svelte-search-engine
Version:
A wrapper for Google's Programmable Search Engine, providing a Svelte-friendly interface.
33 lines (32 loc) • 1.34 kB
TypeScript
import { type Unsubscriber } from 'svelte/store';
import type { Promotion, Result, SearchCallback } from '../types/search';
import type { SearchEngineComponent, UIComponents } from '../types/components';
export declare const searchType: readonly ["web", "image"];
export type SearchType = (typeof searchType)[number];
export type StartingInput = {
type: SearchType;
gname: string;
query: string;
};
export type ReadyInput = {
type: SearchType;
gname: string;
query: string;
promos: Promotion[] | undefined;
results: Result[];
div: HTMLElement;
};
export type RenderedInput = {
type: SearchType;
gname: string;
query: string;
promos: HTMLElement[];
results: HTMLElement[];
};
export declare const init: import("svelte/store").Writable<boolean>;
export declare const starting: import("svelte/store").Writable<StartingInput | null>;
export declare const ready: import("svelte/store").Writable<ReadyInput | null>;
export declare const rendered: import("svelte/store").Writable<RenderedInput | null>;
export declare function createCallbacks(type: SearchType): SearchCallback;
export declare function subscribeComponent(gname: string, component: typeof SearchEngineComponent): Unsubscriber;
export declare function subscribeComponents(gname: string, components: UIComponents): () => void;