/** * @module Helper Methods */ import { HttpResponse } from "./agent"; import { UkAddress, PafAddress, NybAddress, MrAddress, KeyStatus } from "./types"; import { Authenticable, Filterable, Taggable, HttpOptions, Paginateable } from "./types"; import { Client } from "./client"; /** * ID lookup options interface */ export interface LookupIdOptions extends Authenticable, Filterable, Taggable, HttpOptions { /** * Client instance */ client: Client; } /** * Address search options */ export interface LookupAddressOptions extends Authenticable, Filterable, Taggable, Paginateable, HttpOptions { /** * Client instance */ client: Client; /** * Query string for address * * @example "10 downing street" */ query: string; } /** * Postcode lookup options */ export interface LookupPostcodeOptions extends LookupIdOptions { /** * Client instance */ client: Client; /** * Postcode to query for. Space and case insensitive */ postcode: string; /** * With multiple residence datasets, a very small number of postcodes will * yield more than 100 results. In this instance, you would need to paginate * through them with `page` */ page?: number; } /** * UDPRN lookup options */ export interface LookupUdprnOptions extends LookupIdOptions { /** * Client instance */ client: Client; /** * UDPRN to query for */ udprn: number; } /** * UMPRN lookup options */ export interface LookupUmprnOptions extends LookupIdOptions { /** * Client instance */ client: Client; /** * UMPRN to query for */ umprn: number; } /** * Check key usab ility options */ export interface CheckKeyUsabilityOptions extends HttpOptions { /** * Client instance */ client: Client; /** * If api_key is supplied, this will overwrite the key defined during client instantiation */ api_key?: string; /** * Checks API Key and licensee combination. This checks whether a particular * licensee can use the API */ licensee?: string; } /** * Ping API base (`/`) * * Dispatches HTTP request to root endpoint "`/`" */ export declare const ping: (client: Client) => Promise; /** * Lookup Postcode * * Search for addresses given a postcode. Postcode queries are case and space insensitive * * Invalid postcodes return an empty array address result `[]` * * [API Documentation for /postcodes](https://ideal-postcodes.co.uk/documentation/postcodes#postcode) */ export declare const lookupPostcode: (options: LookupPostcodeOptions) => Promise; /** * Lookup Address * * Search for an address given a query * * [API Documentation for /addresses](https://ideal-postcodes.co.uk/documentation/addresses#query) */ export declare const lookupAddress: (options: LookupAddressOptions) => Promise; /** * Lookup UDPRN * * Search for an address given a UDPRN * * Invalid UDPRN returns `null` * * [API Documentation for /udprn](https://ideal-postcodes.co.uk/documentation/udprn) */ export declare const lookupUdprn: (options: LookupUdprnOptions) => Promise; /** * Lookup UMPRN * * Search for an address given a UDPRN * * Invalid UDPRN returns `null` * * [API Documentation for /udprn](https://ideal-postcodes.co.uk/documentation/udprn) */ export declare const lookupUmprn: (options: LookupUmprnOptions) => Promise; /** * Check Key Availability * * Checks if a key can bey used * * [API Documentation for /keys]()https://ideal-postcodes.co.uk/documentation/keys#key) */ export declare const checkKeyUsability: (options: CheckKeyUsabilityOptions) => Promise;