@types/react-is-deprecated
TypeScript icon, indicating that this package has built-in type declarations

0.1.14 • Public • Published

Installation

npm install --save @types/react-is-deprecated

Summary

This package contains type definitions for react-is-deprecated (https://github.com/Aweary/react-is-deprecated).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-is-deprecated.

declare module "react-is-deprecated" {
    import type * as PropTypes from "prop-types";

    interface PropTypesValidators {
        any: typeof PropTypes.any;
        array: typeof PropTypes.array;
        bool: typeof PropTypes.bool;
        func: typeof PropTypes.func;
        number: typeof PropTypes.number;
        object: typeof PropTypes.object;
        string: typeof PropTypes.string;
        node: typeof PropTypes.node;
        element: typeof PropTypes.element;
        instanceOf: typeof PropTypes.instanceOf;
        oneOf: typeof PropTypes.oneOf;
        oneOfType: typeof PropTypes.oneOfType;
        arrayOf: typeof PropTypes.arrayOf;
        objectOf: typeof PropTypes.objectOf;
        shape: typeof PropTypes.shape;
        exact: typeof PropTypes.exact;
    }

    export function deprecate<T>(validator: PropTypes.Validator<T>, message: string): PropTypes.Validator<T>;

    interface Deprecatable<T> {
        isDeprecated: (message: string) => PropTypes.Validator<T>;
    }

    // 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: PropTypes.Requireable<any> & Deprecatable<any>;
        array: PropTypes.Requireable<any> & Deprecatable<any>;
        bool: PropTypes.Requireable<any> & Deprecatable<any>;
        func: PropTypes.Requireable<any> & Deprecatable<any>;
        number: PropTypes.Requireable<any> & Deprecatable<any>;
        object: PropTypes.Requireable<any> & Deprecatable<any>;
        string: PropTypes.Requireable<any> & Deprecatable<any>;
        node: PropTypes.Requireable<any> & Deprecatable<any>;
        element: PropTypes.Requireable<any> & Deprecatable<any>;
        instanceOf(expectedClass: {}): PropTypes.Requireable<any> & Deprecatable<any>;
        oneOf(types: any[]): PropTypes.Requireable<any> & Deprecatable<any>;
        oneOfType(types: Array<PropTypes.Validator<any>>): PropTypes.Requireable<any> & Deprecatable<any>;
        arrayOf(type: PropTypes.Validator<any>): PropTypes.Requireable<any> & Deprecatable<any>;
        objectOf(type: PropTypes.Validator<any>): PropTypes.Requireable<any> & Deprecatable<any>;
        shape(type: PropTypes.ValidationMap<any>): PropTypes.Requireable<any> & Deprecatable<any>;
    }

    export function addIsDeprecated(propTypes: PropTypesValidators): DeprecatablePropTypes;
}

Additional Details

Credits

These definitions were written by Sean Kelley.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-is-deprecated

Weekly Downloads

21

Version

0.1.14

License

MIT

Unpacked Size

7.65 kB

Total Files

5

Last publish

Collaborators

  • types