UNPKG

domain-objects

Version:

A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.

8 lines (7 loc) 534 B
import { DomainObjectShape, Refable } from './DomainReferenceable'; /** * a generic which extracts the primary keys of a domain object */ export type DomainPrimaryKeys<TDobj extends Refable<TShape, TPrimary, TUnique>, TShape extends DomainObjectShape = any, // todo: update DomainObjectShape -> DomainReferenceableInstance to enable extraction of primary and unique keys via types TPrimary extends readonly string[] = any, TUnique extends readonly string[] = any> = TDobj['primary']; export { DomainPrimaryKeys as RefKeysPrimary };