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

    Interface NewableFunction

    Creates a new function.

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

    Hierarchy (View Summary)

    Index

    Properties

    arguments: any
    caller: Function
    length: number
    name: string

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

    prototype: any

    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

    • 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

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

    • 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: new () => T
      • thisArg: T

        The object to be used as the this object.

      Returns void

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

      Parameters

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

        The object to be used as the this object.

      • args: A

      Returns void

    • 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: new (...args: [...A[], ...B[]]) => R
      • thisArg: any

        The object to be used as the this object.

      • ...args: A

        Arguments to bind to the parameters of the function.

      Returns new (...args: B) => 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: 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

      • A0
      • A extends any[]
      • R

      Parameters

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

        An object to which the this keyword can refer inside the new function.

      • arg0: A0

      Returns new (...args: A) => 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

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

      Parameters

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

        An object to which the this keyword can refer inside the new function.

      • arg0: A0
      • arg1: A1

      Returns new (...args: A) => 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

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

      Parameters

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

        An object to which the this keyword can refer inside the new function.

      • arg0: A0
      • arg1: A1
      • arg2: A2

      Returns new (...args: A) => 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

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

      Parameters

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

        An object to which the this keyword can refer inside the new function.

      • arg0: A0
      • arg1: A1
      • arg2: A2
      • arg3: A3

      Returns new (...args: A) => 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

      • AX
      • R

      Parameters

      • this: new (...args: AX[]) => R
      • thisArg: any

        An object to which the this keyword can refer inside the new function.

      • ...args: AX[]

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

    • 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: new (...args: A) => T
      • thisArg: T

        The object to be used as the this object.

      • ...args: A

        Argument values to be passed to the function.

      Returns void

    • 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: new (...args: A) => T
      • thisArg: T

        The object to be used as the this object.

      • ...args: A

        Argument values to be passed to the function.

      Returns void

    • Returns a string representation of a function.

      Returns string

    • Returns a string representation of a function.

      Returns string