Options
All
  • Public
  • Public/Protected
  • All
Menu

Module types

Index

Type Aliases

AsyncFunction<P, R>: ((...args: P) => Promise<R>)

Type Parameters

  • P extends any[] = any[]

  • R = any

Type declaration

    • (...args: P): Promise<R>
    • async function

      Parameters

      • Rest ...args: P

      Returns Promise<R>

Class<T>: (new (...args: any[]) => T)

Type Parameters

  • T = any

Type declaration

    • new (...args: any[]): T
    • Class constructor

      Parameters

      • Rest ...args: any[]

      Returns T

DeepPartial<T>: { [ P in keyof T]?: T[P] extends (infer U)[] ? DeepPartial<U>[] : T[P] extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : DeepPartial<T[P]> }

Same as Partial but goes deeper and makes Partial all its properties and sub-properties.

Type Parameters

  • T

FirstElement<T>: T extends [infer U, ...any[]] ? U : any

first element type of array types

Type Parameters

  • T extends ArrayLike<any>

GeneralFunction<Args, ReturnType>: ((...args: Args) => ReturnType)

Type Parameters

  • Args extends any[] = any[]

  • ReturnType extends any = any

Type declaration

    • (...args: Args): ReturnType
    • general function in typescript

      Parameters

      • Rest ...args: Args

      Returns ReturnType

JSType: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"

possible values of typeof object

Keys<T>: keyof T

keys of object

Type Parameters

  • T

LastOf<T>: UnionToIntersection<T extends any ? (() => T) : never> extends (() => infer R) ? R : never

Type Parameters

  • T

OptionalParameters<T>: T extends ((...args: infer P) => any) ? { [ K in keyof P]?: P[K] } : never

optional version of Parameters

Type Parameters

  • T extends Function

Partial<T>: { [ P in keyof T]?: T[P] }

Partial Object

Type Parameters

  • T

Predicate<T>: ((value?: T, index?: any, collection?: any) => boolean)

Type Parameters

  • T

Type declaration

    • (value?: T, index?: any, collection?: any): boolean
    • Parameters

      • Optional value: T
      • Optional index: any
      • Optional collection: any

      Returns boolean

Push<T, V>: [...T, V]

Type Parameters

  • T extends any[]

  • V

ReturnType<T>: T extends ((...args: any) => infer R) ? R : any

return type of function

Type Parameters

  • T

TupleUnion<T, L, N>: true extends N ? [] : Push<TupleUnion<Exclude<T, L>>, L>

Type Parameters

  • T

  • L = LastOf<T>

  • N = [T] extends [never] ? true : false

UnwrapPromise<T>: T extends PromiseLike<infer U> ? U : T

Unwrap Promise Generic Type

Type Parameters

  • T

Values<T>: T[keyof T][]

Convert values of object to array

Type Parameters

  • T