UNPKG

thai-address-picker-react

Version:

[![NPM](https://img.shields.io/npm/v/thai-address-picker-react)](https://www.npmjs.com/package/thai-address-picker-react) [![NPM](https://img.shields.io/badge/Watsize-Library-289548)](https://www.npmjs.com/package/thai-address-picker-react) [![Downloads](

27 lines (26 loc) 1.05 kB
export interface Address { district: string; amphoe: string; province: string; zipcode: string; } export interface CompatibleDatabase { lookup: string; words: string; data: any[]; } export interface Config { database?: CompatibleDatabase; maxSearchResult?: number; } export declare class ThaiAddressFinder { #private; constructor({ database, maxSearchResult, }?: Config); private preProcess; private resolveResultByField; GetConfig: () => Config; SearchAddressByDistrict: (searchStr: string, filter?: (value?: Address, index?: number, array?: Address[]) => boolean) => Address[]; SearchAddressByAmphoe: (searchStr: string, filter?: (value?: Address, index?: number, array?: Address[]) => boolean) => Address[]; SearchAddressByProvince: (searchStr: string, filter?: (value?: Address, index?: number, array?: Address[]) => boolean) => Address[]; SearchAddressByZipcode: (searchStr: string, filter?: (value?: Address, index?: number, array?: Address[]) => boolean) => Address[]; }