import { Requireable } from 'prop-types'; type CheckTypeInternal = (props: Record, propName: string, componentName: string, location: string, propFullName: string, // if null it equals propName secret: string) => Error | null; /** * --- * category: utilities/PropTypes * --- * Ensure that a corresponding handler function is provided for the given prop if the * component does not manage its own state. * * ```js-code * import { controllable } from '@instructure/ui-prop-types' * * class Foo extends Component { * static propTypes = { * selected: controllable(PropTypes.bool, 'onSelect', 'defaultSelected'), * onSelect: PropTypes.func, * defaultSelected: PropTypes.bool * } * ... * ``` * * This will throw an error if the 'selected' prop is supplied without a corresponding * 'onSelect' handler and will recommend using 'defaultSelected' instead. * @module controllable * @param {function} checkType - validates the prop type. Returns null if valid, error otherwise * @param {string} handlerName - name of the handler function * @param {string} defaultPropName - name of the default prop * @returns {function} A function that return Error if designated prop is * supplied without a corresponding handler function */ declare function controllable(checkType: CheckTypeInternal & Requireable, handlerName?: string, defaultPropName?: string): (props: Record, propName: string, componentName: string) => Error | null; export default controllable; export { controllable }; //# sourceMappingURL=controllable.d.ts.map