Options
All
  • Public
  • Public/Protected
  • All
Menu

Module types

Index

Type aliases

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

Type parameters

  • P: 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: ArrayLike<any>

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

Type parameters

  • Args: any[] = any[]

  • ReturnType: 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: 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: 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