import type { ValuSearch } from "../index"; import { loadPolyfill } from "./lazy-utils"; interface SelectOptions { nullable?: boolean; } /** * document.querySelectorAll() wrapper which asserts that * it returns only one element and the returned * element matches the given type * * @param selector CSS selector * @param klass Element subclass * @param options Allow nullable * @returns */ export declare function select(selector: string, klass: Klass, options?: Options): Options extends { nullable: true; } ? InstanceType | null : InstanceType; /** * Simple wrapper for the DOMContentLoaded event which fires the callback when * bound after the actual event */ export declare function onDomContentLoaded(cb: () => any): void; export interface LazyLoadedModule { default: ValuSearch; } export interface ValuSearchLoaderOptions { instanceId?: string; polyfill?: Parameters[1]; load: () => Promise; } export interface OnLazyLoaded { (vs: ValuSearch, module: Module): any; } declare global { interface Window { valuSearchLoader?: LazyValuSearch; } } export declare class LazyValuSearch { module?: Module; private options; private onLoad; replaced?: boolean; instanceId: string; constructor(options: ValuSearchLoaderOptions); /** * triggers loader.load() if the input has focus when this is called, * otherwise adds onfocus eventlistener to input that calls loader.load() * @param input HTMLInputElement */ loadOnFocus(input: HTMLInputElement): void; isActive: () => boolean; /** * Returns true when the module has be loaded */ isLoaded: () => boolean; /** * Class name used to create FocusTrap containers */ get trapClassName(): string; replace: (url: string) => void; load: () => void; activate: () => void; init: (onInit: () => OnLazyLoaded | undefined | void) => void; } export {};