/** * @file * * Mock of Obsidian's `WorkspaceRoot`, the container of the main window's editing area. */ import type { SplitDirection as SplitDirectionOriginal, WorkspaceRoot as WorkspaceRootOriginal } from 'obsidian'; import type { Workspace } from './Workspace.cjs'; import { WorkspaceContainer } from './WorkspaceContainer.cjs'; /** * Mock of Obsidian's `WorkspaceRoot`, the root split of the main window, bound to the global `window` and * `document`. */ export declare class WorkspaceRoot extends WorkspaceContainer { /** * The document of the main window. * * @returns The global `document`. */ get doc(): Document; /** * The main window. * * @returns The global `window`. */ get win(): Window; /** * Creates the root split. Obsidian does not construct it publicly; use {@link WorkspaceRoot.create3__}. * * @param workspace - The workspace the root belongs to. * @param direction - The split direction. * @param id - The item id. */ protected constructor(workspace: Workspace, direction: SplitDirectionOriginal, id?: string); /** * Mock-only factory: creates a root split, spyable via `vi.spyOn(WorkspaceRoot, 'create3__')`. The numbered * subclass variant of `create__`. * * @param workspace - The workspace the root belongs to. * @param direction - The split direction. * @param id - The item id. * @returns The new root split. */ static create3__(workspace: Workspace, direction: SplitDirectionOriginal, id?: string): WorkspaceRoot; /** * Mock-only: views a value typed as Obsidian's `WorkspaceRoot` as this mock. The numbered subclass variant of * `fromOriginalType__`. * * @param value - The value typed as the original `WorkspaceRoot`. * @returns The same object, typed as the mock. */ static fromOriginalType6__(value: WorkspaceRootOriginal): WorkspaceRoot; /** * Mock-only: views this mock as Obsidian's `WorkspaceRoot` type. The numbered subclass variant of * `asOriginalType__`. * * @returns The same object, typed as the original `WorkspaceRoot`. */ asOriginalType6__(): WorkspaceRootOriginal; /** * Mock-only construction hook, called at the end of the constructor; a no-op meant for * `vi.spyOn(WorkspaceRoot.prototype, 'constructor6__')`. * * @param _workspace - The workspace the root was created with. * @param _direction - The split direction the root was created with. * @param _id - The item id the root was created with. */ constructor6__(_workspace: Workspace, _direction: SplitDirectionOriginal, _id?: string): void; }