nhle-api 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/README.md +319 -153
- package/lib/index.cjs +1600 -382
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +3189 -614
- package/lib/index.d.ts +3189 -614
- package/lib/index.js +1576 -381
- package/lib/index.js.map +1 -1
- package/lib/nhl-B7Hg7iMB.d.cts +462 -0
- package/lib/nhl-B7Hg7iMB.d.ts +462 -0
- package/lib/toolkit.cjs +1216 -0
- package/lib/toolkit.cjs.map +1 -0
- package/lib/toolkit.d.cts +502 -0
- package/lib/toolkit.d.ts +502 -0
- package/lib/toolkit.js +1194 -0
- package/lib/toolkit.js.map +1 -0
- package/package.json +43 -10
package/lib/index.d.cts
CHANGED
|
@@ -2,7 +2,10 @@ import * as arktype_internal_variants_number_ts from 'arktype/internal/variants/
|
|
|
2
2
|
import * as arktype_internal_variants_string_ts from 'arktype/internal/variants/string.ts';
|
|
3
3
|
import * as arktype_internal_variants_object_ts from 'arktype/internal/variants/object.ts';
|
|
4
4
|
import * as arktype from 'arktype';
|
|
5
|
+
import { Out } from 'arktype';
|
|
5
6
|
import * as arktype_internal_attributes_ts from 'arktype/internal/attributes.ts';
|
|
7
|
+
import { C as CayenneQueryBuilder } from './nhl-B7Hg7iMB.cjs';
|
|
8
|
+
export { a as CayenneCondition, c as CayenneExpression, d as CayenneGroup, n as NHL, b as buildCayenneExp, e as createCayenneQuery } from './nhl-B7Hg7iMB.cjs';
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
11
|
* Error handling module for NHL Sports Data API wrapper
|
|
@@ -25,6 +28,14 @@ declare const ErrorCategory: {
|
|
|
25
28
|
readonly VALIDATION: "VALIDATION";
|
|
26
29
|
};
|
|
27
30
|
type ErrorCategory = (typeof ErrorCategory)[keyof typeof ErrorCategory];
|
|
31
|
+
declare const LogLevel$1: {
|
|
32
|
+
NONE: number;
|
|
33
|
+
ERROR: number;
|
|
34
|
+
WARN: number;
|
|
35
|
+
INFO: number;
|
|
36
|
+
DEBUG: number;
|
|
37
|
+
};
|
|
38
|
+
type LogLevel$1 = (typeof LogLevel$1)[keyof typeof LogLevel$1];
|
|
28
39
|
interface ErrorContext {
|
|
29
40
|
/** HTTP status code if applicable */
|
|
30
41
|
statusCode?: number;
|
|
@@ -43,6 +54,14 @@ interface ErrorContext {
|
|
|
43
54
|
/** Additional metadata */
|
|
44
55
|
metadata?: Record<string, unknown>;
|
|
45
56
|
}
|
|
57
|
+
interface ErrorConfig {
|
|
58
|
+
/** Logging level for error output */
|
|
59
|
+
logLevel?: LogLevel$1;
|
|
60
|
+
/** Custom logger function */
|
|
61
|
+
logger?: (level: LogLevel$1, message: string, context?: ErrorContext) => void;
|
|
62
|
+
/** Whether to include stack traces */
|
|
63
|
+
includeStack?: boolean;
|
|
64
|
+
}
|
|
46
65
|
/**
|
|
47
66
|
* Base error class for all NHL API errors
|
|
48
67
|
*/
|
|
@@ -61,318 +80,3000 @@ declare class NHLError extends Error {
|
|
|
61
80
|
context: ErrorContext;
|
|
62
81
|
};
|
|
63
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Network-level errors (timeouts, connection failures)
|
|
85
|
+
*/
|
|
86
|
+
declare class NetworkError extends NHLError {
|
|
87
|
+
constructor(message: string, context?: ErrorContext);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* HTTP 4xx client errors
|
|
91
|
+
*/
|
|
92
|
+
declare class ClientError extends NHLError {
|
|
93
|
+
constructor(message: string, context?: ErrorContext);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* HTTP 404 resource not found
|
|
97
|
+
*/
|
|
98
|
+
declare class NotFoundError extends ClientError {
|
|
99
|
+
constructor(message?: string, context?: ErrorContext);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* HTTP 5xx server errors
|
|
103
|
+
*/
|
|
104
|
+
declare class ServerError extends NHLError {
|
|
105
|
+
constructor(message: string, context?: ErrorContext);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* HTTP 429 rate limit errors
|
|
109
|
+
*/
|
|
110
|
+
declare class RateLimitError extends NHLError {
|
|
111
|
+
readonly retryAfter?: number;
|
|
112
|
+
constructor(message?: string, context?: ErrorContext, retryAfter?: number);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* API returned 200 but with error message in JSON payload
|
|
116
|
+
*/
|
|
117
|
+
declare class APIError extends NHLError {
|
|
118
|
+
constructor(message: string, context?: ErrorContext);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Response parsing or validation failures
|
|
122
|
+
*/
|
|
123
|
+
declare class ParseError extends NHLError {
|
|
124
|
+
constructor(message: string, context?: ErrorContext);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Invalid user input or configuration
|
|
128
|
+
*/
|
|
129
|
+
declare class ValidationError extends NHLError {
|
|
130
|
+
constructor(message: string, context?: ErrorContext);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Error handler utility class
|
|
134
|
+
*/
|
|
135
|
+
declare class ErrorHandler {
|
|
136
|
+
private overrides;
|
|
137
|
+
/**
|
|
138
|
+
* @param config - Overrides; an unset `logLevel` follows the shared
|
|
139
|
+
* `config.logLevel` at log time.
|
|
140
|
+
*/
|
|
141
|
+
constructor(config?: ErrorConfig);
|
|
142
|
+
private get config();
|
|
143
|
+
/**
|
|
144
|
+
* Default console-based logger
|
|
145
|
+
*/
|
|
146
|
+
private defaultLogger;
|
|
147
|
+
/**
|
|
148
|
+
* Log an error based on configuration
|
|
149
|
+
*/
|
|
150
|
+
log(error: NHLError): void;
|
|
151
|
+
/**
|
|
152
|
+
* Determine log level based on error category
|
|
153
|
+
*/
|
|
154
|
+
private getLogLevel;
|
|
155
|
+
/**
|
|
156
|
+
* Create error from HTTP response
|
|
157
|
+
*/
|
|
158
|
+
fromResponse(response: Response, context?: Omit<ErrorContext, 'statusCode'>): Promise<NHLError>;
|
|
159
|
+
/**
|
|
160
|
+
* Create error from caught exception
|
|
161
|
+
*/
|
|
162
|
+
fromError(error: unknown, context?: ErrorContext): NHLError;
|
|
163
|
+
/**
|
|
164
|
+
* Update configuration
|
|
165
|
+
*/
|
|
166
|
+
configure(config: Partial<ErrorConfig>): void;
|
|
167
|
+
}
|
|
64
168
|
|
|
65
169
|
/**
|
|
66
170
|
* NHL API Client Type Definitions
|
|
67
171
|
*/
|
|
68
172
|
|
|
69
|
-
|
|
70
|
-
|
|
173
|
+
/**
|
|
174
|
+
* Configuration options for the NHL API client
|
|
175
|
+
*/
|
|
176
|
+
interface NHLClientConfig {
|
|
177
|
+
/**
|
|
178
|
+
* Base URL for the NHL API
|
|
179
|
+
* @default 'https://api-web.nhle.com/v1'
|
|
180
|
+
*/
|
|
181
|
+
baseUrl?: string;
|
|
182
|
+
/**
|
|
183
|
+
* Request timeout in milliseconds
|
|
184
|
+
* @default 5000 (5 seconds)
|
|
185
|
+
*/
|
|
186
|
+
timeout?: number;
|
|
187
|
+
/**
|
|
188
|
+
* Additional headers to include with every request
|
|
189
|
+
*/
|
|
190
|
+
headers?: Record<string, string>;
|
|
191
|
+
/**
|
|
192
|
+
* Language code for localized responses
|
|
193
|
+
* @default 'en' (English)
|
|
194
|
+
*/
|
|
195
|
+
language?: 'en' | 'fr';
|
|
196
|
+
}
|
|
197
|
+
type APIResult<T> = {
|
|
198
|
+
success: true;
|
|
71
199
|
data: T;
|
|
72
200
|
} | {
|
|
73
|
-
|
|
201
|
+
success: false;
|
|
74
202
|
error: NHLError;
|
|
75
203
|
};
|
|
76
204
|
|
|
77
|
-
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
205
|
+
/**
|
|
206
|
+
* Common types used in Gamecenter API responses
|
|
207
|
+
*/
|
|
208
|
+
/** The current state of the game. */
|
|
209
|
+
type GameState$2 = 'OFF' | 'FUT' | 'LIVE' | 'PRE' | 'CRIT' | 'FINAL';
|
|
210
|
+
/** The current state of the game. */
|
|
211
|
+
type GameScheduleState = 'OK' | 'TBD' | 'CNCL' | (string & {});
|
|
212
|
+
/** The type of period in the game. */
|
|
213
|
+
type PeriodType = 'REG' | 'OT' | 'SO';
|
|
214
|
+
/** Abbreviated day of the week. (MON = Monday, TUE = Tuesday ...) */
|
|
215
|
+
type DayAbbrev = 'MON' | 'TUE' | 'WED' | 'THU' | 'FRI' | 'SAT' | 'SUN';
|
|
216
|
+
/** The type of penalty. (MIN = Minor, BEN = Bench, MAJ = Major ...) */
|
|
217
|
+
type PenaltyTypeCode = 'MIN' | 'BEN' | 'MAJ' | (string & {});
|
|
218
|
+
/** The market for this broadcast. (H = Home, A = Away, N = National, S = Satellite Radio) */
|
|
219
|
+
type Market = 'H' | 'A' | 'N' | 'S';
|
|
220
|
+
/** The country code for this broadcast. (CA = Canada, US = United States) */
|
|
221
|
+
type CountryCode$2 = 'CA' | 'US';
|
|
222
|
+
/** The position code for a player. (C = Center, L[W] = Left Wing, R[W] = Right Wing, D = Defenseman, G = Goalie) */
|
|
223
|
+
type PositionCode = 'C' | 'LW' | 'L' | 'RW' | 'R' | 'D' | 'G';
|
|
224
|
+
/** Player's shooting/catching handedness. (L = Left, R = Right) */
|
|
225
|
+
type ShootsCatches = 'L' | 'R';
|
|
226
|
+
type HexColorCode = `#${string}`;
|
|
227
|
+
type UTCOffset = `+${number}:${number}` | `-${number}:${number}`;
|
|
228
|
+
type GoalModifier = 'none' | 'empty-net' | 'awarded-empty-net';
|
|
229
|
+
type DefendingSide = 'left' | 'right';
|
|
230
|
+
type Strength = 'ev' | 'pp' | 'sh';
|
|
231
|
+
type ZoneCode = 'N' | 'D' | 'O';
|
|
232
|
+
type ShotType = 'backhand' | 'bat' | 'between-legs' | 'deflected' | 'poke' | 'slap' | 'snap' | 'tip-in' | 'wrap-around' | 'wrist' | (string & {});
|
|
233
|
+
type PenaltyDescKey = 'tripping' | 'hooking' | 'interference' | 'high-sticking' | 'roughing' | 'unsportsmanlike-conduct' | 'slashing' | 'delaying-game-puck-over-glass' | 'holding' | 'holding-the-stick' | 'too-many-men-on-the-ice' | 'fighting' | 'minor' | 'cross-checking' | (string & {});
|
|
234
|
+
type Reason = 'blocked' | 'failed-bank-attempt' | 'wide-right' | 'goalie-stopped-after-sog' | 'offside' | 'teammate-blocked' | 'icing' | 'puck-in-netting' | 'wide-left' | 'high-and-wide-left' | 'puck-frozen' | 'above-crossbar' | 'tv-timeout' | 'hand-pass' | 'skater-puck-frozen' | 'high-stick' | 'high-and-wide-right' | 'hit-crossbar' | 'puck-in-benches' | 'hit-right-post' | 'short' | 'referee-or-linesman' | 'puck-in-crowd' | 'hit-left-post' | 'player-equipment' | 'net-dislodged-defensive-skater' | 'home-timeout' | 'chlg-hm-goal-interference' | 'video-review' | 'chlg-league-missed-stoppage' | 'visitor-timeout' | 'official-injury' | (string & {});
|
|
235
|
+
type EventTypeDescKey = 'period-start' | 'faceoff' | 'blocked-shot' | 'goal' | 'hit' | 'giveaway' | 'missed-shot' | 'shot-on-goal' | 'stoppage' | 'takeaway' | 'penalty' | 'period-end' | 'delayed-penalty' | 'game-end' | (string & {});
|
|
236
|
+
/** An object containing a default string an optional localized strings. */
|
|
237
|
+
interface LocalizedText {
|
|
238
|
+
/** Default */
|
|
239
|
+
default: string;
|
|
240
|
+
/** French */
|
|
241
|
+
fr?: string;
|
|
242
|
+
/** Czech */
|
|
243
|
+
cs?: string;
|
|
244
|
+
/** German */
|
|
245
|
+
de?: string;
|
|
246
|
+
/** Spanish */
|
|
247
|
+
es?: string;
|
|
248
|
+
/** Finnish */
|
|
249
|
+
fi?: string;
|
|
250
|
+
/** Slovak */
|
|
251
|
+
sk?: string;
|
|
252
|
+
/** Swedish */
|
|
253
|
+
sv?: string;
|
|
254
|
+
}
|
|
255
|
+
interface TvBroadcast {
|
|
256
|
+
id: number;
|
|
257
|
+
market: Market;
|
|
258
|
+
countryCode: CountryCode$2;
|
|
259
|
+
network: string;
|
|
260
|
+
sequenceNumber: number;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Response types for the NHL Edge advanced stats endpoints
|
|
265
|
+
* (api-web.nhle.com/v1/edge/*), exposed as the `adv` namespace.
|
|
266
|
+
*
|
|
267
|
+
* Generated from live responses for two seasons (regular season and
|
|
268
|
+
* playoffs) and kept in step by the API drift check.
|
|
269
|
+
*/
|
|
270
|
+
|
|
271
|
+
/** A measurement in both unit systems (mph/km/h, feet/metres or miles/km) */
|
|
272
|
+
interface EdgeMeasurement {
|
|
273
|
+
imperial: number;
|
|
274
|
+
metric: number;
|
|
275
|
+
}
|
|
276
|
+
/** A season with Edge data and the game types it covers */
|
|
277
|
+
interface EdgeSeason {
|
|
278
|
+
id: number;
|
|
279
|
+
gameTypes: number[];
|
|
280
|
+
}
|
|
281
|
+
/** The game a stat was recorded in, shown as an overlay on nhl.com/edge */
|
|
282
|
+
interface EdgeOverlay {
|
|
283
|
+
player?: {
|
|
284
|
+
firstName: LocalizedText;
|
|
285
|
+
lastName: LocalizedText;
|
|
286
|
+
};
|
|
287
|
+
gameDate: string;
|
|
288
|
+
awayTeam: {
|
|
289
|
+
abbrev: string;
|
|
290
|
+
score: number;
|
|
291
|
+
};
|
|
292
|
+
homeTeam: {
|
|
293
|
+
abbrev: string;
|
|
294
|
+
score: number;
|
|
295
|
+
};
|
|
296
|
+
gameOutcome: {
|
|
297
|
+
lastPeriodType: string;
|
|
298
|
+
otPeriods?: number;
|
|
299
|
+
};
|
|
300
|
+
periodDescriptor: EdgePeriodDescriptor;
|
|
301
|
+
timeInPeriod?: string;
|
|
302
|
+
gameType: number;
|
|
303
|
+
}
|
|
304
|
+
/** Period of a game event */
|
|
305
|
+
interface EdgePeriodDescriptor {
|
|
306
|
+
maxRegulationPeriods: number;
|
|
307
|
+
number: number;
|
|
308
|
+
periodType: string;
|
|
309
|
+
}
|
|
310
|
+
/** Team logo URLs for light and dark backgrounds */
|
|
311
|
+
interface EdgeTeamLogos {
|
|
312
|
+
light: string;
|
|
313
|
+
dark: string;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* A team as Edge responses nest it. Detail and landing endpoints add
|
|
317
|
+
* the optional fields; game rows carry only names, abbrev and logos.
|
|
318
|
+
*/
|
|
319
|
+
interface EdgeTeam {
|
|
320
|
+
commonName: LocalizedText;
|
|
321
|
+
placeNameWithPreposition: LocalizedText;
|
|
322
|
+
abbrev?: string;
|
|
323
|
+
teamLogo: EdgeTeamLogos;
|
|
324
|
+
id?: number;
|
|
325
|
+
slug?: string;
|
|
326
|
+
conference?: string;
|
|
327
|
+
division?: string;
|
|
328
|
+
wins?: number;
|
|
329
|
+
losses?: number;
|
|
330
|
+
otLosses?: number;
|
|
331
|
+
gamesPlayed?: number;
|
|
332
|
+
points?: number;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* A player as Edge responses nest it. Detail endpoints add season totals
|
|
336
|
+
* (skater or goalie); top-10 rows carry only names, slug and team.
|
|
337
|
+
*/
|
|
338
|
+
interface EdgePlayer {
|
|
339
|
+
birthDate?: string;
|
|
340
|
+
id?: number;
|
|
341
|
+
firstName: LocalizedText;
|
|
342
|
+
lastName: LocalizedText;
|
|
343
|
+
sweaterNumber?: number;
|
|
344
|
+
position?: string;
|
|
345
|
+
slug: string;
|
|
346
|
+
headshot?: string;
|
|
347
|
+
shootsCatches?: string;
|
|
348
|
+
team?: EdgeTeam;
|
|
349
|
+
goals?: number;
|
|
350
|
+
assists?: number;
|
|
351
|
+
points?: number;
|
|
352
|
+
gamesPlayed?: number;
|
|
353
|
+
wins?: number;
|
|
354
|
+
losses?: number;
|
|
355
|
+
overtimeLosses?: number;
|
|
356
|
+
goalsAgainstAvg?: number;
|
|
357
|
+
savePctg?: number;
|
|
358
|
+
}
|
|
359
|
+
/** Response of `adv.byTheNumbers` */
|
|
360
|
+
interface EdgeByTheNumbers {
|
|
361
|
+
games: number;
|
|
362
|
+
gameDate: string;
|
|
363
|
+
hardestShotSkater: {
|
|
364
|
+
player: EdgePlayer;
|
|
365
|
+
overlay: EdgeOverlay;
|
|
366
|
+
shotSpeed: EdgeMeasurement;
|
|
367
|
+
};
|
|
368
|
+
maxSkatingSpeedSkater: {
|
|
369
|
+
player: EdgePlayer;
|
|
370
|
+
overlay: EdgeOverlay;
|
|
371
|
+
skatingSpeed: EdgeMeasurement;
|
|
372
|
+
};
|
|
373
|
+
totalDistanceSkatedSkater: {
|
|
374
|
+
player: EdgePlayer;
|
|
375
|
+
distanceSkated: {
|
|
376
|
+
imperial: number;
|
|
377
|
+
metric: number;
|
|
378
|
+
overlay: EdgeOverlay;
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
totalDistanceSkatedTeam: {
|
|
382
|
+
team: EdgeTeam;
|
|
383
|
+
game: {
|
|
384
|
+
gameCenterLink: string;
|
|
385
|
+
gameDate: string;
|
|
386
|
+
isHomeTeam: boolean;
|
|
387
|
+
homeTeam: EdgeTeam;
|
|
388
|
+
awayTeam: EdgeTeam;
|
|
389
|
+
distanceSkated: EdgeMeasurement;
|
|
390
|
+
};
|
|
391
|
+
topFiveSkaters: {
|
|
392
|
+
gameCenterLink: string;
|
|
393
|
+
gameDate: string;
|
|
394
|
+
playerOnHomeTeam: boolean;
|
|
395
|
+
distanceSkated: EdgeMeasurement;
|
|
396
|
+
toi: number;
|
|
397
|
+
homeTeam: {
|
|
398
|
+
id: number;
|
|
399
|
+
commonName: LocalizedText;
|
|
400
|
+
placeNameWithPreposition: LocalizedText;
|
|
401
|
+
abbrev: string;
|
|
402
|
+
slug: string;
|
|
403
|
+
teamLogo: EdgeTeamLogos;
|
|
404
|
+
conference: string;
|
|
405
|
+
division: string;
|
|
406
|
+
};
|
|
407
|
+
awayTeam: {
|
|
408
|
+
id: number;
|
|
409
|
+
commonName: LocalizedText;
|
|
410
|
+
placeNameWithPreposition: LocalizedText;
|
|
411
|
+
abbrev: string;
|
|
412
|
+
slug: string;
|
|
413
|
+
teamLogo: EdgeTeamLogos;
|
|
414
|
+
conference: string;
|
|
415
|
+
division: string;
|
|
416
|
+
};
|
|
417
|
+
player: {
|
|
418
|
+
name: LocalizedText;
|
|
419
|
+
};
|
|
420
|
+
}[];
|
|
421
|
+
};
|
|
422
|
+
totalDistanceSkatedLeague: {
|
|
423
|
+
distanceSkated: EdgeMeasurement;
|
|
424
|
+
topFiveSkaters: {
|
|
425
|
+
gameCenterLink: string;
|
|
426
|
+
gameDate: string;
|
|
427
|
+
playerOnHomeTeam: boolean;
|
|
428
|
+
distanceSkated: EdgeMeasurement;
|
|
429
|
+
toi: number;
|
|
430
|
+
homeTeam: {
|
|
431
|
+
id: number;
|
|
432
|
+
commonName: LocalizedText;
|
|
433
|
+
placeNameWithPreposition: LocalizedText;
|
|
434
|
+
abbrev: string;
|
|
435
|
+
slug: string;
|
|
436
|
+
teamLogo: EdgeTeamLogos;
|
|
437
|
+
conference: string;
|
|
438
|
+
division: string;
|
|
439
|
+
};
|
|
440
|
+
awayTeam: {
|
|
441
|
+
id: number;
|
|
442
|
+
commonName: LocalizedText;
|
|
443
|
+
placeNameWithPreposition: LocalizedText;
|
|
444
|
+
abbrev: string;
|
|
445
|
+
slug: string;
|
|
446
|
+
teamLogo: EdgeTeamLogos;
|
|
447
|
+
conference: string;
|
|
448
|
+
division: string;
|
|
449
|
+
};
|
|
450
|
+
player: {
|
|
451
|
+
name: LocalizedText;
|
|
452
|
+
};
|
|
453
|
+
}[];
|
|
454
|
+
};
|
|
455
|
+
sogTeam: {
|
|
456
|
+
team: EdgeTeam;
|
|
457
|
+
shots: number;
|
|
458
|
+
sogDetails: {
|
|
459
|
+
area: string;
|
|
460
|
+
shots: number;
|
|
461
|
+
}[];
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
/** Response of `adv.skaters.detail` */
|
|
465
|
+
interface EdgeSkaterDetail {
|
|
466
|
+
player: EdgePlayer;
|
|
467
|
+
seasonsWithEdgeStats: EdgeSeason[];
|
|
468
|
+
topShotSpeed: {
|
|
469
|
+
imperial: number;
|
|
470
|
+
metric: number;
|
|
471
|
+
percentile: number;
|
|
472
|
+
leagueAvg: EdgeMeasurement;
|
|
473
|
+
overlay: EdgeOverlay;
|
|
474
|
+
};
|
|
475
|
+
skatingSpeed: {
|
|
476
|
+
speedMax: {
|
|
477
|
+
imperial: number;
|
|
478
|
+
metric: number;
|
|
479
|
+
percentile: number;
|
|
480
|
+
leagueAvg: EdgeMeasurement;
|
|
481
|
+
overlay: EdgeOverlay;
|
|
482
|
+
};
|
|
483
|
+
burstsOver20: {
|
|
484
|
+
value: number;
|
|
485
|
+
percentile: number;
|
|
486
|
+
leagueAvg: {
|
|
487
|
+
value: number;
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
totalDistanceSkated: {
|
|
492
|
+
imperial: number;
|
|
493
|
+
metric: number;
|
|
494
|
+
percentile: number;
|
|
495
|
+
leagueAvg: EdgeMeasurement;
|
|
496
|
+
};
|
|
497
|
+
distanceMaxGame: {
|
|
498
|
+
imperial: number;
|
|
499
|
+
metric: number;
|
|
500
|
+
percentile: number;
|
|
501
|
+
leagueAvg: EdgeMeasurement;
|
|
502
|
+
overlay: EdgeOverlay;
|
|
503
|
+
};
|
|
504
|
+
sogSummary: {
|
|
505
|
+
locationCode: string;
|
|
506
|
+
shots: number;
|
|
507
|
+
shotsPercentile: number;
|
|
508
|
+
shotsLeagueAvg: number;
|
|
509
|
+
goals: number;
|
|
510
|
+
goalsPercentile: number;
|
|
511
|
+
goalsLeagueAvg: number;
|
|
512
|
+
shootingPctg: number;
|
|
513
|
+
shootingPctgPercentile: number;
|
|
514
|
+
shootingPctgLeagueAvg: number;
|
|
515
|
+
}[];
|
|
516
|
+
sogDetails: {
|
|
517
|
+
area: string;
|
|
518
|
+
shots: number;
|
|
519
|
+
shotsPercentile: number;
|
|
520
|
+
}[];
|
|
521
|
+
zoneTimeDetails: {
|
|
522
|
+
offensiveZonePctg: number;
|
|
523
|
+
offensiveZonePercentile: number;
|
|
524
|
+
offensiveZoneLeagueAvg: number;
|
|
525
|
+
offensiveZoneEvPctg: number;
|
|
526
|
+
offensiveZoneEvPercentile: number;
|
|
527
|
+
offensiveZoneEvLeagueAvg: number;
|
|
528
|
+
neutralZonePctg: number;
|
|
529
|
+
neutralZonePercentile: number;
|
|
530
|
+
neutralZoneLeagueAvg: number;
|
|
531
|
+
defensiveZonePctg: number;
|
|
532
|
+
defensiveZonePercentile: number;
|
|
533
|
+
defensiveZoneLeagueAvg: number;
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
/** Response of `adv.skaters.comparison` */
|
|
537
|
+
interface EdgeSkaterComparison {
|
|
538
|
+
player: EdgePlayer;
|
|
539
|
+
seasonsWithEdgeStats: EdgeSeason[];
|
|
540
|
+
shotSpeedDetails: {
|
|
541
|
+
topShotSpeed: {
|
|
542
|
+
imperial: number;
|
|
543
|
+
metric: number;
|
|
544
|
+
overlay: EdgeOverlay;
|
|
545
|
+
};
|
|
546
|
+
avgShotSpeed: EdgeMeasurement;
|
|
547
|
+
shotAttemptsOver100: number;
|
|
548
|
+
shotAttempts90To100: number;
|
|
549
|
+
shotAttempts80To90: number;
|
|
550
|
+
shotAttempts70To80: number;
|
|
551
|
+
};
|
|
552
|
+
skatingSpeedDetails: {
|
|
553
|
+
maxSkatingSpeed: {
|
|
554
|
+
imperial: number;
|
|
555
|
+
metric: number;
|
|
556
|
+
overlay: EdgeOverlay;
|
|
557
|
+
};
|
|
558
|
+
burstsOver22: number;
|
|
559
|
+
bursts20To22: number;
|
|
560
|
+
bursts18To20: number;
|
|
561
|
+
};
|
|
562
|
+
skatingDistanceLast10: {
|
|
563
|
+
gameCenterLink: string;
|
|
564
|
+
gameDate: string;
|
|
565
|
+
playerOnHomeTeam: boolean;
|
|
566
|
+
distanceSkated: EdgeMeasurement;
|
|
567
|
+
toi: number;
|
|
568
|
+
homeTeam: EdgeTeam;
|
|
569
|
+
awayTeam: EdgeTeam;
|
|
570
|
+
}[];
|
|
571
|
+
skatingDistanceDetails: {
|
|
572
|
+
distanceTotal: EdgeMeasurement;
|
|
573
|
+
distancePer60: EdgeMeasurement;
|
|
574
|
+
distanceMaxGame: {
|
|
575
|
+
imperial: number;
|
|
576
|
+
metric: number;
|
|
577
|
+
overlay: EdgeOverlay;
|
|
578
|
+
};
|
|
579
|
+
distanceMaxPeriod: {
|
|
580
|
+
imperial: number;
|
|
581
|
+
metric: number;
|
|
582
|
+
overlay: EdgeOverlay;
|
|
583
|
+
};
|
|
584
|
+
};
|
|
585
|
+
shotLocationDetails: {
|
|
586
|
+
area: string;
|
|
587
|
+
sog: number;
|
|
588
|
+
goals: number;
|
|
589
|
+
shootingPctg: number;
|
|
590
|
+
}[];
|
|
591
|
+
shotLocationTotals: {
|
|
592
|
+
locationCode: string;
|
|
593
|
+
sog: number;
|
|
594
|
+
goals: number;
|
|
595
|
+
shootingPctg: number;
|
|
596
|
+
}[];
|
|
597
|
+
zoneTimeDetails: {
|
|
598
|
+
offensiveZonePctg: number;
|
|
599
|
+
offensiveZoneLeagueAvg: number;
|
|
600
|
+
neutralZonePctg: number;
|
|
601
|
+
neutralZoneLeagueAvg: number;
|
|
602
|
+
defensiveZonePctg: number;
|
|
603
|
+
defensiveZoneLeagueAvg: number;
|
|
604
|
+
};
|
|
605
|
+
zoneStarts: {
|
|
606
|
+
offensiveZoneStarts: number;
|
|
607
|
+
neutralZoneStarts: number;
|
|
608
|
+
defensiveZoneStarts: number;
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
/** Response of `adv.skaters.leaders` */
|
|
612
|
+
interface EdgeSkaterLanding {
|
|
613
|
+
seasonsWithEdgeStats: EdgeSeason[];
|
|
614
|
+
leaders: {
|
|
615
|
+
hardestShot: {
|
|
616
|
+
player: EdgePlayer;
|
|
617
|
+
overlay: EdgeOverlay;
|
|
618
|
+
shotSpeed: EdgeMeasurement;
|
|
619
|
+
};
|
|
620
|
+
maxSkatingSpeed: {
|
|
621
|
+
player: EdgePlayer;
|
|
622
|
+
overlay: EdgeOverlay;
|
|
623
|
+
skatingSpeed: EdgeMeasurement;
|
|
624
|
+
};
|
|
625
|
+
totalDistanceSkated: {
|
|
626
|
+
player: EdgePlayer;
|
|
627
|
+
distanceSkated: EdgeMeasurement;
|
|
628
|
+
};
|
|
629
|
+
distanceMaxGame: {
|
|
630
|
+
player: EdgePlayer;
|
|
631
|
+
distanceSkated: EdgeMeasurement;
|
|
632
|
+
overlay: EdgeOverlay;
|
|
633
|
+
};
|
|
634
|
+
highDangerSOG: {
|
|
635
|
+
player: EdgePlayer;
|
|
636
|
+
sog: number;
|
|
637
|
+
shotLocationDetails: {
|
|
638
|
+
area: string;
|
|
639
|
+
sog: number;
|
|
640
|
+
sogPercentile: number;
|
|
641
|
+
}[];
|
|
642
|
+
};
|
|
643
|
+
offensiveZoneTime: {
|
|
644
|
+
player: EdgePlayer;
|
|
645
|
+
zoneTime: number;
|
|
646
|
+
};
|
|
647
|
+
defensiveZoneTime: {
|
|
648
|
+
player: EdgePlayer;
|
|
649
|
+
zoneTime: number;
|
|
650
|
+
};
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
/** Response of `adv.skaters.shotLocation` */
|
|
654
|
+
interface EdgeSkaterShotLocation {
|
|
655
|
+
shotLocationDetails: {
|
|
656
|
+
area: string;
|
|
657
|
+
sog: number;
|
|
658
|
+
goals: number;
|
|
659
|
+
shootingPctg: number | null;
|
|
660
|
+
sogPercentile: number;
|
|
661
|
+
goalsPercentile: number;
|
|
662
|
+
shootingPctgPercentile: number | null;
|
|
663
|
+
}[];
|
|
664
|
+
shotLocationTotals: {
|
|
665
|
+
locationCode: string;
|
|
666
|
+
sog: number;
|
|
667
|
+
goals: number;
|
|
668
|
+
shootingPctg: number;
|
|
669
|
+
sogPercentile: number;
|
|
670
|
+
goalsPercentile: number;
|
|
671
|
+
shootingPctgPercentile: number;
|
|
672
|
+
sogLeagueAvg: number;
|
|
673
|
+
goalsLeagueAvg: number;
|
|
674
|
+
shootingPctgLeagueAvg: number;
|
|
675
|
+
}[];
|
|
676
|
+
}
|
|
677
|
+
/** Response of `adv.skaters.shotSpeed` */
|
|
678
|
+
interface EdgeSkaterShotSpeed {
|
|
679
|
+
hardestShots: {
|
|
680
|
+
gameCenterLink: string;
|
|
681
|
+
gameDate: string;
|
|
682
|
+
gameType: number;
|
|
683
|
+
playerOnHomeTeam: boolean;
|
|
684
|
+
shotSpeed: EdgeMeasurement;
|
|
685
|
+
timeInPeriod: string;
|
|
686
|
+
periodDescriptor: EdgePeriodDescriptor;
|
|
687
|
+
homeTeam: EdgeTeam;
|
|
688
|
+
awayTeam: EdgeTeam;
|
|
689
|
+
}[];
|
|
690
|
+
shotSpeedDetails: {
|
|
691
|
+
topShotSpeed: {
|
|
692
|
+
imperial: number;
|
|
693
|
+
metric: number;
|
|
694
|
+
percentile: number;
|
|
695
|
+
leagueAvg: EdgeMeasurement;
|
|
696
|
+
overlay: EdgeOverlay;
|
|
697
|
+
};
|
|
698
|
+
avgShotSpeed: {
|
|
699
|
+
imperial: number;
|
|
700
|
+
metric: number;
|
|
701
|
+
percentile: number;
|
|
702
|
+
leagueAvg: EdgeMeasurement;
|
|
703
|
+
};
|
|
704
|
+
shotAttemptsOver100: {
|
|
705
|
+
value: number;
|
|
706
|
+
percentile: number;
|
|
707
|
+
leagueAvg: number;
|
|
708
|
+
};
|
|
709
|
+
shotAttempts90To100: {
|
|
710
|
+
value: number;
|
|
711
|
+
percentile: number;
|
|
712
|
+
leagueAvg: number;
|
|
713
|
+
};
|
|
714
|
+
shotAttempts80To90: {
|
|
715
|
+
value: number;
|
|
716
|
+
percentile: number;
|
|
717
|
+
leagueAvg: number;
|
|
718
|
+
};
|
|
719
|
+
shotAttempts70To80: {
|
|
720
|
+
value: number;
|
|
721
|
+
percentile: number;
|
|
722
|
+
leagueAvg: number;
|
|
723
|
+
};
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
/** Response of `adv.skaters.skatingDistance` */
|
|
727
|
+
interface EdgeSkaterSkatingDistance {
|
|
728
|
+
skatingDistanceLast10: {
|
|
729
|
+
gameCenterLink: string;
|
|
730
|
+
gameDate: string;
|
|
731
|
+
playerOnHomeTeam: boolean;
|
|
732
|
+
distanceSkatedAll: EdgeMeasurement;
|
|
733
|
+
toiAll: number;
|
|
734
|
+
distanceSkatedEven: EdgeMeasurement;
|
|
735
|
+
toiEven: number;
|
|
736
|
+
distanceSkatedPP: EdgeMeasurement;
|
|
737
|
+
toiPP: number;
|
|
738
|
+
homeTeam: EdgeTeam;
|
|
739
|
+
awayTeam: EdgeTeam;
|
|
740
|
+
distanceSkatedPK?: EdgeMeasurement;
|
|
741
|
+
toiPK?: number;
|
|
742
|
+
}[];
|
|
743
|
+
skatingDistanceDetails: {
|
|
744
|
+
strengthCode: string;
|
|
745
|
+
distanceTotal: {
|
|
746
|
+
imperial: number;
|
|
747
|
+
metric: number;
|
|
748
|
+
percentile: number;
|
|
749
|
+
leagueAvg: EdgeMeasurement;
|
|
750
|
+
};
|
|
751
|
+
distancePer60: {
|
|
752
|
+
imperial: number;
|
|
753
|
+
metric: number;
|
|
754
|
+
percentile: number;
|
|
755
|
+
leagueAvg: EdgeMeasurement;
|
|
756
|
+
};
|
|
757
|
+
distanceMaxGame: {
|
|
758
|
+
imperial: number;
|
|
759
|
+
metric: number;
|
|
760
|
+
percentile: number;
|
|
761
|
+
leagueAvg: EdgeMeasurement;
|
|
762
|
+
overlay: EdgeOverlay;
|
|
763
|
+
};
|
|
764
|
+
distanceMaxPeriod: {
|
|
765
|
+
imperial: number;
|
|
766
|
+
metric: number;
|
|
767
|
+
percentile: number;
|
|
768
|
+
leagueAvg: EdgeMeasurement;
|
|
769
|
+
overlay: EdgeOverlay;
|
|
770
|
+
};
|
|
771
|
+
}[];
|
|
772
|
+
}
|
|
773
|
+
/** Response of `adv.skaters.skatingSpeed` */
|
|
774
|
+
interface EdgeSkaterSkatingSpeed {
|
|
775
|
+
topSkatingSpeeds: {
|
|
776
|
+
gameCenterLink: string;
|
|
777
|
+
gameDate: string;
|
|
778
|
+
gameType: number;
|
|
779
|
+
playerOnHomeTeam: boolean;
|
|
780
|
+
skatingSpeed: EdgeMeasurement;
|
|
781
|
+
timeInPeriod: string;
|
|
782
|
+
periodDescriptor: EdgePeriodDescriptor;
|
|
783
|
+
homeTeam: EdgeTeam;
|
|
784
|
+
awayTeam: EdgeTeam;
|
|
785
|
+
}[];
|
|
786
|
+
skatingSpeedDetails: {
|
|
787
|
+
maxSkatingSpeed: {
|
|
788
|
+
imperial: number;
|
|
789
|
+
metric: number;
|
|
790
|
+
percentile: number;
|
|
791
|
+
leagueAvg: EdgeMeasurement;
|
|
792
|
+
overlay: EdgeOverlay;
|
|
793
|
+
};
|
|
794
|
+
burstsOver22: {
|
|
795
|
+
value: number;
|
|
796
|
+
percentile: number;
|
|
797
|
+
leagueAvg: number;
|
|
798
|
+
};
|
|
799
|
+
bursts20To22: {
|
|
800
|
+
value: number;
|
|
801
|
+
percentile: number;
|
|
802
|
+
leagueAvg: number;
|
|
803
|
+
};
|
|
804
|
+
bursts18To20: {
|
|
805
|
+
value: number;
|
|
806
|
+
percentile: number;
|
|
807
|
+
leagueAvg: number;
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
/** Response of `adv.skaters.zoneTime` */
|
|
812
|
+
interface EdgeSkaterZoneTime {
|
|
813
|
+
zoneTimeDetails: {
|
|
814
|
+
strengthCode: string;
|
|
815
|
+
offensiveZonePctg: number;
|
|
816
|
+
offensiveZonePercentile: number;
|
|
817
|
+
offensiveZoneLeagueAvg: number;
|
|
818
|
+
neutralZonePctg: number;
|
|
819
|
+
neutralZonePercentile: number;
|
|
820
|
+
neutralZoneLeagueAvg: number;
|
|
821
|
+
defensiveZonePctg: number;
|
|
822
|
+
defensiveZonePercentile: number;
|
|
823
|
+
defensiveZoneLeagueAvg: number;
|
|
824
|
+
}[];
|
|
825
|
+
zoneStarts: {
|
|
826
|
+
offensiveZoneStartsPctg: number;
|
|
827
|
+
offensiveZoneStartsPctgPercentile: number;
|
|
828
|
+
neutralZoneStartsPctg: number;
|
|
829
|
+
neutralZoneStartsPctgPercentile: number;
|
|
830
|
+
defensiveZoneStartsPctg: number;
|
|
831
|
+
defensiveZoneStartsPctgPercentile: number;
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
/** One row of `adv.skaters.top10.distance` */
|
|
835
|
+
interface EdgeSkaterDistanceTop10Entry {
|
|
836
|
+
player: EdgePlayer;
|
|
837
|
+
distanceTotal: EdgeMeasurement;
|
|
838
|
+
distancePer60: EdgeMeasurement;
|
|
839
|
+
distanceMaxPerGame: {
|
|
840
|
+
imperial: number;
|
|
841
|
+
metric: number;
|
|
842
|
+
overlay: EdgeOverlay;
|
|
843
|
+
};
|
|
844
|
+
distanceMaxPerPeriod: {
|
|
845
|
+
imperial: number;
|
|
846
|
+
metric: number;
|
|
847
|
+
overlay: EdgeOverlay;
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
/** Response of `adv.skaters.top10.distance` */
|
|
851
|
+
type EdgeSkaterDistanceTop10 = EdgeSkaterDistanceTop10Entry[];
|
|
852
|
+
/** One row of `adv.skaters.top10.shotLocation` */
|
|
853
|
+
interface EdgeSkaterShotLocationTop10Entry {
|
|
854
|
+
player: EdgePlayer;
|
|
855
|
+
all: number;
|
|
856
|
+
highDanger: number;
|
|
857
|
+
midRange: number;
|
|
858
|
+
longRange: number;
|
|
859
|
+
}
|
|
860
|
+
/** Response of `adv.skaters.top10.shotLocation` */
|
|
861
|
+
type EdgeSkaterShotLocationTop10 = EdgeSkaterShotLocationTop10Entry[];
|
|
862
|
+
/** One row of `adv.skaters.top10.shotSpeed` */
|
|
863
|
+
interface EdgeSkaterShotSpeedTop10Entry {
|
|
864
|
+
player: EdgePlayer;
|
|
865
|
+
hardestShot: {
|
|
866
|
+
imperial: number;
|
|
867
|
+
metric: number;
|
|
868
|
+
overlay: EdgeOverlay;
|
|
869
|
+
};
|
|
870
|
+
shotAttemptsOver100: number;
|
|
871
|
+
shotAttempts90To100: number;
|
|
872
|
+
shotAttempts80To90: number;
|
|
873
|
+
shotAttempts70To80: number;
|
|
874
|
+
}
|
|
875
|
+
/** Response of `adv.skaters.top10.shotSpeed` */
|
|
876
|
+
type EdgeSkaterShotSpeedTop10 = EdgeSkaterShotSpeedTop10Entry[];
|
|
877
|
+
/** One row of `adv.skaters.top10.speed` */
|
|
878
|
+
interface EdgeSkaterSpeedTop10Entry {
|
|
879
|
+
player: EdgePlayer;
|
|
880
|
+
maxSpeed: {
|
|
881
|
+
imperial: number;
|
|
882
|
+
metric: number;
|
|
883
|
+
overlay: EdgeOverlay;
|
|
884
|
+
};
|
|
885
|
+
burstsOver22: number;
|
|
886
|
+
bursts20To22: number;
|
|
887
|
+
bursts18To20: number;
|
|
888
|
+
}
|
|
889
|
+
/** Response of `adv.skaters.top10.speed` */
|
|
890
|
+
type EdgeSkaterSpeedTop10 = EdgeSkaterSpeedTop10Entry[];
|
|
891
|
+
/** One row of `adv.skaters.top10.zoneTime` */
|
|
892
|
+
interface EdgeSkaterZoneTimeTop10Entry {
|
|
893
|
+
player: EdgePlayer;
|
|
894
|
+
offensiveZoneTime: number;
|
|
895
|
+
neutralZoneTime: number;
|
|
896
|
+
defensiveZoneTime: number;
|
|
897
|
+
}
|
|
898
|
+
/** Response of `adv.skaters.top10.zoneTime` */
|
|
899
|
+
type EdgeSkaterZoneTimeTop10 = EdgeSkaterZoneTimeTop10Entry[];
|
|
900
|
+
/** Response of `adv.goalies.player` */
|
|
901
|
+
interface EdgeGoalieDetail {
|
|
902
|
+
player: EdgePlayer;
|
|
903
|
+
seasonsWithEdgeStats: EdgeSeason[];
|
|
904
|
+
stats: {
|
|
905
|
+
goalsAgainstAvg: {
|
|
906
|
+
value: number;
|
|
907
|
+
percentile: number;
|
|
908
|
+
leagueAvg: number;
|
|
909
|
+
};
|
|
910
|
+
gamesAbove900: {
|
|
911
|
+
value: number;
|
|
912
|
+
percentile: number;
|
|
913
|
+
leagueAvg: number;
|
|
914
|
+
};
|
|
915
|
+
goalDifferentialPer60: {
|
|
916
|
+
value: number;
|
|
917
|
+
percentile: number;
|
|
918
|
+
leagueAvg: number;
|
|
919
|
+
};
|
|
920
|
+
goalSupportAvg: {
|
|
921
|
+
value: number;
|
|
922
|
+
percentile: number;
|
|
923
|
+
leagueAvg: number;
|
|
924
|
+
};
|
|
925
|
+
pointPctg: {
|
|
926
|
+
value: number;
|
|
927
|
+
percentile: number;
|
|
928
|
+
leagueAvg: number;
|
|
929
|
+
};
|
|
930
|
+
};
|
|
931
|
+
shotLocationSummary: {
|
|
932
|
+
locationCode: string;
|
|
933
|
+
goalsAgainst: number;
|
|
934
|
+
goalsAgainstPercentile: number;
|
|
935
|
+
goalsAgainstLeagueAvg: number;
|
|
936
|
+
saves: number;
|
|
937
|
+
savesPercentile: number;
|
|
938
|
+
savesLeagueAvg: number;
|
|
939
|
+
savePctg: number;
|
|
940
|
+
savePctgPercentile: number;
|
|
941
|
+
savePctgLeagueAvg: number;
|
|
942
|
+
}[];
|
|
943
|
+
shotLocationDetails: {
|
|
944
|
+
area: string;
|
|
945
|
+
saves: number;
|
|
946
|
+
savesPercentile: number;
|
|
947
|
+
savePctg: number;
|
|
948
|
+
savePctgPercentile: number;
|
|
949
|
+
}[];
|
|
950
|
+
}
|
|
951
|
+
/** Response of `adv.goalies.compare` */
|
|
952
|
+
interface EdgeGoalieComparison {
|
|
953
|
+
player: EdgePlayer;
|
|
954
|
+
seasonsWithEdgeStats: EdgeSeason[];
|
|
955
|
+
shotLocationSummary: {
|
|
956
|
+
locationCode: string;
|
|
957
|
+
shotsAgainst: number;
|
|
958
|
+
goalsAgainst: number;
|
|
959
|
+
saves: number;
|
|
960
|
+
savePctg: number;
|
|
961
|
+
}[];
|
|
962
|
+
shotLocationDetails: {
|
|
963
|
+
area: string;
|
|
964
|
+
goalsAgainst: number;
|
|
965
|
+
shotsAgainst: number;
|
|
966
|
+
saves: number;
|
|
967
|
+
savePctg: number;
|
|
968
|
+
}[];
|
|
969
|
+
savePctg5v5Last10: unknown[];
|
|
970
|
+
savePctg5v5Details: {
|
|
971
|
+
savePctg: number;
|
|
972
|
+
savePctgClose: number;
|
|
973
|
+
shots: number;
|
|
974
|
+
shotsPer60: number;
|
|
975
|
+
};
|
|
976
|
+
savePctgLast10: unknown[];
|
|
977
|
+
savePctgDetails: {
|
|
978
|
+
gamesAbove900: number;
|
|
979
|
+
pctgGamesAbove900: number;
|
|
980
|
+
pointPctg: number;
|
|
981
|
+
goalsAgainstAvg: number;
|
|
982
|
+
savePctg: number;
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
/** Response of `adv.goalies.leaders` */
|
|
986
|
+
interface EdgeGoalieLanding {
|
|
987
|
+
seasonsWithEdgeStats: EdgeSeason[];
|
|
988
|
+
minimumGamesPlayed?: number;
|
|
989
|
+
leaders: {
|
|
990
|
+
highDangerSavePctg: {
|
|
991
|
+
player: EdgePlayer;
|
|
992
|
+
savePctg: number;
|
|
993
|
+
shotLocationDetails: {
|
|
994
|
+
area: string;
|
|
995
|
+
savePctg: number;
|
|
996
|
+
savePctgPercentile: number;
|
|
997
|
+
}[];
|
|
998
|
+
};
|
|
999
|
+
highDangerSaves: {
|
|
1000
|
+
player: EdgePlayer;
|
|
1001
|
+
saves: number;
|
|
1002
|
+
shotLocationDetails: {
|
|
1003
|
+
area: string;
|
|
1004
|
+
saves: number;
|
|
1005
|
+
savesPercentile: number;
|
|
1006
|
+
}[];
|
|
1007
|
+
};
|
|
1008
|
+
highDangerGoalsAgainst: {
|
|
1009
|
+
player: EdgePlayer;
|
|
1010
|
+
goalsAgainst: number;
|
|
1011
|
+
};
|
|
1012
|
+
savePctg5v5: {
|
|
1013
|
+
player: EdgePlayer;
|
|
1014
|
+
savePctg: number;
|
|
1015
|
+
};
|
|
1016
|
+
gamesAbove900: {
|
|
1017
|
+
player: EdgePlayer;
|
|
1018
|
+
games: number;
|
|
1019
|
+
};
|
|
1020
|
+
};
|
|
1021
|
+
minimumMinutesPlayed?: number;
|
|
1022
|
+
}
|
|
1023
|
+
/** Response of `adv.goalies.savePercentage` */
|
|
1024
|
+
interface EdgeGoalieSavePercentage {
|
|
1025
|
+
savePctgLast10: {
|
|
1026
|
+
gameCenterLink: string;
|
|
1027
|
+
savePctg: number;
|
|
1028
|
+
gameDate: string;
|
|
1029
|
+
decision: string;
|
|
1030
|
+
playerOnHomeTeam: boolean;
|
|
1031
|
+
homeTeam: EdgeTeam;
|
|
1032
|
+
awayTeam: EdgeTeam;
|
|
1033
|
+
}[];
|
|
1034
|
+
savePctgDetails: {
|
|
1035
|
+
gamesAbove900: {
|
|
1036
|
+
value: number;
|
|
1037
|
+
percentile: number;
|
|
1038
|
+
leagueAvg: number;
|
|
1039
|
+
};
|
|
1040
|
+
pctgGamesAbove900: {
|
|
1041
|
+
value: number;
|
|
1042
|
+
percentile: number;
|
|
1043
|
+
leagueAvg: number;
|
|
1044
|
+
};
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
/** Response of `adv.goalies.savePercentage5v5` */
|
|
1048
|
+
interface EdgeGoalieSavePercentage5v5 {
|
|
1049
|
+
savePctg5v5Last10: unknown[];
|
|
1050
|
+
savePctg5v5Details: {
|
|
1051
|
+
savePctg: {
|
|
1052
|
+
value: number;
|
|
1053
|
+
leagueAvg: number;
|
|
1054
|
+
percentile: number;
|
|
1055
|
+
};
|
|
1056
|
+
savePctgClose: {
|
|
1057
|
+
value: number;
|
|
1058
|
+
leagueAvg: number;
|
|
1059
|
+
percentile: number;
|
|
1060
|
+
};
|
|
1061
|
+
shots: {
|
|
1062
|
+
value: number;
|
|
1063
|
+
leagueAvg: number;
|
|
1064
|
+
percentile: number;
|
|
1065
|
+
};
|
|
1066
|
+
shotsPer60: {
|
|
1067
|
+
value: number;
|
|
1068
|
+
leagueAvg: number;
|
|
1069
|
+
percentile: number;
|
|
1070
|
+
};
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
/** Response of `adv.goalies.saveLocation` */
|
|
1074
|
+
interface EdgeGoalieShotLocation {
|
|
1075
|
+
shotLocationDetails: {
|
|
1076
|
+
area: string;
|
|
1077
|
+
shotsAgainst: number;
|
|
1078
|
+
saves: number;
|
|
1079
|
+
goalsAgainst: number;
|
|
1080
|
+
savePctg: number;
|
|
1081
|
+
shotsAgainstPercentile: number;
|
|
1082
|
+
savesPercentile: number;
|
|
1083
|
+
goalsAgainstPercentile: number;
|
|
1084
|
+
savePctgPercentile: number;
|
|
1085
|
+
}[];
|
|
1086
|
+
shotLocationTotals: {
|
|
1087
|
+
locationCode: string;
|
|
1088
|
+
shotsAgainst: number;
|
|
1089
|
+
goalsAgainst: number;
|
|
1090
|
+
saves: number;
|
|
1091
|
+
savePctg: number;
|
|
1092
|
+
shotsAgainstPercentile: number;
|
|
1093
|
+
goalsAgainstPercentile: number;
|
|
1094
|
+
savesPercentile: number;
|
|
1095
|
+
savePctgPercentile: number;
|
|
1096
|
+
shotsAgainstLeagueAvg: number;
|
|
1097
|
+
goalsAgainstLeagueAvg: number;
|
|
1098
|
+
savesLeagueAvg: number;
|
|
1099
|
+
savePctgLeagueAvg: number;
|
|
1100
|
+
}[];
|
|
1101
|
+
}
|
|
1102
|
+
/** One row of `adv.goalies.top10.savePercentage` */
|
|
1103
|
+
interface EdgeGoalieSavePercentageTop10Entry {
|
|
1104
|
+
player: EdgePlayer;
|
|
1105
|
+
gamesOver900: number;
|
|
1106
|
+
pctgGamesOver900: number;
|
|
1107
|
+
}
|
|
1108
|
+
/** Response of `adv.goalies.top10.savePercentage` */
|
|
1109
|
+
type EdgeGoalieSavePercentageTop10 = EdgeGoalieSavePercentageTop10Entry[];
|
|
1110
|
+
/** One row of `adv.goalies.top10.savePercentage5v5` */
|
|
1111
|
+
interface EdgeGoalieSavePercentage5v5Top10Entry {
|
|
1112
|
+
player: EdgePlayer;
|
|
1113
|
+
savePctg: number;
|
|
1114
|
+
savePctgClose: number;
|
|
1115
|
+
shots: number;
|
|
1116
|
+
shotsPer60: number;
|
|
1117
|
+
}
|
|
1118
|
+
/** Response of `adv.goalies.top10.savePercentage5v5` */
|
|
1119
|
+
type EdgeGoalieSavePercentage5v5Top10 = EdgeGoalieSavePercentage5v5Top10Entry[];
|
|
1120
|
+
/** One row of `adv.goalies.top10.saveLocation` */
|
|
1121
|
+
interface EdgeGoalieShotLocationTop10Entry {
|
|
1122
|
+
player: EdgePlayer;
|
|
1123
|
+
all: number;
|
|
1124
|
+
highDanger: number;
|
|
1125
|
+
midRange: number;
|
|
1126
|
+
longRange: number;
|
|
1127
|
+
}
|
|
1128
|
+
/** Response of `adv.goalies.top10.saveLocation` */
|
|
1129
|
+
type EdgeGoalieShotLocationTop10 = EdgeGoalieShotLocationTop10Entry[];
|
|
1130
|
+
/** Response of `adv.teams.stats` */
|
|
1131
|
+
interface EdgeTeamDetail {
|
|
1132
|
+
team: EdgeTeam;
|
|
1133
|
+
seasonsWithEdgeStats: EdgeSeason[];
|
|
1134
|
+
shotSpeed: {
|
|
1135
|
+
shotAttemptsOver90: {
|
|
1136
|
+
value: number;
|
|
1137
|
+
rank: number;
|
|
1138
|
+
};
|
|
1139
|
+
topShotSpeed: {
|
|
1140
|
+
imperial: number;
|
|
1141
|
+
metric: number;
|
|
1142
|
+
rank: number;
|
|
1143
|
+
leagueAvg: EdgeMeasurement;
|
|
1144
|
+
overlay: EdgeOverlay;
|
|
1145
|
+
};
|
|
1146
|
+
};
|
|
1147
|
+
skatingSpeed: {
|
|
1148
|
+
burstsOver22: {
|
|
1149
|
+
value: number;
|
|
1150
|
+
rank: number;
|
|
1151
|
+
};
|
|
1152
|
+
burstsOver20: {
|
|
1153
|
+
value: number;
|
|
1154
|
+
rank: number;
|
|
1155
|
+
leagueAvg: {
|
|
1156
|
+
value: number;
|
|
1157
|
+
};
|
|
1158
|
+
};
|
|
1159
|
+
speedMax: {
|
|
1160
|
+
imperial: number;
|
|
1161
|
+
metric: number;
|
|
1162
|
+
rank: number;
|
|
1163
|
+
leagueAvg: EdgeMeasurement;
|
|
1164
|
+
overlay: EdgeOverlay;
|
|
1165
|
+
};
|
|
1166
|
+
};
|
|
1167
|
+
distanceSkated: {
|
|
1168
|
+
total: {
|
|
1169
|
+
imperial: number;
|
|
1170
|
+
metric: number;
|
|
1171
|
+
rank: number;
|
|
1172
|
+
leagueAvg: EdgeMeasurement;
|
|
1173
|
+
};
|
|
1174
|
+
};
|
|
1175
|
+
sogSummary: {
|
|
1176
|
+
locationCode: string;
|
|
1177
|
+
shots: number;
|
|
1178
|
+
shotsRank: number;
|
|
1179
|
+
shotsLeagueAvg: number;
|
|
1180
|
+
shootingPctg: number;
|
|
1181
|
+
shootingPctgRank: number;
|
|
1182
|
+
shootingPctgLeagueAvg: number;
|
|
1183
|
+
goals: number;
|
|
1184
|
+
goalsRank: number;
|
|
1185
|
+
goalsLeagueAvg: number;
|
|
1186
|
+
}[];
|
|
1187
|
+
sogDetails: {
|
|
1188
|
+
area: string;
|
|
1189
|
+
shots: number;
|
|
1190
|
+
shotsRank: number;
|
|
1191
|
+
}[];
|
|
1192
|
+
zoneTimeDetails: {
|
|
1193
|
+
offensiveZonePctg: number;
|
|
1194
|
+
offensiveZoneRank: number;
|
|
1195
|
+
offensiveZoneLeagueAvg: number;
|
|
1196
|
+
offensiveZoneEvPctg: number;
|
|
1197
|
+
offensiveZoneEvRank: number;
|
|
1198
|
+
offensiveZoneEvLeagueAvg: number;
|
|
1199
|
+
neutralZonePctg: number;
|
|
1200
|
+
neutralZoneRank: number;
|
|
1201
|
+
neutralZoneLeagueAvg: number;
|
|
1202
|
+
defensiveZonePctg: number;
|
|
1203
|
+
defensiveZoneRank: number;
|
|
1204
|
+
defensiveZoneLeagueAvg: number;
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
/** Response of `adv.teams.compare` */
|
|
1208
|
+
interface EdgeTeamComparison {
|
|
1209
|
+
team: EdgeTeam;
|
|
1210
|
+
seasonsWithEdgeStats: EdgeSeason[];
|
|
1211
|
+
shotSpeedDetails: {
|
|
1212
|
+
topShotSpeed: {
|
|
1213
|
+
imperial: number;
|
|
1214
|
+
metric: number;
|
|
1215
|
+
overlay: EdgeOverlay;
|
|
1216
|
+
};
|
|
1217
|
+
avgShotSpeed: EdgeMeasurement;
|
|
1218
|
+
shotAttemptsOver100: number;
|
|
1219
|
+
shotAttempts90To100: number;
|
|
1220
|
+
shotAttempts80To90: number;
|
|
1221
|
+
shotAttempts70To80: number;
|
|
1222
|
+
};
|
|
1223
|
+
skatingSpeedDetails: {
|
|
1224
|
+
maxSkatingSpeed: {
|
|
1225
|
+
imperial: number;
|
|
1226
|
+
metric: number;
|
|
1227
|
+
overlay: EdgeOverlay;
|
|
1228
|
+
};
|
|
1229
|
+
burstsOver22: number;
|
|
1230
|
+
bursts20To22: number;
|
|
1231
|
+
bursts18To20: number;
|
|
1232
|
+
};
|
|
1233
|
+
skatingDistanceLast10: {
|
|
1234
|
+
gameCenterLink: string;
|
|
1235
|
+
gameDate: string;
|
|
1236
|
+
isHomeTeam: boolean;
|
|
1237
|
+
distanceSkated: EdgeMeasurement;
|
|
1238
|
+
homeTeam: EdgeTeam;
|
|
1239
|
+
awayTeam: EdgeTeam;
|
|
1240
|
+
}[];
|
|
1241
|
+
skatingDistanceDetails: {
|
|
1242
|
+
distanceTotal: EdgeMeasurement;
|
|
1243
|
+
distancePer60: EdgeMeasurement;
|
|
1244
|
+
distanceMaxGame: {
|
|
1245
|
+
imperial: number;
|
|
1246
|
+
metric: number;
|
|
1247
|
+
overlay: EdgeOverlay;
|
|
1248
|
+
};
|
|
1249
|
+
distanceMaxPeriod: {
|
|
1250
|
+
imperial: number;
|
|
1251
|
+
metric: number;
|
|
1252
|
+
overlay: EdgeOverlay;
|
|
1253
|
+
};
|
|
1254
|
+
};
|
|
1255
|
+
shotLocationDetails: {
|
|
1256
|
+
area: string;
|
|
1257
|
+
sog: number;
|
|
1258
|
+
goals: number;
|
|
1259
|
+
shootingPctg: number;
|
|
1260
|
+
}[];
|
|
1261
|
+
shotLocationTotals: {
|
|
1262
|
+
locationCode: string;
|
|
1263
|
+
sog: number;
|
|
1264
|
+
goals: number;
|
|
1265
|
+
shootingPctg: number;
|
|
1266
|
+
}[];
|
|
1267
|
+
zoneTimeDetails: {
|
|
1268
|
+
offensiveZonePctg: number;
|
|
1269
|
+
offensiveZoneLeagueAvg: number;
|
|
1270
|
+
neutralZonePctg: number;
|
|
1271
|
+
neutralZoneLeagueAvg: number;
|
|
1272
|
+
defensiveZonePctg: number;
|
|
1273
|
+
defensiveZoneLeagueAvg: number;
|
|
1274
|
+
};
|
|
1275
|
+
shotDifferential: {
|
|
1276
|
+
shotAttemptDifferential: number;
|
|
1277
|
+
sogDifferential: number;
|
|
1278
|
+
};
|
|
1279
|
+
}
|
|
1280
|
+
/** Response of `adv.teams.leaders` */
|
|
1281
|
+
interface EdgeTeamLanding {
|
|
1282
|
+
seasonsWithEdgeStats: EdgeSeason[];
|
|
1283
|
+
leaders: {
|
|
1284
|
+
shotAttemptsOver90: {
|
|
1285
|
+
team: EdgeTeam;
|
|
1286
|
+
attempts: number;
|
|
1287
|
+
};
|
|
1288
|
+
burstsOver22: {
|
|
1289
|
+
team: EdgeTeam;
|
|
1290
|
+
bursts: number;
|
|
1291
|
+
};
|
|
1292
|
+
distancePer60: {
|
|
1293
|
+
team: EdgeTeam;
|
|
1294
|
+
distanceSkated: EdgeMeasurement;
|
|
1295
|
+
};
|
|
1296
|
+
highDangerSOG: {
|
|
1297
|
+
team: EdgeTeam;
|
|
1298
|
+
sog: number;
|
|
1299
|
+
shotLocationDetails: {
|
|
1300
|
+
area: string;
|
|
1301
|
+
sog: number;
|
|
1302
|
+
rank: number;
|
|
1303
|
+
}[];
|
|
1304
|
+
};
|
|
1305
|
+
offensiveZoneTime: {
|
|
1306
|
+
team: EdgeTeam;
|
|
1307
|
+
zoneTime: number;
|
|
1308
|
+
};
|
|
1309
|
+
neutralZoneTime: {
|
|
1310
|
+
team: EdgeTeam;
|
|
1311
|
+
zoneTime: number;
|
|
1312
|
+
};
|
|
1313
|
+
defensiveZoneTime: {
|
|
1314
|
+
team: EdgeTeam;
|
|
1315
|
+
zoneTime: number;
|
|
1316
|
+
};
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
/** Response of `adv.teams.shotLocation` */
|
|
1320
|
+
interface EdgeTeamShotLocation {
|
|
1321
|
+
shotLocationDetails: {
|
|
1322
|
+
area: string;
|
|
1323
|
+
sog: number;
|
|
1324
|
+
sogRank: number;
|
|
1325
|
+
goals: number;
|
|
1326
|
+
goalsRank: number;
|
|
1327
|
+
shootingPctg: number | null;
|
|
1328
|
+
shootingPctgRank: number | null;
|
|
1329
|
+
}[];
|
|
1330
|
+
shotLocationTotals: {
|
|
1331
|
+
locationCode: string;
|
|
1332
|
+
position: string;
|
|
1333
|
+
sog: number;
|
|
1334
|
+
sogRank: number;
|
|
1335
|
+
sogLeagueAvg: number;
|
|
1336
|
+
goals: number;
|
|
1337
|
+
goalsRank: number;
|
|
1338
|
+
goalsLeagueAvg: number;
|
|
1339
|
+
shootingPctg: number;
|
|
1340
|
+
shootingPctgRank: number;
|
|
1341
|
+
shootingPctgLeagueAvg: number;
|
|
1342
|
+
}[];
|
|
1343
|
+
}
|
|
1344
|
+
/** Response of `adv.teams.shotSpeed` */
|
|
1345
|
+
interface EdgeTeamShotSpeed {
|
|
1346
|
+
hardestShots: {
|
|
1347
|
+
player: EdgePlayer;
|
|
1348
|
+
gameCenterLink: string;
|
|
1349
|
+
gameDate: string;
|
|
1350
|
+
gameType: number;
|
|
1351
|
+
isHomeTeam: boolean;
|
|
1352
|
+
shotSpeed: EdgeMeasurement;
|
|
1353
|
+
timeInPeriod: string;
|
|
1354
|
+
periodDescriptor: EdgePeriodDescriptor;
|
|
1355
|
+
homeTeam: EdgeTeam;
|
|
1356
|
+
awayTeam: EdgeTeam;
|
|
1357
|
+
}[];
|
|
1358
|
+
shotSpeedDetails: {
|
|
1359
|
+
position: string;
|
|
1360
|
+
topShotSpeed: {
|
|
1361
|
+
imperial: number;
|
|
1362
|
+
metric: number;
|
|
1363
|
+
rank: number;
|
|
1364
|
+
leagueAvg: EdgeMeasurement;
|
|
1365
|
+
overlay: EdgeOverlay;
|
|
1366
|
+
};
|
|
1367
|
+
avgShotSpeed: {
|
|
1368
|
+
imperial: number;
|
|
1369
|
+
metric: number;
|
|
1370
|
+
rank: number;
|
|
1371
|
+
leagueAvg: EdgeMeasurement;
|
|
1372
|
+
};
|
|
1373
|
+
shotAttemptsOver100: {
|
|
1374
|
+
value: number;
|
|
1375
|
+
rank: number;
|
|
1376
|
+
leagueAvg: number;
|
|
1377
|
+
};
|
|
1378
|
+
shotAttempts90To100: {
|
|
1379
|
+
value: number;
|
|
1380
|
+
rank: number;
|
|
1381
|
+
leagueAvg: number;
|
|
1382
|
+
};
|
|
1383
|
+
shotAttempts80To90: {
|
|
1384
|
+
value: number;
|
|
1385
|
+
leagueAvg: number;
|
|
1386
|
+
};
|
|
1387
|
+
shotAttempts70To80: {
|
|
1388
|
+
value: number;
|
|
1389
|
+
leagueAvg: number;
|
|
1390
|
+
};
|
|
1391
|
+
}[];
|
|
1392
|
+
}
|
|
1393
|
+
/** Response of `adv.teams.skatingDistance` */
|
|
1394
|
+
interface EdgeTeamSkatingDistance {
|
|
1395
|
+
skatingDistanceLast10: {
|
|
1396
|
+
gameCenterLink: string;
|
|
1397
|
+
gameDate: string;
|
|
1398
|
+
isHomeTeam: boolean;
|
|
1399
|
+
toiAll: number;
|
|
1400
|
+
distanceSkatedAll: EdgeMeasurement;
|
|
1401
|
+
toiEven: number;
|
|
1402
|
+
distanceSkatedEven: EdgeMeasurement;
|
|
1403
|
+
toiPP?: number;
|
|
1404
|
+
distanceSkatedPP?: EdgeMeasurement;
|
|
1405
|
+
toiPK: number;
|
|
1406
|
+
distanceSkatedPK: EdgeMeasurement;
|
|
1407
|
+
homeTeam: EdgeTeam;
|
|
1408
|
+
awayTeam: EdgeTeam;
|
|
1409
|
+
}[];
|
|
1410
|
+
skatingDistanceDetails: {
|
|
1411
|
+
strengthCode: string;
|
|
1412
|
+
positionCode: string;
|
|
1413
|
+
distanceTotal: {
|
|
1414
|
+
imperial: number;
|
|
1415
|
+
metric: number;
|
|
1416
|
+
rank: number;
|
|
1417
|
+
leagueAvg: EdgeMeasurement;
|
|
1418
|
+
};
|
|
1419
|
+
distancePer60: {
|
|
1420
|
+
imperial: number;
|
|
1421
|
+
metric: number;
|
|
1422
|
+
rank: number;
|
|
1423
|
+
leagueAvg: EdgeMeasurement;
|
|
1424
|
+
};
|
|
1425
|
+
distanceMaxGame: {
|
|
1426
|
+
imperial: number;
|
|
1427
|
+
metric: number;
|
|
1428
|
+
rank: number;
|
|
1429
|
+
leagueAvg: EdgeMeasurement;
|
|
1430
|
+
overlay: EdgeOverlay;
|
|
1431
|
+
};
|
|
1432
|
+
distanceMaxPeriod: {
|
|
1433
|
+
imperial: number;
|
|
1434
|
+
metric: number;
|
|
1435
|
+
rank: number;
|
|
1436
|
+
leagueAvg: EdgeMeasurement;
|
|
1437
|
+
overlay: EdgeOverlay;
|
|
1438
|
+
};
|
|
1439
|
+
}[];
|
|
1440
|
+
}
|
|
1441
|
+
/** Response of `adv.teams.skatingSpeed` */
|
|
1442
|
+
interface EdgeTeamSkatingSpeed {
|
|
1443
|
+
topSkatingSpeeds: {
|
|
1444
|
+
player: EdgePlayer;
|
|
1445
|
+
gameCenterLink: string;
|
|
1446
|
+
gameDate: string;
|
|
1447
|
+
gameType: number;
|
|
1448
|
+
isHomeTeam: boolean;
|
|
1449
|
+
skatingSpeed: EdgeMeasurement;
|
|
1450
|
+
timeInPeriod: string;
|
|
1451
|
+
periodDescriptor: EdgePeriodDescriptor;
|
|
1452
|
+
homeTeam: EdgeTeam;
|
|
1453
|
+
awayTeam: EdgeTeam;
|
|
1454
|
+
}[];
|
|
1455
|
+
skatingSpeedDetails: {
|
|
1456
|
+
positionCode: string;
|
|
1457
|
+
maxSkatingSpeed: {
|
|
1458
|
+
imperial: number;
|
|
1459
|
+
metric: number;
|
|
1460
|
+
rank: number;
|
|
1461
|
+
leagueAvg: EdgeMeasurement;
|
|
1462
|
+
overlay: EdgeOverlay;
|
|
1463
|
+
};
|
|
1464
|
+
burstsOver22: {
|
|
1465
|
+
value: number;
|
|
1466
|
+
rank: number;
|
|
1467
|
+
leagueAvg: number;
|
|
1468
|
+
};
|
|
1469
|
+
bursts20To22: {
|
|
1470
|
+
value: number;
|
|
1471
|
+
rank: number;
|
|
1472
|
+
leagueAvg: number;
|
|
1473
|
+
};
|
|
1474
|
+
bursts18To20: {
|
|
1475
|
+
value: number;
|
|
1476
|
+
rank: number;
|
|
1477
|
+
leagueAvg: number;
|
|
1478
|
+
};
|
|
1479
|
+
}[];
|
|
1480
|
+
}
|
|
1481
|
+
/** Response of `adv.teams.zoneTime` */
|
|
1482
|
+
interface EdgeTeamZoneTime {
|
|
1483
|
+
zoneTimeDetails: {
|
|
1484
|
+
strengthCode: string;
|
|
1485
|
+
offensiveZonePctg: number;
|
|
1486
|
+
offensiveZoneRank: number;
|
|
1487
|
+
offensiveZoneLeagueAvg: number;
|
|
1488
|
+
neutralZonePctg: number;
|
|
1489
|
+
neutralZoneRank: number;
|
|
1490
|
+
neutralZoneLeagueAvg: number;
|
|
1491
|
+
defensiveZonePctg: number;
|
|
1492
|
+
defensiveZoneRank: number;
|
|
1493
|
+
defensiveZoneLeagueAvg: number;
|
|
1494
|
+
}[];
|
|
1495
|
+
shotDifferential: {
|
|
1496
|
+
shotAttemptDifferential: number;
|
|
1497
|
+
shotAttemptDifferentialRank: number;
|
|
1498
|
+
sogDifferential: number;
|
|
1499
|
+
sogDifferentialRank: number;
|
|
1500
|
+
};
|
|
1501
|
+
}
|
|
1502
|
+
/** One row of `adv.teams.top10.shotLocation` */
|
|
1503
|
+
interface EdgeTeamShotLocationTop10Entry {
|
|
1504
|
+
team: EdgeTeam;
|
|
1505
|
+
all: number;
|
|
1506
|
+
highDanger: number;
|
|
1507
|
+
midRange: number;
|
|
1508
|
+
longRange: number;
|
|
1509
|
+
}
|
|
1510
|
+
/** Response of `adv.teams.top10.shotLocation` */
|
|
1511
|
+
type EdgeTeamShotLocationTop10 = EdgeTeamShotLocationTop10Entry[];
|
|
1512
|
+
/** One row of `adv.teams.top10.shotSpeed` */
|
|
1513
|
+
interface EdgeTeamShotSpeedTop10Entry {
|
|
1514
|
+
team: EdgeTeam;
|
|
1515
|
+
hardestShot: {
|
|
1516
|
+
imperial: number;
|
|
1517
|
+
metric: number;
|
|
1518
|
+
overlay: EdgeOverlay;
|
|
1519
|
+
};
|
|
1520
|
+
shotAttemptsOver100: number;
|
|
1521
|
+
shotAttempts90To100: number;
|
|
1522
|
+
shotAttempts80To90: number;
|
|
1523
|
+
shotAttempts70To80: number;
|
|
1524
|
+
}
|
|
1525
|
+
/** Response of `adv.teams.top10.shotSpeed` */
|
|
1526
|
+
type EdgeTeamShotSpeedTop10 = EdgeTeamShotSpeedTop10Entry[];
|
|
1527
|
+
/** One row of `adv.teams.top10.skatingDistance` */
|
|
1528
|
+
interface EdgeTeamSkatingDistanceTop10Entry {
|
|
1529
|
+
team: EdgeTeam;
|
|
1530
|
+
distanceTotal: EdgeMeasurement;
|
|
1531
|
+
distancePer60: EdgeMeasurement;
|
|
1532
|
+
distanceMaxPerGame: {
|
|
1533
|
+
imperial: number;
|
|
1534
|
+
metric: number;
|
|
1535
|
+
overlay: EdgeOverlay;
|
|
1536
|
+
};
|
|
1537
|
+
distanceMaxPerPeriod: {
|
|
1538
|
+
imperial: number;
|
|
1539
|
+
metric: number;
|
|
1540
|
+
overlay: EdgeOverlay;
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
/** Response of `adv.teams.top10.skatingDistance` */
|
|
1544
|
+
type EdgeTeamSkatingDistanceTop10 = EdgeTeamSkatingDistanceTop10Entry[];
|
|
1545
|
+
/** One row of `adv.teams.top10.skatingSpeed` */
|
|
1546
|
+
interface EdgeTeamSkatingSpeedTop10Entry {
|
|
1547
|
+
team: EdgeTeam;
|
|
1548
|
+
maxSkatingSpeed: {
|
|
1549
|
+
imperial: number;
|
|
1550
|
+
metric: number;
|
|
1551
|
+
overlay: EdgeOverlay;
|
|
1552
|
+
};
|
|
1553
|
+
burstsOver22: number;
|
|
1554
|
+
bursts20To22: number;
|
|
1555
|
+
bursts18To20: number;
|
|
1556
|
+
}
|
|
1557
|
+
/** Response of `adv.teams.top10.skatingSpeed` */
|
|
1558
|
+
type EdgeTeamSkatingSpeedTop10 = EdgeTeamSkatingSpeedTop10Entry[];
|
|
1559
|
+
/** One row of `adv.teams.top10.zoneTime` */
|
|
1560
|
+
interface EdgeTeamZoneTimeTop10Entry {
|
|
1561
|
+
team: EdgeTeam;
|
|
1562
|
+
offensiveZoneTime: number;
|
|
1563
|
+
neutralZoneTime: number;
|
|
1564
|
+
defensiveZoneTime: number;
|
|
1565
|
+
}
|
|
1566
|
+
/** Response of `adv.teams.top10.zoneTime` */
|
|
1567
|
+
type EdgeTeamZoneTimeTop10 = EdgeTeamZoneTimeTop10Entry[];
|
|
1568
|
+
|
|
1569
|
+
/** Categories for save location top-10 list */
|
|
1570
|
+
declare const SaveLocationCategoryEnum: {
|
|
1571
|
+
/** Save Percentage */
|
|
1572
|
+
readonly 'SV%': "save-pctg";
|
|
1573
|
+
/** Saves */
|
|
1574
|
+
readonly SV: "saves";
|
|
1575
|
+
/** Shots Against */
|
|
1576
|
+
readonly SA: "shots-against";
|
|
1577
|
+
/** Goals Against */
|
|
1578
|
+
readonly GA: "goals-against";
|
|
1579
|
+
};
|
|
1580
|
+
/** Sort options for shot location top-10 list */
|
|
1581
|
+
declare const ShotLocationSortEnum: {
|
|
1582
|
+
/** All shot locations */
|
|
1583
|
+
readonly ALL: "all";
|
|
1584
|
+
/** High-danger (i.e. close-range) shot locations */
|
|
1585
|
+
readonly HIGH: "high";
|
|
1586
|
+
/** Mid-range shot locations */
|
|
1587
|
+
readonly MID: "mid";
|
|
1588
|
+
/** Long-range shot locations */
|
|
1589
|
+
readonly LONG: "long";
|
|
1590
|
+
};
|
|
1591
|
+
/** Alias for ShotLocationSortEnum */
|
|
1592
|
+
declare const SaveLocationSortEnum: {
|
|
1593
|
+
/** All shot locations */
|
|
1594
|
+
readonly ALL: "all";
|
|
1595
|
+
/** High-danger (i.e. close-range) shot locations */
|
|
1596
|
+
readonly HIGH: "high";
|
|
1597
|
+
/** Mid-range shot locations */
|
|
1598
|
+
readonly MID: "mid";
|
|
1599
|
+
/** Long-range shot locations */
|
|
1600
|
+
readonly LONG: "long";
|
|
1601
|
+
};
|
|
1602
|
+
/** Sort options for 5v5 save percentage top-10 list */
|
|
1603
|
+
declare const SavePercentage5v5SortEnum: {
|
|
1604
|
+
/**5v5 Save %: The percentage of shots a goalie stops at even strength (5-on-5). */
|
|
1605
|
+
readonly '5v5-SV%': "save-pctg";
|
|
1606
|
+
/**5v5 Save % in Close Situations: A “close situation” is the time during which a game is tied in the first or second period, or within one goal in the third period. This stats helps how goalies perform in high-pressure situations.*/
|
|
1607
|
+
readonly '5v5-SV%-Close': "save-pctg-close";
|
|
1608
|
+
/**5v5 Shots Against: The total number of shots a goalie faces at even strength (5-on-5).*/
|
|
1609
|
+
readonly '5v5-SA': "shots";
|
|
1610
|
+
/**5v5 Shots Against per 60 Minutes: The total number of shots a goalie faces at even strength (5-on-5) normalized to a 60-minute game. */
|
|
1611
|
+
readonly '5v5-SA/60': "shots-per-60";
|
|
1612
|
+
};
|
|
1613
|
+
/** Sort options for save percentage top-10 list */
|
|
1614
|
+
declare const SavePercentageSortEnum: {
|
|
1615
|
+
/** Starts above .900 */
|
|
1616
|
+
readonly GAMES: "games";
|
|
1617
|
+
/** Percentage of starts above .900 */
|
|
1618
|
+
readonly PCTG: "pctg";
|
|
1619
|
+
};
|
|
1620
|
+
/** Filter options for player positions */
|
|
1621
|
+
declare const PositionFilterEnum: {
|
|
1622
|
+
/** Center */
|
|
1623
|
+
readonly ALL: "all";
|
|
1624
|
+
/** Left Wing */
|
|
1625
|
+
readonly FWD: "forwards";
|
|
1626
|
+
/** Right Wing */
|
|
1627
|
+
readonly DEF: "defense";
|
|
1628
|
+
};
|
|
1629
|
+
/** Categories for skater strength */
|
|
1630
|
+
declare const SkatersStrengthEnum: {
|
|
1631
|
+
/** All strengths */
|
|
1632
|
+
readonly ALL: "all";
|
|
1633
|
+
/** Even strength */
|
|
1634
|
+
readonly ES: "es";
|
|
1635
|
+
/** Power play */
|
|
1636
|
+
readonly PP: "pp";
|
|
1637
|
+
/** Short-handed */
|
|
1638
|
+
readonly PK: "pk";
|
|
1639
|
+
};
|
|
1640
|
+
/** Sorting options for shot speed top-10 list */
|
|
1641
|
+
declare const ShotSpeedSortEnum: {
|
|
1642
|
+
/** Hardest shot recorded by player */
|
|
1643
|
+
readonly MAX: "max";
|
|
1644
|
+
/** Shots over 100 mph */
|
|
1645
|
+
readonly 'OVER-100': "over-100";
|
|
1646
|
+
/** Shots between 90 and 99 mph */
|
|
1647
|
+
readonly '90-99': "90-99";
|
|
1648
|
+
/** Shots between 80 and 89 mph */
|
|
1649
|
+
readonly '80-89': "80-89";
|
|
1650
|
+
/** Shots between 70 and 79 mph */
|
|
1651
|
+
readonly '70-79': "70-79";
|
|
1652
|
+
};
|
|
1653
|
+
/** Sorting options for skating speed top-10 list */
|
|
1654
|
+
declare const SkatingSpeedSortEnum: {
|
|
1655
|
+
/** Fastest skating speed recorded by player */
|
|
1656
|
+
readonly TOP: "max";
|
|
1657
|
+
/** Speed bursts recorded over 22 mph */
|
|
1658
|
+
readonly 'OVER-22': "over-22";
|
|
1659
|
+
/** Speed bursts recorded between 20 and 22 mph */
|
|
1660
|
+
readonly '20-22': "20-22";
|
|
1661
|
+
/** Speed bursts recorded between 18 and 20 mph */
|
|
1662
|
+
readonly '18-20': "18-20";
|
|
1663
|
+
};
|
|
1664
|
+
/** Sorting options for skating distance top-10 list */
|
|
1665
|
+
declare const SkatingDistanceSortEnum: {
|
|
1666
|
+
/** Total distance skated */
|
|
1667
|
+
TOTAL: string;
|
|
1668
|
+
/** Average distance skated per 60 minutes */
|
|
1669
|
+
'PER-60': string;
|
|
1670
|
+
/** Maximum distance skated in a single period */
|
|
1671
|
+
'MAX-PERIOD': string;
|
|
1672
|
+
/** Maximum distance skated in a single game */
|
|
1673
|
+
'MAX-GAME': string;
|
|
1674
|
+
};
|
|
1675
|
+
/** Categories for shot location top-10 list */
|
|
1676
|
+
declare const ShotLocationCategoryEnum: {
|
|
1677
|
+
/** Total shots on goal */
|
|
1678
|
+
readonly SOG: "sog";
|
|
1679
|
+
/** Total goals */
|
|
1680
|
+
readonly G: "goals";
|
|
1681
|
+
/** Shooting percentage */
|
|
1682
|
+
readonly 'SH%': "shooting-pctg";
|
|
1683
|
+
};
|
|
1684
|
+
/** Sorting options for zone time top-10 lists. */
|
|
1685
|
+
declare const ZoneTimeSortEnum: {
|
|
1686
|
+
/** Percentage of time spent in the offensive zone */
|
|
1687
|
+
readonly OZ: "offensive";
|
|
1688
|
+
/** Percentage of time spent in the defensive zone */
|
|
1689
|
+
readonly DZ: "defensive";
|
|
1690
|
+
/** Percentage of time spent in the neutral zone */
|
|
1691
|
+
readonly NZ: "neutral";
|
|
1692
|
+
};
|
|
1693
|
+
|
|
1694
|
+
declare const Year$1: arktype.BaseType<number | ((In: string) => arktype_internal_attributes_ts.To<number>), {}>;
|
|
1695
|
+
declare const NHLMonth$1: arktype_internal_variants_object_ts.ObjectType<(In: string | Date) => Out<string>, {}>;
|
|
1696
|
+
declare const NHLDate$1: arktype_internal_variants_object_ts.ObjectType<(In: string | Date) => Out<string>, {}>;
|
|
1697
|
+
declare const Season$2: arktype_internal_variants_object_ts.ObjectType<(In: string | number) => Out<string>, {}>;
|
|
1698
|
+
declare const TeamAbbrev$1: arktype_internal_variants_string_ts.StringType<"MIN" | "ANA" | "BOS" | "BUF" | "CGY" | "CAR" | "CHI" | "COL" | "CBJ" | "DAL" | "DET" | "EDM" | "FLA" | "LAK" | "MTL" | "NJD" | "NSH" | "NYI" | "NYR" | "OTT" | "PHI" | "PIT" | "SJS" | "SEA" | "STL" | "TBL" | "TOR" | "UTA" | "VAN" | "VGK" | "WPG" | "WSH" | "AFM" | "ARI" | "ATL" | "BRK" | "CGS" | "CLE" | "CLR" | "DCG" | "DFL" | "HAM" | "HFD" | "KCS" | "MMR" | "MNS" | "MWN" | "NYA" | "OAK" | "PHX" | "PIR" | "QBD" | "QUA" | "QUE" | "SEN" | "SLE" | "TAN" | "TSP" | "WIN", {}>;
|
|
1699
|
+
declare const TeamId$1: arktype_internal_variants_number_ts.NumberType<1 | 2 | 3 | 4 | 10 | 8 | 7 | 24 | 6 | 20 | 12 | 16 | 21 | 29 | 25 | 17 | 22 | 13 | 26 | 30 | 18 | 9 | 5 | 28 | 55 | 19 | 14 | 59 | 23 | 54 | 52 | 15 | 47 | 53 | 11 | 51 | 56 | 49 | 35 | 40 | 50 | 37 | 34 | 48 | 43 | 31 | 41 | 44 | 46 | 27 | 38 | 42 | 39 | 32 | 36 | 45 | 57 | 58 | 33, {}>;
|
|
1700
|
+
declare const GameType$1: arktype.BaseType<1 | 2 | 3 | 4 | 19 | ((In: "PRE" | "REG" | "POST" | "ASG" | "INTL") => Out<1 | 2 | 3 | 4 | 19>), {}>;
|
|
1701
|
+
declare const GameNumber$1: arktype_internal_variants_object_ts.ObjectType<(In: string | number) => Out<string>, {}>;
|
|
1702
|
+
declare const DraftRound$1: arktype_internal_variants_object_ts.ObjectType<(In: string | number) => Out<string>, {}>;
|
|
1703
|
+
declare const EventId$1: arktype.BaseType<number | ((In: string) => arktype_internal_attributes_ts.To<number>), {}>;
|
|
1704
|
+
declare const GameId$1: arktype.BaseType<number | ((In: string) => arktype_internal_attributes_ts.To<number>), {}>;
|
|
1705
|
+
declare const SeriesLetter$2: arktype_internal_variants_string_ts.StringType<"H" | "A" | "N" | "C" | "L" | "D" | "G" | "O" | "B" | "E" | "F" | "I" | "J" | "K" | "M", {}>;
|
|
1706
|
+
declare const GameState$1: arktype_internal_variants_string_ts.StringType<"FUT" | "LIV" | "FIN", {}>;
|
|
1707
|
+
declare const CountryCode$1: arktype_internal_variants_object_ts.ObjectType<(In: string) => Out<string>, {}>;
|
|
1708
|
+
declare const PostalCode$1: arktype_internal_variants_object_ts.ObjectType<(In: string) => Out<string>, {}>;
|
|
1709
|
+
declare const PlayerId$1: arktype_internal_variants_object_ts.ObjectType<(In: string | number) => Out<string>, {}>;
|
|
1710
|
+
|
|
1711
|
+
/**
|
|
1712
|
+
* Represents a valid NHL year (e.g., 2023, 2024, ...)
|
|
1713
|
+
*/
|
|
1714
|
+
type Year = typeof Year$1.inferIn;
|
|
1715
|
+
/**
|
|
1716
|
+
* Represents an NHL season in the format YYYYYYYY (e.g., 20232024)
|
|
1717
|
+
*/
|
|
1718
|
+
type Season$1 = typeof Season$2.inferIn;
|
|
1719
|
+
/**
|
|
1720
|
+
* Represents a valid NHL game type (e.g. REG, PRE, POST)
|
|
1721
|
+
*/
|
|
1722
|
+
type GameType = typeof GameType$1.inferIn;
|
|
1723
|
+
/**
|
|
1724
|
+
* Represents an NHL game ID with regex /\d{10}/
|
|
1725
|
+
* Breakdown of the ID: (YYYYTTNNNN)
|
|
1726
|
+
* - First 4 digits: Year of the game (YYYY)
|
|
1727
|
+
* - Next 2 digits: Game type (TT)(01 for preseason, 02 for regular
|
|
1728
|
+
* season, 03 for playoffs)
|
|
1729
|
+
* - Next 4 digits: Game number of the season (NNNN)
|
|
1730
|
+
*/
|
|
1731
|
+
type GameId = typeof GameId$1.inferIn;
|
|
1732
|
+
/**
|
|
1733
|
+
* Represents a valid NHL team abbreviation (e.g., NYR, MTL, ...)
|
|
1734
|
+
*/
|
|
1735
|
+
type TeamAbbrev = typeof TeamAbbrev$1.inferIn | (string & {});
|
|
1736
|
+
/**
|
|
1737
|
+
* Represents a valid NHL team ID
|
|
1738
|
+
*/
|
|
1739
|
+
type TeamId = typeof TeamId$1.inferIn | (number & {});
|
|
1740
|
+
/**
|
|
1741
|
+
* Represents a valid NHL game number
|
|
1742
|
+
*/
|
|
1743
|
+
type GameNumber = typeof GameNumber$1.inferIn;
|
|
1744
|
+
/**
|
|
1745
|
+
* Represents a valid NHL game state
|
|
1746
|
+
*/
|
|
1747
|
+
type GameState = typeof GameState$1.inferIn;
|
|
1748
|
+
/**
|
|
1749
|
+
* Represents a valid draft round (1-7)
|
|
1750
|
+
*/
|
|
1751
|
+
type DraftRound = typeof DraftRound$1.inferIn;
|
|
1752
|
+
/**
|
|
1753
|
+
* Represents a valid NHL event ID
|
|
1754
|
+
*/
|
|
1755
|
+
type EventId = typeof EventId$1.inferIn;
|
|
1756
|
+
/**
|
|
1757
|
+
* Represents a valid NHL date in the format YYYY-MM-DD
|
|
1758
|
+
*/
|
|
1759
|
+
type NHLDate = typeof NHLDate$1.inferIn;
|
|
1760
|
+
/**
|
|
1761
|
+
* Represents a valid NHL month in the format YYYY-MM
|
|
1762
|
+
*/
|
|
1763
|
+
type NHLMonth = typeof NHLMonth$1.inferIn;
|
|
1764
|
+
/**
|
|
1765
|
+
* Represents a valid NHL series letter (A-O)
|
|
1766
|
+
*/
|
|
1767
|
+
type SeriesLetter$1 = typeof SeriesLetter$2.inferIn;
|
|
1768
|
+
/**
|
|
1769
|
+
* Represents the playoff rounds in an NHL season (1-4)
|
|
1770
|
+
*/
|
|
1771
|
+
type PlayoffRound = 1 | 2 | 3 | 4;
|
|
1772
|
+
/**
|
|
1773
|
+
* Represents a valid country code (e.g., CAN, USA, SWE, ...)
|
|
1774
|
+
*/
|
|
1775
|
+
type CountryCode = typeof CountryCode$1.inferIn;
|
|
1776
|
+
/**
|
|
1777
|
+
* Represents a valid country code (e.g., CAN, USA, SWE, ...)
|
|
1778
|
+
*/
|
|
1779
|
+
type PostalCode = typeof PostalCode$1.inferIn;
|
|
1780
|
+
/**
|
|
1781
|
+
* Represents a valid NHL player ID
|
|
1782
|
+
*/
|
|
1783
|
+
type PlayerId = typeof PlayerId$1.inferIn;
|
|
1784
|
+
/**
|
|
1785
|
+
* Type definitions for enums from constants.ts
|
|
1786
|
+
*/
|
|
1787
|
+
/** Categories for shot location top-10 list */
|
|
1788
|
+
type ShotLocationCategory = keyof typeof ShotLocationCategoryEnum;
|
|
1789
|
+
/** Sort options for shot location top-10 list */
|
|
1790
|
+
type ShotLocationSort = keyof typeof ShotLocationSortEnum;
|
|
1791
|
+
/** Sort options for 5v5 save percentage top-10 list */
|
|
1792
|
+
type SavePercentage5v5Sort = keyof typeof SavePercentage5v5SortEnum;
|
|
1793
|
+
/** Sort options for save percentage top-10 list */
|
|
1794
|
+
type SavePercentageSort = keyof typeof SavePercentageSortEnum;
|
|
1795
|
+
/** Categories for save location top-10 list */
|
|
1796
|
+
type SaveLocationCategory = keyof typeof SaveLocationCategoryEnum;
|
|
1797
|
+
/** Sort options for save location top-10 list */
|
|
1798
|
+
type SaveLocationSort = keyof typeof SaveLocationSortEnum;
|
|
1799
|
+
/** Positions filter for player stats */
|
|
1800
|
+
type PositionFilter = keyof typeof PositionFilterEnum;
|
|
1801
|
+
/** Strength situation for skater stats */
|
|
1802
|
+
type SkatersStrength = keyof typeof SkatersStrengthEnum;
|
|
1803
|
+
/** Sort options for shot speed top-10 list */
|
|
1804
|
+
type ShotSpeedSort = keyof typeof ShotSpeedSortEnum;
|
|
1805
|
+
/** Sort options for skating speed top-10 list */
|
|
1806
|
+
type SkatingSpeedSort = keyof typeof SkatingSpeedSortEnum;
|
|
1807
|
+
/** Sort options for skating distance top-10 list */
|
|
1808
|
+
type SkatingDistanceSort = keyof typeof SkatingDistanceSortEnum;
|
|
1809
|
+
/** Sort options for zone time top-10 lists. */
|
|
1810
|
+
type ZoneTimeSort = keyof typeof ZoneTimeSortEnum;
|
|
1811
|
+
|
|
1812
|
+
/**
|
|
1813
|
+
* ======================================================================
|
|
1814
|
+
* API endpoints for goalie-related data.
|
|
1815
|
+
* Base url: api-web.nhle.com/v1/edge
|
|
1816
|
+
*
|
|
1817
|
+
* Notes:
|
|
1818
|
+
* - Convenience endpoints using 'now' for season have been
|
|
1819
|
+
* excluded in favor of using calculated current season. You can optionally
|
|
1820
|
+
* configure the switch over date for how current season is calculated.
|
|
1821
|
+
* See README for details.
|
|
1822
|
+
* - There is an extra endpoint that appears to duplicate
|
|
1823
|
+
* the functionality of /skater-detail at `v1/cat/edge/skater-detail`
|
|
1824
|
+
* As such, it has been excluded from this implementation.
|
|
1825
|
+
* ======================================================================
|
|
1826
|
+
*/
|
|
1827
|
+
|
|
1828
|
+
/**
|
|
1829
|
+
* Goalie Edge Advanced Stats API helpers.
|
|
1830
|
+
*
|
|
1831
|
+
* Lightweight wrapper exposing functions that call the underlying nhlClient
|
|
1832
|
+
* for goalie-related endpoints. Each function resolves to an APIResult; invalid
|
|
1833
|
+
* parameters give a ValidationError result without a request.
|
|
1834
|
+
*/
|
|
1835
|
+
/**
|
|
1836
|
+
* Get goalie detail for a player.
|
|
1837
|
+
* @param playerId - The player's numeric id.
|
|
1838
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
1839
|
+
* @param gameType - Optional game type id.
|
|
1840
|
+
* @returns Promise resolving to an APIResult with the response data.
|
|
1841
|
+
*/
|
|
1842
|
+
declare function player$1(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeGoalieDetail>>;
|
|
1843
|
+
/**
|
|
1844
|
+
* Get goalie comparison data for a player.
|
|
1845
|
+
* @param playerId - The player's numeric id.
|
|
1846
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
1847
|
+
* @param gameType - Optional game type id.
|
|
1848
|
+
* @returns Promise resolving to an APIResult with the response data.
|
|
1849
|
+
*/
|
|
1850
|
+
declare function compare$1(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeGoalieComparison>>;
|
|
1851
|
+
/**
|
|
1852
|
+
* Get goalie landing / leaders for a season.
|
|
1853
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
1854
|
+
* @param gameType - Optional game type id.
|
|
1855
|
+
* @returns Promise resolving to an APIResult with the response data.
|
|
1856
|
+
*/
|
|
1857
|
+
declare function leaders$2(season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeGoalieLanding>>;
|
|
1858
|
+
/**
|
|
1859
|
+
* Get 5v5 save percentage details for a goalie.
|
|
1860
|
+
* @param playerId - The player's numeric id.
|
|
1861
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
1862
|
+
* @param gameType - Optional game type id.
|
|
1863
|
+
* @returns Promise resolving to an APIResult with the response data.
|
|
1864
|
+
*/
|
|
1865
|
+
declare function savePercentage5v5(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeGoalieSavePercentage5v5>>;
|
|
1866
|
+
/**
|
|
1867
|
+
* Get save percentage details for a goalie.
|
|
1868
|
+
* @param playerId - The player's numeric id.
|
|
1869
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
1870
|
+
* @param gameType - Optional game type id.
|
|
1871
|
+
* @returns Promise resolving to an APIResult with the response data.
|
|
1872
|
+
*/
|
|
1873
|
+
declare function savePercentage(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeGoalieSavePercentage>>;
|
|
1874
|
+
/**
|
|
1875
|
+
* Get save location details for a goalie.
|
|
1876
|
+
* @param playerId - The player's numeric id.
|
|
1877
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
1878
|
+
* @param gameType - Optional game type id.
|
|
1879
|
+
* @returns Promise resolving to an APIResult with the response data.
|
|
1880
|
+
*/
|
|
1881
|
+
declare function saveLocation(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeGoalieShotLocation>>;
|
|
1882
|
+
/**
|
|
1883
|
+
* Accessor for top-10 leaderboards.
|
|
1884
|
+
* @returns Object with methods to fetch various top-10 lists.
|
|
1885
|
+
*/
|
|
1886
|
+
declare const top10$2: {
|
|
1887
|
+
savePercentage: typeof top10SavePercentage;
|
|
1888
|
+
savePercentage5v5: typeof top10SavePercentage5v5;
|
|
1889
|
+
saveLocation: typeof top10SaveLocation;
|
|
1890
|
+
};
|
|
1891
|
+
/**
|
|
1892
|
+
* Top-10 edge save percentage lists.
|
|
1893
|
+
* @param sortBy - Sorting key for the leaderboard.
|
|
1894
|
+
* @param season - Optional season (numeric or 'now').
|
|
1895
|
+
* @param gameType - Optional game type id.
|
|
1896
|
+
* @returns Promise resolving to an APIResult with the response data.
|
|
1897
|
+
*/
|
|
1898
|
+
declare function top10SavePercentage(season?: Season$1, gameType?: GameType, sortBy?: SavePercentageSort): Promise<APIResult<EdgeGoalieSavePercentageTop10>>;
|
|
1899
|
+
/**
|
|
1900
|
+
* Top-10 5v5 save percentage lists.
|
|
1901
|
+
* @param sortBy - Sorting key for the leaderboard.
|
|
1902
|
+
* @param season - Optional season (numeric or 'now').
|
|
1903
|
+
* @param gameType - Optional game type id.
|
|
1904
|
+
* @returns Promise resolving to an APIResult with the response data.
|
|
1905
|
+
*/
|
|
1906
|
+
declare function top10SavePercentage5v5(season?: Season$1, gameType?: GameType, sortBy?: SavePercentage5v5Sort): Promise<APIResult<EdgeGoalieSavePercentage5v5Top10>>;
|
|
1907
|
+
/**
|
|
1908
|
+
* Top-10 save location lists.
|
|
1909
|
+
* @param category - Category key (see SaveLocationCategoryEnum).
|
|
1910
|
+
* @param sortBy - Sorting key for the leaderboard (see SaveLocationSortEnum).
|
|
1911
|
+
* @param season - Optional season (e.g. 20242025).
|
|
1912
|
+
* @param gameType - Optional game type.
|
|
1913
|
+
* @returns Promise resolving to an APIResult with the response data.
|
|
1914
|
+
*/
|
|
1915
|
+
declare function top10SaveLocation(season?: Season$1, gameType?: GameType, category?: SaveLocationCategory, sortBy?: SaveLocationSort): Promise<APIResult<EdgeGoalieShotLocationTop10>>;
|
|
1916
|
+
|
|
1917
|
+
declare const goalies$1_saveLocation: typeof saveLocation;
|
|
1918
|
+
declare const goalies$1_savePercentage: typeof savePercentage;
|
|
1919
|
+
declare const goalies$1_savePercentage5v5: typeof savePercentage5v5;
|
|
1920
|
+
declare namespace goalies$1 {
|
|
1921
|
+
export { compare$1 as compare, leaders$2 as leaders, player$1 as player, goalies$1_saveLocation as saveLocation, goalies$1_savePercentage as savePercentage, goalies$1_savePercentage5v5 as savePercentage5v5, top10$2 as top10 };
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
/**
|
|
1925
|
+
* ======================================================================
|
|
1926
|
+
* API endpoints for skater-related data.
|
|
1927
|
+
* Base url: api-web.nhle.com/v1/edge
|
|
1928
|
+
*
|
|
1929
|
+
* Notes:
|
|
1930
|
+
* - Convenience endpoints using 'now' for season have been
|
|
1931
|
+
* excluded in favor of using calculated current season. You can optionally
|
|
1932
|
+
* configure the switch over date for how current season is calculated.
|
|
1933
|
+
* See README for details.
|
|
1934
|
+
* - There is an extra endpoint that appears to duplicate
|
|
1935
|
+
* the functionality of /skater-detail at `v1/cat/edge/skater-detail`
|
|
1936
|
+
* As such, it has been excluded from this implementation.
|
|
1937
|
+
* =====================================================================
|
|
1938
|
+
*/
|
|
1939
|
+
|
|
1940
|
+
/**
|
|
1941
|
+
* Skater Edge Advanced Stats API helpers.
|
|
1942
|
+
*
|
|
1943
|
+
* Lightweight wrapper exposing functions that call the underlying nhlClient
|
|
1944
|
+
* for skater-related endpoints. Each function resolves to an APIResult; invalid
|
|
1945
|
+
* parameters give a ValidationError result without a request.
|
|
1946
|
+
*/
|
|
1947
|
+
/** Get skater detail for a player. */
|
|
1948
|
+
declare function detail(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeSkaterDetail>>;
|
|
1949
|
+
/** Get skater shot location details for a player. */
|
|
1950
|
+
declare function shotLocation$1(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeSkaterShotLocation>>;
|
|
1951
|
+
/** Get skater shot speed details for a player. */
|
|
1952
|
+
declare function shotSpeed$1(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeSkaterShotSpeed>>;
|
|
1953
|
+
/** Get skater skating distance details for a player. */
|
|
1954
|
+
declare function skatingDistance$1(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeSkaterSkatingDistance>>;
|
|
1955
|
+
/** Get skater skating speed details for a player. */
|
|
1956
|
+
declare function skatingSpeed$1(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeSkaterSkatingSpeed>>;
|
|
1957
|
+
/** Get skater zone time for a player. */
|
|
1958
|
+
declare function zoneTime$1(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeSkaterZoneTime>>;
|
|
1959
|
+
/** Get skater comparison data for a player. */
|
|
1960
|
+
declare function comparison(playerId: PlayerId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeSkaterComparison>>;
|
|
1961
|
+
/** Get skater landing / leaders for a season. */
|
|
1962
|
+
declare function leaders$1(season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeSkaterLanding>>;
|
|
1963
|
+
declare const top10$1: {
|
|
1964
|
+
distance: typeof top10Distance;
|
|
1965
|
+
shotLocation: typeof top10ShotLocation$1;
|
|
1966
|
+
shotSpeed: typeof top10ShotSpeed$1;
|
|
1967
|
+
speed: typeof top10Speed;
|
|
1968
|
+
zoneTime: typeof top10ZoneTime$1;
|
|
1969
|
+
};
|
|
1970
|
+
/** Top-10 skating distance lists. */
|
|
1971
|
+
declare function top10Distance(season?: Season$1, gameType?: GameType, position?: PositionFilter, strength?: SkatersStrength, sortBy?: SkatingDistanceSort): Promise<APIResult<EdgeSkaterDistanceTop10>>;
|
|
1972
|
+
/** Top-10 shot location lists. */
|
|
1973
|
+
declare function top10ShotLocation$1(season?: Season$1, gameType?: GameType, position?: PositionFilter, category?: ShotLocationCategory, sortBy?: ShotLocationSort): Promise<APIResult<EdgeSkaterShotLocationTop10>>;
|
|
1974
|
+
/** Top-10 shot speed lists. */
|
|
1975
|
+
declare function top10ShotSpeed$1(season?: Season$1, gameType?: GameType, position?: PositionFilter, sortBy?: ShotSpeedSort): Promise<APIResult<EdgeSkaterShotSpeedTop10>>;
|
|
1976
|
+
/** Top-10 skating speed lists. */
|
|
1977
|
+
declare function top10Speed(season?: Season$1, gameType?: GameType, position?: PositionFilter, sortBy?: SkatingSpeedSort): Promise<APIResult<EdgeSkaterSpeedTop10>>;
|
|
1978
|
+
/** Top-10 zone time lists. */
|
|
1979
|
+
declare function top10ZoneTime$1(season?: Season$1, gameType?: GameType, position?: PositionFilter, strength?: SkatersStrength, sortBy?: ZoneTimeSort): Promise<APIResult<EdgeSkaterZoneTimeTop10>>;
|
|
1980
|
+
|
|
1981
|
+
declare const skaters$1_comparison: typeof comparison;
|
|
1982
|
+
declare const skaters$1_detail: typeof detail;
|
|
1983
|
+
declare namespace skaters$1 {
|
|
1984
|
+
export { skaters$1_comparison as comparison, skaters$1_detail as detail, leaders$1 as leaders, shotLocation$1 as shotLocation, shotSpeed$1 as shotSpeed, skatingDistance$1 as skatingDistance, skatingSpeed$1 as skatingSpeed, top10$1 as top10, zoneTime$1 as zoneTime };
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* Edge Advanced Stats API helpers.
|
|
1989
|
+
*
|
|
1990
|
+
* Lightweight wrapper exposing functions that call the underlying nhlClient
|
|
1991
|
+
* for related endpoints. Each function resolves to an APIResult; invalid
|
|
1992
|
+
* parameters give a ValidationError result without a request.
|
|
1993
|
+
*/
|
|
1994
|
+
/**
|
|
1995
|
+
* Get the "by the numbers" data for the current day, updated daily with
|
|
1996
|
+
* insights from the previous days games.
|
|
1997
|
+
* @returns A promise that resolves to the "by the numbers" data.
|
|
1998
|
+
*/
|
|
1999
|
+
declare function byTheNumbers(): Promise<APIResult<EdgeByTheNumbers>>;
|
|
2000
|
+
|
|
2001
|
+
/**
|
|
2002
|
+
* ======================================================================
|
|
2003
|
+
* API endpoints for team-related data.
|
|
2004
|
+
* Base url: api-web.nhle.com/v1/edge
|
|
2005
|
+
*
|
|
2006
|
+
* note: the season and game-type params on any endpoint can
|
|
2007
|
+
* be replaced with 'now' to get current season data.
|
|
2008
|
+
* ex. `/team-detail/{team-id}/now`
|
|
2009
|
+
* ======================================================================
|
|
2010
|
+
*/
|
|
2011
|
+
|
|
2012
|
+
/**
|
|
2013
|
+
* Team Edge Advanced Stats API helpers.
|
|
2014
|
+
*
|
|
2015
|
+
* Lightweight wrapper exposing functions that call the underlying nhlClient
|
|
2016
|
+
* for team-related endpoints. Each function resolves to an APIResult; invalid
|
|
2017
|
+
* parameters give a ValidationError result without a request.
|
|
2018
|
+
*/
|
|
2019
|
+
/**
|
|
2020
|
+
* Get team detail stats for a team.
|
|
2021
|
+
* @param teamId - Team numeric id.
|
|
2022
|
+
* @param season - Optional season (numeric season format or 'now').
|
|
2023
|
+
* @param gameType - Optional game type id (defaults to Regular Season).
|
|
2024
|
+
*/
|
|
2025
|
+
declare function stats$1(teamId: TeamId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeTeamDetail>>;
|
|
2026
|
+
/**
|
|
2027
|
+
* Get team comparison data for a single team.
|
|
2028
|
+
*/
|
|
2029
|
+
declare function compare(teamId: TeamId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeTeamComparison>>;
|
|
2030
|
+
/**
|
|
2031
|
+
* Get team landing/leaders for a season.
|
|
2032
|
+
*/
|
|
2033
|
+
declare function leaders(season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeTeamLanding>>;
|
|
2034
|
+
/**
|
|
2035
|
+
* Get shot location details for a team.
|
|
2036
|
+
*/
|
|
2037
|
+
declare function shotLocation(teamId: TeamId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeTeamShotLocation>>;
|
|
2038
|
+
/**
|
|
2039
|
+
* Get shot speed details for a team.
|
|
2040
|
+
*/
|
|
2041
|
+
declare function shotSpeed(teamId: TeamId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeTeamShotSpeed>>;
|
|
2042
|
+
/**
|
|
2043
|
+
* Get skating distance details for a team.
|
|
2044
|
+
*/
|
|
2045
|
+
declare function skatingDistance(teamId: TeamId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeTeamSkatingDistance>>;
|
|
2046
|
+
/**
|
|
2047
|
+
* Get skating speed details for a team.
|
|
2048
|
+
*/
|
|
2049
|
+
declare function skatingSpeed(teamId: TeamId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeTeamSkatingSpeed>>;
|
|
2050
|
+
/**
|
|
2051
|
+
* Get zone time details for a team.
|
|
2052
|
+
*/
|
|
2053
|
+
declare function zoneTime(teamId: TeamId, season?: Season$1, gameType?: GameType): Promise<APIResult<EdgeTeamZoneTime>>;
|
|
2054
|
+
declare const top10: {
|
|
2055
|
+
shotLocation: typeof top10ShotLocation;
|
|
2056
|
+
shotSpeed: typeof top10ShotSpeed;
|
|
2057
|
+
skatingDistance: typeof top10SkatingDistance;
|
|
2058
|
+
skatingSpeed: typeof top10SkatingSpeed;
|
|
2059
|
+
zoneTime: typeof top10ZoneTime;
|
|
2060
|
+
};
|
|
2061
|
+
/**
|
|
2062
|
+
* Top-10 team shot location lists.
|
|
2063
|
+
*/
|
|
2064
|
+
declare function top10ShotLocation(season?: Season$1, gameType?: GameType, position?: PositionFilter, category?: ShotLocationCategory, sortBy?: ShotLocationSort): Promise<APIResult<EdgeTeamShotLocationTop10>>;
|
|
2065
|
+
/**
|
|
2066
|
+
* Top-10 team shot speed lists.
|
|
2067
|
+
*/
|
|
2068
|
+
declare function top10ShotSpeed(season?: Season$1, gameType?: GameType, position?: PositionFilter, sortBy?: ShotSpeedSort): Promise<APIResult<EdgeTeamShotSpeedTop10>>;
|
|
2069
|
+
/**
|
|
2070
|
+
* Top-10 team skating distance lists.
|
|
2071
|
+
*/
|
|
2072
|
+
declare function top10SkatingDistance(season?: Season$1, gameType?: GameType, position?: PositionFilter, strength?: SkatersStrength, sortBy?: SkatingDistanceSort): Promise<APIResult<EdgeTeamSkatingDistanceTop10>>;
|
|
2073
|
+
/**
|
|
2074
|
+
* Top-10 team skating speed lists.
|
|
2075
|
+
*/
|
|
2076
|
+
declare function top10SkatingSpeed(season?: Season$1, gameType?: GameType, position?: PositionFilter, sortBy?: SkatingSpeedSort): Promise<APIResult<EdgeTeamSkatingSpeedTop10>>;
|
|
2077
|
+
/**
|
|
2078
|
+
* Top-10 team zone time lists.
|
|
2079
|
+
*/
|
|
2080
|
+
declare function top10ZoneTime(season?: Season$1, gameType?: GameType, strength?: SkatersStrength, sortBy?: ZoneTimeSort): Promise<APIResult<EdgeTeamZoneTimeTop10>>;
|
|
2081
|
+
|
|
2082
|
+
declare const teams$1_compare: typeof compare;
|
|
2083
|
+
declare const teams$1_leaders: typeof leaders;
|
|
2084
|
+
declare const teams$1_shotLocation: typeof shotLocation;
|
|
2085
|
+
declare const teams$1_shotSpeed: typeof shotSpeed;
|
|
2086
|
+
declare const teams$1_skatingDistance: typeof skatingDistance;
|
|
2087
|
+
declare const teams$1_skatingSpeed: typeof skatingSpeed;
|
|
2088
|
+
declare const teams$1_top10: typeof top10;
|
|
2089
|
+
declare const teams$1_zoneTime: typeof zoneTime;
|
|
2090
|
+
declare namespace teams$1 {
|
|
2091
|
+
export { teams$1_compare as compare, teams$1_leaders as leaders, teams$1_shotLocation as shotLocation, teams$1_shotSpeed as shotSpeed, teams$1_skatingDistance as skatingDistance, teams$1_skatingSpeed as skatingSpeed, stats$1 as stats, teams$1_top10 as top10, teams$1_zoneTime as zoneTime };
|
|
2092
|
+
}
|
|
2093
|
+
|
|
2094
|
+
/**
|
|
2095
|
+
* ========================================================================
|
|
2096
|
+
* NHL Edge Advanced Stats API Module Exports
|
|
2097
|
+
* Base URL: https://api.nhle.com/stats/rest
|
|
2098
|
+
* ========================================================================
|
|
2099
|
+
* Complete NHL Edge Advanced Stats API implementation with modules for:
|
|
2100
|
+
* - Players (skaters, goalies)
|
|
2101
|
+
* - Teams and franchises
|
|
2102
|
+
* - Advanced statistical numbers
|
|
2103
|
+
* ========================================================================
|
|
2104
|
+
*/
|
|
2105
|
+
|
|
2106
|
+
declare const index$2_byTheNumbers: typeof byTheNumbers;
|
|
2107
|
+
declare namespace index$2 {
|
|
2108
|
+
export { index$2_byTheNumbers as byTheNumbers, goalies$1 as goalies, skaters$1 as skaters, teams$1 as teams };
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
/**
|
|
2112
|
+
* ======================================================================
|
|
2113
|
+
* NHL Edge Stats API - Endpoint Paths
|
|
2114
|
+
* Base URL: https://api.nhle.com/stats/rest
|
|
2115
|
+
* ======================================================================
|
|
2116
|
+
* Defines the endpoint paths for all categories of data in the NHL Edge
|
|
2117
|
+
* Stats API. These paths are used by the various API functions to
|
|
2118
|
+
* construct the correct URLs for making requests to the API.
|
|
2119
|
+
*
|
|
2120
|
+
* Note: These endpoints generally return entire datasets (tabular data)
|
|
2121
|
+
* as arrays of objects. The API expects query parameters to be used for
|
|
2122
|
+
* filtering and column selection (namely through cayenneExp). Some
|
|
2123
|
+
* endpoints will return empty arrays or 'not found' errors when queried
|
|
2124
|
+
* without parameters.
|
|
2125
|
+
*/
|
|
2126
|
+
declare const dataPaths: {
|
|
2127
|
+
/** Goalie-related statistics and reports. */
|
|
2128
|
+
goalie: {
|
|
2129
|
+
/** Goalie leader boards by stat category. */
|
|
2130
|
+
leaders: {
|
|
2131
|
+
/** Goals-against average leaders. */
|
|
2132
|
+
gaa: string;
|
|
2133
|
+
/** Save percentage leaders. */
|
|
2134
|
+
savePctg: string;
|
|
2135
|
+
/** Shutouts leaders. */
|
|
2136
|
+
shutouts: string;
|
|
2137
|
+
};
|
|
2138
|
+
/** Goalie statistical reports. */
|
|
2139
|
+
report: string;
|
|
2140
|
+
/** Goalie career milestones. */
|
|
2141
|
+
milestones: string;
|
|
2142
|
+
};
|
|
2143
|
+
/** Skater/player-related statistics and reports. */
|
|
2144
|
+
skater: {
|
|
2145
|
+
/** Player directory and information. */
|
|
2146
|
+
players: string;
|
|
2147
|
+
/** Skater leader boards by stat category. */
|
|
2148
|
+
leaders: {
|
|
2149
|
+
/** Assists leaders. */
|
|
2150
|
+
assists: string;
|
|
2151
|
+
/** Goals leaders. */
|
|
2152
|
+
goals: string;
|
|
2153
|
+
/** Points leaders. */
|
|
2154
|
+
points: string;
|
|
2155
|
+
};
|
|
2156
|
+
/** Skater career milestones. */
|
|
2157
|
+
milestones: string;
|
|
2158
|
+
/** Skater statistical reports. */
|
|
2159
|
+
report: string;
|
|
2160
|
+
};
|
|
2161
|
+
/** Team-related statistics and reports. */
|
|
2162
|
+
team: {
|
|
2163
|
+
/** All teams data. */
|
|
2164
|
+
all: string;
|
|
2165
|
+
/** Team data by team ID. */
|
|
2166
|
+
byId: string;
|
|
2167
|
+
/** Team statistical reports. */
|
|
2168
|
+
report: string;
|
|
2169
|
+
};
|
|
2170
|
+
/** Season-related data. */
|
|
2171
|
+
season: string;
|
|
2172
|
+
/** Game-related data. */
|
|
2173
|
+
game: string;
|
|
2174
|
+
/** Draft-related data. */
|
|
2175
|
+
draft: string;
|
|
2176
|
+
/** Configuration data for skater, goalie, and team reports. */
|
|
2177
|
+
config: string;
|
|
2178
|
+
/** Country data. */
|
|
2179
|
+
countries: string;
|
|
2180
|
+
/** Shift chart data. */
|
|
2181
|
+
shiftCharts: string;
|
|
2182
|
+
/** Glossary data. */
|
|
2183
|
+
glossary: string;
|
|
2184
|
+
/** Franchise data. */
|
|
2185
|
+
franchises: string;
|
|
2186
|
+
};
|
|
2187
|
+
|
|
2188
|
+
/**
|
|
2189
|
+
* Response and parameter types for the NHL Stats API
|
|
2190
|
+
* (https://api.nhle.com/stats/rest)
|
|
2191
|
+
*
|
|
2192
|
+
* Every list endpoint answers `{ data: T[], total }`. Report rows (skater,
|
|
2193
|
+
* goalie and team reports) vary with the report and with `isAggregate` /
|
|
2194
|
+
* `isGame`, so their types list the `summary` fields and keep an index
|
|
2195
|
+
* signature for the rest.
|
|
2196
|
+
*
|
|
2197
|
+
* With `isAggregate=true`, report rows drop per-instance fields (seasonId,
|
|
2198
|
+
* teamId, gameId) and team reports add franchise fields; see
|
|
2199
|
+
* TeamStatsWithFranchise.
|
|
2200
|
+
*/
|
|
2201
|
+
|
|
2202
|
+
/** List response returned by every Stats API list endpoint */
|
|
2203
|
+
interface PaginatedData<T> {
|
|
2204
|
+
data: T[];
|
|
2205
|
+
/** Number of rows matching the query, before `limit` */
|
|
2206
|
+
total: number;
|
|
2207
|
+
}
|
|
2208
|
+
type APIResultPaginated<T> = APIResult<PaginatedData<T>>;
|
|
2209
|
+
/**
|
|
2210
|
+
* Skater report names listed by `/config` (`playerReportData`).
|
|
2211
|
+
* Any other string is accepted for reports added later.
|
|
2212
|
+
*/
|
|
2213
|
+
type SkaterReport = 'bios' | 'faceoffpercentages' | 'faceoffwins' | 'goalsForAgainst' | 'penalties' | 'penaltyShots' | 'penaltykill' | 'percentages' | 'powerplay' | 'puckPossessions' | 'realtime' | 'scoringRates' | 'scoringpergame' | 'shootout' | 'shottype' | 'summary' | 'summaryshooting' | 'timeonice' | (string & {});
|
|
2214
|
+
/** Goalie report names listed by `/config` (`goalieReportData`) */
|
|
2215
|
+
type GoalieReport = 'advanced' | 'bios' | 'daysrest' | 'penaltyShots' | 'savesByStrength' | 'shootout' | 'startedVsRelieved' | 'summary' | (string & {});
|
|
2216
|
+
/** Team report names listed by `/config` (`teamReportData`) */
|
|
2217
|
+
type TeamReport = 'daysbetweengames' | 'faceoffpercentages' | 'faceoffwins' | 'goalgames' | 'goalsagainstbystrength' | 'goalsagainstbystrengthgoaliepull' | 'goalsbyperiod' | 'goalsforbystrength' | 'goalsforbystrengthgoaliepull' | 'leadingtrailing' | 'outshootoutshotby' | 'penalties' | 'penaltykill' | 'penaltykilltime' | 'percentages' | 'powerplay' | 'powerplaytime' | 'realtime' | 'savePercentage' | 'scoretrailfirst' | 'shootout' | 'shottype' | 'summary' | 'summaryshooting' | (string & {});
|
|
2218
|
+
/** A player as listed by `/players` and nested in leader rows */
|
|
2219
|
+
interface PlayerInfo {
|
|
2220
|
+
id: number;
|
|
2221
|
+
currentTeamId: number | null;
|
|
2222
|
+
firstName: string;
|
|
2223
|
+
fullName: string;
|
|
2224
|
+
lastName: string;
|
|
2225
|
+
positionCode: string;
|
|
2226
|
+
sweaterNumber: number | null;
|
|
2227
|
+
}
|
|
2228
|
+
/** A team logo, included with `include=logos` */
|
|
2229
|
+
interface TeamLogo {
|
|
2230
|
+
id: number;
|
|
2231
|
+
background: string;
|
|
2232
|
+
endSeason: number;
|
|
2233
|
+
secureUrl: string;
|
|
2234
|
+
startSeason: number;
|
|
2235
|
+
teamId: number;
|
|
2236
|
+
url: string;
|
|
2237
|
+
}
|
|
2238
|
+
/** A team as listed by `/team` and `/team/id/{id}` */
|
|
2239
|
+
interface Team$b {
|
|
2240
|
+
id: number;
|
|
2241
|
+
franchiseId: number | null;
|
|
2242
|
+
fullName: string;
|
|
2243
|
+
leagueId: number;
|
|
2244
|
+
rawTricode: string;
|
|
2245
|
+
triCode: string;
|
|
2246
|
+
/** Present with `include=logos`, and on leader rows */
|
|
2247
|
+
logos?: TeamLogo[];
|
|
2248
|
+
}
|
|
2249
|
+
/** Row of a skater report (fields of the `summary` report) */
|
|
2250
|
+
interface SkaterStats {
|
|
2251
|
+
playerId: number;
|
|
2252
|
+
skaterFullName?: string;
|
|
2253
|
+
lastName?: string;
|
|
2254
|
+
seasonId?: number;
|
|
2255
|
+
teamAbbrevs?: string;
|
|
2256
|
+
positionCode?: string;
|
|
2257
|
+
shootsCatches?: string;
|
|
2258
|
+
gamesPlayed?: number;
|
|
2259
|
+
goals?: number;
|
|
2260
|
+
assists?: number;
|
|
2261
|
+
points?: number;
|
|
2262
|
+
plusMinus?: number;
|
|
2263
|
+
pointsPerGame?: number;
|
|
2264
|
+
penaltyMinutes?: number;
|
|
2265
|
+
evGoals?: number;
|
|
2266
|
+
evPoints?: number;
|
|
2267
|
+
ppGoals?: number;
|
|
2268
|
+
ppPoints?: number;
|
|
2269
|
+
shGoals?: number;
|
|
2270
|
+
shPoints?: number;
|
|
2271
|
+
otGoals?: number;
|
|
2272
|
+
gameWinningGoals?: number;
|
|
2273
|
+
shots?: number;
|
|
2274
|
+
shootingPct?: number | null;
|
|
2275
|
+
faceoffWinPct?: number | null;
|
|
2276
|
+
timeOnIcePerGame?: number;
|
|
2277
|
+
[key: string]: unknown;
|
|
2278
|
+
}
|
|
2279
|
+
/** Row of a goalie report (fields of the `summary` report) */
|
|
2280
|
+
interface GoalieStats {
|
|
2281
|
+
playerId: number;
|
|
2282
|
+
goalieFullName?: string;
|
|
2283
|
+
lastName?: string;
|
|
2284
|
+
seasonId?: number;
|
|
2285
|
+
teamAbbrevs?: string;
|
|
2286
|
+
shootsCatches?: string;
|
|
2287
|
+
gamesPlayed?: number;
|
|
2288
|
+
gamesStarted?: number;
|
|
2289
|
+
wins?: number;
|
|
2290
|
+
losses?: number;
|
|
2291
|
+
otLosses?: number | null;
|
|
2292
|
+
ties?: number | null;
|
|
2293
|
+
shutouts?: number;
|
|
2294
|
+
goalsAgainst?: number;
|
|
2295
|
+
goalsAgainstAverage?: number;
|
|
2296
|
+
saves?: number;
|
|
2297
|
+
shotsAgainst?: number;
|
|
2298
|
+
savePct?: number | null;
|
|
2299
|
+
timeOnIce?: number;
|
|
2300
|
+
goals?: number;
|
|
2301
|
+
assists?: number;
|
|
2302
|
+
points?: number;
|
|
2303
|
+
penaltyMinutes?: number;
|
|
2304
|
+
[key: string]: unknown;
|
|
2305
|
+
}
|
|
2306
|
+
/** Row of a team report (fields of the `summary` report) */
|
|
2307
|
+
interface TeamStats$1 {
|
|
2308
|
+
teamId?: number;
|
|
2309
|
+
teamFullName?: string;
|
|
2310
|
+
seasonId?: number;
|
|
2311
|
+
gamesPlayed?: number;
|
|
2312
|
+
wins?: number;
|
|
2313
|
+
losses?: number;
|
|
2314
|
+
otLosses?: number | null;
|
|
2315
|
+
ties?: number | null;
|
|
2316
|
+
points?: number;
|
|
2317
|
+
pointPct?: number;
|
|
2318
|
+
regulationAndOtWins?: number;
|
|
2319
|
+
winsInRegulation?: number;
|
|
2320
|
+
winsInShootout?: number;
|
|
2321
|
+
goalsFor?: number;
|
|
2322
|
+
goalsAgainst?: number;
|
|
2323
|
+
goalsForPerGame?: number;
|
|
2324
|
+
goalsAgainstPerGame?: number;
|
|
2325
|
+
shotsForPerGame?: number;
|
|
2326
|
+
shotsAgainstPerGame?: number;
|
|
2327
|
+
powerPlayPct?: number | null;
|
|
2328
|
+
powerPlayNetPct?: number | null;
|
|
2329
|
+
penaltyKillPct?: number | null;
|
|
2330
|
+
penaltyKillNetPct?: number | null;
|
|
2331
|
+
faceoffWinPct?: number | null;
|
|
2332
|
+
teamShutouts?: number;
|
|
2333
|
+
[key: string]: unknown;
|
|
2334
|
+
}
|
|
2335
|
+
/**
|
|
2336
|
+
* Row of a team report requested with `isAggregate=true`: per-team and
|
|
2337
|
+
* per-season fields are dropped and franchise fields added.
|
|
2338
|
+
*/
|
|
2339
|
+
interface TeamStatsWithFranchise extends TeamStats$1 {
|
|
2340
|
+
franchiseId: number;
|
|
2341
|
+
franchiseName: string;
|
|
2342
|
+
}
|
|
2343
|
+
/** Skater leader row; the stat field is named after the category */
|
|
2344
|
+
interface SkaterLeader$1 {
|
|
2345
|
+
player: PlayerInfo;
|
|
2346
|
+
team: Team$b;
|
|
2347
|
+
goals?: number;
|
|
2348
|
+
assists?: number;
|
|
2349
|
+
points?: number;
|
|
2350
|
+
}
|
|
2351
|
+
/** Goalie leader row; the stat field is named after the category */
|
|
2352
|
+
interface GoalieLeader$1 {
|
|
2353
|
+
player: PlayerInfo;
|
|
2354
|
+
team: Team$b;
|
|
2355
|
+
gaa?: number | null;
|
|
2356
|
+
savePctg?: number | null;
|
|
2357
|
+
shutouts?: number;
|
|
2358
|
+
}
|
|
2359
|
+
/** Shared fields of a milestone row */
|
|
2360
|
+
interface Milestone {
|
|
2361
|
+
id: number;
|
|
2362
|
+
playerId: number;
|
|
2363
|
+
firstName: string;
|
|
2364
|
+
lastName: string;
|
|
2365
|
+
playerFullName: string;
|
|
2366
|
+
currentTeamId: number;
|
|
2367
|
+
teamAbbrev: string;
|
|
2368
|
+
teamCommonName: string;
|
|
2369
|
+
teamFullName: string;
|
|
2370
|
+
teamPlaceName: string;
|
|
2371
|
+
gameTypeId: number;
|
|
2372
|
+
gamesPlayed: number;
|
|
2373
|
+
/** The stat being approached, e.g. "Goals" or "Shutouts" */
|
|
2374
|
+
milestone: string;
|
|
2375
|
+
milestoneAmount: number;
|
|
2376
|
+
}
|
|
2377
|
+
/** A skater approaching a career milestone */
|
|
2378
|
+
interface SkaterMilestone extends Milestone {
|
|
2379
|
+
goals: number;
|
|
2380
|
+
assists: number;
|
|
2381
|
+
points: number;
|
|
2382
|
+
}
|
|
2383
|
+
/** A goalie approaching a career milestone */
|
|
2384
|
+
interface GoalieMilestone extends Milestone {
|
|
2385
|
+
wins: number;
|
|
2386
|
+
so: number;
|
|
2387
|
+
toiMinutes: number;
|
|
2388
|
+
}
|
|
2389
|
+
/** A franchise from `/franchise` */
|
|
2390
|
+
interface Franchise {
|
|
2391
|
+
id: number;
|
|
2392
|
+
fullName: string;
|
|
2393
|
+
teamCommonName: string;
|
|
2394
|
+
teamPlaceName: string;
|
|
2395
|
+
}
|
|
2396
|
+
/** A season from `/season` */
|
|
2397
|
+
interface Season {
|
|
2398
|
+
/** Season id, e.g. 20242025 */
|
|
2399
|
+
id: number;
|
|
2400
|
+
formattedSeasonId: string;
|
|
2401
|
+
seasonOrdinal: number;
|
|
2402
|
+
startDate: string;
|
|
2403
|
+
endDate: string;
|
|
2404
|
+
preseasonStartdate: string | null;
|
|
2405
|
+
regularSeasonEndDate: string;
|
|
2406
|
+
numberOfGames: number;
|
|
2407
|
+
totalRegularSeasonGames: number;
|
|
2408
|
+
totalPlayoffGames: number;
|
|
2409
|
+
allStarGameInUse: number;
|
|
2410
|
+
conferencesInUse: number;
|
|
2411
|
+
divisionsInUse: number;
|
|
2412
|
+
entryDraftInUse: number;
|
|
2413
|
+
nhlStanleyCupOwner: number;
|
|
2414
|
+
olympicsParticipation: number;
|
|
2415
|
+
pointForOTLossInUse: number;
|
|
2416
|
+
rowInUse: number;
|
|
2417
|
+
supplementalDraftInUse: number;
|
|
2418
|
+
tiesInUse: number;
|
|
2419
|
+
wildcardInUse: number;
|
|
2420
|
+
minimumPlayoffMinutesForGoalieStatsLeaders: number;
|
|
2421
|
+
minimumRegularGamesForGoalieStatsLeaders: number;
|
|
2422
|
+
}
|
|
2423
|
+
/** A game from `/game` */
|
|
2424
|
+
interface Game$6 {
|
|
2425
|
+
/** Game id, e.g. 2024020001 */
|
|
2426
|
+
id: number;
|
|
2427
|
+
season: number;
|
|
2428
|
+
/** 1 = preseason, 2 = regular season, 3 = playoffs */
|
|
2429
|
+
gameType: number;
|
|
2430
|
+
gameNumber: number;
|
|
2431
|
+
gameDate: string;
|
|
2432
|
+
easternStartTime: string;
|
|
2433
|
+
gameScheduleStateId: number;
|
|
2434
|
+
gameStateId: number;
|
|
2435
|
+
period: number | null;
|
|
2436
|
+
homeTeamId: number;
|
|
2437
|
+
homeScore: number | null;
|
|
2438
|
+
visitingTeamId: number;
|
|
2439
|
+
visitingScore: number | null;
|
|
2440
|
+
}
|
|
2441
|
+
/** A draft year from `/draft` */
|
|
2442
|
+
interface Draft {
|
|
2443
|
+
id: number;
|
|
2444
|
+
draftYear: number;
|
|
2445
|
+
rounds: number;
|
|
2446
|
+
}
|
|
2447
|
+
/**
|
|
2448
|
+
* Report configuration from `/config`: the columns, filters and sort keys
|
|
2449
|
+
* of every skater, goalie and team report.
|
|
2450
|
+
*/
|
|
2451
|
+
interface Config {
|
|
2452
|
+
playerReportData: Record<string, unknown>;
|
|
2453
|
+
goalieReportData: Record<string, unknown>;
|
|
2454
|
+
teamReportData: Record<string, unknown>;
|
|
2455
|
+
[key: string]: unknown;
|
|
2456
|
+
}
|
|
2457
|
+
/** A country from `/country` */
|
|
2458
|
+
interface Country {
|
|
2459
|
+
/** Three-letter code, same as country3Code */
|
|
2460
|
+
id: string;
|
|
2461
|
+
country3Code: string;
|
|
2462
|
+
countryCode: string;
|
|
2463
|
+
countryName: string;
|
|
2464
|
+
nationalityName: string;
|
|
2465
|
+
iocCode: string | null;
|
|
2466
|
+
hasPlayerStats: number;
|
|
2467
|
+
isActive: number;
|
|
2468
|
+
imageUrl: string | null;
|
|
2469
|
+
thumbnailUrl: string | null;
|
|
2470
|
+
olympicUrl: string | null;
|
|
2471
|
+
}
|
|
2472
|
+
/** One shift (or goal event) from `/shiftcharts` */
|
|
2473
|
+
interface ShiftChart {
|
|
2474
|
+
id: number;
|
|
2475
|
+
gameId: number;
|
|
2476
|
+
playerId: number;
|
|
2477
|
+
firstName: string;
|
|
2478
|
+
lastName: string;
|
|
2479
|
+
teamId: number;
|
|
2480
|
+
teamAbbrev: string;
|
|
2481
|
+
teamName: string;
|
|
2482
|
+
hexValue: string;
|
|
2483
|
+
period: number;
|
|
2484
|
+
shiftNumber: number;
|
|
2485
|
+
startTime: string;
|
|
2486
|
+
endTime: string;
|
|
2487
|
+
duration: string | null;
|
|
2488
|
+
/** 517 = shift, 505 = goal */
|
|
2489
|
+
typeCode: number;
|
|
2490
|
+
detailCode: number;
|
|
2491
|
+
eventNumber: number | null;
|
|
2492
|
+
eventDescription: string | null;
|
|
2493
|
+
eventDetails: string | null;
|
|
2494
|
+
}
|
|
2495
|
+
/** A stat definition from `/glossary` */
|
|
2496
|
+
interface GlossaryEntry {
|
|
2497
|
+
id: number;
|
|
2498
|
+
abbreviation: string;
|
|
2499
|
+
fullName: string;
|
|
2500
|
+
definition: string;
|
|
2501
|
+
firstSeasonForStat: number | null;
|
|
2502
|
+
languageCode: string;
|
|
2503
|
+
lastUpdated: string;
|
|
2504
|
+
}
|
|
2505
|
+
/**
|
|
2506
|
+
* Query parameters for Stats API list endpoints
|
|
2507
|
+
*/
|
|
2508
|
+
interface StatsQueryParams extends Record<string, unknown> {
|
|
2509
|
+
/**
|
|
2510
|
+
* Cayenne expression for filtering. Skater and goalie reports fail
|
|
2511
|
+
* (HTTP 500) without one, so the report functions send an empty
|
|
2512
|
+
* expression when none is given.
|
|
2513
|
+
*/
|
|
2514
|
+
cayenneExp?: string;
|
|
2515
|
+
/** Sort field, or a JSON array of `{property, direction}` */
|
|
2516
|
+
sort?: string;
|
|
2517
|
+
/** Sort direction: 'asc' or 'desc' */
|
|
2518
|
+
dir?: 'asc' | 'desc';
|
|
2519
|
+
/** Number of results to return; -1 returns all results */
|
|
2520
|
+
limit?: number;
|
|
2521
|
+
/** Starting index for pagination */
|
|
2522
|
+
start?: number;
|
|
2523
|
+
/** Include related data, e.g. 'logos' on teams */
|
|
2524
|
+
include?: string;
|
|
2525
|
+
/** Exclude certain fields */
|
|
2526
|
+
exclude?: string;
|
|
2527
|
+
/** Cayenne expression applied to the underlying facts (e.g. gamesPlayed>=10) */
|
|
2528
|
+
factCayenneExp?: string;
|
|
2529
|
+
/** Aggregate rows across seasons and teams */
|
|
2530
|
+
isAggregate?: boolean;
|
|
2531
|
+
/** Return one row per game */
|
|
2532
|
+
isGame?: boolean;
|
|
2533
|
+
}
|
|
2534
|
+
/** Convenience filters for the `getStatsWithFilters` functions */
|
|
2535
|
+
interface StatsFilters {
|
|
2536
|
+
seasonId?: string | number;
|
|
2537
|
+
gameTypeId?: number;
|
|
2538
|
+
playerId?: number;
|
|
2539
|
+
teamId?: number;
|
|
2540
|
+
/** Any other field, matched with equality */
|
|
2541
|
+
[key: string]: string | number | undefined;
|
|
2542
|
+
}
|
|
2543
|
+
/** Sorting for the `getStatsWithFilters` functions */
|
|
2544
|
+
interface StatsSorting {
|
|
2545
|
+
sortBy?: string;
|
|
2546
|
+
direction?: 'asc' | 'desc';
|
|
2547
|
+
}
|
|
2548
|
+
/** Pagination for the `getStatsWithFilters` functions */
|
|
2549
|
+
interface StatsPagination {
|
|
2550
|
+
limit?: number;
|
|
2551
|
+
start?: number;
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
/**
|
|
2555
|
+
* ======================================================================
|
|
2556
|
+
* NHL Stats API - Goalie Endpoints
|
|
2557
|
+
* Base URL: https://api.nhle.com/stats/rest
|
|
2558
|
+
* ======================================================================
|
|
2559
|
+
* Provides functions for retrieving goalie statistics and information
|
|
2560
|
+
* from the NHL Stats API.
|
|
2561
|
+
*/
|
|
2562
|
+
|
|
2563
|
+
/**
|
|
2564
|
+
* Get goalie leaders for a stat category
|
|
2565
|
+
*
|
|
2566
|
+
* Without a filter the leaders are all-time; filter by season with
|
|
2567
|
+
* `{ cayenneExp: 'season=20242025 and gameType=2' }`.
|
|
2568
|
+
*
|
|
2569
|
+
* @param statCategory - 'gaa', 'savePctg' or 'shutouts'
|
|
2570
|
+
* @param params - Query parameters (the endpoint ignores `limit`)
|
|
2571
|
+
* @param lang - Language code (default: configured language)
|
|
2572
|
+
* @returns Promise resolving to goalie leaders
|
|
2573
|
+
*
|
|
2574
|
+
* @example
|
|
2575
|
+
* const leaders = await stats.goalies.getLeaders('gaa', {
|
|
2576
|
+
* cayenneExp: 'season=20242025 and gameType=2',
|
|
2577
|
+
* });
|
|
2578
|
+
*/
|
|
2579
|
+
declare function getLeaders$1(statCategory: keyof typeof dataPaths.goalie.leaders, params?: StatsQueryParams, lang?: string): Promise<APIResultPaginated<GoalieLeader$1>>;
|
|
2580
|
+
/**
|
|
2581
|
+
* Get a goalie report
|
|
2582
|
+
*
|
|
2583
|
+
* @param report - The report name (default: 'summary')
|
|
2584
|
+
* @param params - Query parameters including cayenneExp for filtering
|
|
2585
|
+
* @param lang - Language code (default: configured language)
|
|
2586
|
+
* @returns Promise resolving to goalie statistics
|
|
2587
|
+
*
|
|
2588
|
+
* @example
|
|
2589
|
+
* const result = await stats.goalies.getStats('summary', {
|
|
2590
|
+
* cayenneExp: 'seasonId=20242025 and gameTypeId=2',
|
|
2591
|
+
* sort: 'wins',
|
|
2592
|
+
* dir: 'desc',
|
|
2593
|
+
* limit: 10,
|
|
2594
|
+
* });
|
|
2595
|
+
*/
|
|
2596
|
+
declare function getStats$2(report?: GoalieReport, params?: StatsQueryParams, lang?: string): Promise<APIResultPaginated<GoalieStats>>;
|
|
2597
|
+
/**
|
|
2598
|
+
* Get goalie stats with low-level query parameters
|
|
2599
|
+
* This is the most flexible approach - you build the query parameters yourself
|
|
2600
|
+
*
|
|
2601
|
+
* @param report - The report name (e.g., 'summary', 'advanced')
|
|
2602
|
+
* @param params - Query parameters including cayenneExp for filtering
|
|
2603
|
+
* @param lang - Language code (default: configured language)
|
|
2604
|
+
* @returns Promise resolving to goalie statistics
|
|
2605
|
+
*
|
|
2606
|
+
* @example
|
|
2607
|
+
* const result = await stats.goalies.getStatsWithParams('summary', {
|
|
2608
|
+
* cayenneExp: 'seasonId=20232024 and gameTypeId=2',
|
|
2609
|
+
* sort: 'wins',
|
|
2610
|
+
* limit: 10,
|
|
2611
|
+
* dir: 'desc',
|
|
2612
|
+
* });
|
|
2613
|
+
*/
|
|
2614
|
+
declare function getStatsWithParams$2(report: GoalieReport, params: StatsQueryParams, lang?: string): Promise<APIResultPaginated<GoalieStats>>;
|
|
2615
|
+
/**
|
|
2616
|
+
* Get goalie stats using a fluent query builder
|
|
2617
|
+
*
|
|
2618
|
+
* @param report - The report name (e.g., 'summary', 'advanced')
|
|
2619
|
+
* @param buildQuery - Function that receives a CayenneQueryBuilder and returns params
|
|
2620
|
+
* @param lang - Language code (default: configured language)
|
|
2621
|
+
* @returns Promise resolving to goalie statistics
|
|
2622
|
+
*
|
|
2623
|
+
* @example
|
|
2624
|
+
* const result = await stats.goalies.getStatsWithBuilder('summary', (q) => ({
|
|
2625
|
+
* cayenneExp: q.equals('seasonId', 20232024).equals('gameTypeId', 2).build(),
|
|
2626
|
+
* sort: 'wins',
|
|
2627
|
+
* limit: 10,
|
|
2628
|
+
* dir: 'desc' as const,
|
|
2629
|
+
* }));
|
|
2630
|
+
*/
|
|
2631
|
+
declare function getStatsWithBuilder$2(report: GoalieReport, buildQuery: (builder: CayenneQueryBuilder) => StatsQueryParams, lang?: string): Promise<APIResultPaginated<GoalieStats>>;
|
|
2632
|
+
/**
|
|
2633
|
+
* Get goalie stats with high-level convenience parameters
|
|
2634
|
+
* Every filter is matched with equality.
|
|
2635
|
+
*
|
|
2636
|
+
* @param report - The report name (e.g., 'summary', 'advanced')
|
|
2637
|
+
* @param filters - Field filters, e.g. `{ seasonId: 20232024, gameTypeId: 2 }`
|
|
2638
|
+
* @param sorting - Sorting options
|
|
2639
|
+
* @param pagination - Pagination options
|
|
2640
|
+
* @param lang - Language code (default: configured language)
|
|
2641
|
+
* @returns Promise resolving to goalie statistics
|
|
2642
|
+
*
|
|
2643
|
+
* @example
|
|
2644
|
+
* const result = await stats.goalies.getStatsWithFilters(
|
|
2645
|
+
* 'summary',
|
|
2646
|
+
* { seasonId: '20232024', gameTypeId: 2 },
|
|
2647
|
+
* { sortBy: 'wins', direction: 'desc' },
|
|
2648
|
+
* { limit: 10, start: 0 },
|
|
2649
|
+
* );
|
|
2650
|
+
*/
|
|
2651
|
+
declare function getStatsWithFilters$2(report: GoalieReport, filters?: StatsFilters, sorting?: StatsSorting, pagination?: StatsPagination, lang?: string): Promise<APIResultPaginated<GoalieStats>>;
|
|
2652
|
+
/**
|
|
2653
|
+
* Get active goalies approaching a career milestone
|
|
2654
|
+
*
|
|
2655
|
+
* @param lang - Language code (default: configured language)
|
|
2656
|
+
* @returns Promise resolving to goalie milestones
|
|
2657
|
+
*
|
|
2658
|
+
* @example
|
|
2659
|
+
* const milestones = await stats.goalies.getMilestones();
|
|
2660
|
+
*/
|
|
2661
|
+
declare function getMilestones$1(lang?: string): Promise<APIResultPaginated<GoalieMilestone>>;
|
|
2662
|
+
|
|
2663
|
+
declare namespace goalies {
|
|
2664
|
+
export { getLeaders$1 as getLeaders, getMilestones$1 as getMilestones, getStats$2 as getStats, getStatsWithBuilder$2 as getStatsWithBuilder, getStatsWithFilters$2 as getStatsWithFilters, getStatsWithParams$2 as getStatsWithParams };
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
/**
|
|
2668
|
+
* ======================================================================
|
|
2669
|
+
* NHL Stats API - Miscellaneous Endpoints
|
|
2670
|
+
* Base URL: https://api.nhle.com/stats/rest
|
|
2671
|
+
* ======================================================================
|
|
2672
|
+
* Provides functions for miscellaneous operations including configuration,
|
|
2673
|
+
* country information, shift charts, glossary, and content modules.
|
|
2674
|
+
*/
|
|
2675
|
+
|
|
2676
|
+
/**
|
|
2677
|
+
* Get configuration information
|
|
2678
|
+
*
|
|
2679
|
+
* @param lang - Language code (default: configured language)
|
|
2680
|
+
* @returns Promise resolving to configuration data
|
|
2681
|
+
*
|
|
2682
|
+
* @example
|
|
2683
|
+
* const config = await getConfig('en');
|
|
2684
|
+
*/
|
|
2685
|
+
declare function getConfig(lang?: string): Promise<APIResult<Config>>;
|
|
2686
|
+
/**
|
|
2687
|
+
* Get country information
|
|
2688
|
+
* Returns list of all countries with a hockey presence
|
|
2689
|
+
*
|
|
2690
|
+
* @param lang - Language code (default: configured language)
|
|
2691
|
+
* @returns Promise resolving to country data
|
|
2692
|
+
*
|
|
2693
|
+
* @example
|
|
2694
|
+
* const countries = await getCountries('en');
|
|
2695
|
+
*/
|
|
2696
|
+
declare function getCountries(lang?: string): Promise<APIResultPaginated<Country>>;
|
|
2697
|
+
/**
|
|
2698
|
+
* Get the glossary for a specific language
|
|
2699
|
+
*
|
|
2700
|
+
* @param lang - Language code (default: configured language)
|
|
2701
|
+
* @returns Promise resolving to glossary data
|
|
2702
|
+
*
|
|
2703
|
+
* @example
|
|
2704
|
+
* const glossary = await glossary.get('en');
|
|
2705
|
+
*/
|
|
2706
|
+
declare function getGlossary(lang?: string): Promise<APIResultPaginated<GlossaryEntry>>;
|
|
2707
|
+
/**
|
|
2708
|
+
* Get franchise information
|
|
2709
|
+
*
|
|
2710
|
+
* @param lang - Language code (default: configured language)
|
|
2711
|
+
* @returns Promise resolving to franchise data
|
|
2712
|
+
*
|
|
2713
|
+
* @example
|
|
2714
|
+
* const allFranchises = await getFranchises('en');
|
|
2715
|
+
*/
|
|
2716
|
+
declare function getFranchises(lang?: string): Promise<APIResultPaginated<Franchise>>;
|
|
201
2717
|
|
|
202
|
-
declare const
|
|
203
|
-
declare const
|
|
204
|
-
declare const
|
|
205
|
-
declare const
|
|
206
|
-
declare
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
declare const GameNumber$1: arktype_internal_variants_object_ts.ObjectType<(In: string | number) => arktype.Out<string>, {}>;
|
|
210
|
-
declare const DraftRound$1: arktype_internal_variants_object_ts.ObjectType<(In: string | number) => arktype.Out<string>, {}>;
|
|
211
|
-
declare const EventId$1: arktype.BaseType<number | ((In: string) => arktype_internal_attributes_ts.To<number>), {}>;
|
|
212
|
-
declare const GameId$1: arktype.BaseType<number | ((In: string) => arktype_internal_attributes_ts.To<number>), {}>;
|
|
213
|
-
declare const SeriesLetter$2: arktype_internal_variants_string_ts.StringType<"A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O", {}>;
|
|
214
|
-
declare const GameState$2: arktype_internal_variants_string_ts.StringType<"FUT" | "LIV" | "FIN", {}>;
|
|
215
|
-
declare const CountryCode$2: arktype_internal_variants_object_ts.ObjectType<(In: string) => arktype.Out<string>, {}>;
|
|
216
|
-
declare const PostalCode$1: arktype_internal_variants_string_ts.StringType<string, {}>;
|
|
217
|
-
declare const PlayerId$1: arktype_internal_variants_object_ts.ObjectType<(In: string | number) => arktype.Out<string>, {}>;
|
|
2718
|
+
declare const misc$1_getConfig: typeof getConfig;
|
|
2719
|
+
declare const misc$1_getCountries: typeof getCountries;
|
|
2720
|
+
declare const misc$1_getFranchises: typeof getFranchises;
|
|
2721
|
+
declare const misc$1_getGlossary: typeof getGlossary;
|
|
2722
|
+
declare namespace misc$1 {
|
|
2723
|
+
export { misc$1_getConfig as getConfig, misc$1_getCountries as getCountries, misc$1_getFranchises as getFranchises, misc$1_getGlossary as getGlossary };
|
|
2724
|
+
}
|
|
218
2725
|
|
|
219
2726
|
/**
|
|
220
|
-
*
|
|
2727
|
+
* ======================================================================
|
|
2728
|
+
* NHL Stats API - Season and Game Endpoints
|
|
2729
|
+
* Base URL: https://api.nhle.com/stats/rest
|
|
2730
|
+
* ======================================================================
|
|
2731
|
+
* Provides functions for retrieving season and game information
|
|
2732
|
+
* from the NHL Stats API.
|
|
221
2733
|
*/
|
|
222
|
-
|
|
2734
|
+
|
|
223
2735
|
/**
|
|
224
|
-
*
|
|
2736
|
+
* Get every season's settings (dates, game counts, rules in use)
|
|
2737
|
+
*
|
|
2738
|
+
* @param lang - Language code (default: configured language)
|
|
2739
|
+
* @returns Promise resolving to season data
|
|
2740
|
+
*
|
|
2741
|
+
* @example
|
|
2742
|
+
* const seasons = await stats.season.getSeasons();
|
|
225
2743
|
*/
|
|
226
|
-
|
|
2744
|
+
declare function getSeasons(lang?: string): Promise<APIResultPaginated<Season>>;
|
|
227
2745
|
/**
|
|
228
|
-
*
|
|
2746
|
+
* Get games
|
|
2747
|
+
*
|
|
2748
|
+
* Without a filter this downloads every game since 1917 (about 19 MB),
|
|
2749
|
+
* so filter by season or date.
|
|
2750
|
+
*
|
|
2751
|
+
* @param params - Query parameters, e.g. `{ cayenneExp: 'season=20242025 and gameType=2' }`
|
|
2752
|
+
* @param lang - Language code (default: configured language)
|
|
2753
|
+
* @returns Promise resolving to game data
|
|
2754
|
+
*
|
|
2755
|
+
* @example
|
|
2756
|
+
* const games = await stats.season.getGames({
|
|
2757
|
+
* cayenneExp: 'gameDate="2025-01-15"',
|
|
2758
|
+
* });
|
|
229
2759
|
*/
|
|
230
|
-
|
|
2760
|
+
declare function getGames(params?: StatsQueryParams, lang?: string): Promise<APIResultPaginated<Game$6>>;
|
|
231
2761
|
/**
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
* -
|
|
236
|
-
*
|
|
237
|
-
*
|
|
2762
|
+
* Get every shift (and goal event) of a game
|
|
2763
|
+
*
|
|
2764
|
+
* @param gameId - The game ID
|
|
2765
|
+
* @param lang - Language code (default: configured language)
|
|
2766
|
+
* @returns Promise resolving to shift chart data
|
|
2767
|
+
*
|
|
2768
|
+
* @example
|
|
2769
|
+
* const shifts = await stats.season.getShiftChart(2024020500);
|
|
238
2770
|
*/
|
|
239
|
-
|
|
2771
|
+
declare function getShiftChart(gameId: string | number, lang?: string): Promise<APIResultPaginated<ShiftChart>>;
|
|
240
2772
|
/**
|
|
241
|
-
*
|
|
2773
|
+
* Get the draft years and their number of rounds
|
|
2774
|
+
*
|
|
2775
|
+
* @param lang - Language code (default: configured language)
|
|
2776
|
+
* @returns Promise resolving to draft data
|
|
2777
|
+
*
|
|
2778
|
+
* @example
|
|
2779
|
+
* const drafts = await stats.season.getDraft();
|
|
242
2780
|
*/
|
|
243
|
-
|
|
2781
|
+
declare function getDraft(lang?: string): Promise<APIResultPaginated<Draft>>;
|
|
2782
|
+
|
|
2783
|
+
declare const seasonGame_getDraft: typeof getDraft;
|
|
2784
|
+
declare const seasonGame_getGames: typeof getGames;
|
|
2785
|
+
declare const seasonGame_getSeasons: typeof getSeasons;
|
|
2786
|
+
declare const seasonGame_getShiftChart: typeof getShiftChart;
|
|
2787
|
+
declare namespace seasonGame {
|
|
2788
|
+
export { seasonGame_getDraft as getDraft, seasonGame_getGames as getGames, seasonGame_getSeasons as getSeasons, seasonGame_getShiftChart as getShiftChart };
|
|
2789
|
+
}
|
|
2790
|
+
|
|
244
2791
|
/**
|
|
245
|
-
*
|
|
2792
|
+
* ======================================================================
|
|
2793
|
+
* NHL Stats API - Skater Endpoints
|
|
2794
|
+
* Base URL: https://api.nhle.com/stats/rest
|
|
2795
|
+
* ======================================================================
|
|
2796
|
+
* Provides functions for retrieving skater (player) statistics and information
|
|
2797
|
+
* from the NHL Stats API.
|
|
246
2798
|
*/
|
|
247
|
-
|
|
2799
|
+
|
|
248
2800
|
/**
|
|
249
|
-
*
|
|
2801
|
+
* Look up players (skaters and goalies)
|
|
2802
|
+
*
|
|
2803
|
+
* The endpoint returns nothing without a filter, so pass a `cayenneExp`.
|
|
2804
|
+
*
|
|
2805
|
+
* @param params - Query parameters, e.g. `{ cayenneExp: 'id=8478402' }`
|
|
2806
|
+
* @param lang - Language code (default: configured language)
|
|
2807
|
+
* @returns Promise resolving to matching players
|
|
2808
|
+
*
|
|
2809
|
+
* @example
|
|
2810
|
+
* const players = await stats.skaters.getPlayerInfo({
|
|
2811
|
+
* cayenneExp: 'lastName="McDavid"',
|
|
2812
|
+
* });
|
|
250
2813
|
*/
|
|
251
|
-
|
|
2814
|
+
declare function getPlayerInfo(params?: StatsQueryParams, lang?: string): Promise<APIResultPaginated<PlayerInfo>>;
|
|
252
2815
|
/**
|
|
253
|
-
*
|
|
2816
|
+
* Get skater leaders for a stat category
|
|
2817
|
+
*
|
|
2818
|
+
* Without a filter the leaders are all-time; filter by season with
|
|
2819
|
+
* `{ cayenneExp: 'season=20242025 and gameType=2' }`.
|
|
2820
|
+
*
|
|
2821
|
+
* @param statCategory - 'points', 'goals' or 'assists'
|
|
2822
|
+
* @param params - Query parameters (the endpoint ignores `limit`)
|
|
2823
|
+
* @param lang - Language code (default: configured language)
|
|
2824
|
+
* @returns Promise resolving to skater leaders
|
|
2825
|
+
*
|
|
2826
|
+
* @example
|
|
2827
|
+
* const leaders = await stats.skaters.getLeaders('points', {
|
|
2828
|
+
* cayenneExp: 'season=20242025 and gameType=2',
|
|
2829
|
+
* });
|
|
254
2830
|
*/
|
|
255
|
-
|
|
2831
|
+
declare function getLeaders(statCategory: keyof typeof dataPaths.skater.leaders, params?: StatsQueryParams, lang?: string): Promise<APIResultPaginated<SkaterLeader$1>>;
|
|
256
2832
|
/**
|
|
257
|
-
*
|
|
2833
|
+
* Get active skaters approaching a career milestone
|
|
2834
|
+
*
|
|
2835
|
+
* @param lang - Language code (default: configured language)
|
|
2836
|
+
* @returns Promise resolving to skater milestones
|
|
2837
|
+
*
|
|
2838
|
+
* @example
|
|
2839
|
+
* const milestones = await stats.skaters.getMilestones();
|
|
258
2840
|
*/
|
|
259
|
-
|
|
2841
|
+
declare function getMilestones(lang?: string): Promise<APIResultPaginated<SkaterMilestone>>;
|
|
260
2842
|
/**
|
|
261
|
-
*
|
|
2843
|
+
* Get a skater report
|
|
2844
|
+
*
|
|
2845
|
+
* @param report - The report name (default: 'summary')
|
|
2846
|
+
* @param params - Query parameters including cayenneExp for filtering
|
|
2847
|
+
* @param lang - Language code (default: configured language)
|
|
2848
|
+
* @returns Promise resolving to skater statistics
|
|
2849
|
+
*
|
|
2850
|
+
* @example
|
|
2851
|
+
* const result = await stats.skaters.getStats('summary', {
|
|
2852
|
+
* cayenneExp: 'seasonId=20242025 and gameTypeId=2',
|
|
2853
|
+
* sort: 'points',
|
|
2854
|
+
* dir: 'desc',
|
|
2855
|
+
* limit: 10,
|
|
2856
|
+
* });
|
|
262
2857
|
*/
|
|
263
|
-
|
|
2858
|
+
declare function getStats$1(report?: SkaterReport, params?: StatsQueryParams, lang?: string): Promise<APIResultPaginated<SkaterStats>>;
|
|
264
2859
|
/**
|
|
265
|
-
*
|
|
2860
|
+
* Get skater stats with low-level query parameters
|
|
2861
|
+
* This is the most flexible approach - you build the query parameters yourself
|
|
2862
|
+
*
|
|
2863
|
+
* @param report - The report name (e.g., 'summary', 'realtime')
|
|
2864
|
+
* @param params - Query parameters including cayenneExp for filtering
|
|
2865
|
+
* @param lang - Language code (default: configured language)
|
|
2866
|
+
* @returns Promise resolving to skater statistics
|
|
2867
|
+
*
|
|
2868
|
+
* @example
|
|
2869
|
+
* const result = await stats.skaters.getStatsWithParams('summary', {
|
|
2870
|
+
* cayenneExp: 'seasonId=20232024 and gameTypeId=2',
|
|
2871
|
+
* sort: 'points',
|
|
2872
|
+
* limit: 10,
|
|
2873
|
+
* dir: 'desc',
|
|
2874
|
+
* });
|
|
266
2875
|
*/
|
|
267
|
-
|
|
2876
|
+
declare function getStatsWithParams$1(report: SkaterReport, params: StatsQueryParams, lang?: string): Promise<APIResultPaginated<SkaterStats>>;
|
|
268
2877
|
/**
|
|
269
|
-
*
|
|
2878
|
+
* Get skater stats using a fluent query builder
|
|
2879
|
+
*
|
|
2880
|
+
* @param report - The report name (e.g., 'summary', 'realtime')
|
|
2881
|
+
* @param buildQuery - Function that receives a CayenneQueryBuilder and returns params
|
|
2882
|
+
* @param lang - Language code (default: configured language)
|
|
2883
|
+
* @returns Promise resolving to skater statistics
|
|
2884
|
+
*
|
|
2885
|
+
* @example
|
|
2886
|
+
* const result = await stats.skaters.getStatsWithBuilder('summary', (q) => ({
|
|
2887
|
+
* cayenneExp: q.equals('seasonId', 20232024).equals('gameTypeId', 2).build(),
|
|
2888
|
+
* sort: 'points',
|
|
2889
|
+
* limit: 10,
|
|
2890
|
+
* dir: 'desc' as const,
|
|
2891
|
+
* }));
|
|
270
2892
|
*/
|
|
271
|
-
|
|
2893
|
+
declare function getStatsWithBuilder$1(report: SkaterReport, buildQuery: (builder: CayenneQueryBuilder) => StatsQueryParams, lang?: string): Promise<APIResultPaginated<SkaterStats>>;
|
|
272
2894
|
/**
|
|
273
|
-
*
|
|
2895
|
+
* Get skater stats with high-level convenience parameters
|
|
2896
|
+
* Every filter is matched with equality.
|
|
2897
|
+
*
|
|
2898
|
+
* @param report - The report name (e.g., 'summary', 'realtime')
|
|
2899
|
+
* @param filters - Field filters, e.g. `{ seasonId: 20232024, gameTypeId: 2 }`
|
|
2900
|
+
* @param sorting - Sorting options
|
|
2901
|
+
* @param pagination - Pagination options
|
|
2902
|
+
* @param lang - Language code (default: configured language)
|
|
2903
|
+
* @returns Promise resolving to skater statistics
|
|
2904
|
+
*
|
|
2905
|
+
* @example
|
|
2906
|
+
* const result = await stats.skaters.getStatsWithFilters(
|
|
2907
|
+
* 'summary',
|
|
2908
|
+
* { seasonId: '20232024', gameTypeId: 2 },
|
|
2909
|
+
* { sortBy: 'points', direction: 'desc' },
|
|
2910
|
+
* { limit: 10, start: 0 },
|
|
2911
|
+
* );
|
|
274
2912
|
*/
|
|
275
|
-
|
|
2913
|
+
declare function getStatsWithFilters$1(report: SkaterReport, filters?: StatsFilters, sorting?: StatsSorting, pagination?: StatsPagination, lang?: string): Promise<APIResultPaginated<SkaterStats>>;
|
|
2914
|
+
|
|
2915
|
+
declare const skaters_getLeaders: typeof getLeaders;
|
|
2916
|
+
declare const skaters_getMilestones: typeof getMilestones;
|
|
2917
|
+
declare const skaters_getPlayerInfo: typeof getPlayerInfo;
|
|
2918
|
+
declare namespace skaters {
|
|
2919
|
+
export { skaters_getLeaders as getLeaders, skaters_getMilestones as getMilestones, skaters_getPlayerInfo as getPlayerInfo, getStats$1 as getStats, getStatsWithBuilder$1 as getStatsWithBuilder, getStatsWithFilters$1 as getStatsWithFilters, getStatsWithParams$1 as getStatsWithParams };
|
|
2920
|
+
}
|
|
2921
|
+
|
|
276
2922
|
/**
|
|
277
|
-
*
|
|
2923
|
+
* ======================================================================
|
|
2924
|
+
* NHL Stats API - Team Endpoints
|
|
2925
|
+
* Base URL: https://api.nhle.com/stats/rest
|
|
2926
|
+
* ======================================================================
|
|
2927
|
+
* Provides functions for retrieving team statistics and information
|
|
2928
|
+
* from the NHL Stats API.
|
|
278
2929
|
*/
|
|
279
|
-
|
|
2930
|
+
|
|
280
2931
|
/**
|
|
281
|
-
*
|
|
2932
|
+
* Get every team, past and present
|
|
2933
|
+
*
|
|
2934
|
+
* @param params - Query parameters, e.g. `{ include: 'logos' }`
|
|
2935
|
+
* @param lang - Language code (default: configured language)
|
|
2936
|
+
* @returns Promise resolving to the team list
|
|
2937
|
+
*
|
|
2938
|
+
* @example
|
|
2939
|
+
* const allTeams = await stats.teams.getAll();
|
|
282
2940
|
*/
|
|
283
|
-
|
|
2941
|
+
declare function getAll(params?: StatsQueryParams, lang?: string): Promise<APIResultPaginated<Team$b>>;
|
|
284
2942
|
/**
|
|
285
|
-
*
|
|
2943
|
+
* Get a team by ID
|
|
2944
|
+
*
|
|
2945
|
+
* The API answers with a one-row list.
|
|
2946
|
+
*
|
|
2947
|
+
* @param teamId - The team ID
|
|
2948
|
+
* @param params - Query parameters, e.g. `{ include: 'logos' }`
|
|
2949
|
+
* @param lang - Language code (default: configured language)
|
|
2950
|
+
* @returns Promise resolving to a list holding the team
|
|
2951
|
+
*
|
|
2952
|
+
* @example
|
|
2953
|
+
* const result = await stats.teams.getById(10);
|
|
2954
|
+
* if (result.success) console.log(result.data.data[0]?.fullName);
|
|
286
2955
|
*/
|
|
287
|
-
|
|
2956
|
+
declare function getById(teamId: number, params?: StatsQueryParams, lang?: string): Promise<APIResultPaginated<Team$b>>;
|
|
288
2957
|
/**
|
|
289
|
-
*
|
|
2958
|
+
* Get a team report
|
|
2959
|
+
*
|
|
2960
|
+
* @param report - The report name (default: 'summary')
|
|
2961
|
+
* @param params - Query parameters including cayenneExp for filtering
|
|
2962
|
+
* @param lang - Language code (default: configured language)
|
|
2963
|
+
* @returns Promise resolving to team statistics
|
|
2964
|
+
*
|
|
2965
|
+
* @example
|
|
2966
|
+
* const result = await stats.teams.getStats('summary', {
|
|
2967
|
+
* cayenneExp: 'seasonId=20242025 and gameTypeId=2',
|
|
2968
|
+
* sort: 'points',
|
|
2969
|
+
* dir: 'desc',
|
|
2970
|
+
* });
|
|
290
2971
|
*/
|
|
291
|
-
|
|
2972
|
+
declare function getStats(report?: TeamReport, params?: StatsQueryParams, lang?: string): Promise<APIResultPaginated<TeamStats$1>>;
|
|
292
2973
|
/**
|
|
293
|
-
*
|
|
2974
|
+
* Get team stats with low-level query parameters
|
|
2975
|
+
* This is the most flexible approach - you build the query parameters yourself
|
|
2976
|
+
*
|
|
2977
|
+
* @param report - The report name (e.g., 'summary', 'powerplay')
|
|
2978
|
+
* @param params - Query parameters including cayenneExp for filtering
|
|
2979
|
+
* @param lang - Language code (default: configured language)
|
|
2980
|
+
* @returns Promise resolving to team statistics
|
|
2981
|
+
*
|
|
2982
|
+
* @example
|
|
2983
|
+
* const result = await stats.teams.getStatsWithParams('summary', {
|
|
2984
|
+
* cayenneExp: 'seasonId=20232024 and gameTypeId=2',
|
|
2985
|
+
* sort: 'shotsForPerGame',
|
|
2986
|
+
* });
|
|
294
2987
|
*/
|
|
295
|
-
|
|
296
|
-
type ShotLocationCategory = keyof typeof ShotLocationCategoryEnum;
|
|
297
|
-
/** Sort options for shot location top-10 list */
|
|
298
|
-
type ShotLocationSort = keyof typeof ShotLocationSortEnum;
|
|
299
|
-
/** Sort options for 5v5 save percentage top-10 list */
|
|
300
|
-
type SavePercentage5v5Sort = keyof typeof SavePercentage5v5SortEnum;
|
|
301
|
-
/** Sort options for save percentage top-10 list */
|
|
302
|
-
type SavePercentageSort = keyof typeof SavePercentageSortEnum;
|
|
303
|
-
/** Categories for save location top-10 list */
|
|
304
|
-
type SaveLocationCategory = keyof typeof SaveLocationCategoryEnum;
|
|
305
|
-
/** Sort options for save location top-10 list */
|
|
306
|
-
type SaveLocationSort = keyof typeof SaveLocationSortEnum;
|
|
307
|
-
/** Positions filter for player stats */
|
|
308
|
-
type PositionFilter = keyof typeof PositionFilterEnum;
|
|
309
|
-
/** Strength situation for skater stats */
|
|
310
|
-
type SkatersStrength = keyof typeof SkatersStrengthEnum;
|
|
311
|
-
/** Sort options for shot speed top-10 list */
|
|
312
|
-
type ShotSpeedSort = keyof typeof ShotSpeedSortEnum;
|
|
313
|
-
/** Sort options for skating speed top-10 list */
|
|
314
|
-
type SkatingSpeedSort = keyof typeof SkatingSpeedSortEnum;
|
|
315
|
-
/** Sort options for skating distance top-10 list */
|
|
316
|
-
type SkatingDistanceSort = keyof typeof SkatingDistanceSortEnum;
|
|
317
|
-
/** Sort options for zone time top-10 lists. */
|
|
318
|
-
type ZoneTimeSort = keyof typeof ZoneTimeSortEnum;
|
|
319
|
-
|
|
2988
|
+
declare function getStatsWithParams(report: TeamReport, params: StatsQueryParams, lang?: string): Promise<APIResultPaginated<TeamStats$1>>;
|
|
320
2989
|
/**
|
|
321
|
-
*
|
|
2990
|
+
* Get team stats using a fluent query builder
|
|
2991
|
+
*
|
|
2992
|
+
* @param report - The report name (e.g., 'summary', 'powerplay')
|
|
2993
|
+
* @param buildQuery - Function that receives a CayenneQueryBuilder and returns params
|
|
2994
|
+
* @param lang - Language code (default: configured language)
|
|
2995
|
+
* @returns Promise resolving to team statistics
|
|
2996
|
+
*
|
|
2997
|
+
* @example
|
|
2998
|
+
* const result = await stats.teams.getStatsWithBuilder('summary', (q) => ({
|
|
2999
|
+
* cayenneExp: q.equals('seasonId', 20232024).equals('gameTypeId', 2).build(),
|
|
3000
|
+
* sort: 'shotsForPerGame',
|
|
3001
|
+
* limit: 10,
|
|
3002
|
+
* dir: 'desc' as const,
|
|
3003
|
+
* }));
|
|
322
3004
|
*/
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
/** Default */
|
|
354
|
-
default: string;
|
|
355
|
-
/** French */
|
|
356
|
-
fr?: string;
|
|
357
|
-
/** Czech */
|
|
358
|
-
cs?: string;
|
|
359
|
-
/** German */
|
|
360
|
-
de?: string;
|
|
361
|
-
/** Spanish */
|
|
362
|
-
es?: string;
|
|
363
|
-
/** Finnish */
|
|
364
|
-
fi?: string;
|
|
365
|
-
/** Slovak */
|
|
366
|
-
sk?: string;
|
|
367
|
-
/** Swedish */
|
|
368
|
-
sv?: string;
|
|
3005
|
+
declare function getStatsWithBuilder(report: TeamReport, buildQuery: (builder: CayenneQueryBuilder) => StatsQueryParams, lang?: string): Promise<APIResultPaginated<TeamStats$1>>;
|
|
3006
|
+
/**
|
|
3007
|
+
* Get team stats with high-level convenience parameters
|
|
3008
|
+
* Every filter is matched with equality.
|
|
3009
|
+
*
|
|
3010
|
+
* @param report - The report name (e.g., 'summary', 'powerplay')
|
|
3011
|
+
* @param filters - Field filters, e.g. `{ seasonId: 20232024, gameTypeId: 2 }`
|
|
3012
|
+
* @param sorting - Sorting options
|
|
3013
|
+
* @param pagination - Pagination options
|
|
3014
|
+
* @param lang - Language code (default: configured language)
|
|
3015
|
+
* @returns Promise resolving to team statistics
|
|
3016
|
+
*
|
|
3017
|
+
* @example
|
|
3018
|
+
* const result = await stats.teams.getStatsWithFilters(
|
|
3019
|
+
* 'summary',
|
|
3020
|
+
* { seasonId: '20232024', gameTypeId: 2 },
|
|
3021
|
+
* { sortBy: 'shotsForPerGame', direction: 'desc' },
|
|
3022
|
+
* { limit: 10, start: 0 },
|
|
3023
|
+
* );
|
|
3024
|
+
*/
|
|
3025
|
+
declare function getStatsWithFilters(report: TeamReport, filters?: StatsFilters, sorting?: StatsSorting, pagination?: StatsPagination, lang?: string): Promise<APIResultPaginated<TeamStats$1>>;
|
|
3026
|
+
|
|
3027
|
+
declare const teams_getAll: typeof getAll;
|
|
3028
|
+
declare const teams_getById: typeof getById;
|
|
3029
|
+
declare const teams_getStats: typeof getStats;
|
|
3030
|
+
declare const teams_getStatsWithBuilder: typeof getStatsWithBuilder;
|
|
3031
|
+
declare const teams_getStatsWithFilters: typeof getStatsWithFilters;
|
|
3032
|
+
declare const teams_getStatsWithParams: typeof getStatsWithParams;
|
|
3033
|
+
declare namespace teams {
|
|
3034
|
+
export { teams_getAll as getAll, teams_getById as getById, teams_getStats as getStats, teams_getStatsWithBuilder as getStatsWithBuilder, teams_getStatsWithFilters as getStatsWithFilters, teams_getStatsWithParams as getStatsWithParams };
|
|
369
3035
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
3036
|
+
|
|
3037
|
+
/**
|
|
3038
|
+
* ======================================================================
|
|
3039
|
+
* NHL Stats API Module Exports
|
|
3040
|
+
* Base URL: https://api.nhle.com/stats/rest
|
|
3041
|
+
* ======================================================================
|
|
3042
|
+
* Complete NHL Stats API implementation with modules for:
|
|
3043
|
+
* - Players (skaters, goalies, draft info)
|
|
3044
|
+
* - Teams and franchises
|
|
3045
|
+
* - Seasons and games
|
|
3046
|
+
* - Miscellaneous (config, shifts, glossary, etc.)
|
|
3047
|
+
*/
|
|
3048
|
+
|
|
3049
|
+
type index$1_APIResultPaginated<T> = APIResultPaginated<T>;
|
|
3050
|
+
type index$1_Config = Config;
|
|
3051
|
+
type index$1_Country = Country;
|
|
3052
|
+
type index$1_Draft = Draft;
|
|
3053
|
+
type index$1_Franchise = Franchise;
|
|
3054
|
+
type index$1_GlossaryEntry = GlossaryEntry;
|
|
3055
|
+
type index$1_GoalieMilestone = GoalieMilestone;
|
|
3056
|
+
type index$1_GoalieReport = GoalieReport;
|
|
3057
|
+
type index$1_GoalieStats = GoalieStats;
|
|
3058
|
+
type index$1_PaginatedData<T> = PaginatedData<T>;
|
|
3059
|
+
type index$1_PlayerInfo = PlayerInfo;
|
|
3060
|
+
type index$1_Season = Season;
|
|
3061
|
+
type index$1_ShiftChart = ShiftChart;
|
|
3062
|
+
type index$1_SkaterMilestone = SkaterMilestone;
|
|
3063
|
+
type index$1_SkaterReport = SkaterReport;
|
|
3064
|
+
type index$1_SkaterStats = SkaterStats;
|
|
3065
|
+
type index$1_StatsFilters = StatsFilters;
|
|
3066
|
+
type index$1_StatsPagination = StatsPagination;
|
|
3067
|
+
type index$1_StatsQueryParams = StatsQueryParams;
|
|
3068
|
+
type index$1_StatsSorting = StatsSorting;
|
|
3069
|
+
type index$1_TeamLogo = TeamLogo;
|
|
3070
|
+
type index$1_TeamReport = TeamReport;
|
|
3071
|
+
type index$1_TeamStatsWithFranchise = TeamStatsWithFranchise;
|
|
3072
|
+
declare const index$1_goalies: typeof goalies;
|
|
3073
|
+
declare const index$1_skaters: typeof skaters;
|
|
3074
|
+
declare const index$1_teams: typeof teams;
|
|
3075
|
+
declare namespace index$1 {
|
|
3076
|
+
export { type index$1_APIResultPaginated as APIResultPaginated, type index$1_Config as Config, type index$1_Country as Country, type index$1_Draft as Draft, type index$1_Franchise as Franchise, type Game$6 as Game, type index$1_GlossaryEntry as GlossaryEntry, type GoalieLeader$1 as GoalieLeader, type index$1_GoalieMilestone as GoalieMilestone, type index$1_GoalieReport as GoalieReport, type index$1_GoalieStats as GoalieStats, type index$1_PaginatedData as PaginatedData, type index$1_PlayerInfo as PlayerInfo, type index$1_Season as Season, type index$1_ShiftChart as ShiftChart, type SkaterLeader$1 as SkaterLeader, type index$1_SkaterMilestone as SkaterMilestone, type index$1_SkaterReport as SkaterReport, type index$1_SkaterStats as SkaterStats, type index$1_StatsFilters as StatsFilters, type index$1_StatsPagination as StatsPagination, type index$1_StatsQueryParams as StatsQueryParams, type index$1_StatsSorting as StatsSorting, type Team$b as Team, type index$1_TeamLogo as TeamLogo, type index$1_TeamReport as TeamReport, type TeamStats$1 as TeamStats, type index$1_TeamStatsWithFranchise as TeamStatsWithFranchise, index$1_goalies as goalies, misc$1 as misc, seasonGame as season, index$1_skaters as skaters, index$1_teams as teams };
|
|
376
3077
|
}
|
|
377
3078
|
|
|
378
3079
|
interface GamecenterBoxscore {
|
|
@@ -387,7 +3088,7 @@ interface GamecenterBoxscore {
|
|
|
387
3088
|
easternUTCOffset: UTCOffset;
|
|
388
3089
|
venueUTCOffset: UTCOffset;
|
|
389
3090
|
tvBroadcasts: TvBroadcast[];
|
|
390
|
-
gameState: GameState;
|
|
3091
|
+
gameState: GameState$2;
|
|
391
3092
|
gameScheduleState: GameScheduleState;
|
|
392
3093
|
periodDescriptor?: PeriodDescriptor$9;
|
|
393
3094
|
regPeriods: number;
|
|
@@ -601,7 +3302,7 @@ interface GamecenterLanding {
|
|
|
601
3302
|
venueTimezone: string;
|
|
602
3303
|
periodDescriptor?: PeriodDescriptor$8;
|
|
603
3304
|
tvBroadcasts: TvBroadcast[];
|
|
604
|
-
gameState: GameState;
|
|
3305
|
+
gameState: GameState$2;
|
|
605
3306
|
gameScheduleState: GameScheduleState;
|
|
606
3307
|
awayTeam: LandingTeam;
|
|
607
3308
|
homeTeam: LandingTeam;
|
|
@@ -871,7 +3572,7 @@ interface ThreeStar$1 {
|
|
|
871
3572
|
savePctg?: number;
|
|
872
3573
|
}
|
|
873
3574
|
|
|
874
|
-
type NHLSeasons = Array<Season>;
|
|
3575
|
+
type NHLSeasons = Array<Season$1>;
|
|
875
3576
|
interface PlayoffSeriesMeta {
|
|
876
3577
|
seriesTitle: string;
|
|
877
3578
|
teams: Teams;
|
|
@@ -970,7 +3671,7 @@ interface GamecenterPlayByPlay {
|
|
|
970
3671
|
easternUTCOffset: UTCOffset;
|
|
971
3672
|
venueUTCOffset: UTCOffset;
|
|
972
3673
|
tvBroadcasts: TvBroadcast[];
|
|
973
|
-
gameState: GameState;
|
|
3674
|
+
gameState: GameState$2;
|
|
974
3675
|
gameScheduleState: GameScheduleState;
|
|
975
3676
|
periodDescriptor?: PeriodDescriptor$7;
|
|
976
3677
|
awayTeam: Team$7;
|
|
@@ -1060,7 +3761,7 @@ interface RosterSpot {
|
|
|
1060
3761
|
firstName: LocalizedText;
|
|
1061
3762
|
lastName: LocalizedText;
|
|
1062
3763
|
sweaterNumber: number;
|
|
1063
|
-
positionCode:
|
|
3764
|
+
positionCode: PositionCode;
|
|
1064
3765
|
headshot: string;
|
|
1065
3766
|
}
|
|
1066
3767
|
interface Situation {
|
|
@@ -1104,7 +3805,7 @@ interface PenaltyBoxElement {
|
|
|
1104
3805
|
playerId: number;
|
|
1105
3806
|
name: LocalizedText;
|
|
1106
3807
|
sweaterNumber: number;
|
|
1107
|
-
positionCode:
|
|
3808
|
+
positionCode: PositionCode;
|
|
1108
3809
|
headshot: string;
|
|
1109
3810
|
totalSOI?: number;
|
|
1110
3811
|
secondsRemaining?: number;
|
|
@@ -1113,7 +3814,7 @@ interface GoalieElement {
|
|
|
1113
3814
|
playerId: number;
|
|
1114
3815
|
name: LocalizedText;
|
|
1115
3816
|
sweaterNumber: number;
|
|
1116
|
-
positionCode:
|
|
3817
|
+
positionCode: PositionCode;
|
|
1117
3818
|
headshot: string;
|
|
1118
3819
|
totalSOI?: number;
|
|
1119
3820
|
}
|
|
@@ -1135,7 +3836,7 @@ interface PurpleForward {
|
|
|
1135
3836
|
playerId: number;
|
|
1136
3837
|
name: LocalizedText;
|
|
1137
3838
|
sweaterNumber: number;
|
|
1138
|
-
positionCode:
|
|
3839
|
+
positionCode: PositionCode;
|
|
1139
3840
|
headshot: string;
|
|
1140
3841
|
totalSOI?: number;
|
|
1141
3842
|
}
|
|
@@ -1144,7 +3845,7 @@ interface PlayerSpotlight {
|
|
|
1144
3845
|
playerId: number;
|
|
1145
3846
|
name: LocalizedText;
|
|
1146
3847
|
playerSlug: string;
|
|
1147
|
-
position:
|
|
3848
|
+
position: PositionCode;
|
|
1148
3849
|
sweaterNumber: number;
|
|
1149
3850
|
teamId: number;
|
|
1150
3851
|
headshot: string;
|
|
@@ -1159,7 +3860,7 @@ interface PlayerLanding {
|
|
|
1159
3860
|
lastName: LocalizedText;
|
|
1160
3861
|
badges: Badge[];
|
|
1161
3862
|
sweaterNumber: number;
|
|
1162
|
-
position:
|
|
3863
|
+
position: PositionCode;
|
|
1163
3864
|
headshot: string;
|
|
1164
3865
|
heroImage: string;
|
|
1165
3866
|
heightInInches: number;
|
|
@@ -1170,7 +3871,7 @@ interface PlayerLanding {
|
|
|
1170
3871
|
birthCity: LocalizedText;
|
|
1171
3872
|
birthStateProvince?: LocalizedText;
|
|
1172
3873
|
birthCountry: string;
|
|
1173
|
-
shootsCatches:
|
|
3874
|
+
shootsCatches: ShootsCatches;
|
|
1174
3875
|
draftDetails?: DraftDetails;
|
|
1175
3876
|
playerSlug: string;
|
|
1176
3877
|
inTop100AllTime: number;
|
|
@@ -1562,7 +4263,7 @@ interface BasePPTReplay {
|
|
|
1562
4263
|
gameDate: string;
|
|
1563
4264
|
awayTeam: Team$5;
|
|
1564
4265
|
homeTeam: Team$5;
|
|
1565
|
-
gameState: GameState;
|
|
4266
|
+
gameState: GameState$2;
|
|
1566
4267
|
gameType: number;
|
|
1567
4268
|
}
|
|
1568
4269
|
interface Team$5 {
|
|
@@ -1719,7 +4420,7 @@ interface SeasonSeriesGame {
|
|
|
1719
4420
|
startTimeUTC: string;
|
|
1720
4421
|
easternUTCOffset: UTCOffset;
|
|
1721
4422
|
venueUTCOffset: UTCOffset;
|
|
1722
|
-
gameState: GameState;
|
|
4423
|
+
gameState: GameState$2;
|
|
1723
4424
|
gameScheduleState: GameScheduleState;
|
|
1724
4425
|
awayTeam: TeamDetail;
|
|
1725
4426
|
homeTeam: TeamDetail;
|
|
@@ -1797,7 +4498,7 @@ interface Game$3 {
|
|
|
1797
4498
|
easternUTCOffset: UTCOffset;
|
|
1798
4499
|
venueUTCOffset: UTCOffset;
|
|
1799
4500
|
venueTimezone: string;
|
|
1800
|
-
gameState: GameState;
|
|
4501
|
+
gameState: GameState$2;
|
|
1801
4502
|
gameScheduleState: GameScheduleState;
|
|
1802
4503
|
tvBroadcasts: TvBroadcast[];
|
|
1803
4504
|
awayTeam: Team$4;
|
|
@@ -1902,7 +4603,7 @@ interface Game$2 {
|
|
|
1902
4603
|
easternUTCOffset: UTCOffset;
|
|
1903
4604
|
venueUTCOffset: UTCOffset;
|
|
1904
4605
|
tvBroadcasts: TvBroadcast[];
|
|
1905
|
-
gameState: GameState;
|
|
4606
|
+
gameState: GameState$2;
|
|
1906
4607
|
gameScheduleState: GameScheduleState;
|
|
1907
4608
|
awayTeam: Team$3;
|
|
1908
4609
|
homeTeam: Team$3;
|
|
@@ -1968,7 +4669,7 @@ interface Game$1 {
|
|
|
1968
4669
|
easternUTCOffset: UTCOffset;
|
|
1969
4670
|
venueUTCOffset: UTCOffset;
|
|
1970
4671
|
tvBroadcasts: TvBroadcast[];
|
|
1971
|
-
gameState: GameState;
|
|
4672
|
+
gameState: GameState$2;
|
|
1972
4673
|
gameScheduleState: GameScheduleState;
|
|
1973
4674
|
awayTeam: Team$2;
|
|
1974
4675
|
homeTeam: Team$2;
|
|
@@ -2140,7 +4841,7 @@ interface Goalie$3 extends BaseProspect {
|
|
|
2140
4841
|
positionCode: 'G';
|
|
2141
4842
|
}
|
|
2142
4843
|
|
|
2143
|
-
type TeamRosterSeasons = Array<Season>;
|
|
4844
|
+
type TeamRosterSeasons = Array<Season$1>;
|
|
2144
4845
|
interface TeamRoster {
|
|
2145
4846
|
forwards: Forward[];
|
|
2146
4847
|
defensemen: Defenseman[];
|
|
@@ -2208,7 +4909,7 @@ interface Game {
|
|
|
2208
4909
|
easternUTCOffset: string;
|
|
2209
4910
|
venueUTCOffset: string;
|
|
2210
4911
|
venueTimezone: string;
|
|
2211
|
-
gameState: GameState;
|
|
4912
|
+
gameState: GameState$2;
|
|
2212
4913
|
gameScheduleState: GameScheduleState;
|
|
2213
4914
|
tvBroadcasts: TvBroadcast[];
|
|
2214
4915
|
awayTeam: Team$1;
|
|
@@ -2278,7 +4979,7 @@ interface WinningGoal {
|
|
|
2278
4979
|
lastName: LocalizedText;
|
|
2279
4980
|
}
|
|
2280
4981
|
interface AlternateBroadcast {
|
|
2281
|
-
country: CountryCode;
|
|
4982
|
+
country: CountryCode$2;
|
|
2282
4983
|
descriptions: LocalizedText[];
|
|
2283
4984
|
}
|
|
2284
4985
|
|
|
@@ -2367,7 +5068,7 @@ interface WSCGameStory {
|
|
|
2367
5068
|
venueUTCOffset: UTCOffset;
|
|
2368
5069
|
venueTimezone: string;
|
|
2369
5070
|
tvBroadcasts: TvBroadcast[];
|
|
2370
|
-
gameState: GameState;
|
|
5071
|
+
gameState: GameState$2;
|
|
2371
5072
|
gameScheduleState: 'OK';
|
|
2372
5073
|
awayTeam: Team;
|
|
2373
5074
|
homeTeam: Team;
|
|
@@ -2613,7 +5314,7 @@ type PlayerSearchResult = Record<string, unknown>;
|
|
|
2613
5314
|
* picks(2023, 1).then((data) => console.log(data));
|
|
2614
5315
|
* ```
|
|
2615
5316
|
*/
|
|
2616
|
-
declare function picks(year?: Year, round?: DraftRound): Promise<
|
|
5317
|
+
declare function picks(year?: Year, round?: DraftRound): Promise<APIResult<DraftPicks>>;
|
|
2617
5318
|
/**
|
|
2618
5319
|
* Get current draft tracker information for live draft coverage
|
|
2619
5320
|
* @returns Promise resolving to current draft tracker data, including live pick information
|
|
@@ -2622,7 +5323,7 @@ declare function picks(year?: Year, round?: DraftRound): Promise<APIResponse<Dra
|
|
|
2622
5323
|
* tracker().then((data) => console.log(data));
|
|
2623
5324
|
* ```
|
|
2624
5325
|
*/
|
|
2625
|
-
declare function tracker(): Promise<
|
|
5326
|
+
declare function tracker(): Promise<APIResult<DraftTracker>>;
|
|
2626
5327
|
/**
|
|
2627
5328
|
* Access draft rankings by category (skaters/goalies, NA/International)
|
|
2628
5329
|
* @param year - The draft year (defaults to current year if not provided)
|
|
@@ -2637,11 +5338,11 @@ declare function tracker(): Promise<APIResponse<DraftTracker>>;
|
|
|
2637
5338
|
* ```
|
|
2638
5339
|
*/
|
|
2639
5340
|
declare function rankings(year?: Year): {
|
|
2640
|
-
skatersNA: () => Promise<
|
|
2641
|
-
skatersIntl: () => Promise<
|
|
2642
|
-
goaliesNA: () => Promise<
|
|
2643
|
-
goaliesIntl: () => Promise<
|
|
2644
|
-
all: () => Promise<
|
|
5341
|
+
skatersNA: () => Promise<APIResult<DraftRankings>>;
|
|
5342
|
+
skatersIntl: () => Promise<APIResult<DraftRankings>>;
|
|
5343
|
+
goaliesNA: () => Promise<APIResult<DraftRankings>>;
|
|
5344
|
+
goaliesIntl: () => Promise<APIResult<DraftRankings>>;
|
|
5345
|
+
all: () => Promise<APIResult<DraftRankings[]>>;
|
|
2645
5346
|
};
|
|
2646
5347
|
|
|
2647
5348
|
declare const draft_picks: typeof picks;
|
|
@@ -2660,7 +5361,7 @@ declare namespace draft {
|
|
|
2660
5361
|
* playByPlay(2023020001).then((data) => console.log(data));
|
|
2661
5362
|
* ```
|
|
2662
5363
|
*/
|
|
2663
|
-
declare function playByPlay(gameId: GameId): Promise<
|
|
5364
|
+
declare function playByPlay(gameId: GameId): Promise<APIResult<GamecenterPlayByPlay>>;
|
|
2664
5365
|
/**
|
|
2665
5366
|
* Get comprehensive game data including stats, reports, and game information
|
|
2666
5367
|
*
|
|
@@ -2691,7 +5392,7 @@ declare function playByPlay(gameId: GameId): Promise<APIResponse<GamecenterPlayB
|
|
|
2691
5392
|
* reports(2023020001).then((data) => console.log(data));
|
|
2692
5393
|
* ```
|
|
2693
5394
|
*/
|
|
2694
|
-
declare function reports(gameId: GameId): Promise<
|
|
5395
|
+
declare function reports(gameId: GameId): Promise<APIResult<GamecenterReports>>;
|
|
2695
5396
|
/**
|
|
2696
5397
|
* Get landing page data for a specific game
|
|
2697
5398
|
* @param gameId - The unique identifier for the game (10-digit format)
|
|
@@ -2701,7 +5402,7 @@ declare function reports(gameId: GameId): Promise<APIResponse<GamecenterReports>
|
|
|
2701
5402
|
* landing(2023020001).then((data) => console.log(data));
|
|
2702
5403
|
* ```
|
|
2703
5404
|
*/
|
|
2704
|
-
declare function landing$1(gameId: GameId): Promise<
|
|
5405
|
+
declare function landing$1(gameId: GameId): Promise<APIResult<GamecenterLanding>>;
|
|
2705
5406
|
/**
|
|
2706
5407
|
* Get boxscore data for a specific game
|
|
2707
5408
|
* @param gameId - The unique identifier for the game (10-digit format)
|
|
@@ -2711,7 +5412,7 @@ declare function landing$1(gameId: GameId): Promise<APIResponse<GamecenterLandin
|
|
|
2711
5412
|
* boxscore(2023020001).then((data) => console.log(data));
|
|
2712
5413
|
* ```
|
|
2713
5414
|
*/
|
|
2714
|
-
declare function boxscore(gameId: GameId): Promise<
|
|
5415
|
+
declare function boxscore(gameId: GameId): Promise<APIResult<GamecenterBoxscore>>;
|
|
2715
5416
|
/**
|
|
2716
5417
|
* Access WSC Sports related game content endpoints
|
|
2717
5418
|
* @description Alternative data source for game information
|
|
@@ -2729,7 +5430,7 @@ declare const wsc: {
|
|
|
2729
5430
|
* wsc.gameStory(2023020001).then((data) => console.log(data));
|
|
2730
5431
|
* ```
|
|
2731
5432
|
*/
|
|
2732
|
-
declare function wscGameStory(gameId: GameId): Promise<
|
|
5433
|
+
declare function wscGameStory(gameId: GameId): Promise<APIResult<WSCGameStory>>;
|
|
2733
5434
|
/**
|
|
2734
5435
|
* Get WSC play-by-play data for a specific game
|
|
2735
5436
|
* @param gameId - The unique identifier for the game (10-digit format)
|
|
@@ -2739,7 +5440,7 @@ declare function wscGameStory(gameId: GameId): Promise<APIResponse<WSCGameStory>
|
|
|
2739
5440
|
* wsc.playByPlay(2023020001).then((data) => console.log(data));
|
|
2740
5441
|
* ```
|
|
2741
5442
|
*/
|
|
2742
|
-
declare function wscPlayByPlay(gameId: GameId): Promise<
|
|
5443
|
+
declare function wscPlayByPlay(gameId: GameId): Promise<APIResult<WSCPlayByPlay>>;
|
|
2743
5444
|
/**
|
|
2744
5445
|
* Access PPT (Player and Puck Tracking) visualization data endpoints
|
|
2745
5446
|
* @description Endpoints for accessing player and puck tracking data used for replay visualizations
|
|
@@ -2758,7 +5459,7 @@ declare const pptReplay: {
|
|
|
2758
5459
|
* pptReplay.goal(2023020001, 42).then((data) => console.log(data));
|
|
2759
5460
|
* ```
|
|
2760
5461
|
*/
|
|
2761
|
-
declare function pptReplayGoal(gameId: GameId, eventId: number | string): Promise<
|
|
5462
|
+
declare function pptReplayGoal(gameId: GameId, eventId: number | string): Promise<APIResult<PPTReplayGoal>>;
|
|
2762
5463
|
/**
|
|
2763
5464
|
* Get player and puck tracking visualization data for a specific event
|
|
2764
5465
|
* @param gameId - The unique identifier for the game (10-digit format)
|
|
@@ -2769,7 +5470,7 @@ declare function pptReplayGoal(gameId: GameId, eventId: number | string): Promis
|
|
|
2769
5470
|
* pptReplay.event(2023020001, 42).then((data) => console.log(data));
|
|
2770
5471
|
* ```
|
|
2771
5472
|
*/
|
|
2772
|
-
declare function pptReplayEvent(gameId: GameId, eventId: number | string): Promise<
|
|
5473
|
+
declare function pptReplayEvent(gameId: GameId, eventId: number | string): Promise<APIResult<PPTReplayEvent>>;
|
|
2773
5474
|
/**
|
|
2774
5475
|
* Get the league schedule for a specific date
|
|
2775
5476
|
* @param date - Date to get schedule for (Date object or ISO date string 'YYYY-MM-DD'). Defaults to current date
|
|
@@ -2783,7 +5484,7 @@ declare function pptReplayEvent(gameId: GameId, eventId: number | string): Promi
|
|
|
2783
5484
|
* schedule('2023-11-15').then((data) => console.log(data));
|
|
2784
5485
|
* ```
|
|
2785
5486
|
*/
|
|
2786
|
-
declare function schedule$1(date?: Date | string): Promise<
|
|
5487
|
+
declare function schedule$1(date?: Date | string): Promise<APIResult<LeagueSchedule>>;
|
|
2787
5488
|
/**
|
|
2788
5489
|
* Get schedule calendar data for a specific date
|
|
2789
5490
|
* @param date - Date to get calendar data for (Date object or ISO date string 'YYYY-MM-DD'). Defaults to current date
|
|
@@ -2793,7 +5494,7 @@ declare function schedule$1(date?: Date | string): Promise<APIResponse<LeagueSch
|
|
|
2793
5494
|
* scheduleCalendar('2023-11-15').then((data) => console.log(data));
|
|
2794
5495
|
* ```
|
|
2795
5496
|
*/
|
|
2796
|
-
declare function scheduleCalendar(date?: Date | string): Promise<
|
|
5497
|
+
declare function scheduleCalendar(date?: Date | string): Promise<APIResult<ScheduleCalendar>>;
|
|
2797
5498
|
/**
|
|
2798
5499
|
* Get playoff bracket data for a specific year
|
|
2799
5500
|
* @param year - The playoff year (YYYY format). Defaults to current year
|
|
@@ -2803,7 +5504,7 @@ declare function scheduleCalendar(date?: Date | string): Promise<APIResponse<Sch
|
|
|
2803
5504
|
* playoffBracket(2023).then((data) => console.log(data));
|
|
2804
5505
|
* ```
|
|
2805
5506
|
*/
|
|
2806
|
-
declare function playoffBracket(year?: Year): Promise<
|
|
5507
|
+
declare function playoffBracket(year?: Year): Promise<APIResult<PlayoffBracket>>;
|
|
2807
5508
|
/**
|
|
2808
5509
|
* Get playoff series information for a season
|
|
2809
5510
|
* @param season - The season identifier (8-digit format: YYYYYYYY, e.g., 20232024). Defaults to current season
|
|
@@ -2813,7 +5514,7 @@ declare function playoffBracket(year?: Year): Promise<APIResponse<PlayoffBracket
|
|
|
2813
5514
|
* playoffSeries(20232024).then((data) => console.log(data));
|
|
2814
5515
|
* ```
|
|
2815
5516
|
*/
|
|
2816
|
-
declare function playoffSeries(season?: Season): Promise<
|
|
5517
|
+
declare function playoffSeries(season?: Season$1): Promise<APIResult<PlayoffSeries>>;
|
|
2817
5518
|
/**
|
|
2818
5519
|
* Get schedule for a specific playoff series
|
|
2819
5520
|
* @param seriesLetter - Single letter identifier for the playoff series (A-O)
|
|
@@ -2824,16 +5525,19 @@ declare function playoffSeries(season?: Season): Promise<APIResponse<PlayoffSeri
|
|
|
2824
5525
|
* playoffSeriesSchedule('A', 20232024).then((data) => console.log(data));
|
|
2825
5526
|
* ```
|
|
2826
5527
|
*/
|
|
2827
|
-
declare function playoffSeriesSchedule(seriesLetter: SeriesLetter$1, season?: Season): Promise<
|
|
5528
|
+
declare function playoffSeriesSchedule(seriesLetter: SeriesLetter$1, season?: Season$1): Promise<APIResult<PlayoffSeriesSchedule>>;
|
|
5529
|
+
declare function playoffSeriesSchedule(seriesLetter: string, season?: Season$1): Promise<APIResult<PlayoffSeriesSchedule>>;
|
|
2828
5530
|
/**
|
|
2829
5531
|
* Get information about where games are available to watch
|
|
5532
|
+
* @deprecated The NHL retired this endpoint, and it now returns 404
|
|
5533
|
+
* (`NotFoundError`). It will be removed in a future major version.
|
|
2830
5534
|
* @returns Promise resolving to streaming and broadcast availability information
|
|
2831
5535
|
* @example
|
|
2832
5536
|
* ```ts
|
|
2833
5537
|
* whereToWatch().then((data) => console.log(data));
|
|
2834
5538
|
* ```
|
|
2835
5539
|
*/
|
|
2836
|
-
declare function whereToWatch(): Promise<
|
|
5540
|
+
declare function whereToWatch(): Promise<APIResult<WhereToWatch>>;
|
|
2837
5541
|
/**
|
|
2838
5542
|
* Get TV network schedule for a specific date
|
|
2839
5543
|
* @param date - Date to get TV schedule for (Date object or ISO date string 'YYYY-MM-DD'). Defaults to current date
|
|
@@ -2843,7 +5547,7 @@ declare function whereToWatch(): Promise<APIResponse<WhereToWatch>>;
|
|
|
2843
5547
|
* networkTVSchedule('2023-11-15').then((data) => console.log(data));
|
|
2844
5548
|
* ```
|
|
2845
5549
|
*/
|
|
2846
|
-
declare function networkTVSchedule(date?: Date | string): Promise<
|
|
5550
|
+
declare function networkTVSchedule(date?: Date | string): Promise<APIResult<NetworkTVSchedule>>;
|
|
2847
5551
|
|
|
2848
5552
|
declare const game_boxscore: typeof boxscore;
|
|
2849
5553
|
declare const game_networkTVSchedule: typeof networkTVSchedule;
|
|
@@ -2873,7 +5577,7 @@ declare namespace game {
|
|
|
2873
5577
|
* seasons().then((data) => console.log(data));
|
|
2874
5578
|
* ```
|
|
2875
5579
|
*/
|
|
2876
|
-
declare function seasons(): Promise<
|
|
5580
|
+
declare function seasons(): Promise<APIResult<NHLSeasons>>;
|
|
2877
5581
|
/**
|
|
2878
5582
|
* Access meta information endpoints
|
|
2879
5583
|
* @description Get metadata about playoff series and games
|
|
@@ -2892,7 +5596,7 @@ declare const meta: {
|
|
|
2892
5596
|
* meta.game(2023020001).then((data) => console.log(data));
|
|
2893
5597
|
* ```
|
|
2894
5598
|
*/
|
|
2895
|
-
declare function metaGame(gameId: GameId): Promise<
|
|
5599
|
+
declare function metaGame(gameId: GameId): Promise<APIResult<GameMeta>>;
|
|
2896
5600
|
/**
|
|
2897
5601
|
* Get meta information for a playoff series
|
|
2898
5602
|
*
|
|
@@ -2904,7 +5608,8 @@ declare function metaGame(gameId: GameId): Promise<APIResponse<GameMeta>>;
|
|
|
2904
5608
|
* meta.playoffSeries('A', 2023).then((data) => console.log(data));
|
|
2905
5609
|
* ```
|
|
2906
5610
|
*/
|
|
2907
|
-
declare function metaPlayoffSeries(seriesLetter: SeriesLetter$1, year?: Year): Promise<
|
|
5611
|
+
declare function metaPlayoffSeries(seriesLetter: SeriesLetter$1, year?: Year): Promise<APIResult<PlayoffSeriesMeta>>;
|
|
5612
|
+
declare function metaPlayoffSeries(seriesLetter: string, year?: Year): Promise<APIResult<PlayoffSeriesMeta>>;
|
|
2908
5613
|
/**
|
|
2909
5614
|
* Lookup information based on postal/zip code
|
|
2910
5615
|
*
|
|
@@ -2916,7 +5621,7 @@ declare function metaPlayoffSeries(seriesLetter: SeriesLetter$1, year?: Year): P
|
|
|
2916
5621
|
* postalLookup('M5H 2N2').then((data) => console.log(data)); // Canadian postal
|
|
2917
5622
|
* ```
|
|
2918
5623
|
*/
|
|
2919
|
-
declare function postalLookup(postalCode: PostalCode): Promise<
|
|
5624
|
+
declare function postalLookup(postalCode: PostalCode): Promise<APIResult<PostalCodeInfo>>;
|
|
2920
5625
|
/**
|
|
2921
5626
|
* Get location information based on IP address
|
|
2922
5627
|
*
|
|
@@ -2927,7 +5632,7 @@ declare function postalLookup(postalCode: PostalCode): Promise<APIResponse<Posta
|
|
|
2927
5632
|
* location().then((data) => console.log(data));
|
|
2928
5633
|
* ```
|
|
2929
5634
|
*/
|
|
2930
|
-
declare function location(): Promise<
|
|
5635
|
+
declare function location(): Promise<APIResult<LocationInfo>>;
|
|
2931
5636
|
/**
|
|
2932
5637
|
* Get partner game information for a specific country
|
|
2933
5638
|
*
|
|
@@ -2938,7 +5643,7 @@ declare function location(): Promise<APIResponse<LocationInfo>>;
|
|
|
2938
5643
|
* partnerGame('USA').then((data) => console.log(data));
|
|
2939
5644
|
* ```
|
|
2940
5645
|
*/
|
|
2941
|
-
declare function partnerGame(countryCode: CountryCode
|
|
5646
|
+
declare function partnerGame(countryCode: CountryCode): Promise<APIResult<PartnerGameInfo>>;
|
|
2942
5647
|
|
|
2943
5648
|
declare const misc_location: typeof location;
|
|
2944
5649
|
declare const misc_meta: typeof meta;
|
|
@@ -2963,7 +5668,7 @@ declare namespace misc {
|
|
|
2963
5668
|
* landing(8478402).then((data) => console.log(data)); // Connor McDavid
|
|
2964
5669
|
* ```
|
|
2965
5670
|
*/
|
|
2966
|
-
declare function landing(playerId: number | string): Promise<
|
|
5671
|
+
declare function landing(playerId: number | string): Promise<APIResult<PlayerLanding>>;
|
|
2967
5672
|
/**
|
|
2968
5673
|
* Get player game log for a specific season
|
|
2969
5674
|
* @param playerId - The unique player identifier (NHL player ID number)
|
|
@@ -2975,7 +5680,8 @@ declare function landing(playerId: number | string): Promise<APIResponse<PlayerL
|
|
|
2975
5680
|
* gameLog(8478402, 20232024, 2).then((data) => console.log(data));
|
|
2976
5681
|
* ```
|
|
2977
5682
|
*/
|
|
2978
|
-
declare function gameLog(playerId: number | string, season?: Season, gameType?: GameType): Promise<
|
|
5683
|
+
declare function gameLog(playerId: number | string, season?: Season$1, gameType?: GameType): Promise<APIResult<PlayerGameLog>>;
|
|
5684
|
+
declare function gameLog(playerId: number | string, season?: Season$1, gameType?: number | string): Promise<APIResult<PlayerGameLog>>;
|
|
2979
5685
|
/**
|
|
2980
5686
|
* Get player spotlight featuring highlighted players
|
|
2981
5687
|
* @returns Promise resolving to featured/spotlight players
|
|
@@ -2984,17 +5690,18 @@ declare function gameLog(playerId: number | string, season?: Season, gameType?:
|
|
|
2984
5690
|
* spotlight().then((data) => console.log(data));
|
|
2985
5691
|
* ```
|
|
2986
5692
|
*/
|
|
2987
|
-
declare function spotlight(): Promise<
|
|
5693
|
+
declare function spotlight(): Promise<APIResult<PlayerSpotlight[]>>;
|
|
2988
5694
|
/**
|
|
2989
5695
|
* Search for players by name
|
|
2990
5696
|
* @param query - The search query string (player name)
|
|
2991
5697
|
* @returns Promise resolving to player search results
|
|
5698
|
+
* @deprecated This endpoint is deprecated and may be removed in future versions. Use the NHL Stats API player endpoint instead.
|
|
2992
5699
|
* @example
|
|
2993
5700
|
* ```ts
|
|
2994
5701
|
* search('McDavid').then((data) => console.log(data));
|
|
2995
5702
|
* ```
|
|
2996
5703
|
*/
|
|
2997
|
-
declare function search(query: string): Promise<
|
|
5704
|
+
declare function search(query: string): Promise<APIResult<PlayerSearchResult[] | undefined>>;
|
|
2998
5705
|
/**
|
|
2999
5706
|
* Access stats leaders endpoints for skaters and goalies
|
|
3000
5707
|
* @description Get statistical leaders across various categories
|
|
@@ -3013,7 +5720,7 @@ declare const statsLeaders: {
|
|
|
3013
5720
|
* statsLeaders.skaters(20232024, 2).then((data) => console.log(data));
|
|
3014
5721
|
* ```
|
|
3015
5722
|
*/
|
|
3016
|
-
declare function statsLeadersSkaters(season?: Season, gameType?: GameType): Promise<
|
|
5723
|
+
declare function statsLeadersSkaters(season?: Season$1, gameType?: GameType): Promise<APIResult<SkaterStatsLeaders>>;
|
|
3017
5724
|
/**
|
|
3018
5725
|
* Get goalie stats leaders
|
|
3019
5726
|
* @param season - The season identifier (8-digit format: YYYYYYYY). Defaults to current season
|
|
@@ -3024,7 +5731,7 @@ declare function statsLeadersSkaters(season?: Season, gameType?: GameType): Prom
|
|
|
3024
5731
|
* statsLeaders.goalies(20232024, 2).then((data) => console.log(data));
|
|
3025
5732
|
* ```
|
|
3026
5733
|
*/
|
|
3027
|
-
declare function statsLeadersGoalies(season?: Season, gameType?: GameType): Promise<
|
|
5734
|
+
declare function statsLeadersGoalies(season?: Season$1, gameType?: GameType): Promise<APIResult<GoalieStatsLeaders>>;
|
|
3028
5735
|
|
|
3029
5736
|
declare const player_gameLog: typeof gameLog;
|
|
3030
5737
|
declare const player_landing: typeof landing;
|
|
@@ -3048,7 +5755,7 @@ declare namespace player {
|
|
|
3048
5755
|
* score('2023-11-15').then((data) => console.log(data));
|
|
3049
5756
|
* ```
|
|
3050
5757
|
*/
|
|
3051
|
-
declare function score(date?: Date | string): Promise<
|
|
5758
|
+
declare function score(date?: Date | string): Promise<APIResult<Score>>;
|
|
3052
5759
|
/**
|
|
3053
5760
|
* Get current scoreboard information
|
|
3054
5761
|
* @returns Promise resolving to current scoreboard with live and recent game data
|
|
@@ -3057,10 +5764,10 @@ declare function score(date?: Date | string): Promise<APIResponse<Score>>;
|
|
|
3057
5764
|
* scoreboard().then((data) => console.log(data));
|
|
3058
5765
|
* ```
|
|
3059
5766
|
*/
|
|
3060
|
-
declare function scoreboard(): Promise<
|
|
5767
|
+
declare function scoreboard(): Promise<APIResult<Scoreboard>>;
|
|
3061
5768
|
declare namespace scoreboard {
|
|
3062
|
-
var team: (team: TeamAbbrev) => Promise<
|
|
3063
|
-
var date: (date: Date | string) => Promise<
|
|
5769
|
+
var team: (team: TeamAbbrev) => Promise<APIResult<Scoreboard>>;
|
|
5770
|
+
var date: (date: Date | string) => Promise<APIResult<Scoreboard>>;
|
|
3064
5771
|
}
|
|
3065
5772
|
|
|
3066
5773
|
/**
|
|
@@ -3072,7 +5779,7 @@ declare namespace scoreboard {
|
|
|
3072
5779
|
* rosterSeasons('TOR').then((data) => console.log(data));
|
|
3073
5780
|
* ```
|
|
3074
5781
|
*/
|
|
3075
|
-
declare function rosterSeasons(team: TeamAbbrev): Promise<
|
|
5782
|
+
declare function rosterSeasons(team: TeamAbbrev): Promise<APIResult<TeamRosterSeasons>>;
|
|
3076
5783
|
/**
|
|
3077
5784
|
* Get team roster for a specific season
|
|
3078
5785
|
* @param team - The team abbreviation (e.g., 'TOR', 'MTL', 'NYR')
|
|
@@ -3083,7 +5790,7 @@ declare function rosterSeasons(team: TeamAbbrev): Promise<APIResponse<TeamRoster
|
|
|
3083
5790
|
* roster('TOR', 20232024).then((data) => console.log(data));
|
|
3084
5791
|
* ```
|
|
3085
5792
|
*/
|
|
3086
|
-
declare function roster(team: string, season?: string | number): Promise<
|
|
5793
|
+
declare function roster(team: string, season?: string | number): Promise<APIResult<TeamRoster>>;
|
|
3087
5794
|
/**
|
|
3088
5795
|
* Get team prospects information
|
|
3089
5796
|
* @param team - The team abbreviation (e.g., 'TOR', 'MTL', 'NYR')
|
|
@@ -3093,7 +5800,7 @@ declare function roster(team: string, season?: string | number): Promise<APIResp
|
|
|
3093
5800
|
* prospects('TOR').then((data) => console.log(data));
|
|
3094
5801
|
* ```
|
|
3095
5802
|
*/
|
|
3096
|
-
declare function prospects(team: TeamAbbrev): Promise<
|
|
5803
|
+
declare function prospects(team: TeamAbbrev): Promise<APIResult<TeamProspects>>;
|
|
3097
5804
|
/**
|
|
3098
5805
|
* Get team statistics for a specific season
|
|
3099
5806
|
* @param team - The team abbreviation (e.g., 'TOR', 'MTL', 'NYR')
|
|
@@ -3105,7 +5812,7 @@ declare function prospects(team: TeamAbbrev): Promise<APIResponse<TeamProspects>
|
|
|
3105
5812
|
* stats('TOR', 20232024, 'REG').then((data) => console.log(data));
|
|
3106
5813
|
* ```
|
|
3107
5814
|
*/
|
|
3108
|
-
declare function stats(team: TeamAbbrev, season?: Season, gameType?: GameType): Promise<
|
|
5815
|
+
declare function stats(team: TeamAbbrev, season?: Season$1, gameType?: GameType): Promise<APIResult<TeamStats>>;
|
|
3109
5816
|
/**
|
|
3110
5817
|
* Get valid season and game type options for a team's statistics
|
|
3111
5818
|
* @param team - The team abbreviation (e.g., 'TOR', 'MTL', 'NYR')
|
|
@@ -3117,7 +5824,7 @@ declare function stats(team: TeamAbbrev, season?: Season, gameType?: GameType):
|
|
|
3117
5824
|
* statsSeason('TOR').then((data) => console.log(data));
|
|
3118
5825
|
* ```
|
|
3119
5826
|
*/
|
|
3120
|
-
declare function statsSeason(team: TeamAbbrev): Promise<
|
|
5827
|
+
declare function statsSeason(team: TeamAbbrev): Promise<APIResult<TeamStatsSeason>>;
|
|
3121
5828
|
/**
|
|
3122
5829
|
* Get league standings for a specific date
|
|
3123
5830
|
* @param date - Date to get standings for (Date object or ISO date string 'YYYY-MM-DD'). Defaults to current date
|
|
@@ -3127,7 +5834,7 @@ declare function statsSeason(team: TeamAbbrev): Promise<APIResponse<TeamStatsSea
|
|
|
3127
5834
|
* standings('2023-11-15').then((data) => console.log(data));
|
|
3128
5835
|
* ```
|
|
3129
5836
|
*/
|
|
3130
|
-
declare function standings(date?: Date | string): Promise<
|
|
5837
|
+
declare function standings(date?: Date | string): Promise<APIResult<NHLStandings>>;
|
|
3131
5838
|
/**
|
|
3132
5839
|
* Get current season standings information
|
|
3133
5840
|
* @returns Promise resolving to current season standings with detailed team records
|
|
@@ -3136,7 +5843,7 @@ declare function standings(date?: Date | string): Promise<APIResponse<NHLStandin
|
|
|
3136
5843
|
* standingsSeason().then((data) => console.log(data));
|
|
3137
5844
|
* ```
|
|
3138
5845
|
*/
|
|
3139
|
-
declare function standingsSeason(): Promise<
|
|
5846
|
+
declare function standingsSeason(): Promise<APIResult<NHLStandingsSeason>>;
|
|
3140
5847
|
/**
|
|
3141
5848
|
* Get the team schedule for any seven-day period
|
|
3142
5849
|
* @param team - The team abbreviation (e.g., 'TOR', 'MTL', 'NYR')
|
|
@@ -3153,8 +5860,8 @@ declare function standingsSeason(): Promise<APIResponse<NHLStandingsSeason>>;
|
|
|
3153
5860
|
* });
|
|
3154
5861
|
* ```
|
|
3155
5862
|
*/
|
|
3156
|
-
declare function scheduleWeek(team: TeamAbbrev, date?: Date | string): Promise<
|
|
3157
|
-
declare function scheduleWeek(team: string, date?: Date | string): Promise<
|
|
5863
|
+
declare function scheduleWeek(team: TeamAbbrev, date?: Date | string): Promise<APIResult<TeamScheduleWeek>>;
|
|
5864
|
+
declare function scheduleWeek(team: string, date?: Date | string): Promise<APIResult<TeamScheduleWeek>>;
|
|
3158
5865
|
/**
|
|
3159
5866
|
* Get the team schedule for any month
|
|
3160
5867
|
* @param team - The team abbreviation (e.g., 'TOR', 'MTL', 'NYR')
|
|
@@ -3170,8 +5877,8 @@ declare function scheduleWeek(team: string, date?: Date | string): Promise<APIRe
|
|
|
3170
5877
|
* });
|
|
3171
5878
|
* ```
|
|
3172
5879
|
*/
|
|
3173
|
-
declare function scheduleMonth(team: TeamAbbrev, date?: Date | string): Promise<
|
|
3174
|
-
declare function scheduleMonth(team: string, date?: Date | string): Promise<
|
|
5880
|
+
declare function scheduleMonth(team: TeamAbbrev, date?: Date | string): Promise<APIResult<TeamScheduleMonth>>;
|
|
5881
|
+
declare function scheduleMonth(team: string, date?: Date | string): Promise<APIResult<TeamScheduleMonth>>;
|
|
3175
5882
|
/**
|
|
3176
5883
|
* Returns the full season schedule for the provided team and season
|
|
3177
5884
|
* @param team - The team abbreviation for the desired team (e.g., 'TOR', 'MTL', 'NYR')
|
|
@@ -3185,8 +5892,8 @@ declare function scheduleMonth(team: string, date?: Date | string): Promise<APIR
|
|
|
3185
5892
|
* });
|
|
3186
5893
|
* ```
|
|
3187
5894
|
*/
|
|
3188
|
-
declare function scheduleSeason(team: TeamAbbrev, season?: Season): Promise<
|
|
3189
|
-
declare function scheduleSeason(team: string, season?: Season): Promise<
|
|
5895
|
+
declare function scheduleSeason(team: TeamAbbrev, season?: Season$1): Promise<APIResult<TeamScheduleSeason>>;
|
|
5896
|
+
declare function scheduleSeason(team: string, season?: Season$1): Promise<APIResult<TeamScheduleSeason>>;
|
|
3190
5897
|
/**
|
|
3191
5898
|
* Access team schedule endpoints for different time periods
|
|
3192
5899
|
* @description Get team schedules by season, week, or month
|
|
@@ -3226,297 +5933,154 @@ declare namespace index {
|
|
|
3226
5933
|
}
|
|
3227
5934
|
|
|
3228
5935
|
/**
|
|
3229
|
-
*
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
/**
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
readonly NSH: 18;
|
|
3266
|
-
/** New York Islanders */
|
|
3267
|
-
readonly NYI: 2;
|
|
3268
|
-
/** New York Rangers */
|
|
3269
|
-
readonly NYR: 3;
|
|
3270
|
-
/** Ottawa Senators */
|
|
3271
|
-
readonly OTT: 9;
|
|
3272
|
-
/** Philadelphia Flyers */
|
|
3273
|
-
readonly PHI: 4;
|
|
3274
|
-
/** Pittsburgh Penguins */
|
|
3275
|
-
readonly PIT: 5;
|
|
3276
|
-
/** San Jose Sharks */
|
|
3277
|
-
readonly SJS: 28;
|
|
3278
|
-
/** Seattle Kraken */
|
|
3279
|
-
readonly SEA: 55;
|
|
3280
|
-
/** St. Louis Blues */
|
|
3281
|
-
readonly STL: 19;
|
|
3282
|
-
/** Tampa Bay Lightning */
|
|
3283
|
-
readonly TBL: 14;
|
|
3284
|
-
/** Toronto Maple Leafs */
|
|
3285
|
-
readonly TOR: 10;
|
|
3286
|
-
/** Utah Hockey Club */
|
|
3287
|
-
readonly UTA: 59;
|
|
3288
|
-
/** Vancouver Canucks */
|
|
3289
|
-
readonly VAN: 23;
|
|
3290
|
-
/** Vegas Golden Knights */
|
|
3291
|
-
readonly VGK: 54;
|
|
3292
|
-
/** Winnipeg Jets */
|
|
3293
|
-
readonly WPG: 52;
|
|
3294
|
-
/** Washington Capitals */
|
|
3295
|
-
readonly WSH: 15;
|
|
3296
|
-
};
|
|
3297
|
-
declare const TeamsReverseEnum: Record<(typeof TeamsEnum)[keyof typeof TeamsEnum], keyof typeof TeamsEnum>;
|
|
3298
|
-
/**
|
|
3299
|
-
* All inactive NHL teams and their corresponding team IDs.
|
|
3300
|
-
*/
|
|
3301
|
-
declare const InactiveTeamsEnum: {
|
|
3302
|
-
/** Atlanta Flames (not active) */
|
|
3303
|
-
readonly AFM: 47;
|
|
3304
|
-
/** Arizona Coyotes (not active) */
|
|
3305
|
-
readonly ARI: 53;
|
|
3306
|
-
/** Atlanta Thrashers (not active) */
|
|
3307
|
-
readonly ATL: 11;
|
|
3308
|
-
/** Brooklyn Americans - (not active) */
|
|
3309
|
-
readonly BRK: 51;
|
|
3310
|
-
/** California Golden Seals (aka Bay Area Seals) - (not active) */
|
|
3311
|
-
readonly CGS: 56;
|
|
3312
|
-
/** Cleveland Barons - (not active) */
|
|
3313
|
-
readonly CLE: 49;
|
|
3314
|
-
/** Colorado Rockies - (not active) */
|
|
3315
|
-
readonly CLR: 35;
|
|
3316
|
-
/** Detroit Cougars - (not active) */
|
|
3317
|
-
readonly DCG: 40;
|
|
3318
|
-
/** Detroit Falcons - (not active) */
|
|
3319
|
-
readonly DFL: 50;
|
|
3320
|
-
/** Hamilton Tigers - (not active) */
|
|
3321
|
-
readonly HAM: 37;
|
|
3322
|
-
/** Hartford Whalers - (not active) */
|
|
3323
|
-
readonly HFD: 34;
|
|
3324
|
-
/** Kansas City Scouts - (not active) */
|
|
3325
|
-
readonly KCS: 48;
|
|
3326
|
-
/** Montreal Maroons - (not active) */
|
|
3327
|
-
readonly MMR: 43;
|
|
3328
|
-
/** Minnesota North Stars - (not active) */
|
|
3329
|
-
readonly MNS: 31;
|
|
3330
|
-
/** Montreal Wanderers - (not active) */
|
|
3331
|
-
readonly MWN: 41;
|
|
3332
|
-
/** New York Americans - (not active) */
|
|
3333
|
-
readonly NYA: 44;
|
|
3334
|
-
/** California Seals (aka Oakland Seals) - (not active) */
|
|
3335
|
-
readonly OAK: 46;
|
|
3336
|
-
/** Phoenix Coyotes - (not active) */
|
|
3337
|
-
readonly PHX: 27;
|
|
3338
|
-
/** Pittsburgh Pirates - (not active) */
|
|
3339
|
-
readonly PIR: 38;
|
|
3340
|
-
/** Quebec Bulldogs - (not active) */
|
|
3341
|
-
readonly QBD: 42;
|
|
3342
|
-
/** Philadelphia Quakers - (not active) */
|
|
3343
|
-
readonly QUA: 39;
|
|
3344
|
-
/** Quebec Nordiques - (not active) */
|
|
3345
|
-
readonly QUE: 32;
|
|
3346
|
-
/** Ottawa Senators (original franchise) - (not active) */
|
|
3347
|
-
readonly SEN: 36;
|
|
3348
|
-
/** St. Louis Eagles - (not active) */
|
|
3349
|
-
readonly SLE: 45;
|
|
3350
|
-
/** Toronto Hockey Club (aka Toronto Arenas) - (not active) */
|
|
3351
|
-
readonly TAN: 57;
|
|
3352
|
-
/** Toronto St. Patricks - (not active) */
|
|
3353
|
-
readonly TSP: 58;
|
|
3354
|
-
/** Winnipeg Jets (original franchise) - (not active) */
|
|
3355
|
-
readonly WIN: 33;
|
|
3356
|
-
};
|
|
3357
|
-
declare const InactiveTeamsReverseEnum: Record<(typeof InactiveTeamsEnum)[keyof typeof InactiveTeamsEnum], keyof typeof InactiveTeamsEnum>;
|
|
3358
|
-
/**
|
|
3359
|
-
* All valid NHL seasons in yyyyYYYY format.
|
|
3360
|
-
*/
|
|
3361
|
-
declare const SeasonsArray: readonly [19171918, 19181919, 19191920, 19201921, 19211922, 19221923, 19231924, 19241925, 19251926, 19261927, 19271928, 19281929, 19291930, 19301931, 19311932, 19321933, 19331934, 19341935, 19351936, 19361937, 19371938, 19381939, 19391940, 19401941, 19411942, 19421943, 19431944, 19441945, 19451946, 19461947, 19471948, 19481949, 19491950, 19501951, 19511952, 19521953, 19531954, 19541955, 19551956, 19561957, 19571958, 19581959, 19591960, 19601961, 19611962, 19621963, 19631964, 19641965, 19651966, 19661967, 19671968, 19681969, 19691970, 19701971, 19711972, 19721973, 19731974, 19741975, 19751976, 19761977, 19771978, 19781979, 19791980, 19801981, 19811982, 19821983, 19831984, 19841985, 19851986, 19861987, 19871988, 19881989, 19891990, 19901991, 19911992, 19921993, 19931994, 19941995, 19951996, 19961997, 19971998, 19981999, 19992000, 20002001, 20012002, 20022003, 20032004, 20052006, 20062007, 20072008, 20082009, 20092010, 20102011, 20112012, 20122013, 20132014, 20142015, 20152016, 20162017, 20172018, 20182019, 20192020, 20202021, 20212022, 20222023, 20232024, 20242025, 20252026];
|
|
3362
|
-
/**
|
|
3363
|
-
* All valid NHL playoff series letters.
|
|
3364
|
-
*/
|
|
3365
|
-
declare const SeriesLetterEnum: {
|
|
3366
|
-
/** Atlantic Division Round 1: D1 vs WC# */
|
|
3367
|
-
readonly A: "A";
|
|
3368
|
-
/** Atlantic Division Round 1: D2 vs D3 */
|
|
3369
|
-
readonly B: "B";
|
|
3370
|
-
/** Metropolitan Division Round 1: D1 vs WC# */
|
|
3371
|
-
readonly C: "C";
|
|
3372
|
-
/** Metropolitan Division Round 1: D2 vs D3 */
|
|
3373
|
-
readonly D: "D";
|
|
3374
|
-
/** Central Division Round 1: D1 vs WC# */
|
|
3375
|
-
readonly E: "E";
|
|
3376
|
-
/** Central Division Round 1: D2 vs D3 */
|
|
3377
|
-
readonly F: "F";
|
|
3378
|
-
/** Pacific Division Round 1: D1 vs WC# */
|
|
3379
|
-
readonly G: "G";
|
|
3380
|
-
/** Pacific Division Round 1: D2 vs D3 */
|
|
3381
|
-
readonly H: "H";
|
|
3382
|
-
/** Atlantic Division Round 2: Aw vs Bw */
|
|
3383
|
-
readonly I: "I";
|
|
3384
|
-
/** Metropolitan Division Round 2: Cw vs Dw */
|
|
3385
|
-
readonly J: "J";
|
|
3386
|
-
/** Central Division Round 2: Ew vs Fw */
|
|
3387
|
-
readonly K: "K";
|
|
3388
|
-
/** Pacific Division Round 2: Gw vs Hw */
|
|
3389
|
-
readonly L: "L";
|
|
3390
|
-
/** Eastern Conference Finals */
|
|
3391
|
-
readonly M: "M";
|
|
3392
|
-
/** Western Conference Finals*/
|
|
3393
|
-
readonly N: "N";
|
|
3394
|
-
/** Stanley Cup Finals */
|
|
3395
|
-
readonly O: "O";
|
|
3396
|
-
};
|
|
5936
|
+
* ======================================================================
|
|
5937
|
+
* NHL video metadata from Brightcove, the NHL's video host.
|
|
5938
|
+
* Base URL: https://edge.api.brightcove.com/playback/v1
|
|
5939
|
+
* ======================================================================
|
|
5940
|
+
* Video ids come from `highlightClip` / `discreteClip` fields in Game
|
|
5941
|
+
* Center responses (e.g. `gc.game.landing` goals). The policy key is the
|
|
5942
|
+
* public one nhl.com's player sends.
|
|
5943
|
+
*/
|
|
5944
|
+
|
|
5945
|
+
/** One rendition of a video */
|
|
5946
|
+
interface VideoSource {
|
|
5947
|
+
src: string;
|
|
5948
|
+
/** MIME type of a streaming manifest, e.g. application/x-mpegURL */
|
|
5949
|
+
type?: string;
|
|
5950
|
+
/** Container of a progressive download, e.g. MP4 */
|
|
5951
|
+
container?: string;
|
|
5952
|
+
codec?: string;
|
|
5953
|
+
width?: number;
|
|
5954
|
+
height?: number;
|
|
5955
|
+
}
|
|
5956
|
+
/** Metadata and playable sources for a video */
|
|
5957
|
+
interface VideoMetadata {
|
|
5958
|
+
id: string;
|
|
5959
|
+
title: string;
|
|
5960
|
+
description: string | null;
|
|
5961
|
+
longDescription: string | null;
|
|
5962
|
+
/** Length in milliseconds */
|
|
5963
|
+
duration: number;
|
|
5964
|
+
publishedAt: string;
|
|
5965
|
+
poster: string | null;
|
|
5966
|
+
thumbnail: string | null;
|
|
5967
|
+
/** The widest HTTPS MP4 rendition, or null when there is none */
|
|
5968
|
+
url: string | null;
|
|
5969
|
+
sources: VideoSource[];
|
|
5970
|
+
tags: string[];
|
|
5971
|
+
}
|
|
3397
5972
|
/**
|
|
3398
|
-
*
|
|
5973
|
+
* Get a video's title, descriptions and playable sources
|
|
5974
|
+
*
|
|
5975
|
+
* @param videoId - Brightcove video id, e.g. a goal's `highlightClip`
|
|
5976
|
+
* @returns Promise resolving to the video metadata; an unknown id gives a
|
|
5977
|
+
* NotFoundError result
|
|
5978
|
+
*
|
|
5979
|
+
* @example
|
|
5980
|
+
* const result = await video.metadata(6366156642112);
|
|
5981
|
+
* if (result.success) console.log(result.data.title, result.data.url);
|
|
3399
5982
|
*/
|
|
3400
|
-
declare
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
5983
|
+
declare function metadata(videoId: string | number): Promise<APIResult<VideoMetadata>>;
|
|
5984
|
+
|
|
5985
|
+
type video_VideoMetadata = VideoMetadata;
|
|
5986
|
+
type video_VideoSource = VideoSource;
|
|
5987
|
+
declare const video_metadata: typeof metadata;
|
|
5988
|
+
declare namespace video {
|
|
5989
|
+
export { type video_VideoMetadata as VideoMetadata, type video_VideoSource as VideoSource, video_metadata as metadata };
|
|
5990
|
+
}
|
|
5991
|
+
|
|
3406
5992
|
/**
|
|
3407
|
-
*
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
Atlantic_R1_D2_vs_D3: string;
|
|
3412
|
-
Metropolitan_R1_D1_vs_WC: string;
|
|
3413
|
-
Metropolitan_R1_D2_vs_D3: string;
|
|
3414
|
-
Central_R1_D1_vs_WC: string;
|
|
3415
|
-
Central_R1_D2_vs_D3: string;
|
|
3416
|
-
Pacific_R1_D1_vs_WC: string;
|
|
3417
|
-
Pacific_R1_D2_vs_D3: string;
|
|
3418
|
-
Atlantic_R2_Aw_vs_Bw: string;
|
|
3419
|
-
Metropolitan_R2_Cw_vs_Dw: string;
|
|
3420
|
-
Central_R2_Ew_vs_Fw: string;
|
|
3421
|
-
Pacific_R2_Gw_vs_Hw: string;
|
|
3422
|
-
Eastern_Conference_Finals: string;
|
|
3423
|
-
Western_Conference_Finals: string;
|
|
3424
|
-
Stanley_Cup_Finals: string;
|
|
3425
|
-
};
|
|
5993
|
+
* NHL API Client implementation
|
|
5994
|
+
* Internal client for making API requests to the NHL API
|
|
5995
|
+
*/
|
|
5996
|
+
|
|
3426
5997
|
/**
|
|
3427
|
-
*
|
|
5998
|
+
* Extended configuration for the NHL API client including error handling
|
|
3428
5999
|
*/
|
|
3429
|
-
|
|
3430
|
-
/**
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
6000
|
+
interface NHLClientWithErrorConfig extends NHLClientConfig {
|
|
6001
|
+
/**
|
|
6002
|
+
* Error handling configuration
|
|
6003
|
+
*/
|
|
6004
|
+
errorConfig?: ErrorConfig;
|
|
6005
|
+
}
|
|
6006
|
+
/** Base URLs of the NHL APIs the library calls. */
|
|
6007
|
+
declare const BASE_URLS: {
|
|
6008
|
+
readonly gamecenter: "https://api-web.nhle.com/v1";
|
|
6009
|
+
readonly edgeStats: "https://api.nhle.com/stats/rest";
|
|
3436
6010
|
};
|
|
3437
6011
|
/**
|
|
3438
|
-
*
|
|
6012
|
+
* NHL API Client class for making API requests to the NHL API
|
|
6013
|
+
* Provides methods for sending GET requests to the NHL API with automatic
|
|
6014
|
+
* URL construction, query parameter handling, timeout management, and
|
|
6015
|
+
* comprehensive error handling using the ErrorHandler utility.
|
|
3439
6016
|
*/
|
|
3440
|
-
declare
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
/**
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
6017
|
+
declare class NHLClient {
|
|
6018
|
+
private options;
|
|
6019
|
+
private errorHandler;
|
|
6020
|
+
/**
|
|
6021
|
+
* Creates a new NHL API client instance
|
|
6022
|
+
*
|
|
6023
|
+
* Options left unset (timeout, language) follow the shared `config`
|
|
6024
|
+
* object at request time, so changing `config` after import still
|
|
6025
|
+
* applies to this client.
|
|
6026
|
+
*
|
|
6027
|
+
* @param baseURLOrOptions - Base URL, or client options
|
|
6028
|
+
* @param errorConfig - Optional error handling configuration
|
|
6029
|
+
*
|
|
6030
|
+
* @example
|
|
6031
|
+
* const client = new NHLClient('https://api-web.nhle.com/v1');
|
|
6032
|
+
* const slow = new NHLClient({ timeout: 15000, language: 'fr' });
|
|
6033
|
+
*/
|
|
6034
|
+
constructor(baseURLOrOptions?: string | NHLClientWithErrorConfig, errorConfig?: ErrorConfig);
|
|
6035
|
+
/** Base URL, timeout, headers and language in effect for the next request. */
|
|
6036
|
+
private get config();
|
|
6037
|
+
/**
|
|
6038
|
+
* Helper to build URL with query parameters
|
|
6039
|
+
* @private
|
|
6040
|
+
*/
|
|
6041
|
+
private buildUrl;
|
|
6042
|
+
/**
|
|
6043
|
+
* Send a GET request to the NHL API
|
|
6044
|
+
* @param endpoint - API endpoint path
|
|
6045
|
+
* @param params - Optional query parameters
|
|
6046
|
+
* @returns Promise resolving to an APIResponse containing either data or error
|
|
6047
|
+
*/
|
|
6048
|
+
get<T = unknown>(endpoint: string, params?: Record<string, unknown>): Promise<APIResult<T>>;
|
|
6049
|
+
/**
|
|
6050
|
+
* Configure error handling behavior
|
|
6051
|
+
* @param config - Error configuration options
|
|
6052
|
+
*/
|
|
6053
|
+
configureErrorHandling(config: Partial<ErrorConfig>): void;
|
|
6054
|
+
}
|
|
3448
6055
|
/**
|
|
3449
|
-
*
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
readonly POST: 3;
|
|
3458
|
-
/** All-Star Game (unconfirmed) */
|
|
3459
|
-
readonly ASG: 4;
|
|
3460
|
-
/** International (unconfirmed) */
|
|
3461
|
-
readonly INTL: 19;
|
|
3462
|
-
};
|
|
3463
|
-
/** */
|
|
3464
|
-
declare const SEASON_RANGE: {
|
|
3465
|
-
START: number;
|
|
3466
|
-
END: number;
|
|
3467
|
-
};
|
|
3468
|
-
/** */
|
|
3469
|
-
declare const START_SEASON: number;
|
|
3470
|
-
/** */
|
|
3471
|
-
declare const END_SEASON: number;
|
|
3472
|
-
/** */
|
|
3473
|
-
declare const YEAR_RANGE: {
|
|
3474
|
-
START: number;
|
|
3475
|
-
END: number;
|
|
3476
|
-
};
|
|
3477
|
-
/** */
|
|
3478
|
-
declare const START_YEAR: number;
|
|
3479
|
-
/** */
|
|
3480
|
-
declare const END_YEAR: number;
|
|
3481
|
-
/** */
|
|
3482
|
-
declare const CURRENT: {
|
|
3483
|
-
SEASON: number;
|
|
3484
|
-
YEAR: number;
|
|
3485
|
-
};
|
|
3486
|
-
/** */
|
|
3487
|
-
declare const PLAYER_ID_RANGE: {
|
|
3488
|
-
readonly MIN: 8444000;
|
|
3489
|
-
readonly MAX: 8489999;
|
|
3490
|
-
};
|
|
3491
|
-
/** */
|
|
3492
|
-
declare const TEAM_ID_RANGE: {
|
|
3493
|
-
readonly MIN: 1;
|
|
3494
|
-
readonly MAX: 59;
|
|
3495
|
-
};
|
|
6056
|
+
* Factory function for backward compatibility
|
|
6057
|
+
* Creates a new NHL API client instance
|
|
6058
|
+
*
|
|
6059
|
+
* @param baseURL - Optional custom base URL or predefined API endpoint key
|
|
6060
|
+
* @param errorConfig - Optional error handling configuration
|
|
6061
|
+
* @returns A new NHL API client instance
|
|
6062
|
+
*/
|
|
6063
|
+
declare function createNHLClient(baseURLOrOptions?: string | NHLClientWithErrorConfig, errorConfig?: ErrorConfig): NHLClient;
|
|
3496
6064
|
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
declare const
|
|
3514
|
-
|
|
3515
|
-
declare
|
|
3516
|
-
declare const nhl_YEAR_RANGE: typeof YEAR_RANGE;
|
|
3517
|
-
declare namespace nhl {
|
|
3518
|
-
export { nhl_CURRENT as CURRENT, nhl_END_SEASON as END_SEASON, nhl_END_YEAR as END_YEAR, nhl_GameStateEnum as GameStateEnum, nhl_GameTypeEnum as GameTypeEnum, nhl_InactiveTeamsEnum as InactiveTeamsEnum, nhl_InactiveTeamsReverseEnum as InactiveTeamsReverseEnum, nhl_PLAYER_ID_RANGE as PLAYER_ID_RANGE, nhl_PeriodTypeEnum as PeriodTypeEnum, nhl_PlayoffSeriesEnum as PlayoffSeriesEnum, nhl_SEASON_RANGE as SEASON_RANGE, nhl_START_SEASON as START_SEASON, nhl_START_YEAR as START_YEAR, nhl_SeasonsArray as SeasonsArray, nhl_SeriesLetterByRound as SeriesLetterByRound, nhl_SeriesLetterEnum as SeriesLetterEnum, nhl_TEAM_ID_RANGE as TEAM_ID_RANGE, nhl_TeamsEnum as TeamsEnum, nhl_TeamsReverseEnum as TeamsReverseEnum, nhl_YEAR_RANGE as YEAR_RANGE };
|
|
3519
|
-
}
|
|
6065
|
+
/**
|
|
6066
|
+
* Code-defined configuration for the NHL API client.
|
|
6067
|
+
*
|
|
6068
|
+
* Change these values in source when the application needs different
|
|
6069
|
+
* defaults.
|
|
6070
|
+
*/
|
|
6071
|
+
type LogLevel = 'silent' | 'error' | 'warn' | 'info' | 'debug';
|
|
6072
|
+
interface NHLConfig {
|
|
6073
|
+
/** Request timeout in milliseconds. */
|
|
6074
|
+
timeout: number;
|
|
6075
|
+
/** Language code for localized API responses. */
|
|
6076
|
+
language: 'en' | 'fr';
|
|
6077
|
+
/** Logging level for the client. */
|
|
6078
|
+
logLevel: LogLevel;
|
|
6079
|
+
}
|
|
6080
|
+
/** Default configuration used by the shared NHL API clients. */
|
|
6081
|
+
declare const config: NHLConfig;
|
|
6082
|
+
/** Log the active code-defined configuration. */
|
|
6083
|
+
declare function logConfig(): void;
|
|
3520
6084
|
|
|
3521
6085
|
declare const EDGE: {
|
|
3522
6086
|
SaveLocationCategoryEnum: {
|
|
@@ -3589,4 +6153,15 @@ declare const EDGE: {
|
|
|
3589
6153
|
};
|
|
3590
6154
|
};
|
|
3591
6155
|
|
|
3592
|
-
|
|
6156
|
+
type LogContext = unknown;
|
|
6157
|
+
/** Write a message when its level is enabled by the configured threshold. */
|
|
6158
|
+
declare function writeLog(level: Exclude<LogLevel, 'silent'>, message: string, context?: LogContext, threshold?: LogLevel): void;
|
|
6159
|
+
/** Simple level-aware logging wrappers for library messages. */
|
|
6160
|
+
declare const logger: {
|
|
6161
|
+
error: (message: string, context?: LogContext) => void;
|
|
6162
|
+
warn: (message: string, context?: LogContext) => void;
|
|
6163
|
+
info: (message: string, context?: LogContext) => void;
|
|
6164
|
+
debug: (message: string, context?: LogContext) => void;
|
|
6165
|
+
};
|
|
6166
|
+
|
|
6167
|
+
export { APIError, type APIResult, BASE_URLS, CayenneQueryBuilder, ClientError, type CountryCode, type DraftPicks, type DraftRankings, type DraftRound, type DraftTracker, EDGE, type EdgeByTheNumbers, type EdgeGoalieComparison, type EdgeGoalieDetail, type EdgeGoalieLanding, type EdgeGoalieSavePercentage, type EdgeGoalieSavePercentage5v5, type EdgeGoalieSavePercentage5v5Top10, type EdgeGoalieSavePercentage5v5Top10Entry, type EdgeGoalieSavePercentageTop10, type EdgeGoalieSavePercentageTop10Entry, type EdgeGoalieShotLocation, type EdgeGoalieShotLocationTop10, type EdgeGoalieShotLocationTop10Entry, type EdgeMeasurement, type EdgeOverlay, type EdgePeriodDescriptor, type EdgePlayer, type EdgeSeason, type EdgeSkaterComparison, type EdgeSkaterDetail, type EdgeSkaterDistanceTop10, type EdgeSkaterDistanceTop10Entry, type EdgeSkaterLanding, type EdgeSkaterShotLocation, type EdgeSkaterShotLocationTop10, type EdgeSkaterShotLocationTop10Entry, type EdgeSkaterShotSpeed, type EdgeSkaterShotSpeedTop10, type EdgeSkaterShotSpeedTop10Entry, type EdgeSkaterSkatingDistance, type EdgeSkaterSkatingSpeed, type EdgeSkaterSpeedTop10, type EdgeSkaterSpeedTop10Entry, type EdgeSkaterZoneTime, type EdgeSkaterZoneTimeTop10, type EdgeSkaterZoneTimeTop10Entry, type EdgeTeam, type EdgeTeamComparison, type EdgeTeamDetail, type EdgeTeamLanding, type EdgeTeamLogos, type EdgeTeamShotLocation, type EdgeTeamShotLocationTop10, type EdgeTeamShotLocationTop10Entry, type EdgeTeamShotSpeed, type EdgeTeamShotSpeedTop10, type EdgeTeamShotSpeedTop10Entry, type EdgeTeamSkatingDistance, type EdgeTeamSkatingDistanceTop10, type EdgeTeamSkatingDistanceTop10Entry, type EdgeTeamSkatingSpeed, type EdgeTeamSkatingSpeedTop10, type EdgeTeamSkatingSpeedTop10Entry, type EdgeTeamZoneTime, type EdgeTeamZoneTimeTop10, type EdgeTeamZoneTimeTop10Entry, ErrorCategory, type ErrorConfig, type ErrorContext, ErrorHandler, LogLevel$1 as ErrorLogLevel, type EventId, type GameId, type GameMeta, type GameNumber, type GameState, type GameType, type GamecenterBoxscore, type GamecenterLanding, type GamecenterPlayByPlay, type GamecenterReports, type GoalieStatsLeaders, type LeagueSchedule, type LocalizedText, type LocationInfo, type LogContext, type LogLevel, NHLClient, type NHLClientConfig, type NHLClientWithErrorConfig, type NHLConfig, type NHLDate, NHLError, type NHLMonth, type NHLSeasons, type NHLStandings, type NHLStandingsSeason, NetworkError, type NetworkTVSchedule, NotFoundError, type PPTReplayEvent, type PPTReplayGoal, ParseError, type PartnerGameInfo, type PlayerGameLog, type PlayerId, type PlayerLanding, type PlayerSearchResult, type PlayerSpotlight, type PlayoffBracket, type PlayoffRound, type PlayoffSeries, type PlayoffSeriesMeta, type PlayoffSeriesSchedule, type PositionFilter, type PostalCode, type PostalCodeInfo, RateLimitError, type SaveLocationCategory, type SaveLocationSort, type SavePercentage5v5Sort, type SavePercentageSort, type ScheduleCalendar, type Score, type Scoreboard, type Season$1 as Season, type SeriesLetter$1 as SeriesLetter, ServerError, type ShotLocationCategory, type ShotLocationSort, type ShotSpeedSort, type SkaterStatsLeaders, type SkatersStrength, type SkatingDistanceSort, type SkatingSpeedSort, type TeamAbbrev, type TeamId, type TeamProspects, type TeamRoster, type TeamRosterSeasons, type TeamScheduleMonth, type TeamScheduleSeason, type TeamScheduleWeek, type TeamStats, type TeamStatsSeason, ValidationError, type WSCGameStory, type WSCPlayByPlay, type WSCPlayByPlayEvent, type WhereToWatch, type Year, type ZoneTimeSort, index$2 as adv, config, createNHLClient, index as gc, logConfig, logger, index$1 as stats, video, writeLog };
|