Function getTypedArray

  • Create a typed array from an ArrayBuffer by name

    Parameters

    • type:
          | "Uint8Array"
          | "Int8Array"
          | "Uint8ClampedArray"
          | "Int16Array"
          | "Uint16Array"
          | "Int32Array"
          | "Uint32Array"
          | "Float32Array"
          | "Float64Array"

      Name of the typed array constructor

    • buffer: ArrayBuffer

      ArrayBuffer to use

    Returns
        | Uint8Array<ArrayBuffer>
        | Int8Array<ArrayBuffer>
        | Uint8ClampedArray<ArrayBuffer>
        | Int16Array<ArrayBuffer>
        | Uint16Array<ArrayBuffer>
        | Int32Array<ArrayBuffer>
        | Uint32Array<ArrayBuffer>
        | Float32Array<ArrayBuffer>
        | Float64Array<ArrayBuffer>