ecore-ts
Version:
Ecore (EMOF) TypeScript Implementation
74 lines (73 loc) • 3.48 kB
TypeScript
import { EResource } from './resource.ts';
export declare function create<T extends EObject>(eClass: EObject | unknown, attributes?: Record<any, any> | string): T;
export declare class EObject {
_: any;
eClass: any;
values: Record<any, any>;
private _callbacks?;
eContainingFeature: any;
eContainer?: EObject | EResource;
private __updateContents;
private __eContents;
_id: any;
Registry: ERegistry;
constructor(attributes?: Record<any, any>);
getEStructuralFeature(feature: any): any;
on(events: string, callback: (eObject: EObject | string) => void, context?: any): this;
off(events: string, callback?: any, context?: any): this;
trigger(events: string, ...rest: any[]): this;
initOperations(eObject: EObject): void;
create<T extends EObject>(attributes?: Record<any, any> | string): T | undefined;
has(name: string): any;
isSet(name: string): boolean;
set(attrs: Record<any, any> | string | null, options?: any): this;
unset(attrs: Record<any, any> | string, _?: any): this;
get<T>(feature: EObject | string): T | null;
isTypeOf(type: EObject | string): boolean;
isKindOf(type: EObject | string): any;
eResource(): EObject | null;
eContents(): any;
eURI(): string;
fragment(): string | null;
}
export declare class EList<T extends EObject = any> {
private _internal;
private readonly _owner;
private _size;
_feature: any;
private _isContainment;
constructor(owner: any, feature?: any);
get length(): number;
_setFeature(feature: any): void;
add(eObject: T | unknown): this;
push(eObject: T | unknown): void;
addAll(): this;
remove(eObject: T): this;
clear(): this;
size(): number;
at<T>(position: number): T | EObject;
array(): T[];
forEach(iterator: (e: T) => void): void;
first(): T | EObject | undefined;
last(): T | undefined;
each(iterator: (e: T) => void): void;
filter(iterator: (e: T) => any): any[];
find(iterator: (e: T) => any): any;
map(iterator: (e: T) => any): any[];
contains(object: T | unknown): boolean;
includes(object: T | unknown): boolean;
indexOf(object: T | unknown): number;
}
export declare const EClass: EObject, EString: EObject, EInt: EObject, EBoolean: EObject, EDouble: EObject, EDate: EObject, EIntegerObject: EObject, EFloatObject: EObject, ELongObject: EObject, EMap: EObject, EDiagnosticChain: EObject, JSObject: EObject, EClass_abstract: EObject, EClass_interface: EObject, EClass_eStructuralFeatures: EObject, EClass_eOperations: EObject, EClass_eSuperTypes: EObject;
export declare const EObjectClass: EObject, EModelElement: EObject, EAnnotation: EObject, ENamedElement: EObject, EPackage: EObject, EClassifier: EObject, EDataType: EObject, EEnum: EObject, ETypedElement: EObject, EStructuralFeature: EObject, EAttribute: EObject, EReference: EObject, EOperation: EObject, EParameter: EObject, EEnumLiteral: EObject, EGenericType: EObject, ETypeParameter: EObject;
export declare const EStringToStringMapEntry: EObject;
export declare const EStringToStringMapEntry_key: EObject;
export declare const EStringToStringMapEntry_value: EObject;
export declare const EcorePackage: EObject;
export interface ERegistry {
_ePackages: Record<any, any>;
getEPackage: (nsURI: string) => any;
register: (ePackage: typeof EPackage) => void;
ePackages: () => any[];
elements: (type: EObject | unknown) => any[];
}