/** * @file * * Mock of Obsidian's `ProgressBarComponent`, a horizontal progress bar. */ import type { ProgressBarComponent as ProgressBarComponentOriginal } from 'obsidian'; import { ValueComponent } from './ValueComponent.mjs'; /** * Mock of Obsidian's `ProgressBarComponent`, a progress bar whose value is a percentage. * * The value is tracked in memory and mirrored onto {@link ProgressBarComponent.progressBar} as its `width` style * and `data-value` attribute, so a test can read it back from the element. */ export declare class ProgressBarComponent extends ValueComponent { /** * The bar element whose width reflects the progress. */ progressBar: HTMLElement; private value; /** * Creates the progress bar inside `containerEl`, starting at `0`. * * @param containerEl - The element to create the progress bar in. */ constructor(containerEl: HTMLElement); /** * Mock-only factory: creates a progress bar, spyable via `vi.spyOn(ProgressBarComponent, 'create__')`. * * @param containerEl - The element to create the progress bar in. * @returns The new progress bar. */ static create__(containerEl: HTMLElement): ProgressBarComponent; /** * Mock-only: views a value typed as Obsidian's `ProgressBarComponent` as this mock. * * @param value - The value typed as the original `ProgressBarComponent`. * @returns The same object, typed as the mock. */ static fromOriginalType3__(value: ProgressBarComponentOriginal): ProgressBarComponent; /** * Mock-only: views this mock as Obsidian's `ProgressBarComponent` type. * * @returns The same object, typed as the original `ProgressBarComponent`. */ asOriginalType3__(): ProgressBarComponentOriginal; /** * Mock-only construction hook, called at the end of the constructor; a no-op meant for * `vi.spyOn(ProgressBarComponent.prototype, 'constructor3__')`. * * @param _containerEl - The element the progress bar was created in. */ constructor3__(_containerEl: HTMLElement): void; /** * Gets the current progress. * * @returns The progress amount, between 0 and 100. */ getValue(): number; /** * Sets the progress, updating the bar's width and its `data-value` attribute. * * @param value - The progress amount, between 0 and 100. * @returns This component, for chaining. */ setValue(value: number): this; }