/** * @file * * Mock of Obsidian's `WorkspaceWindow`, the container of a popout window. */ import type { WorkspaceWindow as WorkspaceWindowOriginal } from 'obsidian'; import type { Workspace } from './Workspace.mjs'; import { WorkspaceContainer } from './WorkspaceContainer.mjs'; /** * Mock of Obsidian's `WorkspaceWindow`, the root split of a popout window. No window is opened: the mock is bound * to the global `window` and `document`, the same as `WorkspaceRoot`, and lays its children out vertically as * Obsidian's does. The requested size is not kept: Obsidian stores it on a `size` member that neither `obsidian.d.ts` * nor `obsidian-typings` declares, so the mock has no member to keep it under. */ export declare class WorkspaceWindow extends WorkspaceContainer { /** * The item kind, `window`, as Obsidian names it. */ type: string; /** * The document of the popout window. The mock has no separate window. * * @returns The global `document`. */ get doc(): Document; /** * The popout window. The mock has no separate window. * * @returns The global `window`. */ get win(): Window; /** * Creates a popout container. Obsidian does not construct it publicly; use {@link WorkspaceWindow.create3__}. * * @param workspace - The workspace the window belongs to. * @param id - The item id. * @param size - The requested window size, which the mock does not keep. */ protected constructor(workspace: Workspace, id?: string, size?: Record); /** * Mock-only factory: creates a popout container, spyable via `vi.spyOn(WorkspaceWindow, 'create3__')`. The * numbered subclass variant of `create__`. * * @param workspace - The workspace the window belongs to. * @param id - The item id. * @param size - The requested window size. * @returns The new popout container. */ static create3__(workspace: Workspace, id?: string, size?: Record): WorkspaceWindow; /** * Mock-only: views a value typed as Obsidian's `WorkspaceWindow` as this mock. The numbered subclass variant of * `fromOriginalType__`. * * @param value - The value typed as the original `WorkspaceWindow`. * @returns The same object, typed as the mock. */ static fromOriginalType6__(value: WorkspaceWindowOriginal): WorkspaceWindow; /** * Mock-only: views this mock as Obsidian's `WorkspaceWindow` type. The numbered subclass variant of * `asOriginalType__`. * * @returns The same object, typed as the original `WorkspaceWindow`. */ asOriginalType6__(): WorkspaceWindowOriginal; /** * Mock-only construction hook, called at the end of the constructor; a no-op meant for * `vi.spyOn(WorkspaceWindow.prototype, 'constructor6__')`. * * @param _workspace - The workspace the window was created with. * @param _id - The item id the window was created with. * @param _size - The window size the window was created with. */ constructor6__(_workspace: Workspace, _id?: string, _size?: Record): void; }