courthive-components 7.0.0 → 7.1.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.
Files changed (35) hide show
  1. package/dist/components/composition-editor/sections/colorsSection.d.ts +1 -1
  2. package/dist/components/composition-editor/sections/layoutSection.d.ts +1 -1
  3. package/dist/components/renderSchematicStructure/index.d.ts +1 -1
  4. package/dist/components/renderSchematicStructure/renderSchematicMatchUp.d.ts +29 -3
  5. package/dist/components/renderSchematicStructure/renderSchematicRound.d.ts +3 -2
  6. package/dist/components/renderSchematicStructure/renderSchematicStructure.d.ts +4 -2
  7. package/dist/components/renderStructure/connectors.d.ts +25 -0
  8. package/dist/components/renderStructure/matchUpState.d.ts +32 -0
  9. package/dist/components/renderStructure/renderMatchUp.d.ts +6 -3
  10. package/dist/components/renderStructure/renderMatchUpActions.d.ts +14 -0
  11. package/dist/components/renderStructure/renderMatchUpInPlace.d.ts +19 -0
  12. package/dist/components/renderStructure/renderOnlineResources.d.ts +20 -0
  13. package/dist/components/renderStructure/renderParticipantDetail.d.ts +1 -1
  14. package/dist/components/renderStructure/renderRound.d.ts +5 -1
  15. package/dist/components/renderStructure/renderRoundHeader.d.ts +3 -2
  16. package/dist/components/renderStructure/renderRoundPager.d.ts +14 -0
  17. package/dist/components/renderStructure/renderSchedule.d.ts +10 -3
  18. package/dist/components/renderStructure/renderSlot.d.ts +7 -0
  19. package/dist/components/renderStructure/renderStructure.d.ts +20 -1
  20. package/dist/components/renderStructure/renderStructureMinimap.d.ts +5 -1
  21. package/dist/components/renderStructure/scoreboardState.d.ts +17 -0
  22. package/dist/components/renderStructure/structurePaths.d.ts +21 -0
  23. package/dist/courthive-components.css +1 -1
  24. package/dist/courthive-components.es.js +9007 -9237
  25. package/dist/courthive-components.umd.js +46 -46
  26. package/dist/courts.mjs +2 -4
  27. package/dist/{dist-DPnSc4eG.mjs → dist-BuZ2aY07.mjs} +13 -46
  28. package/dist/features.css +1 -1
  29. package/dist/index.d.ts +4 -2
  30. package/dist/{range-C-KhEV-d.mjs → range-5-_fCM2L.mjs} +1 -2
  31. package/dist/segmented-bar.mjs +1 -2
  32. package/dist/styles/themes/createTheme.d.ts +6 -0
  33. package/dist/types.d.ts +297 -4
  34. package/package.json +9 -9
  35. package/dist/styles/getLinkStyle.d.ts +0 -25
@@ -1,3 +1,3 @@
1
- import { CompositionEditorStore } from '../compositionEditorStore';
2
1
  import { EditorPanel } from '../compositionEditorTypes';
2
+ import { CompositionEditorStore } from '../compositionEditorStore';
3
3
  export declare function buildColorsSection(store: CompositionEditorStore): EditorPanel;
@@ -1,3 +1,3 @@
1
- import { CompositionEditorStore } from '../compositionEditorStore';
2
1
  import { EditorPanel } from '../compositionEditorTypes';
2
+ import { CompositionEditorStore } from '../compositionEditorStore';
3
3
  export declare function buildLayoutSection(store: CompositionEditorStore): EditorPanel;
@@ -1,4 +1,4 @@
1
1
  export { renderSchematicStructure } from './renderSchematicStructure';
2
2
  export { renderSchematicRound } from './renderSchematicRound';
3
3
  export { renderSchematicMatchUp } from './renderSchematicMatchUp';
4
- export type { SchematicMatchUp } from './renderSchematicMatchUp';
4
+ export type { SchematicMatchUp, SchematicOptions } from './renderSchematicMatchUp';
@@ -1,3 +1,26 @@
1
+ /**
2
+ * The schematic's geometry and colours. Every value has a default equal to the original fixed rendering, so
3
+ * leaving it out changes nothing. Set on the structure root as CSS variables, which the stylesheet reads.
4
+ */
5
+ export interface SchematicOptions {
6
+ /** height in px of one participant slot; a matchUp is two slots and a 1px divider. Default 5 */
7
+ slotHeight?: number;
8
+ /** width in px of the connector between rounds. Default 8 */
9
+ connectorWidth?: number;
10
+ /** width in px of a matchUp. Default 40 */
11
+ matchUpWidth?: number;
12
+ /** corner radius of a slot, any CSS length. Default 1px */
13
+ radius?: string;
14
+ /** connector colour, any CSS colour. Default the structure's connector colour */
15
+ connectorColor?: string;
16
+ /** slot fill, any CSS colour. Default `--chc-border-primary` */
17
+ slotColor?: string;
18
+ }
19
+ export declare const SCHEMATIC_DEFAULTS: {
20
+ slotHeight: number;
21
+ connectorWidth: number;
22
+ matchUpWidth: number;
23
+ };
1
24
  export interface SchematicMatchUp {
2
25
  matchUpId: string;
3
26
  roundNumber: number;
@@ -12,10 +35,10 @@ export interface SchematicMatchUp {
12
35
  collectionId?: string;
13
36
  }
14
37
  /**
15
- * Renders a compact matchup: two 5px-tall slots separated by a 1px divider.
16
- * Total height 11px vs ~60px for the full renderMatchUp.
38
+ * Renders a compact matchup: two slots (5px tall by default, `slotHeight`) separated by a 1px divider.
39
+ * Total height 11px by default, vs ~60px for the full renderMatchUp.
17
40
  */
18
- export declare function renderSchematicMatchUp({ matchUp, moiety, isFirstRound, isFinalRound, isRoundRobin, roundFactor: roundFactorParam, isLucky }: {
41
+ export declare function renderSchematicMatchUp({ matchUp, moiety, isFirstRound, isFinalRound, isRoundRobin, roundFactor: roundFactorParam, connectorWidth, slotHeight, isLucky }: {
19
42
  matchUp: SchematicMatchUp;
20
43
  moiety?: boolean;
21
44
  isFirstRound?: boolean;
@@ -28,4 +51,7 @@ export declare function renderSchematicMatchUp({ matchUp, moiety, isFirstRound,
28
51
  * Falls back to the matchUp's own factor for direct callers.
29
52
  */
30
53
  roundFactor?: number;
54
+ /** `SchematicOptions.slotHeight`, which the connector heights scale with */
55
+ slotHeight?: number;
56
+ connectorWidth?: number;
31
57
  }): HTMLElement;
@@ -1,9 +1,9 @@
1
- import { SchematicMatchUp } from './renderSchematicMatchUp';
1
+ import { SchematicMatchUp, SchematicOptions } from './renderSchematicMatchUp';
2
2
  /**
3
3
  * Renders a round column with optional simplified header (round number only)
4
4
  * and compact schematic matchups.
5
5
  */
6
- export declare function renderSchematicRound({ initialRoundFactor, initialRoundNumber, isFinalRound, isRoundRobin, roundNumber, matchUps, showHeader, isLucky }: {
6
+ export declare function renderSchematicRound({ initialRoundFactor, initialRoundNumber, isFinalRound, isRoundRobin, roundNumber, matchUps, showHeader, options, isLucky }: {
7
7
  initialRoundFactor?: number;
8
8
  initialRoundNumber?: number;
9
9
  isFinalRound?: boolean;
@@ -11,5 +11,6 @@ export declare function renderSchematicRound({ initialRoundFactor, initialRoundN
11
11
  roundNumber: number;
12
12
  matchUps: SchematicMatchUp[];
13
13
  showHeader?: boolean;
14
+ options?: SchematicOptions;
14
15
  isLucky?: boolean;
15
16
  }): HTMLElement;
@@ -1,12 +1,14 @@
1
- import { SchematicMatchUp } from './renderSchematicMatchUp';
1
+ import { SchematicMatchUp, SchematicOptions } from './renderSchematicMatchUp';
2
2
  /**
3
3
  * Compact bracket renderer showing structure shape without participant details.
4
4
  * Uses the same getRoundMatchUps() engine call as renderStructure but produces
5
5
  * a much smaller visual (~14px per matchup vs ~60px).
6
6
  */
7
- export declare function renderSchematicStructure({ initialRoundNumber, showHeaders, structureId, matchUps }: {
7
+ export declare function renderSchematicStructure({ initialRoundNumber, showHeaders, structureId, matchUps, options }: {
8
8
  initialRoundNumber?: number;
9
9
  showHeaders?: boolean;
10
10
  structureId?: string;
11
11
  matchUps: SchematicMatchUp[];
12
+ /** geometry and colours; defaults reproduce the original rendering */
13
+ options?: SchematicOptions;
12
14
  }): HTMLElement;
@@ -0,0 +1,25 @@
1
+ import { MatchUp } from '../../types';
2
+ /**
3
+ * How a matchUp connects to the next round: `m1` / `m2` the upper / lower matchUp of a pair (the line turns
4
+ * down / up to their junction), `m0` straight across (a feed or qualifying round), `noProgression` the final,
5
+ * `mr` no connector at all (round robin, ad hoc, lucky, a search result, a tie's collection).
6
+ */
7
+ export type ConnectorVariant = 'm1' | 'm2' | 'm0' | 'noProgression' | 'mr';
8
+ export declare function connectorVariant({ searchActive, isFinalRound, matchUp, isAdHoc, isLucky, moiety }: {
9
+ searchActive?: boolean;
10
+ isFinalRound?: boolean;
11
+ matchUp: MatchUp;
12
+ isAdHoc?: boolean;
13
+ isLucky?: boolean;
14
+ moiety?: boolean;
15
+ }): ConnectorVariant;
16
+ /**
17
+ * The cell a connected matchUp sits in. A round of cells is a grid of equal rows, so a cell in the next round
18
+ * spans exactly the two it is fed by, and the connector is drawn from the cell as percentages of its height:
19
+ * no JS heights, and nothing depends on how tall a card is.
20
+ */
21
+ export declare function renderConnectorCell({ connectorWidth, isFirstRound, variant }: {
22
+ connectorWidth?: number;
23
+ isFirstRound?: boolean;
24
+ variant: ConnectorVariant;
25
+ }): HTMLElement;
@@ -0,0 +1,32 @@
1
+ import { MatchUp, Side } from '../../types';
2
+ /**
3
+ * Entry statuses shown beside the seed, with their abbreviation and full name. LUCKY_LOSER is absent on
4
+ * purpose: the name already carries an `LL` badge. Registration states (CONFIRMED, REGISTERED, ...) are
5
+ * not draw entries and are absent too.
6
+ */
7
+ export declare const ENTRY_STATUS_LABELS: Record<string, {
8
+ abbr: string;
9
+ name: string;
10
+ }>;
11
+ /**
12
+ * The entry-status label to show for a side, or undefined. `setting` is `configuration.entryStatus`:
13
+ * `true` shows every status but direct acceptance, the ordinary case; `'all'` shows that too.
14
+ */
15
+ export declare function entryStatusLabel(side: Side | undefined, setting: boolean | 'all' | undefined): {
16
+ abbr: string;
17
+ name: string;
18
+ } | undefined;
19
+ /**
20
+ * A seed beaten in a fully scored result by an unseeded side or a lower seed: `{ winnerSeed, loserSeed, winningSide }`,
21
+ * else undefined. The verdict is the factory's `getMatchUpUpset` (CA, 2026-10-26: upset belongs in the factory, played
22
+ * results only and only fully scored), on its default SEEDING basis.
23
+ */
24
+ export declare function upsetOf(matchUp?: MatchUp): {
25
+ winnerSeed?: number;
26
+ loserSeed: number;
27
+ winningSide: number;
28
+ } | undefined;
29
+ export declare function upsetTitle(upset: {
30
+ winnerSeed?: number;
31
+ loserSeed: number;
32
+ }): string;
@@ -3,6 +3,10 @@ export declare function renderMatchUp(params: {
3
3
  composition?: Composition;
4
4
  initialRoundNumber?: number;
5
5
  matchUp: MatchUp;
6
+ /**
7
+ * @deprecated The connector is drawn by the cell `renderRound` puts the matchUp in, so a matchUp no longer
8
+ * needs to know whether it is the upper or lower of a pair. Ignored.
9
+ */
6
10
  moiety?: boolean;
7
11
  selectedMatchUpId?: string;
8
12
  searchActive?: boolean;
@@ -12,9 +16,8 @@ export declare function renderMatchUp(params: {
12
16
  eventHandlers?: EventHandlers;
13
17
  className?: string;
14
18
  /**
15
- * Connector-height scale for THIS render. `renderRound` computes it for the
16
- * round the view currently starts at and passes it down; direct callers can
17
- * leave it out and the matchUp's own factor is used.
19
+ * @deprecated Connector heights are no longer computed: a round is a grid of equal rows and the connector is
20
+ * drawn as percentages of its cell. Ignored.
18
21
  */
19
22
  roundFactor?: number;
20
23
  }): HTMLElement;
@@ -0,0 +1,14 @@
1
+ import { Configuration, EventHandlers, MatchUp } from '../../types';
2
+ /**
3
+ * `configuration.matchUpActions`: Watch and Share under the card, or undefined when neither can do anything.
4
+ *
5
+ * Watch needs a STREAM or VIDEO resource and opens it as the header icons do: `eventHandlers.onlineResourceClick`
6
+ * when the host gives one, else the resource's http(s) link in a new tab. Share needs `eventHandlers.matchUpShare`;
7
+ * a share button that did nothing would be worse than none. Clicks are properties, not listeners (TMX's morphdom
8
+ * carries properties across a refresh), and stop propagating so they do not also select the matchUp.
9
+ */
10
+ export declare function renderMatchUpActions({ configuration, eventHandlers, matchUp }: {
11
+ configuration?: Configuration;
12
+ eventHandlers?: EventHandlers;
13
+ matchUp: MatchUp;
14
+ }): HTMLElement | undefined;
@@ -0,0 +1,19 @@
1
+ import { Composition, EventHandlers, MatchUp } from '../../types';
2
+ /**
3
+ * Re-render one matchUp of a rendered structure and swap it in, instead of rebuilding the structure and
4
+ * diffing the whole tree, e.g. on a live score update. The matchUp's place in the structure (the view's first
5
+ * round, final / lucky / ad hoc / search) is read from what `renderMatchUp` recorded on its `.tmx-m`, so the
6
+ * swapped node is what a full render would have produced. Its connector belongs to the cell around it, which
7
+ * the swap keeps.
8
+ *
9
+ * Returns the new node, or undefined when the matchUp is not in `root`. The path index behind
10
+ * `configuration.pathHighlight` is built per structure render, so a path reflects the last full render.
11
+ */
12
+ export declare function renderMatchUpInPlace({ selectedMatchUpId, eventHandlers, composition, favourites, matchUp, root }: {
13
+ selectedMatchUpId?: string;
14
+ eventHandlers?: EventHandlers;
15
+ composition?: Composition;
16
+ favourites?: string[] | Set<string>;
17
+ matchUp: MatchUp;
18
+ root: Element | Document;
19
+ }): HTMLElement | undefined;
@@ -0,0 +1,20 @@
1
+ import { Configuration, EventHandlers, MatchUp, OnlineResource, OnlineResourceSubType } from '../../types';
2
+ /** True when the matchUp carries a URL resource of subtype VIDEO or STREAM. Read for `data-has-video`. */
3
+ export declare function hasVideo(matchUp?: MatchUp): boolean;
4
+ /** The first URL resource of each wanted subtype, in display order. */
5
+ export declare function getMatchUpOnlineResources(matchUp?: MatchUp, subTypes?: OnlineResourceSubType[]): OnlineResource[];
6
+ /** Only http(s): an identifier is data from the record, and `javascript:` must never become a link. */
7
+ export declare function isWebUrl(identifier?: string): boolean;
8
+ /**
9
+ * The matchUp's online resources as icons, or `undefined` when the option is off or nothing renders.
10
+ *
11
+ * Clicks are bound as PROPERTIES (`onclick`), never with `addEventListener`: TMX refreshes a draw with
12
+ * morphdom, which carries handler properties across to a reused node and cannot carry listeners. Each
13
+ * click stops propagating, so it opens the resource without also selecting the matchUp or the schedule.
14
+ */
15
+ export declare function renderOnlineResources({ configuration, eventHandlers, placement, matchUp }: {
16
+ configuration?: Configuration;
17
+ eventHandlers?: EventHandlers;
18
+ placement: 'schedule' | 'corner';
19
+ matchUp?: MatchUp;
20
+ }): HTMLElement | undefined;
@@ -4,4 +4,4 @@ export declare function renderParticipantDetail(params: {
4
4
  individualParticipant?: IndividualParticipant;
5
5
  className?: string;
6
6
  [key: string]: any;
7
- }): HTMLElement;
7
+ }): HTMLElement | undefined;
@@ -1,5 +1,5 @@
1
1
  import { Composition, EventHandlers, MatchUp } from '../../types';
2
- export declare function renderRound({ initialRoundNumber, selectedMatchUpId, eventHandlers, isFinalRound, isRoundRobin, searchActive, composition, roundFactor, roundNumber, roundProfile, minWidth, matchUps, context, isLucky }: {
2
+ export declare function renderRound({ initialRoundNumber, selectedMatchUpId, eventHandlers, isFinalRound, isRoundRobin, searchActive, composition, roundNumber, roundProfile, minWidth, matchUps, context, isLucky }: {
3
3
  initialRoundNumber?: number;
4
4
  selectedMatchUpId?: string;
5
5
  eventHandlers?: EventHandlers;
@@ -7,6 +7,10 @@ export declare function renderRound({ initialRoundNumber, selectedMatchUpId, eve
7
7
  isRoundRobin?: boolean;
8
8
  searchActive?: boolean;
9
9
  composition?: Composition;
10
+ /**
11
+ * @deprecated Connector heights are no longer computed (see `connectors.ts`), so there is no scale to
12
+ * override. Ignored.
13
+ */
10
14
  roundFactor?: number;
11
15
  roundNumber: number;
12
16
  roundProfile?: any;
@@ -1,8 +1,9 @@
1
- import { EventHandlers, MatchUp } from '../../types';
2
- export declare function renderRoundHeader({ eventHandlers, roundMatchUps, roundProfile, roundNumber, context }: {
1
+ import { EventHandlers, MatchUp, StructureRenderers } from '../../types';
2
+ export declare function renderRoundHeader({ eventHandlers, roundMatchUps, roundProfile, roundNumber, renderers, context }: {
3
3
  eventHandlers?: EventHandlers;
4
4
  roundMatchUps?: MatchUp[];
5
5
  roundProfile?: any;
6
6
  roundNumber: number;
7
+ renderers?: StructureRenderers;
7
8
  context?: any;
8
9
  }): HTMLElement;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * A pager for a structure rendered with `carousel`: one button per round that scrolls the carousel to it,
3
+ * with `aria-current` on the round in view. Mount it next to the structure; call `destroy` when the structure
4
+ * is removed or re-rendered, which disconnects the observer that tracks the round in view.
5
+ *
6
+ * Labels come from each round's header when it has one (`configuration.roundHeader`), else `R1`, `R2`, ...
7
+ */
8
+ export declare function renderRoundPager({ behavior, structure }: {
9
+ behavior?: 'smooth' | 'instant' | 'auto';
10
+ structure: HTMLElement;
11
+ }): {
12
+ element: HTMLElement;
13
+ destroy: () => void;
14
+ };
@@ -1,5 +1,12 @@
1
- import { EventHandlers, MatchUp } from '../../types';
2
- export declare function renderSchedule({ matchUp, eventHandlers }: {
3
- matchUp?: MatchUp;
1
+ import { Configuration, EventHandlers, MatchUp } from '../../types';
2
+ export declare function renderSchedule({ configuration, eventHandlers, matchUp }: {
3
+ configuration?: Configuration;
4
4
  eventHandlers?: EventHandlers;
5
+ matchUp?: MatchUp;
5
6
  }): HTMLElement;
7
+ /**
8
+ * The schedule header's date and time, compact enough not to wrap beside a court name: `Mon 26 Oct., 8:00AM`.
9
+ * The month is abbreviated with a period when it is shortened (`May` stays as it is), and the hour drops the
10
+ * leading zero and the space before AM/PM (CA, 2026-10-26: `07:30 AM` wrapped the header).
11
+ */
12
+ export declare function formatScheduleDate(date: string, time?: string): string;
@@ -0,0 +1,7 @@
1
+ import { StructureRenderers } from '../../types';
2
+ /**
3
+ * Call a host's slot renderer and wrap what it returns, or return undefined when there is no renderer or it
4
+ * renders nothing. The host's element is wrapped, never modified: `chc-slot chc-slot--<name>` goes on the
5
+ * wrapper. A renderer that throws is a host defect and is left to surface.
6
+ */
7
+ export declare function renderSlot<K extends keyof StructureRenderers>(renderers: StructureRenderers | undefined, name: K, ctx: Parameters<NonNullable<StructureRenderers[K]>>[0], tagName?: 'div' | 'span'): HTMLElement | undefined;
@@ -1,5 +1,5 @@
1
1
  import { Composition, EventHandlers, MatchUp } from '../../types';
2
- export declare function renderStructure({ initialRoundNumber, selectedMatchUpId, eventHandlers, searchActive, composition, structureId, finalColumn, matchUps, minWidth, context }: {
2
+ export declare function renderStructure({ initialRoundNumber, selectedMatchUpId, eventHandlers, searchActive, composition, structureId, finalColumn, favourites, carousel, matchUps, minWidth, context }: {
3
3
  initialRoundNumber?: number;
4
4
  selectedMatchUpId?: string;
5
5
  eventHandlers?: EventHandlers;
@@ -7,7 +7,26 @@ export declare function renderStructure({ initialRoundNumber, selectedMatchUpId,
7
7
  composition?: Composition;
8
8
  structureId?: string;
9
9
  finalColumn?: boolean | HTMLElement;
10
+ /**
11
+ * participantIds the host pins (a pair's or an individual's): their sides take the favourite style and
12
+ * their matchUps carry `data-favourite`. Host state, so a parameter rather than a composition option.
13
+ */
14
+ favourites?: string[] | Set<string>;
15
+ /**
16
+ * Lay the rounds out as a horizontal carousel for narrow screens: one round per scroll-snap stop, with
17
+ * `peek` (default 0.2) of the next round showing, so connectors lead somewhere. Round headers move with
18
+ * their column. Pair it with `renderRoundPager` for a pager. The host decides when, e.g. by viewport.
19
+ */
20
+ carousel?: boolean | {
21
+ peek?: number;
22
+ };
10
23
  matchUps: MatchUp[];
11
24
  minWidth?: string;
12
25
  context?: any;
13
26
  }): HTMLElement;
27
+ /**
28
+ * Mark the sides of pinned participants. A side matches on its own participantId (a pair, a team) or on any
29
+ * of its individuals', so pinning one player of a pair pins the pair's side. Exported for hosts that render
30
+ * matchUps one at a time.
31
+ */
32
+ export declare function applyFavourites(root: HTMLElement, favourites?: string[] | Set<string>): void;
@@ -3,5 +3,9 @@ export interface StructureMinimapOptions {
3
3
  matchUps: MatchUp[];
4
4
  width?: number;
5
5
  quarterCount?: number;
6
+ /** connector line colour, any CSS colour. Default the structure's connector colour */
7
+ connectorColor?: string;
8
+ /** connector stroke width in px. Default 1 */
9
+ strokeWidth?: number;
6
10
  }
7
- export declare function buildStructureMinimap({ matchUps, width, quarterCount }: StructureMinimapOptions): HTMLDivElement | null;
11
+ export declare function buildStructureMinimap({ matchUps, width, quarterCount, connectorColor, strokeWidth }: StructureMinimapOptions): HTMLDivElement | null;
@@ -0,0 +1,17 @@
1
+ import { Configuration, MatchUp, ScheduleInfoOptions } from '../../types';
2
+ /** `configuration.scheduleInfo` in its object form; `true` (or nothing) is the plain header. */
3
+ export declare function scheduleInfoOptions(configuration?: Configuration): ScheduleInfoOptions;
4
+ /** The side's colour from `configuration.sideColors`, or undefined. */
5
+ export declare function sideColorOf(configuration: Configuration | undefined, matchUp: MatchUp, sideNumber: number): string;
6
+ export declare function isFinished(matchUp?: MatchUp): boolean;
7
+ /** The side due to serve, while the matchUp is unfinished; undefined when nobody is tracking service. */
8
+ export declare function servingSideOf(matchUp?: MatchUp): 1 | 2 | undefined;
9
+ /**
10
+ * Playing time in milliseconds, or undefined before the matchUp starts. The factory's `schedule.milliseconds`
11
+ * first (it excludes suspensions); otherwise `startTime` to `endTime`, or to `now` while the matchUp is unfinished.
12
+ */
13
+ export declare function elapsedOf(matchUp?: MatchUp, now?: number): number | undefined;
14
+ /** `h:mm`: `0:16`, `1:42`, `12:05`. */
15
+ export declare function formatElapsed(milliseconds: number): string;
16
+ /** `Men's Singles - R32`, from what the matchUp carries; empty when it carries neither. */
17
+ export declare function eventRoundLabel(matchUp?: MatchUp): string;
@@ -0,0 +1,21 @@
1
+ import { MatchUp } from '../../types';
2
+ export type ParticipantPath = {
3
+ /** every matchUp the participant appears in */
4
+ played: string[];
5
+ /** the matchUps the participant won: their outgoing connector is part of the path */
6
+ won: string[];
7
+ /** the matchUps ahead while the participant is still alive, by draw position */
8
+ projected: string[];
9
+ };
10
+ /**
11
+ * Index a structure's matchUps by participant, for path highlighting. `projectable` is false for draws whose
12
+ * later rounds are not reached by position (round robin, ad hoc, lucky); their paths are then the matchUps
13
+ * played, with nothing projected.
14
+ */
15
+ export declare function buildPathIndex({ roundProfile, projectable, matchUps }: {
16
+ roundProfile?: Record<string, {
17
+ matchUpsCount?: number;
18
+ }>;
19
+ projectable: boolean;
20
+ matchUps: MatchUp[];
21
+ }): (participantId: string) => ParticipantPath | undefined;