UNPKG

ikea-availability-checker

Version:

ikea product in-store availability checker and product search

40 lines (39 loc) 1.53 kB
export interface Store { /** unique identifier of a store */ buCode: buCode; /** name of the store */ name: string; /** geo-coordinates of the store, longitude, latitude */ coordinates: [number, number]; /** alpha-2 country code */ countryCode: countryCode; /** country name */ country: string; } /** buCode unique ikea store identification number */ export type buCode = string; /** ISO 3166-1 alpha 2 lowercase country code */ export type countryCode = string; export declare const stores: Store[]; /** * Find stores by matching the given query against the buCode, countryCode or * name of a store and return an array of all matching stores. */ export declare function findByQuery( /** query case insensitive search query */ query: string | RegExp, /** optional additional countryCode that must match */ countryCode?: countryCode | null): Store[]; export declare function findById(buCodes: buCode | buCode[]): Store[]; export declare function findOneById(buCode: buCode): Store | undefined; export declare function findByCountryCode(countryCodes: countryCode | countryCode[]): Store[]; /** * Returns an array with all ISO 3166-1 alpha 2 country codes that have at * least one store in alphabetical order. */ export declare function getCountryCodes(): countryCode[]; /** * Transforms a ISO 3166-2 country code like "gb" to the ISO 639-2 * language code ("en") that is supported by the IOWS endpoint. */ export declare function getLanguageCode(countryCode: countryCode): string;