UNPKG

@instructure/ui-react-utils

Version:

A React utility library made by Instructure Inc.

35 lines 1.32 kB
export type GetInteractionOptions = { props?: { /** * specifies the interaction mode, one of 'enabled', 'disabled', or 'readonly' */ interaction?: InteractionType | null; /** * specifies if the component is disabled. Will take precedence over readOnly */ disabled?: boolean | null; /** * specifies if the component is readonly */ readOnly?: boolean | null; [key: string]: any; }; /** * an array specifying the interaction types available to the component, ['disabled', 'readonly'] by default */ interactionTypes?: InteractionType[]; }; export type InteractionType = 'enabled' | 'disabled' | 'readonly'; /** * --- * category: utilities/react * --- * Parse the component props for the interaction type. It will return one of 'enabled', 'disabled', or 'readonly'. * This is useful for form elements where consumers are able to either use the interaction prop as specified or the * native html disabled or readonly attributes * @module getInteraction * @param args extra arguments * @returns The calculated interaction type */ export declare function getInteraction({ props, interactionTypes }?: GetInteractionOptions): InteractionType; //# sourceMappingURL=getInteraction.d.ts.map