/** * @fileoverview Lexicon Factory * * Helper for creating Lexicon instances from static configuration. */ import type { IntentIR } from "../schema/index.js"; import type { IntentScope } from "../keys/types.js"; import type { Lexicon, EventEntry, EntitySpec } from "./interface.js"; /** * Configuration for creating a Lexicon. */ export type LexiconConfig = { /** Event entries keyed by lemma (uppercase) */ readonly events: Record; /** Entity specifications keyed by type name */ readonly entities: Record; /** Optional lemma -> action type mapping (defaults to lowercase lemma) */ readonly actionTypes?: Record; /** Optional custom args mapper */ readonly mapArgsToInput?: (args: IntentIR["args"], cond?: IntentIR["cond"]) => unknown; /** Optional custom scope proposal derivation */ readonly deriveScopeProposal?: (ir: IntentIR) => IntentScope | undefined; }; /** * Create a Lexicon from static configuration. * * Common pattern for domain-specific lexicons. * * @example * const lexicon = createLexicon({ * events: { * CANCEL: { * eventClass: "CONTROL", * thetaFrame: { * required: ["TARGET"], * optional: [], * restrictions: { * TARGET: { termKinds: ["entity"], entityTypes: ["Order"] } * } * } * } * }, * entities: { * Order: { fields: { id: "string", status: "string" } } * } * }); */ export declare function createLexicon(config: LexiconConfig): Lexicon; //# sourceMappingURL=factory.d.ts.map