@sleeperhq/mini-core 1.2.2 → 1.2.4

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.
@@ -1,5 +1,4 @@
1
- import { NavigationType, NavigationTypeId } from './types';
2
- declare class SleeperActions {
3
- navigate: (navType: NavigationType, navTypeId: NavigationTypeId) => void;
4
- }
5
- export default SleeperActions;
1
+ import { NavigationTabId } from './types';
2
+ export type SleeperActions = {
3
+ navigate: (navTabType: NavigationTabId, args?: any) => void;
4
+ };
@@ -1,9 +1,9 @@
1
- import { User, Navigation, League, LeaguesMap, RostersInLeagueMap, UserMap, MatchupsInLeagueMap, UsersInLeagueMap, PlayoffsInLeagueMap, TransactionsInLeagueMap, TransactionsMap, SportInfoMap, DraftsInLeagueMap, DraftPickTradesInLeagueMap, DraftPicksInDraftMap, PlayersInSportMap } from './types';
2
- import SleeperActions from './sleeper_actions';
1
+ import { User, League, LeaguesMap, RostersInLeagueMap, UserMap, MatchupsInLeagueMap, UsersInLeagueMap, PlayoffsInLeagueMap, TransactionsInLeagueMap, TransactionsMap, SportInfoMap, DraftsInLeagueMap, DraftPickTradesInLeagueMap, DraftPicksInDraftMap, PlayersInSportMap } from './types';
2
+ import type { SleeperActions } from './sleeper_actions';
3
+
3
4
  declare class SleeperContext {
4
5
  static apiLevel: string;
5
6
  user: User;
6
- navigation: Navigation;
7
7
  league: League;
8
8
  leaguesMap: LeaguesMap;
9
9
  userLeagueList: string[];
@@ -20,6 +20,5 @@ declare class SleeperContext {
20
20
  draftPicksInDraftMap: DraftPicksInDraftMap;
21
21
  playersInSportMap: PlayersInSportMap;
22
22
  actions: SleeperActions;
23
- constructor();
24
23
  }
25
24
  export default SleeperContext;
@@ -1,13 +1,6 @@
1
- import { NAVIGATION_ID, NAVIGATION_TYPE } from './redux/native_nav/constants.d';
2
1
  import { League, Roster, User, MatchupLeg, LeagueTransaction, Draft, DraftPick, RosterDraftPick, Player } from './shared/graphql.d';
3
- export type NavigationType = typeof NAVIGATION_TYPE[keyof typeof NAVIGATION_TYPE];
4
- export type NavigationTypeId = typeof NAVIGATION_ID[keyof typeof NAVIGATION_ID];
2
+ export type NavigationTabId = 'LeaguesIndexScreen' | 'LeaguesDetailScreen' | 'ScoreIndexScreen' | 'ScoreDetailScreen' | 'PicksIndexScreen' | 'FeedIndexScreen' | 'WebviewScreen' | 'ManageChannelsScreen' | 'InboxIndexScreen' | 'MinisIndexScreen' | 'ManageChannelsScreen' | 'InboxIndexScreen' | 'MinisIndexScreen';
5
3
  export * from './shared/graphql.d';
6
- export type Navigation = {
7
- selectedNavType: NavigationType;
8
- selectedNavTypeId: NavigationTypeId;
9
- selectedNavData: {};
10
- };
11
4
  export type LeagueId = string;
12
5
  export type RosterId = string;
13
6
  export type UserId = string;
@@ -34,18 +27,18 @@ export type Bracket = {
34
27
  export type BracketSet = {
35
28
  bracket: Bracket[];
36
29
  loserBracket: Bracket[];
37
- }
30
+ };
38
31
  export type SportInfo = {
39
32
  season_type: string;
40
33
  season: string;
41
- week: number;
42
- display_week: number;
43
- leg: number;
44
- league_season: string;
45
- league_create_season: string;
46
- previous_season: string;
47
- season_start_date: string;
48
- season_end_date: string;
34
+ week?: number;
35
+ display_week?: number;
36
+ leg?: number;
37
+ league_season?: string;
38
+ league_create_season?: string;
39
+ previous_season?: string;
40
+ season_start_date?: string;
41
+ season_end_date?: string;
49
42
  };
50
43
  export type LeaguesMap = Record<LeagueId, League>;
51
44
  export type RostersMap = Record<RosterId, Roster>;
@@ -53,7 +46,7 @@ export type RostersInLeagueMap = Record<LeagueId, RostersMap>;
53
46
  export type UserMap = Record<UserId, User>;
54
47
  export type MathchupWeekMap = Record<MatchupWeek, MatchupLeg>;
55
48
  export type MatchupsInLeagueMap = Record<LeagueId, MathchupWeekMap>;
56
- export type UsersInLeagueMap = Record<LeagueId, Record<UserId, User>>;
49
+ export type UsersInLeagueMap = Record<LeagueId, UserMap>;
57
50
  export type PlayoffsInLeagueMap = Record<LeagueId, BracketSet>;
58
51
  export type TransactionsInLeagueMap = Record<LeagueId, TransactionId[]>;
59
52
  export type TransactionsMap = Record<TransactionId, LeagueTransaction>;
@@ -63,3 +56,17 @@ export type DraftPickTradesInLeagueMap = Record<LeagueId, RosterDraftPick[]>;
63
56
  export type DraftPicksInDraftMap = Record<DraftId, DraftPick[]>;
64
57
  export type PlayersMap = Record<PlayerId, Player>;
65
58
  export type PlayersInSportMap = Record<SportType, PlayersMap>;
59
+ export declare enum MiniCategory {
60
+ DEVELOPER = "Developer",
61
+ FEATURED = "Featured",
62
+ GAMES = "Games",
63
+ SPORTUTILITY = "Sport Utility"
64
+ }
65
+ export type Mini = {
66
+ name: string;
67
+ description: string;
68
+ image: string;
69
+ category: MiniCategory;
70
+ id: string;
71
+ };
72
+ export type VersionMap = Record<string, Mini>;
@@ -21,3 +21,11 @@ export declare const NAVIGATION_ID: {
21
21
  readonly MENTIONS: 6;
22
22
  readonly FRIENDS: 7;
23
23
  };
24
+ export declare const NAVIGATION_TAB_ID: {
25
+ readonly FantasyTab: "FantasyTab";
26
+ readonly ScoresTab: "ScoresTab";
27
+ readonly GamesTab: "GamesTab";
28
+ readonly FeedTab: "FeedTab";
29
+ readonly InboxTab: "InboxTab";
30
+ readonly MinisTab: "MinisTab";
31
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleeperhq/mini-core",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Core library frameworks for developing Sleeper Mini Apps.",
5
5
  "main": "index.ts",
6
6
  "types": "index.d.ts",
@@ -34,7 +34,7 @@
34
34
  "access": "public"
35
35
  },
36
36
  "peerDependencies": {
37
- "@callstack/repack": "blitzstudios/repack.git#callstack-repack-v2.6.1-gitpkg",
37
+ "@callstack/repack": "blitzstudios/repack.git#callstack-repack-v2.6.3-gitpkg",
38
38
  "@react-native-community/netinfo": "9.3.7",
39
39
  "axios": "0.15.3",
40
40
  "lodash": "4.17.21",