/** The languages the card offers, in menu order. */ export declare const LANGUAGE_CHOICES: readonly [{ readonly value: ""; readonly labelKey: "language.unset"; }, { readonly value: "all"; readonly labelKey: "language.all"; }, { readonly value: "ja"; readonly label: "日本語"; }, { readonly value: "zh-CN"; readonly label: "中文(简体)"; }, { readonly value: "zh-TW"; readonly label: "中文(繁體)"; }, { readonly value: "en"; readonly label: "English"; }]; /** Where the effective instance URL came from. Mirrors the host view. */ export type BaseUrlSource = 'settings' | 'environment' | 'none'; /** The host gateway's read view. */ export interface SearxngSettingsView { value: { baseURL?: string; language?: string; }; effectiveBaseURL?: string; baseURLSource: BaseUrlSource; baseURLEnvVar: string; writable: boolean; } /** Everything the card renders from. */ export interface SearxngCardState { status: 'loading' | 'ready' | 'failed'; /** Failure text from the last load, or `undefined` while healthy. */ error?: string | undefined; /** Stored values, as the host last reported them. */ stored: { baseURL: string; language: string; }; /** What the user has typed but not saved. */ draft: { baseURL: string; language: string; }; effectiveBaseURL?: string | undefined; baseURLSource: BaseUrlSource; baseURLEnvVar: string; writable: boolean; saving: boolean; } /** * What one endpoint call resolves to. The channel hands back the result * envelope rather than the value: a refused write (an unknown key, a wrong * type) is `ok: false` with the host's message, NOT a thrown error, so a caller * that forgets to unwrap silently reads `undefined` for every field instead of * failing. That mistake renders as an empty, read-only card. */ export interface RpcResult { ok: boolean; value?: unknown; error?: { message?: string; }; } /** Minimal shape of the connection's plugin-endpoint channel. */ export interface RpcChannel { call(path: string, method: string, payload: unknown): Promise; } /** Whether a draft differs from what the host stores. */ export declare function isDirty(state: SearxngCardState): boolean; /** * Accept only an absolute http(s) URL, or empty (meaning "inherit"). * * The instance rejects a malformed *language* loudly but accepts any * well-formed URL, so a typo in the address surfaces only as a failing search * much later. Catching it at the form is the earliest honest moment. * @param value - the draft URL. * @returns true when the value is usable. */ export declare function isValidBaseURL(value: string): boolean; /** Owns the card's state and the three gateway calls. */ export declare class SearxngSettingsController { private readonly rpc; readonly store: import("@deepseek-ai/dsh-client-store").SnapshotStore; constructor(rpc: RpcChannel); /** Read the section and reset drafts to it. */ load(): Promise; /** Stage a field without writing it. */ edit(field: 'baseURL' | 'language', value: string): void; /** Drop staged edits. */ discard(): void; /** * Write the staged fields. * * An emptied field is sent as `undefined` so the host's merge removes the * override and the value re-inherits, rather than pinning an empty string * that would read as "configured, to nothing". */ save(): Promise; /** Clear the user layer so the section re-inherits composition defaults. */ reset(): Promise; /** Fold one host view into state, clearing drafts and transient flags. */ private adopt; }