/** * @file * * Mock of Obsidian's `SearchComponent`, a search input with a clear button. */ import type { SearchComponent as SearchComponentOriginal } from 'obsidian'; import { AbstractTextComponent } from './AbstractTextComponent.mjs'; /** * Mock of Obsidian's `SearchComponent`, a `type="search"` input with a button that clears it. * * Clicking {@link SearchComponent.clearButtonEl} empties the input and calls the change callback, unless the * component is disabled. */ export declare class SearchComponent extends AbstractTextComponent { /** * The button element that clears the input. */ clearButtonEl: HTMLElement; /** * Creates the search input and its clear button inside `containerEl`, and wires the button's click. * * @param containerEl - The element to create the component in. */ constructor(containerEl: HTMLElement); /** * Mock-only factory: creates a search component, spyable via `vi.spyOn(SearchComponent, 'create__')`. * * @param containerEl - The element to create the component in. * @returns The new search component. */ static create__(containerEl: HTMLElement): SearchComponent; /** * Mock-only: views a value typed as Obsidian's `SearchComponent` as this mock. * * @param value - The value typed as the original `SearchComponent`. * @returns The same object, typed as the mock. */ static fromOriginalType4__(value: SearchComponentOriginal): SearchComponent; /** * Mock-only: views this mock as Obsidian's `SearchComponent` type. * * @returns The same object, typed as the original `SearchComponent`. */ asOriginalType4__(): SearchComponentOriginal; /** * Mock-only construction hook, called at the end of the constructor; a no-op meant for * `vi.spyOn(SearchComponent.prototype, 'constructor4__')`. * * @param _containerEl - The element the component was created in. */ constructor4__(_containerEl: HTMLElement): void; /** * Calls the change callback with the input's current value, as `AbstractTextComponent.onChanged` does. The input's * `input` listener and a click on {@link SearchComponent.clearButtonEl} both call it. */ onChanged(): void; }