// Type definitions for react-is-deprecated v0.1.2 // Project: https://github.com/Aweary/react-is-deprecated // Definitions by: Sean Kelley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 declare module 'react-is-deprecated' { import { Validator, Requireable, ValidationMap, ReactPropTypes } from 'react'; export function deprecate(validator: Validator, message: string): Validator; interface Deprecatable { isDeprecated: (message: string) => Validator; } // Unfortunately this copy-paste must happen -- I can't just take PropTypes and programmatically // define a version that intersects in the Deprecatable interface into the keys. interface DeprecatablePropTypes { any: Requireable & Deprecatable; array: Requireable & Deprecatable; bool: Requireable & Deprecatable; func: Requireable & Deprecatable; number: Requireable & Deprecatable; object: Requireable & Deprecatable; string: Requireable & Deprecatable; node: Requireable & Deprecatable; element: Requireable & Deprecatable; instanceOf(expectedClass: {}): Requireable & Deprecatable; oneOf(types: any[]): Requireable & Deprecatable; oneOfType(types: Validator[]): Requireable & Deprecatable; arrayOf(type: Validator): Requireable & Deprecatable; objectOf(type: Validator): Requireable & Deprecatable; shape(type: ValidationMap): Requireable & Deprecatable; } export function addIsDeprecated(propTypes: ReactPropTypes): DeprecatablePropTypes; }