/** * @file * * Mock of Obsidian's `ValueComponent`, the base of UI components that hold a value. */ import type { ValueComponent as ValueComponentOriginal } from 'obsidian'; import { BaseComponent } from './BaseComponent.cjs'; /** * Mock of Obsidian's `ValueComponent` base class. * * @typeParam T - The type of the component's value. */ export declare abstract class ValueComponent extends BaseComponent { /** * Creates the component. */ protected constructor(); /** * Mock-only: views a value typed as Obsidian's `ValueComponent` as this mock. * * @typeParam T - The type of the component's value. * @param value - The value typed as the original `ValueComponent`. * @returns The same object, typed as the mock. */ static fromOriginalType2__(value: ValueComponentOriginal): ValueComponent; /** * Mock-only: views this mock as Obsidian's `ValueComponent` type. * * @returns The same object, typed as the original `ValueComponent`. */ asOriginalType2__(): ValueComponentOriginal; /** * Mock-only construction hook, called at the end of the constructor; a no-op meant for * `vi.spyOn(ValueComponent.prototype, 'constructor2__')`. */ constructor2__(): void; /** * Gets the component's current value. * * @returns The current value. */ abstract getValue(): T; /** * Registers a listener under `key` that sets the component's value when called with one and returns the current * value. A no-op in the mock, which registers nothing. * * @param _listeners - The record of option listeners. * @param _key - The key of the listener to bind. * @returns This component, for chaining. */ registerOptionListener(_listeners: Record T>, _key: string): this; /** * Sets the component's value. * * @param value - The new value. * @returns This component, for chaining. */ abstract setValue(value: T): this; }