-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.ts
57 lines (53 loc) · 1.13 KB
/
interfaces.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* Represents a sports team.
*
* @interface
*/
interface Team {
/** The name of the team. */
name: string
/** The team colors. */
colors: string[]
/** The nicknames of the team. */
nicknames: string[]
/** The abbreviations of the team. */
abbrev: string[]
}
/**
* Represents a list of teams categorized by sport.
*
* This is the source library the {@linkcode resolveTeam API} will use to identify and resolve team data.
*
* @interface
*/
interface TeamList {
/** List of NBA teams. */
nba: Team[]
/** List of NFL teams. */
nfl: Team[]
}
/**
* The default options the {@linkcode resolveTeam API} uses for the Fuse.js search.
*
* @constant
* @type {Options}
*/
const defaultOptions: Options = {
sport: 'all',
threshold: 0.4,
full: false,
}
/**
* Represents the options for the {@linkcode resolveTeam API} to use with the Fuse.js search.
*
* @interface
*/
interface Options {
/** The sport category to search within. */
sport?: string
/** The threshold for the Fuse.js search. */
threshold?: number
/** Flag to return full team details. */
full?: boolean
}
export { Team, TeamList, defaultOptions, Options }