/** * Codec system for handling different file formats * Framework-agnostic implementation */ import { EventSystem } from '../../utils/event_system'; export interface CodecOptions { id: string; name?: string; extension?: string; format?: any; export_options?: Record; remember?: boolean; multiple_per_file?: boolean; support_partial_export?: boolean; load_filter?: { extensions?: string[]; [key: string]: any; }; plugin?: string; } export interface CodecCallbacks { load?: (model: any, file: any, args?: any) => void; parse?: (model: any, path?: string, args?: any) => void; compile?: (options?: any) => string; write?: (content: string, path: string) => void; overwrite?: (content: string, path: string, callback: (path: string) => void) => void; export?: () => Promise; exportCollection?: (collection: any) => Promise; writeCollection?: (collection: any) => Promise; fileName?: () => string; afterSave?: (path: string) => void; afterDownload?: (path: string) => void; merge?: (data: any) => void; } export declare class Codec extends EventSystem { id: string; name: string; extension: string; format?: any; export_options: Record; remember: boolean; multiple_per_file: boolean; support_partial_export: boolean; load_filter?: { extensions?: string[]; [key: string]: any; }; plugin?: string; context: any; parse?: (model: any, path?: string, args?: any) => void; compile?: (options?: any) => string; write?: (content: string, path: string) => void; overwrite?: (content: string, path: string, callback: (path: string) => void) => void; export?: () => Promise; exportCollection?: (collection: any) => Promise; writeCollection?: (collection: any) => Promise; fileName?: () => string; afterSave?: (path: string) => void; afterDownload?: (path: string) => void; merge?: (data: any) => void; constructor(id: string, data?: CodecOptions & CodecCallbacks); /** * Get export options (merged with saved options) */ getExportOptions(savedOptions?: Record): Record; /** * Load a model from file */ load(model: any, file: any, args?: any): boolean; /** * Compile model to string */ compile(options?: Record): string; /** * Get file name for export */ getFileName(projectName?: string, collectionName?: string): string; /** * Write content to file */ writeFile(content: string, path: string): void; /** * Handle file overwrite */ handleOverwrite(content: string, path: string, callback: (path: string) => void): void; /** * Export model */ exportModel(options?: Record): Promise; /** * Export collection */ exportCollectionModel(collection: any): Promise; /** * Get all supported extensions */ getSupportedExtensions(): string[]; } /** * Codec registry */ export declare class CodecRegistry { private codecs; /** * Register a codec */ register(codec: Codec): void; /** * Get codec by ID */ get(id: string): Codec | undefined; /** * Get all codecs */ getAll(): Codec[]; /** * Get codec by extension */ getByExtension(extension: string): Codec | undefined; /** * Get all supported extensions */ getAllExtensions(): string[]; /** * Remove codec */ remove(id: string): boolean; /** * Clear all codecs */ clear(): void; } export declare const codecRegistry: CodecRegistry; //# sourceMappingURL=codec.d.ts.map