// $ExpectType Requireable<number>
AirbnbPropTypes.range(0, 10);
// $ExpectType Requireable<5>
AirbnbPropTypes.range<5>(0, 10);

// $ExpectType Requireable<string | null>
AirbnbPropTypes.requiredBy('foo', PropTypes.string);
// $ExpectType Validator<number>
AirbnbPropTypes.requiredBy('bar', PropTypes.number, 42).isRequired;

validateRequireableTop(AirbnbPropTypes.restrictedProp());
validateRequireableTop(AirbnbPropTypes.restrictedProp(() => 'Error'));
validateRequireableTop(AirbnbPropTypes.restrictedProp(() => new Error('Error')));

validateRequireableTop(AirbnbPropTypes.sequenceOf({ validator: PropTypes.number }));
validateRequireableTop(AirbnbPropTypes.sequenceOf({ validator: PropTypes.number }, { validator: PropTypes.string }));
validateRequireableTop(AirbnbPropTypes.sequenceOf(
    { validator: PropTypes.number, min: 0, max: 10 },
    { validator: PropTypes.string },
    { validator: PropTypes.bool },
));

interface ShapeShape {
    foo: string;
    bar?: number | null;
}

// $ExpectType Requireable<{ foo: string | null; }>
AirbnbPropTypes.shape({
    foo: PropTypes.string,
AirbnbPropTypes.range<5>(0, 10);

// $ExpectType Requireable<string | null>
AirbnbPropTypes.requiredBy('foo', PropTypes.string);
// $ExpectType Validator<number>
AirbnbPropTypes.requiredBy('bar', PropTypes.number, 42).isRequired;

// $ExpectType Requireable<{}>
AirbnbPropTypes.restrictedProp();
// $ExpectType Requireable<{}>
AirbnbPropTypes.restrictedProp(() => 'Error');
// $ExpectType Requireable<{}>
AirbnbPropTypes.restrictedProp(() => new Error('Error'));

// $ExpectType Requireable<{}>
AirbnbPropTypes.sequenceOf({ validator: PropTypes.number });
// $ExpectType Requireable<{}>
AirbnbPropTypes.sequenceOf({ validator: PropTypes.number }, { validator: PropTypes.string });
// $ExpectType Requireable<{}>
AirbnbPropTypes.sequenceOf(
    { validator: PropTypes.number, min: 0, max: 10 },
    { validator: PropTypes.string },
    { validator: PropTypes.bool },
);

interface ShapeShape {
    foo: string;
    bar?: number | null;
}

// $ExpectType Requireable<{ foo: string | null; }>