Pair

export type Pair<T> = [T, T];

A tuple of exactly two values of the same type.

Since 0.1.0

Action

export type Action<A> = (a: A) => void;

Useful for event handlers and other side-effectful functions.

Since 0.1.0

ActionKL

export type ActionKL = (key: string, label?: string) => void;

Useful for event handlers that need to know the key and label of the item being interacted with.

Since 0.1.0

Effect

export type Effect = () => void;

Useful for effects and other side-effectful functions that don't need any input.

Since 0.1.0

Fn

export type Fn<A, B> = (a: A) => B;

A generic unary function. Useful for general-purpose transformations.

Since 0.1.0

Predicate

export type Predicate<A> = (a: A) => boolean;

A predicate function. Useful for filtering and conditional logic.

Since 0.1.0

Maybe

export type Maybe<T> = T | undefined;

A value that can be of type T or undefined.

Since 0.2.1

Nilable

export type Nilable<T> = T | null | undefined;

A value that can be of type T, null, or undefined.

Since 0.2.1

Nullable

export type Nullable<T> = T | null;

A value that can be of type T or null.

Since 0.2.1

FnMap

export type FnMap = Obj<Fn<any, unknown>>;

A map of functions — an object whose values are functions accepting any single input and returning an opaque result. Used in higher-order functions like `applyFnMap`, `transformValues`, etc.

Since 0.1.0

Obj

export type Obj<T> = Record<string, T>;

A type representing an object with string keys and values of type T.

Since 0.1.0

ObjK

export type ObjK<Rest extends Obj<any> = Obj<unknown>> = {
	key: string;
} & Partial<Rest>;

In this library we have a number of functions expecting objects with specific keys `key`, `label`, `value`/`values` and their combinations and optional additional properties.

ObjKL

export interface ObjKL extends ObjK, ObjL {}

An object with `key`, `label` properties and optional additional properties. Useful for representing items in a list or options in a dropdown.

Since 0.1.0

ObjKLV

export interface ObjKLV<VType> extends ObjK, ObjL, ObjV<VType> {}

An object with `key`, `label`, `value` properties and optional additional properties. Useful for representing items in a list or options in a dropdown.

Since 0.1.0

ObjKLVs

export interface ObjKLVs<VType> extends ObjK, ObjL, ObjVs<VType> {}

An object with `key`, `label`, `values` properties and optional additional properties. Useful for representing items in a list or options in a dropdown.

Since 0.1.0

ObjKV

export interface ObjKV<VType> extends ObjK, ObjV<VType> {}

An object with `key`, `value` properties and optional additional properties. Useful for representing items in a list or options in a dropdown.

Since 0.1.0

ObjKVs

export interface ObjKVs<VType> extends ObjK, ObjVs<VType> {}

An object with `key`, `values` properties and optional additional properties. Useful for representing items in a list or options in a dropdown.

Since 0.1.0

ObjL

export type ObjL<Rest extends Obj<any> = Obj<unknown>> = {
	label: string;
} & Partial<Rest>;

An object with a `label` property and optional additional properties. Useful for representing items in a list or options in a dropdown.

Since 0.1.0

ObjLV

export interface ObjLV<VType> extends ObjL, ObjV<VType> {}

An object with `label`, `value` properties and optional additional properties. Useful for representing items in a list or options in a dropdown.

Since 0.1.0

ObjLVs

export interface ObjLVs<VType> extends ObjL, ObjVs<VType> {}

An object with `label`, `values` properties and optional additional properties. Useful for representing items in a list or options in a dropdown.

Since 0.1.0

ObjV

export type ObjV<VType, Rest extends Obj<any> = Obj<unknown>> = {
	value: VType;
} & Partial<Rest>;

An object with a `value` property of type VType and optional additional properties. Useful for representing items in a list or options in a dropdown.

Since 0.1.0

ObjVs

export type ObjVs<VType, Rest extends Obj<any> = Obj<unknown>> = {
	values: VType[];
} & Partial<Rest>;

An object with a `values` property of type VType[] and optional additional properties. Useful for representing items in a list or options in a dropdown.

Since 0.1.0

HasLength

export type HasLength = {length: number};

Types with a length property.

Since 0.1.0

HasSize

export type HasSize = {size: number};

Types with a size property

Since 0.1.0

© mindrones · datakit