Interface Uint8ArrayConstructor

    interface Uint8ArrayConstructor {
        new Uint8ArrayConstructor(length: number): Uint8Array<ArrayBuffer>;
        new Uint8ArrayConstructor(
            array: ArrayLike<number>,
        ): Uint8Array<ArrayBuffer>;
        new Uint8ArrayConstructor<
            TArrayBuffer extends ArrayBufferLike = ArrayBuffer,
        >(
            buffer: TArrayBuffer,
            byteOffset?: number,
            length?: number,
        ): Uint8Array<TArrayBuffer>;
        new Uint8ArrayConstructor(
            array: ArrayBuffer | ArrayLike<number>,
        ): Uint8Array<ArrayBuffer>;
        new Uint8ArrayConstructor(
            elements: Iterable<number>,
        ): Uint8Array<ArrayBuffer>;
        new Uint8ArrayConstructor(): Uint8Array<ArrayBuffer>;
        BYTES_PER_ELEMENT: number;
        prototype: Uint8Array;
        from(arrayLike: ArrayLike<number>): Uint8Array<ArrayBuffer>;
        from<T>(
            arrayLike: ArrayLike<T>,
            mapfn: (v: T, k: number) => number,
            thisArg?: any,
        ): Uint8Array<ArrayBuffer>;
        from(arrayLike: Iterable<number>): Uint8Array<ArrayBuffer>;
        from<T>(
            arrayLike: Iterable<T>,
            mapfn?: (v: T, k: number) => number,
            thisArg?: any,
        ): Uint8Array<ArrayBuffer>;
        of(...items: number[]): Uint8Array<ArrayBuffer>;
    }

    Constructors

    Properties

    Methods

    Constructors

    Properties

    BYTES_PER_ELEMENT: number

    The size in bytes of each element in the array.

    prototype: Uint8Array

    Methods

    • Creates an array from an array-like or iterable object.

      Parameters

      • arrayLike: ArrayLike<number>

        An array-like or iterable object to convert to an array.

      Returns Uint8Array<ArrayBuffer>

    • Creates an array from an array-like or iterable object.

      Type Parameters

      • T

      Parameters

      • arrayLike: ArrayLike<T>

        An array-like or iterable object to convert to an array.

      • mapfn: (v: T, k: number) => number

        A mapping function to call on every element of the array.

      • OptionalthisArg: any

        Value of 'this' used to invoke the mapfn.

      Returns Uint8Array<ArrayBuffer>

    • Creates an array from an array-like or iterable object.

      Parameters

      • arrayLike: Iterable<number>

        An array-like or iterable object to convert to an array.

      Returns Uint8Array<ArrayBuffer>

    • Creates an array from an array-like or iterable object.

      Type Parameters

      • T

      Parameters

      • arrayLike: Iterable<T>

        An array-like or iterable object to convert to an array.

      • Optionalmapfn: (v: T, k: number) => number

        A mapping function to call on every element of the array.

      • OptionalthisArg: any

        Value of 'this' used to invoke the mapfn.

      Returns Uint8Array<ArrayBuffer>