-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.d.ts
56 lines (52 loc) · 1.44 KB
/
main.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
declare module 'quick-opgg-scraper' {
export enum Region {
NORTH_AMERICA = 'na',
MIDDLE_EAST = 'me',
EUROPE_WEST = 'euw',
EUROPE_NORDICEAST = 'eune',
OCEANIA = 'oce',
KOREA = 'kr',
JAPAN = 'jp',
BRAZIL = 'br',
LATIN_AMERICA_SOUTH = 'las',
LATIN_AMERICA_NORTH = 'lan',
RUSSIA = 'ru',
TURKIYE = 'tr',
SINGAPORE = 'sg',
PHILIPPINES = 'ph',
TAIWAN = 'tw',
VIETNAM = 'vn',
THAILAND = 'th'
}
export interface RankedData {
rank: string | null;
lp: string | null;
wins: string | null;
losses: string | null;
winrate: string | null;
ladderRank?: string | null;
}
export interface PlayerData {
riotId: string;
name: string;
tag: string;
region: Region;
level: string;
ranked: {
soloQueue: RankedData;
flexQueue: RankedData;
};
icon: {
url: string;
id: string;
};
mostPlayedChampions: string[];
}
export interface CacheSettings {
enabled: boolean;
ttl: number;
}
export function getPlayerData(riotId: string, region: Region, forceRefresh?: boolean): Promise<PlayerData | { error: string }>;
export function configureCacheSettings(settings: Partial<CacheSettings>): void;
export function clearCache(): void;
}