-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathschema.ts
More file actions
47 lines (42 loc) · 1.39 KB
/
schema.ts
File metadata and controls
47 lines (42 loc) · 1.39 KB
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
export type NameToDefindex = { [name: string]: number };
export type DefindexToName = { [defindex: number]: string };
export type SchemaEnum = NameToDefindex & DefindexToName;
export type ItemsGame = {
items: Record<
string,
{ static_attrs?: { 'set supply crate series'?: string } }
>;
};
export type SchemaItem = {
name: string;
defindex: number;
item_class: string;
item_type_name: string;
item_name: string;
proper_name: boolean | string | undefined;
};
/**
* Injectable schema interface.
*/
export type ISchema = {
getDefindex(search: number | string): number | null;
getName(search: number | string): string;
getEffectName(effect: number | string): string;
getWearName(wear: number | string): string;
getKillstreakName(killstreak: number | string): string;
getTextureName(texture: number | string): string;
getQualityName(quality: number | string): string;
getEffectEnum(effect: number | string): number;
getWearEnum(wear: number | string): number;
getKillstreakEnum(killstreak: number | string): number;
getTextureEnum(texture: number | string): number;
getQualityEnum(quality: number | string): number;
getTextures(): SchemaEnum;
getEffects(): SchemaEnum;
getItems(): SchemaItem[];
getTextureNames(): NameToDefindex;
getEffectNames(): NameToDefindex;
isUniqueHat(nameOrDefindex: string | number): boolean;
getCrateNumber(defindex: string | number): number;
getVersion(): number;
};