Skip to content

Commit 2abb903

Browse files
committed
feat: extend types declaration
1 parent d5591e7 commit 2abb903

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

index.d.ts

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,41 @@
11
declare module "pokeapi-js-wrapper" {
2+
interface APIResource {
3+
url: string;
4+
[property: string]: any;
5+
}
6+
7+
interface APIResourceList {
8+
count: number;
9+
next: null | string;
10+
previous: null | string;
11+
results: APIResource[];
12+
[property: string]: any;
13+
}
14+
15+
interface NamedAPIResource {
16+
name: string;
17+
url: string;
18+
[property: string]: any;
19+
}
20+
21+
interface NamedAPIResourceList {
22+
count: number;
23+
next: null | string;
24+
previous: null | string;
25+
results: NamedAPIResource[];
26+
[property: string]: any;
27+
}
28+
229
export class Pokedex {
330
constructor(config?: {
4-
protocol?: string,
5-
hostName?: string,
6-
versionPath?: string,
7-
offset?: number
8-
limit?: number,
9-
timeout?: number,
10-
cache?: boolean,
11-
cacheImages?: boolean
31+
protocol?: string;
32+
hostName?: string;
33+
versionPath?: string;
34+
offset?: number;
35+
limit?: number;
36+
timeout?: number;
37+
cache?: boolean;
38+
cacheImages?: boolean;
1239
});
1340

1441
getBerryByName(name: string | number | string[] | number[]): Promise<object>;

0 commit comments

Comments
 (0)