Options
All
  • Public
  • Public/Protected
  • All
Menu

@thi.ng/api

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

Always

Always<T>: T extends undefined ? never : T

Similar to NonNullable, but only excludes undefined.

Type parameters

  • T

ArrayLikeIterable

ArrayLikeIterable<T>: ArrayLike<T> & Iterable<T>

Type parameters

  • T

ArrayValue

ArrayValue<T>: T[0]

Returns an array's value type.

Type parameters

  • T: unknown[]

ButLast

ButLast<T, C>: { 0: ButLast<Tail<T>, Prepend<Head<T>, C>>; 1: Reverse<C> }[IsEmpty<Tail<T>>]

Extracts everything except the last element from a tuple.

Type parameters

  • T: unknown[]

  • C: unknown[] = []

Comparator

Comparator<T>: Fn2<T, T, number>

Generic 2-element comparator function type alias.

remarks

Must follow this contract and return:

  • negative if a < b
  • zero if a == b
  • positive if a > b

Type parameters

  • T

DeepPartial

DeepPartial<T>: Partial<{[ k in keyof T]: DeepPartial<T[k]> }>

Type parameters

  • T

DeepPath

DeepPath<T, A, B, C, D, E, F, G, H>: A extends Keys<T> ? B extends Keys1<T, A> ? C extends Keys2<T, A, B> ? D extends Keys3<T, A, B, C> ? E extends Keys4<T, A, B, C, D> ? F extends Keys5<T, A, B, C, D, E> ? G extends Keys6<T, A, B, C, D, E, F> ? H extends Keys7<T, A, B, C, D, E, F, G> ? readonly [A, B, C, D, E, F, G, H, ...NumOrString[]] : never : never : never : never : never : never : never : never

Semi-typechecked lookup path (depth > 8). Only the first 8 levels are checked.

Type parameters

  • T

  • A

  • B

  • C

  • D

  • E

  • F

  • G

  • H

Derefed

Derefed<T>: T extends IDeref<any> ? ReturnType<T["deref"]> : T

If T is a IDeref, returns its value type or else T.

Type parameters

  • T

DerefedKeys

DerefedKeys<T, K>: {[ P in K]: Derefed<T[P]> }

Constructs a type with a set of properties K of type T and attempts to resolve each given key via Derefed.

example
interface Foo {
    a: IDeref<string>;
    b: IDeref<number>;
    c: { d: number };
}

type Foo2 = DerefedKeys<Foo>;
// { a: string; b: number; c: { d: number; } }

type Foo3 = DerefedKeys<Foo, "b">;
// { b: number; }

Type parameters

FloatArray

FloatArray: Float32Array | Float64Array

FloatArrayConstructor

FloatArrayConstructor: Float32ArrayConstructor | Float64ArrayConstructor

FloatType

FloatType: "f32" | "f64"

Fn

Fn<A, B>: (a: A) => B

Type parameters

  • A

  • B

Type declaration

    • (a: A): B
    • A single arg function from A to B.

      Parameters

      • a: A

      Returns B

Fn0

Fn0<T>: () => T

Type parameters

  • T

Type declaration

    • (): T
    • A no-arg function, returning T.

      Returns T

Fn10

Fn10<A, B, C, D, E, F, G, H, I, J, K>: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, j: J) => K

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

  • G

  • H

  • I

  • J

  • K

Type declaration

    • (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, j: J): K
    • A 10-arg function from A,B,C,D,E,F,G,H,I,J to K.

      Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E
      • f: F
      • g: G
      • h: H
      • i: I
      • j: J

      Returns K

Fn2

Fn2<A, B, C>: (a: A, b: B) => C

Type parameters

  • A

  • B

  • C

Type declaration

    • (a: A, b: B): C
    • A 2-arg function from A,B to C.

      Parameters

      • a: A
      • b: B

      Returns C

Fn3

Fn3<A, B, C, D>: (a: A, b: B, c: C) => D

Type parameters

  • A

  • B

  • C

  • D

Type declaration

    • (a: A, b: B, c: C): D
    • A 3-arg function from A,B,C to D.

      Parameters

      • a: A
      • b: B
      • c: C

      Returns D

Fn4

Fn4<A, B, C, D, E>: (a: A, b: B, c: C, d: D) => E

Type parameters

  • A

  • B

  • C

  • D

  • E

Type declaration

    • (a: A, b: B, c: C, d: D): E
    • A 4-arg function from A,B,C,D to E.

      Parameters

      • a: A
      • b: B
      • c: C
      • d: D

      Returns E

Fn5

Fn5<A, B, C, D, E, F>: (a: A, b: B, c: C, d: D, e: E) => F

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

Type declaration

    • (a: A, b: B, c: C, d: D, e: E): F
    • A 5-arg function from A,B,C,D,E to F.

      Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E

      Returns F

Fn6

Fn6<A, B, C, D, E, F, G>: (a: A, b: B, c: C, d: D, e: E, f: F) => G

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

  • G

Type declaration

    • (a: A, b: B, c: C, d: D, e: E, f: F): G
    • A 6-arg function from A,B,C,D,E,F to G.

      Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E
      • f: F

      Returns G

Fn7

Fn7<A, B, C, D, E, F, G, H>: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => H

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

  • G

  • H

Type declaration

    • (a: A, b: B, c: C, d: D, e: E, f: F, g: G): H
    • A 7-arg function from A,B,C,D,E,F,G to H.

      Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E
      • f: F
      • g: G

      Returns H

Fn8

Fn8<A, B, C, D, E, F, G, H, I>: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H) => I

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

  • G

  • H

  • I

Type declaration

    • (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H): I
    • A 8-arg function from A,B,C,D,E,F,G,H to I.

      Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E
      • f: F
      • g: G
      • h: H

      Returns I

Fn9

Fn9<A, B, C, D, E, F, G, H, I, J>: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I) => J

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

  • G

  • H

  • I

  • J

Type declaration

    • (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I): J
    • A 9-arg function from A,B,C,D,E,F,G,H,I to J.

      Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E
      • f: F
      • g: G
      • h: H
      • i: I

      Returns J

FnAny

FnAny<T>: (...xs: any[]) => T

Type parameters

  • T

Type declaration

    • (...xs: any[]): T
    • An untyped vararg arg function to type T.

      Parameters

      • Rest ...xs: any[]

      Returns T

FnAnyT

FnAnyT<A, B>: (...xs: A[]) => B

Type parameters

  • A

  • B

Type declaration

    • (...xs: A[]): B
    • A typed vararg arg function from A to B.

      Parameters

      • Rest ...xs: A[]

      Returns B

FnN

FnN: FnU<number>

FnN10

FnN10: FnU10<number>

FnN2

FnN2: FnU2<number>

FnN3

FnN3: FnU3<number>

FnN4

FnN4: FnU4<number>

FnN5

FnN5: FnU5<number>

FnN6

FnN6: FnU6<number>

FnN7

FnN7: FnU7<number>

FnN8

FnN8: FnU8<number>

FnN9

FnN9: FnU9<number>

FnO

FnO<A, B>: (a: A, ...xs: any[]) => B

Type parameters

  • A

  • B

Type declaration

    • (a: A, ...xs: any[]): B
    • Parameters

      • a: A
      • Rest ...xs: any[]

      Returns B

FnO10

FnO10<A, B, C, D, E, F, G, H, I, J, K>: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, j: J, ...xs: any[]) => K

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

  • G

  • H

  • I

  • J

  • K

Type declaration

    • (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, j: J, ...xs: any[]): K
    • Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E
      • f: F
      • g: G
      • h: H
      • i: I
      • j: J
      • Rest ...xs: any[]

      Returns K

FnO2

FnO2<A, B, C>: (a: A, b: B, ...xs: any[]) => C

Type parameters

  • A

  • B

  • C

Type declaration

    • (a: A, b: B, ...xs: any[]): C
    • Parameters

      • a: A
      • b: B
      • Rest ...xs: any[]

      Returns C

FnO3

FnO3<A, B, C, D>: (a: A, b: B, c: C, ...xs: any[]) => D

Type parameters

  • A

  • B

  • C

  • D

Type declaration

    • (a: A, b: B, c: C, ...xs: any[]): D
    • Parameters

      • a: A
      • b: B
      • c: C
      • Rest ...xs: any[]

      Returns D

FnO4

FnO4<A, B, C, D, E>: (a: A, b: B, c: C, d: D, ...xs: any[]) => E

Type parameters

  • A

  • B

  • C

  • D

  • E

Type declaration

    • (a: A, b: B, c: C, d: D, ...xs: any[]): E
    • Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • Rest ...xs: any[]

      Returns E

FnO5

FnO5<A, B, C, D, E, F>: (a: A, b: B, c: C, d: D, e: E, ...xs: any[]) => F

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

Type declaration

    • (a: A, b: B, c: C, d: D, e: E, ...xs: any[]): F
    • Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E
      • Rest ...xs: any[]

      Returns F

FnO6

FnO6<A, B, C, D, E, F, G>: (a: A, b: B, c: C, d: D, e: E, f: F, ...xs: any[]) => G

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

  • G

Type declaration

    • (a: A, b: B, c: C, d: D, e: E, f: F, ...xs: any[]): G
    • Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E
      • f: F
      • Rest ...xs: any[]

      Returns G

FnO7

FnO7<A, B, C, D, E, F, G, H>: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, ...xs: any[]) => H

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

  • G

  • H

Type declaration

    • (a: A, b: B, c: C, d: D, e: E, f: F, g: G, ...xs: any[]): H
    • Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E
      • f: F
      • g: G
      • Rest ...xs: any[]

      Returns H

FnO8

FnO8<A, B, C, D, E, F, G, H, I>: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, ...xs: any[]) => I

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

  • G

  • H

  • I

Type declaration

    • (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, ...xs: any[]): I
    • Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E
      • f: F
      • g: G
      • h: H
      • Rest ...xs: any[]

      Returns I

FnO9

FnO9<A, B, C, D, E, F, G, H, I, J>: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, ...xs: any[]) => J

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

  • G

  • H

  • I

  • J

Type declaration

    • (a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: I, ...xs: any[]): J
    • Parameters

      • a: A
      • b: B
      • c: C
      • d: D
      • e: E
      • f: F
      • g: G
      • h: H
      • i: I
      • Rest ...xs: any[]

      Returns J

FnU

FnU<A, B>: Fn<A, B>

1-arg function with arg of type A and return type B (defaults to A)

Type parameters

  • A

  • B = A

FnU10

FnU10<A, B>: Fn10<A, A, A, A, A, A, A, A, A, A, B>

10-arg function with all args uniformly of type A and return type B (defaults to A)

Type parameters

  • A

  • B = A

FnU2

FnU2<A, B>: Fn2<A, A, B>

2-arg function with all args uniformly of type A and return type B (defaults to A)

Type parameters

  • A

  • B = A

FnU3

FnU3<A, B>: Fn3<A, A, A, B>

3-arg function with all args uniformly of type A and return type B (defaults to A)

Type parameters

  • A

  • B = A

FnU4

FnU4<A, B>: Fn4<A, A, A, A, B>

4-arg function with all args uniformly of type A and return type B (defaults to A)

Type parameters

  • A

  • B = A

FnU5

FnU5<A, B>: Fn5<A, A, A, A, A, B>

5-arg function with all args uniformly of type A and return type B (defaults to A)

Type parameters

  • A

  • B = A

FnU6

FnU6<A, B>: Fn6<A, A, A, A, A, A, B>

6-arg function with all args uniformly of type A and return type B (defaults to A)

Type parameters

  • A

  • B = A

FnU7

FnU7<A, B>: Fn7<A, A, A, A, A, A, A, B>

7-arg function with all args uniformly of type A and return type B (defaults to A)

Type parameters

  • A

  • B = A

FnU8

FnU8<A, B>: Fn8<A, A, A, A, A, A, A, A, B>

8-arg function with all args uniformly of type A and return type B (defaults to A)

Type parameters

  • A

  • B = A

FnU9

FnU9<A, B>: Fn9<A, A, A, A, A, A, A, A, A, B>

9-arg function with all args uniformly of type A and return type B (defaults to A)

Type parameters

  • A

  • B = A

Head

Head<T>: T extends [infer A, ...unknown[]] ? A : never

Extracts the first element of a tuple.

Type parameters

  • T: unknown[]

IntArray

IntArray: Int8Array | Int16Array | Int32Array

IntArrayConstructor

IntArrayConstructor: Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor

IntType

IntType: "i8" | "i16" | "i32"

IsEmpty

IsEmpty<T>: T extends [] ? 1 : 0

Returns 1 if T is empty tuple, else 0

Type parameters

  • T: unknown[]

IsOpt

IsOpt<T>: T extends undefined ? true : never

Returns true if T includes undefined.

Type parameters

  • T

IsOptPath

IsOptPath<T, P>: P extends [] ? never : IsOptR<T, Head<P>, Tail<P>>

Returns true if given path contains any intermediate properties declared as optional in type T.

Reference: https://stackoverflow.com/q/60869412/294515

Type parameters

  • T

  • P: unknown[]

Keys

Keys<T>: keyof Required<T>

Type parameters

  • T

Keys1

Keys1<T, A>: Keys<Required<T>[A]>

Type parameters

Keys2

Keys2<T, A, B>: Keys1<Required<T>[A], B>

Type parameters

Keys3

Keys3<T, A, B, C>: Keys2<Required<T>[A], B, C>

Type parameters

Keys4

Keys4<T, A, B, C, D>: Keys3<Required<T>[A], B, C, D>

Type parameters

Keys5

Keys5<T, A, B, C, D, E>: Keys4<Required<T>[A], B, C, D, E>

Type parameters

Keys6

Keys6<T, A, B, C, D, E, F>: Keys5<Required<T>[A], B, C, D, E, F>

Type parameters

Keys7

Keys7<T, A, B, C, D, E, F, G>: Keys6<Required<T>[A], B, C, D, E, F, G>

Type parameters

Keys8

Keys8<T, A, B, C, D, E, F, G, H>: Keys7<Required<T>[A], B, C, D, E, F, G, H>

Type parameters

KeysN

KeysN<T, L>: L extends [] ? Keys<T> : KeysNReducer<T, Head<L>, Tail<L>>

Generalised version of Keys0 - Keys7.

Type parameters

  • T

  • L: unknown[]

Last

Last<T>: { 0: Last<Tail<T>>; 1: Head<T> }[IsEmpty<Tail<T>>]

Extracts the last element from a tuple.

Type parameters

  • T: unknown[]

Listener

Listener: Fn<Event, void>

Event listener.

LogLevelName

LogLevelName: "FINE" | "DEBUG" | "INFO" | "WARN" | "SEVERE" | "NONE"

MaybeDeref

MaybeDeref<T>: IDeref<T> | T

Type parameters

  • T

Nullable

Nullable<T>: T | null | undefined

Type parameters

  • T

NumOrString

NumOrString: number | string

NumericArray

NumericArray: number[] | TypedArray

NumericKeys

NumericKeys<T>: TypedKeys<T, number>

Type parameters

  • T

OptPathVal

OptPathVal<T, P>: OptVal<IsOptPath<T, P>, ValN<T, P>>

Similar to PathVal, but also takes into account if given path contains any intermediate properties declared as optional in type T. If that's the case, returns union of undefined and inferred value for path, else just the latter.

Context & reference: https://stackoverflow.com/q/60869412/294515

Type parameters

  • T

  • P: unknown[]

OptVal

OptVal<PRED, RES>: [PRED] extends [never] ? RES : RES | undefined

Returns RES if PRED is never, else RES | undefined

Type parameters

  • PRED

  • RES

Pair

Pair<K, V>: [K, V]

A key-value pair / tuple.

Type parameters

  • K

  • V

Path

Path: readonly NumOrString[] | NumOrString

Unchecked lookup path for nested data structures.

Path0

Path0: readonly []

Empty lookup path.

Path1

Path1<T, A>: A extends Keys<T> ? readonly [A] : never

Type checked lookup path (depth 1)

Type parameters

  • T

  • A

Path2

Path2<T, A, B>: A extends Keys<T> ? B extends Keys1<T, A> ? readonly [A, B] : never : never

Type checked lookup path (depth 2)

Type parameters

  • T

  • A

  • B

Path3

Path3<T, A, B, C>: A extends Keys<T> ? B extends Keys1<T, A> ? C extends Keys2<T, A, B> ? readonly [A, B, C] : never : never : never

Type checked lookup path (depth 3)

Type parameters

  • T

  • A

  • B

  • C

Path4

Path4<T, A, B, C, D>: A extends Keys<T> ? B extends Keys1<T, A> ? C extends Keys2<T, A, B> ? D extends Keys3<T, A, B, C> ? readonly [A, B, C, D] : never : never : never : never

Type checked lookup path (depth 4)

Type parameters

  • T

  • A

  • B

  • C

  • D

Path5

Path5<T, A, B, C, D, E>: A extends Keys<T> ? B extends Keys1<T, A> ? C extends Keys2<T, A, B> ? D extends Keys3<T, A, B, C> ? E extends Keys4<T, A, B, C, D> ? readonly [A, B, C, D, E] : never : never : never : never : never

Type checked lookup path (depth 5)

Type parameters

  • T

  • A

  • B

  • C

  • D

  • E

Path6

Path6<T, A, B, C, D, E, F>: A extends Keys<T> ? B extends Keys1<T, A> ? C extends Keys2<T, A, B> ? D extends Keys3<T, A, B, C> ? E extends Keys4<T, A, B, C, D> ? F extends Keys5<T, A, B, C, D, E> ? readonly [A, B, C, D, E, F] : never : never : never : never : never : never

Type checked lookup path (depth 6)

Type parameters

  • T

  • A

  • B

  • C

  • D

  • E

  • F

Path7

Path7<T, A, B, C, D, E, F, G>: A extends Keys<T> ? B extends Keys1<T, A> ? C extends Keys2<T, A, B> ? D extends Keys3<T, A, B, C> ? E extends Keys4<T, A, B, C, D> ? F extends Keys5<T, A, B, C, D, E> ? G extends Keys6<T, A, B, C, D, E, F> ? readonly [A, B, C, D, E, F, G] : never : never : never : never : never : never : never

Type checked lookup path (depth 7)

Type parameters

  • T

  • A

  • B

  • C

  • D

  • E

  • F

  • G

Path8

Path8<T, A, B, C, D, E, F, G, H>: A extends Keys<T> ? B extends Keys1<T, A> ? C extends Keys2<T, A, B> ? D extends Keys3<T, A, B, C> ? E extends Keys4<T, A, B, C, D> ? F extends Keys5<T, A, B, C, D, E> ? G extends Keys6<T, A, B, C, D, E, F> ? H extends Keys7<T, A, B, C, D, E, F, G> ? readonly [A, B, C, D, E, F, G, H] : never : never : never : never : never : never : never : never

Type checked lookup path (depth 8)

Type parameters

  • T

  • A

  • B

  • C

  • D

  • E

  • F

  • G

  • H

PathVal

PathVal<T, P>: ValN<T, P>

Returns nested value type for given path into T or never if path is incompatible with T.

Type parameters

  • T

  • P: unknown[]

Predicate

Predicate<T>: Fn<T, boolean>

Predicate function mapping given value to true/false.

Type parameters

  • T

Predicate2

Predicate2<T>: Fn2<T, T, boolean>

Predicate function mapping given args to true/false.

Type parameters

  • T

Prepend

Prepend<T, U>: [T, ...U]

Adds an element at the start of an tuple.

Type parameters

  • T

  • U: unknown[]

Primitive

Primitive: NumOrString | boolean | symbol

Range

Range: [number, number]

Range0_1

Range0_1: 0 | 1

Range0_15

Range0_15: Range0_7 | Range8_15

Range0_23

Range0_23: Range0_15 | Range16_23

Range0_3

Range0_3: Range0_1 | 2 | 3

Range0_31

Range0_31: Range0_15 | Range16_31

Range0_47

Range0_47: Range0_31 | Range32_47

Range0_63

Range0_63: Range0_31 | Range32_63

Range0_7

Range0_7: Range0_3 | Range4_7

Range16_23

Range16_23: 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23

Range16_31

Range16_31: Range16_23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31

Range1_16

Range1_16: Range1_8 | Range8_15 | 16

Range1_2

Range1_2: 1 | 2

Range1_24

Range1_24: Range1_16 | Range16_23 | 24

Range1_32

Range1_32: Range1_16 | Range16_31 | 32

Range1_4

Range1_4: Range1_2 | 3 | 4

Range1_48

Range1_48: Range1_32 | Range32_47 | 48

Range1_64

Range1_64: Range1_32 | Range32_63 | 64

Range1_8

Range1_8: Range1_4 | Range4_7 | 8

Range32_47

Range32_47: 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47

Range32_63

Range32_63: Range32_47 | Range48_63

Range48_63

Range48_63: 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63

Range4_7

Range4_7: 4 | 5 | 6 | 7

Range8_15

Range8_15: 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15

Replace

Replace<T, A, V>: Without<T, A> & {[ id in A]: V }

Utilities for replacing types of nested keys.

Type parameters

Replace2

Replace2<T, A, B, V>: Without<T, A> & {[ id in A]: Replace<Val1<T, A>, B, V> }

Type parameters

Replace3

Replace3<T, A, B, C, V>: Without<T, A> & {[ id in A]: Replace2<Val1<T, A>, B, C, V> }

Type parameters

Replace4

Replace4<T, A, B, C, D, V>: Without<T, A> & {[ id in A]: Replace3<Val1<T, A>, B, C, D, V> }

Type parameters

Replace5

Replace5<T, A, B, C, D, E, V>: Without<T, A> & {[ id in A]: Replace4<Val1<T, A>, B, C, D, E, V> }

Type parameters

Replace6

Replace6<T, A, B, C, D, E, F, V>: Without<T, A> & {[ id in A]: Replace5<Val1<T, A>, B, C, D, E, F, V> }

Type parameters

Replace7

Replace7<T, A, B, C, D, E, F, G, V>: Without<T, A> & {[ id in A]: Replace6<Val1<T, A>, B, C, D, E, F, G, V> }

Type parameters

Replace8

Replace8<T, A, B, C, D, E, F, G, H, V>: Without<T, A> & {[ id in A]: Replace7<Val1<T, A>, B, C, D, E, F, G, H, V> }

Type parameters

ReplaceN

ReplaceN<T, P, V>: ReplaceNReducer<T, Head<P>, Tail<P>, V>

Generalised version of Replace0-Replace8.

Type parameters

  • T

  • P: unknown[]

  • V

Reverse

Reverse<T>: ReverseReducer<T, []>

Reverses the order of elements from a tuple.

Type parameters

  • T: unknown[]

Select2

Select2<T, Q, A, B>: T extends Q ? A : B

Type parameters

  • T

  • Q

  • A

  • B

Select3

Select3<T, Q1, Q2, A, B, C>: T extends Q1 ? A : T extends Q2 ? B : C

Type parameters

  • T

  • Q1

  • Q2

  • A

  • B

  • C

Select4

Select4<T, Q1, Q2, Q3, A, B, C, D>: T extends Q1 ? A : T extends Q2 ? B : T extends Q3 ? C : D

Type parameters

  • T

  • Q1

  • Q2

  • Q3

  • A

  • B

  • C

  • D

StatefulPredicate

StatefulPredicate<T>: Fn0<Predicate<T>>

Higher order Predicate builder. Possibly stateful.

Type parameters

  • T

StatefulPredicate2

StatefulPredicate2<T>: Fn0<Predicate2<T>>

Higher order Predicate2 builder. Possibly stateful.

Type parameters

  • T

StringKeys

StringKeys<T>: TypedKeys<T, string>

Type parameters

  • T

StringOrSym

StringOrSym: string | symbol

Tail

Tail<T>: T extends [unknown, ...infer A] ? A : never

Extracts everything except the first element from a tuple.

Type parameters

  • T: unknown[]

Tuple

Tuple<T, N>: [T, ...T[]] & { length: N } & Iterable<T>

Defines a fixed sized, iterable tuple with elements of type T and length N.

Type parameters

  • T

  • N: number

TupleLength

TupleLength<T>: T["length"]

Extracts a tuple's length / size.

Type parameters

  • T: unknown[]

Type

Type: "u8" | "u8c" | "i8" | "u16" | "i16" | "u32" | "i32" | "f32" | "f64"

Type IDs for typed array backed buffers and generally describing binary data values.

GLType GL2TYPE TYPE2GL

TypedArray

TypedArray: Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array

TypedArrayConstructor

TypedKeys

TypedKeys<A, B>: {[ P in Keys<A>]: B extends A[P] ? P : never }[keyof A]

Extracts from A all keys which have values assignable to type B.

Type parameters

  • A

  • B

UIntArray

UIntArray: Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array

UIntArrayConstructor

UIntArrayConstructor: Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor

UintType

UintType: "u8" | "u8c" | "u16" | "u32"

Val1

Val1<T, A>: T[A]

Type parameters

Val2

Val2<T, A, B>: ValN<T, [A, B]>

Type parameters

Val3

Val3<T, A, B, C>: ValN<T, [A, B, C]>

Type parameters

Val4

Val4<T, A, B, C, D>: ValN<T, [A, B, C, D]>

Type parameters

Val5

Val5<T, A, B, C, D, E>: ValN<T, [A, B, C, D, E]>

Type parameters

Val6

Val6<T, A, B, C, D, E, F>: ValN<T, [A, B, C, D, E, F]>

Type parameters

Val7

Val7<T, A, B, C, D, E, F, G>: ValN<T, [A, B, C, D, E, F, G]>

Type parameters

Val8

Val8<T, A, B, C, D, E, F, G, H>: ValN<T, [A, B, C, D, E, F, G, H]>

Type parameters

ValN

ValN<T, L>: L extends [] ? T : ValNReducer<T, Head<L>, Tail<L>>

Generalised version of Val1-Val7

Type parameters

  • T

  • L: unknown[]

Watch

Watch<T>: (id: string, oldState: T, newState: T) => void

Type parameters

  • T

Type declaration

    • (id: string, oldState: T, newState: T): void
    • Observer function for IWatch implementations.

      Parameters

      • id: string
      • oldState: T
      • newState: T

      Returns void

Without

Without<T, A>: Omit<T, A>

Utilities for constructing types with nested keys removed.

Type parameters

Without2

Without2<T, A, B>: Without<T, A> & {[ id in A]: Without<Val1<T, A>, B> }

Type parameters

Without3

Without3<T, A, B, C>: Without<T, A> & {[ id in A]: Without2<Val1<T, A>, B, C> }

Type parameters

Without4

Without4<T, A, B, C, D>: Without<T, A> & {[ id in A]: Without3<Val1<T, A>, B, C, D> }

Type parameters

Without5

Without5<T, A, B, C, D, E>: Without<T, A> & {[ id in A]: Without4<Val1<T, A>, B, C, D, E> }

Type parameters

Without6

Without6<T, A, B, C, D, E, F>: Without<T, A> & {[ id in A]: Without5<Val1<T, A>, B, C, D, E, F> }

Type parameters

Without7

Without7<T, A, B, C, D, E, F, G>: Without<T, A> & {[ id in A]: Without6<Val1<T, A>, B, C, D, E, F, G> }

Type parameters

Without8

Without8<T, A, B, C, D, E, F, G, H>: Without<T, A> & {[ id in A]: Without7<Val1<T, A>, B, C, D, E, F, G, H> }

Type parameters

WithoutN

WithoutN<T, P>: WithoutNReducer<T, Head<P>, Tail<P>>

Generalised version of Without0-Without8.

Type parameters

  • T

  • P: unknown[]

Variables

Const DEFAULT_EPS

DEFAULT_EPS: 0.000001 = 1e-6

Const EVENT_ALL

EVENT_ALL: "*" = "*"

Catch-all event ID

Const EVENT_DISABLE

EVENT_DISABLE: "disable" = "disable"

Const EVENT_ENABLE

EVENT_ENABLE: "enable" = "enable"

Const FLOAT_ARRAY_CTORS

FLOAT_ARRAY_CTORS: Record<FloatType, FloatArrayConstructor> = ...

Const GL2TYPE

GL2TYPE: Record<GLType, Type> = ...

Conversion from GLType to Type enums.

Const INT_ARRAY_CTORS

INT_ARRAY_CTORS: Record<IntType, IntArrayConstructor> = ...

Const NULL_LOGGER

NULL_LOGGER: ILogger = ...

Const SEMAPHORE

SEMAPHORE: typeof SEMAPHORE = ...

Internal use only. Do NOT use in user land code!

internal

Const SIZEOF

SIZEOF: { f32: number; f64: number; i16: number; i32: number; i8: number; u16: number; u32: number; u8: number; u8c: number } = ...

Size information (in bytes) for Type. Also see sizeOf.

Type declaration

  • f32: number
  • f64: number
  • i16: number
  • i32: number
  • i8: number
  • u16: number
  • u32: number
  • u8: number
  • u8c: number

Const TYPE2GL

TYPE2GL: Record<Type, GLType | undefined> = ...

Potentially lossy conversion from Type to GLType enums.

Not all enums are mappable:

  • F64 maps to undefined, since unsupported by WebGL
  • U8C maps to "u8"

Const TYPEDARRAY_CTORS

TYPEDARRAY_CTORS: Record<Type, TypedArrayConstructor> = ...

Const UINT_ARRAY_CTORS

UINT_ARRAY_CTORS: Record<UintType, UIntArrayConstructor> = ...

Functions

Const IEnableMixin

  • IEnableMixin(clazz: any): any

Const INotifyMixin

  • INotifyMixin(clazz: any): any
  • Mixin class decorator, injects INotify default implementation, incl. a lazily instantiated _listeners property object, storing registered listeners.

    Parameters

    • clazz: any

    Returns any

Const IWatchMixin

  • IWatchMixin(clazz: any): any

Const NO_OP

  • NO_OP(): void

Const asGLType

Const asNativeType

Const assert

  • assert(test: boolean | Fn0<boolean>, msg?: string | Fn0<string>): void
  • Takes a test result or predicate function without args and throws error with given msg if test failed (i.e. is falsy).

    remarks

    The function is only enabled if process.env.NODE_ENV != "production" or if the UMBRELLA_ASSERTS env var is set to 1.

    Parameters

    • test: boolean | Fn0<boolean>
    • msg: string | Fn0<string> = "assertion failed"

    Returns void

Const configurable

  • configurable(state: boolean): MethodDecorator
  • Property decorator factory. Sets configurable flag of PropertyDescriptor to given state.

    Parameters

    • state: boolean

      true, if propoerty is configurable

    Returns MethodDecorator

Const deprecated

  • deprecated(msg?: string, log?: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void }): MethodDecorator
  • Method property decorator factory. Augments original method with deprecation message (via console), shown when method is invoked. Accepts optional message arg. Throws error if assigned property is not a function.

    Parameters

    • Optional msg: string

      deprecation message

    • log: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void } = ...
        • (...data: any[]): void
        • (message?: any, ...optionalParams: any[]): void
        • Parameters

          • Rest ...data: any[]

          Returns void

        • Prints to stdout with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()).

          const count = 5;
          console.log('count: %d', count);
          // Prints: count: 5, to stdout
          console.log('count:', count);
          // Prints: count: 5, to stdout
          

          See util.format() for more information.

          since

          v0.1.100

          Parameters

          • Optional message: any
          • Rest ...optionalParams: any[]

          Returns void

    Returns MethodDecorator

Const deref

Const exposeGlobal

  • exposeGlobal(id: string, value: any, always?: boolean): void
  • Exposes given value as id in global scope, iff always = true (default: false) or if process.env.NODE_ENV != "production" or if the UMBRELLA_GLOBALS env var is set to 1.

    Parameters

    • id: string

      -

    • value: any

      -

    • always: boolean = false

      -

    Returns void

Const inotify_dispatch

  • inotify_dispatch(listeners: any[][], e: Event): void

Const intTypeForBits

Const intTypeForSize

Const isDeref

  • isDeref(x: any): x is IDeref<any>

Const iterable

  • iterable(prop: PropertyKey): (clazz: any) => any

Const mixin

  • mixin(behaviour: any, sharedBehaviour?: any): (clazz: any) => any
  • Additionally only injects/overwrites properties in target, which are NOT marked with @nomixin (i.e. haven't set their configurable property descriptor flag to false)

    Parameters

    • behaviour: any

      to mixin

    • sharedBehaviour: any = {}

      -

    Returns (clazz: any) => any

    decorator function

      • (clazz: any): any
      • Parameters

        • clazz: any

        Returns any

Const nomixin

  • nomixin(_: any, __: string, descriptor: PropertyDescriptor): void
  • Method property decorator. Sets configurable flag of PropertyDescriptor to false (same as @configurable(false)). Intended to be used in combination with mixin decorators to enable partial implementations of mixed-in behaviors in target class and avoid them being overidden by mixed-in behaviour.

    Parameters

    • _: any
    • __: string
    • descriptor: PropertyDescriptor

    Returns void

Const sealed

  • sealed(constructor: Function): void

Const sizeOf

typedArray

Const typedArrayType

Const uintTypeForBits

Const uintTypeForSize

Generated using TypeDoc