Link Search Menu Expand Document

index overview

Added in v1.0.0


Table of contents


Util

typeOf

Signature

export declare const typeOf: <T>() => T

Added in v1.0.0

utils

Extract (type alias)

Signature

export type Extract<T> = T extends infer O ? { [K in keyof O]: O[K] } : never

Added in v1.0.0

IsAny (type alias)

Signature

export type IsAny<T> = 0 extends 1 & T ? true : false

Added in v1.0.0

NoData (type alias)

Signature

export type NoData = void

Added in v1.0.0

Normalize (type alias)

Signature

export type Normalize<T, A> = IsAny<T> extends false
  ? NormalizeUnknown<NormalizeUndefined<T, A>, A>
  : T

Added in v1.0.0

RecordVal (type alias)

Signature

export type RecordVal<R> = R extends Record<infer K, infer V> ? V : never

Added in v1.0.0

Tagged (type alias)

Signature

export type Tagged<T, D> = { tag: T; data: D }

Added in v1.0.0

Tuple (type alias)

Signature

export type Tuple<T> =
  | []
  | [T]
  | [T, T]
  | [T, T, T]
  | [T, T, T, T]
  | [T, T, T, T, T]
  | [T, T, T, T, T, T]
  | [T, T, T, T, T, T, T]
  | [T, T, T, T, T, T, T, T]
  | [T, T, T, T, T, T, T, T, T]
  | [T, T, T, T, T, T, T, T, T, T]

Added in v1.0.0

TupleToUnion (type alias)

Signature

export type TupleToUnion<T extends any[]> = T[number]

Added in v1.0.0

Union (type alias)

Signature

export type Union<T> = T[keyof T]

Added in v1.0.0

tag

Signature

export declare const tag: {
  <Tag extends string, Data>(tag: Tag, data: Data): Tagged<Tag, Data>
  <Tag extends string>(tag: Tag): Tagged<Tag, void>
}

Added in v1.0.0