UNPKG

@finos/legend-application-studio

Version:
64 lines 3.2 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 { type PackageableElement } from '@finos/legend-graph'; import { type Clazz } from '@finos/legend-shared'; import type { EditorState } from './editor-state/EditorState.js'; import { ElementEditorState } from './editor-state/element-editor-state/ElementEditorState.js'; import type { EditorStore } from './EditorStore.js'; import { TabManagerState } from '@finos/legend-lego/application'; import type { EditorInitialConfiguration } from './editor-state/element-editor-state/ElementEditorInitialConfiguration.js'; export declare class EditorTabManagerState extends TabManagerState { readonly editorStore: EditorStore; currentTab?: EditorState | undefined; tabs: EditorState[]; cachedTabs: { openedTabEditorPaths: string[]; currentTabState: EditorState | undefined; currentTabElementPath: string | undefined; } | undefined; constructor(editorStore: EditorStore); get dndType(): string; /** * Here we store the element paths of the * elements editors as element paths don't refer to the actual graph. We can find the element * from the new graph that is built by using element path and can reprocess the element editor states. * The other kind of editors we reprocess are file generation editors, we store them as is as they don't * hold any reference to the actual graph. */ cacheAndClose(options?: { cacheGeneration?: boolean; }): void; clearTabCache(): void; getCurrentEditorState<T extends EditorState>(clazz: Clazz<T>): T; createElementEditorState(element: PackageableElement, config?: EditorInitialConfiguration): ElementEditorState | undefined; refreshCurrentEntityDiffViewer(): void; /** * After we do graph processing, we want to recover the tabs * * NOTE: we have to flush old tab states to ensure, we have no reference * to the old graph to avoid memory leak. Here, we only recreate element * editor tabs, and keep special editors open. Some tabs will be closed. * But we **ABSOLUTELY** must never make this behavior customizable by extension * i.e. we should not allow extension control if a tab should be kept open, because * the plugin implementation could accidentally reference older graph and therefore * cause memory issues * * See https://github.com/finos/legend-studio/issues/1713 */ recoverTabs: () => void; findCurrentTab: (tab: EditorState | undefined, tabElementPath: string | undefined) => EditorState | undefined; } //# sourceMappingURL=EditorTabManagerState.d.ts.map