Base
Basic TypeScript helpers for common needs.
Maybe
Returns a union of the type and a potentially missing value, such as undefined or null.
type Maybe<T> = NoInfer<T | undefined | null>;Note: NoInfer is used to provide a more readable hover overlay.
Primitive
Represents a primitive data type in JavaScript. A primitive is not an object and has no methods or properties.
type Primitive = string | number | boolean | bigint | symbol | null | undefined;AnyFn
Represents a function that can take any number and type of arguments and return any. Sometimes TypeScript forces you to use it in generics.
type AnyFn = (...args: any[]) => any;ExpandRecord
Forces TypeScript to expand an object type into its full structure. Useful where TypeScript displays a complex type as a combination of aliases instead of a fully resolved object shape.
type ExpandRecord<T> = { [K in keyof T]: T[K] } & {};Note: Only affects how the type is displayed in editor hovers/error messages; it does not change the underlying type.
ExpandUnion
Forces TypeScript to distribute and fully materialize a union type. Improves editor hover/error messages readability when unions are derived from complex conditional types or other inferred constructs.
type ExpandUnion<T> = T extends infer U ? U : never;Note: Only affects how the type is displayed in editor hovers/error messages; it does not change the underlying type.