JSPM

@types/hoist-non-react-statics

3.3.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10724262
  • Score
    100M100P100Q254398F
  • License MIT

TypeScript definitions for hoist-non-react-statics

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/hoist-non-react-statics) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Installation

    npm install --save @types/hoist-non-react-statics

    Summary

    This package contains type definitions for hoist-non-react-statics (https://github.com/mridgway/hoist-non-react-statics#readme).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hoist-non-react-statics.

    index.d.ts

    import * as React from "react";
    
    interface REACT_STATICS {
        childContextTypes: true;
        contextType: true;
        contextTypes: true;
        defaultProps: true;
        displayName: true;
        getDefaultProps: true;
        getDerivedStateFromError: true;
        getDerivedStateFromProps: true;
        mixins: true;
        propTypes: true;
        type: true;
    }
    
    interface KNOWN_STATICS {
        name: true;
        length: true;
        prototype: true;
        caller: true;
        callee: true;
        arguments: true;
        arity: true;
    }
    
    interface MEMO_STATICS {
        "$$typeof": true;
        compare: true;
        defaultProps: true;
        displayName: true;
        propTypes: true;
        type: true;
    }
    
    interface FORWARD_REF_STATICS {
        "$$typeof": true;
        render: true;
        defaultProps: true;
        displayName: true;
        propTypes: true;
    }
    
    declare namespace hoistNonReactStatics {
        type NonReactStatics<
            Source,
            C extends {
                [key: string]: true;
            } = {},
        > = {
            [
                key in Exclude<
                    keyof Source,
                    Source extends React.MemoExoticComponent<any> ? keyof MEMO_STATICS | keyof C
                        : Source extends React.ForwardRefExoticComponent<any> ? keyof FORWARD_REF_STATICS | keyof C
                        : keyof REACT_STATICS | keyof KNOWN_STATICS | keyof C
                >
            ]: Source[key];
        };
    }
    
    declare function hoistNonReactStatics<
        Target,
        Source,
        CustomStatic extends {
            [key: string]: true;
        } = {},
    >(
        TargetComponent: Target,
        SourceComponent: Source,
        customStatic?: CustomStatic,
    ): Target & hoistNonReactStatics.NonReactStatics<Source, CustomStatic>;
    
    export = hoistNonReactStatics;
    

    Additional Details

    Credits

    These definitions were written by JounQin, and James Reggio.