/** * @module Controller */ import { Client } from "@ideal-postcodes/core-axios"; import { Config as ClientConfig } from "@ideal-postcodes/core-axios/dist/client"; import { GbrAddress } from "@ideal-postcodes/jsutil"; import { Config } from "./index"; /** * Keypress listener on input field * * @hidden */ export declare const keypress: (this: Controller, event: KeyboardEvent) => false | undefined; /** * Button Click handler * * @hidden */ export declare const click: (this: Controller, event: Event) => boolean; /** * Select change handler * * @hidden */ export declare const selectEvent: (this: Controller) => void; /** * Default Controller configuration */ export declare const defaults: StrictConfig; /** * @hidden */ export declare type StrictConfig = Required>; /** * Configuration object for `Controller` */ export interface ControllerConfig extends Config, Omit { } /** * @hidden */ interface CachedOptions extends Required, Omit { } /** * A Postcode Lookup Controller instances manages the state of a postcode or address search widget and updates the DOM accordingly * * To detach from the DOM call use the `#removeAll()` method */ export declare class Controller { /** * Caches options object */ options: CachedOptions; /** * Stores most recent lookup */ lastLookup: string; /** * Cache for recently retrieved data */ data: GbrAddress[]; /** * Ideal Postcodes API client */ client: Client; /** * Scopes the DOM for the entire controller */ scope: HTMLElement | Document; /** * Scopes the DOM for fields which should receive address inputs */ outputScope: HTMLElement | Document; /** * Reference to the DOM, to which this.scope belongs */ document: Document; /** * HTML Element in which postcode lookup tools live */ context: HTMLElement; /** * Reference to postcode lookup input field */ input: HTMLInputElement; /** * Reference to postcode lookup button */ button: HTMLButtonElement; /** * Reference to message paragraph element */ message: HTMLParagraphElement; /** * Reference to dropdown containing address suggestions */ select: HTMLSelectElement; /** * Reference to HTMLElement that wraps the