Options
All
  • Public
  • Public/Protected
  • All
Menu

@vykaash/array-utils

Index

Type Aliases

TBufferArrays: Float64Array | Float32Array | Uint32Array | Int32Array | Uint16Array | Int16Array | Uint8Array | Uint8ClampedArray | Int8Array
TFixedLength<T, N>: number extends N ? T[] : _TFixedLength<T, N, []>
example
// make an array type equivelent to [number x 16]
type Matrix = TFixedLength<number, 16>;

Type Parameters

  • T

  • N extends number

TFloatBufferArrays: Float64Array | Float32Array
TIndexable<T>: {}

Type Parameters

  • T

Type declaration

  • [key: number]: T
TIndexableIterable<T>: TIndexable<T> & TIterable<T>

Type Parameters

  • T

TInferIndexableGeneric<T>: T extends TIndexable<infer A> ? A : never

Type Parameters

  • T

TIntegerBufferArrays: Uint32Array | Uint32Array | Int32Array | Uint16Array | Int16Array | Uint8Array | Uint8ClampedArray | Int8Array
TIterable<T>: { [iterator]: any }

Type Parameters

  • T

Type declaration

  • [iterator]:function
    • [iterator](): IterableIterator<T>

Functions

  • copy<T, U>(target: T, source: U, from: number, to: number): T
  • resizeBuffer<T>(buffer: T, newSize: number): T
  • swap<T>(array: T, a: number, b: number): T
  • a faster remove method than splice for UNORDERED arrays. the value at indexToRemove is replaced with the result of array.pop(). does not validate indices. if indexToRemove is >= array.length then the pop() result is returned without any swapping.

    Type Parameters

    • T extends TIndexable<any> & { length: number; pop: any }

    Parameters

    • array: T
    • indexToRemove: number

    Returns undefined | TInferIndexableGeneric<T>

    standard pop results

Generated using TypeDoc