@eclipse-emfcloud/model-service
Version:
Model service framework
62 lines • 2.85 kB
TypeScript
import { ModelAccessorBus } from '@eclipse-emfcloud/model-accessor-bus';
import { CommandStack, DirtyStateChangedCallback, ModelManager } from '@eclipse-emfcloud/model-manager';
import { Diagnostic, ModelValidationService } from '@eclipse-emfcloud/model-validation';
import { ModelHub, ModelHubSubscription, ModelServiceContribution } from '../api';
export declare class ModelHubImpl<K = string, C = unknown> implements ModelHub<K, C> {
context: C;
private modelManager;
private validationService;
private modelAccessorBus;
private contributions;
private subscriptions;
private selfSubscription;
private modelManagerSubscription;
private liveValidationSubscription;
private dirtyStateSub;
private dirtyState;
private pendingLoads;
private disposed;
constructor(context: C, modelManager: ModelManager<K>, validationService: ModelValidationService<K>, modelAccessorBus: ModelAccessorBus);
dispose(): void;
get isDisposed(): boolean;
addModelServiceContribution<M extends object = object>(modelServiceContribution: ModelServiceContribution<K, M>): void;
get liveValidation(): boolean;
set liveValidation(liveValidation: boolean);
private get triggerEngine();
getModelService<S = unknown>(id: string): S | undefined;
getModelAccessorBus(): ModelAccessorBus;
getModel<M extends object = object>(modelId: K): Promise<M>;
private loadModel;
subscribe<M extends object = object>(...modelIds: K[]): ModelHubSubscription<K, M>;
save(...commandStackIds: string[]): Promise<boolean>;
validateModels(...modelIds: K[]): Promise<Diagnostic>;
getValidationState(...modelIds: K[]): Diagnostic | undefined;
protected getCommandStack(commandStackId: string): CommandStack<K>;
undo(commandStackId: string): Promise<boolean>;
redo(commandStackId: string): Promise<boolean>;
flush(commandStackId: string): boolean;
isDirty(commandStackId: string): boolean;
protected handleDirtyStateChanged(...args: Parameters<DirtyStateChangedCallback<K>>): void;
private getPersistenceContribution;
/**
* Handle the self-subscription notification of the loading of the
* identified model. This default implementation validates the newly
* loaded model if {@link liveValidation} is on.
*/
protected handleModelLoaded(modelId: K): void;
/**
* Invoke the model-loaded call-back of subscribers for the given
* model ID that have the call-back.
*/
private notifyModelLoaded;
/**
* Invoke the model-unloaded call-back of subscribers for the given
* model ID that have the call-back.
*/
private notifyModelUnloaded;
/**
* Invoke the disposed call-back of subscribers that have the call-back.
*/
private notifyDisposed;
}
//# sourceMappingURL=model-hub-impl.d.ts.map