Skip to content

type

Frequently used types and type helpers for TypeScript.

Type Aliases

ArrayKeys<T>

type ArrayKeys<T>: { [K in keyof T]: T[K] extends unknown[] | undefined ? K : never }[keyof T];

Type Parameters

T

Defined in

tmp/commons/src/lib/type.ts:20


PartialBy<T, K>

type PartialBy<T, K>: Omit<T, K> & Partial<Pick<T, K>>;

Make selected properties in T optional.

Type Parameters

T

The type to make partial.

K extends keyof T

The keys of T to make optional.

Defined in

tmp/commons/src/lib/type.ts:11


SaveData<T>

type SaveData<T>: ReturnType<T["toJSON"]>;

Get the return type of the toJSON method of an object.

Type Parameters

T extends object

The object type.

Defined in

tmp/commons/src/lib/type.ts:17


StringArrayKeys<T>

type StringArrayKeys<T>: { [K in keyof T]: T[K] extends string[] | undefined ? K : never }[keyof T];

Type Parameters

T

Defined in

tmp/commons/src/lib/type.ts:24


StringKeys<T>

type StringKeys<T>: { [K in keyof T]: T[K] extends string | undefined ? K : never }[keyof T];

Type Parameters

T

Defined in

tmp/commons/src/lib/type.ts:22