ValueComponent<T>
Mock of Obsidian’s ValueComponent base class.
Import:
import { ValueComponent } from 'obsidian-test-mocks/obsidian';Signature:
export class ValueComponent<T> extends BaseComponentExtends: BaseComponent
Constructor
new ValueComponent()Creates the component.
Properties
| Property | Type | Description |
|---|---|---|
| disabled | boolean | Whether the component is disabled. (Inherited from BaseComponent) |
Methods
| Method | Returns | Description |
|---|---|---|
| asOriginalType__() | BaseComponentOriginal | Mock-only: views this mock as Obsidian's BaseComponent type.(Inherited from BaseComponent) |
| asOriginalType2__() | ValueComponentOriginal<T> | Mock-only: views this mock as Obsidian's ValueComponent type. |
| constructor__() | void | Mock-only construction hook, called at the end of the constructor; a no-op meant for vi.spyOn(BaseComponent.prototype, 'constructor__').(Inherited from BaseComponent) |
| constructor2__() | void | Mock-only construction hook, called at the end of the constructor; a no-op meant for vi.spyOn(ValueComponent.prototype, 'constructor2__'). |
| getValue() | T | Gets the component's current value. |
| registerOptionListener(_listeners, _key) | this | 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. |
| setDisabled(disabled) | this | Enables or disables the component. The mock only records the flag in BaseComponent.disabled. (Inherited from BaseComponent) |
| setValue(value) | this | Sets the component's value. |
| then(callback) | this | Calls a function with the component, to configure it inside a builder chain. (Inherited from BaseComponent) |
| static fromOriginalType__(value) | BaseComponent | Mock-only: views a value typed as Obsidian's BaseComponent as this mock.(Inherited from BaseComponent) |
| static fromOriginalType2__(value) | ValueComponent<T> | Mock-only: views a value typed as Obsidian's ValueComponent as this mock. |
Links to this page: