神岛 API 文档 - ArenaPro版
    Preparing search index...

    Interface NewableFunction

    表示可使用 new 运算符调用的函数。

    Represents a function that can be called with the new operator.

    interface NewableFunction {
        arguments: any;
        caller: Function;
        length: number;
        name: string;
        prototype: any;
        "[hasInstance]"(value: any): boolean;
        "[hasInstance]"(value: any): boolean;
        apply<T>(this: Object, thisArg: T): void;
        apply<T, A extends any[]>(this: Object, thisArg: T, args: A): void;
        apply<T>(this: Object, thisArg: T): void;
        apply<T, A extends any[]>(this: Object, thisArg: T, args: A): void;
        bind<T>(this: T, thisArg: any): T;
        bind<A extends any[], B extends any[], R>(
            this: Object,
            thisArg: any,
            ...args: A,
        ): Object;
        bind<T>(this: T, thisArg: any): T;
        bind<A0, A extends any[], R>(this: Object, thisArg: any, arg0: A0): Object;
        bind<A0, A1, A extends any[], R>(
            this: Object,
            thisArg: any,
            arg0: A0,
            arg1: A1,
        ): Object;
        bind<A0, A1, A2, A extends any[], R>(
            this: Object,
            thisArg: any,
            arg0: A0,
            arg1: A1,
            arg2: A2,
        ): Object;
        bind<A0, A1, A2, A3, A extends any[], R>(
            this: Object,
            thisArg: any,
            arg0: A0,
            arg1: A1,
            arg2: A2,
            arg3: A3,
        ): Object;
        bind<AX, R>(this: Object, thisArg: any, ...args: AX[]): Object;
        call<T, A extends any[]>(this: Object, thisArg: T, ...args: A): void;
        call<T, A extends any[]>(this: Object, thisArg: T, ...args: A): void;
        toString(): string;
        toString(): string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    arguments: any

    传递给函数的参数。

    The arguments passed to a function. @non-standard

    caller: Function

    调用当前函数的函数。

    The function that invoked the current function. @non-standard

    length: number

    函数期望的参数个数。

    The number of arguments expected by the function.

    name: string

    Returns the name of the function. Function names are read-only and can not be changed.

    prototype: any

    函数的原型。

    The prototype of a function.

    Methods

    • Determines whether the given value inherits from this function if this function was used as a constructor function.

      A constructor function can control which objects are recognized as its instances by 'instanceof' by overriding this method.

      Parameters

      • value: any

      Returns boolean

    • Parameters

      • value: any

      Returns boolean

      如果此函数用作构造函数,则确定给定值是否继承自此函数。

      Determines whether the given value inherits from this function if this function was used as a constructor function.

      构造函数可以通过重写此方法来控制哪些对象被 'instanceof' 识别为其-实例。

      A constructor function can control which objects are recognized as its instances by 'instanceof' by overriding this method.

    • Calls the function with the specified object as the this value and the elements of specified array as the arguments.

      Type Parameters

      • T

      Parameters

      • this: Object
      • thisArg: T

        The object to be used as the this object.

      Returns void

    • Calls the function with the specified object as the this value and the elements of specified array as the arguments.

      Type Parameters

      • T
      • A extends any[]

      Parameters

      • this: Object
      • thisArg: T

        The object to be used as the this object.

      • args: A

        An array of argument values to be passed to the function.

      Returns void

    • Type Parameters

      • T

      Parameters

      • this: Object
      • thisArg: T

      Returns void

      使用指定的对象作为 this 值,并将指定数组的元素作为参数来调用函数。

      Calls the function with the specified object as the this value and the elements of specified array as the arguments.

      将用作 this 对象的对象。

      The object to be used as the this object.

      要传递给函数的参数值数组。

      An array of argument values to be passed to the function.

    • Type Parameters

      • T
      • A extends any[]

      Parameters

      • this: Object
      • thisArg: T
      • args: A

      Returns void

      使用指定的对象作为 this 值,并将指定数组的元素作为参数来调用函数。

      Calls the function with the specified object as the this value and the elements of specified array as the arguments.

      将用作 this 对象的对象。

      The object to be used as the this object.

      要传递给函数的参数值数组。

      An array of argument values to be passed to the function.

    • For a given function, creates a bound function that has the same body as the original function. The this object of the bound function is associated with the specified object, and has the specified initial parameters.

      Type Parameters

      • T

      Parameters

      • this: T
      • thisArg: any

        The object to be used as the this object.

      Returns T

    • For a given function, creates a bound function that has the same body as the original function. The this object of the bound function is associated with the specified object, and has the specified initial parameters.

      Type Parameters

      • A extends any[]
      • B extends any[]
      • R

      Parameters

      • this: Object
      • thisArg: any

        The object to be used as the this object.

      • ...args: A

        Arguments to bind to the parameters of the function.

      Returns Object

    • Type Parameters

      • T

      Parameters

      • this: T
      • thisArg: any

      Returns T

      对于给定的函数,创建一个绑定函数,其主体与原始函数相同。

      For a given function, creates a bound function that has the same body as the original function.

      绑定函数的 this 对象与指定的对象相关联,并具有指定的初始参数。

      The this object of the bound function is associated with the specified object, and has the specified initial parameters.

      将用作 this 对象的对象。

      The object to be used as the this object.

      要绑定到函数参数的参数。

      Arguments to bind to the parameters of the function.

    • Type Parameters

      • A0
      • A extends any[]
      • R

      Parameters

      • this: Object
      • thisArg: any
      • arg0: A0

      Returns Object

      对于给定的函数,创建一个绑定函数,其主体与原始函数相同。

      For a given function, creates a bound function that has the same body as the original function.

      绑定函数的 this 对象与指定的对象相关联,并具有指定的初始参数。

      The this object of the bound function is associated with the specified object, and has the specified initial parameters.

      将用作 this 对象的对象。

      The object to be used as the this object.

      要绑定到函数参数的参数。

      Arguments to bind to the parameters of the function.

    • Type Parameters

      • A0
      • A1
      • A extends any[]
      • R

      Parameters

      • this: Object
      • thisArg: any
      • arg0: A0
      • arg1: A1

      Returns Object

      对于给定的函数,创建一个绑定函数,其主体与原始函数相同。

      For a given function, creates a bound function that has the same body as the original function.

      绑定函数的 this 对象与指定的对象相关联,并具有指定的初始参数。

      The this object of the bound function is associated with the specified object, and has the specified initial parameters.

      将用作 this 对象的对象。

      The object to be used as the this object.

      要绑定到函数参数的参数。

      Arguments to bind to the parameters of the function.

    • Type Parameters

      • A0
      • A1
      • A2
      • A extends any[]
      • R

      Parameters

      • this: Object
      • thisArg: any
      • arg0: A0
      • arg1: A1
      • arg2: A2

      Returns Object

      对于给定的函数,创建一个绑定函数,其主体与原始函数相同。

      For a given function, creates a bound function that has the same body as the original function.

      绑定函数的 this 对象与指定的对象相关联,并具有指定的初始参数。

      The this object of the bound function is associated with the specified object, and has the specified initial parameters.

      将用作 this 对象的对象。

      The object to be used as the this object.

      要绑定到函数参数的参数。

      Arguments to bind to the parameters of the function.

    • Type Parameters

      • A0
      • A1
      • A2
      • A3
      • A extends any[]
      • R

      Parameters

      • this: Object
      • thisArg: any
      • arg0: A0
      • arg1: A1
      • arg2: A2
      • arg3: A3

      Returns Object

      对于给定的函数,创建一个绑定函数,其主体与原始函数相同。

      For a given function, creates a bound function that has the same body as the original function.

      绑定函数的 this 对象与指定的对象相关联,并具有指定的初始参数。

      The this object of the bound function is associated with the specified object, and has the specified initial parameters.

      将用作 this 对象的对象。

      The object to be used as the this object.

      要绑定到函数参数的参数。

      Arguments to bind to the parameters of the function.

    • Type Parameters

      • AX
      • R

      Parameters

      • this: Object
      • thisArg: any
      • ...args: AX[]

      Returns Object

      对于给定的函数,创建一个绑定函数,其主体与原始函数相同。

      For a given function, creates a bound function that has the same body as the original function.

      绑定函数的 this 对象与指定的对象相关联,并具有指定的初始参数。

      The this object of the bound function is associated with the specified object, and has the specified initial parameters.

      将用作 this 对象的对象。

      The object to be used as the this object.

      要绑定到函数参数的参数。

      Arguments to bind to the parameters of the function.

    • Calls the function with the specified object as the this value and the specified rest arguments as the arguments.

      Type Parameters

      • T
      • A extends any[]

      Parameters

      • this: Object
      • thisArg: T

        The object to be used as the this object.

      • ...args: A

        Argument values to be passed to the function.

      Returns void

    • Type Parameters

      • T
      • A extends any[]

      Parameters

      • this: Object
      • thisArg: T
      • ...args: A

      Returns void

      使用指定的对象作为 this 值,并使用指定的 rest 参数作为参数来调用函数。

      Calls the function with the specified object as the this value and the specified rest arguments as the arguments.

      将用作 this 对象的对象。

      The object to be used as the this object.

      要传递给函数的参数值。

      Argument values to be passed to the function.

    • Returns a string representation of a function.

      Returns string

    • Returns string

      返回函数的字符串表示形式。

      Returns a string representation of a function.