import { interfaces } from '@theia/core/shared/inversify'; import { ApplicationShell, BaseWidget, ExtractableWidget, Message, Panel, SplitLayout, SplitPanel, SplitPositionHandler, StatefulWidget, StorageService, Widget, WidgetManager } from '@theia/core/lib/browser'; import { DisposableCollection, Emitter, ILogger } from '@theia/core'; import { TerminalWidget, TerminalWidgetOptions } from '@theia/terminal/lib/browser/base/terminal-widget'; import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state'; import { TerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution'; import { TerminalManagerPreferences } from './terminal-manager-preferences'; import { TerminalManagerTreeTypes } from './terminal-manager-types'; import { TerminalManagerTreeWidget } from './terminal-manager-tree-widget'; export declare namespace TerminalManagerWidgetState { interface BaseLayoutData { id: ID; } interface TerminalWidgetLayoutData { widget: TerminalWidget | undefined; } interface TerminalGroupLayoutData extends BaseLayoutData { childLayouts: TerminalWidgetLayoutData[]; widgetRelativeHeights: number[] | undefined; } interface PageLayoutData extends BaseLayoutData { childLayouts: TerminalGroupLayoutData[]; groupRelativeWidths: number[] | undefined; } interface TerminalManagerLayoutData extends BaseLayoutData<'ParentPanel'> { childLayouts: PageLayoutData[]; } const isLayoutData: (obj: unknown) => obj is LayoutData; interface PanelRelativeSizes { terminal: number; tree: number; } interface LayoutData { items?: TerminalManagerLayoutData; widget: TerminalManagerTreeWidget; terminalAndTreeRelativeSizes: PanelRelativeSizes | undefined; } } export declare class TerminalManagerWidget extends BaseWidget implements StatefulWidget, ApplicationShell.TrackableWidgetProvider, ExtractableWidget { static ID: string; static LABEL: string; isExtractable: boolean; secondaryWindow: Window | undefined; protected panel: SplitPanel; protected pageAndTreeLayout: SplitLayout | undefined; protected stateIsSet: boolean; pagePanels: Map<`page-${string}`, TerminalManagerTreeTypes.PageSplitPanel>; groupPanels: Map<`group-${string}`, TerminalManagerTreeTypes.GroupSplitPanel>; /** By node ID: safer for state restoration. */ terminalWidgets: Map<`terminal-${string}`, TerminalWidget>; /** By terminal ID to work from widget to internal metadata. */ terminalWidgetIdsToNodeIds: Map; /** Track disposables per terminal to prevent memory leaks. */ protected terminalDisposables: Map<`terminal-${string}`, DisposableCollection>; protected readonly onDidChangeTrackableWidgetsEmitter: Emitter; readonly onDidChangeTrackableWidgets: import("@theia/core").Event; protected terminalPanelWrapper: Panel; protected interceptCloseRequest: boolean; protected terminalFrontendContribution: TerminalFrontendContribution; readonly treeWidget: TerminalManagerTreeWidget; protected readonly splitPositionHandler: SplitPositionHandler; protected readonly shell: ApplicationShell; protected readonly terminalManagerPreferences: TerminalManagerPreferences; protected readonly applicationStateService: FrontendApplicationStateService; protected readonly widgetManager: WidgetManager; protected readonly storageService: StorageService; protected readonly logger: ILogger; protected readonly terminalsDeletingFromClose: Set<`terminal-${string}`>; static createRestoreError: (nodeId: string) => Error; static createContainer(parent: interfaces.Container): interfaces.Container; static createWidget(parent: interfaces.Container): Promise; protected init(): void; /** Yields all terminal widgets owned by this widget and then closes this widget. */ drainWidgets(): IterableIterator; populateLayout(force?: boolean): Promise; createTerminalWidget(options?: TerminalWidgetOptions): Promise; protected registerListeners(): void; protected handleNodeRenamed(node: TerminalManagerTreeTypes.TerminalManagerTreeNode): void; setPanelSizes({ terminal, tree }?: TerminalManagerWidgetState.PanelRelativeSizes): void; getTrackableWidgets(): Widget[]; toggleTreeVisibility(): void; protected createPageAndTreeLayout(relativeSizes?: TerminalManagerWidgetState.PanelRelativeSizes): Promise; protected resolveMainLayout(relativeSizes?: TerminalManagerWidgetState.PanelRelativeSizes): Promise; protected onAfterAttach(msg: Message): void; protected onCloseRequest(msg: Message): void; protected confirmClose(): Promise; /** * Add a terminal to a page. If no `pageId` is given, a new auto-numbered * page is created. If a `pageId` is given, the existing page is reused * or a new one is created (with special-page config applied if available). */ addTerminalPage(widget: Widget, pageId?: TerminalManagerTreeTypes.PageId): void; protected addTerminalReference(widget: TerminalWidget, nodeId: TerminalManagerTreeTypes.TerminalKey): void; protected removeTerminalReferenceByWidgetId(widgetId: string): boolean; protected removeTerminalReferenceByNodeId(nodeId: TerminalManagerTreeTypes.TerminalKey): boolean; protected createPagePanel(pageId?: TerminalManagerTreeTypes.PageId): TerminalManagerTreeTypes.PageSplitPanel; protected generateUUIDAvoidDuplicatesFromStorage(idPrefix: 'group-' | 'page-'): string; protected handlePageAdded(pageId: TerminalManagerTreeTypes.PageId): void; protected handlePageDeleted(pagePanelId: TerminalManagerTreeTypes.PageId): void; protected clearGroupReferences(panel: TerminalManagerTreeTypes.PageSplitPanel): void; addTerminalGroupToPage(widget: Widget, pageId: TerminalManagerTreeTypes.PageId): void; protected createTerminalGroupPanel(groupId?: TerminalManagerTreeTypes.GroupId): TerminalManagerTreeTypes.GroupSplitPanel; protected handleTerminalGroupAdded(groupId: TerminalManagerTreeTypes.GroupId, pageId: TerminalManagerTreeTypes.PageId): void; protected activateTerminalWidget(terminalKey: TerminalManagerTreeTypes.TerminalKey): Promise; activateWidget(id: string): Widget | undefined; protected handleTerminalGroupDeleted(groupPanelId: TerminalManagerTreeTypes.GroupId): void; protected clearTerminalReferences(panel: TerminalManagerTreeTypes.GroupSplitPanel): void; addWidgetToTerminalGroup(widget: Widget, groupId: TerminalManagerTreeTypes.GroupId): void; protected onActivateRequest(msg: Message): void; protected handleWidgetAddedToTerminalGroup(terminalKey: TerminalManagerTreeTypes.TerminalKey, groupId: TerminalManagerTreeTypes.GroupId): void; protected handleTerminalDeleted(terminalId: TerminalManagerTreeTypes.TerminalKey): void; protected handleOnDidChangeActiveWidget(widget: Widget | null): void; protected handleSelectionChange(changeEvent: TerminalManagerTreeTypes.SelectionChangedEvent): void; protected updateViewPage(activePageId: TerminalManagerTreeTypes.PageId): void; deleteTerminal(terminalId: TerminalManagerTreeTypes.TerminalKey): void; deleteGroup(groupId: TerminalManagerTreeTypes.GroupId): void; deletePage(pageNode: TerminalManagerTreeTypes.PageId): void; toggleRenameTerminal(entityId: TerminalManagerTreeTypes.TerminalManagerValidId): void; storeState(): TerminalManagerWidgetState.LayoutData; restoreState(oldState: TerminalManagerWidgetState.LayoutData): void; protected resetLayout(): void; resetView(): Promise; protected iterateAndRestoreLayoutTree(pageLayouts: TerminalManagerWidgetState.PageLayoutData[], treeWidget: TerminalManagerTreeWidget): void; restoreLayoutData(items: TerminalManagerWidgetState.TerminalManagerLayoutData, treeWidget: TerminalManagerTreeWidget): void; getLayoutData(): TerminalManagerWidgetState.LayoutData; protected activateNextAvailableTerminal(excludeTerminalKey: TerminalManagerTreeTypes.TerminalKey): void; dispose(): void; } //# sourceMappingURL=terminal-manager-widget.d.ts.map