import { Validator } from 'prop-types'; /** * --- * category: utilities/PropTypes * --- * Verify that a prop cannot be given if one or more other props are also * given. * * ```js-code * import { xor } from '@instructure/ui-prop-types' * * class Foo extends Component { * static propTypes = { * decimalPrecision: xor(PropTypes.number, 'significantDigits'), * significantDigits: xor(PropTypes.number, 'decimalPrecision') * } * ... * ``` * * This will throw an error if both the `decimalPrecision` and * `significantDigits` props are provided. * @module xor * @param {function} propType - validates the prop type. Returns null if valid, error otherwise * @param {...string} otherPropNames - reject if any of these other props are also given * @returns {function} A function that returns Error if any of the other props * are also given, null otherwise */ declare function xor(propType: Validator, ...otherPropNames: string[]): (props: Record, propName: string, componentName: string) => Error | null; export default xor; export { xor }; //# sourceMappingURL=xor.d.ts.map