@tanqory/theme-kit 0.1.0 → 2.0.0-alpha.5

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 (204) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -10
  3. package/dist/abi/canvas-live.d.ts +49 -0
  4. package/dist/abi/canvas-live.js +88 -0
  5. package/dist/abi/cart.d.ts +48 -0
  6. package/dist/abi/cart.js +321 -0
  7. package/dist/abi/convert.d.ts +192 -0
  8. package/dist/abi/convert.js +670 -0
  9. package/dist/abi/data-api.d.ts +15 -0
  10. package/dist/abi/data-api.js +198 -0
  11. package/dist/abi/jcs.d.ts +6 -0
  12. package/dist/abi/jcs.js +28 -0
  13. package/dist/abi/page-data.d.ts +209 -0
  14. package/dist/abi/page-data.js +583 -0
  15. package/dist/abi/page.d.ts +23 -0
  16. package/dist/abi/page.js +46 -0
  17. package/dist/abi/referrals.d.ts +23 -0
  18. package/dist/abi/referrals.js +89 -0
  19. package/dist/abi/rewards.d.ts +27 -0
  20. package/dist/abi/rewards.js +82 -0
  21. package/dist/abi/seo.d.ts +47 -0
  22. package/dist/abi/seo.js +68 -0
  23. package/dist/abi/shell.d.ts +22 -0
  24. package/dist/abi/shell.js +10 -0
  25. package/dist/abi/wire.d.ts +38 -0
  26. package/dist/abi/wire.js +84 -0
  27. package/dist/build.d.ts +113 -0
  28. package/dist/build.js +294 -0
  29. package/dist/client.d.ts +19 -0
  30. package/dist/client.js +76 -0
  31. package/dist/contract.d.ts +6 -0
  32. package/dist/contract.js +6 -0
  33. package/dist/headless/ai.d.ts +132 -0
  34. package/dist/headless/ai.js +99 -0
  35. package/dist/headless/hooks.d.ts +273 -0
  36. package/dist/headless/hooks.js +533 -0
  37. package/dist/headless/i18n.d.ts +13 -0
  38. package/dist/headless/i18n.js +45 -0
  39. package/dist/headless/index.d.ts +36 -0
  40. package/dist/headless/index.js +38 -0
  41. package/dist/headless/money.d.ts +25 -0
  42. package/dist/headless/money.js +61 -0
  43. package/dist/headless/page.d.ts +43 -0
  44. package/dist/headless/page.js +53 -0
  45. package/dist/headless/platform.d.ts +55 -0
  46. package/dist/headless/platform.js +77 -0
  47. package/dist/headless/primitives/cart.d.ts +90 -0
  48. package/dist/headless/primitives/cart.js +153 -0
  49. package/dist/headless/primitives/collection.d.ts +68 -0
  50. package/dist/headless/primitives/collection.js +80 -0
  51. package/dist/headless/primitives/product.d.ts +101 -0
  52. package/dist/headless/primitives/product.js +117 -0
  53. package/dist/headless/primitives/storefront.d.ts +106 -0
  54. package/dist/headless/primitives/storefront.js +186 -0
  55. package/dist/headless/primitives/util.d.ts +19 -0
  56. package/dist/headless/primitives/util.js +42 -0
  57. package/dist/headless/strings.d.ts +9 -0
  58. package/dist/headless/strings.js +186 -0
  59. package/dist/headless/structured-data.d.ts +31 -0
  60. package/dist/headless/structured-data.js +57 -0
  61. package/dist/headless/theme.d.ts +99 -0
  62. package/dist/headless/theme.js +54 -0
  63. package/dist/index.d.ts +20 -0
  64. package/dist/index.js +18 -553
  65. package/dist/runtime/data/StoreProvider.d.ts +56 -0
  66. package/dist/runtime/data/StoreProvider.js +308 -0
  67. package/dist/runtime/data/handle.d.ts +14 -0
  68. package/dist/runtime/data/handle.js +16 -0
  69. package/dist/runtime/data/routes.d.ts +87 -0
  70. package/dist/runtime/data/routes.js +154 -0
  71. package/dist/runtime/data/to-ui.d.ts +258 -0
  72. package/dist/runtime/data/to-ui.js +820 -0
  73. package/dist/runtime/entries/register.d.ts +9 -0
  74. package/dist/runtime/entries/register.js +9 -0
  75. package/dist/runtime/entries/sections.d.ts +16 -0
  76. package/dist/runtime/entries/sections.js +19 -0
  77. package/dist/{types → runtime/kit}/SectionTree.d.ts +2 -1
  78. package/dist/runtime/kit/SectionTree.js +100 -0
  79. package/dist/runtime/kit/analytics.d.ts +63 -0
  80. package/dist/runtime/kit/analytics.js +233 -0
  81. package/dist/runtime/kit/cart.d.ts +186 -0
  82. package/dist/runtime/kit/cart.js +545 -0
  83. package/dist/{types → runtime/kit}/composition.d.ts +1 -1
  84. package/dist/runtime/kit/composition.js +3 -0
  85. package/dist/{types → runtime/kit}/config.d.ts +2 -2
  86. package/dist/runtime/kit/config.js +6 -0
  87. package/dist/runtime/kit/consent.d.ts +29 -0
  88. package/dist/runtime/kit/consent.js +159 -0
  89. package/dist/runtime/kit/contract/content.d.ts +164 -0
  90. package/dist/runtime/kit/contract/content.js +83 -0
  91. package/dist/runtime/kit/contract/field-types.d.ts +290 -0
  92. package/dist/runtime/kit/contract/field-types.js +129 -0
  93. package/dist/runtime/kit/contract/groups.d.ts +230 -0
  94. package/dist/runtime/kit/contract/groups.js +402 -0
  95. package/dist/runtime/kit/contract/index.d.ts +33 -0
  96. package/dist/runtime/kit/contract/index.js +33 -0
  97. package/dist/runtime/kit/contract/transform.d.ts +82 -0
  98. package/dist/runtime/kit/contract/transform.js +133 -0
  99. package/dist/runtime/kit/contract/validate.d.ts +67 -0
  100. package/dist/runtime/kit/contract/validate.js +388 -0
  101. package/dist/runtime/kit/data.d.ts +636 -0
  102. package/dist/runtime/kit/data.js +1117 -0
  103. package/dist/{types → runtime/kit}/defineSection.d.ts +1 -1
  104. package/dist/runtime/kit/defineSection.js +10 -0
  105. package/dist/{types → runtime/kit}/dynamic-source.d.ts +4 -4
  106. package/dist/runtime/kit/dynamic-source.js +143 -0
  107. package/dist/runtime/kit/index.d.ts +24 -0
  108. package/dist/runtime/kit/index.js +24 -0
  109. package/dist/{types → runtime/kit}/jsx-to-json.d.ts +1 -1
  110. package/dist/runtime/kit/jsx-to-json.js +28 -0
  111. package/dist/{types → runtime/kit}/mount.d.ts +25 -4
  112. package/dist/runtime/kit/mount.js +124 -0
  113. package/dist/{types → runtime/kit}/registry.d.ts +1 -1
  114. package/dist/runtime/kit/registry.js +12 -0
  115. package/dist/{types → runtime/kit}/ssg.d.ts +9 -3
  116. package/dist/runtime/kit/ssg.js +56 -0
  117. package/dist/runtime/kit/storefront.d.ts +566 -0
  118. package/dist/runtime/kit/storefront.js +723 -0
  119. package/dist/{types → runtime/kit}/theme-context.d.ts +8 -2
  120. package/dist/runtime/kit/theme-context.js +25 -0
  121. package/dist/runtime/kit/types.d.ts +142 -0
  122. package/dist/runtime/kit/types.js +1 -0
  123. package/dist/runtime/platform/TrackingPixels.d.ts +14 -0
  124. package/dist/runtime/platform/TrackingPixels.js +63 -0
  125. package/dist/runtime/platform/environment.d.ts +68 -0
  126. package/dist/runtime/platform/environment.js +85 -0
  127. package/dist/runtime/platform/locale.d.ts +27 -0
  128. package/dist/runtime/platform/locale.js +42 -0
  129. package/dist/runtime/platform/route-analytics.d.ts +15 -0
  130. package/dist/runtime/platform/route-analytics.js +72 -0
  131. package/dist/runtime/platform/safe-href.d.ts +25 -0
  132. package/dist/runtime/platform/safe-href.js +69 -0
  133. package/dist/runtime/platform/safe-values.d.ts +37 -0
  134. package/dist/runtime/platform/safe-values.js +140 -0
  135. package/dist/runtime/render/SectionRenderer.d.ts +4 -0
  136. package/dist/runtime/render/SectionRenderer.js +111 -0
  137. package/dist/runtime/render/listing-query.d.ts +47 -0
  138. package/dist/runtime/render/listing-query.js +114 -0
  139. package/dist/runtime/render/localized-copy.d.ts +86 -0
  140. package/dist/runtime/render/localized-copy.js +129 -0
  141. package/dist/runtime/render/product-listing.d.ts +11 -0
  142. package/dist/runtime/render/product-listing.js +240 -0
  143. package/dist/runtime/render/section-actions.d.ts +48 -0
  144. package/dist/runtime/render/section-actions.js +170 -0
  145. package/dist/runtime/render/starter.d.ts +11 -0
  146. package/dist/runtime/render/starter.js +81 -0
  147. package/dist/runtime/seo/head.d.ts +87 -0
  148. package/dist/runtime/seo/head.js +224 -0
  149. package/dist/runtime/seo/structured-data.d.ts +22 -0
  150. package/dist/runtime/seo/structured-data.js +115 -0
  151. package/dist/runtime/shell/PageShell.d.ts +18 -0
  152. package/dist/runtime/shell/PageShell.js +113 -0
  153. package/dist/runtime/shell/RuntimeBridge.d.ts +14 -0
  154. package/dist/runtime/shell/RuntimeBridge.js +85 -0
  155. package/dist/runtime/shell/overlay-state.d.ts +31 -0
  156. package/dist/runtime/shell/overlay-state.js +59 -0
  157. package/dist/runtime/shell/preview-mode.d.ts +2 -0
  158. package/dist/runtime/shell/preview-mode.js +11 -0
  159. package/dist/runtime/shell/spa-router.d.ts +14 -0
  160. package/dist/runtime/shell/spa-router.js +76 -0
  161. package/dist/runtime/shell/url-redirects.d.ts +6 -0
  162. package/dist/runtime/shell/url-redirects.js +37 -0
  163. package/dist/runtime/slots.d.ts +74 -0
  164. package/dist/runtime/slots.js +16 -0
  165. package/dist/runtime.d.ts +34 -0
  166. package/dist/runtime.js +40 -0
  167. package/dist/sdk/index.d.ts +24 -0
  168. package/dist/sdk/index.js +24 -0
  169. package/dist/sdk/referrals.d.ts +62 -0
  170. package/dist/sdk/referrals.js +20 -0
  171. package/dist/sdk/rewards.d.ts +85 -0
  172. package/dist/sdk/rewards.js +29 -0
  173. package/dist/sdk/runtime-context.d.ts +135 -0
  174. package/dist/sdk/runtime-context.js +73 -0
  175. package/dist/sdk/schema.d.ts +197 -0
  176. package/dist/sdk/schema.js +121 -0
  177. package/dist/sdk/server-render.d.ts +8 -0
  178. package/dist/sdk/server-render.js +12 -0
  179. package/dist/sdk/store-lookup.d.ts +27 -0
  180. package/dist/sdk/store-lookup.js +29 -0
  181. package/dist/sdk/store.d.ts +115 -0
  182. package/dist/sdk/store.js +1 -0
  183. package/dist/sdk/sx.d.ts +40 -0
  184. package/dist/sdk/sx.js +112 -0
  185. package/dist/sdk/theme.d.ts +152 -0
  186. package/dist/sdk/theme.js +10 -0
  187. package/dist/sdk/types.d.ts +470 -0
  188. package/dist/sdk/types.js +7 -0
  189. package/dist/server.d.ts +65 -0
  190. package/dist/server.js +370 -0
  191. package/docs/headless-api.md +220 -0
  192. package/package.json +77 -23
  193. package/dist/index.js.map +0 -1
  194. package/dist/ssg-BZ5FYTw7.js +0 -1802
  195. package/dist/ssg-BZ5FYTw7.js.map +0 -1
  196. package/dist/ssg.js +0 -8
  197. package/dist/ssg.js.map +0 -1
  198. package/dist/types/cart.d.ts +0 -86
  199. package/dist/types/data.d.ts +0 -357
  200. package/dist/types/editor.d.ts +0 -5
  201. package/dist/types/index.d.ts +0 -20
  202. package/dist/types/preview-bridge.d.ts +0 -9
  203. package/dist/types/storefront.d.ts +0 -333
  204. package/dist/types/types.d.ts +0 -44
@@ -0,0 +1,258 @@
1
+ /**
2
+ * Runtime shapes → UI shapes.
3
+ *
4
+ * app/platform/tanqory (DataApi · storefront · cart) ──► to-ui.ts ──► ui/types
5
+ *
6
+ * Every function here is PURE and TOTAL: no fetching, no globals, no throwing on
7
+ * a missing optional field. The runtime's payloads are partial by design — a
8
+ * card listing has no variants, the offline fixture has no ids or image
9
+ * dimensions, an older payload has no languages — so every read is guarded.
10
+ *
11
+ * Two rules decide what an absent value becomes:
12
+ * - A UI field that is optional (or nullable) stays undefined / null.
13
+ * - A UI field that is required gets the documented empty value ('' / [] / 0),
14
+ * never a made-up one. Nothing here invents a price, stock level, rating,
15
+ * review, badge or policy text.
16
+ *
17
+ * Money keeps the precision the backend sent: the runtime carries decimal
18
+ * strings ("5000" for JPY, "8.750" for KWD); the UI carries numbers and lets
19
+ * Intl pick the decimals when it formats. Nothing here rounds.
20
+ */
21
+ import type * as R from '../kit/data.js';
22
+ import type * as S from '../kit/storefront.js';
23
+ import type * as C from '../kit/cart.js';
24
+ import type * as UI from '../../sdk/index.js';
25
+ export declare const productUrl: (handle: string) => string;
26
+ export declare const collectionUrl: (handle: string) => string;
27
+ export declare const pageUrl: (handle: string) => string;
28
+ export declare const blogUrl: (handle: string) => string;
29
+ export declare const articleUrl: (blogHandle: string, articleHandle: string) => string;
30
+ export declare const policyUrl: (handle: string) => string;
31
+ type ImageLike = {
32
+ url?: string | null;
33
+ altText?: string | null;
34
+ width?: number | null;
35
+ height?: number | null;
36
+ } | null | undefined;
37
+ /**
38
+ * A runtime image → Image, or null when there is no URL.
39
+ *
40
+ * `width`/`height` are required by the UI type but optional in the runtime (the
41
+ * offline fixture, collection images, article images and the theme logo setting
42
+ * carry none). An unknown dimension is `0` — "unknown", never a guessed size.
43
+ * UI images are CSS-sized (`width:100%; height:100%; object-fit`), and a
44
+ * `0 / 0` aspect-ratio is invalid CSS, so the frame keeps its own ratio.
45
+ */
46
+ export declare function toImage(img: ImageLike): UI.Image | null;
47
+ /** Decimal string → number, keeping every digit the source sent. null when absent or not a number. */
48
+ export declare function toMoney(m: {
49
+ amount?: string | number | null;
50
+ currencyCode?: string | null;
51
+ } | null | undefined): UI.Money | null;
52
+ /**
53
+ * A runtime variant → ProductVariant.
54
+ *
55
+ * `quantityAvailable` is the on-hand count only when it LIMITS a purchase:
56
+ * `inventoryPolicy: CONTINUE` sells past zero, so there is no cap, and a
57
+ * negative count under DENY means nothing is purchasable (0). Unknown — no
58
+ * count, or a count that does not limit — is an ABSENT key, never 0 or null.
59
+ */
60
+ export declare function toVariant(v: R.ProductVariant, fallbackCurrency?: string): UI.ProductVariant;
61
+ /**
62
+ * A runtime product → Product.
63
+ *
64
+ * The runtime has two product shapes: the CARD (bootstrap, collection pages,
65
+ * search, recommendations) with one price, one compare-at and no variants; and
66
+ * the DETAIL (`fetchProduct`) with options + variants. Ranges come from the
67
+ * variants when they are there. On a card the runtime knows only the minimum
68
+ * price and the maximum compare-at, so both ends of each range are that one
69
+ * value — see the data-gap notes in the report.
70
+ */
71
+ export declare function toProduct(p: R.Product): UI.Product;
72
+ export declare const toProducts: (list: readonly R.Product[] | null | undefined) => UI.Product[];
73
+ /** Products by handle, for StoreContext.products. */
74
+ export declare function toProductMap(list: readonly R.Product[] | null | undefined): Record<string, UI.Product>;
75
+ /**
76
+ * A runtime collection → Collection.
77
+ *
78
+ * `products`: pass the live page (`collectionProducts(...).products`) when you
79
+ * have it. Otherwise the bootstrap cache is used ONLY when it actually has
80
+ * products — an empty cached list can be a shell baked before products were
81
+ * assigned, so it maps to `products: undefined` ("not loaded"), not "empty".
82
+ * Pass `products: []` to state that the collection is known to be empty.
83
+ */
84
+ export declare function toCollection(c: R.Collection, opts?: {
85
+ products?: readonly R.Product[] | null;
86
+ }): UI.Collection;
87
+ /** Collections by handle, for StoreContext.collections (card-level: no product lists). */
88
+ export declare function toCollectionMap(list: readonly R.Collection[] | null | undefined, opts?: {
89
+ withProducts?: boolean;
90
+ }): Record<string, UI.Collection>;
91
+ export interface MenuOptions {
92
+ /** The current pathname — marks the matching item at each level `active`. */
93
+ currentPath?: string;
94
+ /** Hosts that ARE this store (e.g. `shop.primaryDomain.host`); their absolute URLs become paths. */
95
+ storeHosts?: readonly string[];
96
+ }
97
+ /**
98
+ * A menu URL the theme can render, or null.
99
+ *
100
+ * Unsafe schemes are dropped (app/platform/safe-href). A menu item that points at one of
101
+ * the store's own resources (any type but HTTP) — or at one of `storeHosts` —
102
+ * may still arrive as an absolute store URL; it becomes a same-origin path so
103
+ * soft navigation and the active rule both work. A genuine external HTTP link
104
+ * is kept absolute.
105
+ */
106
+ export declare function toMenuHref(url: string | null | undefined, type?: S.MenuItemType | string | null, storeHosts?: readonly string[]): string | null;
107
+ /** A runtime menu → Menu (recursive, every level). null when there is no menu. */
108
+ export declare function toMenu(menu: S.Menu | null | undefined, opts?: MenuOptions): UI.Menu | null;
109
+ /** Menus by handle, for StoreContext.menus. Missing menus are left out. */
110
+ export declare function toMenuMap(menus: ReadonlyArray<S.Menu | null | undefined>, opts?: MenuOptions): Record<string, UI.Menu>;
111
+ export declare function toPaymentMethods(settings: S.Shop['paymentSettings'] | null | undefined): UI.PaymentMethod[];
112
+ /**
113
+ * Settings → Social → the design's drawn networks (`social`) and the rest (`otherSocial`, generic
114
+ * link mark). Only https: URLs; one link per network, the first wins. Empty → both absent.
115
+ */
116
+ export declare function toSocial(links: S.Shop['socialLinks']): Pick<UI.Shop, 'social' | 'otherSocial'>;
117
+ /**
118
+ * The shop + the theme's Brand settings → Shop.
119
+ *
120
+ * Name: the store name (Settings › General), else the theme's `shopName` setting
121
+ * (a fallback only — D-13). Logo: the theme's
122
+ * `logo` setting, else Settings → Brand (the same precedence as
123
+ * app/platform/safe-values `resolveLogo`, which this reuses).
124
+ */
125
+ /**
126
+ * The product's gallery with its hosted videos (Theme ABI `Product.media`, storefront-query rev 2.34). Only `image` and
127
+ * `video` items with a playable source map; YouTube / Vimeo / 3D never do (the storefront plays no third-party
128
+ * player). No video left ⇒ absent, and the gallery stays `images`.
129
+ */
130
+ export declare function toProductMedia(list: R.Product['media'] | null | undefined): {
131
+ media?: UI.ProductMediaItem[];
132
+ };
133
+ /** A merchant-published postal address → display lines: street (address1, address2), "city province zip", country. */
134
+ export declare function addressLines(a: {
135
+ address1?: string;
136
+ address2?: string;
137
+ city?: string;
138
+ province?: string;
139
+ zip?: string;
140
+ country?: string;
141
+ countryCode?: string;
142
+ } | null | undefined): string[];
143
+ export declare function toShop(shop: S.Shop | null | undefined, settings?: {
144
+ shopName?: string;
145
+ logo?: string;
146
+ }): UI.Shop;
147
+ /**
148
+ * Localization → Localization, or null (no Markets: the picker hides).
149
+ *
150
+ * The runtime publishes countries and languages as two independent lists —
151
+ * every published language is available in every country — so `available` is
152
+ * their product. `current` is always included in `available`.
153
+ */
154
+ export declare function toLocalization(loc: R.Localization | null | undefined): UI.Localization | null;
155
+ export declare function toCartSummary(cart: Pick<C.CartState, 'lines' | 'totalQuantity'> | null | undefined): UI.CartSummary;
156
+ /**
157
+ * One cart line → CartLine.
158
+ *
159
+ * A line carries id + title + image + price, its product as handle + title, and
160
+ * — when the cart source sends the whole variant (Theme ABI v2) — its options,
161
+ * compare-at and availability. No vendor and no stock. `variant.available` is
162
+ * true unless the source says otherwise: the backend accepted the line, and it
163
+ * refuses unpurchasable merchandise at add/update time.
164
+ */
165
+ export declare function toCartLine(line: C.CartLine): UI.CartLine;
166
+ /**
167
+ * The full cart (cart page). `discounts` is left out: the runtime keeps no per-code amount. The order-level
168
+ * discount is `discountTotal` (from the cart's own totals) and, when the host names them, `discountAllocations`.
169
+ */
170
+ export declare function toCart(cart: C.CartState | null | undefined): UI.Cart;
171
+ /** A page → the UI's page-body shape (StoreContext.currentPage / pages). */
172
+ export declare function toPage(page: R.Page | null | undefined): {
173
+ title: string;
174
+ html: string;
175
+ } | null;
176
+ /**
177
+ * An article → Article, or null when its blog is unknown (no URL can be built —
178
+ * search results arrive without one). Pass the blog handle when the caller
179
+ * knows it.
180
+ */
181
+ export declare function toArticle(a: S.Article | null | undefined, blogHandle?: string): UI.Article | null;
182
+ export declare function toBlog(blog: S.Blog | null | undefined): UI.Blog | null;
183
+ /**
184
+ * A shop policy → Policy. The URL is the theme's own policy route (the runtime's
185
+ * `url` may be absolute). `bodyHtml` is '' when the payload carries no body.
186
+ */
187
+ export declare function toPolicy(p: S.ShopPolicy | null | undefined): UI.Policy | null;
188
+ /** Every published policy by handle, for StoreContext.policies. */
189
+ export declare function toPolicies(shop: S.Shop | null | undefined): Record<string, UI.Policy>;
190
+ type RuntimeLocation = NonNullable<Awaited<ReturnType<NonNullable<R.DataApi['locations']>>>>[number];
191
+ /** Store locations. The platform returns a postal address only — no hours, email, image or coordinates. */
192
+ export declare function toLocations(list: readonly RuntimeLocation[] | null | undefined): UI.StoreLocation[];
193
+ /**
194
+ * Search → SearchResults. `total` is the backend's count across every type.
195
+ * Articles whose blog is unknown are left out (see toArticle).
196
+ */
197
+ export declare function toSearchResults(query: string, r: S.SearchResults | null | undefined): UI.SearchResults;
198
+ /**
199
+ * Listing filters → Facets. List filters map value-for-value; `active` is set
200
+ * for the values whose `input` the shopper has applied. A PRICE_RANGE filter
201
+ * becomes a price facet only when its input carries the store's bounds and a
202
+ * currency is known.
203
+ */
204
+ export declare function toFacets(filters: readonly S.Filter[] | null | undefined, opts?: {
205
+ activeInputs?: readonly string[];
206
+ currencyCode?: string;
207
+ }): UI.Facet[];
208
+ export interface BreadcrumbInput {
209
+ pathname: string;
210
+ /** Interface words, already translated by the caller. Without `home` there is no trail. */
211
+ labels: {
212
+ home: string;
213
+ collections?: string;
214
+ search?: string;
215
+ cart?: string;
216
+ account?: string;
217
+ };
218
+ /** The route's collection — or, on a product page, the collection the shopper came from. */
219
+ collection?: {
220
+ handle: string;
221
+ title: string;
222
+ } | null;
223
+ product?: {
224
+ title: string;
225
+ } | null;
226
+ page?: {
227
+ title: string;
228
+ } | null;
229
+ blog?: {
230
+ title: string;
231
+ } | null;
232
+ article?: {
233
+ title: string;
234
+ } | null;
235
+ policy?: {
236
+ title: string;
237
+ } | null;
238
+ }
239
+ /**
240
+ * The trail for a route. The last item is the current page and carries no URL.
241
+ * A route whose own title is unknown returns [] rather than a trail that ends
242
+ * on a link — the breadcrumbs section then renders nothing.
243
+ */
244
+ export declare function toBreadcrumbs(input: BreadcrumbInput): UI.BreadcrumbItem[];
245
+ /**
246
+ * Whether the cookie banner shows to a shopper who has not decided yet (Settings › Customer privacy,
247
+ * contract rev 2): the platform's legal floor first (EEA, UK, unknown location — or a platform that
248
+ * does not say), then the merchant's switch — everywhere with "Use automated settings", else only in
249
+ * the regions the merchant chose. No merchant config (older data) = shown, as before.
250
+ */
251
+ export declare function consentBannerShows(readout: {
252
+ regionRequiresBanner?: boolean;
253
+ geo?: {
254
+ country?: string;
255
+ region?: string;
256
+ };
257
+ }, banner: S.ConsentBannerConfig | null | undefined): boolean;
258
+ export {};