@simple-parlay/components 1.30.6-pre.8 → 2.0.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.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +653 -485
- package/dist/react/components/CallPayoutTable.d.ts +7 -1
- package/dist/react/components/CorrelationPropPlaceholder.d.ts +6 -1
- package/dist/react/components/DenseUi.d.ts +1 -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 +4 -2
- package/dist/react/components/GameSelector.d.ts +1 -27
- package/dist/react/components/GameSetupPage.d.ts +5 -1
- package/dist/react/components/GameShelfCatalogue.d.ts +1 -7
- package/dist/react/components/GameShowcaseCatalogue.d.ts +11 -0
- package/dist/react/components/GameSkeletons.d.ts +24 -0
- package/dist/react/components/HowToPlayButton.d.ts +2 -1
- 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 +3 -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 +37 -4
- package/dist/react/components/PropositionFilters.d.ts +0 -1
- package/dist/react/components/PropositionParts.d.ts +38 -0
- package/dist/react/components/QuickPickButton.d.ts +27 -1
- package/dist/react/components/QuickPickMenu.d.ts +19 -1
- package/dist/react/components/SelectionsPage.d.ts +8 -4
- package/dist/react/components/ShelfKit.d.ts +43 -0
- package/dist/react/components/SportRail.d.ts +1 -1
- package/dist/react/components/SportSelector.d.ts +1 -36
- package/dist/react/components/SuccessPage.d.ts +7 -3
- 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 +57 -12
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.ts +15 -13
- package/dist/react/index.mjs +653 -485
- package/dist/react/utils/dom.d.ts +7 -0
- package/dist/react/utils/themes.d.ts +1 -1
- package/dist/react-native/components/CallGameCatalogue.d.ts +1 -0
- package/dist/react-native/components/CallPayoutTable.d.ts +7 -1
- package/dist/react-native/components/CallTicketBuilder.d.ts +2 -0
- package/dist/react-native/components/DenseUi.d.ts +4 -10
- 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 +3 -1
- package/dist/react-native/components/GameSelector.d.ts +1 -28
- package/dist/react-native/components/GameSetupPage.d.ts +4 -13
- package/dist/react-native/components/GameShelfCatalogue.d.ts +1 -6
- package/dist/react-native/components/GameSkeletons.d.ts +23 -0
- package/dist/react-native/components/HowToPlayButton.d.ts +2 -1
- package/dist/react-native/components/LoadingIndicators.d.ts +22 -10
- 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 +3 -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 +37 -4
- package/dist/react-native/components/PropositionFilters.d.ts +0 -1
- package/dist/react-native/components/PropositionParts.d.ts +35 -0
- package/dist/react-native/components/QuickPickButton.d.ts +27 -1
- package/dist/react-native/components/QuickPickMenu.d.ts +20 -1
- package/dist/react-native/components/SelectionsPage.d.ts +7 -4
- package/dist/react-native/components/ShelfKit.d.ts +62 -0
- package/dist/react-native/components/SportRail.d.ts +1 -1
- package/dist/react-native/components/SportSelector.d.ts +1 -33
- package/dist/react-native/components/SuccessPage.d.ts +7 -3
- package/dist/react-native/components/SwipeDeck.d.ts +43 -3
- package/dist/react-native/components/YesNoMultiLogo.d.ts +12 -0
- package/dist/react-native/components/_primitives/index.d.ts +92 -10
- package/dist/react-native/index.cjs +1 -1
- package/dist/react-native/index.d.ts +14 -12
- package/dist/react-native/index.mjs +559 -474
- package/dist/react-native/utils/themes.d.ts +1 -1
- package/dist/shared/button-ui.d.ts +65 -0
- package/dist/shared/call-presentation.d.ts +9 -1
- package/dist/shared/canvas.d.ts +14 -0
- package/dist/shared/correlation-steering.d.ts +14 -1
- package/dist/shared/date-filters.d.ts +0 -23
- package/dist/shared/dense-ui.d.ts +0 -1
- package/dist/shared/entry-progress.d.ts +38 -0
- package/dist/shared/game-artwork.d.ts +22 -0
- package/dist/shared/game-flow.d.ts +22 -0
- package/dist/shared/game-icons.d.ts +2 -1
- package/dist/shared/game-library.d.ts +30 -6
- package/dist/shared/game-shelf-presentation.d.ts +36 -1
- package/dist/shared/game-variants.d.ts +1 -1
- package/dist/shared/hooks.d.ts +1 -1
- package/dist/shared/selection-actions.d.ts +70 -4
- package/dist/shared/selection-caps.d.ts +67 -10
- package/dist/shared/selection-variants.d.ts +7 -0
- 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 +10 -0
- package/dist/shared/themes.d.ts +53 -10
- package/dist/shared/tokens.d.ts +7 -0
- package/dist/shared/types.d.ts +21 -4
- package/dist/shared/ui-system.d.ts +71 -0
- package/dist/shared/ui-variant.d.ts +5 -3
- package/dist/shared/utils.d.ts +4 -1
- package/package.json +1 -1
- package/dist/react/components/PerfectPickPage.d.ts +0 -22
- package/dist/react/components/RuleSetupPage.d.ts +0 -27
- package/dist/react-native/components/PerfectPickPage.d.ts +0 -20
- package/dist/react-native/components/RuleSetupPage.d.ts +0 -23
|
@@ -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;
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
* - confirm — the armed second press of a two-stage action (Place → Confirm). Filled in the brand accent
|
|
9
|
+
* (YESNO citron) — never the primary, which in YESNO is the same teal as the heading ink — and
|
|
10
|
+
* the Button twins add a check, a pop on arming and (web) a breathing glow.
|
|
11
|
+
* - quiet — small actions (Undo, Clear picks, Show all). A tint pill.
|
|
12
|
+
*
|
|
13
|
+
* Two sizes: lg (52) for the page's main action, md (44) everywhere else.
|
|
14
|
+
* Chips, tabs and filters (`optionLook`) and icon-only buttons (`hoverTint`)
|
|
15
|
+
* share the same hover / press / disabled states.
|
|
16
|
+
*/
|
|
17
|
+
export declare const BUTTON_UI: {
|
|
18
|
+
readonly radius: 12;
|
|
19
|
+
readonly height: {
|
|
20
|
+
readonly md: 44;
|
|
21
|
+
readonly lg: 52;
|
|
22
|
+
};
|
|
23
|
+
readonly padX: {
|
|
24
|
+
readonly md: 14;
|
|
25
|
+
readonly lg: 18;
|
|
26
|
+
};
|
|
27
|
+
readonly fontSize: {
|
|
28
|
+
readonly md: 14;
|
|
29
|
+
readonly lg: 16;
|
|
30
|
+
};
|
|
31
|
+
readonly weight: 800;
|
|
32
|
+
readonly gap: 8;
|
|
33
|
+
/** Every button sinks a touch when pressed. */
|
|
34
|
+
readonly pressScale: 0.98;
|
|
35
|
+
readonly disabledOpacity: 0.5;
|
|
36
|
+
readonly ms: 150;
|
|
37
|
+
};
|
|
38
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'quiet' | 'confirm';
|
|
39
|
+
export type ButtonSize = 'md' | 'lg';
|
|
40
|
+
export interface PressState {
|
|
41
|
+
hovered?: boolean;
|
|
42
|
+
pressed?: boolean;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface ButtonLook {
|
|
46
|
+
background: string;
|
|
47
|
+
color: string;
|
|
48
|
+
borderColor: string;
|
|
49
|
+
borderWidth: number;
|
|
50
|
+
opacity: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The one hover rule for every unfilled control: it previews the colour it acts
|
|
54
|
+
* in — the ring turns that colour over a faint tint (a little more on press).
|
|
55
|
+
* Chips and icon buttons preview the primary, an unchosen Yes / No its own green / red.
|
|
56
|
+
*/
|
|
57
|
+
export declare function previewTint(color: string, { hovered, pressed, disabled }?: PressState): {
|
|
58
|
+
borderColor: string;
|
|
59
|
+
background: string;
|
|
60
|
+
} | null;
|
|
61
|
+
/** `previewTint` in the theme primary, background only. */
|
|
62
|
+
export declare function hoverTint(theme: BladeTheme, state?: PressState): string | undefined;
|
|
63
|
+
export declare function buttonLook(theme: BladeTheme, variant: ButtonVariant, state?: PressState): ButtonLook;
|
|
64
|
+
/** Chips, tabs, filters and options: teal with light text when chosen; a hairline card that tints on hover when not. */
|
|
65
|
+
export declare function optionLook(theme: BladeTheme, selected: boolean, state?: PressState): ButtonLook;
|
|
@@ -13,8 +13,16 @@ export interface CallPayoutView {
|
|
|
13
13
|
heading: string;
|
|
14
14
|
note: string;
|
|
15
15
|
rows: CallPayoutRow[];
|
|
16
|
+
/** A short line beside the heading, e.g. "Includes your $20 stake". */
|
|
17
|
+
aside?: string;
|
|
16
18
|
}
|
|
17
|
-
|
|
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;
|
|
18
26
|
/** Outcome tables use the same pricing functions as setup and confirmation. */
|
|
19
27
|
export declare function callOutcomePayouts(game: Game, count: number, stake: number, expectedCorrect?: number): CallPayoutView | null;
|
|
20
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;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { BladeApiClient } from './api-client';
|
|
2
2
|
import { Game, Proposition } from './types';
|
|
3
|
-
/** Explicit opt-in only:
|
|
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
|
+
*/
|
|
4
10
|
export declare const usesCorrelationPricing: (game?: Game | null) => boolean;
|
|
5
11
|
export interface CorrelationQuote {
|
|
6
12
|
resultant_price: number;
|
|
@@ -39,5 +45,12 @@ export declare function useCorrelationSteering(client: BladeApiClient | null, ga
|
|
|
39
45
|
answers: Map<number, Partial<Record<"yes" | "no", CorrelationQuote>>>;
|
|
40
46
|
retry: () => void;
|
|
41
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;
|
|
42
55
|
/** Developer diagnostics use the correlation quote, never the payout multiplier. */
|
|
43
56
|
export declare function correlationDebugText(correlation: Pick<ReturnType<typeof useCorrelationSteering>, 'loading' | 'error' | 'data'>, targetCount: number): string;
|
|
@@ -1,26 +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 appears when at least one prop falls inside it — so the chips read
|
|
16
|
-
* the same way every time you open the panel. The whole group drops out only
|
|
17
|
-
* when no window can change the list at all (every dated prop inside every
|
|
18
|
-
* window it matches), which is what a game the operator already caps to a
|
|
19
|
-
* single day or week looks like.
|
|
20
|
-
*/
|
|
21
|
-
export declare function availableDateWindows(propositions: ReadonlyArray<Pick<Proposition, 'commence_time'>>, now: Date): DateWindowOption[];
|
|
22
|
-
/**
|
|
23
|
-
* Filter propositions to a window. `null` returns them unchanged; undated
|
|
24
|
-
* propositions are dropped whenever a window is active.
|
|
25
|
-
*/
|
|
26
|
-
export declare function filterByDateWindow<T extends Pick<Proposition, 'commence_time'>>(propositions: readonly T[], id: DateWindowId | null, now: Date): T[];
|
|
@@ -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, maxWinCents?: number | null, 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
|
+
};
|
|
@@ -23,6 +23,8 @@ export interface GameArtwork {
|
|
|
23
23
|
icons: Readonly<Record<string, string>>;
|
|
24
24
|
/** Category covers and guide branding supplied by the library. */
|
|
25
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>>;
|
|
26
28
|
guideLogo?: string;
|
|
27
29
|
catalogueImages?: Readonly<Record<string, string>>;
|
|
28
30
|
/** Shelf cover data URLs by icon id. */
|
|
@@ -31,7 +33,27 @@ export interface GameArtwork {
|
|
|
31
33
|
presets: readonly CategoryGamePreset[];
|
|
32
34
|
/** Shelf cover data URLs by preset id. */
|
|
33
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;
|
|
34
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[];
|
|
35
57
|
export declare const BASE_GAME_ARTWORK: GameArtwork;
|
|
36
58
|
/** The base artwork plus the given packs, later packs winning. */
|
|
37
59
|
export declare function mergeGameArtwork(...packs: readonly (Partial<GameArtwork> | undefined)[]): GameArtwork;
|
|
@@ -46,6 +46,28 @@ export interface WinConditionPrizeRow {
|
|
|
46
46
|
export declare function winConditionPrizeRows(winningCounts: number[] | null | undefined, totalPicks: number, payouts: Record<number, number> | null | undefined): WinConditionPrizeRow[];
|
|
47
47
|
export declare function lockedLegCount(game: Game | null | undefined, selectedCount: number | null | undefined): number | null;
|
|
48
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;
|
|
49
71
|
export declare function isStakeLockedGame(game: Game | null | undefined): boolean;
|
|
50
72
|
/** Why the stake is fixed, shown beside the locked figure. */
|
|
51
73
|
export declare function stakeLockedNote(game: Game | null | undefined): string;
|
|
@@ -6,8 +6,9 @@ export declare const GAME_ICON_SCHEME = "game-icon:";
|
|
|
6
6
|
export declare const GAME_ICON_SVG: Readonly<Record<string, string>>;
|
|
7
7
|
/** Resolve a bundled icon id for a game; unknown games use the question-mark fallback. */
|
|
8
8
|
export declare function resolveGameIconId(game: Pick<Game, 'game_name' | 'quick_pick_only' | 'rule'>): GameIconId;
|
|
9
|
+
export declare const CATEGORY_ICON_PREFIX: RegExp;
|
|
9
10
|
/** Stable URL token consumed by IconSvg (never fetched over the network). */
|
|
10
|
-
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;
|
|
11
12
|
export declare function isGameIconUrl(iconUrl: string): boolean;
|
|
12
13
|
/** Markup for a local icon token, from the given icon set (the base icons by default); unknown ids use the fallback. */
|
|
13
14
|
export declare function resolveGameIconMarkup(iconUrl: string, icons?: Readonly<Record<string, string | undefined>>): string | null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { CallTicketBuilderProps } from './dense-ui';
|
|
2
3
|
import { Game } from './types';
|
|
3
4
|
import { YesNoLabels } from './utils';
|
|
4
5
|
import { GameArtwork } from './game-artwork';
|
|
5
6
|
import { GameFlow } from './game-flow';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
yesNoLabels: YesNoLabels;
|
|
7
|
+
/** Where the host's setup frame sends the player; passed through from the host's setup route. */
|
|
8
|
+
export interface GameSetupNav {
|
|
9
9
|
onPickYourOwn?: () => void;
|
|
10
10
|
onQuickPick?: () => void;
|
|
11
11
|
onBack?: () => void;
|
|
@@ -13,13 +13,37 @@ export interface GameSetupProps<Entry> {
|
|
|
13
13
|
backLabel?: string;
|
|
14
14
|
className?: string;
|
|
15
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
|
+
}
|
|
16
40
|
/** An implementation for API game records, not a replacement for API data. */
|
|
17
41
|
export interface GameDefinition<Entry> {
|
|
18
42
|
readonly id: string;
|
|
19
43
|
/** The API games this entry plays. An entry without `matches` plays nothing and only carries artwork. */
|
|
20
44
|
readonly matches?: (game: Game) => boolean;
|
|
21
45
|
readonly flow?: GameFlow;
|
|
22
|
-
/** Opt in to
|
|
46
|
+
/** Opt in to supplying the setup screen for a built-in game, such as Perfect Pick. */
|
|
23
47
|
readonly overrideBase?: boolean;
|
|
24
48
|
readonly Setup?: ComponentType<GameSetupProps<Entry>>;
|
|
25
49
|
/** Icons, shelf covers and category presets for the games this entry brings; the provider merges every pack. */
|
|
@@ -27,7 +51,7 @@ export interface GameDefinition<Entry> {
|
|
|
27
51
|
}
|
|
28
52
|
export type GameLibrary<Entry> = readonly GameDefinition<Entry>[];
|
|
29
53
|
export declare const EMPTY_GAME_LIBRARY: readonly never[];
|
|
30
|
-
export declare const BASE_GAME_IDS: readonly ["perfect-pick", "h2h", "
|
|
54
|
+
export declare const BASE_GAME_IDS: readonly ["perfect-pick", "h2h", "total-points", "quick-pick"];
|
|
31
55
|
export declare function getBaseGameId(game: Game): typeof BASE_GAME_IDS[number] | undefined;
|
|
32
56
|
export declare function findLibraryGame<Entry>(game: Game | null | undefined, library: GameLibrary<Entry>): GameDefinition<Entry> | undefined;
|
|
33
57
|
export declare function supportsGame<Entry>(game: Game, library: GameLibrary<Entry>): boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CategoryGamePreset, GameArtwork } from './game-artwork';
|
|
2
2
|
import { BladeTheme } from './themes';
|
|
3
3
|
import { Game } from './types';
|
|
4
|
+
import { DrawnCover } from './shelf-covers';
|
|
4
5
|
import { GameTierId } from './game-tiers';
|
|
5
|
-
export { playbookTier as shelfTier, playbookHook as shelfHook } from './playbook';
|
|
6
|
+
export { playbookTier as shelfTier, playbookHook as shelfHook, playbookMechanic as shelfMechanic } from './playbook';
|
|
6
7
|
/** Illustrated games lead each shelf; the rest follow in API order. */
|
|
7
8
|
export declare const FEATURED: string[];
|
|
8
9
|
export declare const COVER_COLORS: Record<string, string>;
|
|
@@ -35,8 +36,42 @@ export declare function resolveShelfSkin(theme: BladeTheme): {
|
|
|
35
36
|
buttonText: string;
|
|
36
37
|
coverText: string;
|
|
37
38
|
artwork?: Record<string, string | null>;
|
|
39
|
+
coverStyle?: "art" | "brand" | "mark" | "stacked" | "tile";
|
|
40
|
+
heroArtwork?: Record<string, string | null>;
|
|
38
41
|
categoryArtwork?: Record<string, string | null>;
|
|
39
42
|
};
|
|
43
|
+
/** Game Shelf's category banner: shared by the page and its loading skeleton on both platforms. */
|
|
44
|
+
export declare const SHELF_CATEGORY_BANNER: {
|
|
45
|
+
readonly height: 116;
|
|
46
|
+
readonly art: 150;
|
|
47
|
+
readonly radius: 16;
|
|
48
|
+
readonly pad: 16;
|
|
49
|
+
readonly gap: 12;
|
|
50
|
+
readonly minWidth: 300;
|
|
51
|
+
readonly mark: 92;
|
|
52
|
+
readonly markRight: 16;
|
|
53
|
+
};
|
|
40
54
|
/** Specific suite overrides precede generic rule artwork overrides. */
|
|
41
55
|
export declare function resolveShelfArtwork(game: Game, theme: BladeTheme, artwork?: GameArtwork): string | null | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* One Shelf cover: its ground and name ink, and either its illustration or its drawn art (`theme.shelf.coverStyle`).
|
|
58
|
+
* In `art` mode a game without an illustration is drawn in `brand`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolveShelfCover(game: Game, theme: BladeTheme, artwork?: GameArtwork): {
|
|
61
|
+
ground: string;
|
|
62
|
+
ink: string;
|
|
63
|
+
art?: string;
|
|
64
|
+
drawn?: DrawnCover;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* One category banner's ground, name ink and picture, or its mark (from the game library's `categoryIcons`) drawn like
|
|
68
|
+
* the game covers: in `brand` on the stacked tiles on stone, in `mark` / `stacked` / `tile` on a colour ground. A
|
|
69
|
+
* picture set to null in `art` mode stays hidden; without a mark a drawn banner is its ground and name.
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveShelfCategoryArt(category: string, theme: BladeTheme, artwork?: Pick<GameArtwork, 'categoryCovers' | 'categoryIcons'>): {
|
|
72
|
+
ground?: string;
|
|
73
|
+
ink: string;
|
|
74
|
+
art?: string | null;
|
|
75
|
+
drawn?: DrawnCover;
|
|
76
|
+
};
|
|
42
77
|
export declare function shelfGameName(game: Game, presets?: readonly CategoryGamePreset[]): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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';
|
|
2
|
+
export type GameVariant = 'cards' | 'split' | 'compare' | 'shelf' | 'showcase';
|
|
3
3
|
export declare const GAME_VARIANTS: readonly GameVariant[];
|
|
4
4
|
export declare const GAME_VARIANT_LABELS: Record<GameVariant, string>;
|
|
5
5
|
export declare function parseGameVariant(value: unknown): GameVariant | undefined;
|
package/dist/shared/hooks.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export declare function useCreateGameEntry(apiClient: BladeApiClient): {
|
|
|
67
67
|
clearSubmitError: () => void;
|
|
68
68
|
};
|
|
69
69
|
export declare function usePlaceEntryFlow(initialGameId?: number): {
|
|
70
|
-
step: "sport" | "
|
|
70
|
+
step: "sport" | "game" | "confirm" | "success";
|
|
71
71
|
selectedGame: Game | null;
|
|
72
72
|
selections: Record<number, "yes" | "no">;
|
|
73
73
|
placedEntry: GameEntry | null;
|
|
@@ -1,14 +1,79 @@
|
|
|
1
1
|
import { Game, TopPayoutsResponse } from './types';
|
|
2
|
+
import { MarketFamily } from './selection-caps';
|
|
2
3
|
/** Copy for the live slip docked under the selection list. */
|
|
3
4
|
export declare const SLIP_EMPTY_HINT = "Tap Yes or No to start building your multi.";
|
|
4
5
|
export declare const SLIP_STAKE_LABEL = "Your stake";
|
|
5
6
|
export declare const SLIP_DIVIDEND_LABEL = "Potential dividend";
|
|
6
|
-
export declare const SLIP_LEG_HINT = "Tap a leg to read it.";
|
|
7
7
|
export declare const SLIP_LEG_REMOVE = "Remove";
|
|
8
|
-
export declare const SLIP_CLEAR = "Clear
|
|
8
|
+
export declare const SLIP_CLEAR = "Clear picks";
|
|
9
|
+
export declare const SELECTION_UNDO = "Undo";
|
|
10
|
+
/** The accessible name of the bolt on a row QuickPick answered. */
|
|
11
|
+
export declare const QUICK_PICKED_NOTE = "Picked by QuickPick";
|
|
12
|
+
/** QuickPick's shuffle mark, stroked paths on a 24×24 viewBox: the QuickPick buttons, the snackbar and the row marks. */
|
|
13
|
+
export declare const QUICK_PICK_ICON: readonly string[];
|
|
14
|
+
/** Snackbar after QuickPick fills the empty slots: "Filled 6 picks". */
|
|
15
|
+
export declare function quickPickUndoMessage(filled: number): string;
|
|
16
|
+
/** Snackbar after QuickPick shrinks the card: "Removed your last 2 picks". */
|
|
17
|
+
export declare function quickPickTrimMessage(removed: number): string;
|
|
18
|
+
/** Snackbar after Randomise all: "Randomised all 8 picks". */
|
|
19
|
+
export declare function quickPickReplaceMessage(count: number): string;
|
|
20
|
+
/** Snackbar after Clear picks: "Cleared 5 picks". */
|
|
21
|
+
export declare function clearPicksUndoMessage(count: number): string;
|
|
22
|
+
/** Snackbar after a folded row swaps in for the pick holding its slot. */
|
|
23
|
+
export declare const SWAP_UNDO_MESSAGE = "Swapped your pick";
|
|
24
|
+
type PickGroupKey = MarketFamily | 'other';
|
|
25
|
+
/** A match card's rail labels, per group. */
|
|
26
|
+
export declare const PICK_GROUP_COPY: Record<PickGroupKey, {
|
|
27
|
+
label: string;
|
|
28
|
+
caption?: string;
|
|
29
|
+
noun: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const pickGroupCopy: (family: MarketFamily | null) => {
|
|
32
|
+
label: string;
|
|
33
|
+
caption?: string;
|
|
34
|
+
noun: string;
|
|
35
|
+
};
|
|
36
|
+
/** Rail icons, stroked paths on a 24×24 viewBox: line versions of the Head to Head and Total Points marks, a jersey, a plus. */
|
|
37
|
+
export declare const PICK_GROUP_ICON: Record<PickGroupKey, readonly string[]>;
|
|
38
|
+
export declare const pickGroupIcon: (family: MarketFamily | null) => readonly string[];
|
|
39
|
+
/** The limit chip on a group's rail tile: "Pick 1" until it's full, then "1 of 1". */
|
|
40
|
+
export declare function pickLimitLabel(cap: number, full: boolean): string;
|
|
41
|
+
/** The tile the blocked rows fold into: "7 other players". */
|
|
42
|
+
export declare function foldedRowsLabel(count: number, family: MarketFamily | null): string;
|
|
43
|
+
/** The rule under it: "One per match. Picking another swaps it." */
|
|
44
|
+
export declare function foldedRowsRule(cap: number): string;
|
|
45
|
+
/** Shelf: how many `min`-wide columns fit across, `gap` apart — phone-width (400px) match cards by default. Same count as CSS `repeat(auto-fill, minmax(min, 1fr))`. */
|
|
46
|
+
export declare function shelfColumns(width: number, min?: number, gap?: number): number;
|
|
47
|
+
/**
|
|
48
|
+
* Shelf paging in fixed pages of `n` (1–2, 3–4 … 9): Next only ever brings in
|
|
49
|
+
* matches you haven't seen, and a jump to `at` lands on the page holding it.
|
|
50
|
+
* `prev` / `next` are where those pages start, null at the ends.
|
|
51
|
+
*/
|
|
52
|
+
export declare function shelfPage(count: number, at: number, n: number): {
|
|
53
|
+
start: number;
|
|
54
|
+
end: number;
|
|
55
|
+
prev: number | null;
|
|
56
|
+
next: number | null;
|
|
57
|
+
};
|
|
58
|
+
export type ShelfPage = ReturnType<typeof shelfPage>;
|
|
59
|
+
/** The jump board's days: every match in order under the day it starts ("Fri, 9 Oct"), with its place in the list. Undated ones share an unlabelled day. */
|
|
60
|
+
export declare function matchesByDay<T extends {
|
|
61
|
+
date: Date | null;
|
|
62
|
+
}>(events: readonly T[]): {
|
|
63
|
+
label: string;
|
|
64
|
+
items: {
|
|
65
|
+
event: T;
|
|
66
|
+
index: number;
|
|
67
|
+
}[];
|
|
68
|
+
}[];
|
|
69
|
+
/** "Next match", or "Next 2 matches" when the arrow pages several. */
|
|
70
|
+
export declare function stepLabel(dir: -1 | 1, count: number, noun: string): string;
|
|
71
|
+
/**
|
|
72
|
+
* The toggles that turn the `from` card into `to`: toggling an id's current
|
|
73
|
+
* answer drops it, toggling any other answer sets it. Empty when they match.
|
|
74
|
+
*/
|
|
75
|
+
export declare function selectionToggles(from: Record<number, 'yes' | 'no'>, to: Record<number, 'yes' | 'no'>): [number, 'yes' | 'no'][];
|
|
9
76
|
export declare const SPORT_LOCKED_HINT = "One sport per bet.";
|
|
10
|
-
export declare const VIEW_LIST_GLYPH = "\u2630";
|
|
11
|
-
export declare const VIEW_SWIPE_GLYPH = "\u21C6";
|
|
12
77
|
export declare const VIEW_LIST_LABEL = "List";
|
|
13
78
|
export declare const VIEW_SWIPE_LABEL = "Swipe";
|
|
14
79
|
export interface LiveSlipLeg {
|
|
@@ -59,3 +124,4 @@ export declare function payout20AtCount(payouts: TopPayoutsResponse | undefined,
|
|
|
59
124
|
expectedCorrect?: number;
|
|
60
125
|
stake?: number;
|
|
61
126
|
}): number;
|
|
127
|
+
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Game, Proposition } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* Which games ration the slots at all.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Game is already confined to a single fixture and priced for it, and every
|
|
3
|
+
* Which games ration the slots at all: the limited risk modes. BLADE holds a
|
|
4
|
+
* `limited` card to one line, one total and one player per match (two players
|
|
5
|
+
* under `limited_2p`) and prices it as independent legs, so the slots are the
|
|
6
|
+
* card's only rule. `any` leaves the mix to the Correlation Engine, and every
|
|
8
7
|
* other game leaves the slots alone — nothing greyed, no slot chips drawn.
|
|
9
8
|
*
|
|
10
9
|
* No game means no caps, so a caller that forgets to pass one shows no
|
|
@@ -14,12 +13,9 @@ export declare function selectionCapsApply(game?: Game | null): boolean;
|
|
|
14
13
|
export type MarketFamily = 'totals' | 'spread' | 'player';
|
|
15
14
|
export declare const MARKET_FAMILIES: MarketFamily[];
|
|
16
15
|
export declare const MARKET_CAPS: Record<MarketFamily, number>;
|
|
16
|
+
export declare function marketCaps(game?: Game | null): Record<MarketFamily, number>;
|
|
17
17
|
/** Slot names, as they read on a fixture header. */
|
|
18
18
|
export declare const MARKET_FAMILY_LABEL: Record<MarketFamily, string>;
|
|
19
|
-
/** How the market filter names each family — plural, since it picks many. */
|
|
20
|
-
export declare const MARKET_FAMILY_FILTER_LABEL: Record<MarketFamily, string>;
|
|
21
|
-
/** A raw feed market type as a filter chip reads it: `player_first_try` → "Player First Try". */
|
|
22
|
-
export declare function formatMarketTypeLabel(marketType: string): string;
|
|
23
19
|
export declare function slotTooltip(family: MarketFamily, filled: boolean): string;
|
|
24
20
|
/** Why a greyed row won't answer. */
|
|
25
21
|
export declare function capReason(family: MarketFamily): string;
|
|
@@ -60,8 +56,69 @@ export interface SelectionCaps {
|
|
|
60
56
|
* question and get the same answer.
|
|
61
57
|
*/
|
|
62
58
|
export declare function buildSelectionCaps(propositions: readonly Proposition[], selections: Record<number, 'yes' | 'no'>, componentById?: ReadonlyMap<number, Proposition> | null, game?: Game | null): SelectionCaps;
|
|
59
|
+
/** A match card's groups, in reading order: the line, the total, the players, then anything else. */
|
|
60
|
+
export declare const PICK_GROUP_ORDER: readonly (MarketFamily | null)[];
|
|
61
|
+
export interface PickGroup {
|
|
62
|
+
family: MarketFamily | null;
|
|
63
|
+
props: Proposition[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* One match's questions split into PICK_GROUP_ORDER, each keeping the feed's
|
|
67
|
+
* order. A match with no family at all (a race, a novelty) comes back as one
|
|
68
|
+
* `null` group, which the card draws without a rail.
|
|
69
|
+
*/
|
|
70
|
+
export declare function groupByFamily(props: readonly Proposition[]): PickGroup[];
|
|
71
|
+
/**
|
|
72
|
+
* A shelf group's limit: shown only when the group offers more than it allows. Once it's full, `blocked` are the
|
|
73
|
+
* rows it rules out, which fold away in place behind one tile.
|
|
74
|
+
*/
|
|
75
|
+
export declare function shelfGroupLimit({ family, props }: PickGroup, selections: Record<number, 'yes' | 'no'>, caps: SelectionCaps, game?: Game | null): {
|
|
76
|
+
cap: number;
|
|
77
|
+
limited: boolean;
|
|
78
|
+
full: boolean;
|
|
79
|
+
blocked: ReadonlySet<number>;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Whether a limited game's server takes this leg: a spread, a total or a player prop, read off the market type the
|
|
83
|
+
* way BLADE's `correlation_market_class` reads it. Head-to-heads, corners and composites are refused.
|
|
84
|
+
*/
|
|
85
|
+
export declare function limitedLegAllowed(prop: Proposition): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* The picks to drop so `prop` fits its match: for every family it would
|
|
88
|
+
* overfill, the same player's pick if there is one, else the most recent pick
|
|
89
|
+
* (by `pickOrder`; the last in the feed without it).
|
|
90
|
+
* Empty when it already fits.
|
|
91
|
+
*/
|
|
92
|
+
export declare function swapOut(prop: Proposition, pool: readonly Proposition[], selections: Record<number, 'yes' | 'no'>, componentById?: ReadonlyMap<number, Proposition> | null, game?: Game | null, pickOrder?: readonly number[]): number[];
|
|
93
|
+
/** Fisher–Yates: every order equally likely, which `sort(() => Math.random() - 0.5)` is not. */
|
|
94
|
+
export declare function shuffled<T>(rows: readonly T[]): T[];
|
|
63
95
|
/**
|
|
64
96
|
* Quick pick's pool, thinned to what a player could have picked by hand — one
|
|
65
97
|
* slot per family per fixture, in the order it is handed (already shuffled).
|
|
98
|
+
* `kept` are picks already on the card: they hold their slots first, but don't
|
|
99
|
+
* count toward `count`.
|
|
100
|
+
*/
|
|
101
|
+
export declare function takeWithinCaps(pool: readonly Proposition[], count: number, componentById?: ReadonlyMap<number, Proposition> | null, game?: Game | null, kept?: readonly Proposition[]): Proposition[];
|
|
102
|
+
export type QuickPickMode = 'fill' | 'replace';
|
|
103
|
+
type Answer = 'yes' | 'no';
|
|
104
|
+
/**
|
|
105
|
+
* QuickPick's next card at `count` picks. fill keeps the player's picks and adds random ones
|
|
106
|
+
* to the empty slots; with more picks than `count` it drops the most recent extras (by
|
|
107
|
+
* `pickOrder`). replace throws the card away and picks `count` afresh.
|
|
66
108
|
*/
|
|
67
|
-
export declare function
|
|
109
|
+
export declare function planQuickPick({ selections, pickOrder, propositions, count, mode, componentById, game, coin }: {
|
|
110
|
+
selections: Readonly<Record<number, Answer>>;
|
|
111
|
+
pickOrder: readonly number[];
|
|
112
|
+
propositions: readonly Proposition[];
|
|
113
|
+
count: number;
|
|
114
|
+
mode: QuickPickMode;
|
|
115
|
+
componentById?: ReadonlyMap<number, Proposition> | null;
|
|
116
|
+
game?: Game | null;
|
|
117
|
+
coin?: () => Answer;
|
|
118
|
+
}): {
|
|
119
|
+
next: Record<number, Answer>;
|
|
120
|
+
added: Record<number, Answer>;
|
|
121
|
+
removed: number;
|
|
122
|
+
kept: number;
|
|
123
|
+
};
|
|
124
|
+
export {};
|
|
@@ -40,6 +40,13 @@ export declare function formatFixtureTime(date: Date): string;
|
|
|
40
40
|
export declare function teamCode(team: string | null | undefined): string;
|
|
41
41
|
/** `HAW v ADE` — a chip-sized fixture label; races and team-less groups keep their title. */
|
|
42
42
|
export declare function fixtureShortLabel(event: SelectionEvent): string;
|
|
43
|
+
/** Both teams in full — the selected match chip, when the rail has room. */
|
|
44
|
+
export declare function fixtureFullLabel(event: SelectionEvent): string;
|
|
45
|
+
/** A grouping key's two clubs, when it names both ("Home vs Away"). */
|
|
46
|
+
export declare function splitMatchup(key: string, racing: boolean): {
|
|
47
|
+
home?: string;
|
|
48
|
+
away?: string;
|
|
49
|
+
};
|
|
43
50
|
/**
|
|
44
51
|
* Fixtures in kick-off order, split into day blocks; undated ones trail.
|
|
45
52
|
*
|