An experimental TypeSpec syntax for Lexicon
at cli 33 lines 728 B view raw
1import type { EmitContext } from "@typespec/compiler"; 2import { TypelexEmitter } from "./emitter.js"; 3 4export interface TypelexEmitterOptions { 5 "output-dir"?: string; 6} 7 8export async function $onEmit(context: EmitContext<TypelexEmitterOptions>) { 9 // Use custom output-dir from options if provided, otherwise use emitterOutputDir 10 const outputDir = context.options["output-dir"] || context.emitterOutputDir; 11 12 const emitter = new TypelexEmitter(context.program, { 13 outputDir, 14 }); 15 16 await emitter.emit(); 17} 18 19// Export decorators 20export { 21 $maxGraphemes, 22 $minGraphemes, 23 $rec, 24 $required, 25 $readOnly, 26 $token, 27 $closed, 28 $query, 29 $procedure, 30 $subscription, 31 $encoding, 32 $errors, 33} from "./decorators.js";