-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
79 lines (72 loc) · 2.58 KB
/
index.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
export class Alliance {
public static cache: Cache<Alliance>;
public static maxLife: number;
constructor(name: string, id: string, tag: string, memberCount: number, founded: number, founderId: string, guildIds: string[]);
public name: string;
public id: string;
public tag: string;
public memberCount: number;
public guildCount: number;
public founded: Date;
public founderId: string;
public guildIds: string[];
public getFounder(): Promise<Player | null>;
public getGuilds(max: number): Promise<Guild[]>;
}
export class Guild {
public static cache: Cache<Guild>;
public static maxLife: number;
constructor(name: string, id: string, alliance: Alliance | null, memberCount: number, founded: number, founderId: string);
public name: string;
public id: string;
public alliance: Alliance | null;
public memberCount: number;
public founded: Date;
public founderId: string;
public getFounder(): Promise<Player | null>;
}
export class Player {
public static cache: Cache<Player>;
public static maxLife: number;
constructor(name: string, id: string, guild: Guild | null, avatar: PlayerAvatar);
public name: string;
public id: string;
public guild: Guild | null;
public alliance: Alliance | null;
public avatar: PlayerAvatar;
public fame: Fame;
}
export interface PlayerAvatar {
public code: string;
public ringCode: string;
}
export class Fame {
public pve: FameTypeExtended;
public gathering: { fiber: FameType, hide: FameType, ore: FameType, rock: FameType, wood: FameType, all: FameType };
public crafting: FameType;
public fishing: FameType;
public farming: FameType;
}
export class FameType {
public total: number;
public royal: number;
public outlands: number;
public avalon: number;
}
export class FameTypeExtended extends FameType {
public hellgate: number;
public corrupted: number
public mists: number
}
export interface CacheItem<T> {
content: T;
timestamp: number
}
export type Cache<T> = Map<string, CacheItem<T>>;
export declare function getPlayerByName (name: string): Promise<Player | null>;
export declare function getPlayerById (id: string): Promise<Player | null>;
export declare function getGuildByName (name: string): Promise<Guild | null>;
export declare function getGuildById (id: string): Promise<Guild | null>;
export declare function getAllianceById (id: string): Promise<Alliance | null>;
export declare function getPlayerId (name: string): Promise<string>;
export declare function getGuildId (name: string): Promise<string>;