ArrayElement<T> import type {ArrayElement} from '@fuzdev/fuz_util/types.js'; generics
ArrayElement<T>15 declarations
ArrayElement<T> import type {ArrayElement} from '@fuzdev/fuz_util/types.js'; ArrayElement<T>TAssignable<T, K> import type {Assignable} from '@fuzdev/fuz_util/types.js'; Assignable<T, K extends keyof T = keyof T>TKkeyof Tkeyof TBrand<T> import type {Brand} from '@fuzdev/fuz_util/types.js'; Brand<T>TBranded<TValue, TName> import type {Branded} from '@fuzdev/fuz_util/types.js'; Branded<TValue, TName>TValueTNameClassConstructor<TInstance, TArgs> import type {ClassConstructor} from '@fuzdev/fuz_util/types.js'; ClassConstructor<TInstance, TArgs extends Array<any> = Array<any>>TInstanceTArgsArray<any>Array<any>(construct)type new (...args: TArgs): TInstance
argsTArgsDefined<T> import type {Defined} from '@fuzdev/fuz_util/types.js'; Defined<T>TFlavor<T> import type {Flavor} from '@fuzdev/fuz_util/types.js'; Flavor<T>TFlavored<TValue, TName> import type {Flavored} from '@fuzdev/fuz_util/types.js'; The Flavored and Branded type helpers add varying degrees of nominal typing to other types. This is especially useful with primitives like strings and numbers.
Flavored<TValue, TName>TValueTNamehttps://spin.atomicobject.com/typescript-flexible-nominal-typing/ * Flavored is a looser form of Branded that trades explicitness and a little safety in some cases for ergonomics. With Flavored you don't need to cast unflavored types: * ``ts type Email = Flavored<string, 'Email'>; const email1: Email = 'foo'; // ok type Address = Flavored<string, 'Address'>; const email2: Email = 'foo' as Address; // error! `` * Branded requires casting: * ``ts type PhoneNumber = Branded<string, 'PhoneNumber'>; const phone1: PhoneNumber = 'foo'; // error! const phone2: PhoneNumber = 'foo' as PhoneNumber; // ok `` * See also Zod's .brand schema helper:
KeyofUnion<T> import type {KeyofUnion} from '@fuzdev/fuz_util/types.js'; Like keyof but works for type unions.
KeyofUnion<T>TNotNull<T> import type {NotNull} from '@fuzdev/fuz_util/types.js'; NotNull<T>TOmitStrict<T, K> import type {OmitStrict} from '@fuzdev/fuz_util/types.js'; OmitStrict<T, K extends keyof T>TKkeyof TPartialExcept<T, K> import type {PartialExcept} from '@fuzdev/fuz_util/types.js'; PartialExcept<T, K extends keyof T>TKkeyof TPartialOnly<T, K> import type {PartialOnly} from '@fuzdev/fuz_util/types.js'; PartialOnly<T, K extends keyof T>TKkeyof TPartialValues<T> import type {PartialValues} from '@fuzdev/fuz_util/types.js'; PartialValues<T>TPickUnion<T, K> import type {PickUnion} from '@fuzdev/fuz_util/types.js'; Like Pick but works for type unions.
PickUnion<T, K extends KeyofUnion<T>>TKKeyofUnion<T>