Created
April 27, 2018 17:13
-
-
Save Deiru2k/77c534171e14d9426e59d981e3eaf5e7 to your computer and use it in GitHub Desktop.
dadata-suggestions typings for TS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For Own Project | |
interface CommonParams { | |
query: string, | |
count?: number, | |
} | |
interface FIOParams extends CommonParams { | |
parts?: 'NAME' | 'SURNAME' | 'PATRONYMIC', | |
gender?: 'MALE' | 'FEMALE' | 'UNKNOWN', | |
} | |
interface AddressLocationParams { | |
region_fias_id?: number, | |
area_fias_id?: number, | |
city_fias_id?: number, | |
settlement_fias_id?: number, | |
street_fias_id?: number, | |
} | |
interface AddressParams extends CommonParams { | |
locations?: AddressLocationParams, | |
} | |
interface PartyLocationParams extends AddressLocationParams { | |
kladr_id?: number; | |
} | |
interface PartyParams extends CommonParams { | |
status?: 'ACTIVE' | 'LIQUIDATING' | 'LIQUIDATED'; | |
type?: 'LEGAL' | 'INDIVIDUAL'; | |
locations: PartyLocationParams[]; | |
} | |
interface BankParams extends CommonParams { | |
status?: 'ACTIVE' | 'LIQUIDATING' | 'LIQUIDATED'; | |
type?: 'BANK' | 'NKO' | 'BANK_BRANCH' | 'NKO_BRANCH' | 'RKC' | 'OTHER'; | |
} | |
declare class DaData { | |
constructor(apyKey: string); | |
fio(params: FIOParams): PromiseLike<Array<any> | any>; | |
address(params: AddressParams): PromiseLike<Array<any> | any>; | |
party(params: PartyParams): PromiseLike<Array<any> | any>; | |
bank(params: BankParams): PromiseLike<Array<any> | any>; | |
email(params: CommonParams): PromiseLike<Array<any> | any>; | |
} | |
declare namespace DaData {} | |
declare module 'dadata-suggestions' { | |
export = DaData; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For Package itself | |
interface CommonParams { | |
query: string, | |
count?: number, | |
} | |
interface FIOParams extends CommonParams { | |
parts?: 'NAME' | 'SURNAME' | 'PATRONYMIC', | |
gender?: 'MALE' | 'FEMALE' | 'UNKNOWN', | |
} | |
interface AddressLocationParams { | |
region_fias_id?: number, | |
area_fias_id?: number, | |
city_fias_id?: number, | |
settlement_fias_id?: number, | |
street_fias_id?: number, | |
} | |
interface AddressParams extends CommonParams { | |
locations?: AddressLocationParams, | |
} | |
interface PartyLocationParams extends AddressLocationParams { | |
kladr_id?: number; | |
} | |
interface PartyParams extends CommonParams { | |
status?: 'ACTIVE' | 'LIQUIDATING' | 'LIQUIDATED'; | |
type?: 'LEGAL' | 'INDIVIDUAL'; | |
locations: PartyLocationParams[]; | |
} | |
interface BankParams extends CommonParams { | |
status?: 'ACTIVE' | 'LIQUIDATING' | 'LIQUIDATED'; | |
type?: 'BANK' | 'NKO' | 'BANK_BRANCH' | 'NKO_BRANCH' | 'RKC' | 'OTHER'; | |
} | |
declare class DaData { | |
constructor(apyKey: string); | |
fio(params: FIOParams): PromiseLike<Array<any> | any>; | |
address(params: AddressParams): PromiseLike<Array<any> | any>; | |
party(params: PartyParams): PromiseLike<Array<any> | any>; | |
bank(params: BankParams): PromiseLike<Array<any> | any>; | |
email(params: CommonParams): PromiseLike<Array<any> | any>; | |
} | |
export DaData; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment