export type ScannedEvent = { /** Qualified event-name as it appears in the events table: * `:event:`. The KumikoEventTypeMap key. */ readonly qualifiedName: string; /** Where the type for this event's payload comes from. Two flavours: * * { kind: "imported", schemaIdentifier, schemaModulePath } * Schema is a named export of another file. Augmentation * `import type`-s it from there. * * { kind: "inline", schemaSource, generatedConstName } * Schema was inlined at the call-site. We extract the source * text into `schemas.generated.ts` under `generatedConstName` * and import-type from there. */ readonly schemaSource: SchemaSource; /** Absolute disk-path of the feature file (for relative-path * resolution + diagnostics). */ readonly featureFilePath: string; /** For diagnostics + dedup logging. */ readonly source: { readonly file: string; readonly line: number; }; }; export type SchemaSource = { readonly kind: "imported"; readonly schemaIdentifier: string; readonly schemaModulePath: string; } | { readonly kind: "inline"; /** zod source text — `z.object({ id: z.string() })` etc. */ readonly schemaSource: string; /** Name we'll generate inside `schemas.generated.ts`. Stable * + qualified-name-derived so reorder of features doesn't * rename them. */ readonly generatedConstName: string; }; /** `file` + `line` come as a pair; the location-less variant covers warnings * that aren't tied to a scanned source line (e.g. a codegen-level warning * about a missing manifest file). */ export type ScanWarning = { readonly file: string; readonly line: number; readonly message: string; } | { readonly file?: undefined; readonly line?: undefined; readonly message: string; }; export type ScanResult = { readonly events: readonly ScannedEvent[]; readonly warnings: readonly ScanWarning[]; }; /** Renders a `ScanWarning` for terminal output; omits the location prefix when the warning has no source line. */ export declare function formatScanWarning(warning: ScanWarning): string; export type ScanOptions = { /** App-Wurzel — alles unter `/src` wird gescannt. Tests + * generated-files (`.kumiko`, `dist*`, `node_modules`) sind raus. */ readonly appRoot: string; }; /** * Scant `appRoot/src/**` nach `r.defineEvent(...)`-Aufrufen und liefert * eine deduplizierte Liste aus ScannedEvent. Doppelte qualifiedName * landen mit einer Warnung in der Result — Codegen schreibt nur den * ERSTEN, sodass das generated File compile-stabil bleibt. */ export declare function scanEvents(opts: ScanOptions): ScanResult; /** * Stable identifier-safe rewrite of a qualifiedName like * `pubsubOrders:event:order-placed` → `_kg_pubsubOrders__orderPlaced`. * Used for the `export const` name in `schemas.generated.ts`. Same * transform in scan + render keeps the two sides in sync. */ export declare function qualifiedNameToConstName(qualifiedName: string): string; /** * Resolves the relative schema-import path from the feature-file's * point-of-view to a path relative to `.kumiko/` (which is where the * generated d.ts file lives). Workspace-package specifiers * (`@cosmicdrift/kumiko-...`) are returned as-is. */ export declare function rewriteImportPath(schemaModulePath: string, featureFilePath: string, outputDirAbs: string): string;