UNPKG

@finos/legend-application-studio

Version:
171 lines 9.66 kB
/** * 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 { PANEL_MODE, GRAPH_EDITOR_MODE, EDITOR_MODE } from './EditorConfig.js'; import { EditorGraphState } from './EditorGraphState.js'; import { ChangeDetectionState } from './ChangeDetectionState.js'; import { NewElementState } from './NewElementState.js'; import { WorkspaceUpdaterState } from './sidebar-state/WorkspaceUpdaterState.js'; import { ProjectOverviewState } from './sidebar-state/ProjectOverviewState.js'; import { WorkspaceReviewState } from './sidebar-state/WorkspaceReviewState.js'; import { type LocalChangesState } from './sidebar-state/LocalChangesState.js'; import { WorkspaceWorkflowManagerState } from './sidebar-state/WorkflowManagerState.js'; import { type GeneratorFn, ActionState, type Clazz } from '@finos/legend-shared'; import { EditorSDLCState } from './EditorSDLCState.js'; import { ModelImporterState } from './editor-state/ModelImporterState.js'; import { ProjectConfigurationEditorState } from './editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js'; import type { ElementFileGenerationState } from './editor-state/element-editor-state/ElementFileGenerationState.js'; import { DevToolPanelState } from './panel-group/DevToolPanelState.js'; import { type StudioQueryParams, type WorkspaceEditorPathParams } from '../../__lib__/LegendStudioNavigation.js'; import { PanelDisplayState } from '@finos/legend-art'; import type { Entity } from '@finos/legend-storage'; import { WorkspaceType, type SDLCServerClient } from '@finos/legend-server-sdlc'; import { GraphManagerState } from '@finos/legend-graph'; import type { DepotServerClient } from '@finos/legend-server-depot'; import type { LegendStudioPluginManager } from '../../application/LegendStudioPluginManager.js'; import { type CommandRegistrar } from '@finos/legend-application'; import type { EditorMode } from './EditorMode.js'; import { WorkspaceUpdateConflictResolutionState } from './sidebar-state/WorkspaceUpdateConflictResolutionState.js'; import { GlobalTestRunnerState } from './sidebar-state/testable/GlobalTestRunnerState.js'; import type { LegendStudioApplicationStore } from '../LegendStudioBaseStore.js'; import { EmbeddedQueryBuilderState } from './EmbeddedQueryBuilderState.js'; import { EditorTabManagerState } from './EditorTabManagerState.js'; import type { GraphEditorMode } from './GraphEditorMode.js'; import { GlobalBulkServiceRegistrationState } from './sidebar-state/BulkServiceRegistrationState.js'; import { StudioSQLPlaygroundPanelState } from './panel-group/StudioSQLPlaygroundPanelState.js'; import { LegendSQLStudioPlaygroundState } from './LegendSQLStudioPlaygroundState.js'; import type { QuickInputState } from './QuickInputState.js'; import { GlobalEndToEndWorkflowState } from './sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.js'; import { LazyTextEditorStore } from '../lazy-text-editor/LazyTextEditorStore.js'; import type { QueryBuilderDataCubeViewerState } from '@finos/legend-query-builder'; import { EditorInitialConfiguration } from './editor-state/element-editor-state/ElementEditorInitialConfiguration.js'; import { LakehouseIngestionManager } from '@finos/legend-server-lakehouse'; import { DevMetadataState } from './sidebar-state/dev-metadata/DevMetadataState.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; abstract get INTERNAL__identifierKey(): string; } export declare class EditorStore implements CommandRegistrar { readonly applicationStore: LegendStudioApplicationStore; readonly sdlcServerClient: SDLCServerClient; readonly depotServerClient: DepotServerClient; readonly ingestionManager: LakehouseIngestionManager | undefined; readonly pluginManager: LegendStudioPluginManager; /** * This is a mechanism to have the store holds references to extension states * so that we can refer back to these states when needed or do cross-extensions * operations */ readonly extensionStates: EditorExtensionState[]; readonly initState: ActionState; initialEntityPath?: string | undefined; editorConfig: EditorInitialConfiguration | undefined; editorMode: EditorMode; mode: EDITOR_MODE; sdlcState: EditorSDLCState; changeDetectionState: ChangeDetectionState; graphState: EditorGraphState; graphManagerState: GraphManagerState; graphEditorMode: GraphEditorMode; explorerTreeState: ExplorerTreeState; projectOverviewState: ProjectOverviewState; workspaceWorkflowManagerState: WorkspaceWorkflowManagerState; globalTestRunnerState: GlobalTestRunnerState; workspaceUpdaterState: WorkspaceUpdaterState; workspaceReviewState: WorkspaceReviewState; localChangesState: LocalChangesState; conflictResolutionState: WorkspaceUpdateConflictResolutionState; globalBulkServiceRegistrationState: GlobalBulkServiceRegistrationState; globalEndToEndWorkflowState: GlobalEndToEndWorkflowState; devToolState: DevToolPanelState; devMetadataState: DevMetadataState; studioSqlPlaygroundState: StudioSQLPlaygroundPanelState; legendSQLStudioPlaygroundState: LegendSQLStudioPlaygroundState; modelImporterState: ModelImporterState; projectConfigurationEditorState: ProjectConfigurationEditorState; embeddedQueryBuilderState: EmbeddedQueryBuilderState; embeddedDataCubeViewerState: QueryBuilderDataCubeViewerState | undefined; 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[]; showSearchElementCommand: boolean; quickInputState?: QuickInputState<unknown> | undefined; activePanelMode: PANEL_MODE; readonly panelGroupDisplayState: PanelDisplayState; activeActivity?: string; readonly sideBarDisplayState: PanelDisplayState; readonly showcasePanelDisplayState: PanelDisplayState; readonly showcaseDefaultSize = 500; readonly tabManagerState: EditorTabManagerState; supportedElementTypesWithCategory: Map<string, string[]>; lazyTextEditorStore: LazyTextEditorStore; constructor(applicationStore: LegendStudioApplicationStore, sdlcServerClient: SDLCServerClient, depotServerClient: DepotServerClient); get showcaseInitialSize(): number; get isInitialized(): boolean; get isInViewerMode(): boolean; get disableGraphEditing(): boolean; get isInConflictResolutionMode(): boolean; setEditorMode(val: EditorMode): void; setMode(val: EDITOR_MODE): void; setShowSearchElementCommand(val: boolean): void; setEmbeddedDataCubeViewerState(val: QueryBuilderDataCubeViewerState | undefined): void; setQuickInputState<T>(val: QuickInputState<T> | undefined): void; cleanUp(): void; /** * TODO?: we should really think of how we could simplify the trigger condition below * after we refactor editor modes * * See https://github.com/finos/legend-studio/issues/317 */ createEditorCommandTrigger(additionalChecker?: () => boolean): () => boolean; registerCommands(): void; deregisterCommands(): void; reset(): void; deCodeStudioQueryParams(studioParams: Partial<StudioQueryParams> | undefined): void; internalizeEntityPath(params: Partial<WorkspaceEditorPathParams>, studioParams: Partial<StudioQueryParams> | undefined): 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, patchReleaseVersionId: string | undefined, workspaceId: string, workspaceType: WorkspaceType, studioParams: Partial<StudioQueryParams> | undefined): GeneratorFn<void>; initMode(): GeneratorFn<void>; private initStandardMode; initializeLazyTextMode(): GeneratorFn<void>; private initConflictResolutionMode; buildGraph(graphEntities?: Entity[]): GeneratorFn<void>; setActiveActivity(activity: string, options?: { keepShowingIfMatchedCurrent?: boolean; }): void; setActivePanelMode(val: PANEL_MODE): void; toggleTextMode(): GeneratorFn<void>; getSupportedElementTypesWithCategory(): Map<string, string[]>; getSupportedElementTypes(): string[]; switchModes(to: GRAPH_EDITOR_MODE, fallbackOptions?: { isCompilationFailure?: boolean; isGraphBuildFailure?: boolean; useStoredEntities?: boolean; }): GeneratorFn<void>; getGraphEditorMode<T extends GraphEditorMode>(clazz: Clazz<T>): T; } //# sourceMappingURL=EditorStore.d.ts.map