nhle-api 0.5.4 → 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 +40 -0
- package/README.md +319 -234
- package/lib/index.cjs +922 -418
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +3071 -802
- package/lib/index.d.ts +3071 -802
- package/lib/index.js +899 -417
- 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 +42 -11
package/lib/toolkit.d.ts
ADDED
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
import { T as TeamsEnum } from './nhl-B7Hg7iMB.js';
|
|
2
|
+
export { a as CayenneCondition, c as CayenneExpression, d as CayenneGroup, C as CayenneQueryBuilder, n as NHL, b as buildCayenneExp, e as createCayenneQuery } from './nhl-B7Hg7iMB.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* NHL season and date utilities.
|
|
6
|
+
*
|
|
7
|
+
* These helpers define the calendar semantics used by NHL API parameters.
|
|
8
|
+
* Calendar values are evaluated in the NHL's eastern time zone
|
|
9
|
+
* (`America/New_York`), regardless of the process's local time zone. Use
|
|
10
|
+
* `getDate` and `getMonth` when converting `Date` values for API calls.
|
|
11
|
+
*/
|
|
12
|
+
/** Canonical timezone for NHL calendar dates and API date parameters. */
|
|
13
|
+
declare const NHL_TIMEZONE = "America/New_York";
|
|
14
|
+
/**
|
|
15
|
+
* Formats a date as the NHL API's `YYYY-MM-DD` calendar parameter.
|
|
16
|
+
*
|
|
17
|
+
* The calendar date is resolved in {@link NHL_TIMEZONE}, not UTC.
|
|
18
|
+
* @param date - A valid date to format.
|
|
19
|
+
* @returns The date formatted as `YYYY-MM-DD`.
|
|
20
|
+
* @throws RangeError If `date` is invalid.
|
|
21
|
+
*/
|
|
22
|
+
declare const getNHLDate: (date: Date) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the current date as `YYYY-MM-DD` in the NHL eastern time zone.
|
|
25
|
+
* @returns The current date formatted as `YYYY-MM-DD`.
|
|
26
|
+
*/
|
|
27
|
+
declare const getCurrentNHLDate: () => string;
|
|
28
|
+
/**
|
|
29
|
+
* Formats a date as the NHL API's `YYYY-MM` calendar parameter.
|
|
30
|
+
*
|
|
31
|
+
* The calendar month is resolved in {@link NHL_TIMEZONE}, not UTC.
|
|
32
|
+
* @param date - A valid date to format.
|
|
33
|
+
* @returns The month formatted as `YYYY-MM`.
|
|
34
|
+
* @throws RangeError If `date` is invalid.
|
|
35
|
+
*/
|
|
36
|
+
declare const getNHLMonth: (date: Date) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the current month as `YYYY-MM` in the NHL eastern time zone.
|
|
39
|
+
* @returns The current month formatted as `YYYY-MM`.
|
|
40
|
+
*/
|
|
41
|
+
declare const getCurrentNHLMonth: () => string;
|
|
42
|
+
/**
|
|
43
|
+
* Formats a date as `YYYY` in the NHL eastern time zone.
|
|
44
|
+
* @param date - A valid date to format.
|
|
45
|
+
* @returns The year formatted as `YYYY`.
|
|
46
|
+
* @throws RangeError If `date` is invalid.
|
|
47
|
+
*/
|
|
48
|
+
declare const getYear: (date: Date) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Returns the current year as `YYYY` in the NHL eastern time zone.
|
|
51
|
+
* @returns The current year formatted as `YYYY`.
|
|
52
|
+
*/
|
|
53
|
+
declare const getCurrentNHLYear: () => string;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the NHL season label associated with a date as `yyyyYYYY` (for
|
|
56
|
+
* example, `20232024`). The season label starts on July 1: dates from
|
|
57
|
+
* January through June belong to the season that started in the previous
|
|
58
|
+
* calendar year, while dates from July through December belong to the season
|
|
59
|
+
* starting in the current calendar year.
|
|
60
|
+
*
|
|
61
|
+
* The month is resolved in {@link NHL_TIMEZONE}.
|
|
62
|
+
* @param date - A valid `Date` or a date string accepted by the `Date` constructor.
|
|
63
|
+
* @returns The season formatted as `yyyyYYYY`.
|
|
64
|
+
* @throws RangeError If the date is invalid.
|
|
65
|
+
*/
|
|
66
|
+
declare const getSeason: (date: string | Date) => string;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the current NHL season as `yyyyYYYY` in the NHL eastern time zone.
|
|
69
|
+
* @returns The current season formatted as `yyyyYYYY`.
|
|
70
|
+
*/
|
|
71
|
+
declare const getCurrentSeason: () => string;
|
|
72
|
+
/** Lower bound used when validating NHL API date ranges. */
|
|
73
|
+
declare const NHL_START_DATE: Date;
|
|
74
|
+
/**
|
|
75
|
+
* Upper bound for the current NHL season, set to June 30 of its ending year.
|
|
76
|
+
*/
|
|
77
|
+
declare const NHL_END_DATE: Date;
|
|
78
|
+
|
|
79
|
+
declare const normalizeAbbrev: (abbrev: string) => string;
|
|
80
|
+
|
|
81
|
+
/** A CSS-compatible hexadecimal team colour. */
|
|
82
|
+
type TeamColor = `#${string}`;
|
|
83
|
+
/** The supported NHL logo treatments. */
|
|
84
|
+
type TeamLogoTheme = 'light' | 'dark';
|
|
85
|
+
/** Options for building an official NHL team logo URL. */
|
|
86
|
+
interface TeamLogoOptions {
|
|
87
|
+
theme?: TeamLogoTheme;
|
|
88
|
+
secondary?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/** Current colours and identity metadata for an NHL team. */
|
|
91
|
+
interface TeamBranding {
|
|
92
|
+
name: string;
|
|
93
|
+
primaryColor: TeamColor;
|
|
94
|
+
colors: Readonly<Record<string, TeamColor>>;
|
|
95
|
+
}
|
|
96
|
+
/** Historical colour set for a team or franchise. */
|
|
97
|
+
interface HistoricalTeamColors {
|
|
98
|
+
period: string;
|
|
99
|
+
colors: Readonly<Record<string, TeamColor>>;
|
|
100
|
+
}
|
|
101
|
+
type ActiveTeamAbbreviation = keyof typeof TeamsEnum;
|
|
102
|
+
/**
|
|
103
|
+
* Current NHL team colours.
|
|
104
|
+
*
|
|
105
|
+
* Values are based on the local NHL colour-code research dataset. The first
|
|
106
|
+
* value in each `colors` object is the team's primary brand colour.
|
|
107
|
+
*/
|
|
108
|
+
declare const TEAM_BRANDING: {
|
|
109
|
+
readonly ANA: {
|
|
110
|
+
readonly name: "Anaheim Ducks";
|
|
111
|
+
readonly primaryColor: "#F47A38";
|
|
112
|
+
readonly colors: {
|
|
113
|
+
readonly orange: "#F47A38";
|
|
114
|
+
readonly metallicGold: "#B9975B";
|
|
115
|
+
readonly silver: "#C1C6C8";
|
|
116
|
+
readonly black: "#000000";
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
readonly BOS: {
|
|
120
|
+
readonly name: "Boston Bruins";
|
|
121
|
+
readonly primaryColor: "#FFB81C";
|
|
122
|
+
readonly colors: {
|
|
123
|
+
readonly gold: "#FFB81C";
|
|
124
|
+
readonly black: "#000000";
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
readonly BUF: {
|
|
128
|
+
readonly name: "Buffalo Sabres";
|
|
129
|
+
readonly primaryColor: "#003087";
|
|
130
|
+
readonly colors: {
|
|
131
|
+
readonly royalBlue: "#003087";
|
|
132
|
+
readonly gold: "#FFB81C";
|
|
133
|
+
readonly white: "#FFFFFF";
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
readonly CGY: {
|
|
137
|
+
readonly name: "Calgary Flames";
|
|
138
|
+
readonly primaryColor: "#D2001C";
|
|
139
|
+
readonly colors: {
|
|
140
|
+
readonly red: "#D2001C";
|
|
141
|
+
readonly yellow: "#FAAF19";
|
|
142
|
+
readonly white: "#FFFFFF";
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
readonly CAR: {
|
|
146
|
+
readonly name: "Carolina Hurricanes";
|
|
147
|
+
readonly primaryColor: "#CE1126";
|
|
148
|
+
readonly colors: {
|
|
149
|
+
readonly red: "#CE1126";
|
|
150
|
+
readonly white: "#FFFFFF";
|
|
151
|
+
readonly gray: "#A4A9AD";
|
|
152
|
+
readonly black: "#000000";
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
readonly CHI: {
|
|
156
|
+
readonly name: "Chicago Blackhawks";
|
|
157
|
+
readonly primaryColor: "#CF0A2C";
|
|
158
|
+
readonly colors: {
|
|
159
|
+
readonly red: "#CF0A2C";
|
|
160
|
+
readonly orange: "#FF671B";
|
|
161
|
+
readonly green: "#00833E";
|
|
162
|
+
readonly yellow: "#FFD100";
|
|
163
|
+
readonly tan: "#D18A00";
|
|
164
|
+
readonly blue: "#001970";
|
|
165
|
+
readonly black: "#000000";
|
|
166
|
+
readonly white: "#FFFFFF";
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
readonly COL: {
|
|
170
|
+
readonly name: "Colorado Avalanche";
|
|
171
|
+
readonly primaryColor: "#6F263D";
|
|
172
|
+
readonly colors: {
|
|
173
|
+
readonly burgundy: "#6F263D";
|
|
174
|
+
readonly blue: "#236192";
|
|
175
|
+
readonly silver: "#A2AAAD";
|
|
176
|
+
readonly black: "#000000";
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
readonly CBJ: {
|
|
180
|
+
readonly name: "Columbus Blue Jackets";
|
|
181
|
+
readonly primaryColor: "#002654";
|
|
182
|
+
readonly colors: {
|
|
183
|
+
readonly unionBlue: "#002654";
|
|
184
|
+
readonly goalRed: "#CE1126";
|
|
185
|
+
readonly capitalSilver: "#A4A9AD";
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
readonly DAL: {
|
|
189
|
+
readonly name: "Dallas Stars";
|
|
190
|
+
readonly primaryColor: "#006847";
|
|
191
|
+
readonly colors: {
|
|
192
|
+
readonly victoryGreen: "#006847";
|
|
193
|
+
readonly silver: "#8F8F8C";
|
|
194
|
+
readonly black: "#111111";
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
readonly DET: {
|
|
198
|
+
readonly name: "Detroit Red Wings";
|
|
199
|
+
readonly primaryColor: "#CE1126";
|
|
200
|
+
readonly colors: {
|
|
201
|
+
readonly red: "#CE1126";
|
|
202
|
+
readonly white: "#FFFFFF";
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
readonly EDM: {
|
|
206
|
+
readonly name: "Edmonton Oilers";
|
|
207
|
+
readonly primaryColor: "#041E42";
|
|
208
|
+
readonly colors: {
|
|
209
|
+
readonly blue: "#041E42";
|
|
210
|
+
readonly orange: "#FF4C00";
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
readonly FLA: {
|
|
214
|
+
readonly name: "Florida Panthers";
|
|
215
|
+
readonly primaryColor: "#041E42";
|
|
216
|
+
readonly colors: {
|
|
217
|
+
readonly navy: "#041E42";
|
|
218
|
+
readonly red: "#C8102E";
|
|
219
|
+
readonly tan: "#B9975B";
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
readonly LAK: {
|
|
223
|
+
readonly name: "Los Angeles Kings";
|
|
224
|
+
readonly primaryColor: "#111111";
|
|
225
|
+
readonly colors: {
|
|
226
|
+
readonly black: "#111111";
|
|
227
|
+
readonly silver: "#A2AAAD";
|
|
228
|
+
readonly white: "#FFFFFF";
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
readonly MIN: {
|
|
232
|
+
readonly name: "Minnesota Wild";
|
|
233
|
+
readonly primaryColor: "#A6192E";
|
|
234
|
+
readonly colors: {
|
|
235
|
+
readonly ironRangeRed: "#A6192E";
|
|
236
|
+
readonly forestGreen: "#154734";
|
|
237
|
+
readonly gold: "#EAAA00";
|
|
238
|
+
readonly minnesotaWheat: "#DDCBA4";
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
readonly MTL: {
|
|
242
|
+
readonly name: "Montreal Canadiens";
|
|
243
|
+
readonly primaryColor: "#AF1E2D";
|
|
244
|
+
readonly colors: {
|
|
245
|
+
readonly red: "#AF1E2D";
|
|
246
|
+
readonly blue: "#192168";
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
readonly NJD: {
|
|
250
|
+
readonly name: "New Jersey Devils";
|
|
251
|
+
readonly primaryColor: "#CE1126";
|
|
252
|
+
readonly colors: {
|
|
253
|
+
readonly red: "#CE1126";
|
|
254
|
+
readonly black: "#000000";
|
|
255
|
+
readonly white: "#FFFFFF";
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
readonly NSH: {
|
|
259
|
+
readonly name: "Nashville Predators";
|
|
260
|
+
readonly primaryColor: "#FFB81C";
|
|
261
|
+
readonly colors: {
|
|
262
|
+
readonly gold: "#FFB81C";
|
|
263
|
+
readonly navyBlue: "#041E42";
|
|
264
|
+
readonly white: "#FFFFFF";
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
readonly NYI: {
|
|
268
|
+
readonly name: "New York Islanders";
|
|
269
|
+
readonly primaryColor: "#00539B";
|
|
270
|
+
readonly colors: {
|
|
271
|
+
readonly blue: "#00539B";
|
|
272
|
+
readonly orange: "#F47D30";
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
readonly NYR: {
|
|
276
|
+
readonly name: "New York Rangers";
|
|
277
|
+
readonly primaryColor: "#0038A8";
|
|
278
|
+
readonly colors: {
|
|
279
|
+
readonly blue: "#0038A8";
|
|
280
|
+
readonly red: "#CE1126";
|
|
281
|
+
readonly white: "#FFFFFF";
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
readonly OTT: {
|
|
285
|
+
readonly name: "Ottawa Senators";
|
|
286
|
+
readonly primaryColor: "#000000";
|
|
287
|
+
readonly colors: {
|
|
288
|
+
readonly black: "#000000";
|
|
289
|
+
readonly red: "#DA1A32";
|
|
290
|
+
readonly gold: "#B79257";
|
|
291
|
+
readonly white: "#FFFFFF";
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
readonly PHI: {
|
|
295
|
+
readonly name: "Philadelphia Flyers";
|
|
296
|
+
readonly primaryColor: "#F74902";
|
|
297
|
+
readonly colors: {
|
|
298
|
+
readonly flyersOrange: "#F74902";
|
|
299
|
+
readonly black: "#000000";
|
|
300
|
+
readonly white: "#FFFFFF";
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
readonly PIT: {
|
|
304
|
+
readonly name: "Pittsburgh Penguins";
|
|
305
|
+
readonly primaryColor: "#000000";
|
|
306
|
+
readonly colors: {
|
|
307
|
+
readonly black: "#000000";
|
|
308
|
+
readonly gold: "#CFC493";
|
|
309
|
+
readonly yellow: "#FCB514";
|
|
310
|
+
readonly white: "#FFFFFF";
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
readonly SJS: {
|
|
314
|
+
readonly name: "San Jose Sharks";
|
|
315
|
+
readonly primaryColor: "#006D75";
|
|
316
|
+
readonly colors: {
|
|
317
|
+
readonly teal: "#006D75";
|
|
318
|
+
readonly orange: "#EA7200";
|
|
319
|
+
readonly black: "#000000";
|
|
320
|
+
readonly white: "#FFFFFF";
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
readonly SEA: {
|
|
324
|
+
readonly name: "Seattle Kraken";
|
|
325
|
+
readonly primaryColor: "#001628";
|
|
326
|
+
readonly colors: {
|
|
327
|
+
readonly deepSeaBlue: "#001628";
|
|
328
|
+
readonly iceBlue: "#99D9D9";
|
|
329
|
+
readonly boundlessBlue: "#355464";
|
|
330
|
+
readonly shadowBlue: "#68A2B9";
|
|
331
|
+
readonly redAlert: "#E9072B";
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
readonly STL: {
|
|
335
|
+
readonly name: "St. Louis Blues";
|
|
336
|
+
readonly primaryColor: "#002F87";
|
|
337
|
+
readonly colors: {
|
|
338
|
+
readonly blue: "#002F87";
|
|
339
|
+
readonly yellow: "#FCB514";
|
|
340
|
+
readonly navyBlue: "#041E42";
|
|
341
|
+
readonly white: "#FFFFFF";
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
readonly TBL: {
|
|
345
|
+
readonly name: "Tampa Bay Lightning";
|
|
346
|
+
readonly primaryColor: "#002868";
|
|
347
|
+
readonly colors: {
|
|
348
|
+
readonly blue: "#002868";
|
|
349
|
+
readonly white: "#FFFFFF";
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
readonly TOR: {
|
|
353
|
+
readonly name: "Toronto Maple Leafs";
|
|
354
|
+
readonly primaryColor: "#00205B";
|
|
355
|
+
readonly colors: {
|
|
356
|
+
readonly blue: "#00205B";
|
|
357
|
+
readonly white: "#FFFFFF";
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
readonly UTA: {
|
|
361
|
+
readonly name: "Utah Mammoth";
|
|
362
|
+
readonly primaryColor: "#69B3E7";
|
|
363
|
+
readonly colors: {
|
|
364
|
+
readonly mountainBlue: "#69B3E7";
|
|
365
|
+
readonly rockBlack: "#010101";
|
|
366
|
+
readonly saltWhite: "#FFFFFF";
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
readonly VAN: {
|
|
370
|
+
readonly name: "Vancouver Canucks";
|
|
371
|
+
readonly primaryColor: "#00205B";
|
|
372
|
+
readonly colors: {
|
|
373
|
+
readonly blue: "#00205B";
|
|
374
|
+
readonly green: "#00843D";
|
|
375
|
+
readonly darkBlue: "#041C2C";
|
|
376
|
+
readonly gray: "#99999A";
|
|
377
|
+
readonly white: "#FFFFFF";
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
readonly VGK: {
|
|
381
|
+
readonly name: "Vegas Golden Knights";
|
|
382
|
+
readonly primaryColor: "#B4975A";
|
|
383
|
+
readonly colors: {
|
|
384
|
+
readonly gold: "#B4975A";
|
|
385
|
+
readonly steelGray: "#333F42";
|
|
386
|
+
readonly red: "#C8102E";
|
|
387
|
+
readonly black: "#000000";
|
|
388
|
+
readonly white: "#FFFFFF";
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
readonly WSH: {
|
|
392
|
+
readonly name: "Washington Capitals";
|
|
393
|
+
readonly primaryColor: "#041E42";
|
|
394
|
+
readonly colors: {
|
|
395
|
+
readonly navy: "#041E42";
|
|
396
|
+
readonly red: "#C8102E";
|
|
397
|
+
readonly white: "#FFFFFF";
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
readonly WPG: {
|
|
401
|
+
readonly name: "Winnipeg Jets";
|
|
402
|
+
readonly primaryColor: "#041E42";
|
|
403
|
+
readonly colors: {
|
|
404
|
+
readonly navy: "#041E42";
|
|
405
|
+
readonly blue: "#004C97";
|
|
406
|
+
readonly red: "#AC162C";
|
|
407
|
+
readonly maroon: "#7B303E";
|
|
408
|
+
readonly darkGray: "#55565A";
|
|
409
|
+
readonly silver: "#8E9090";
|
|
410
|
+
readonly white: "#FFFFFF";
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
/** Historical colour palettes included in the local research dataset. */
|
|
415
|
+
declare const HISTORICAL_TEAM_COLORS: {
|
|
416
|
+
readonly ANA: {
|
|
417
|
+
readonly period: "1993-2006";
|
|
418
|
+
readonly colors: {
|
|
419
|
+
readonly green: "#00685E";
|
|
420
|
+
readonly purple: "#532A44";
|
|
421
|
+
readonly yellow: "#FCC72C";
|
|
422
|
+
readonly black: "#241E24";
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
readonly ARI: {
|
|
426
|
+
readonly period: "1996-2014";
|
|
427
|
+
readonly colors: {
|
|
428
|
+
readonly brickRed: "#8C2633";
|
|
429
|
+
readonly green: "#154734";
|
|
430
|
+
readonly desertSand: "#DDCBA4";
|
|
431
|
+
readonly brown: "#A9431E";
|
|
432
|
+
readonly purple: "#5F259F";
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
readonly BUF: {
|
|
436
|
+
readonly period: "2006-2020";
|
|
437
|
+
readonly colors: {
|
|
438
|
+
readonly navyBlue: "#002654";
|
|
439
|
+
readonly yellow: "#FCB514";
|
|
440
|
+
readonly silver: "#ADAFAA";
|
|
441
|
+
readonly red: "#C8102E";
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
readonly CGY: {
|
|
445
|
+
readonly period: "1994-2020";
|
|
446
|
+
readonly colors: {
|
|
447
|
+
readonly red: "#C8102E";
|
|
448
|
+
readonly gold: "#F1BE48";
|
|
449
|
+
readonly black: "#111111";
|
|
450
|
+
readonly white: "#FFFFFF";
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
readonly LAK: {
|
|
454
|
+
readonly period: "1967-1988";
|
|
455
|
+
readonly colors: {
|
|
456
|
+
readonly purple: "#572A84";
|
|
457
|
+
readonly goldenYellow: "#FFC80C";
|
|
458
|
+
readonly white: "#FFFFFF";
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
readonly OTT: {
|
|
462
|
+
readonly period: "2007-2020";
|
|
463
|
+
readonly colors: {
|
|
464
|
+
readonly red: "#C52032";
|
|
465
|
+
readonly gold: "#C2912C";
|
|
466
|
+
readonly black: "#000000";
|
|
467
|
+
readonly white: "#FFFFFF";
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
/**
|
|
472
|
+
* Returns current branding for an active team abbreviation.
|
|
473
|
+
*
|
|
474
|
+
* Alternate abbreviations such as `TB`, `LA`, and `UTAH` are normalized before
|
|
475
|
+
* lookup. Returns `undefined` for unknown or inactive abbreviations.
|
|
476
|
+
*/
|
|
477
|
+
declare function getTeamBranding(abbreviation: string): (typeof TEAM_BRANDING)[ActiveTeamAbbreviation] | undefined;
|
|
478
|
+
/**
|
|
479
|
+
* Builds an official NHL SVG logo URL for an active team.
|
|
480
|
+
*
|
|
481
|
+
* @throws {RangeError} If `abbreviation` is not an active NHL team.
|
|
482
|
+
*/
|
|
483
|
+
declare function getTeamLogoUrl(abbreviation: string, options?: TeamLogoOptions): string;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Resolves a path template by replacing placeholders with actual values from the params object.
|
|
487
|
+
* Placeholders in the template should be in the format `{key}` where `key` corresponds to a key in the params object.
|
|
488
|
+
* If a value in params is undefined, the placeholder will not be replaced.
|
|
489
|
+
*
|
|
490
|
+
* @param template - The path template containing placeholders (e.g., '/teams/{team}/stats')
|
|
491
|
+
* @param params - An object mapping placeholder keys to their replacement values (e.g., { team: 'TOR' })
|
|
492
|
+
* @returns The resolved path with placeholders replaced by actual values (e.g., '/teams/TOR/stats')
|
|
493
|
+
*
|
|
494
|
+
* @example
|
|
495
|
+
* const pathTemplate = '/teams/{team}/stats';
|
|
496
|
+
* const params = { team: 'TOR' };
|
|
497
|
+
* const resolvedPath = resolvePath(pathTemplate, params);
|
|
498
|
+
* console.log(resolvedPath); // Output: '/teams/TOR/stats'
|
|
499
|
+
*/
|
|
500
|
+
declare function resolvePath(template: string, params: Record<string, string | number | undefined>): string;
|
|
501
|
+
|
|
502
|
+
export { HISTORICAL_TEAM_COLORS, type HistoricalTeamColors, NHL_END_DATE, NHL_START_DATE, NHL_TIMEZONE, TEAM_BRANDING, type TeamBranding, type TeamColor, type TeamLogoOptions, type TeamLogoTheme, getCurrentNHLDate, getCurrentNHLMonth, getCurrentNHLYear, getCurrentSeason, getNHLDate, getNHLMonth, getSeason, getTeamBranding, getTeamLogoUrl, getYear, normalizeAbbrev, resolvePath };
|