import type { SubjectFields } from './hash.js'; export type ReferenceDeclaration = { /** the referencing subject type */ type: string; /** the referenced subject type */ to: string; /** the referenced subject's id, read from the referencing subject's fields (undefined: no reference) */ key: (fields: SubjectFields) => string | undefined; /** the fields to overlay once the referenced subject's id is `vendorId` */ adopt: (fields: SubjectFields, vendorId: string) => SubjectFields; }; /** The common case: one field holds the referenced subject's id as it is. */ export declare function referenceField(type: string, field: string, to: string): ReferenceDeclaration; export declare function registerReferences(vendor: string, references: ReferenceDeclaration[]): void; export declare function packReferences(vendor: string): ReferenceDeclaration[]; /** `fields` of a `type` subject with every declared reference resolved through `aliases` * (`${type}:${oldId}` → newId, as `aliasesFrom` builds it). The same object when nothing applies. */ export declare function resolveReferences(vendor: string, type: string, fields: SubjectFields, aliases: Map): SubjectFields;