/** * @file * * Mock of Obsidian's `BaseComponent`, the root of the setting UI components. */ import type { BaseComponent as BaseComponentOriginal } from 'obsidian'; /** * Mock of Obsidian's `BaseComponent`, the base of every setting control such as buttons, toggles and text * fields. The mock tracks the disabled state without touching any element. */ export declare abstract class BaseComponent { /** * Whether the component is disabled. */ disabled: boolean; /** * Creates an enabled component. */ protected constructor(); /** * Mock-only: views a value typed as Obsidian's `BaseComponent` as this mock. * * @param value - The value typed as the original `BaseComponent`. * @returns The same object, typed as the mock. */ static fromOriginalType__(value: BaseComponentOriginal): BaseComponent; /** * Mock-only: views this mock as Obsidian's `BaseComponent` type. * * @returns The same object, typed as the original `BaseComponent`. */ asOriginalType__(): BaseComponentOriginal; /** * Mock-only construction hook, called at the end of the constructor; a no-op meant for * `vi.spyOn(BaseComponent.prototype, 'constructor__')`. */ constructor__(): void; /** * Enables or disables the component. The mock only records the flag in {@link BaseComponent.disabled}. * * @param disabled - `true` to disable the component. * @returns This component, for chaining. */ setDisabled(disabled: boolean): this; /** * Calls a function with the component, to configure it inside a builder chain. * * @param callback - Called synchronously with this component. * @returns This component, for chaining. */ then(callback: (component: this) => unknown): this; }