ecore-ts
Version:
Ecore (EMOF) TypeScript Implementation
38 lines (37 loc) • 1.24 kB
TypeScript
import { EObject } from './ecore.ts';
export declare let ResourceSet: EResourceSet;
export declare const EJSON: {
dataType: string;
contentType: string;
parse(model: EResource, data: any): void;
to: (model: any) => any;
};
export interface EResource extends EObject {
uri: string;
contents: EObject[];
resourceSet?: typeof ResourceSet;
add: (eObject: EObject) => EResource;
addAll: (eObject: EObject[]) => EResource;
clear: () => EResource;
getEObject: (fragment: any) => EObject;
each: (iterator: Function, context: any) => any;
to: (formatter: {
to: Function;
} | unknown, indent?: boolean) => any;
parse: (data: any, loader: {
parse: (eObject: EObject, data: any) => void;
}) => EResource;
save: (callback: Function, options: Record<any, any>) => void;
load: (data: any, callback: Function, options?: Record<any, any>) => void;
remove: () => void;
_index: () => any;
__index: number;
__updateIndex: number;
}
export declare const Resource: EObject;
export interface EResourceSet extends EObject {
uri?: string;
resources: EObject[];
elements: (type?: any) => EObject[];
getEObject: (uri: string) => EObject | null;
}