import type { CollectionSchemaBase, SchemaBase } from './dsl.js'; import type { DtoMessage } from './dto.js'; import type { EntitySchema } from './entity.js'; import type { FrontAppSchema, ProjectApiSchema } from './project.js'; /** A source/target collection of a convert — dto or entity. Entity sources * may carry aggregate fields (aggField), e.g. an aggregate result entity * projected into a wire message. */ export type ConvertSourceSchema = DtoMessage | EntitySchema; /** Method input for defineConvert: type/schema/name are set by the builder. */ export type ConvertMethodDef = Omit; /** One conversion: multiple source collections → single target collection. */ export interface ConvertMethodSchema extends SchemaBase { type: 'convertMethod'; /** The convert file this method belongs to. */ schema: ConvertSchema; /** Source schemas — one or more, mixed dimensions. */ sources: ConvertSourceSchema[]; /** Target schema — the single integrated collection. */ target: ConvertSourceSchema; } /** Declares multi-source → single-target schema integrations grouped by source identity. */ export interface ConvertSchema extends CollectionSchemaBase { type: 'convert'; /** The backend api module this convert belongs to (shared instance from * project.config.ts apis). Storage is convert_schema/{api.name}/{app.name}/ * — same layout as service_schema. */ api: ProjectApiSchema; /** The app (module) this convert belongs to — its artifact lands in modules/{app}/convert/. */ app: FrontAppSchema; /** Methods keyed by name — the map key is written back as the method name. */ methods: Record; } export declare function defineConvert(options: { name: string; api: ProjectApiSchema; app: FrontAppSchema; methods: Record; description?: string; }): ConvertSchema;