.vscode/typings/react/react.d.ts

(开头部分) 89KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

// Type definitions for React v0.14
// Project: http://facebook.github.io/react/
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

declare namespace __React {

    //
    // React Elements
    // ----------------------------------------------------------------------

    type ReactType = string | ComponentClass<any> | StatelessComponent<any>;

    interface ReactElement<P extends Props<any>> {
        type: string | ComponentClass<P> | StatelessComponent<P>;
        props: P;
        key: string | number;
        ref: string | ((component: Component<P, any> | Element) => any);
    }

    interface ClassicElement<P> extends ReactElement<P> {
        type: ClassicComponentClass<P>;
        ref: string | ((component: ClassicComponent<P, any>) => any);
    }

    interface DOMElement<P extends Props<Element>> extends ReactElement<P> {
        type: string;
        ref: string | ((element: Element) => any);
    }

    interface ReactHTMLElement extends DOMElement<HTMLProps<HTMLElement>> {
        ref: string | ((element: HTMLElement) => any);
    }

    interface ReactSVGElement extends DOMElement<SVGProps> {
        ref: string | ((element: SVGElement) => any);
    }

    //
    // Factories
    // ----------------------------------------------------------------------

    interface Factory<P> {
        (props?: P, ...children: ReactNode[]): ReactElement<P>;
    }

    interface ClassicFactory<P> extends Factory<P> {
        (props?: P, ...children: ReactNode[]): ClassicElement<P>;
    }

    interface DOMFactory<P extends Props<Element>> extends Factory<P> {
        (props?: P, ...children: ReactNode[]): DOMElement<P>;
    }

    type HTMLFactory = DOMFactory<HTMLProps<HTMLElement>>;
    type SVGFactory = DOMFactory<SVGProps>;

    //
    // React Nodes
    // http://facebook.github.io/react/docs/glossary.html
后面还有 2214 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。