fansunited-data-layer 0.2.0 → 0.2.2
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/api/fansunited/constants.d.ts +5 -0
- package/api/fansunited/constants.d.ts.map +1 -0
- package/api/fansunited/football/competition/index.d.ts +30 -0
- package/api/fansunited/football/competition/index.d.ts.map +1 -0
- package/api/fansunited/football/competition/transformer.d.ts +11 -0
- package/api/fansunited/football/competition/transformer.d.ts.map +1 -0
- package/api/fansunited/football/competition/types.d.ts +70 -0
- package/api/fansunited/football/competition/types.d.ts.map +1 -0
- package/api/fansunited/football/competitions/index.d.ts +27 -0
- package/api/fansunited/football/competitions/index.d.ts.map +1 -0
- package/api/fansunited/football/competitions/transformer.d.ts +14 -0
- package/api/fansunited/football/competitions/transformer.d.ts.map +1 -0
- package/api/fansunited/football/competitions/types.d.ts +67 -0
- package/api/fansunited/football/competitions/types.d.ts.map +1 -0
- package/api/fansunited/football/http.d.ts +8 -0
- package/api/fansunited/football/http.d.ts.map +1 -0
- package/api/fansunited/football/index.d.ts +19 -0
- package/api/fansunited/football/index.d.ts.map +1 -0
- package/api/fansunited/football/matches/index.d.ts +61 -0
- package/api/fansunited/football/matches/index.d.ts.map +1 -0
- package/api/fansunited/football/matches/transformer.d.ts +28 -0
- package/api/fansunited/football/matches/transformer.d.ts.map +1 -0
- package/api/fansunited/football/matches/types.d.ts +328 -0
- package/api/fansunited/football/matches/types.d.ts.map +1 -0
- package/api/fansunited/football/players/index.d.ts +30 -0
- package/api/fansunited/football/players/index.d.ts.map +1 -0
- package/api/fansunited/football/players/transformer.d.ts +10 -0
- package/api/fansunited/football/players/transformer.d.ts.map +1 -0
- package/api/fansunited/football/players/types.d.ts +70 -0
- package/api/fansunited/football/players/types.d.ts.map +1 -0
- package/api/fansunited/football/search/index.d.ts +49 -0
- package/api/fansunited/football/search/index.d.ts.map +1 -0
- package/api/fansunited/football/search/transformer.d.ts +10 -0
- package/api/fansunited/football/search/transformer.d.ts.map +1 -0
- package/api/fansunited/football/search/types.d.ts +151 -0
- package/api/fansunited/football/search/types.d.ts.map +1 -0
- package/api/fansunited/football/teams/index.d.ts +30 -0
- package/api/fansunited/football/teams/index.d.ts.map +1 -0
- package/api/fansunited/football/teams/transformer.d.ts +10 -0
- package/api/fansunited/football/teams/transformer.d.ts.map +1 -0
- package/api/fansunited/football/teams/types.d.ts +87 -0
- package/api/fansunited/football/teams/types.d.ts.map +1 -0
- package/api/fansunited/http.d.ts +54 -0
- package/api/fansunited/http.d.ts.map +1 -0
- package/api/fansunited/index.d.ts +10 -0
- package/api/fansunited/index.d.ts.map +1 -0
- package/api/sportal365-sports/constants.d.ts +16 -0
- package/api/sportal365-sports/constants.d.ts.map +1 -0
- package/api/sportal365-sports/football/competitions/competition.types.d.ts +148 -0
- package/api/sportal365-sports/football/competitions/competition.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/competitions/index.d.ts +54 -0
- package/api/sportal365-sports/football/competitions/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/competitions/utils.d.ts +14 -0
- package/api/sportal365-sports/football/competitions/utils.d.ts.map +1 -0
- package/api/sportal365-sports/football/http.d.ts +8 -0
- package/api/sportal365-sports/football/http.d.ts.map +1 -0
- package/api/sportal365-sports/football/index.d.ts +19 -0
- package/api/sportal365-sports/football/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/index.d.ts +151 -0
- package/api/sportal365-sports/football/matches/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/commentary.d.ts +12 -0
- package/api/sportal365-sports/football/matches/transformers/commentary.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/index.d.ts +10 -0
- package/api/sportal365-sports/football/matches/transformers/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/lineup.d.ts +11 -0
- package/api/sportal365-sports/football/matches/transformers/lineup.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/match-event.d.ts +12 -0
- package/api/sportal365-sports/football/matches/transformers/match-event.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/match.d.ts +11 -0
- package/api/sportal365-sports/football/matches/transformers/match.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/odds.d.ts +11 -0
- package/api/sportal365-sports/football/matches/transformers/odds.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/statistics.d.ts +11 -0
- package/api/sportal365-sports/football/matches/transformers/statistics.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/commentary.types.d.ts +27 -0
- package/api/sportal365-sports/football/matches/types/commentary.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/event.types.d.ts +19 -0
- package/api/sportal365-sports/football/matches/types/event.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/index.d.ts +16 -0
- package/api/sportal365-sports/football/matches/types/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/lineup.types.d.ts +80 -0
- package/api/sportal365-sports/football/matches/types/lineup.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/match.types.d.ts +47 -0
- package/api/sportal365-sports/football/matches/types/match.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/minute.types.d.ts +8 -0
- package/api/sportal365-sports/football/matches/types/minute.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/odds.types.d.ts +80 -0
- package/api/sportal365-sports/football/matches/types/odds.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/option.types.d.ts +129 -0
- package/api/sportal365-sports/football/matches/types/option.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/referee.types.d.ts +13 -0
- package/api/sportal365-sports/football/matches/types/referee.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/statistics.types.d.ts +45 -0
- package/api/sportal365-sports/football/matches/types/statistics.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/status.types.d.ts +13 -0
- package/api/sportal365-sports/football/matches/types/status.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/team.types.d.ts +17 -0
- package/api/sportal365-sports/football/matches/types/team.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/winner.types.d.ts +15 -0
- package/api/sportal365-sports/football/matches/types/winner.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/search/index.d.ts +45 -0
- package/api/sportal365-sports/football/search/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/search/search.transformer.d.ts +10 -0
- package/api/sportal365-sports/football/search/search.transformer.d.ts.map +1 -0
- package/api/sportal365-sports/football/search/search.types.d.ts +147 -0
- package/api/sportal365-sports/football/search/search.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/standings/index.d.ts +43 -0
- package/api/sportal365-sports/football/standings/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/standings/standing.transformer.d.ts +15 -0
- package/api/sportal365-sports/football/standings/standing.transformer.d.ts.map +1 -0
- package/api/sportal365-sports/football/standings/standing.types.d.ts +73 -0
- package/api/sportal365-sports/football/standings/standing.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/statistics/index.d.ts +42 -0
- package/api/sportal365-sports/football/statistics/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/statistics/player-season.transformer.d.ts +11 -0
- package/api/sportal365-sports/football/statistics/player-season.transformer.d.ts.map +1 -0
- package/api/sportal365-sports/football/statistics/player-season.types.d.ts +84 -0
- package/api/sportal365-sports/football/statistics/player-season.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/teams/index.d.ts +53 -0
- package/api/sportal365-sports/football/teams/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/teams/squad.types.d.ts +63 -0
- package/api/sportal365-sports/football/teams/squad.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/teams/team.types.d.ts +58 -0
- package/api/sportal365-sports/football/teams/team.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/teams/utils.d.ts +24 -0
- package/api/sportal365-sports/football/teams/utils.d.ts.map +1 -0
- package/api/sportal365-sports/http.d.ts +59 -0
- package/api/sportal365-sports/http.d.ts.map +1 -0
- package/api/sportal365-sports/index.d.ts +14 -0
- package/api/sportal365-sports/index.d.ts.map +1 -0
- package/api/sportal365-sports/search/http.d.ts +8 -0
- package/api/sportal365-sports/search/http.d.ts.map +1 -0
- package/api/sportal365-sports/search/index.d.ts +43 -0
- package/api/sportal365-sports/search/index.d.ts.map +1 -0
- package/api/sportal365-sports/search/search.transformer.d.ts +10 -0
- package/api/sportal365-sports/search/search.transformer.d.ts.map +1 -0
- package/api/sportal365-sports/search/search.types.d.ts +209 -0
- package/api/sportal365-sports/search/search.types.d.ts.map +1 -0
- package/api/sportal365-sports/shared/index.d.ts +6 -0
- package/api/sportal365-sports/shared/index.d.ts.map +1 -0
- package/api/sportal365-sports/shared/providerRef.helper.d.ts +79 -0
- package/api/sportal365-sports/shared/providerRef.helper.d.ts.map +1 -0
- package/api/sportal365-sports/shared/types.d.ts +189 -0
- package/api/sportal365-sports/shared/types.d.ts.map +1 -0
- package/api/sportal365-sports/statistics/http.d.ts +8 -0
- package/api/sportal365-sports/statistics/http.d.ts.map +1 -0
- package/api/sportal365-sports/statistics/index.d.ts +55 -0
- package/api/sportal365-sports/statistics/index.d.ts.map +1 -0
- package/api/sportal365-sports/statistics/team-stats.transformer.d.ts +14 -0
- package/api/sportal365-sports/statistics/team-stats.transformer.d.ts.map +1 -0
- package/api/sportal365-sports/statistics/team-stats.types.d.ts +45 -0
- package/api/sportal365-sports/statistics/team-stats.types.d.ts.map +1 -0
- package/client.cjs +8 -0
- package/client.d.ts +20 -0
- package/client.d.ts.map +1 -0
- package/client.js +12065 -0
- package/config/index.d.ts +31 -0
- package/config/index.d.ts.map +1 -0
- package/config/types.d.ts +36 -0
- package/config/types.d.ts.map +1 -0
- package/fansunited-data-layer.cjs +1 -0
- package/fansunited-data-layer.js +1739 -0
- package/helpers/competition.helpers.d.ts +22 -0
- package/helpers/competition.helpers.d.ts.map +1 -0
- package/helpers/index.d.ts +7 -0
- package/helpers/index.d.ts.map +1 -0
- package/helpers/team.helpers.d.ts +289 -0
- package/helpers/team.helpers.d.ts.map +1 -0
- package/index-Cogo-Kkd.cjs +1 -0
- package/index-D7T2Yy11.js +1170 -0
- package/index.d.ts +39 -0
- package/index.d.ts.map +1 -0
- package/package.json +14 -17
- package/providers/competition/hooks/index.d.ts +6 -0
- package/providers/competition/hooks/index.d.ts.map +1 -0
- package/providers/competition/hooks/useCompetitionStats.d.ts +8 -0
- package/providers/competition/hooks/useCompetitionStats.d.ts.map +1 -0
- package/providers/competition/hooks/useGoalDistribution.d.ts +11 -0
- package/providers/competition/hooks/useGoalDistribution.d.ts.map +1 -0
- package/providers/competition/hooks/useMatchHelpers.d.ts +16 -0
- package/providers/competition/hooks/useMatchHelpers.d.ts.map +1 -0
- package/providers/competition/hooks/useStandingsCalculations.d.ts +18 -0
- package/providers/competition/hooks/useStandingsCalculations.d.ts.map +1 -0
- package/providers/competition/hooks/useStandingsHelpers.d.ts +23 -0
- package/providers/competition/hooks/useStandingsHelpers.d.ts.map +1 -0
- package/providers/competition/hooks/useTeamPosition.d.ts +8 -0
- package/providers/competition/hooks/useTeamPosition.d.ts.map +1 -0
- package/providers/competition/hooks/useTeamResultsTable.d.ts +9 -0
- package/providers/competition/hooks/useTeamResultsTable.d.ts.map +1 -0
- package/providers/competition/utils/competitionStats.d.ts +42 -0
- package/providers/competition/utils/competitionStats.d.ts.map +1 -0
- package/providers/competition/utils/goalDistribution.d.ts +41 -0
- package/providers/competition/utils/goalDistribution.d.ts.map +1 -0
- package/providers/competition/utils/index.d.ts +6 -0
- package/providers/competition/utils/index.d.ts.map +1 -0
- package/providers/competition/utils/standingsCalculations.d.ts +24 -0
- package/providers/competition/utils/standingsCalculations.d.ts.map +1 -0
- package/providers/competition.context.d.ts +8 -0
- package/providers/competition.context.d.ts.map +1 -0
- package/providers/competition.provider.d.ts +3 -0
- package/providers/competition.provider.d.ts.map +1 -0
- package/providers/competition.types.d.ts +118 -0
- package/providers/competition.types.d.ts.map +1 -0
- package/providers/fansunited-config.context.d.ts +6 -0
- package/providers/fansunited-config.context.d.ts.map +1 -0
- package/providers/fansunited-config.hooks.d.ts +19 -0
- package/providers/fansunited-config.hooks.d.ts.map +1 -0
- package/providers/fansunited-config.provider.d.ts +44 -0
- package/providers/fansunited-config.provider.d.ts.map +1 -0
- package/providers/fansunited-config.types.d.ts +48 -0
- package/providers/fansunited-config.types.d.ts.map +1 -0
- package/providers/fansunited-sdk.hook.d.ts +40 -0
- package/providers/fansunited-sdk.hook.d.ts.map +1 -0
- package/providers/index.d.ts +20 -0
- package/providers/index.d.ts.map +1 -0
- package/providers/match/hooks/useEventHelpers.d.ts +12 -0
- package/providers/match/hooks/useEventHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useHeadToHeadHelpers.d.ts +13 -0
- package/providers/match/hooks/useHeadToHeadHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useLineupHelpers.d.ts +13 -0
- package/providers/match/hooks/useLineupHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useMatchStandingsCalculations.d.ts +20 -0
- package/providers/match/hooks/useMatchStandingsCalculations.d.ts.map +1 -0
- package/providers/match/hooks/useMatchStatus.d.ts +12 -0
- package/providers/match/hooks/useMatchStatus.d.ts.map +1 -0
- package/providers/match/hooks/useOddsHelpers.d.ts +10 -0
- package/providers/match/hooks/useOddsHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useScoreHelpers.d.ts +16 -0
- package/providers/match/hooks/useScoreHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useStandingsHelpers.d.ts +22 -0
- package/providers/match/hooks/useStandingsHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useStatisticsHelpers.d.ts +13 -0
- package/providers/match/hooks/useStatisticsHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useTeamHelpers.d.ts +11 -0
- package/providers/match/hooks/useTeamHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useTeamStatsHelpers.d.ts +12 -0
- package/providers/match/hooks/useTeamStatsHelpers.d.ts.map +1 -0
- package/providers/match.context.d.ts +8 -0
- package/providers/match.context.d.ts.map +1 -0
- package/providers/match.provider.d.ts +3 -0
- package/providers/match.provider.d.ts.map +1 -0
- package/providers/match.types.d.ts +151 -0
- package/providers/match.types.d.ts.map +1 -0
- package/providers/team/hooks/useFormStats.d.ts +49 -0
- package/providers/team/hooks/useFormStats.d.ts.map +1 -0
- package/providers/team/hooks/useMatchHelpers.d.ts +12 -0
- package/providers/team/hooks/useMatchHelpers.d.ts.map +1 -0
- package/providers/team/hooks/useSquadHelpers.d.ts +17 -0
- package/providers/team/hooks/useSquadHelpers.d.ts.map +1 -0
- package/providers/team.context.d.ts +8 -0
- package/providers/team.context.d.ts.map +1 -0
- package/providers/team.provider.d.ts +3 -0
- package/providers/team.provider.d.ts.map +1 -0
- package/providers/team.types.d.ts +68 -0
- package/providers/team.types.d.ts.map +1 -0
- package/types/canonical/base.types.d.ts +366 -0
- package/types/canonical/base.types.d.ts.map +1 -0
- package/types/canonical/commentary.types.d.ts +42 -0
- package/types/canonical/commentary.types.d.ts.map +1 -0
- package/types/canonical/event.types.d.ts +31 -0
- package/types/canonical/event.types.d.ts.map +1 -0
- package/types/canonical/index.d.ts +17 -0
- package/types/canonical/index.d.ts.map +1 -0
- package/types/canonical/lineup.types.d.ts +33 -0
- package/types/canonical/lineup.types.d.ts.map +1 -0
- package/types/canonical/match.types.d.ts +153 -0
- package/types/canonical/match.types.d.ts.map +1 -0
- package/types/canonical/odds.types.d.ts +73 -0
- package/types/canonical/odds.types.d.ts.map +1 -0
- package/types/canonical/search.types.d.ts +101 -0
- package/types/canonical/search.types.d.ts.map +1 -0
- package/types/canonical/sports-search.types.d.ts +151 -0
- package/types/canonical/sports-search.types.d.ts.map +1 -0
- package/types/canonical/squad.types.d.ts +30 -0
- package/types/canonical/squad.types.d.ts.map +1 -0
- package/types/canonical/standing.types.d.ts +85 -0
- package/types/canonical/standing.types.d.ts.map +1 -0
- package/types/canonical/statistics.types.d.ts +81 -0
- package/types/canonical/statistics.types.d.ts.map +1 -0
- package/types/index.d.ts +10 -0
- package/types/index.d.ts.map +1 -0
- package/utilities/stats/core/helpers.d.ts +65 -0
- package/utilities/stats/core/helpers.d.ts.map +1 -0
- package/utilities/stats/core/index.d.ts +7 -0
- package/utilities/stats/core/index.d.ts.map +1 -0
- package/utilities/stats/core/types.d.ts +39 -0
- package/utilities/stats/core/types.d.ts.map +1 -0
- package/utilities/stats/index.d.ts +27 -0
- package/utilities/stats/index.d.ts.map +1 -0
- package/utilities/stats/match/headToHead.d.ts +73 -0
- package/utilities/stats/match/headToHead.d.ts.map +1 -0
- package/utilities/stats/match/homeVsAway.d.ts +30 -0
- package/utilities/stats/match/homeVsAway.d.ts.map +1 -0
- package/utilities/stats/match/index.d.ts +8 -0
- package/utilities/stats/match/index.d.ts.map +1 -0
- package/utilities/stats/match/overUnder.d.ts +59 -0
- package/utilities/stats/match/overUnder.d.ts.map +1 -0
- package/utilities/stats/match/result.d.ts +13 -0
- package/utilities/stats/match/result.d.ts.map +1 -0
- package/utilities/stats/team/commonOpponents.d.ts +28 -0
- package/utilities/stats/team/commonOpponents.d.ts.map +1 -0
- package/utilities/stats/team/goalStats.d.ts +42 -0
- package/utilities/stats/team/goalStats.d.ts.map +1 -0
- package/utilities/stats/team/index.d.ts +7 -0
- package/utilities/stats/team/index.d.ts.map +1 -0
- package/utilities/stats/team/streaks.d.ts +48 -0
- package/utilities/stats/team/streaks.d.ts.map +1 -0
- package/vite.svg +1 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fansunited-data-layer
|
|
3
|
+
*
|
|
4
|
+
* A data layer library for fetching and transforming sports data
|
|
5
|
+
* from multiple API providers (Sportal365, Fans United Sports API).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { setConfig, getFootballMatch } from 'fansunited-data-layer';
|
|
10
|
+
*
|
|
11
|
+
* // Initialize config at app startup
|
|
12
|
+
* setConfig({
|
|
13
|
+
* defaultSportsProvider: 'sportal365Sports',
|
|
14
|
+
* sportal365Sports: {
|
|
15
|
+
* username: 'your-username',
|
|
16
|
+
* password: 'your-password',
|
|
17
|
+
* projectId: 'your-project-id',
|
|
18
|
+
* }
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // Fetch a football match - returns canonical FUSportsMatch
|
|
22
|
+
* const match = await getFootballMatch('7576255');
|
|
23
|
+
* console.log(match.competitorOne.name); // Team name
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export { setConfig, getConfig, isConfigured, type DataLayerConfig, type Sportal365SportsConfig, type PayloadConfig, } from "./config";
|
|
27
|
+
export { getFootballMatch, getFootballMatchEvents, getFootballMatchLineups, getFootballMatchOdds, getFootballMatchStatistics, getFootballMatchCommentary, getFootballMatches, getFootballTeam, getFootballTeamSquad, getFootballCompetition, getFootballSeasonDetails, getFootballStandings, getFootballPlayerSeasonStatistics, getTeamSeasonStatistics, searchFootball, } from "./api/sportal365-sports";
|
|
28
|
+
export { search } from "./api/sportal365-sports";
|
|
29
|
+
export { getFansUnitedFootballCompetitions, getFansUnitedFootballCompetition, getFansUnitedFootballTeam, getFansUnitedFootballPlayer, getFansUnitedFootballMatch, getFansUnitedFootballMatches, getFansUnitedFootballSearch, } from "./api/fansunited";
|
|
30
|
+
export type { GetFootballCompetitionsOptions, GetFootballCompetitionOptions as GetFansUnitedFootballCompetitionOptions, GetFootballTeamOptions as GetFansUnitedFootballTeamOptions, GetFootballPlayerOptions as GetFansUnitedFootballPlayerOptions, GetFootballMatchOptions as GetFansUnitedFootballMatchOptions, GetFootballMatchesOptions as GetFansUnitedFootballMatchesOptions, GetFootballSearchOptions as GetFansUnitedFootballSearchOptions, SearchEntityType as FansUnitedSearchEntityType, FansUnitedFootballSearchResult, } from "./api/fansunited";
|
|
31
|
+
export { getProviderRefId, addProviderRef, toProviderRefArray } from "./api/sportal365-sports/shared";
|
|
32
|
+
export type { GetFootballMatchOptions, GetFootballMatchEventsOptions, GetFootballMatchLineupsOptions, GetFootballMatchOddsOptions, GetFootballMatchStatisticsOptions, GetFootballMatchCommentaryOptions, GetFootballMatchesOptions, GetFootballTeamOptions, GetFootballTeamSquadOptions, GetFootballCompetitionOptions, GetFootballSeasonDetailsOptions, GetFootballStandingsOptions, GetFootballPlayerSeasonStatisticsOptions, GetTeamSeasonStatisticsOptions, GetFootballSearchOptions, SearchEntityType, GetSportsSearchOptions, SportType, SportsSearchEntityType, FootballStandingsExpandOption, OddType, ScopeType, OddFormat, MarketType, OptionalMatchData, MatchStatusType, SortDirection, NextCacheOptions, } from "./api/sportal365-sports";
|
|
33
|
+
export type { FUSportsCountry, FUSportsCity, FUSportsCompetitor, FUSportsCompetitorBase, FUSportsTeamCompetitor, FUSportsPlayerCompetitor, FUSportsPairCompetitor, FUSportsShirtColor, FUSportsSeason, FUSportsRound, FUSportsStage, FUSportsSeasonDetails, FUSportsCompetition, FUSportsVenue, FUSportsOfficial, FUSportsMember, FUSportsMatchMember, FUSportsCoach, FUSportsSocials, FUBranding, FUSportsMatchScore, FUSportsMatchStatus, FUSportsMatchTiming, FUSportsMatchWinner, FUSportsMatch, FUSportsMatchSimple, FUSportsFootballEventType, FUSportsOtherEventType, FUSportsMatchEvent, FUSportsLineupMember, FUSportsCompetitorLineup, FUSportsMatchLineups, FUSportsStatisticEntry, FUSportsCompetitorStatistics, FUSportsMatchStatistics, FUSportsPlayerStatistic, FUSportsPlayerSeasonStatistics, FUSportsTeamSeasonStatistics, FUSportsBettingOperatorBranding, FUSportsBettingOperator, FUSportsOddSelection, FUSportsMarketPeriod, FUSportsMarketType, FUSportsOddMarket, FUSportsBettingOperatorOdds, FUSportsMatchOdds, FUSportsCommentaryDetail, FUSportsCommentaryMeta, FUSportsCommentaryItem, FUSportsStandingEntry, FUSportsCompetitorForm, FUSportsStandingLegendItem, FUSportsStandingsMetadata, FUSportsStandings, FUSportsSquadMember, FUSportsSquad, FUSportsSearchResultBase, FUSportsTournamentSearchResult, FUSportsPlayerSearchResult, FUSportsTeamSearchResult, FUSportsPresidentSearchResult, FUSportsVenueSearchResult, FUSportsCoachSearchResult, FUSportsSearchResult, FUSportsSearchResults, FUSportsTranslation, FUSportsDisplayAsset, FUSportsSportsSearchResultBase, FUSportsSportsSearchCountry, FUSportsTeamSportsSearchResult, FUSportsCitySportsSearchResult, FUSportsHorseSportsSearchResult, FUSportsPlayerSportsSearchResult, FUSportsCoachSportsSearchResult, FUSportsRefereeSportsSearchResult, FUSportsVenueSportsSearchResult, FUSportsTournamentSportsSearchResult, FUSportsMatchSportsSearchResult, FUSportsCountrySportsSearchResult, FUSportsSportsSearchResult, FUSportsSportsSearchResults, } from "./types/canonical";
|
|
34
|
+
export { getActiveSeason, getTeamNextMatch, getTeamPreviousMatch, getTeamUpcomingMatches, getTeamFinishedMatches, getTeamResultsTable, getTeamTopScorers, getTeamTopAssisters, getTeamTopAppearances, getTeamTopMinutesPlayed, getTeamTopCleanSheets, getTeamMostDecorated, } from "./helpers";
|
|
35
|
+
export type { TeamResultTableResult, TeamResultTableRow, TeamResultTable } from "./helpers";
|
|
36
|
+
export { calcPercentage, calcAverage, formatStatValue, formatWithAverage, formatAsAverage, formatPossessionPercentage, analyzeMatch, isTeamHome, isTeamAway, isTeamInMatch, isMatchFinished, getTeamScore, getOpponentScore, calculateH2HStats, getRecentH2HMeetings, getTeamHomeAwayStats, getTeamOverUnderStats, getMatchResult, getTeamGoalStats, calculateStreak, getTeamStreaks, getTeamStreaksComparison, streakFilters, getTeamsCommonOpponents, } from "./utilities/stats";
|
|
37
|
+
export type { MatchAnalysis, MatchResult, MatchFilter, VenueFilter, H2HStats, H2HMatch, HomeVsAwayStats, TeamOverUnderStats, TeamGoalStats, GoalStatRow, StreakData, StreakRow, TeamOpponentResults, TeamsResultsRow, } from "./utilities/stats";
|
|
38
|
+
export { GOAL_EVENT_TYPES } from "./utilities/stats";
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EACH,SAAS,EACT,SAAS,EACT,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,GACrB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACH,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,iCAAiC,EACjC,uBAAuB,EACvB,cAAc,GACjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGjD,OAAO,EACH,iCAAiC,EACjC,gCAAgC,EAChC,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACR,8BAA8B,EAC9B,6BAA6B,IAAI,uCAAuC,EACxE,sBAAsB,IAAI,gCAAgC,EAC1D,wBAAwB,IAAI,kCAAkC,EAC9D,uBAAuB,IAAI,iCAAiC,EAC5D,yBAAyB,IAAI,mCAAmC,EAChE,wBAAwB,IAAI,kCAAkC,EAC9D,gBAAgB,IAAI,0BAA0B,EAC9C,8BAA8B,GACjC,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEtG,YAAY,EACR,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,iCAAiC,EACjC,iCAAiC,EACjC,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eScript library for fetching and transforming sports data from multiple API providers. Returns clean, canonical types that are provider-agnostic.",
|
|
5
5
|
"homepage": "https://fansunited.com/",
|
|
6
6
|
"private": false,
|
|
7
|
-
"version": "0.2.
|
|
7
|
+
"version": "0.2.2",
|
|
8
8
|
"type": "module",
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"main": "./dist/fansunited-data-layer.cjs",
|
|
13
|
-
"module": "./dist/fansunited-data-layer.js",
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
9
|
+
"main": "./fansunited-data-layer.cjs",
|
|
10
|
+
"module": "./fansunited-data-layer.js",
|
|
11
|
+
"types": "./index.d.ts",
|
|
15
12
|
"exports": {
|
|
16
13
|
".": {
|
|
17
|
-
"types": "./
|
|
18
|
-
"import": "./
|
|
19
|
-
"require": "./
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"import": "./fansunited-data-layer.js",
|
|
16
|
+
"require": "./fansunited-data-layer.cjs"
|
|
20
17
|
},
|
|
21
18
|
"./client": {
|
|
22
|
-
"types": "./
|
|
23
|
-
"import": "./
|
|
24
|
-
"require": "./
|
|
19
|
+
"types": "./client.d.ts",
|
|
20
|
+
"import": "./client.js",
|
|
21
|
+
"require": "./client.cjs"
|
|
25
22
|
}
|
|
26
23
|
},
|
|
27
24
|
"scripts": {
|
|
28
25
|
"dev": "vite",
|
|
29
26
|
"build": "tsc -b && vite build",
|
|
30
|
-
"build:lib": "vite build && tsc --project tsconfig.lib.json && sh scripts/add-use-client.sh",
|
|
27
|
+
"build:lib": "vite build && tsc --project tsconfig.lib.json && sh scripts/add-use-client.sh && sh scripts/prepare-package.sh",
|
|
31
28
|
"build:lib:watch": "vite build --watch",
|
|
32
29
|
"lint": "eslint .",
|
|
33
30
|
"preview": "vite preview"
|
|
34
31
|
},
|
|
35
32
|
"peerDependencies": {
|
|
36
|
-
"fansunited-sdk-esm": "^1.
|
|
37
|
-
"fansunited-sports-ui": "
|
|
33
|
+
"fansunited-sdk-esm": "^1.122.0",
|
|
34
|
+
"fansunited-sports-ui": "latest",
|
|
38
35
|
"react": "^18.0.0 || ^19.0.0",
|
|
39
36
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
40
37
|
},
|
|
@@ -57,4 +54,4 @@
|
|
|
57
54
|
"typescript-eslint": "^8.46.4",
|
|
58
55
|
"vite": "^7.2.4"
|
|
59
56
|
}
|
|
60
|
-
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { useMatchHelpers } from "./useMatchHelpers";
|
|
2
|
+
export { useStandingsHelpers } from "./useStandingsHelpers";
|
|
3
|
+
export { useStandingsCalculations } from "./useStandingsCalculations";
|
|
4
|
+
export { useGoalDistribution } from "./useGoalDistribution";
|
|
5
|
+
export { useCompetitionStats } from "./useCompetitionStats";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Competition statistics hook
|
|
3
|
+
* Provides memoized competition statistics calculations
|
|
4
|
+
*/
|
|
5
|
+
import type { FUSportsMatch } from "../../../types/canonical";
|
|
6
|
+
import type { CompetitionStats } from "../utils/competitionStats";
|
|
7
|
+
export declare function useCompetitionStats(matches: FUSportsMatch[]): CompetitionStats;
|
|
8
|
+
//# sourceMappingURL=useCompetitionStats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCompetitionStats.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/hooks/useCompetitionStats.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,gBAAgB,CAK9E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Goal distribution hook
|
|
3
|
+
* Provides memoized goal distribution calculations
|
|
4
|
+
*/
|
|
5
|
+
import type { FUSportsMatch } from "../../../types/canonical";
|
|
6
|
+
import type { GoalDistribution } from "../utils/goalDistribution";
|
|
7
|
+
export declare function useGoalDistribution(matches: FUSportsMatch[]): {
|
|
8
|
+
goalDistribution: GoalDistribution;
|
|
9
|
+
getGoalDistribution: (intervalMinutes?: number) => GoalDistribution;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useGoalDistribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGoalDistribution.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/hooks/useGoalDistribution.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAE;;4CAU9B,MAAM,KAAQ,gBAAgB;EAa3D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FUSportsMatch } from "../../../types/canonical";
|
|
2
|
+
/**
|
|
3
|
+
* Hook for match-related helper functions
|
|
4
|
+
*/
|
|
5
|
+
export declare function useMatchHelpers(matches: FUSportsMatch[]): {
|
|
6
|
+
getMatch: (id: string) => FUSportsMatch | undefined;
|
|
7
|
+
getMatchesByTeam: (teamId: string) => FUSportsMatch[];
|
|
8
|
+
getMatchesByDate: (date: string) => FUSportsMatch[];
|
|
9
|
+
getMatchesByRound: (roundId: string) => FUSportsMatch[];
|
|
10
|
+
getLiveMatches: () => FUSportsMatch[];
|
|
11
|
+
getUpcomingMatches: (teamId?: string) => FUSportsMatch[];
|
|
12
|
+
getFinishedMatches: (teamId?: string) => FUSportsMatch[];
|
|
13
|
+
getTeamLastMatch: (teamId: string) => FUSportsMatch;
|
|
14
|
+
getTeamNextMatch: (teamId: string) => FUSportsMatch;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useMatchHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchHelpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/hooks/useMatchHelpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,aAAa,EAAE;mBAClB,MAAM;+BAG3B,MAAM;6BAKR,MAAM;iCAKH,MAAM;;kCAON,MAAM;kCAcN,MAAM;+BAaP,MAAM;+BAcN,MAAM;EAwCtB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FUSportsMatch, FUSportsStandingEntry, FUSportsStandings } from "../../../types/canonical";
|
|
2
|
+
/**
|
|
3
|
+
* Hook for advanced standings calculations with memoization
|
|
4
|
+
*/
|
|
5
|
+
export declare function useStandingsCalculations(matches: FUSportsMatch[], standings: FUSportsStandings, getTeamStanding: (teamId: string) => FUSportsStandingEntry | undefined): {
|
|
6
|
+
getFormStandings: (matchCount?: number) => FUSportsStandings;
|
|
7
|
+
getHomeFormStandings: (matchCount?: number) => FUSportsStandings;
|
|
8
|
+
getAwayFormStandings: (matchCount?: number) => FUSportsStandings;
|
|
9
|
+
getOffenceStandings: () => FUSportsStandings;
|
|
10
|
+
getFormOffenceStandings: (matchCount?: number) => FUSportsStandings;
|
|
11
|
+
getHomeOffenceStandings: () => FUSportsStandings;
|
|
12
|
+
getAwayOffenceStandings: () => FUSportsStandings;
|
|
13
|
+
getDefenceStandings: () => FUSportsStandings;
|
|
14
|
+
getFormDefenceStandings: (matchCount?: number) => FUSportsStandings;
|
|
15
|
+
getHomeDefenceStandings: () => FUSportsStandings;
|
|
16
|
+
getAwayDefenceStandings: () => FUSportsStandings;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useStandingsCalculations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStandingsCalculations.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/hooks/useStandingsCalculations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AASxG;;GAEG;AACH,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,aAAa,EAAE,EACxB,SAAS,EAAE,iBAAiB,EAC5B,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,qBAAqB,GAAG,SAAS;oCAoBjD,MAAM;wCAON,MAAM;wCAON,MAAM;;2CAaN,MAAM;;;;2CAuBN,MAAM;;;EAgD9B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { FUSportsStandings, FUSportsCompetitor } from "../../../types/canonical";
|
|
2
|
+
/**
|
|
3
|
+
* Hook for basic standings helper functions
|
|
4
|
+
*/
|
|
5
|
+
export declare function useStandingsHelpers(standings: FUSportsStandings): {
|
|
6
|
+
getTeamStanding: (teamId: string) => import("../../..").FUSportsStandingEntry | undefined;
|
|
7
|
+
getTeamRank: (teamId: string) => number | undefined;
|
|
8
|
+
getTopTeams: (count?: number) => import("../../..").FUSportsStandingEntry[];
|
|
9
|
+
getBottomTeams: (count?: number) => import("../../..").FUSportsStandingEntry[];
|
|
10
|
+
getTeamsAlphabetically: FUSportsCompetitor[];
|
|
11
|
+
getTeamSeasonStats: (teamId: string) => {
|
|
12
|
+
position: number;
|
|
13
|
+
points: number;
|
|
14
|
+
played: number;
|
|
15
|
+
won: number;
|
|
16
|
+
drawn: number;
|
|
17
|
+
lost: number;
|
|
18
|
+
goalsFor: number;
|
|
19
|
+
goalsAgainst: number;
|
|
20
|
+
goalDifference: number;
|
|
21
|
+
} | undefined;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useStandingsHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStandingsHelpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/hooks/useStandingsHelpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEtF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,iBAAiB;8BAK/C,MAAM;0BAKN,MAAM;0BAOqB,MAAM;6BAEH,MAAM;;iCAyB9B,MAAM;;;;;;;;;;;EA8B5B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FUSportsStandings } from "../../../types/canonical";
|
|
2
|
+
/**
|
|
3
|
+
* Hook to get a team's position in the standings
|
|
4
|
+
*/
|
|
5
|
+
export declare function useTeamPosition(standings: FUSportsStandings): {
|
|
6
|
+
getTeamPosition: (teamId: string) => number | undefined;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=useTeamPosition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTeamPosition.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/hooks/useTeamPosition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,iBAAiB;8BAE3C,MAAM,KAAG,MAAM,GAAG,SAAS;EAQ3C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FUSportsMatch, FUSportsStandings } from "../../../types/canonical";
|
|
2
|
+
import type { TeamResultTable } from "../../../helpers/team.helpers";
|
|
3
|
+
/**
|
|
4
|
+
* Hook for team results table helper function
|
|
5
|
+
*/
|
|
6
|
+
export declare function useTeamResultsTable(matches: FUSportsMatch[], standings: FUSportsStandings): {
|
|
7
|
+
getTeamResultsTable: (teamId: string) => TeamResultTable;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useTeamResultsTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTeamResultsTable.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/hooks/useTeamResultsTable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAA6C,MAAM,+BAA+B,CAAC;AAEhH;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,SAAS,EAAE,iBAAiB;kCAWzE,MAAM,KAAG,eAAe;EA4GxC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Competition statistics calculation utilities
|
|
3
|
+
* Provides comprehensive stats about matches, goals, and outcomes
|
|
4
|
+
*/
|
|
5
|
+
import type { FUSportsMatch } from "../../../types/canonical";
|
|
6
|
+
/**
|
|
7
|
+
* Competition statistics overview
|
|
8
|
+
*/
|
|
9
|
+
export interface CompetitionStats {
|
|
10
|
+
totalMatches: number;
|
|
11
|
+
finishedMatches: number;
|
|
12
|
+
completionPercentage: number;
|
|
13
|
+
homeWins: number;
|
|
14
|
+
awayWins: number;
|
|
15
|
+
draws: number;
|
|
16
|
+
homeWinPercentage: number;
|
|
17
|
+
awayWinPercentage: number;
|
|
18
|
+
drawPercentage: number;
|
|
19
|
+
totalGoals: number;
|
|
20
|
+
goalsPerMatch: number;
|
|
21
|
+
homeGoalsPerMatch: number;
|
|
22
|
+
awayGoalsPerMatch: number;
|
|
23
|
+
over1_5Goals: number;
|
|
24
|
+
over2_5Goals: number;
|
|
25
|
+
over3_5Goals: number;
|
|
26
|
+
over1_5Percentage: number;
|
|
27
|
+
over2_5Percentage: number;
|
|
28
|
+
over3_5Percentage: number;
|
|
29
|
+
bothTeamsScored: number;
|
|
30
|
+
bothTeamsScoredPercentage: number;
|
|
31
|
+
homeTeamScoredFirst: number;
|
|
32
|
+
awayTeamScoredFirst: number;
|
|
33
|
+
noGoalScored: number;
|
|
34
|
+
homeTeamScoredFirstPercentage: number;
|
|
35
|
+
awayTeamScoredFirstPercentage: number;
|
|
36
|
+
noGoalScoredPercentage: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Calculate comprehensive competition statistics
|
|
40
|
+
*/
|
|
41
|
+
export declare function calculateCompetitionStats(matches: FUSportsMatch[]): CompetitionStats;
|
|
42
|
+
//# sourceMappingURL=competitionStats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"competitionStats.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/utils/competitionStats.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAE7B,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAG7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IAGvB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAG1B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAG1B,eAAe,EAAE,MAAM,CAAC;IACxB,yBAAyB,EAAE,MAAM,CAAC;IAGlC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,6BAA6B,EAAE,MAAM,CAAC;IACtC,6BAA6B,EAAE,MAAM,CAAC;IACtC,sBAAsB,EAAE,MAAM,CAAC;CAClC;AAyCD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,gBAAgB,CAuGpF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Goal distribution calculation utilities
|
|
3
|
+
* Analyzes when goals are scored across matches
|
|
4
|
+
*/
|
|
5
|
+
import type { FUSportsMatch } from "../../../types/canonical";
|
|
6
|
+
/**
|
|
7
|
+
* Time interval for goal distribution
|
|
8
|
+
*/
|
|
9
|
+
export interface GoalDistributionInterval {
|
|
10
|
+
label: string;
|
|
11
|
+
startMinute: number;
|
|
12
|
+
endMinute: number;
|
|
13
|
+
goals: number;
|
|
14
|
+
percentage: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Half-based goal distribution
|
|
18
|
+
*/
|
|
19
|
+
export interface GoalDistributionByHalf {
|
|
20
|
+
firstHalf: {
|
|
21
|
+
goals: number;
|
|
22
|
+
percentage: number;
|
|
23
|
+
};
|
|
24
|
+
secondHalf: {
|
|
25
|
+
goals: number;
|
|
26
|
+
percentage: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Complete goal distribution data
|
|
31
|
+
*/
|
|
32
|
+
export interface GoalDistribution {
|
|
33
|
+
intervals: GoalDistributionInterval[];
|
|
34
|
+
byHalf: GoalDistributionByHalf;
|
|
35
|
+
totalGoals: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Calculate goal distribution across time intervals
|
|
39
|
+
*/
|
|
40
|
+
export declare function calculateGoalDistribution(matches: FUSportsMatch[], intervalMinutes?: number): GoalDistribution;
|
|
41
|
+
//# sourceMappingURL=goalDistribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goalDistribution.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/utils/goalDistribution.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,SAAS,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,UAAU,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACtB,CAAC;CACL;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE,wBAAwB,EAAE,CAAC;IACtC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;CACtB;AAiBD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,eAAe,GAAE,MAAW,GAAG,gBAAgB,CAgFlH"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { calculateFormStandings, calculateOffenceStandings, calculateDefenceStandings, isHomeMatch, isAwayMatch, } from "./standingsCalculations";
|
|
2
|
+
export { calculateGoalDistribution } from "./goalDistribution";
|
|
3
|
+
export type { GoalDistribution, GoalDistributionInterval, GoalDistributionByHalf } from "./goalDistribution";
|
|
4
|
+
export { calculateCompetitionStats } from "./competitionStats";
|
|
5
|
+
export type { CompetitionStats } from "./competitionStats";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,WAAW,EACX,WAAW,GACd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE7G,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FUSportsMatch, FUSportsStandingEntry, FUSportsStandings } from "../../../types/canonical";
|
|
2
|
+
/**
|
|
3
|
+
* Calculate form-based standings from finished matches
|
|
4
|
+
* @param matches - All finished matches (should be pre-sorted by date descending)
|
|
5
|
+
* @param teamIds - Set of team IDs to calculate standings for
|
|
6
|
+
* @param getTeamInfo - Function to get team competitor info
|
|
7
|
+
* @param matchCount - Number of recent matches to consider
|
|
8
|
+
* @param filterFn - Optional filter function to filter matches (e.g., home/away only)
|
|
9
|
+
*/
|
|
10
|
+
export declare function calculateFormStandings(matches: FUSportsMatch[], teamIds: Set<string>, getTeamInfo: (teamId: string) => FUSportsStandingEntry["competitor"] | undefined, matchCount?: number, filterFn?: (match: FUSportsMatch, teamId: string) => boolean): FUSportsStandings;
|
|
11
|
+
/**
|
|
12
|
+
* Calculate offence standings (goals scored)
|
|
13
|
+
*/
|
|
14
|
+
export declare function calculateOffenceStandings(matches: FUSportsMatch[], teamIds: Set<string>, getTeamInfo: (teamId: string) => FUSportsStandingEntry["competitor"] | undefined, matchCount?: number, filterFn?: (match: FUSportsMatch, teamId: string) => boolean): FUSportsStandings;
|
|
15
|
+
/**
|
|
16
|
+
* Calculate defence standings (goals conceded)
|
|
17
|
+
*/
|
|
18
|
+
export declare function calculateDefenceStandings(matches: FUSportsMatch[], teamIds: Set<string>, getTeamInfo: (teamId: string) => FUSportsStandingEntry["competitor"] | undefined, matchCount?: number, filterFn?: (match: FUSportsMatch, teamId: string) => boolean): FUSportsStandings;
|
|
19
|
+
/**
|
|
20
|
+
* Filter functions for home/away matches
|
|
21
|
+
*/
|
|
22
|
+
export declare const isHomeMatch: (match: FUSportsMatch, teamId: string) => boolean;
|
|
23
|
+
export declare const isAwayMatch: (match: FUSportsMatch, teamId: string) => boolean;
|
|
24
|
+
//# sourceMappingURL=standingsCalculations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standingsCalculations.d.ts","sourceRoot":"","sources":["../../../../src/lib/providers/competition/utils/standingsCalculations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAExG;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,aAAa,EAAE,EACxB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,EACpB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,qBAAqB,CAAC,YAAY,CAAC,GAAG,SAAS,EAChF,UAAU,GAAE,MAAU,EACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,GAC7D,iBAAiB,CAsEnB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACrC,OAAO,EAAE,aAAa,EAAE,EACxB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,EACpB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,qBAAqB,CAAC,YAAY,CAAC,GAAG,SAAS,EAChF,UAAU,CAAC,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,GAC7D,iBAAiB,CAkDnB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACrC,OAAO,EAAE,aAAa,EAAE,EACxB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,EACpB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,qBAAqB,CAAC,YAAY,CAAC,GAAG,SAAS,EAChF,UAAU,CAAC,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,GAC7D,iBAAiB,CAmDnB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,aAAa,EAAE,QAAQ,MAAM,KAAG,OAElE,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,aAAa,EAAE,QAAQ,MAAM,KAAG,OAElE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CompetitionContextValue } from "./competition.types";
|
|
2
|
+
export declare const CompetitionContext: import("react").Context<CompetitionContextValue | null>;
|
|
3
|
+
/**
|
|
4
|
+
* Hook to access competition context
|
|
5
|
+
* Must be used within a CompetitionProvider
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCompetition(): CompetitionContextValue;
|
|
8
|
+
//# sourceMappingURL=competition.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"competition.context.d.ts","sourceRoot":"","sources":["../../src/lib/providers/competition.context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAMnE,eAAO,MAAM,kBAAkB,yDAAsD,CAAC;AAMtF;;;GAGG;AACH,wBAAgB,cAAc,IAAI,uBAAuB,CAMxD"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CompetitionProviderProps } from "./competition.types";
|
|
2
|
+
export declare function CompetitionProvider({ competitionId, seasonId, stageId, competition: initialCompetition, season: initialSeason, matches: initialMatches, standings: initialStandings, previousSeasons, config, autoRefresh, refreshInterval, children, }: CompetitionProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=competition.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"competition.provider.d.ts","sourceRoot":"","sources":["../../src/lib/providers/competition.provider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAA2B,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAkB7F,wBAAgB,mBAAmB,CAAC,EAChC,aAAa,EACb,QAAQ,EACR,OAAO,EACP,WAAW,EAAE,kBAAkB,EAC/B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,gBAAgB,EAC3B,eAAe,EACf,MAAM,EACN,WAAkB,EAClB,eAAuB,EACvB,QAAQ,GACX,EAAE,wBAAwB,2CAmN1B"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { FUSportsMatch, FUSportsStandingEntry, FUSportsStandings, FUSportsCompetition, FUSportsSeasonDetails, FUSportsCompetitor, FUSportsCompetitorForm } from "../types/canonical";
|
|
3
|
+
import type { GoalDistribution } from "./competition/utils/goalDistribution";
|
|
4
|
+
import type { CompetitionStats } from "./competition/utils/competitionStats";
|
|
5
|
+
import type { TeamResultTable } from "../helpers/team.helpers";
|
|
6
|
+
/**
|
|
7
|
+
* Competition branding and display configuration
|
|
8
|
+
*/
|
|
9
|
+
export interface CompetitionConfig {
|
|
10
|
+
/** Competition branding */
|
|
11
|
+
primaryColor?: string;
|
|
12
|
+
secondaryColor?: string;
|
|
13
|
+
logo?: string;
|
|
14
|
+
/** Display preferences */
|
|
15
|
+
showOdds?: boolean;
|
|
16
|
+
showAttendance?: boolean;
|
|
17
|
+
defaultView?: "matches" | "standings" | "stats";
|
|
18
|
+
/** Custom metadata */
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Season with historical data
|
|
23
|
+
*/
|
|
24
|
+
export interface Season {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
matches?: FUSportsMatch[];
|
|
28
|
+
standings?: FUSportsStandings;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Competition context value - all data and helper methods
|
|
32
|
+
*/
|
|
33
|
+
export interface CompetitionContextValue {
|
|
34
|
+
competitionId: string;
|
|
35
|
+
seasonId?: string;
|
|
36
|
+
stageId?: string;
|
|
37
|
+
competition?: FUSportsCompetition;
|
|
38
|
+
season?: FUSportsSeasonDetails;
|
|
39
|
+
isRefreshing: boolean;
|
|
40
|
+
lastRefreshed?: Date;
|
|
41
|
+
matches: FUSportsMatch[];
|
|
42
|
+
standings: FUSportsStandings;
|
|
43
|
+
previousSeasons?: Season[];
|
|
44
|
+
config?: CompetitionConfig;
|
|
45
|
+
refresh: () => Promise<void>;
|
|
46
|
+
getMatch: (id: string) => FUSportsMatch | undefined;
|
|
47
|
+
getMatchesByTeam: (teamId: string) => FUSportsMatch[];
|
|
48
|
+
getMatchesByDate: (date: string) => FUSportsMatch[];
|
|
49
|
+
getMatchesByRound: (roundId: string) => FUSportsMatch[];
|
|
50
|
+
getLiveMatches: () => FUSportsMatch[];
|
|
51
|
+
getUpcomingMatches: (teamId?: string) => FUSportsMatch[];
|
|
52
|
+
getFinishedMatches: (teamId?: string) => FUSportsMatch[];
|
|
53
|
+
getTeamLastMatch: (teamId: string) => FUSportsMatch | undefined;
|
|
54
|
+
getTeamNextMatch: (teamId: string) => FUSportsMatch | undefined;
|
|
55
|
+
getTeamStanding: (teamId: string) => FUSportsStandingEntry | undefined;
|
|
56
|
+
getTeamForm: (teamId: string) => FUSportsCompetitorForm | undefined;
|
|
57
|
+
getTeamPosition: (teamId: string) => number | undefined;
|
|
58
|
+
getTopTeams: (limit: number) => FUSportsStandingEntry[];
|
|
59
|
+
getBottomTeams: (limit: number) => FUSportsStandingEntry[];
|
|
60
|
+
getTeamsAlphabetically: FUSportsCompetitor[];
|
|
61
|
+
getTeamSeasonStats: (teamId: string) => {
|
|
62
|
+
position: number;
|
|
63
|
+
points: number;
|
|
64
|
+
played: number;
|
|
65
|
+
won: number;
|
|
66
|
+
drawn: number;
|
|
67
|
+
lost: number;
|
|
68
|
+
goalsFor: number;
|
|
69
|
+
goalsAgainst: number;
|
|
70
|
+
goalDifference: number;
|
|
71
|
+
} | undefined;
|
|
72
|
+
getFormStandings: (matchCount?: number) => FUSportsStandings;
|
|
73
|
+
getHomeFormStandings: (matchCount?: number) => FUSportsStandings;
|
|
74
|
+
getAwayFormStandings: (matchCount?: number) => FUSportsStandings;
|
|
75
|
+
getOffenceStandings: () => FUSportsStandings;
|
|
76
|
+
getDefenceStandings: () => FUSportsStandings;
|
|
77
|
+
getFormOffenceStandings: (matchCount?: number) => FUSportsStandings;
|
|
78
|
+
getFormDefenceStandings: (matchCount?: number) => FUSportsStandings;
|
|
79
|
+
getHomeOffenceStandings: () => FUSportsStandings;
|
|
80
|
+
getHomeDefenceStandings: () => FUSportsStandings;
|
|
81
|
+
getAwayOffenceStandings: () => FUSportsStandings;
|
|
82
|
+
getAwayDefenceStandings: () => FUSportsStandings;
|
|
83
|
+
goalDistribution: GoalDistribution;
|
|
84
|
+
getGoalDistribution: (intervalMinutes?: number) => GoalDistribution;
|
|
85
|
+
competitionStats: CompetitionStats;
|
|
86
|
+
getSeasonMatches: (seasonId: string) => FUSportsMatch[] | undefined;
|
|
87
|
+
getSeasonStandings: (seasonId: string) => FUSportsStandings | undefined;
|
|
88
|
+
getTeamResultsTable: (teamId: string) => TeamResultTable;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Props for the CompetitionProvider component
|
|
92
|
+
*/
|
|
93
|
+
export interface CompetitionProviderProps {
|
|
94
|
+
/** Competition ID to fetch data for */
|
|
95
|
+
competitionId: string;
|
|
96
|
+
/** Optional season ID (defaults to current season) */
|
|
97
|
+
seasonId?: string;
|
|
98
|
+
/** Optional stage ID */
|
|
99
|
+
stageId?: string;
|
|
100
|
+
/** Initial competition data (from SSR) */
|
|
101
|
+
competition?: FUSportsCompetition;
|
|
102
|
+
/** Initial season details (from SSR) */
|
|
103
|
+
season?: FUSportsSeasonDetails;
|
|
104
|
+
/** Initial matches data (from SSR) */
|
|
105
|
+
matches?: FUSportsMatch[];
|
|
106
|
+
/** Initial standings data (from SSR) */
|
|
107
|
+
standings?: FUSportsStandings;
|
|
108
|
+
/** Historical season data */
|
|
109
|
+
previousSeasons?: Season[];
|
|
110
|
+
/** Custom configuration */
|
|
111
|
+
config?: CompetitionConfig;
|
|
112
|
+
/** Enable auto-refresh for live matches (default: true) */
|
|
113
|
+
autoRefresh?: boolean;
|
|
114
|
+
/** Refresh interval in milliseconds (default: 30000) */
|
|
115
|
+
refreshInterval?: number;
|
|
116
|
+
children: ReactNode;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=competition.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"competition.types.d.ts","sourceRoot":"","sources":["../../src/lib/providers/competition.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACR,aAAa,E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D;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,wCAAwC;IACxC,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,sCAAsC;IACtC,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,wCAAwC;IACxC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,6BAA6B;IAC7B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B,2BAA2B;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B,2DAA2D;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,QAAQ,EAAE,SAAS,CAAC;CACvB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FansUnitedConfig } from "./fansunited-config.types";
|
|
2
|
+
/**
|
|
3
|
+
* Context for FansUnited configuration
|
|
4
|
+
*/
|
|
5
|
+
export declare const FansUnitedConfigContext: import("react").Context<FansUnitedConfig | null>;
|
|
6
|
+
//# sourceMappingURL=fansunited-config.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fansunited-config.context.d.ts","sourceRoot":"","sources":["../../src/lib/providers/fansunited-config.context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,uBAAuB,kDAA+C,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FansUnitedConfig } from "./fansunited-config.types";
|
|
2
|
+
import type { DataLayerConfig } from "../config";
|
|
3
|
+
/**
|
|
4
|
+
* Hook to access the full FansUnited configuration
|
|
5
|
+
* Must be used within a FansUnitedConfigProvider
|
|
6
|
+
*
|
|
7
|
+
* @returns The FansUnited configuration
|
|
8
|
+
* @throws Error if used outside of FansUnitedConfigProvider
|
|
9
|
+
*/
|
|
10
|
+
export declare function useFansUnitedConfig(): FansUnitedConfig;
|
|
11
|
+
/**
|
|
12
|
+
* Hook to access the data layer configuration
|
|
13
|
+
* Must be used within a FansUnitedConfigProvider
|
|
14
|
+
*
|
|
15
|
+
* @returns The data layer configuration
|
|
16
|
+
* @throws Error if used outside of FansUnitedConfigProvider
|
|
17
|
+
*/
|
|
18
|
+
export declare function useDataLayerConfig(): DataLayerConfig;
|
|
19
|
+
//# sourceMappingURL=fansunited-config.hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fansunited-config.hooks.d.ts","sourceRoot":"","sources":["../../src/lib/providers/fansunited-config.hooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAStD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAGpD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { FansUnitedConfigProviderProps } from "./fansunited-config.types";
|
|
2
|
+
/**
|
|
3
|
+
* FansUnitedConfigProvider - Provides configuration to all FansUnited components
|
|
4
|
+
*
|
|
5
|
+
* This provider should wrap your app at the root level to provide configuration
|
|
6
|
+
* to all data layer providers (TeamProvider, CompetitionProvider, etc.).
|
|
7
|
+
*
|
|
8
|
+
* In Next.js App Router, add this to your root layout:
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // app/layout.tsx (Server Component)
|
|
13
|
+
* import { setConfig } from 'fansunited-data-layer';
|
|
14
|
+
* import { FansUnitedConfigProvider } from 'fansunited-data-layer/client';
|
|
15
|
+
*
|
|
16
|
+
* const config = {
|
|
17
|
+
* dataLayer: {
|
|
18
|
+
* defaultSportsProvider: 'sportal365Sports',
|
|
19
|
+
* sportal365Sports: {
|
|
20
|
+
* username: process.env.SPORTAL365_USERNAME!,
|
|
21
|
+
* password: process.env.SPORTAL365_PASSWORD!,
|
|
22
|
+
* projectId: process.env.SPORTAL365_PROJECT_ID!,
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* };
|
|
26
|
+
*
|
|
27
|
+
* // Initialize server-side config
|
|
28
|
+
* setConfig(config.dataLayer);
|
|
29
|
+
*
|
|
30
|
+
* export default function RootLayout({ children }) {
|
|
31
|
+
* return (
|
|
32
|
+
* <html>
|
|
33
|
+
* <body>
|
|
34
|
+
* <FansUnitedConfigProvider config={config}>
|
|
35
|
+
* {children}
|
|
36
|
+
* </FansUnitedConfigProvider>
|
|
37
|
+
* </body>
|
|
38
|
+
* </html>
|
|
39
|
+
* );
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function FansUnitedConfigProvider({ config, children }: FansUnitedConfigProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
//# sourceMappingURL=fansunited-config.provider.d.ts.map
|