@tripsnek/tmf
Version:
TypeScript Modeling Framework - A TypeScript port of the Eclipse Modeling Framework (EMF)
51 lines • 1.82 kB
TypeScript
import { EPackage } from '../metamodel/api/epackage.js';
/**
* Writes an EPackage metamodel to an XML Ecore file.
*/
export declare class EcoreWriter {
private stringWriter;
/**
* Converts an EPackage to Ecore XML string format.
* @param ePackage The root package to serialize
* @returns The XML string representation
*/
writeToString(ePackage: EPackage): string;
/**
* Writes an EPackage to an Ecore XML file.
* @param ePackage The root package to serialize
* @param filePath The path where the .ecore file will be written
* @deprecated Use writeToFileAsync instead for bundle-safe operation
*/
writeToFile(ePackage: EPackage, filePath: string): Promise<void>;
/**
* Async version of writeToFile for better error handling
*/
writeToFileAsync(ePackage: EPackage, filePath: string): Promise<void>;
/**
* Browser-compatible file saving via download
* @param ePackage The root package to serialize
* @param filename The filename for download
*/
saveAsDownload(ePackage: EPackage, filename: string): void;
/**
* Universal save method - chooses appropriate strategy based on environment
*/
save(ePackage: EPackage, pathOrFilename: string): Promise<void>;
/**
* Universal async save method
*/
saveAsync(ePackage: EPackage, pathOrFilename: string): Promise<void>;
/**
* Check if file writing is supported in current environment
*/
static isFileWritingSupported(): boolean;
/**
* Check if download saving is supported in current environment
*/
static isDownloadSupported(): boolean;
/**
* Get supported operations in current environment
*/
static getSupportedOperations(): string[];
}
//# sourceMappingURL=ecorewriter.d.ts.map