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

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 (202) 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 +256 -0
  7. package/dist/abi/convert.d.ts +126 -0
  8. package/dist/abi/convert.js +493 -0
  9. package/dist/abi/data-api.d.ts +11 -0
  10. package/dist/abi/data-api.js +178 -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 +198 -0
  14. package/dist/abi/page-data.js +577 -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 +237 -0
  72. package/dist/runtime/data/to-ui.js +759 -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 +167 -0
  82. package/dist/runtime/kit/cart.js +544 -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/{types → runtime/kit}/data.d.ts +276 -7
  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/{types → runtime/kit}/storefront.d.ts +206 -7
  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 +44 -0
  144. package/dist/runtime/render/section-actions.js +169 -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 +82 -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 +120 -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 +395 -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/editor.d.ts +0 -5
  200. package/dist/types/index.d.ts +0 -20
  201. package/dist/types/preview-bridge.d.ts +0 -9
  202. package/dist/types/types.d.ts +0 -44
@@ -0,0 +1,273 @@
1
+ import type { Article, Blog, Cart, CartLine, Collection, Facet, Image, Localization, Menu, Money, Policy, Product, ProductVariant, Shop, SortOption } from '../sdk/types.js';
2
+ import { type CartLineRefusal } from '../sdk/runtime-context.js';
3
+ /** The theme's global settings: the manifest defaults with the store's saved values over them. */
4
+ export declare function useSettings(): Readonly<Record<string, unknown>>;
5
+ /** The store as the page shows it: name, logo, contact, social links, payment methods, policies, cookie banner. */
6
+ export declare function useShop(): Shop;
7
+ /** A store menu by handle (a `menu` setting's value), with `active` marking the current route; null when absent. */
8
+ export declare function useMenu(handle: string | null | undefined): Menu | null;
9
+ export interface OptionValueState {
10
+ value: string;
11
+ /** This value is part of the selected variant. */
12
+ selected: boolean;
13
+ /** Some variant with this value and the other selected values can be bought. */
14
+ available: boolean;
15
+ /** The variant this value selects, keeping the other selected values when one exists. */
16
+ variantId: string | null;
17
+ }
18
+ export interface ProductState {
19
+ product: Product | null;
20
+ /** The handle exists but the product is unpublished or deleted. */
21
+ unavailable: boolean;
22
+ /** The selected variant (from `?variant=` on the server, else the first available, else the first). */
23
+ variant: ProductVariant | null;
24
+ options: {
25
+ name: string;
26
+ values: OptionValueState[];
27
+ }[];
28
+ selectOption(name: string, value: string): void;
29
+ selectVariant(variantId: string): void;
30
+ price: Money | null;
31
+ compareAtPrice: Money | null;
32
+ onSale: boolean;
33
+ /** The selected variant can be bought. */
34
+ available: boolean;
35
+ /** Units the shopper can still buy, when the store shares inventory (`data:inventory`); null when unknown. */
36
+ quantityAvailable: number | null;
37
+ /** The selected variant's image, else the product's featured image. */
38
+ image: Image | null;
39
+ quantity: number;
40
+ setQuantity(quantity: number): void;
41
+ }
42
+ /** The variant to open on: `wanted` when it belongs to the product, else the first available, else the first. */
43
+ export declare function initialVariant(product: Product | null | undefined, wanted?: string | null): ProductVariant | null;
44
+ /** The option values of `product` around `selected`: each value's availability and the variant it selects. */
45
+ export declare function optionStates(product: Product | null | undefined, selected: ProductVariant | null): ProductState['options'];
46
+ /** The product state `<ProductForm>` shares with the primitives inside it. */
47
+ export declare const ProductContext: import("react").Context<ProductState | null>;
48
+ /**
49
+ * A product and its variant selection. Without an argument: the product of the enclosing `<ProductForm>`, else
50
+ * the route's product (product pages), opened on the `?variant=` the URL names. With a handle: that product (a
51
+ * `product` setting's value). A product object is used as given. Choosing a variant of the route's product keeps
52
+ * `?variant=` in the address bar, so the link shares.
53
+ */
54
+ export declare function useProduct(input?: string | Product | null): ProductState;
55
+ /** The state behind `useProduct` (`inactive`: another instance owns this product; no URL writes). */
56
+ export declare function useProductState(input: string | Product | null | undefined, inactive?: boolean): ProductState;
57
+ /** The collection sorts the data plane answers (`?sort=`), in the order a sort control offers them. */
58
+ export declare const COLLECTION_SORTS: readonly ["featured", "best-selling", "title-asc", "title-desc", "price-asc", "price-desc", "created-desc", "created-asc"];
59
+ export type CollectionSort = (typeof COLLECTION_SORTS)[number];
60
+ export interface CollectionState {
61
+ collection: Collection | null;
62
+ /** The handle exists but the collection is unpublished or deleted. */
63
+ unavailable: boolean;
64
+ /** The products shown now (sorted and filtered as selected). */
65
+ products: Product[];
66
+ /** Products matching the selection when known (the collection's count, unfiltered), else null. */
67
+ total: number | null;
68
+ status: 'ready' | 'loading' | 'error';
69
+ facets: Facet[];
70
+ /** Facet id → the selected value ids. */
71
+ selected: Readonly<Record<string, readonly string[]>>;
72
+ price: {
73
+ from?: number;
74
+ to?: number;
75
+ } | null;
76
+ filtered: boolean;
77
+ toggleFilter(facetId: string, valueId: string): void;
78
+ setPrice(from?: number, to?: number): void;
79
+ clearFilters(): void;
80
+ sort: CollectionSort;
81
+ sortOptions: SortOption[];
82
+ setSort(sort: string): void;
83
+ /** More products exist past the ones shown. */
84
+ hasMore: boolean;
85
+ loadMore(): void;
86
+ /** The page number of a `?page=N` request (1 otherwise) and the URL of any page, for no-JS paging. */
87
+ page: number;
88
+ pageHref(page: number): string;
89
+ }
90
+ /** The collection state `<CollectionProvider>` shares with the primitives inside it. */
91
+ export declare const CollectionContext: import("react").Context<CollectionState | null>;
92
+ /**
93
+ * A collection with its facets, sort and paging. Inside `<CollectionProvider>` (without an argument, or with its
94
+ * handle) every caller shares that provider's state, so a sort control, the filters and the grid agree.
95
+ * Otherwise, without an argument: the route's collection, whose selection
96
+ * lives in the URL (`?sort=`, `?filter.<facet>=`), so a sorted or filtered page shares and reloads. With a
97
+ * handle: that collection (a `collection` setting's value), selection kept in the component.
98
+ *
99
+ * The first render shows what the server rendered (the data plane applies `?sort=` and `?page=`). A change of
100
+ * selection asks the data plane again through the browser wire, sorted and filtered there.
101
+ */
102
+ export declare function useCollection(handle?: string | null): CollectionState;
103
+ /** The state behind `useCollection` (`inactive`: another instance owns this collection; no requests, no URL writes). */
104
+ export declare function useCollectionState(handle?: string | null, inactive?: boolean): CollectionState;
105
+ export declare const SEARCH_SORT_IDS: readonly ["relevance", "price-asc", "price-desc", "title-asc", "created-desc"];
106
+ export interface SearchState {
107
+ /** The query the page was loaded with (`/search?q=`), '' when none. */
108
+ query: string;
109
+ products: Product[];
110
+ articles: Article[];
111
+ pages: {
112
+ title: string;
113
+ url: string;
114
+ excerpt?: string;
115
+ }[];
116
+ /** All matches; null before a query. */
117
+ total: number | null;
118
+ sort: string;
119
+ sortOptions: SortOption[];
120
+ /** The results URL for a query (and sort). */
121
+ href(query: string, sort?: string): string;
122
+ }
123
+ /** The search page's results (`/search?q=…&sort=…`), rendered by the server. */
124
+ export declare function useSearch(): SearchState;
125
+ export interface PredictiveResults {
126
+ products: {
127
+ handle: string;
128
+ title: string;
129
+ url: string;
130
+ price: Money | null;
131
+ image: Image | null;
132
+ }[];
133
+ collections: {
134
+ handle: string;
135
+ title: string;
136
+ url: string;
137
+ }[];
138
+ queries: string[];
139
+ }
140
+ /**
141
+ * Suggestions while the shopper types (`catalog.predictive` over the browser wire; needs `data:search` in the
142
+ * manifest's browser capabilities). Debounced; an answer for an older query never shows under a newer one.
143
+ * On the server, and for an empty query, `results` is null.
144
+ */
145
+ export declare function usePredictiveSearch(query: string, options?: {
146
+ limit?: number;
147
+ debounceMs?: number;
148
+ }): {
149
+ results: PredictiveResults | null;
150
+ loading: boolean;
151
+ };
152
+ export interface CartStateHeadless {
153
+ cart: Cart | null;
154
+ lines: CartLine[];
155
+ itemCount: number;
156
+ subtotal: Money | null;
157
+ total: Money | null;
158
+ /** Where checkout goes (`Cart.checkoutUrl`). Checkout itself is the platform's. */
159
+ checkoutUrl: string;
160
+ /** The shopper's cart is known (an empty cart is known too). */
161
+ ready: boolean;
162
+ /** A request is in flight. */
163
+ loading: boolean;
164
+ /** Why the cart could not be loaded (a wire code), while `ready` is false. */
165
+ loadError: string | null;
166
+ /** The cart drawer is open. */
167
+ isOpen: boolean;
168
+ /** It was opened by an add, not by the shopper. */
169
+ justAdded: boolean;
170
+ open(): void;
171
+ close(): void;
172
+ /** Resolves true when the line is in the cart; never rejects. Opens the cart on success. */
173
+ add(variantId: string, quantity?: number): Promise<boolean>;
174
+ setQuantity(lineId: string, quantity: number): Promise<void>;
175
+ remove(lineId: string): Promise<void>;
176
+ setNote(note: string): Promise<void>;
177
+ isBusy(lineId: string): boolean;
178
+ hasFailed(lineId: string): boolean;
179
+ /** Why the store refused the line's last change, when it said. */
180
+ refusal(lineId: string): CartLineRefusal | null;
181
+ }
182
+ /** The shopper's cart and every cart action (`/_tq/actions/cart.*`, versioned, conflicts retried by the runtime). */
183
+ export declare function useCart(): CartStateHeadless;
184
+ export interface CustomerState {
185
+ /** Whether the shopper has a customer session (never who); null when this page did not read it. */
186
+ signedIn: boolean | null;
187
+ /** The platform's account area for `<AccountSlot>` (customer route only), else null. */
188
+ accountUrl: string | null;
189
+ /** Where an account link goes. */
190
+ accountHref: string;
191
+ }
192
+ /**
193
+ * The shopper's account state. Customer data never reaches theme code: the account area is the platform's
194
+ * iframe (`<AccountSlot>`). `signedIn` is read only when the page asks for it (a `header` section, or
195
+ * `storefront.plan.account`), because the page then varies on it.
196
+ */
197
+ export declare function useCustomer(): CustomerState;
198
+ export interface CountryChoice {
199
+ code: string;
200
+ name: string;
201
+ currencyCode: string;
202
+ currencySymbol: string;
203
+ current: boolean;
204
+ }
205
+ export interface LanguageChoice {
206
+ code: string;
207
+ /** The language's own name (English, ไทย, 日本語). */
208
+ name: string;
209
+ current: boolean;
210
+ }
211
+ export interface LocalizationState {
212
+ localization: Localization | null;
213
+ country: CountryChoice | null;
214
+ language: LanguageChoice;
215
+ /** The store's countries (each with its market currency). Empty unless the page reads the shopper's country. */
216
+ countries: CountryChoice[];
217
+ /** The store's published languages. */
218
+ languages: LanguageChoice[];
219
+ /** Load this page for another country (prices follow its market) or language. */
220
+ changeCountry(code: string): void;
221
+ changeLanguage(code: string): void;
222
+ /** A link to this page in another country and/or language. */
223
+ href(next: {
224
+ country?: string;
225
+ language?: string;
226
+ }): string;
227
+ }
228
+ /**
229
+ * The shopper's market and language, and the switch between them (`?country=`, `?locale=`; the platform
230
+ * remembers both). The country list exists only on a page that reads the shopper's country: a `header`/`footer`
231
+ * section with `showLocale`, or `storefront.plan.localization`.
232
+ */
233
+ export declare function useLocalization(): LocalizationState;
234
+ /**
235
+ * Products recommended with the route's product (`catalog.recommendations`). In the server render when the page
236
+ * asks for them (a `product-recommendations` section, or `storefront.plan.recommendations`); otherwise loaded by
237
+ * the browser after the page shows, which needs `data:products.recommendations` in the browser capabilities.
238
+ */
239
+ export declare function useRecommendations(): {
240
+ products: Product[];
241
+ loading: boolean;
242
+ };
243
+ export interface ConsentState {
244
+ /** The platform says a banner is needed and the shopper has not answered (never on a preview render). */
245
+ required: boolean;
246
+ accept(): void;
247
+ reject(): void;
248
+ decide(choice: {
249
+ analytics: boolean;
250
+ marketing: boolean;
251
+ }): void;
252
+ /** Show the banner again so the shopper can change an earlier answer (a footer "Cookie settings" link). */
253
+ reopen(): void;
254
+ /** The merchant's privacy link, else the published privacy policy, else null. */
255
+ privacyUrl: string | null;
256
+ /** The merchant's own banner wording (Settings › Customer privacy), when typed. */
257
+ text: Partial<Record<'title' | 'body' | 'privacyLinkLabel' | 'acceptLabel' | 'declineLabel', string>>;
258
+ }
259
+ /** The cookie banner's state and the shopper's answer (`/_tq/actions/consent.set`). The platform owns consent. */
260
+ export declare function useConsent(): ConsentState;
261
+ /** The route's content page (`/pages/<handle>`): its title and HTML body; null elsewhere or when the store has none. */
262
+ export declare function usePageContent(): {
263
+ title: string;
264
+ html: string;
265
+ } | null;
266
+ /** A blog with its articles: the route's (`/blogs/<handle>`, and an article's blog), or the one a `blog` setting names. */
267
+ export declare function useBlog(handle?: string | null): Blog | null;
268
+ /** The route's article (`/blogs/<blog>/<handle>`) with its HTML body; null elsewhere. */
269
+ export declare function useArticle(): (Article & {
270
+ contentHtml?: string;
271
+ }) | null;
272
+ /** The route's store policy (`/policies/<handle>`); null elsewhere or when it is not published. */
273
+ export declare function usePolicy(): Policy | null;