@sleeperhq/mini-core 1.5.5 → 1.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LeagueId, PlayerId, RosterId, TransactionId } from '..';
|
|
1
|
+
import type { LeagueId, PlayerId, RosterId, SportType, TransactionId } from '..';
|
|
2
2
|
export type NavigationParams = {
|
|
3
3
|
LeaguesIndexScreen: undefined;
|
|
4
4
|
LeaguesDetailScreen: LeaguesDetailScreenParams;
|
|
@@ -12,6 +12,7 @@ export type NavigationParams = {
|
|
|
12
12
|
LeftDrawer: undefined;
|
|
13
13
|
TradeCenterTransactionScreen: TradeCenterTransactionScreenParams;
|
|
14
14
|
TradeCenterPlayersScreen: TradeCenterPlayersScreenParams;
|
|
15
|
+
PlayerPopupScreen: PlayerPopupScreenParams;
|
|
15
16
|
};
|
|
16
17
|
export type NavigationScreen = keyof NavigationParams;
|
|
17
18
|
export type LeaguesDetailScreenParams = {
|
|
@@ -28,3 +29,7 @@ export type TradeCenterPlayersScreenParams = {
|
|
|
28
29
|
addMap?: Record<RosterId, PlayerId[]>;
|
|
29
30
|
dropMap?: Record<RosterId, PlayerId[]>;
|
|
30
31
|
};
|
|
32
|
+
export type PlayerPopupScreenParams = {
|
|
33
|
+
playerId: PlayerId;
|
|
34
|
+
sport: SportType;
|
|
35
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { NavigationParams, NavigationScreen, ToastConfig } from './types';
|
|
1
|
+
import { NavigationParams, NavigationScreen, ToastConfig, Notification } from './types';
|
|
2
2
|
export type SleeperActions = {
|
|
3
|
-
navigate
|
|
4
|
-
requestLocation
|
|
5
|
-
showToast
|
|
3
|
+
navigate?: <T extends NavigationScreen>(screen: T, params?: NavigationParams[T]) => void;
|
|
4
|
+
requestLocation?: () => void;
|
|
5
|
+
showToast?: (toastData: ToastConfig) => void;
|
|
6
|
+
scheduleNotification?: (notification: Notification) => Promise<string>;
|
|
7
|
+
cancelNotification?: (notificationId: string) => Promise<void>;
|
|
6
8
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { User, League, LeaguesMap, RostersInLeagueMap, UserMap, MatchupsInLeagueMap, UsersInLeagueMap, PlayoffsInLeagueMap, TransactionsInLeagueMap, TransactionsMap, SportInfoMap, DraftsInLeagueMap, DraftPickTradesInLeagueMap, DraftPicksInDraftMap, PlayersInSportMap, Topic, Location } from './types';
|
|
2
2
|
import type { SleeperActions } from './sleeper_actions';
|
|
3
|
-
|
|
4
3
|
declare class SleeperContext {
|
|
5
4
|
static apiLevel: string;
|
|
6
5
|
user: User;
|
|
@@ -59,14 +59,20 @@ export type DraftPickTradesInLeagueMap = Record<LeagueId, RosterDraftPick[]>;
|
|
|
59
59
|
export type DraftPicksInDraftMap = Record<DraftId, DraftPick[]>;
|
|
60
60
|
export type PlayersMap = Record<PlayerId, Player>;
|
|
61
61
|
export type PlayersInSportMap = Record<SportType, PlayersMap>;
|
|
62
|
-
export type Entitlement = 'user:email' | 'user:phone' | 'wallet:date_of_birth' | 'wallet:first_name' | 'wallet:last_name' | 'wallet:country_code' | 'wallet:city' | 'location:longitude' | 'location:latitude' | 'location:state' | 'location:country' | 'location:postalCode';
|
|
62
|
+
export type Entitlement = 'user:email' | 'user:phone' | 'wallet:date_of_birth' | 'wallet:first_name' | 'wallet:last_name' | 'wallet:country_code' | 'wallet:city' | 'location:longitude' | 'location:latitude' | 'location:state' | 'location:country' | 'location:postalCode' | 'action:push_notification';
|
|
63
63
|
export declare const EntitlementDisplayText: Record<Entitlement, string>;
|
|
64
|
-
export
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
export type Notification = {
|
|
65
|
+
title?: string | undefined;
|
|
66
|
+
body?: string | undefined;
|
|
67
|
+
timestamp?: number;
|
|
68
|
+
};
|
|
69
|
+
export declare const EventHandlerResult: {
|
|
70
|
+
readonly CONSUMED: "CONSUMED";
|
|
71
|
+
readonly PROPAGATE: "PROPAGATE";
|
|
72
|
+
};
|
|
73
|
+
export type EventHandlerResultType = typeof EventHandlerResult[keyof typeof EventHandlerResult];
|
|
68
74
|
export type Events = {
|
|
69
|
-
onBackButtonPressed?: () =>
|
|
75
|
+
onBackButtonPressed?: () => EventHandlerResultType;
|
|
70
76
|
};
|
|
71
77
|
export type HeaderOptions = {
|
|
72
78
|
useLeagueSelector?: boolean;
|