Options
All
  • Public
  • Public/Protected
  • All
Menu

Module types

Utility functions for types.

Index

Type aliases

Constructor

Constructor<T>: {}

Extracts a constructor for a given type.

Useful for mixins.

Type parameters

  • T

Type declaration

FirstArgument

FirstArgument<T>: T extends () => any ? never : T extends (arg1: infer U, ...args: any[]) => any ? U : never

Extracts the first argument type from a function.

Type parameters

  • T

FirstArgumentFromConstructor

FirstArgumentFromConstructor<T>: T extends {} ? U : any

Extracts the first type for a given class constructor.

Type parameters

  • T

Json

Json: JsonObject | JsonArray | string | number | boolean | null

The valid types you can expect from parsed JSON.

Mutable

Mutable<T>: T extends Primitive ? T : T extends Array<infer E> ? MutableArray<E> : T extends Map<infer K, infer V> ? MutableMap<K, V> : T extends object ? MutableObject<T> : T

Forces an object's properties to be mutable,and deep recursive into containers too.

The opposite of Immutable.

see

Immutable

Type parameters

  • T

MutableArray

MutableArray<T>: Array<Mutable<T>>

An Array where itself, and all it's children, and so on, are writeable.

Type parameters

  • T

MutableMap

MutableMap<K, V>: Map<Mutable<K>, Mutable<V>>

A Map where itself, and all it's children, and so on, are writeable.

Type parameters

  • K

  • V

MutableObject

MutableObject<T>: {}

An object where itself, and all it's children, and so on, are writeable.

Type parameters

  • T

Type declaration

NonEmptyArray

NonEmptyArray<T>: [T] | { 0: T } & [T] & T[]

An array with at least 1 or more items.

Type parameters

  • T

Omit

Omit<T, K>: Pick<T, {} & {} & {}[keyof T]>

Omits a given key from a type.

Type parameters

  • T

  • K: keyof T

Primitive

Primitive: undefined | null | boolean | string | number | bigint | symbol | Function

Primitive types in JS that are not containers.

UnStringified

UnStringified: string | number | boolean | null

Types that can be easily deduced from a string.

nil

nil: null | undefined

Shorthand for null or undefined.

Generated using TypeDoc