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

    Interface CallableFunction

    表示可调用的函数。

    Represents a callable function.

    interface CallableFunction {
        arguments: any;
        caller: Function;
        length: number;
        name: string;
        prototype: any;
        "[hasInstance]"(value: any): boolean;
        "[hasInstance]"(value: any): boolean;
        apply<T, R>(this: (this: T) => R, thisArg: T): R;
        apply<T, A extends any[], R>(
            this: (this: T, ...args: A) => R,
            thisArg: T,
            args: A,
        ): R;
        apply<T, R>(this: (this: T) => R, thisArg: T, args?: undefined): R;
        apply<T, A extends any[], R>(
            this: (this: T, ...args: A) => R,
            thisArg: T,
            args: A,
        ): R;
        bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;
        bind<T, A extends any[], B extends any[], R>(
            this: (this: T, ...args: [...A[], ...B[]]) => R,
            thisArg: T,
            ...args: A,
        ): (...args: B) => R;
        bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;
        bind<T, A0, A extends any[], R>(
            this: (this: T, arg0: A0, ...args: A) => R,
            thisArg: T,
            arg0: A0,
        ): (...args: A) => R;
        bind<T, A0, A1, A extends any[], R>(
            this: (this: T, arg0: A0, arg1: A1, ...args: A) => R,
            thisArg: T,
            arg0: A0,
            arg1: A1,
        ): (...args: A) => R;
        bind<T, A0, A1, A2, A extends any[], R>(
            this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R,
            thisArg: T,
            arg0: A0,
            arg1: A1,
            arg2: A2,
        ): (...args: A) => R;
        bind<T, A0, A1, A2, A3, A extends any[], R>(
            this: (
                this: T,
                arg0: A0,
                arg1: A1,
                arg2: A2,
                arg3: A3,
                ...args: A,
            ) => R,
            thisArg: T,
            arg0: A0,
            arg1: A1,
            arg2: A2,
            arg3: A3,
        ): (...args: A) => R;
        bind<T, AX, R>(
            this: (this: T, ...args: AX[]) => R,
            thisArg: T,
            ...args: AX[],
        ): (...args: AX[]) => R;
        call<T, A extends any[], R>(
            this: (this: T, ...args: A) => R,
            thisArg: T,
            ...args: A,
        ): R;
        call<T, A extends any[], R>(
            this: (this: T, ...args: A) => R,
            thisArg: T,
            ...args: A,
        ): R;
        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
      • R

      Parameters

      • this: (this: T) => R
      • thisArg: T

        The object to be used as the this object.

      Returns R

    • 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[]
      • R

      Parameters

      • this: (this: T, ...args: A) => R
      • 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 R

    • Type Parameters

      • T
      • R

      Parameters

      • this: (this: T) => R
      • thisArg: T
      • Optionalargs: undefined

      Returns R

      使用指定的对象作为 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.

    • Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.

      Type Parameters

      • T
      • A extends any[]
      • R

      Parameters

      • this: (this: T, ...args: A) => R
      • thisArg: T

        The object to be used as the this object.

      • args: A

      Returns R

    • 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: ThisParameterType<T>

        The object to be used as the this object.

      Returns OmitThisParameter<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

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

      Parameters

      • this: (this: T, ...args: [...A[], ...B[]]) => R
      • thisArg: T

        The object to be used as the this object.

      • ...args: A

        Arguments to bind to the parameters of the function.

      Returns (...args: B) => R

    • Type Parameters

      • T

      Parameters

      • this: T
      • thisArg: ThisParameterType<T>

      Returns OmitThisParameter<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

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

      Parameters

      • this: (this: T, arg0: A0, ...args: A) => R
      • thisArg: T
      • arg0: A0

      Returns (...args: A) => R

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

      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

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

      Parameters

      • this: (this: T, arg0: A0, arg1: A1, ...args: A) => R
      • thisArg: T
      • arg0: A0
      • arg1: A1

      Returns (...args: A) => R

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

      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

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

      Parameters

      • this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R
      • thisArg: T
      • arg0: A0
      • arg1: A1
      • arg2: A2

      Returns (...args: A) => R

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

      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

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

      Parameters

      • this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R
      • thisArg: T
      • arg0: A0
      • arg1: A1
      • arg2: A2
      • arg3: A3

      Returns (...args: A) => R

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

      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

      • T
      • AX
      • R

      Parameters

      • this: (this: T, ...args: AX[]) => R
      • thisArg: T
      • ...args: AX[]

      Returns (...args: AX[]) => R

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

      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[]
      • R

      Parameters

      • this: (this: T, ...args: A) => R
      • thisArg: T

        The object to be used as the this object.

      • ...args: A

        Argument values to be passed to the function.

      Returns R

    • Type Parameters

      • T
      • A extends any[]
      • R

      Parameters

      • this: (this: T, ...args: A) => R
      • thisArg: T
      • ...args: A

      Returns R

      使用指定的对象作为 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.