Module Js_typed_array.Uint8Array

type elt = int;
type typed_array('a) = Js_typed_array2.Uint8Array.typed_array('a);
type t = typed_array(elt);
let unsafe_get: t => int => elt;
let unsafe_set: t => int => elt => unit;
let buffer: t => array_buffer;
let byteLength: t => int;
let byteOffset: t => int;
let setArray: array(elt) => t => unit;
let setArrayOffset: array(elt) => int => t => unit;
let length: t => int;
let copyWithin: to_:int => t => t;
let copyWithinFrom: to_:int => from:int => t => t;
let copyWithinFromRange: to_:int => start:int => end_:int => t => t;
let fillInPlace: elt => t => t;
let fillFromInPlace: elt => from:int => t => t;
let fillRangeInPlace: elt => start:int => end_:int => t => t;
let reverseInPlace: t => t;
let sortInPlace: t => t;
let sortInPlaceWith: Js.Fn.arity2((elt => elt => int)) => t => t;
let includes: elt => t => bool;
let indexOf: elt => t => int;
let indexOfFrom: elt => from:int => t => int;
let join: t => string;
let joinWith: string => t => string;
let lastIndexOf: elt => t => int;
let lastIndexOfFrom: elt => from:int => t => int;
let slice: start:int => end_:int => t => t;

start is inclusive, end_ exclusive

let copy: t => t;
let sliceFrom: int => t => t;
let subarray: start:int => end_:int => t => t;

start is inclusive, end_ exclusive

let subarrayFrom: int => t => t;
let toString: t => string;
let toLocaleString: t => string;
let every: Js.Fn.arity1((elt => bool)) => t => bool;
let everyi: Js.Fn.arity2((elt => int => bool)) => t => bool;
let filter: Js.Fn.arity1((elt => bool)) => t => t;
let filteri: Js.Fn.arity2((elt => int => bool)) => t => t;
let find: Js.Fn.arity1((elt => bool)) => t => Js.undefined(elt);
let findi: Js.Fn.arity2((elt => int => bool)) => t => Js.undefined(elt);
let findIndex: Js.Fn.arity1((elt => bool)) => t => int;
let findIndexi: Js.Fn.arity2((elt => int => bool)) => t => int;
let forEach: Js.Fn.arity1((elt => unit)) => t => unit;
let forEachi: Js.Fn.arity2((elt => int => unit)) => t => unit;
let map: Js.Fn.arity1((elt => 'b)) => t => typed_array('b);
let mapi: Js.Fn.arity2((elt => int => 'b)) => t => typed_array('b);
let reduce: Js.Fn.arity2(('b => elt => 'b)) => 'b => t => 'b;
let reducei: Js.Fn.arity3(('b => elt => int => 'b)) => 'b => t => 'b;
let reduceRight: Js.Fn.arity2(('b => elt => 'b)) => 'b => t => 'b;
let reduceRighti: Js.Fn.arity3(('b => elt => int => 'b)) => 'b => t => 'b;
let some: Js.Fn.arity1((elt => bool)) => t => bool;
let somei: Js.Fn.arity2((elt => int => bool)) => t => bool;
let _BYTES_PER_ELEMENT: int;
let make: array(elt) => t;
let fromBuffer: array_buffer => t;

can throw

let fromBufferOffset: array_buffer => int => t;
  • raises Js.Exn.Error

    raise Js exception

  • parameter offset

    is in bytes

let fromBufferRange: array_buffer => offset:int => length:int => t;
  • raises Js.Exn.Error

    raises Js exception

  • parameter offset

    is in bytes, length in elements

let fromLength: int => t;
let from: array_like(elt) => t;