Skip to content
Snippets Groups Projects
helpers.d.ts 911 B
Newer Older
Alexander Rose's avatar
Alexander Rose committed
/**
 * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
 *
 * @author Alexander Rose <alexander.rose@weirdbyte.de>
 * @author David Sehnal <david.sehnal@gmail.com>
 */

declare module Helpers {
    export type Mutable<T> = {
        -readonly [P in keyof T]: T[P]
    }
    export type TypedIntArray = Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array
    export type TypedFloatArray = Float32Array | Float64Array

    export type TypedArray = TypedIntArray | TypedFloatArray
    export type NumberArray = TypedArray | number[]
    export type UintArray = Uint8Array | Uint16Array | Uint32Array | number[]
Alexander Rose's avatar
Alexander Rose committed
    export type ValueOf<T> = T[keyof T]
David Sehnal's avatar
David Sehnal committed
    export type ArrayCtor<T> = { new(size: number): { [i: number]: T, length: number } }
David Sehnal's avatar
David Sehnal committed
    /** assignable ArrayLike version */
    export type ArrayLike<T> =  { [i: number]: T, length: number }
Alexander Rose's avatar
Alexander Rose committed
}