.vscode/typings/react-native/react-native.d.ts

(开头部分) 118KB

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

// Type definitions for react-native 0.14
// Project: https://github.com/facebook/react-native
// Definitions by: Bruno Grieder <https://github.com/bgrieder>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// USING: these definitions are meant to be used with the TSC compiler target set to ES6
//
// USAGE EXAMPLES: check the RNTSExplorer project at https://github.com/bgrieder/RNTSExplorer
//
// CONTRIBUTING: please open pull requests and make sure that the changes do not break RNTSExplorer (they should not)
// Do not hesitate to open a pull request against RNTSExplorer to provide an example for a case not covered by the current App
//
// CREDITS: This work is based on an original work made by Bernd Paradies: https://github.com/bparadie
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// <reference path="../react/react.d.ts" />

//so we know what is "original" React
import React = __React;

//react-native "extends" react
declare namespace  __React {


    /**
     * Represents the completion of an asynchronous operation
     * @see lib.es6.d.ts
     */
    export interface Promise<T> {
        /**
         * Attaches callbacks for the resolution and/or rejection of the Promise.
         * @param onfulfilled The callback to execute when the Promise is resolved.
         * @param onrejected The callback to execute when the Promise is rejected.
         * @returns A Promise for the completion of which ever callback is executed.
         */
        then<TResult>( onfulfilled?: ( value: T ) => TResult | Promise<TResult>, onrejected?: ( reason: any ) => TResult | Promise<TResult> ): Promise<TResult>;

        /**
         * Attaches a callback for only the rejection of the Promise.
         * @param onrejected The callback to execute when the Promise is rejected.
         * @returns A Promise for the completion of the callback.
         */
        catch( onrejected?: ( reason: any ) => T | Promise<T> ): Promise<T>;


        // not in lib.es6.d.ts but called by react-native
        done( callback?: ( value: T ) => void ): void;
    }

    export interface PromiseConstructor {
        /**
         * A reference to the prototype.
         */
        prototype: Promise<any>;

        /**
         * Creates a new Promise.
后面还有 3420 行代码,购买后查看完整代码

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

AI 解读

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

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