/** * @file * * Mock of Obsidian's `WorkspaceRibbon`, the vertical icon strip beside a side dock. */ import type { WorkspaceRibbon as WorkspaceRibbonOriginal } from 'obsidian'; import type { RibbonState } from '../internal/types.cjs'; import type { Workspace } from './Workspace.cjs'; /** * Mock of Obsidian's `WorkspaceRibbon`. Obsidian's public API declares no members on it, and the mock implements * none beyond the mock-only bridges. */ export declare class WorkspaceRibbon { /** * Creates a ribbon. Obsidian does not construct it publicly; use {@link WorkspaceRibbon.create__}. * * @param workspace - The workspace the ribbon belongs to. * @param side - The side of the window the ribbon is on. */ protected constructor(workspace: Workspace, side: string); /** * Mock-only factory: creates a ribbon, spyable via `vi.spyOn(WorkspaceRibbon, 'create__')`. * * @param workspace - The workspace the ribbon belongs to. * @param side - The side of the window the ribbon is on. * @returns The new ribbon. */ static create__(workspace: Workspace, side: string): WorkspaceRibbon; /** * Mock-only: views a value typed as Obsidian's `WorkspaceRibbon` as this mock. * * @param value - The value typed as the original `WorkspaceRibbon`. * @returns The same object, typed as the mock. */ static fromOriginalType__(value: WorkspaceRibbonOriginal): WorkspaceRibbon; /** * Mock-only: views this mock as Obsidian's `WorkspaceRibbon` type. * * @returns The same object, typed as the original `WorkspaceRibbon`. */ asOriginalType__(): WorkspaceRibbonOriginal; /** * Mock-only construction hook, called at the end of the constructor; a no-op meant for * `vi.spyOn(WorkspaceRibbon.prototype, 'constructor__')`. * * @param _workspace - The workspace the ribbon was created with. * @param _side - The side the ribbon was created with. */ constructor__(_workspace: Workspace, _side: string): void; /** * Restores which ribbon items are hidden, and in what order, from a saved state. The mock ribbon holds no items, so * there is nothing for the state to apply to, exactly as in an Obsidian ribbon with no items; Obsidian then * re-renders the ribbon, which the mock does not. * * @param _state - The saved state, as {@link WorkspaceRibbon.serialize} returns it. */ load(_state: Partial): void; /** * Serializes the ribbon, as Obsidian does: whether each item is hidden, keyed by item id. The mock ribbon holds no * items, so the record is empty. * * @returns The ribbon state. */ serialize(): RibbonState; }