@pie-players/pie-section-player 1.0.0-beta.1 → 1.0.0-beta.2

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.
@@ -0,0 +1,18 @@
1
+ import { SectionPlayerCardTitleContext, SectionPlayerCardTitleFormatter } from '../../contracts/card-title-formatters.js';
2
+ export type ResolvedCardTitle = {
3
+ text: string;
4
+ visible: boolean;
5
+ };
6
+ /**
7
+ * The title a card renders for a host's `hooks.cardTitleFormatter` return.
8
+ *
9
+ * Hiding takes an explicit `{ visible: false }`, the shape a tool context
10
+ * resolver hides a tool with, because `null`, `undefined` and an empty string
11
+ * already mean "keep the default": a host computing its title from data it may
12
+ * lack returns one of them, and that host must keep getting "Question N".
13
+ *
14
+ * A hidden title keeps its text. The heading stays in the outline, visually
15
+ * hidden: it is the card's name for assistive technology, and item content
16
+ * nests its own headings one level below it.
17
+ */
18
+ export declare function resolveCardTitle(formatter: SectionPlayerCardTitleFormatter | null | undefined, context: SectionPlayerCardTitleContext): ResolvedCardTitle;
@@ -13,4 +13,11 @@ export type SectionPlayerPassageTitleContext = {
13
13
  defaultTitle: string;
14
14
  };
15
15
  export type SectionPlayerCardTitleContext = SectionPlayerItemTitleContext | SectionPlayerPassageTitleContext;
16
- export type SectionPlayerCardTitleFormatter = (context: SectionPlayerCardTitleContext) => string | null | undefined;
16
+ /**
17
+ * A non-empty string becomes the card's title. `{ visible: false }` hides it
18
+ * visually; the heading stays, carrying `defaultTitle`. Anything else, a throw
19
+ * included, keeps `defaultTitle`.
20
+ */
21
+ export type SectionPlayerCardTitleFormatter = (context: SectionPlayerCardTitleContext) => string | {
22
+ visible: false;
23
+ } | null | undefined;