-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.d.ts
88 lines (80 loc) · 3.29 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
80
81
82
83
84
85
86
87
88
// Type definitions for ./index.js
import { StatsGeneral } from './types/general';
import { StatsCasual } from './types/casual';
import { StatsRank } from './types/rank';
import { StatsDeathmatch } from './types/deathmatch';
import { StatsOperator } from './types/operator';
/**
* Fetch General stats.
* @param {string} platform: pc | xbox | psn.
* @param {string} name: Player name.
* @returns Stats | `FORMAT_ERROR` | `PLATFORM_ERROR` | `NOT_FOUND` | `TIME_OUT`
* @typedef `FORMAT_ERROR`: Input format error.
* @typedef `PLATFORM_ERROR`: Input platform error.
* @typedef `NOT_FOUND`: No stats found or any errors.
* @typedef `TIME_OUT`: Fetch stats request time out.
*/
async function general(
platform: string,
name: string
): Promise<StatsGeneral | 'FORMAT_ERROR' | 'PLATFORM_ERROR' | 'NOT_FOUND' | 'TIME_OUT'>;
/**
* Fetch Casual stats.
* @param {string} platform: pc | xbox | psn.
* @param {string} name: Player name.
* @returns Stats | `FORMAT_ERROR` | `PLATFORM_ERROR` | `NOT_FOUND` | `TIME_OUT`
* @typedef `FORMAT_ERROR`: Input format error.
* @typedef `PLATFORM_ERROR`: Input platform error.
* @typedef `NOT_FOUND`: No stats found or any errors.
* @typedef `TIME_OUT`: Fetch stats request time out.
*/
declare async function casual(
platform: string,
name: string
): Promise<StatsCasual | 'FORMAT_ERROR' | 'PLATFORM_ERROR' | 'NOT_FOUND' | 'TIME_OUT'>;
/**
* Fetch Rank stats.
* @param {string} platform: pc | xbox | psn.
* @param {string} name: Player name.
* @returns Stats | `FORMAT_ERROR` | `PLATFORM_ERROR` | `NOT_FOUND` | `TIME_OUT`
* @typedef `FORMAT_ERROR`: Input format error.
* @typedef `PLATFORM_ERROR`: Input platform error.
* @typedef `NOT_FOUND`: No stats found or any errors.
* @typedef `TIME_OUT`: Fetch stats request time out.
*/
declare async function rank(
platform: string,
name: string
): Promise<StatsRank | 'FORMAT_ERROR' | 'PLATFORM_ERROR' | 'NOT_FOUND' | 'TIME_OUT'>;
/**
* Fetch Deathmatch stats.
* @param {string} platform: pc | xbox | psn.
* @param {string} name: Player name.
* @returns Stats | `FORMAT_ERROR` | `PLATFORM_ERROR` | `NOT_FOUND` | `TIME_OUT` | `NEVER_PLAY`
* @typedef `FORMAT_ERROR`: Input format error.
* @typedef `PLATFORM_ERROR`: Input platform error.
* @typedef `NOT_FOUND`: No stats found or any errors.
* @typedef `TIME_OUT`: Fetch stats request time out.
* @typedef `NEVER_PLAY`: Haven't played this mode this season.
*/
declare async function deathmatch(
platform: string,
name: string
): Promise<StatsDeathmatch | 'FORMAT_ERROR' | 'PLATFORM_ERROR' | 'NOT_FOUND' | 'TIME_OUT' | 'NEVER_PLAY'>;
/**
* Fetch Operators stats.
* @param {string} platform: pc | xbox | psn.
* @param {string} name: Player name.
* @returns Stats | `FORMAT_ERROR` | `PLATFORM_ERROR` | `NOT_FOUND` | `TIME_OUT` | `OPERATOR_ERROR`
* @typedef `FORMAT_ERROR`: Input format error.
* @typedef `PLATFORM_ERROR`: Input platform error.
* @typedef `NOT_FOUND`: No stats found or any errors.
* @typedef `TIME_OUT`: Fetch stats request time out.
* @typedef `OPERATOR_ERROR`: Wrong operator name.
*/
declare async function operator(
platform: string,
name: string,
operator: string
): Promise<StatsOperator | 'FORMAT_ERROR' | 'PLATFORM_ERROR' | 'NOT_FOUND' | 'TIME_OUT' | 'OPERATOR_ERROR'>;
export { general, casual, rank, deathmatch, operator };