@simple-parlay/components 1.30.6-pre → 1.30.6-pre.11
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/dist/index.cjs +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +653 -451
- package/dist/react/components/CallGameCatalogue.d.ts +4 -0
- package/dist/react/components/CallPayoutTable.d.ts +12 -0
- package/dist/react/components/CallTicketBuilder.d.ts +3 -0
- package/dist/react/components/CorrelationChoicesSkeleton.d.ts +4 -0
- package/dist/react/components/CorrelationPricingDebug.d.ts +2 -0
- package/dist/react/components/CorrelationPropPlaceholder.d.ts +13 -0
- package/dist/react/components/DenseGameCatalogue.d.ts +2 -0
- package/dist/react/components/DenseUi.d.ts +30 -0
- package/dist/react/components/EntriesPage.d.ts +0 -4
- package/dist/react/components/EntrySubmission.d.ts +1 -1
- package/dist/react/components/EventSwipeModal.d.ts +4 -0
- package/dist/react/components/GameCardParts.d.ts +28 -0
- package/dist/react/components/GameModeCard.d.ts +37 -6
- package/dist/react/components/GamePage.d.ts +3 -1
- package/dist/react/components/GameSelector.d.ts +1 -19
- package/dist/react/components/GameSetupPage.d.ts +6 -2
- package/dist/react/components/GameShelfCatalogue.d.ts +2 -0
- package/dist/react/components/GameShowcaseCatalogue.d.ts +11 -0
- package/dist/react/components/GameSkeletons.d.ts +24 -0
- package/dist/react/components/GameVariantCatalogue.d.ts +6 -0
- package/dist/react/components/HowToPlayButton.d.ts +5 -2
- package/dist/react/components/LoadingIndicators.d.ts +27 -10
- package/dist/react/components/MatchRail.d.ts +52 -0
- package/dist/react/components/MatchTopBar.d.ts +19 -0
- package/dist/react/components/MultiLegTable.d.ts +5 -1
- package/dist/react/components/PageBackButton.d.ts +35 -6
- package/dist/react/components/PageSkeletons.d.ts +24 -0
- package/dist/react/components/PickGroupSection.d.ts +37 -0
- package/dist/react/components/PickerBrand.d.ts +0 -5
- package/dist/react/components/PicksSkeletons.d.ts +30 -0
- package/dist/react/components/PlaceEntryProvider.d.ts +75 -6
- package/dist/react/components/PlaybookChooser.d.ts +7 -0
- package/dist/react/components/PropositionFilters.d.ts +2 -1
- package/dist/react/components/PropositionParts.d.ts +38 -0
- package/dist/react/components/QuickPickButton.d.ts +26 -1
- package/dist/react/components/QuickPickMenu.d.ts +19 -1
- package/dist/react/components/SafetyNetPage.d.ts +4 -1
- package/dist/react/components/ScrollShelf.d.ts +5 -1
- package/dist/react/components/SelectionReview.d.ts +1 -1
- package/dist/react/components/SelectionsPage.d.ts +7 -2
- package/dist/react/components/ShelfKit.d.ts +43 -0
- package/dist/react/components/SportRail.d.ts +13 -7
- package/dist/react/components/SportSelector.d.ts +2 -24
- package/dist/react/components/SuccessPage.d.ts +4 -2
- package/dist/react/components/SwipeDeck.d.ts +32 -3
- package/dist/react/components/YesNoMultiLogo.d.ts +13 -0
- package/dist/react/components/_primitives/index.d.ts +54 -13
- package/dist/react/index.cjs +1 -0
- package/dist/react/index.d.ts +46 -19
- package/dist/react/index.mjs +653 -451
- package/dist/react/utils/dom.d.ts +7 -0
- package/dist/react/utils/index.d.ts +1 -1
- package/dist/react/utils/themes.d.ts +1 -1
- package/dist/react-native/components/CallGameCatalogue.d.ts +17 -0
- package/dist/react-native/components/CallPayoutTable.d.ts +12 -0
- package/dist/react-native/components/CallTicketBuilder.d.ts +33 -0
- package/dist/react-native/components/CorrelationChoicesSkeleton.d.ts +3 -0
- package/dist/react-native/components/CorrelationPricingDebug.d.ts +2 -0
- package/dist/react-native/components/CorrelationPropPlaceholder.d.ts +7 -0
- package/dist/react-native/components/DenseGameCatalogue.d.ts +2 -0
- package/dist/react-native/components/DenseUi.d.ts +52 -0
- package/dist/react-native/components/EntrySubmission.d.ts +1 -1
- package/dist/react-native/components/EventSwipeModal.d.ts +5 -0
- package/dist/react-native/components/GameCardParts.d.ts +29 -0
- package/dist/react-native/components/GameModeCard.d.ts +34 -5
- package/dist/react-native/components/GamePage.d.ts +4 -1
- package/dist/react-native/components/GameSelector.d.ts +1 -20
- package/dist/react-native/components/GameSetupPage.d.ts +5 -14
- package/dist/react-native/components/GameShelfCatalogue.d.ts +2 -0
- package/dist/react-native/components/GameSkeletons.d.ts +23 -0
- package/dist/react-native/components/HowToPlayButton.d.ts +5 -2
- package/dist/react-native/components/LoadingIndicators.d.ts +23 -11
- package/dist/react-native/components/MatchRail.d.ts +57 -0
- package/dist/react-native/components/MatchTopBar.d.ts +17 -0
- package/dist/react-native/components/MultiLegTable.d.ts +5 -1
- package/dist/react-native/components/PageBackButton.d.ts +32 -9
- package/dist/react-native/components/PageSkeletons.d.ts +23 -0
- package/dist/react-native/components/PickGroupSection.d.ts +37 -0
- package/dist/react-native/components/PickerBrand.d.ts +0 -4
- package/dist/react-native/components/PicksSkeletons.d.ts +31 -0
- package/dist/react-native/components/PlaceEntryProvider.d.ts +68 -6
- package/dist/react-native/components/PlaybookChooser.d.ts +7 -0
- package/dist/react-native/components/PropositionFilters.d.ts +2 -1
- package/dist/react-native/components/PropositionParts.d.ts +35 -0
- package/dist/react-native/components/QuickPickButton.d.ts +26 -1
- package/dist/react-native/components/QuickPickMenu.d.ts +20 -1
- package/dist/react-native/components/SafetyNetPage.d.ts +4 -1
- package/dist/react-native/components/ScrollShelf.d.ts +8 -1
- package/dist/react-native/components/SelectionReview.d.ts +1 -1
- package/dist/react-native/components/SelectionsPage.d.ts +6 -2
- package/dist/react-native/components/ShelfKit.d.ts +62 -0
- package/dist/react-native/components/SportRail.d.ts +13 -7
- package/dist/react-native/components/SportSelector.d.ts +2 -29
- package/dist/react-native/components/SuccessPage.d.ts +4 -2
- package/dist/react-native/components/SwipeDeck.d.ts +37 -3
- package/dist/react-native/components/YesNoMultiLogo.d.ts +12 -0
- package/dist/react-native/components/_primitives/index.d.ts +93 -12
- package/dist/react-native/index.cjs +1 -0
- package/dist/react-native/index.d.ts +46 -19
- package/dist/react-native/index.mjs +561 -437
- package/dist/react-native/utils/index.d.ts +1 -1
- package/dist/react-native/utils/themes.d.ts +1 -1
- package/dist/shared/api-client.d.ts +4 -3
- package/dist/shared/button-ui.d.ts +62 -0
- package/dist/shared/call-presentation.d.ts +28 -0
- package/dist/shared/canvas.d.ts +14 -0
- package/dist/shared/correlation-steering.d.ts +56 -0
- package/dist/shared/date-filters.d.ts +0 -22
- package/dist/shared/dense-ui.d.ts +54 -0
- package/dist/shared/entry-progress.d.ts +38 -0
- package/dist/shared/game-artwork.d.ts +63 -0
- package/dist/shared/game-flow.d.ts +34 -1
- package/dist/shared/game-icons.d.ts +8 -4
- package/dist/shared/game-library.d.ts +58 -0
- package/dist/shared/game-set-bet.d.ts +0 -1
- package/dist/shared/game-shelf-artwork.d.ts +3 -0
- package/dist/shared/game-shelf-presentation.d.ts +79 -0
- package/dist/shared/game-variants.d.ts +5 -0
- package/dist/shared/hooks.d.ts +8 -8
- package/dist/shared/how-to-play-html.d.ts +1 -1
- package/dist/shared/how-to-play-logo.d.ts +1 -1
- package/dist/shared/menu-placement.d.ts +26 -0
- package/dist/shared/mirror.d.ts +55 -5
- package/dist/shared/picker-brand.d.ts +22 -6
- package/dist/shared/playbook.d.ts +29 -0
- package/dist/shared/selection-actions.d.ts +82 -4
- package/dist/shared/selection-caps.d.ts +124 -0
- package/dist/shared/selection-variants.d.ts +10 -1
- package/dist/shared/shelf-covers.d.ts +92 -0
- package/dist/shared/shelf-ui.d.ts +47 -0
- package/dist/shared/swipe-deck.d.ts +11 -1
- package/dist/shared/themes.d.ts +70 -8
- package/dist/shared/tokens.d.ts +7 -0
- package/dist/shared/types.d.ts +49 -3
- package/dist/shared/ui-system.d.ts +70 -0
- package/dist/shared/ui-variant.d.ts +16 -0
- package/dist/shared/use-call-payouts.d.ts +8 -0
- package/dist/shared/utils.d.ts +20 -7
- package/package.json +7 -8
- package/dist/index.js +0 -1
- package/dist/react/components/GameSetBetPage.d.ts +0 -21
- package/dist/react/components/LadderPage.d.ts +0 -21
- package/dist/react/components/MirrorPage.d.ts +0 -21
- package/dist/react/components/PerfectPickPage.d.ts +0 -22
- package/dist/react/components/PickYourDividendPage.d.ts +0 -21
- package/dist/react/components/RuleSetupPage.d.ts +0 -27
- package/dist/react/components/SixAgainPage.d.ts +0 -16
- package/dist/react/index.js +0 -1
- package/dist/react/utils/design.d.ts +0 -55
- package/dist/react-native/components/GameSetBetPage.d.ts +0 -19
- package/dist/react-native/components/LadderPage.d.ts +0 -19
- package/dist/react-native/components/MirrorPage.d.ts +0 -19
- package/dist/react-native/components/PerfectPickPage.d.ts +0 -20
- package/dist/react-native/components/PickYourDividendPage.d.ts +0 -19
- package/dist/react-native/components/RuleSetupPage.d.ts +0 -23
- package/dist/react-native/components/SixAgainPage.d.ts +0 -14
- package/dist/react-native/index.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { resolvePrice, toNumber, toBool, formatYesNo, formatCurrency, formatDate, groupPropositionsBySport, getPropositionSportKey, collectPropositionSportKeys, compositePropositionMatchesSport, compositePropositionMatchesGameSports, groupPropositionsByCategory, groupPropositionsByEntryCategory, getPropositionEntryCategory, isRacingProposition, getAvailableEntryCategories, getSportPickerTitle, getCategoryDisplayName, getCategoryTagline, getSportShortCode, getSportPickerTagline, getSportSummaryTagline, splitSportLabel, getSportComingSoonCaption, getHowToPlayPanel, describeDemoVerdict, groupByMatchup, groupByRace, groupPropositionsForDisplay, isRacingCategory, buildRangeLegOptions, getPayoutForCount, generateQuickPick, isValidSelectionCount, getEffectivePropositionLimits, findPermittedRule, getJackpotInfo, getSportDisplayName, resolveSportDisplayName, resolveCategoryDisplayName, filterPropositionsForGame, filterPropositionPool, filterGamesByPropositionPool, filterGamesByEntryCategory, gameHasPropositionsInPool, getGameEntryCategory, gameMatchesEntryCategory, gamePermitsSport, normalizeGamesSport, sportKeysCompatible, propositionSportMatches, isGameAvailableToday, getAvailableDaysLabel, contrastTextColour, readableColor, getCompositeOperatorLabel, getCompositeHelperText, parseCompositeDescription, inferCompositeOperatorFromDescription, resolveCompositeOperator, resolveCompositeDisplay, resolveCompositeLegs, parseCompositeComponentIds, collectCompositeComponentIds, formatPropositionEventLabel, getPropositionDescription, getPropositionMarketType, resolveGameIconId, resolveGameIconUrl, isGameIconUrl, resolveGameIconMarkup, } from '../../shared/utils';
|
|
1
|
+
export { resolvePrice, toNumber, toBool, formatYesNo, DEFAULT_YES_NO_LABELS, formatCurrency, formatDate, groupPropositionsBySport, getPropositionSportKey, collectPropositionSportKeys, compositePropositionMatchesSport, compositePropositionMatchesGameSports, groupPropositionsByCategory, groupPropositionsByEntryCategory, getPropositionEntryCategory, isRacingProposition, getAvailableEntryCategories, getSportPickerTitle, getCategoryDisplayName, getCategoryTagline, getSportShortCode, getSportPickerTagline, getSportSummaryTagline, splitSportLabel, getSportComingSoonCaption, getHowToPlayPanel, describeDemoVerdict, groupByMatchup, groupByRace, groupPropositionsForDisplay, isRacingCategory, buildRangeLegOptions, getPayoutForCount, generateQuickPick, isValidSelectionCount, getEffectivePropositionLimits, findPermittedRule, getJackpotInfo, getSportDisplayName, resolveSportDisplayName, resolveSportLabel, resolveCategoryDisplayName, filterPropositionsForGame, filterPropositionPool, filterGamesByPropositionPool, filterGamesByEntryCategory, gameHasPropositionsInPool, getGameEntryCategory, gameMatchesEntryCategory, gamePermitsSport, normalizeGamesSport, sportKeysCompatible, propositionSportMatches, isGameAvailableToday, getAvailableDaysLabel, contrastTextColour, readableColor, getCompositeOperatorLabel, getCompositeHelperText, parseCompositeDescription, inferCompositeOperatorFromDescription, resolveCompositeOperator, resolveCompositeDisplay, resolveCompositeLegs, parseCompositeComponentIds, collectCompositeComponentIds, formatPropositionEventLabel, getPropositionDescription, getPropositionMarketType, resolveGameIconId, resolveGameIconUrl, isGameIconUrl, resolveGameIconMarkup, } from '../../shared/utils';
|
|
2
2
|
export type { SportDisplayNameOverrides, CategoryDisplayNameOverrides, GameIconId, ComingSoonSport, HowToPlayPanelContent, HowToPlaySummarySegment, HowToPlayStep, HowToPlayDemoLeg, HowToPlayDemoVerdict } from '../../shared/utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BladeTheme } from '../../shared/themes';
|
|
2
2
|
export type { BladeTheme, BladeThemeSet, ColorScheme } from '../../shared/themes';
|
|
3
|
-
export { defaultTheme, greenTheme, greenLightTheme, darkTheme, goldTheme, goldLightTheme, defaultThemeSet, greenThemeSet, goldThemeSet, getTheme, getThemeSet, themes, themeSets, themeHeading, themeLabel, themeValue, themeAccent, accentOnSurface, themeProductYes, themeProductNo, PRODUCT_YES, PRODUCT_NO, themeTextAlt, themeTextAltMuted, themeSelectionCard, themeMatchupHeader, themeSelectionProp, themePickerSurfaceColors, resolveTheme, isThemeSet, useResolvedTheme, } from '../../shared/themes';
|
|
3
|
+
export { defaultTheme, greenTheme, greenLightTheme, darkTheme, goldTheme, goldLightTheme, defaultThemeSet, greenThemeSet, goldThemeSet, getTheme, getThemeSet, themes, themeSets, themeHeading, themeLabel, themeValue, themeAccent, canvasTheme, accentOnSurface, themeProductYes, themeProductNo, PRODUCT_YES, PRODUCT_NO, productTextOn, themeTextAlt, themeTextAltMuted, themeSelectionCard, themeMatchupHeader, themeSelectionProp, themePickerSurfaceColors, resolveTheme, isThemeSet, useResolvedTheme, } from '../../shared/themes';
|
|
4
4
|
export declare function themeBodyFont(t: BladeTheme): string;
|
|
5
5
|
export declare function themeHeadingFont(t: BladeTheme): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Game, Proposition, SportSummary, GameEntry, TopPayoutsResponse, EvaluateRuleRequest, EvaluateRuleResponse, CalculatePayoutRequest, CalculatePayoutResponse, EntryPreviewRequest, EntryPreviewResponse } from './types';
|
|
1
|
+
import { Game, Proposition, SportSummary, GameEntry, TopPayoutsResponse, EvaluateRuleRequest, EvaluateRuleResponse, CalculatePayoutRequest, CalculatePayoutResponse, EntryPreviewRequest, EntryPreviewResponse, GameCategory } from './types';
|
|
2
2
|
export interface GamesListResponse {
|
|
3
3
|
payload: Game[];
|
|
4
4
|
how_to_play_markdown?: string | null;
|
|
@@ -21,7 +21,7 @@ export declare class BladeApiClient {
|
|
|
21
21
|
invalidate(): void;
|
|
22
22
|
private request;
|
|
23
23
|
getGames(params?: {
|
|
24
|
-
category?:
|
|
24
|
+
category?: GameCategory;
|
|
25
25
|
jurisdiction?: string;
|
|
26
26
|
sport?: string;
|
|
27
27
|
}): Promise<{
|
|
@@ -32,7 +32,7 @@ export declare class BladeApiClient {
|
|
|
32
32
|
getPropositions(params?: {
|
|
33
33
|
event_id?: string;
|
|
34
34
|
sport?: string;
|
|
35
|
-
category?:
|
|
35
|
+
category?: GameCategory;
|
|
36
36
|
}): Promise<Proposition[]>;
|
|
37
37
|
getSports(): Promise<SportSummary[]>;
|
|
38
38
|
getPropositionsByIds(ids: number[]): Promise<Proposition[]>;
|
|
@@ -68,6 +68,7 @@ export declare class BladeApiClient {
|
|
|
68
68
|
}): Promise<GameEntry>;
|
|
69
69
|
getGameMaxPayout(gameId: number, betAmount?: number): Promise<TopPayoutsResponse>;
|
|
70
70
|
getGamesMaxPayouts(ids: number[], betAmount?: number): Promise<Record<number, TopPayoutsResponse>>;
|
|
71
|
+
getCorrelationSuggestions(gameId: number, data: import('./correlation-steering').CorrelationRequest, signal?: AbortSignal): Promise<import('./correlation-steering').CorrelationSuggestions>;
|
|
71
72
|
getEntryPreview(gameId: number, data: EntryPreviewRequest): Promise<EntryPreviewResponse>;
|
|
72
73
|
evaluateRule(gameId: number, data: EvaluateRuleRequest): Promise<EvaluateRuleResponse>;
|
|
73
74
|
calculatePayout(gameId: number, data: CalculatePayoutRequest): Promise<CalculatePayoutResponse>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { BladeTheme } from './themes';
|
|
2
|
+
/**
|
|
3
|
+
* The kit's one button language. Web and RN both draw from here, in every UI
|
|
4
|
+
* system, so an action button looks and reacts the same on every screen:
|
|
5
|
+
*
|
|
6
|
+
* - primary — the one main action on a screen. Filled.
|
|
7
|
+
* - secondary — the alternative beside it. Filled in the theme's buttonSecondary — never an outline.
|
|
8
|
+
* - quiet — small actions (Undo, Clear picks, Show all). A tint pill.
|
|
9
|
+
*
|
|
10
|
+
* Two sizes: lg (52) for the page's main action, md (44) everywhere else.
|
|
11
|
+
* Chips, tabs and filters (`optionLook`) and icon-only buttons (`hoverTint`)
|
|
12
|
+
* share the same hover / press / disabled states.
|
|
13
|
+
*/
|
|
14
|
+
export declare const BUTTON_UI: {
|
|
15
|
+
readonly radius: 12;
|
|
16
|
+
readonly height: {
|
|
17
|
+
readonly md: 44;
|
|
18
|
+
readonly lg: 52;
|
|
19
|
+
};
|
|
20
|
+
readonly padX: {
|
|
21
|
+
readonly md: 14;
|
|
22
|
+
readonly lg: 18;
|
|
23
|
+
};
|
|
24
|
+
readonly fontSize: {
|
|
25
|
+
readonly md: 14;
|
|
26
|
+
readonly lg: 16;
|
|
27
|
+
};
|
|
28
|
+
readonly weight: 800;
|
|
29
|
+
readonly gap: 8;
|
|
30
|
+
/** Every button sinks a touch when pressed. */
|
|
31
|
+
readonly pressScale: 0.98;
|
|
32
|
+
readonly disabledOpacity: 0.5;
|
|
33
|
+
readonly ms: 150;
|
|
34
|
+
};
|
|
35
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'quiet';
|
|
36
|
+
export type ButtonSize = 'md' | 'lg';
|
|
37
|
+
export interface PressState {
|
|
38
|
+
hovered?: boolean;
|
|
39
|
+
pressed?: boolean;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface ButtonLook {
|
|
43
|
+
background: string;
|
|
44
|
+
color: string;
|
|
45
|
+
borderColor: string;
|
|
46
|
+
borderWidth: number;
|
|
47
|
+
opacity: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The one hover rule for every unfilled control: it previews the colour it acts
|
|
51
|
+
* in — the ring turns that colour over a faint tint (a little more on press).
|
|
52
|
+
* Chips and icon buttons preview the primary, an unchosen Yes / No its own green / red.
|
|
53
|
+
*/
|
|
54
|
+
export declare function previewTint(color: string, { hovered, pressed, disabled }?: PressState): {
|
|
55
|
+
borderColor: string;
|
|
56
|
+
background: string;
|
|
57
|
+
} | null;
|
|
58
|
+
/** `previewTint` in the theme primary, background only. */
|
|
59
|
+
export declare function hoverTint(theme: BladeTheme, state?: PressState): string | undefined;
|
|
60
|
+
export declare function buttonLook(theme: BladeTheme, variant: ButtonVariant, state?: PressState): ButtonLook;
|
|
61
|
+
/** Chips, tabs, filters and options: teal with light text when chosen; a hairline card that tints on hover when not. */
|
|
62
|
+
export declare function optionLook(theme: BladeTheme, selected: boolean, state?: PressState): ButtonLook;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Game, TopPayoutsResponse } from './types';
|
|
2
|
+
import { SafetyNetTicket } from './safety-net';
|
|
3
|
+
/** Short discovery copy describes the mechanic, never substitutes for the rules. */
|
|
4
|
+
export declare function callGameSummary(game: Game): string;
|
|
5
|
+
export declare function callDefaultCount(game: Game, counts: number[]): number;
|
|
6
|
+
export interface CallPayoutRow {
|
|
7
|
+
label: string;
|
|
8
|
+
amount: number;
|
|
9
|
+
added?: number;
|
|
10
|
+
correct?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface CallPayoutView {
|
|
13
|
+
heading: string;
|
|
14
|
+
note: string;
|
|
15
|
+
rows: CallPayoutRow[];
|
|
16
|
+
/** A short line beside the heading, e.g. "Includes your $20 stake". */
|
|
17
|
+
aside?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A ticket's outcomes, best first: "All 8 right", "7 right, 1 miss", "2 or more
|
|
21
|
+
* misses". No miss cover reads "All 8 right", "1 or more misses".
|
|
22
|
+
*/
|
|
23
|
+
export declare function callMissRows(legs: number, misses: number, collect: (wrong: number) => number): CallPayoutRow[];
|
|
24
|
+
/** `modeLabel` is kept for callers; the cover is already chosen above the table. */
|
|
25
|
+
export declare function callSafetyPayouts(ticket: SafetyNetTicket, _modeLabel?: string): CallPayoutView;
|
|
26
|
+
/** Outcome tables use the same pricing functions as setup and confirmation. */
|
|
27
|
+
export declare function callOutcomePayouts(game: Game, count: number, stake: number, expectedCorrect?: number): CallPayoutView | null;
|
|
28
|
+
export declare function callLegPayouts(game: Game, stake: number, payouts?: TopPayoutsResponse): CallPayoutView | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BladeTheme } from './themes';
|
|
3
|
+
/**
|
|
4
|
+
* Marks its children as sitting on one of our own painted surfaces — a card,
|
|
5
|
+
* sheet, modal or a self-painted root like Dense — rather than the host page.
|
|
6
|
+
*/
|
|
7
|
+
export declare function OnSurface({ children }: {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}): import('react').FunctionComponentElement<import('react').ProviderProps<boolean>>;
|
|
10
|
+
/**
|
|
11
|
+
* The theme for page-level content (titles, labels, tabs, quiet buttons):
|
|
12
|
+
* `canvasTheme` on the host page, the theme itself inside an `OnSurface`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function usePageTheme<T extends BladeTheme | undefined>(theme: T): T;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BladeApiClient } from './api-client';
|
|
2
|
+
import { Game, Proposition } from './types';
|
|
3
|
+
/** Cross Game SGM's risk modes. Explicit opt-in only: 'off' and unknown modes keep the ordinary flow. */
|
|
4
|
+
export declare const hasSgmRiskMode: (game?: Game | null) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Only `any` prices through the Correlation Engine. A `limited` / `limited_2p` card holds one line, one total and one
|
|
7
|
+
* player per match, classes that move independently, so it pays off the count table like an ordinary game and
|
|
8
|
+
* `selectionCapsApply` holds it to that shape.
|
|
9
|
+
*/
|
|
10
|
+
export declare const usesCorrelationPricing: (game?: Game | null) => boolean;
|
|
11
|
+
export interface CorrelationQuote {
|
|
12
|
+
resultant_price: number;
|
|
13
|
+
equivalent_flips: number;
|
|
14
|
+
within: boolean;
|
|
15
|
+
verdict: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CorrelationSuggestions {
|
|
18
|
+
choices: {
|
|
19
|
+
id: number;
|
|
20
|
+
answers: Partial<Record<'yes' | 'no', CorrelationQuote>>;
|
|
21
|
+
}[];
|
|
22
|
+
card: CorrelationQuote | null;
|
|
23
|
+
can_submit: boolean;
|
|
24
|
+
target_count: number;
|
|
25
|
+
target_price: number;
|
|
26
|
+
target_price_range?: [number, number];
|
|
27
|
+
partial: boolean;
|
|
28
|
+
supported_counts?: number[];
|
|
29
|
+
propositions?: Proposition[];
|
|
30
|
+
}
|
|
31
|
+
export interface CorrelationRequest {
|
|
32
|
+
selections: Record<number, 'yes' | 'no'>;
|
|
33
|
+
candidate_ids: number[];
|
|
34
|
+
target_count: number;
|
|
35
|
+
rule_id?: number;
|
|
36
|
+
stake: number;
|
|
37
|
+
event_id?: string;
|
|
38
|
+
}
|
|
39
|
+
/** Port of the correlation branch's debounced, request-stamped provider hook. */
|
|
40
|
+
export declare function useCorrelationSteering(client: BladeApiClient | null, gameId: number | null, request: CorrelationRequest): {
|
|
41
|
+
data: CorrelationSuggestions | null;
|
|
42
|
+
displayPropositions: Proposition[] | null;
|
|
43
|
+
loading: boolean;
|
|
44
|
+
error: string | null;
|
|
45
|
+
answers: Map<number, Partial<Record<"yes" | "no", CorrelationQuote>>>;
|
|
46
|
+
retry: () => void;
|
|
47
|
+
};
|
|
48
|
+
export type CorrelationNotice = 'recalculating' | 'stuck' | null;
|
|
49
|
+
export declare function correlationNotice(correlation: Pick<ReturnType<typeof useCorrelationSteering>, 'loading' | 'data'>, answeredCount: number): CorrelationNotice;
|
|
50
|
+
export declare const CORRELATION_NOTICE_TEXT: {
|
|
51
|
+
readonly recalculating: "Recalculating your multi…";
|
|
52
|
+
readonly stuck: "Nothing left can finish this multi. Remove a pick to keep going.";
|
|
53
|
+
};
|
|
54
|
+
export declare function useDelayedFlag(on: boolean, delayMs: number): boolean;
|
|
55
|
+
/** Developer diagnostics use the correlation quote, never the payout multiplier. */
|
|
56
|
+
export declare function correlationDebugText(correlation: Pick<ReturnType<typeof useCorrelationSteering>, 'loading' | 'error' | 'data'>, targetCount: number): string;
|
|
@@ -1,25 +1,3 @@
|
|
|
1
1
|
import { Proposition } from './types';
|
|
2
|
-
/** Date-window chips shown above the proposition list. */
|
|
3
|
-
export type DateWindowId = 'today' | 'weekend' | 'next7';
|
|
4
|
-
export interface DateWindowOption {
|
|
5
|
-
id: DateWindowId;
|
|
6
|
-
label: string;
|
|
7
|
-
}
|
|
8
2
|
/** A proposition's commence time as a Date, or null when absent/invalid. */
|
|
9
3
|
export declare function propositionDate(p: Pick<Proposition, 'commence_time'>): Date | null;
|
|
10
|
-
/** Whether a commence time falls inside a window relative to `now`. */
|
|
11
|
-
export declare function matchesDateWindow(commenceTime: string | null | undefined, id: DateWindowId, now: Date): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Which date-window chips are worth showing for a set of propositions.
|
|
14
|
-
*
|
|
15
|
-
* A window only appears when it *partitions* the set — at least one prop falls
|
|
16
|
-
* inside it and at least one outside — so a filter that would match everything
|
|
17
|
-
* (a game the operator already caps to, say, this week) or nothing (no games
|
|
18
|
-
* today) is hidden rather than shown as a no-op.
|
|
19
|
-
*/
|
|
20
|
-
export declare function availableDateWindows(propositions: ReadonlyArray<Pick<Proposition, 'commence_time'>>, now: Date): DateWindowOption[];
|
|
21
|
-
/**
|
|
22
|
-
* Filter propositions to a window. `null` returns them unchanged; undated
|
|
23
|
-
* propositions are dropped whenever a window is active.
|
|
24
|
-
*/
|
|
25
|
-
export declare function filterByDateWindow<T extends Pick<Proposition, 'commence_time'>>(propositions: readonly T[], id: DateWindowId | null, now: Date): T[];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Game, TopPayoutsResponse } from './types';
|
|
3
|
+
import { BladeTheme } from './themes';
|
|
4
|
+
import { CallPayoutView } from './call-presentation';
|
|
5
|
+
export interface CallGameCatalogueProps {
|
|
6
|
+
games: Game[];
|
|
7
|
+
selectedGame: Game | null;
|
|
8
|
+
theme: BladeTheme;
|
|
9
|
+
onPlay: (game: Game, count: number) => void;
|
|
10
|
+
maxPayouts?: Record<number, TopPayoutsResponse>;
|
|
11
|
+
quickPickLoading?: boolean;
|
|
12
|
+
tierFilter?: React.ReactNode;
|
|
13
|
+
showTier?: boolean;
|
|
14
|
+
showCategory?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface CallTicketBuilderProps {
|
|
17
|
+
/** Replace the title row when a host page supplies its own heading. */
|
|
18
|
+
header?: React.ReactNode;
|
|
19
|
+
game: Game;
|
|
20
|
+
theme: BladeTheme;
|
|
21
|
+
legs: number;
|
|
22
|
+
legOptions: number[];
|
|
23
|
+
onLegs: (n: number) => void;
|
|
24
|
+
stake: number;
|
|
25
|
+
onStake: (n: number) => void;
|
|
26
|
+
stakes?: number[];
|
|
27
|
+
minStake?: number;
|
|
28
|
+
maxStake?: number | null;
|
|
29
|
+
modes?: {
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
detail: string;
|
|
33
|
+
}[];
|
|
34
|
+
modeId?: string;
|
|
35
|
+
onMode?: (id: string) => void;
|
|
36
|
+
expectedCorrect?: number;
|
|
37
|
+
ruleId?: number | null;
|
|
38
|
+
view: CallPayoutView;
|
|
39
|
+
valid?: boolean;
|
|
40
|
+
onPick: () => void;
|
|
41
|
+
onQuickPick: () => void;
|
|
42
|
+
onBack?: () => void;
|
|
43
|
+
}
|
|
44
|
+
export interface DenseTicketActionsProps {
|
|
45
|
+
count: number;
|
|
46
|
+
target: number;
|
|
47
|
+
minimum: number;
|
|
48
|
+
disabled: boolean;
|
|
49
|
+
label: string;
|
|
50
|
+
view: CallPayoutView | null;
|
|
51
|
+
payoutText: string;
|
|
52
|
+
onNext: () => void;
|
|
53
|
+
hideButtons?: boolean;
|
|
54
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Game, GameEntry, Proposition } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Game Shelf's placed + entries screens: what an entry pays and how it is
|
|
4
|
+
* going, read only off the existing pricing and rules. Web and native share it.
|
|
5
|
+
*/
|
|
6
|
+
export interface PayingOutcome {
|
|
7
|
+
correct: number;
|
|
8
|
+
amount: number;
|
|
9
|
+
}
|
|
10
|
+
export type PipState = 'right' | 'miss' | 'open';
|
|
11
|
+
export interface EntryLeg {
|
|
12
|
+
answer?: 'yes' | 'no';
|
|
13
|
+
prop?: Proposition;
|
|
14
|
+
}
|
|
15
|
+
/** Paying outcomes, best first: the ticket outcome table, else the API's win tiers. */
|
|
16
|
+
export declare function payingOutcomes(game: Game | null | undefined, legs: number, stake: number, expectedCorrect?: number | null, winningCounts?: number[] | null, payouts?: Record<number, number> | null): PayingOutcome[];
|
|
17
|
+
/** "Extra Shot" — the Safety Net cover a ticket bought, read off its expected-correct count. */
|
|
18
|
+
export declare function safetyModeLabel(game: Game | null | undefined, legs: number, expectedCorrect?: number | null): string | null;
|
|
19
|
+
/** The earliest unsettled leg still to start. */
|
|
20
|
+
export declare function nextResultAt(props: (Proposition | undefined)[], now?: number): Date | null;
|
|
21
|
+
/** Stake / pays card on the placed screen. */
|
|
22
|
+
export declare function placedEntrySummary(game: Game | null | undefined, props: Proposition[], stake: number, expectedCorrect: number | null | undefined, winningCounts: number[] | null | undefined, payouts: Record<number, number> | null | undefined, now?: number): {
|
|
23
|
+
payLabel: string;
|
|
24
|
+
pays: number;
|
|
25
|
+
note: string;
|
|
26
|
+
};
|
|
27
|
+
/** One row of the entries list. `settledLabel` is the existing Won / Paid / Lost status. */
|
|
28
|
+
export declare function shelfEntrySummary(entry: GameEntry, game: Game | undefined, legs: EntryLeg[], settledLabel: string | null, now?: number): {
|
|
29
|
+
detail: string;
|
|
30
|
+
pips: PipState[];
|
|
31
|
+
pay: {
|
|
32
|
+
label: string;
|
|
33
|
+
amount: number;
|
|
34
|
+
struck: boolean;
|
|
35
|
+
} | null;
|
|
36
|
+
status: string;
|
|
37
|
+
dead: boolean;
|
|
38
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Game } from './types';
|
|
2
|
+
export type GameSuiteCategory = 'racing' | 'prediction' | 'fantasy';
|
|
3
|
+
/** A category product built on an existing rule: a name, copy and cover for a game BLADE serves. */
|
|
4
|
+
export interface CategoryGamePreset {
|
|
5
|
+
id: string;
|
|
6
|
+
category: GameSuiteCategory;
|
|
7
|
+
name: string;
|
|
8
|
+
rule: 'game_set' | 'safety_net' | 'ladder' | 'mirror' | 'pick_your_dividend';
|
|
9
|
+
counts: readonly number[];
|
|
10
|
+
tag: string;
|
|
11
|
+
description: string;
|
|
12
|
+
aliases: readonly string[];
|
|
13
|
+
tier: number;
|
|
14
|
+
color: string;
|
|
15
|
+
allowedMarkets: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Artwork a game library brings with it. Components includes basic-game artwork; the
|
|
19
|
+
* provider merges every pack in `gameLibrary` for IconSvg and the shelf.
|
|
20
|
+
*/
|
|
21
|
+
export interface GameArtwork {
|
|
22
|
+
/** SVG markup by icon id (see resolveGameIconId). */
|
|
23
|
+
icons: Readonly<Record<string, string>>;
|
|
24
|
+
/** Category covers and guide branding supplied by the library. */
|
|
25
|
+
categoryCovers?: Readonly<Record<string, string>>;
|
|
26
|
+
/** One SVG mark per category (currentColor + icon accent), drawn on the Shelf category banners' drawn covers. */
|
|
27
|
+
categoryIcons?: Readonly<Record<string, string>>;
|
|
28
|
+
guideLogo?: string;
|
|
29
|
+
catalogueImages?: Readonly<Record<string, string>>;
|
|
30
|
+
/** Shelf cover data URLs by icon id. */
|
|
31
|
+
covers: Readonly<Record<string, string>>;
|
|
32
|
+
/** Category presets that re-dress rule games as racing, prediction or fantasy products. */
|
|
33
|
+
presets: readonly CategoryGamePreset[];
|
|
34
|
+
/** Shelf cover data URLs by preset id. */
|
|
35
|
+
presetCovers: Readonly<Record<string, string>>;
|
|
36
|
+
/** Curated Showcase tiles for the API's games. Without one the Showcase draws a plain tile per game. */
|
|
37
|
+
catalogue?: ShowcaseCatalogue;
|
|
38
|
+
}
|
|
39
|
+
export type ShowcaseCategory = 'sports' | 'racing' | 'prediction' | 'fantasy';
|
|
40
|
+
export interface ShowcaseCard {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
tier: string;
|
|
44
|
+
/** False dims the tile: a curated game the API is not offering right now. */
|
|
45
|
+
live: boolean;
|
|
46
|
+
tag: string;
|
|
47
|
+
description: string;
|
|
48
|
+
icon: string;
|
|
49
|
+
features: {
|
|
50
|
+
title: string;
|
|
51
|
+
text: string;
|
|
52
|
+
}[];
|
|
53
|
+
game?: Game;
|
|
54
|
+
}
|
|
55
|
+
/** `restricted` drops curated tiles that none of `games` match. */
|
|
56
|
+
export type ShowcaseCatalogue = (category: ShowcaseCategory, games: Game[], restricted?: boolean) => ShowcaseCard[];
|
|
57
|
+
export declare const BASE_GAME_ARTWORK: GameArtwork;
|
|
58
|
+
/** The base artwork plus the given packs, later packs winning. */
|
|
59
|
+
export declare function mergeGameArtwork(...packs: readonly (Partial<GameArtwork> | undefined)[]): GameArtwork;
|
|
60
|
+
export declare const GameArtworkContext: import('react').Context<GameArtwork>;
|
|
61
|
+
export declare function useGameArtwork(): GameArtwork;
|
|
62
|
+
/** Category and rule must match: a name alone must never change a game's meaning. */
|
|
63
|
+
export declare function findCategoryGamePreset(game: Game, presets: readonly CategoryGamePreset[]): CategoryGamePreset | undefined;
|
|
@@ -38,7 +38,40 @@ export interface ConfirmBoostCopy {
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function getConfirmBoostCopy(game: Game | null | undefined): ConfirmBoostCopy;
|
|
40
40
|
export declare function describeWinCondition(rule: GamePermittedRule | null | undefined, winningCounts: number[] | null | undefined, totalPicks: number, payouts?: Record<number, number> | null): string | null;
|
|
41
|
+
export interface WinConditionPrizeRow {
|
|
42
|
+
count: number;
|
|
43
|
+
label: string;
|
|
44
|
+
prize: number;
|
|
45
|
+
}
|
|
46
|
+
export declare function winConditionPrizeRows(winningCounts: number[] | null | undefined, totalPicks: number, payouts: Record<number, number> | null | undefined): WinConditionPrizeRow[];
|
|
47
|
+
export declare function lockedLegCount(game: Game | null | undefined, selectedCount: number | null | undefined): number | null;
|
|
48
|
+
export declare function isLegsLockedGame(game: Game | null | undefined): boolean;
|
|
49
|
+
export declare function canQuickPickResize(game: Game | null | undefined): boolean;
|
|
50
|
+
export declare function quickPickSizes(game: Game | null | undefined, rule: GamePermittedRule | null | undefined, available: number): number[];
|
|
51
|
+
export type QuickPickControl = {
|
|
52
|
+
kind: 'menu';
|
|
53
|
+
counts: number[];
|
|
54
|
+
hint: string;
|
|
55
|
+
fillLabel?: string;
|
|
56
|
+
randomise?: {
|
|
57
|
+
label: string;
|
|
58
|
+
count: number;
|
|
59
|
+
};
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'button';
|
|
62
|
+
mode: 'fill' | 'replace';
|
|
63
|
+
hint: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* What QuickPick offers. Several sizes: a menu of every size (picking one fills or trims the
|
|
67
|
+
* card to it) plus Randomise all once something is picked. One size: fill straight away on an empty card, randomise a
|
|
68
|
+
* full one, and ask "Fill the other N" or "Randomise all N" when it's part done.
|
|
69
|
+
*/
|
|
70
|
+
export declare function quickPickControl(sizes: readonly number[], answered: number, total: number, current: number): QuickPickControl;
|
|
41
71
|
export declare function isStakeLockedGame(game: Game | null | undefined): boolean;
|
|
42
72
|
/** Why the stake is fixed, shown beside the locked figure. */
|
|
43
73
|
export declare function stakeLockedNote(game: Game | null | undefined): string;
|
|
44
|
-
export declare function quotedPayoutAtCount(game: Game | null | undefined, count: number, stake: number
|
|
74
|
+
export declare function quotedPayoutAtCount(game: Game | null | undefined, count: number, stake: number, opts?: {
|
|
75
|
+
expectedCorrect?: number;
|
|
76
|
+
}): number;
|
|
77
|
+
export declare function roundQuotedPayout(amount: number, game?: Game | null): number;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Game } from './types';
|
|
2
|
-
|
|
2
|
+
/** Icon ids the base can derive from a game. Artwork for optional games ships with @simple-parlay/games. */
|
|
3
|
+
export type GameIconId = 'perfect_pick' | 'first_past_the_post' | 'head_to_head' | 'total_points' | 'quickpick' | 'safety_net' | 'ladder' | 'game_set' | 'pick_your_dividend' | 'mirror' | 'mirror_double' | 'mirror_triple' | 'same_game_multi' | 'six_again' | 'unknown';
|
|
3
4
|
export declare const GAME_ICON_SCHEME = "game-icon:";
|
|
4
|
-
|
|
5
|
+
/** Bundled base-game icons; optional game icons arrive with the game library (see GameArtwork). */
|
|
6
|
+
export declare const GAME_ICON_SVG: Readonly<Record<string, string>>;
|
|
5
7
|
/** Resolve a bundled icon id for a game; unknown games use the question-mark fallback. */
|
|
6
8
|
export declare function resolveGameIconId(game: Pick<Game, 'game_name' | 'quick_pick_only' | 'rule'>): GameIconId;
|
|
9
|
+
export declare const CATEGORY_ICON_PREFIX: RegExp;
|
|
7
10
|
/** Stable URL token consumed by IconSvg (never fetched over the network). */
|
|
8
|
-
export declare function resolveGameIconUrl(game: Pick<Game, 'game_name' | 'quick_pick_only' | 'rule'>): string;
|
|
11
|
+
export declare function resolveGameIconUrl(game: Pick<Game, 'game_name' | 'game_name_template' | 'quick_pick_only' | 'rule' | 'category'>): string;
|
|
9
12
|
export declare function isGameIconUrl(iconUrl: string): boolean;
|
|
10
|
-
|
|
13
|
+
/** Markup for a local icon token, from the given icon set (the base icons by default); unknown ids use the fallback. */
|
|
14
|
+
export declare function resolveGameIconMarkup(iconUrl: string, icons?: Readonly<Record<string, string | undefined>>): string | null;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { CallTicketBuilderProps } from './dense-ui';
|
|
3
|
+
import { Game } from './types';
|
|
4
|
+
import { YesNoLabels } from './utils';
|
|
5
|
+
import { GameArtwork } from './game-artwork';
|
|
6
|
+
import { GameFlow } from './game-flow';
|
|
7
|
+
/** Where the host's setup frame sends the player; passed through from the host's setup route. */
|
|
8
|
+
export interface GameSetupNav {
|
|
9
|
+
onPickYourOwn?: () => void;
|
|
10
|
+
onQuickPick?: () => void;
|
|
11
|
+
onBack?: () => void;
|
|
12
|
+
hideTitle?: boolean;
|
|
13
|
+
backLabel?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export type GameSetupTicket = Omit<CallTicketBuilderProps, 'header' | 'game' | 'theme' | 'valid' | 'onPick' | 'onQuickPick' | 'onBack'>;
|
|
17
|
+
export interface GameSetupFrameProps extends GameSetupNav {
|
|
18
|
+
title?: string | null;
|
|
19
|
+
gameName?: string;
|
|
20
|
+
eyebrow?: string | null;
|
|
21
|
+
subtitle?: string | null;
|
|
22
|
+
tagline?: string | null;
|
|
23
|
+
hero?: ReactNode;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
pick?: () => void;
|
|
26
|
+
quickPick?: () => void;
|
|
27
|
+
/** @default 'Pick my own' */
|
|
28
|
+
pickLabel?: string;
|
|
29
|
+
pickDetail?: string[];
|
|
30
|
+
quickDetail?: string[];
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
ticket?: GameSetupTicket;
|
|
33
|
+
}
|
|
34
|
+
export interface GameSetupProps<Entry> extends GameSetupNav {
|
|
35
|
+
entry: Entry;
|
|
36
|
+
yesNoLabels: YesNoLabels;
|
|
37
|
+
/** The host's setup frame. A game renders its content inside it. */
|
|
38
|
+
Frame?: ComponentType<GameSetupFrameProps>;
|
|
39
|
+
}
|
|
40
|
+
/** An implementation for API game records, not a replacement for API data. */
|
|
41
|
+
export interface GameDefinition<Entry> {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
/** The API games this entry plays. An entry without `matches` plays nothing and only carries artwork. */
|
|
44
|
+
readonly matches?: (game: Game) => boolean;
|
|
45
|
+
readonly flow?: GameFlow;
|
|
46
|
+
/** Opt in to supplying the setup screen for a built-in game, such as Perfect Pick. */
|
|
47
|
+
readonly overrideBase?: boolean;
|
|
48
|
+
readonly Setup?: ComponentType<GameSetupProps<Entry>>;
|
|
49
|
+
/** Icons, shelf covers and category presets for the games this entry brings; the provider merges every pack. */
|
|
50
|
+
readonly artwork?: Partial<GameArtwork>;
|
|
51
|
+
}
|
|
52
|
+
export type GameLibrary<Entry> = readonly GameDefinition<Entry>[];
|
|
53
|
+
export declare const EMPTY_GAME_LIBRARY: readonly never[];
|
|
54
|
+
export declare const BASE_GAME_IDS: readonly ["perfect-pick", "h2h", "total-points", "quick-pick"];
|
|
55
|
+
export declare function getBaseGameId(game: Game): typeof BASE_GAME_IDS[number] | undefined;
|
|
56
|
+
export declare function findLibraryGame<Entry>(game: Game | null | undefined, library: GameLibrary<Entry>): GameDefinition<Entry> | undefined;
|
|
57
|
+
export declare function supportsGame<Entry>(game: Game, library: GameLibrary<Entry>): boolean;
|
|
58
|
+
export declare function resolveGameFlow<Entry>(game: Game | null | undefined, library: GameLibrary<Entry>): GameFlow;
|
|
@@ -39,7 +39,6 @@ export interface GameSetBetConfig {
|
|
|
39
39
|
}
|
|
40
40
|
/** Whether a game is a Game Set Bet (routes to the one-screen ticket builder). */
|
|
41
41
|
export declare function isGameSetBetGame(game: Game | null | undefined): boolean;
|
|
42
|
-
/** Price a ticket: total return incl. stake, exact to the cent — never rounded. */
|
|
43
42
|
export declare function gameSetPrize(stake: number, legs: number, opts?: {
|
|
44
43
|
operatorMargin?: number;
|
|
45
44
|
perLegProbability?: number;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { CategoryGamePreset, GameArtwork } from './game-artwork';
|
|
2
|
+
import { BladeTheme } from './themes';
|
|
3
|
+
import { Game, TopPayoutsResponse } from './types';
|
|
4
|
+
import { DrawnCover } from './shelf-covers';
|
|
5
|
+
import { GameTierId } from './game-tiers';
|
|
6
|
+
export { playbookTier as shelfTier, playbookHook as shelfHook, playbookMechanic as shelfMechanic } from './playbook';
|
|
7
|
+
/** What a game pays: "$2,230 for 8 right" (Mirror: "right or wrong"). Null without payout data, never $0. */
|
|
8
|
+
export declare function shelfPayoutLine(game: Game, payouts?: TopPayoutsResponse): string | null;
|
|
9
|
+
/** Illustrated games lead each shelf; the rest follow in API order. */
|
|
10
|
+
export declare const FEATURED: string[];
|
|
11
|
+
export declare const COVER_COLORS: Record<string, string>;
|
|
12
|
+
/** Cover colour for games without artwork: the tier reads at a glance. */
|
|
13
|
+
export declare const TIER_COLORS: Record<GameTierId, string>;
|
|
14
|
+
/** One shelf per tier that has a game, illustrated covers first. */
|
|
15
|
+
export declare function shelfTiers(games: readonly Game[]): {
|
|
16
|
+
id: GameTierId;
|
|
17
|
+
label: string;
|
|
18
|
+
games: Game[];
|
|
19
|
+
}[];
|
|
20
|
+
export declare function previewCopy(game: Game, presets?: readonly CategoryGamePreset[]): {
|
|
21
|
+
title: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
/** Shared by web and native: layout and brand styling stay independent. */
|
|
25
|
+
export declare function resolveShelfSkin(theme: BladeTheme): {
|
|
26
|
+
coverColors: {
|
|
27
|
+
[x: string]: string;
|
|
28
|
+
};
|
|
29
|
+
tierColors: Record<string, string>;
|
|
30
|
+
categoryColors: Record<string, string>;
|
|
31
|
+
canvas: string;
|
|
32
|
+
onCanvas: string;
|
|
33
|
+
surface: string;
|
|
34
|
+
text: string;
|
|
35
|
+
muted: string;
|
|
36
|
+
accent: string;
|
|
37
|
+
button: string;
|
|
38
|
+
buttonText: string;
|
|
39
|
+
coverText: string;
|
|
40
|
+
artwork?: Record<string, string | null>;
|
|
41
|
+
coverStyle?: "art" | "brand" | "mark" | "stacked" | "tile";
|
|
42
|
+
heroArtwork?: Record<string, string | null>;
|
|
43
|
+
categoryArtwork?: Record<string, string | null>;
|
|
44
|
+
};
|
|
45
|
+
/** Game Shelf's category banner: shared by the page and its loading skeleton on both platforms. */
|
|
46
|
+
export declare const SHELF_CATEGORY_BANNER: {
|
|
47
|
+
readonly height: 116;
|
|
48
|
+
readonly art: 150;
|
|
49
|
+
readonly radius: 16;
|
|
50
|
+
readonly pad: 16;
|
|
51
|
+
readonly gap: 12;
|
|
52
|
+
readonly minWidth: 300;
|
|
53
|
+
readonly mark: 92;
|
|
54
|
+
readonly markRight: 16;
|
|
55
|
+
};
|
|
56
|
+
/** Specific suite overrides precede generic rule artwork overrides. */
|
|
57
|
+
export declare function resolveShelfArtwork(game: Game, theme: BladeTheme, artwork?: GameArtwork): string | null | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* One Shelf cover: its ground and name ink, and either its illustration or its drawn art (`theme.shelf.coverStyle`).
|
|
60
|
+
* In `art` mode a game without an illustration is drawn in `brand`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resolveShelfCover(game: Game, theme: BladeTheme, artwork?: GameArtwork): {
|
|
63
|
+
ground: string;
|
|
64
|
+
ink: string;
|
|
65
|
+
art?: string;
|
|
66
|
+
drawn?: DrawnCover;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* One category banner's ground, name ink and picture, or its mark (from the game library's `categoryIcons`) drawn like
|
|
70
|
+
* the game covers: in `brand` on the stacked tiles on stone, in `mark` / `stacked` / `tile` on a colour ground. A
|
|
71
|
+
* picture set to null in `art` mode stays hidden; without a mark a drawn banner is its ground and name.
|
|
72
|
+
*/
|
|
73
|
+
export declare function resolveShelfCategoryArt(category: string, theme: BladeTheme, artwork?: Pick<GameArtwork, 'categoryCovers' | 'categoryIcons'>): {
|
|
74
|
+
ground?: string;
|
|
75
|
+
ink: string;
|
|
76
|
+
art?: string | null;
|
|
77
|
+
drawn?: DrawnCover;
|
|
78
|
+
};
|
|
79
|
+
export declare function shelfGameName(game: Game, presets?: readonly CategoryGamePreset[]): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Optional game-discovery layouts, independent of the overall UI theme. Only `shelf` has a React Native twin; the others are web layouts. */
|
|
2
|
+
export type GameVariant = 'cards' | 'split' | 'compare' | 'shelf' | 'showcase';
|
|
3
|
+
export declare const GAME_VARIANTS: readonly GameVariant[];
|
|
4
|
+
export declare const GAME_VARIANT_LABELS: Record<GameVariant, string>;
|
|
5
|
+
export declare function parseGameVariant(value: unknown): GameVariant | undefined;
|