/** * @omnify/ts — TypeScript Enum Generator * * Generates TypeScript enums with helper methods from schema enum definitions, * plugin enums (customTypes.enums), and inline property enums. */ import type { SchemaDefinition, TSEnum, TSTypeAlias, GeneratorOptions } from './types.js'; /** Convert a string to PascalCase. */ export declare function toPascalCase(value: string): string; /** Convert enum value to valid TypeScript enum member name. */ export declare function toEnumMemberName(value: string): string; /** Generate TSEnum from a schema enum definition. */ export declare function schemaToEnum(schema: SchemaDefinition, options: GeneratorOptions): TSEnum | null; /** Generate enums from all schema enums. */ export declare function generateEnums(schemas: Record, options: GeneratorOptions): TSEnum[]; /** Generate enums from plugin enums (customTypes.enums in schemas.json). */ export declare function generatePluginEnums(pluginEnums: Record, _options: GeneratorOptions): TSEnum[]; /** Format a TypeScript enum with helpers (Values array, type guard, label getter). * * Two emission shapes (issue #103 Issue 1): * * - `'enum'` (DEFAULT): native `export enum X { ... }` — backwards- * compatible with every project that depended on TS enum semantics * (declaration merging via namespace, etc.) before v5.8.34. * * - `'const'`: `export const X = {...} as const; export type X = ...` — * compiles under TS 5.5+ `erasableSyntaxOnly` (Vite 7 default). * Call-site ergonomics identical to enum: `X.User === 'user'` works, * string union narrowing works, all helper signatures unchanged. * * Pass `style` to pick. Default preserves the pre-v5.8.34 behavior so an * upgrade without config change doesn't break consumer code. */ export declare function formatEnum(enumDef: TSEnum, style?: 'enum' | 'const'): string; /** Format a TypeScript type alias with helpers. */ export declare function formatTypeAlias(alias: TSTypeAlias): string; /** Result of extracting inline enums. */ export interface ExtractedInlineEnum { typeAlias?: TSTypeAlias; enum?: TSEnum; } /** Extract inline enums from Enum/Select properties. */ export declare function extractInlineEnums(schemas: Record, options: GeneratorOptions): ExtractedInlineEnum[];