import { ContractEventType, FromRecord, JoinRecord } from './declarative/ProjectionBuilderCore.js'; import type { ProjectionCapabilityProvenance } from './ProjectionCapabilityProvenance.js'; /** * What one variant declared about being part of a mutually exclusive group, carried from the * point its definition was built to the cross-wiring pass that runs once every variant in the * group is known. */ export interface VariantDeclaration { /** The identity value used to group definitions for the cross-wiring pass. */ readonly identity: Function; /** The variant's own key property name, used as the correlation property for reclassified joins. */ readonly key: string; /** The event types that activate this variant. */ readonly enteringEventTypes: ContractEventType[]; } /** * A built projection definition, tagged with its variant declaration when it is one. */ export interface BuiltProjection { readonly typeName: string; readonly definition: Record; readonly variant?: VariantDeclaration; readonly provenance?: ProjectionCapabilityProvenance[]; } /** * Merges every mapping a globalFor shared handler declares into a variant's From records, keyed * by event type. Runs before {@link reclassify} so a shared mapping for a non-entering event is * turned into an update-only join exactly like a mapping declared directly on the variant. * @param variantTypeName - The name of the variant type, used for error reporting. * @param variantMemberNames - The property names the variant actually has. * @param from - The variant's own From records. * @param globalHandlers - The shared handler From records applicable to this variant's identity, keyed by handler type name. * @returns The merged From records. * @throws {@link GlobalHandlerPropertyNotOnVariant} when a shared mapping targets a member the variant does not have. */ export declare function mergeGlobalHandlers(variantTypeName: string, variantMemberNames: ReadonlySet, from: FromRecord[], globalHandlers: ReadonlyMap): FromRecord[]; /** * Reclassifies every From record that is not one of the entering event types into an update-only * join on the variant's own key. The entering event(s) keep their ordinary create-or-update From * handler; everything else becomes a self-referential join that can bring an already-active * instance up to date but can never create one. * @param variantTypeName - The name of the variant type, used for error reporting. * @param from - The variant's own (possibly merged) From records. * @param join - The variant's own Join records, unaffected by reclassification. * @param enteringEventTypes - The event types that activate this variant. * @param variantKey - The variant's own key property name. * @returns The reclassified From and Join records. * @throws {@link VariantMustDeclareEntersOnEvent} when enteringEventTypes is empty. */ export declare function reclassify(variantTypeName: string, from: FromRecord[], join: JoinRecord[], enteringEventTypes: ContractEventType[], variantKey: string): { from: FromRecord[]; join: JoinRecord[]; }; /** * Gives every variant a RemovedWith entry for every sibling's entering event(s), and none for * its own - the mutual-exclusion cross-wiring that can only run once every variant of a group * has been built. * * A variant cannot be told what removes it while it is being built, because its siblings are * not known yet. This runs once per registration call, over every variant discovered in that * call. * @param projections - Every built projection definition from this registration call, tagged with its variant declaration when it is one. */ export declare function crossWireGroups(projections: BuiltProjection[]): void; //# sourceMappingURL=VariantReclassifier.d.ts.map