/** * @omnify/ts — TypeScript Interface Generator * * Generates TypeScript interfaces from schema definitions. * Handles compound type expansion via expandedProperties, association types, * enum references, and all standard property types. */ import type { SchemaDefinition, PropertyDefinition, TSInterface, TSProperty, GeneratorOptions } from './types.js'; /** Convert PascalCase/camelCase to snake_case. */ export declare function toSnakeCase(str: string): string; /** * Physical FK column name for an owning-side association property. * * The convention is `_id`, but a property already named with * that suffix IS the column — `table_session_id` is what Laravel's `belongsTo` * convention names it and what a legacy table already has. Appending * unconditionally produced `table_session_id_id` (issue #149). */ export declare function toFkColumnName(propertyName: string): string; export declare function getPropertyType(property: PropertyDefinition, allSchemas: Record): string; /** * Convert a property to TSProperty array. * Compound types expand to multiple properties via expandedProperties. * MorphTo and ManyToOne also return multiple properties (FK + relation). */ export declare function propertyToTSProperties(propertyName: string, property: PropertyDefinition, schema: SchemaDefinition, allSchemas: Record, options: GeneratorOptions): TSProperty[]; /** Generate a TSInterface from a schema definition. */ export declare function schemaToInterface(schema: SchemaDefinition, allSchemas: Record, options: GeneratorOptions): TSInterface; /** Format a TypeScript property line. * * Nullable fields (DB column allows NULL) emit `field?: T | null` so * consumers can accept the actual JSON value the backend serializes * (`null`), not just an absent key. Mirrors the Go target's `*T` * pointer convention — `*string` in Go ↔ `string | null` in TS. * Pure-optional fields (e.g. payload DTOs that allow omitting) keep * the `field?: T` shape. Issue #103 Phase 2 TS-Go nullability sync. */ export declare function formatProperty(property: TSProperty): string; /** Format a TypeScript interface. */ export declare function formatInterface(iface: TSInterface): string; /** Generate interfaces for all non-enum, non-hidden schemas. */ export declare function generateInterfaces(schemas: Record, options: GeneratorOptions): TSInterface[]; /** Check if interface uses DateTimeString or DateString types. */ export declare function needsDateTimeImports(iface: TSInterface): { dateTime: boolean; date: boolean; };