@loken/hierarchies
Version:
Library for working with hierarchies of identifiers and identifiable objects.
12 lines (7 loc) • 371 B
text/typescript
import { type Some } from '@loken/utilities';
/** Represent a link between a `parent` and `child` using their `Id`s. */
export type Relation<Id> = readonly [parent: Id, child: Id];
/** The type of relation. */
export type RelType = 'ancestors' | 'descendants' | 'children';
/** One or more `RelType`s to use as a filter. */
export type RelTypeFilter = Some<RelType>;