getaddress-autocomplete
Version:
GetAddress.io - Autocomplete plug-in
38 lines (34 loc) • 1.57 kB
TypeScript
import { Suggestion, AutocompleteFilter } from 'getaddress-api';
export { AutocompleteFilter, AutocompleteFilterRadius, Suggestion } from 'getaddress-api';
declare class Options {
delay?: number;
minimum_characters?: number;
suggestion_count?: number | undefined;
item_template: (suggestion: Suggestion) => string;
mobile_item_template?: (suggestion: Suggestion) => string;
footer_template?: (elements: HTMLElement[]) => string;
history_item_template?: (suggestion: Suggestion) => string;
mobile_history_item_template?: (suggestion: Suggestion) => string;
suggestion_template?: string | undefined;
filter?: Partial<AutocompleteFilter>;
show_postcode?: boolean | undefined;
list_style?: string;
list_item_style?: string;
full_screen_on_mobile: boolean;
mobile_list_item_style?: string;
history_item_style?: string;
mobile_history_item_style?: string;
mobile_list_style?: string;
mobile_max_screen_width: number;
enable_repositioning: boolean;
highlight_search_text: boolean;
enable_history: boolean;
constructor(options?: Partial<Options>);
}
declare const autocomplete: (textboxId: string, apiKey: string, options?: Partial<Options>) => Promise<HTMLElement>;
declare const screenWidth: () => number;
declare const isTouchEnabled: () => boolean;
declare const destroy: () => void;
declare const clearHistory: () => void;
declare const removeHistory: (key: string) => void;
export { Options, autocomplete, clearHistory, destroy, isTouchEnabled, removeHistory, screenWidth };