import { Validator } from 'prop-types'; /** * --- * category: utilities/PropTypes * --- * Given a validator function, extends the validator functionality to also * ensure that the prop has been provided if `.isRequired` is specified. * * ```js-code * function validator (props, propName, componentName) { * const propValue = props[propName] * if (propValue === 'purple') { * return new Error(`Purple is not accepted in ${componentName}!`) * } * } * * validator.isRequired = makeRequirable(validator) * ``` * @module makeRequirable * @param {function} validator - a validator function * @returns {function} A function that returns Error if designated prop is not provided */ declare function makeRequirable(validator: Validator): (props: Record, propName: string, componentName: string, location?: string, propFullName?: string) => Error | null; export default makeRequirable; export { makeRequirable }; //# sourceMappingURL=makeRequirable.d.ts.map