helpers.d.ts 911 B

12345678910111213141516171819202122
  1. /**
  2. * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. * @author David Sehnal <david.sehnal@gmail.com>
  6. */
  7. declare module Helpers {
  8. export type Mutable<T> = {
  9. -readonly [P in keyof T]: T[P]
  10. }
  11. export type TypedIntArray = Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array
  12. export type TypedFloatArray = Float32Array | Float64Array
  13. export type TypedArray = TypedIntArray | TypedFloatArray
  14. export type NumberArray = TypedArray | number[]
  15. export type UintArray = Uint8Array | Uint16Array | Uint32Array | number[]
  16. export type ValueOf<T> = T[keyof T]
  17. export type ArrayCtor<T> = { new(size: number): { [i: number]: T, length: number } }
  18. /** assignable ArrayLike version */
  19. export type ArrayLike<T> = { [i: number]: T, length: number }
  20. }