UNPKG

1.43 kBTypeScriptView Raw
1export type GetInteractionOptions = {
2 props?: {
3 interaction?: InteractionType | null;
4 disabled?: boolean | null;
5 readOnly?: boolean | null;
6 [key: string]: any;
7 };
8 interactionTypes?: InteractionType[];
9};
10export type InteractionType = 'enabled' | 'disabled' | 'readonly';
11/**
12 * ---
13 * category: utilities/react
14 * ---
15 * Parse the component props for the interaction type. It will return one of 'enabled', 'disabled', or 'readonly'.
16 * This is useful for form elements where consumers are able to either use the interaction prop as specified or the
17 * native html disabled or readonly attributes
18 * @module getInteraction
19 * @param {Object} args
20 * @param {Object} args.props - the component props
21 * @param {string} args.props.interaction - specifies the interaction mode, one of 'enabled', 'disabled', or 'readonly'
22 * @param {boolean} args.props.disabled - specifies if the component is disabled. Will take precedence over readOnly
23 * @param {boolean} args.props.readOnly - specifies if the component is readonly
24 * @param {Array} args.interactionTypes - an array specifying the interaction types available to the component, ['disabled', 'readonly'] by default
25 * @returns {String} one of 'enabled', 'disabled', or 'readonly'
26 */
27export declare function getInteraction({ props, interactionTypes }?: GetInteractionOptions): InteractionType;
28//# sourceMappingURL=getInteraction.d.ts.map
\No newline at end of file