Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// $ExpectType ValidationMap
AirbnbPropTypes.forbidExtraProps({
foo: PropTypes.string.isRequired,
bar: PropTypes.number.isRequired,
baz: PropTypes.bool,
});
// $ExpectType Requireable
AirbnbPropTypes.integer();
const top = ((x?: T): T => x!)();
type Top = typeof top;
declare function validateRequireableTop(x: React.Requireable): void;
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.number));
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.number, 'foo'));
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.oneOf(['foo', 'bar'])));
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number);
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number, 'foo');
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.string, 'foo', 'bar');
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveTrueProps('foo');
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveTrueProps('foo', 'bar');
// $ExpectType Requireable
AirbnbPropTypes.nChildren(1, PropTypes.number);
// $ExpectType ValidationMap
AirbnbPropTypes.forbidExtraProps({
foo: PropTypes.string.isRequired,
bar: PropTypes.number.isRequired,
baz: PropTypes.bool,
});
// $ExpectType Requireable
AirbnbPropTypes.integer();
const top = ((x?: T): T => x!)();
type Top = typeof top;
declare function validateRequireableTop(x: React.Requireable): void;
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.number));
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.number, 'foo'));
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.oneOf(['foo', 'bar'])));
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number);
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number, 'foo');
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.string, 'foo', 'bar');
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveTrueProps('foo');
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveTrueProps('foo', 'bar');
// $ExpectType Requireable
AirbnbPropTypes.forbidExtraProps({
foo: PropTypes.string.isRequired,
bar: PropTypes.number.isRequired,
baz: PropTypes.bool,
});
// $ExpectType Requireable
AirbnbPropTypes.integer();
const top = ((x?: T): T => x!)();
type Top = typeof top;
declare function validateRequireableTop(x: React.Requireable): void;
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.number));
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.number, 'foo'));
validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.oneOf(['foo', 'bar'])));
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number);
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number, 'foo');
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.string, 'foo', 'bar');
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveTrueProps('foo');
// $ExpectType Requireable
AirbnbPropTypes.mutuallyExclusiveTrueProps('foo', 'bar');
// $ExpectType Requireable
AirbnbPropTypes.nChildren(1, PropTypes.number);
// $ExpectType Requireable