Skip to content

Commit d02f0c0

Browse files
author
Mesquita Vincent
authored
Add types (#64)
1 parent 6fa1b73 commit d02f0c0

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

index.d.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
declare interface Marketplace {
2+
code: string;
3+
id: string;
4+
name: string;
5+
region: string;
6+
domain?: string;
7+
mwsDomain?: string;
8+
advertisingApiDomain?: string;
9+
imagesDomain?: string;
10+
vendorId?: string;
11+
}
12+
13+
/**
14+
* Get a marketplace by its id
15+
* @param id The marketplace's id
16+
* @returns The marketplace
17+
*/
18+
declare function getMarketplaceById(id: string): Marketplace | undefined
19+
20+
/**
21+
* Get a marketplace by its code
22+
* @param code The marketplace's code
23+
* @returns The markerplace
24+
*/
25+
declare function getMarketplaceByCode(code: string): Marketplace | undefined
26+
27+
/**
28+
* Get a marketplace by its domain
29+
* @param domain The marketplace's domain
30+
* @returns The marketplace
31+
*/
32+
declare function getMarketplaceByDomain(domain: string): Marketplace | undefined
33+
34+
/**
35+
* Get several marketplaces by a MWS domain
36+
* @param domain The MWS domain
37+
* @returns The marketplaces
38+
*/
39+
declare function getMarketplacesByMwsDomain(domain: string): Marketplace[]
40+
41+
/**
42+
* Get several marketplaces by a MWS region
43+
* @param mwsRegion The MWS region
44+
* @returns The marketplaces
45+
*/
46+
declare function getMarketplacesByMwsRegion(mwsRegion: string): Marketplace[]

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
},
1212
"files": [
1313
"index.js",
14+
"index.d.ts",
1415
"marketplaces.json"
1516
],
17+
"types": "index.d.ts",
1618
"dependencies": {
1719
"memoizee": "^0.4.14"
1820
},

0 commit comments

Comments
 (0)