import type { JSONSchema7Definition } from "json-schema"; import { type TypescriptConverterOpts } from "./typescript/index.js"; import { type KotlinConverterOpts } from "./kotlin/index.js"; import { type SwiftConverterOpts } from "./swift/index.js"; /** * The structured result of emitting source for a JSON Schema. * * Returned by {@link emitTypescript}, {@link emitKotlin}, and {@link emitSwift}. */ export interface EmitResult { /** * The generated source code. Contains type/struct/data-class declarations * only — no `import` lines (Kotlin) or module imports (Swift). Consumers * assemble the final file by combining {@link imports} with this string. */ code: string; /** Name of the top-level type that the schema's root maps to. */ rootTypeName: string; /** * Names of every additional named declaration emitted besides the root — * nested object types, enums, sealed-interface variants, and similar. * Useful for downstream codegen that wants to reference these by name * without parsing the {@link code} string. */ extractedTypeNames: string[]; /** * Required imports for the emitted code, as fully-qualified module/symbol * paths (Kotlin) or module names (Swift). Empty for TypeScript. * * Format the value into the language's `import` statement at assembly time. * Example: * * const file = [...imports.map((i) => `import ${i}`), "", code].join("\n"); */ imports: string[]; /** * Names of external, already-defined types this output references via the * `x-named-type` schema keyword. ajsc does NOT declare these — the caller * defines them elsewhere and wires the import/reference. Deduped and sorted. */ referencedNamedTypes: string[]; } /** * Emits TypeScript source for the given JSON Schema. * * Wraps {@link TypescriptConverter} with the {@link EmitResult} shape used by * the other language emitters. For advanced use (custom subclassing, deep * options reuse), import {@link TypescriptConverter} directly from `ajsc/typescript`. */ export declare function emitTypescript(schema: JSONSchema7Definition, opts?: TypescriptConverterOpts): EmitResult; /** * Emits Kotlin source for the given JSON Schema. * * Defaults: `serializer: "kotlinx"` (emits `@Serializable` data classes for * use with kotlinx-serialization). Pass `serializer: "none"` for plain types * with no annotations. * * For advanced use (custom subclassing), import {@link KotlinConverter} * directly from `ajsc/kotlin`. */ export declare function emitKotlin(schema: JSONSchema7Definition, opts?: KotlinConverterOpts): EmitResult; /** * Emits Swift source for the given JSON Schema. * * Defaults: `serializer: "codable"` (emits `Codable`-conforming structs). * Pass `serializer: "none"` for plain types with no Codable conformance. * * For advanced use (custom subclassing), import {@link SwiftConverter} * directly from `ajsc/swift`. */ export declare function emitSwift(schema: JSONSchema7Definition, opts?: SwiftConverterOpts): EmitResult; export { TypescriptConverter } from "./typescript/index.js"; export type { TypescriptConverterOpts } from "./typescript/index.js"; export { KotlinConverter } from "./kotlin/index.js"; export type { KotlinConverterOpts } from "./kotlin/index.js"; export { SwiftConverter } from "./swift/index.js"; export type { SwiftConverterOpts } from "./swift/index.js";