import { IDimension } from "../../../../base/browser/dom.js"; import { Direction } from "../../../../base/browser/ui/grid/grid.js"; import { IViewSize } from "../../../../base/browser/ui/grid/gridview.js"; import { Event } from "../../../../base/common/event.js"; import { IDisposable } from "../../../../base/common/lifecycle.js"; import { ILayoutService } from "../../../../platform/layout/browser/layoutService.service.js"; import { Part } from "../../../browser/part.js"; import { PanelAlignment, IPartVisibilityChangeEvent, Parts, SINGLE_WINDOW_PARTS, MULTI_WINDOW_PARTS, Position } from "./layoutService.js"; export declare const IWorkbenchLayoutService: import("../../../../platform/instantiation/common/instantiation.js").ServiceIdentifier; export interface IWorkbenchLayoutService extends ILayoutService { readonly _serviceBrand: undefined; /** * Emits when the zen mode is enabled or disabled. */ readonly onDidChangeZenMode: Event; /** * Emits when the target window is maximized or unmaximized. */ readonly onDidChangeWindowMaximized: Event<{ readonly windowId: number; readonly maximized: boolean; }>; /** * Emits when main editor centered layout is enabled or disabled. */ readonly onDidChangeMainEditorCenteredLayout: Event; readonly onDidChangePanelPosition: Event; /** * Emit when panel alignment changes. */ readonly onDidChangePanelAlignment: Event; /** * Emit when part visibility changes. */ readonly onDidChangePartVisibility: Event; /** * Emit when notifications (toasts or center) visibility changes. */ readonly onDidChangeNotificationsVisibility: Event; readonly onDidChangeAuxiliaryBarMaximized: Event; /** * True if a default layout with default editors was applied at startup */ readonly openedDefaultEditors: boolean; /** * Run a layout of the workbench. */ layout(): void; /** * Asks the part service if all parts have been fully restored. For editor part * this means that the contents of visible editors have loaded. */ isRestored(): boolean; /** * A promise for to await the `isRestored()` condition to be `true`. */ readonly whenRestored: Promise; /** * Returns whether the given part has the keyboard focus or not. */ hasFocus(part: Parts): boolean; /** * Focuses the part in the target window. If the part is not visible this is a noop. */ focusPart(part: SINGLE_WINDOW_PARTS): void; focusPart(part: MULTI_WINDOW_PARTS, targetWindow: Window): void; focusPart(part: Parts, targetWindow: Window): void; /** * Returns the target window container or parts HTML element within, if there is one. */ getContainer(targetWindow: Window): HTMLElement; getContainer(targetWindow: Window, part: Parts): HTMLElement | undefined; /** * Returns if the part is visible in the target window. */ isVisible(part: SINGLE_WINDOW_PARTS): boolean; isVisible(part: MULTI_WINDOW_PARTS, targetWindow: Window): boolean; isVisible(part: Parts, targetWindow: Window): boolean; /** * Set part hidden or not in the target window. */ setPartHidden(hidden: boolean, part: Parts): void; /** * Maximizes the panel height if the panel is not already maximized. * Shrinks the panel to the default starting size if the panel is maximized. */ toggleMaximizedPanel(): void; /** * Returns true if the panel is maximized. */ isPanelMaximized(): boolean; /** * Maximizes the auxiliary sidebar by hiding the editor and panel areas. * Restores the previous layout if the auxiliary sidebar is already maximized. */ toggleMaximizedAuxiliaryBar(): void; /** * Maximizes or restores the auxiliary sidebar. * * @returns `true` if there was a change in the maximization state. */ setAuxiliaryBarMaximized(maximized: boolean): boolean; /** * Returns true if the auxiliary sidebar is maximized. */ isAuxiliaryBarMaximized(): boolean; /** * Returns true if the main window has a border. */ hasMainWindowBorder(): boolean; /** * Returns the main window border radius if any. */ getMainWindowBorderRadius(): string | undefined; /** * Gets the current side bar position. Note that the sidebar can be hidden too. */ getSideBarPosition(): Position; /** * Toggles the menu bar visibility. */ toggleMenuBar(): void; getPanelPosition(): Position; /** * Sets the panel position. */ setPanelPosition(position: Position): void; /** * Gets the panel alignement. */ getPanelAlignment(): PanelAlignment; /** * Sets the panel alignment. */ setPanelAlignment(alignment: PanelAlignment): void; /** * Gets the maximum possible size for editor in the given container. */ getMaximumEditorDimensions(container: HTMLElement): IDimension; /** * Toggles the workbench in and out of zen mode - parts get hidden and window goes fullscreen. */ toggleZenMode(): void; /** * Returns whether the centered editor layout is active on the main editor part. */ isMainEditorLayoutCentered(): boolean; /** * Sets the main editor part in and out of centered layout. */ centerMainEditorLayout(active: boolean): void; /** * Get the provided parts size in the main window. */ getSize(part: Parts): IViewSize; /** * Set the provided parts size in the main window. */ setSize(part: Parts, size: IViewSize): void; /** * Resize the provided part in the main window. */ resizePart(part: Parts, sizeChangeWidth: number, sizeChangeHeight: number): void; /** * Register a part to participate in the layout. */ registerPart(part: Part): IDisposable; /** * Returns whether the target window is maximized. */ isWindowMaximized(targetWindow: Window): boolean; /** * Updates the maximized state of the target window. */ updateWindowMaximizedState(targetWindow: Window, maximized: boolean): void; /** * Returns the next visible view part in a given direction in the main window. */ getVisibleNeighborPart(part: Parts, direction: Direction): Parts | undefined; }