// Type definitions for airbnb-prop-types 2.13 // Project: https://github.com/airbnb/prop-types // Definitions by: Miles Johnson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 import * as PropTypes from 'prop-types'; export interface ReactComponentLike { setState(...args: any[]): any; forceUpdate(...args: any[]): any; render(): PropTypes.ReactNodeLike; props: any; state: any; context: any; refs: any; } export interface ReactClassComponentLike { new (...args: any[]): ReactComponentLike; } export type ReactFunctionComponentLike = (...args: any[]) => PropTypes.ReactNodeLike; export type ReactTypeLike = string | ReactClassComponentLike | ReactFunctionComponentLike; export interface ReactRefLike { readonly current: T | null; } export type ReactLegacyRefLike = ((instance: T | null) => void) | ReactRefLike; export interface Specifier { max?: number; min?: number; validator: PropTypes.Validator; } export function and( propTypes: [PropTypes.Validator], name?: string, ): PropTypes.Requireable; export function and( propTypes: [PropTypes.Validator, PropTypes.Validator], name?: string, ): PropTypes.Requireable; export function and( propTypes: [PropTypes.Validator, PropTypes.Validator, PropTypes.Validator], name?: string, ): PropTypes.Requireable; export function and( propTypes: Array>, name?: string, ): PropTypes.Requireable; export function between(options: { lt?: number; lte?: number; gt?: number; gte?: number; }): PropTypes.Requireable; export function booleanSome(...props: string[]): PropTypes.Requireable; export function childrenHavePropXorChildren( prop: string | symbol, ): PropTypes.Requireable; export function childrenOf( propType: PropTypes.Validator

, ): PropTypes.Requireable; export function childrenOfType( ...types: ReactTypeLike[] ): PropTypes.Requireable; export function childrenSequenceOf( ...specifiers: Specifier[] ): PropTypes.Requireable; export function componentWithName( name: string | RegExp, options?: { stripHOCs: ReadonlyArray }, ): PropTypes.Requireable; export function disallowedIf( propType: PropTypes.Requireable, otherPropName: string, otherPropType: PropTypes.Validator, ): PropTypes.Requireable; export function elementType( type: ReactTypeLike, ): PropTypes.Requireable; export function explicitNull(): PropTypes.Requireable; export function forbidExtraProps( propTypes: PropTypes.ValidationMap, ): PropTypes.ValidationMap; export function integer(): PropTypes.Requireable; export function keysOf( propType: PropTypes.Validator

, name?: string, ): PropTypes.Requireable; export function mutuallyExclusiveProps( propType: PropTypes.Requireable, ...propNames: string[] ): PropTypes.Requireable; export function mutuallyExclusiveProps( // tslint:disable-next-line:unified-signatures propType: PropTypes.Validator, ...propNames: string[] ): PropTypes.Requireable; export function mutuallyExclusiveTrueProps(...propNames: string[]): PropTypes.Requireable; export function nChildren( n: number, propType?: PropTypes.Validator

, ): PropTypes.Requireable; export const nonNegativeInteger: PropTypes.Requireable; export function nonNegativeNumber(): PropTypes.Requireable; export function numericString(): PropTypes.Requireable; export function object(): PropTypes.Requireable; export function or(propTypes: [PropTypes.Validator], name?: string): PropTypes.Requireable; export function or( propTypes: [PropTypes.Validator, PropTypes.Validator], name?: string, ): PropTypes.Requireable; export function or( propTypes: [PropTypes.Validator, PropTypes.Validator, PropTypes.Validator], name?: string, ): PropTypes.Requireable; export function or( propTypes: Array>, name?: string, ): PropTypes.Requireable; export function or( // tslint:disable-next-line:unified-signatures propTypes: Array>, name?: string, ): PropTypes.Requireable; export function range(min?: number, max?: number): PropTypes.Requireable; export function range(min?: number, max?: number): PropTypes.Requireable; export function ref(): PropTypes.Requireable>; export function requiredBy

( requiredByPropName: string, propType: PropTypes.Validator

, defaultValue?: any, ): PropTypes.Requireable

; export function restrictedProp( messageFunction?: ( props: object, propName: string, componentName: string, location: string, propFullName: string, ) => string | Error | undefined, ): PropTypes.Requireable; export function sequenceOf(...specifiers: Specifier[]): PropTypes.Requireable; export function shape( propTypes: PropTypes.ValidationMap, ): PropTypes.Requireable; export function stringStartsWith(string: string): PropTypes.Requireable; export function uniqueArray(): PropTypes.Requireable; export function uniqueArrayOf( propType: PropTypes.Validator

, mapperOrName: ((value: any) => any) | string, name?: string, ): PropTypes.Requireable; export function valuesOf( propType: PropTypes.Validator, ): PropTypes.Requireable<{ [key: string]: T }>; export function withShape( propType: PropTypes.Validator

, propTypes: PropTypes.ValidationMap, ): PropTypes.Requireable;