// eslint-disable-next-line @definitelytyped/export-just-namespace export = PropTypes; declare namespace PropTypes { type ReactComponentLike = | string | ((props: any, context?: any) => any) | (new(props: any, context?: any) => any); interface ReactElementLike { type: ReactComponentLike; props: any; key: string | null; } interface ReactNodeArray extends Iterable {} type ReactNodeLike = | ReactElementLike | ReactNodeArray | string | number | boolean | null | undefined; const nominalTypeHack: unique symbol; type IsOptional = undefined extends T ? true : false; type RequiredKeys = { [K in keyof V]-?: Exclude extends Validator ? IsOptional extends true ? never : K : never; }[keyof V]; type OptionalKeys = Exclude>; type InferPropsInner = { [K in keyof V]-?: InferType }; interface Validator { ( props: { [key: string]: any }, propName: string, componentName: string, location: string, propFullName: string, ): Error | null; [nominalTypeHack]?: { type: T; } | undefined; } interface Requireable extends Validator { isRequired: Validator>; } type ValidationMap = { [K in keyof T]?: Validator }; /** * Like {@link ValidationMap} but treats `undefined`, `null` and optional properties the same. * This type is only added as a migration path in React 19 where this type was removed from React. * Runtime and compile time types would mismatch since you could see `undefined` at runtime when your types don't expect this type. */ type WeakValidationMap = { [K in keyof T]?: null extends T[K] ? Validator : undefined extends T[K] ? Validator : Validator; }; type InferType = V extends Validator ? T : any; type InferProps = & InferPropsInner>> & Partial>>>; const any: Requireable; const array: Requireable; const bool: Requireable; const func: Requireable<(...args: any[]) => any>; const number: Requireable; const object: Requireable; const string: Requireable; const node: Requireable; const element: Requireable; const symbol: Requireable; const elementType: Requireable; function instanceOf(expectedClass: new(...args: any[]) => T): Requireable; function oneOf(types: readonly T[]): Requireable; function oneOfType>(types: T[]): Requireable>>; function arrayOf(type: Validator): Requireable; function objectOf(type: Validator): Requireable<{ [K in keyof any]: T }>; function shape

>(type: P): Requireable>; function exact

>(type: P): Requireable>>; /** * Assert that the values match with the type specs. * Error messages are memorized and will only be shown once. * * @param typeSpecs Map of name to a ReactPropType * @param values Runtime values that need to be type-checked * @param location e.g. "prop", "context", "child context" * @param componentName Name of the component for error messages * @param getStack Returns the component stack */ function checkPropTypes( typeSpecs: any, values: any, location: string, componentName: string, getStack?: () => any, ): void; /** * Only available if NODE_ENV=production */ function resetWarningCache(): void; }