import type { RefByPrimary } from '../instantiation/RefByPrimary'; import type { DomainObjectShape, Refable } from './Refable'; /** * creates a reference to a domain object by its primary key * * extracts only the primary key properties from a domain object instance * * note * - you may need to explicitly annotate the type for proper inference * - e.g., `const ref = refByPrimary(turtle)` * - automatic resolution of the relationship between instance and class.static properties is not yet possible in TypeScript * * @example * ```ts * const turtle = new SeaTurtle({ uuid: '1', seawaterSecurityNumber: '821', name: 'Crush' }); * const ref = refByPrimary(turtle); * // ref = { uuid: '1' } * ``` */ export declare const refByPrimary: , TShape extends DomainObjectShape = any, TPrimary extends readonly string[] = any, TUnique extends readonly string[] = any>(instance: InstanceType) => RefByPrimary;