@finos/legend-studio
Version:
174 lines • 10 kB
TypeScript
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ExplorerTreeState } from './ExplorerTreeState.js';
import { ACTIVITY_MODE, AUX_PANEL_MODE, GRAPH_EDITOR_MODE, EDITOR_MODE } from './EditorConfig.js';
import { ElementEditorState } from './editor-state/element-editor-state/ElementEditorState.js';
import { EditorGraphState } from './EditorGraphState.js';
import { ChangeDetectionState } from './ChangeDetectionState.js';
import { NewElementState } from './editor/NewElementState.js';
import { WorkspaceUpdaterState } from './sidebar-state/WorkspaceUpdaterState.js';
import { ProjectOverviewState } from './sidebar-state/ProjectOverviewState.js';
import { WorkspaceReviewState } from './sidebar-state/WorkspaceReviewState.js';
import { LocalChangesState } from './sidebar-state/LocalChangesState.js';
import { WorkspaceWorkflowManagerState } from './sidebar-state/WorkflowManagerState.js';
import { GrammarTextEditorState } from './editor-state/GrammarTextEditorState.js';
import { type Clazz, type GeneratorFn, ActionState } from '@finos/legend-shared';
import { EditorSDLCState } from './EditorSDLCState.js';
import { ModelLoaderState } from './editor-state/ModelLoaderState.js';
import type { EditorState } from './editor-state/EditorState.js';
import { EntityDiffViewState } from './editor-state/entity-diff-editor-state/EntityDiffViewState.js';
import { ProjectConfigurationEditorState } from './editor-state/ProjectConfigurationEditorState.js';
import { EntityChangeConflictEditorState } from './editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.js';
import type { GenerationFile } from './shared/FileGenerationTreeUtil.js';
import type { ElementFileGenerationState } from './editor-state/element-editor-state/ElementFileGenerationState.js';
import { DevToolState } from './aux-panel-state/DevToolState.js';
import { HotkeyConfiguration, NonBlockingDialogState, PanelDisplayState } from '@finos/legend-art';
import type { Entity } from '@finos/legend-model-storage';
import { type SDLCServerClient, type WorkspaceType } from '@finos/legend-server-sdlc';
import { type PackageableElement, type Type, type Store, type GraphManagerState, Class, Enumeration, Profile, Association, Mapping, Service, PackageableRuntime, DataElement } from '@finos/legend-graph';
import type { DepotServerClient } from '@finos/legend-server-depot';
import type { LegendStudioPluginManager } from '../application/LegendStudioPluginManager.js';
import { type ActionAlertInfo, type BlockingAlertInfo, type PackageableElementOption } from '@finos/legend-application';
import type { EditorMode } from './editor/EditorMode.js';
import { WorkspaceUpdateConflictResolutionState } from './sidebar-state/WorkspaceUpdateConflictResolutionState.js';
import { GlobalTestRunnerState } from './sidebar-state/testable/GlobalTestRunnerState.js';
import type { LegendStudioApplicationStore } from './LegendStudioBaseStore.js';
export declare abstract class EditorExtensionState {
/**
* This helps to better type-check for this empty abtract type
* See https://github.com/finos/legend-studio/blob/master/docs/technical/typescript-usage.md#understand-typescript-structual-type-system
*/
private readonly _$nominalTypeBrand;
}
export declare class EditorStore {
applicationStore: LegendStudioApplicationStore;
sdlcServerClient: SDLCServerClient;
depotServerClient: DepotServerClient;
pluginManager: LegendStudioPluginManager;
editorMode: EditorMode;
setEditorMode(val: EditorMode): void;
mode: EDITOR_MODE;
setMode(val: EDITOR_MODE): void;
get isInViewerMode(): boolean;
get isInConflictResolutionMode(): boolean;
editorExtensionStates: EditorExtensionState[];
explorerTreeState: ExplorerTreeState;
sdlcState: EditorSDLCState;
graphState: EditorGraphState;
graphManagerState: GraphManagerState;
changeDetectionState: ChangeDetectionState;
grammarTextEditorState: GrammarTextEditorState;
modelLoaderState: ModelLoaderState;
projectConfigurationEditorState: ProjectConfigurationEditorState;
projectOverviewState: ProjectOverviewState;
workspaceWorkflowManagerState: WorkspaceWorkflowManagerState;
globalTestRunnerState: GlobalTestRunnerState;
workspaceUpdaterState: WorkspaceUpdaterState;
workspaceReviewState: WorkspaceReviewState;
localChangesState: LocalChangesState;
conflictResolutionState: WorkspaceUpdateConflictResolutionState;
devToolState: DevToolState;
private _isDisposed;
initState: ActionState;
graphEditMode: GRAPH_EDITOR_MODE;
activeAuxPanelMode: AUX_PANEL_MODE;
auxPanelDisplayState: PanelDisplayState;
activeActivity?: ACTIVITY_MODE;
sideBarDisplayState: PanelDisplayState;
blockGlobalHotkeys: boolean;
defaultHotkeys: HotkeyConfiguration[];
hotkeys: HotkeyConfiguration[];
currentEditorState?: EditorState | undefined;
openedEditorStates: EditorState[];
newElementState: NewElementState;
/**
* Since we want to share element generation state across all element in the editor, we will create 1 element generate state
* per file generation configuration type.
*/
elementGenerationStates: ElementFileGenerationState[];
searchElementCommandState: NonBlockingDialogState;
backdrop: boolean;
ignoreNavigationBlocking: boolean;
isDevToolEnabled: boolean;
constructor(applicationStore: LegendStudioApplicationStore, sdlcServerClient: SDLCServerClient, depotServerClient: DepotServerClient, graphManagerState: GraphManagerState, pluginManager: LegendStudioPluginManager);
get isInitialized(): boolean;
get isInGrammarTextMode(): boolean;
get isInFormMode(): boolean;
get hasUnpushedChanges(): boolean;
setDevTool(val: boolean): void;
setHotkeys(val: HotkeyConfiguration[]): void;
addHotKey(val: HotkeyConfiguration): void;
resetHotkeys(): void;
setBlockGlobalHotkeys(val: boolean): void;
setCurrentEditorState(val: EditorState | undefined): void;
setBackdrop(val: boolean): void;
setActiveAuxPanelMode(val: AUX_PANEL_MODE): void;
setIgnoreNavigationBlocking(val: boolean): void;
refreshCurrentEntityDiffEditorState(): void;
setBlockingAlert(alertInfo: BlockingAlertInfo | undefined): void;
setActionAlertInfo(alertInfo: ActionAlertInfo | undefined): void;
cleanUp(): void;
reset(): void;
/**
* This is the entry of the app logic where the initialization of editor states happens
* Here, we ensure the order of calls after checking existence of current project and workspace
* If either of them does not exist, we cannot proceed.
*/
initialize(projectId: string, workspaceId: string, workspaceType: WorkspaceType): GeneratorFn<void>;
initMode(): GeneratorFn<void>;
private initStandardMode;
private initConflictResolutionMode;
buildGraph(graphEntities?: Entity[]): GeneratorFn<void>;
getCurrentEditorState<T extends EditorState>(clazz: Clazz<T>): T;
getEditorExtensionState<T extends EditorExtensionState>(clazz: Clazz<T>): T;
setGraphEditMode(graphEditor: GRAPH_EDITOR_MODE): void;
setActiveActivity(activity: ACTIVITY_MODE, options?: {
keepShowingIfMatchedCurrent?: boolean;
}): void;
closeState(editorState: EditorState): void;
closeAllOtherStates(editorState: EditorState): void;
closeAllStates(): void;
openState(editorState: EditorState): void;
openEntityDiff(entityDiffEditorState: EntityDiffViewState): void;
openEntityChangeConflict(entityChangeConflictEditorState: EntityChangeConflictEditorState): void;
/**
* This method helps open editor that only exists one instance at at time such as model-loader, project config, settings ...
*/
openSingletonEditorState(singularEditorState: ModelLoaderState | ProjectConfigurationEditorState): void;
createElementState(element: PackageableElement): ElementEditorState | undefined;
openElement(element: PackageableElement): void;
addElement(element: PackageableElement, packagePath: string | undefined, openAfterCreate: boolean): GeneratorFn<void>;
deleteElement(element: PackageableElement): GeneratorFn<void>;
renameElement(element: PackageableElement, newPath: string): GeneratorFn<void>;
reprocessElementEditorState: (editorState: EditorState) => EditorState | undefined;
findCurrentEditorState: (editor: EditorState | undefined) => EditorState | undefined;
openGeneratedFile(file: GenerationFile): void;
createGlobalHotKeyAction: (handler: (event?: KeyboardEvent) => void, preventDefault?: boolean) => (event?: KeyboardEvent) => void;
closeAllEditorTabs(): void;
toggleTextMode(): GeneratorFn<void>;
get enumerationOptions(): PackageableElementOption<Enumeration>[];
get classOptions(): PackageableElementOption<Class>[];
get associationOptions(): PackageableElementOption<Association>[];
get profileOptions(): PackageableElementOption<Profile>[];
get classPropertyGenericTypeOptions(): PackageableElementOption<Type>[];
get mappingOptions(): PackageableElementOption<Mapping>[];
get runtimeOptions(): PackageableElementOption<PackageableRuntime>[];
get serviceOptions(): PackageableElementOption<Service>[];
get storeOptions(): PackageableElementOption<Store>[];
get dataOptions(): PackageableElementOption<DataElement>[];
getSupportedElementTypes(): string[];
}
//# sourceMappingURL=EditorStore.d.ts.map