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

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 (233) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -10
  3. package/dist/abi/canvas-live.d.ts +72 -0
  4. package/dist/abi/canvas-live.js +159 -0
  5. package/dist/abi/cart.d.ts +60 -0
  6. package/dist/abi/cart.js +396 -0
  7. package/dist/abi/convert.d.ts +360 -0
  8. package/dist/abi/convert.js +1330 -0
  9. package/dist/abi/data-api.d.ts +15 -0
  10. package/dist/abi/data-api.js +213 -0
  11. package/dist/abi/jcs.d.ts +6 -0
  12. package/dist/abi/jcs.js +28 -0
  13. package/dist/abi/labels.d.ts +3 -0
  14. package/dist/abi/labels.js +34 -0
  15. package/dist/abi/page-data.d.ts +264 -0
  16. package/dist/abi/page-data.js +746 -0
  17. package/dist/abi/page.d.ts +28 -0
  18. package/dist/abi/page.js +57 -0
  19. package/dist/abi/referrals.d.ts +23 -0
  20. package/dist/abi/referrals.js +89 -0
  21. package/dist/abi/rewards.d.ts +27 -0
  22. package/dist/abi/rewards.js +82 -0
  23. package/dist/abi/seo.d.ts +47 -0
  24. package/dist/abi/seo.js +68 -0
  25. package/dist/abi/shell.d.ts +23 -0
  26. package/dist/abi/shell.js +10 -0
  27. package/dist/abi/state-pack.d.ts +17 -0
  28. package/dist/abi/state-pack.js +43 -0
  29. package/dist/abi/wire.d.ts +46 -0
  30. package/dist/abi/wire.js +114 -0
  31. package/dist/build.d.ts +121 -0
  32. package/dist/build.js +401 -0
  33. package/dist/chunks.d.ts +23 -0
  34. package/dist/chunks.js +41 -0
  35. package/dist/client.d.ts +26 -0
  36. package/dist/client.js +101 -0
  37. package/dist/contract.d.ts +6 -0
  38. package/dist/contract.js +6 -0
  39. package/dist/headless/ai.d.ts +132 -0
  40. package/dist/headless/ai.js +99 -0
  41. package/dist/headless/hooks.d.ts +276 -0
  42. package/dist/headless/hooks.js +544 -0
  43. package/dist/headless/i18n.d.ts +13 -0
  44. package/dist/headless/i18n.js +45 -0
  45. package/dist/headless/index.d.ts +44 -0
  46. package/dist/headless/index.js +48 -0
  47. package/dist/headless/lazy-component.d.ts +72 -0
  48. package/dist/headless/lazy-component.js +225 -0
  49. package/dist/headless/lazy-section.d.ts +38 -0
  50. package/dist/headless/lazy-section.js +97 -0
  51. package/dist/headless/model.d.ts +73 -0
  52. package/dist/headless/model.js +115 -0
  53. package/dist/headless/money.d.ts +17 -0
  54. package/dist/headless/money.js +63 -0
  55. package/dist/headless/page.d.ts +45 -0
  56. package/dist/headless/page.js +53 -0
  57. package/dist/headless/platform.d.ts +55 -0
  58. package/dist/headless/platform.js +77 -0
  59. package/dist/headless/primitives/cart.d.ts +90 -0
  60. package/dist/headless/primitives/cart.js +153 -0
  61. package/dist/headless/primitives/collection.d.ts +68 -0
  62. package/dist/headless/primitives/collection.js +80 -0
  63. package/dist/headless/primitives/product.d.ts +101 -0
  64. package/dist/headless/primitives/product.js +117 -0
  65. package/dist/headless/primitives/storefront.d.ts +106 -0
  66. package/dist/headless/primitives/storefront.js +187 -0
  67. package/dist/headless/primitives/util.d.ts +19 -0
  68. package/dist/headless/primitives/util.js +42 -0
  69. package/dist/headless/strings.d.ts +9 -0
  70. package/dist/headless/strings.js +198 -0
  71. package/dist/headless/structured-data.d.ts +31 -0
  72. package/dist/headless/structured-data.js +57 -0
  73. package/dist/headless/tanqory-money.generated.d.ts +493 -0
  74. package/dist/headless/tanqory-money.generated.js +507 -0
  75. package/dist/headless/theme.d.ts +109 -0
  76. package/dist/headless/theme.js +62 -0
  77. package/dist/index.d.ts +21 -0
  78. package/dist/index.js +21 -553
  79. package/dist/runtime/data/StoreProvider.d.ts +84 -0
  80. package/dist/runtime/data/StoreProvider.js +380 -0
  81. package/dist/runtime/data/handle.d.ts +14 -0
  82. package/dist/runtime/data/handle.js +16 -0
  83. package/dist/runtime/data/routes.d.ts +87 -0
  84. package/dist/runtime/data/routes.js +158 -0
  85. package/dist/runtime/data/to-ui.d.ts +286 -0
  86. package/dist/runtime/data/to-ui.js +1009 -0
  87. package/dist/runtime/entries/register.d.ts +9 -0
  88. package/dist/runtime/entries/register.js +9 -0
  89. package/dist/runtime/entries/sections.d.ts +16 -0
  90. package/dist/runtime/entries/sections.js +19 -0
  91. package/dist/{types → runtime/kit}/SectionTree.d.ts +2 -1
  92. package/dist/runtime/kit/SectionTree.js +100 -0
  93. package/dist/runtime/kit/analytics.d.ts +63 -0
  94. package/dist/runtime/kit/analytics.js +250 -0
  95. package/dist/runtime/kit/cart.d.ts +222 -0
  96. package/dist/runtime/kit/cart.js +545 -0
  97. package/dist/{types → runtime/kit}/composition.d.ts +1 -1
  98. package/dist/runtime/kit/composition.js +3 -0
  99. package/dist/{types → runtime/kit}/config.d.ts +2 -2
  100. package/dist/runtime/kit/config.js +6 -0
  101. package/dist/runtime/kit/consent.d.ts +29 -0
  102. package/dist/runtime/kit/consent.js +159 -0
  103. package/dist/runtime/kit/contract/content.d.ts +213 -0
  104. package/dist/runtime/kit/contract/content.js +119 -0
  105. package/dist/runtime/kit/contract/field-types.d.ts +360 -0
  106. package/dist/runtime/kit/contract/field-types.js +216 -0
  107. package/dist/runtime/kit/contract/groups.d.ts +230 -0
  108. package/dist/runtime/kit/contract/groups.js +402 -0
  109. package/dist/runtime/kit/contract/index.d.ts +33 -0
  110. package/dist/runtime/kit/contract/index.js +33 -0
  111. package/dist/runtime/kit/contract/transform.d.ts +82 -0
  112. package/dist/runtime/kit/contract/transform.js +133 -0
  113. package/dist/runtime/kit/contract/validate.d.ts +77 -0
  114. package/dist/runtime/kit/contract/validate.js +520 -0
  115. package/dist/runtime/kit/data.d.ts +732 -0
  116. package/dist/runtime/kit/data.js +1131 -0
  117. package/dist/{types → runtime/kit}/defineSection.d.ts +1 -1
  118. package/dist/runtime/kit/defineSection.js +10 -0
  119. package/dist/runtime/kit/dynamic-source.d.ts +118 -0
  120. package/dist/runtime/kit/dynamic-source.js +311 -0
  121. package/dist/runtime/kit/index.d.ts +24 -0
  122. package/dist/runtime/kit/index.js +24 -0
  123. package/dist/{types → runtime/kit}/jsx-to-json.d.ts +1 -1
  124. package/dist/runtime/kit/jsx-to-json.js +28 -0
  125. package/dist/{types → runtime/kit}/mount.d.ts +25 -4
  126. package/dist/runtime/kit/mount.js +124 -0
  127. package/dist/{types → runtime/kit}/registry.d.ts +1 -1
  128. package/dist/runtime/kit/registry.js +12 -0
  129. package/dist/{types → runtime/kit}/ssg.d.ts +9 -3
  130. package/dist/runtime/kit/ssg.js +56 -0
  131. package/dist/runtime/kit/storefront.d.ts +652 -0
  132. package/dist/runtime/kit/storefront.js +723 -0
  133. package/dist/{types → runtime/kit}/theme-context.d.ts +8 -2
  134. package/dist/runtime/kit/theme-context.js +25 -0
  135. package/dist/runtime/kit/types.d.ts +155 -0
  136. package/dist/runtime/kit/types.js +1 -0
  137. package/dist/runtime/platform/TrackingPixels.d.ts +14 -0
  138. package/dist/runtime/platform/TrackingPixels.js +63 -0
  139. package/dist/runtime/platform/environment.d.ts +68 -0
  140. package/dist/runtime/platform/environment.js +85 -0
  141. package/dist/runtime/platform/locale.d.ts +27 -0
  142. package/dist/runtime/platform/locale.js +42 -0
  143. package/dist/runtime/platform/route-analytics.d.ts +15 -0
  144. package/dist/runtime/platform/route-analytics.js +72 -0
  145. package/dist/runtime/platform/safe-href.d.ts +25 -0
  146. package/dist/runtime/platform/safe-href.js +69 -0
  147. package/dist/runtime/platform/safe-values.d.ts +37 -0
  148. package/dist/runtime/platform/safe-values.js +140 -0
  149. package/dist/runtime/render/SectionRenderer.d.ts +4 -0
  150. package/dist/runtime/render/SectionRenderer.js +199 -0
  151. package/dist/runtime/render/listing-query.d.ts +52 -0
  152. package/dist/runtime/render/listing-query.js +122 -0
  153. package/dist/runtime/render/localized-copy.d.ts +86 -0
  154. package/dist/runtime/render/localized-copy.js +129 -0
  155. package/dist/runtime/render/product-listing.d.ts +11 -0
  156. package/dist/runtime/render/product-listing.js +243 -0
  157. package/dist/runtime/render/resolved.d.ts +47 -0
  158. package/dist/runtime/render/resolved.js +80 -0
  159. package/dist/runtime/render/section-actions.d.ts +67 -0
  160. package/dist/runtime/render/section-actions.js +205 -0
  161. package/dist/runtime/render/starter.d.ts +11 -0
  162. package/dist/runtime/render/starter.js +96 -0
  163. package/dist/runtime/seo/head.d.ts +115 -0
  164. package/dist/runtime/seo/head.js +281 -0
  165. package/dist/runtime/seo/structured-data.d.ts +83 -0
  166. package/dist/runtime/seo/structured-data.js +252 -0
  167. package/dist/runtime/shell/PageShell.d.ts +18 -0
  168. package/dist/runtime/shell/PageShell.js +118 -0
  169. package/dist/runtime/shell/RuntimeBridge.d.ts +18 -0
  170. package/dist/runtime/shell/RuntimeBridge.js +124 -0
  171. package/dist/runtime/shell/overlay-state.d.ts +31 -0
  172. package/dist/runtime/shell/overlay-state.js +59 -0
  173. package/dist/runtime/shell/preview-mode.d.ts +2 -0
  174. package/dist/runtime/shell/preview-mode.js +11 -0
  175. package/dist/runtime/shell/spa-router.d.ts +14 -0
  176. package/dist/runtime/shell/spa-router.js +76 -0
  177. package/dist/runtime/shell/url-redirects.d.ts +6 -0
  178. package/dist/runtime/shell/url-redirects.js +37 -0
  179. package/dist/runtime/slots.d.ts +74 -0
  180. package/dist/runtime/slots.js +16 -0
  181. package/dist/runtime.d.ts +34 -0
  182. package/dist/runtime.js +40 -0
  183. package/dist/sdk/app-block.d.ts +29 -0
  184. package/dist/sdk/app-block.js +22 -0
  185. package/dist/sdk/font-hooks.d.ts +7 -0
  186. package/dist/sdk/font-hooks.js +21 -0
  187. package/dist/sdk/fonts.d.ts +144 -0
  188. package/dist/sdk/fonts.js +241 -0
  189. package/dist/sdk/index.d.ts +32 -0
  190. package/dist/sdk/index.js +36 -0
  191. package/dist/sdk/motion-hooks.d.ts +23 -0
  192. package/dist/sdk/motion-hooks.js +46 -0
  193. package/dist/sdk/motion.d.ts +78 -0
  194. package/dist/sdk/motion.js +292 -0
  195. package/dist/sdk/referrals.d.ts +62 -0
  196. package/dist/sdk/referrals.js +20 -0
  197. package/dist/sdk/rewards.d.ts +85 -0
  198. package/dist/sdk/rewards.js +29 -0
  199. package/dist/sdk/runtime-context.d.ts +230 -0
  200. package/dist/sdk/runtime-context.js +73 -0
  201. package/dist/sdk/schema.d.ts +249 -0
  202. package/dist/sdk/schema.js +168 -0
  203. package/dist/sdk/server-render.d.ts +8 -0
  204. package/dist/sdk/server-render.js +12 -0
  205. package/dist/sdk/store-lookup.d.ts +32 -0
  206. package/dist/sdk/store-lookup.js +48 -0
  207. package/dist/sdk/store.d.ts +164 -0
  208. package/dist/sdk/store.js +5 -0
  209. package/dist/sdk/sx.d.ts +45 -0
  210. package/dist/sdk/sx.js +117 -0
  211. package/dist/sdk/theme.d.ts +212 -0
  212. package/dist/sdk/theme.js +27 -0
  213. package/dist/sdk/types.d.ts +789 -0
  214. package/dist/sdk/types.js +7 -0
  215. package/dist/server.d.ts +112 -0
  216. package/dist/server.js +589 -0
  217. package/dist/vite-chunks.d.ts +10 -0
  218. package/dist/vite-chunks.js +44 -0
  219. package/docs/headless-api.md +250 -0
  220. package/package.json +72 -26
  221. package/dist/index.js.map +0 -1
  222. package/dist/ssg-BZ5FYTw7.js +0 -1802
  223. package/dist/ssg-BZ5FYTw7.js.map +0 -1
  224. package/dist/ssg.js +0 -8
  225. package/dist/ssg.js.map +0 -1
  226. package/dist/types/cart.d.ts +0 -86
  227. package/dist/types/data.d.ts +0 -357
  228. package/dist/types/dynamic-source.d.ts +0 -84
  229. package/dist/types/editor.d.ts +0 -5
  230. package/dist/types/index.d.ts +0 -20
  231. package/dist/types/preview-bridge.d.ts +0 -9
  232. package/dist/types/storefront.d.ts +0 -333
  233. package/dist/types/types.d.ts +0 -44
@@ -0,0 +1,789 @@
1
+ /**
2
+ * The data Nova components receive. Components are presentational: they never
3
+ * fetch. A storefront adapter maps Tanqory API payloads onto these shapes; the
4
+ * lab maps fixtures onto them. Optional means "a real store can lack it" —
5
+ * every component must render (or deliberately render nothing) without it.
6
+ */
7
+ export interface Image {
8
+ src: string;
9
+ alt?: string;
10
+ width: number;
11
+ height: number;
12
+ /** Optional responsive candidates; `src` is always the fallback. */
13
+ srcSet?: string;
14
+ }
15
+ export interface Video {
16
+ src: string;
17
+ poster?: Image;
18
+ captions?: string;
19
+ captionsLang?: string;
20
+ }
21
+ export interface Link {
22
+ title: string;
23
+ url: string;
24
+ }
25
+ export interface MenuItem {
26
+ title: string;
27
+ /** null = a heading-only item that exists to group children. */
28
+ url: string | null;
29
+ items?: MenuItem[];
30
+ /** The item matches the current route (drives aria-current + the active rule). */
31
+ active?: boolean;
32
+ /** ABI Menu-1: the image of the store's collection the item links to (a mega menu's tile), when it has one. */
33
+ image?: Image;
34
+ }
35
+ export interface Menu {
36
+ handle: string;
37
+ title: string;
38
+ items: MenuItem[];
39
+ }
40
+ export interface Money {
41
+ /** Minor units avoided on purpose: the storefront API returns decimals. */
42
+ amount: number;
43
+ currencyCode: string;
44
+ }
45
+ export type SocialNetwork = 'instagram' | 'facebook' | 'x' | 'tiktok' | 'youtube';
46
+ export declare const SOCIAL_NETWORKS: readonly SocialNetwork[];
47
+ export type PaymentMethod = 'visa' | 'mastercard' | 'amex' | 'promptpay' | 'paypal' | 'apple-pay' | 'google-pay' | 'jcb' | 'unionpay' | 'truemoney' | 'discover' | 'diners-club';
48
+ /** A store social profile on a network the design draws no mark for (Threads, Pinterest, …): shown with the generic link mark and its name. */
49
+ export interface SocialLink {
50
+ /** The dashboard's lower-case network slug. */
51
+ platform: string;
52
+ /** The network's display name ("Threads"). */
53
+ label: string;
54
+ /** Absolute https: URL. */
55
+ url: string;
56
+ }
57
+ export interface Shop {
58
+ name: string;
59
+ /** Settings → Brand → logo. The header resolves: logo image → header.logo text → name. */
60
+ logo?: Image | null;
61
+ /** Settings → Brand → slogan, when set (board 35 #110). A theme shows it only where the merchant turns its option on. */
62
+ slogan?: string;
63
+ /** Settings → Brand → short description, when set (board 35 #110). */
64
+ shortDescription?: string;
65
+ /** Settings → Brand → cover image, when set (board 35 #110). */
66
+ coverImage?: Image;
67
+ email?: string;
68
+ phone?: string;
69
+ social?: Partial<Record<SocialNetwork, string>>;
70
+ /** The store's other social profiles, in the store's order, after the drawn networks. */
71
+ otherSocial?: SocialLink[];
72
+ paymentMethods?: PaymentMethod[];
73
+ /** Copyright line owner; defaults to name. */
74
+ legalName?: string;
75
+ /** Prices include tax for the shopper's market (Settings › Taxes): the price says "Tax included." */
76
+ taxesIncluded?: boolean;
77
+ /** The lowest "free over" shipping threshold for the shopper's country, in the market's currency. */
78
+ freeShippingThreshold?: Money;
79
+ /** Settings › Customer accounts › "Show sign-in links"; false hides the account links. Absent = shown. */
80
+ signInLinks?: boolean;
81
+ /** The store's published policies, when the platform listed them (footer legal links fallback). */
82
+ policyLinks?: {
83
+ handle: string;
84
+ title: string;
85
+ url: string;
86
+ }[];
87
+ /** Settings › Customer privacy › Cookie banner. Absent = the theme's own banner. */
88
+ consentBanner?: ConsentBannerConfig;
89
+ /** The store's base currency (Settings › General › Store currency), when the platform sent it. */
90
+ currencyCode?: string;
91
+ /**
92
+ * Settings › Markets › Currency formatting, when the merchant set it: patterns holding one `{{amount…}}` token
93
+ * (`฿{{amount}}`, `{{amount_no_decimals}} บาท`). They apply ONLY to amounts in `currencyCode`; any other currency
94
+ * keeps the locale's formatting. The text may hold HTML the merchant typed — render it as text, tags stripped.
95
+ */
96
+ moneyFormat?: {
97
+ withCurrency?: string;
98
+ withoutCurrency?: string;
99
+ };
100
+ /**
101
+ * Settings › Brand › Business details › Location — the business address the merchant published, as display lines
102
+ * (street, city line, country), when set. Never the billing address.
103
+ */
104
+ address?: string[];
105
+ /**
106
+ * Marketing › Pop-ups — the pop-ups the store runs now, oldest first (at most 20), when it runs any. See
107
+ * `ShopPopup`; a theme shows at most one at a time.
108
+ */
109
+ popups?: ShopPopup[];
110
+ /** Marketing › Loyalty, while the program is on (storefront-query rev 2.48). See `ShopLoyalty`. */
111
+ loyalty?: ShopLoyalty;
112
+ /** Marketing › Referrals, while the program is on (storefront-query rev 2.48). See `ShopReferrals`. */
113
+ referrals?: ShopReferrals;
114
+ /**
115
+ * Settings › Preferences › Spam protection (A4): `contactForms` ⇒ the contact and newsletter forms (and a pop-up
116
+ * sign-up) render the invisible Cloudflare Turnstile widget with `siteKey`; `authPages` ⇒ sign-in, sign-up and
117
+ * password recovery do. Absent ⇒ no widget anywhere.
118
+ */
119
+ spamProtection?: {
120
+ contactForms: boolean;
121
+ authPages: boolean;
122
+ siteKey: string;
123
+ };
124
+ }
125
+ /** A decimal as the platform sends it: no sign, no exponent, at most 4 fraction digits (`"1"`, `"1.5"`, `"2000"`). */
126
+ export type LoyaltyNumber = string;
127
+ /** How a way to earn is triggered (Marketing › Loyalty › Ways to earn). */
128
+ export type LoyaltyEarnKind = 'purchase' | 'account' | 'birthday' | 'review' | 'newsletter' | 'social' | 'custom';
129
+ /** What a reward in the catalog gives once redeemed in the shopper's account. */
130
+ export type LoyaltyRewardKind = 'amountOff' | 'percentOff' | 'freeShipping' | 'freeProduct' | 'storeCredit';
131
+ /**
132
+ * Marketing › Loyalty — the program as ANY shopper may read it (storefront-query rev 2.48 `shop.loyalty`, theme-abi
133
+ * `Shop.loyalty`, NEW-MKT-10). Present only while the program is on. Nothing per shopper is ever here: a balance, a
134
+ * tier reached, a code or a ledger row lives in the shopper's account (`/account/rewards`), so a section built on this
135
+ * renders the same page for every visitor. `earnRates[].pointsPerUnit` = points per 1 unit of `currencyCode` spent;
136
+ * `pointValue` = what one point is worth in the store currency; `tiers` lowest threshold first (`threshold` in points
137
+ * or in the store currency per `tierBasis`).
138
+ */
139
+ export interface ShopLoyalty {
140
+ name: string;
141
+ earnRates: Array<{
142
+ currencyCode: string;
143
+ pointsPerUnit: LoyaltyNumber;
144
+ }>;
145
+ pointValue?: {
146
+ amount: string;
147
+ currencyCode: string;
148
+ };
149
+ pendingDays: number;
150
+ tierBasis: 'points' | 'spend';
151
+ tiers?: Array<{
152
+ name: string;
153
+ threshold: LoyaltyNumber;
154
+ earnMultiplier: LoyaltyNumber;
155
+ }>;
156
+ rules?: Array<{
157
+ kind: LoyaltyEarnKind;
158
+ name: string;
159
+ points: number;
160
+ url?: string;
161
+ }>;
162
+ rewards?: Array<{
163
+ name: string;
164
+ kind: LoyaltyRewardKind;
165
+ points: number;
166
+ value?: LoyaltyNumber;
167
+ minimumSubtotal?: {
168
+ amount: string;
169
+ currencyCode: string;
170
+ };
171
+ }>;
172
+ }
173
+ /**
174
+ * Marketing › Referrals — what a referred friend gets on a first order and what the advocate earns per friend who
175
+ * orders (storefront-query rev 2.48 `shop.referrals`, NEW-MKT-10). Present only while the program is on. Never a
176
+ * link, a code or a count: the advocate's link is in their account; a landing's code is the gateway's `tanqory_ref`
177
+ * cookie.
178
+ */
179
+ export interface ShopReferrals {
180
+ friendReward: {
181
+ kind: 'percentage' | 'fixed';
182
+ value: LoyaltyNumber;
183
+ minimumSubtotal?: {
184
+ amount: string;
185
+ currencyCode: string;
186
+ };
187
+ };
188
+ advocateReward: {
189
+ kind: 'percentageCode' | 'fixedCode' | 'storeCredit' | 'points';
190
+ value?: LoyaltyNumber;
191
+ points?: number;
192
+ };
193
+ }
194
+ /**
195
+ * A merchant pop-up (Marketing › Pop-ups) the store runs now (storefront-query rev 2.37 `Shop.popups`, theme-abi
196
+ * alpha.18): ACTIVE and inside its schedule when the platform projected it. Copy is plain text in `language`.
197
+ * `trigger` `delay` waits `triggerValue` seconds, `scroll` waits for `triggerValue` percent of the page, `exitIntent`
198
+ * fires when a pointer leaves the top of the window. `frequencyDays` 0 = once per browser session, else at most once
199
+ * per that many days after the shopper closed it. `discountOffered`: a newsletter sign-up reveals a code — the code
200
+ * comes back with the sign-up's form result, never here. A theme still shows it only while now is in [startsAt, endsAt).
201
+ */
202
+ export interface ShopPopup {
203
+ id: string;
204
+ kind: 'newsletter' | 'announcement';
205
+ trigger: 'delay' | 'scroll' | 'exitIntent';
206
+ triggerValue: number;
207
+ frequencyDays: number;
208
+ pages: Array<'all' | 'home' | 'product' | 'collection' | 'cart'>;
209
+ startsAt?: string;
210
+ endsAt?: string;
211
+ language: string;
212
+ heading: string;
213
+ body?: string;
214
+ ctaLabel: string;
215
+ consentText?: string;
216
+ image?: Image;
217
+ ctaUrl?: string;
218
+ discountOffered?: boolean;
219
+ }
220
+ /** The merchant's cookie banner (Settings › Customer privacy). Text members are present only when typed. */
221
+ export interface ConsentBannerConfig {
222
+ enabled: boolean;
223
+ /**
224
+ * "Use automated settings": the platform decides where the banner shows (its legal floor, `consent.get`
225
+ * `regionRequiresBanner`), and `regions` is not used. Off: also in `regions` (board 35 #42).
226
+ */
227
+ automated: boolean;
228
+ position: 'bottom' | 'bottom-left' | 'bottom-right' | 'bottom-center' | 'center';
229
+ /** custom = the merchant's `colors` when sent, else the theme's own colours. */
230
+ colorTheme: 'light' | 'dark' | 'custom';
231
+ /** With `colorTheme` custom: the merchant's own colours (`#rrggbb`), storefront-query rev 2.69. */
232
+ colors?: {
233
+ background: string;
234
+ text: string;
235
+ button: string;
236
+ buttonText: string;
237
+ };
238
+ /** Countries ("TH") or subdivisions ("US-CA") the merchant chose. */
239
+ regions: string[];
240
+ privacyLinkUrl?: string;
241
+ text: Partial<Record<'title' | 'body' | 'privacyLinkLabel' | 'acceptLabel' | 'declineLabel' | 'manageLabel', string>>;
242
+ preferences: Partial<Record<'title' | 'introTitle' | 'introBody' | 'acceptAllLabel' | 'declineAllLabel' | 'saveLabel' | 'bulletTitle' | 'requiredTitle' | 'requiredDescription' | 'personalizationTitle' | 'personalizationDescription' | 'marketingTitle' | 'marketingDescription' | 'analyticsTitle' | 'analyticsDescription', string>> & {
243
+ bullets?: string[];
244
+ };
245
+ }
246
+ export interface Market {
247
+ countryCode: string;
248
+ country: string;
249
+ currencyCode: string;
250
+ currencySymbol: string;
251
+ languageCode: string;
252
+ /** The language's own name, in its own script (English, ไทย, 日本語). */
253
+ language: string;
254
+ /** The language's English name, shown muted beside the native one (Thai, Japanese). */
255
+ languageEnglish?: string;
256
+ /**
257
+ * The language's name in the page's language (on a Burmese page: အင်္ဂလိပ် for English), when the platform names it
258
+ * (theme-abi Locale-2). A selector shows it muted beside the native one instead of `languageEnglish`.
259
+ */
260
+ languageLocalized?: string;
261
+ }
262
+ export interface Localization {
263
+ current: Market;
264
+ available: Market[];
265
+ }
266
+ export interface CartSummary {
267
+ itemCount: number;
268
+ lineCount: number;
269
+ }
270
+ export interface Customer {
271
+ signedIn: boolean;
272
+ firstName?: string;
273
+ }
274
+ export interface BreadcrumbItem {
275
+ title: string;
276
+ /** Absent on the current page. */
277
+ url?: string;
278
+ }
279
+ export interface ProductOption {
280
+ name: string;
281
+ values: string[];
282
+ }
283
+ export interface ProductVariant {
284
+ id: string;
285
+ title: string;
286
+ sku?: string;
287
+ price: Money;
288
+ compareAtPrice?: Money | null;
289
+ available: boolean;
290
+ quantityAvailable?: number | null;
291
+ selectedOptions: {
292
+ name: string;
293
+ value: string;
294
+ }[];
295
+ image?: Image | null;
296
+ /**
297
+ * Where this variant can be picked up (storefront-query rev 2.52, O3): ids of `StoreContext.locations`. Absent when the
298
+ * store offers no local pickup; `[]` when no pickup location has it.
299
+ */
300
+ pickupLocationIds?: string[];
301
+ }
302
+ export interface Product {
303
+ id: string;
304
+ handle: string;
305
+ title: string;
306
+ vendor?: string;
307
+ productType?: string;
308
+ description?: string;
309
+ descriptionHtml?: string;
310
+ url: string;
311
+ featuredImage?: Image | null;
312
+ images: Image[];
313
+ options: ProductOption[];
314
+ variants: ProductVariant[];
315
+ priceRange: {
316
+ min: Money;
317
+ max: Money;
318
+ };
319
+ compareAtPriceRange?: {
320
+ min: Money;
321
+ max: Money;
322
+ } | null;
323
+ available: boolean;
324
+ tags?: string[];
325
+ /** The product's own low-stock threshold (Products › inventory), which overrides the theme's. */
326
+ lowStockThreshold?: number;
327
+ /**
328
+ * A gift card product (storefront-query rev 2.50 `Product.isGiftCard`, NEW-PROD-12): the product page offers the
329
+ * recipient form, whose values ride the cart line as attributes (`ThemeActions.cart.add(…, attributes)`). Absent for
330
+ * every other product.
331
+ */
332
+ isGiftCard?: boolean;
333
+ /**
334
+ * The store's automatic discounts that apply to this product without conditions (storefront-query rev 2.31
335
+ * `Product.automaticDiscounts`), active or scheduled: show one only while now ∈ [startsAt, endsAt). `value` is a
336
+ * percentage (0–100] or, for `fixed`, the amount off each item in the store's base currency. QA D8.
337
+ */
338
+ automaticDiscounts?: ProductAutomaticDiscount[];
339
+ /**
340
+ * The selling plan groups the product can be subscribed under (storefront-query rev 2.39, NEW-SUB-1), in the
341
+ * merchant's order; absent when the product is sold one-time only. A theme offers one-time or subscribe, the
342
+ * plans' intervals and the per-delivery price, and adds the line with `cart.add(variantId, quantity, { sellingPlanId })`.
343
+ */
344
+ sellingPlanGroups?: ProductSellingPlanGroup[];
345
+ /**
346
+ * The gallery in the merchant's order when it holds a hosted video (images and videos interleaved). Absent ⇒ the
347
+ * gallery is `images`. Only videos uploaded to the store's own media library appear (mp4 / webm / mov); never
348
+ * YouTube, Vimeo or 3D.
349
+ */
350
+ media?: ProductMediaItem[];
351
+ /** Merchant-set badge text; the card shows at most one badge. */
352
+ badge?: string | null;
353
+ rating?: {
354
+ value: number;
355
+ count: number;
356
+ } | null;
357
+ }
358
+ /**
359
+ * What the platform's gift card balance lookup answers (NEW-PROD-12, the `gift-card-balance` native form): the card
360
+ * masked to its last characters, never its code; the balance it still holds and the value it was issued with;
361
+ * whether it still pays at checkout and why not; the expiry (RFC 3339), null for a card that never expires.
362
+ */
363
+ /** An amount as the platform answered it: a plain decimal string (`350`, `66.7`) and an ISO 4217 code. */
364
+ export interface GiftCardMoney {
365
+ amount: string;
366
+ currencyCode: string;
367
+ }
368
+ export interface GiftCardBalance {
369
+ lastCharacters: string;
370
+ balance: GiftCardMoney;
371
+ initialValue: GiftCardMoney;
372
+ enabled: boolean;
373
+ status: 'ACTIVE' | 'PARTIAL' | 'EMPTY' | 'EXPIRED' | 'DEACTIVATED';
374
+ expiresOn: string | null;
375
+ }
376
+ export interface Collection {
377
+ id: string;
378
+ handle: string;
379
+ title: string;
380
+ description?: string;
381
+ url: string;
382
+ image?: Image | null;
383
+ productsCount: number;
384
+ products?: Product[];
385
+ }
386
+ /** 12C · listing filters — facets come from the store's filter settings (Search & discovery). */
387
+ export interface FacetValue {
388
+ id: string;
389
+ label: string;
390
+ count: number;
391
+ active: boolean;
392
+ }
393
+ export interface Facet {
394
+ id: string;
395
+ label: string;
396
+ type: 'list' | 'price';
397
+ values?: FacetValue[];
398
+ /** Price facets: the store's bounds and the shopper's current range. */
399
+ range?: {
400
+ min: number;
401
+ max: number;
402
+ from?: number;
403
+ to?: number;
404
+ currencyCode: string;
405
+ };
406
+ }
407
+ export interface SortOption {
408
+ id: string;
409
+ label: string;
410
+ }
411
+ /** A cart line's custom attribute, as the platform stores it (`key` ≤ 255, `value` ≤ 255 characters). */
412
+ export interface CartLineAttribute {
413
+ key: string;
414
+ value: string;
415
+ }
416
+ export interface CartLine {
417
+ id: string;
418
+ quantity: number;
419
+ /** `id`: the product's id (theme-abi Cart-4), when the cart source sends it — the same id as `Product.id`. */
420
+ product: Pick<Product, 'title' | 'handle' | 'url' | 'vendor'> & {
421
+ id?: string;
422
+ };
423
+ variant: ProductVariant;
424
+ /**
425
+ * `total`: what the line costs after its own discounts (a product discount, a Buy X get Y free item), as the cart's
426
+ * subtotal and checkout count it. `subtotal`: the price × quantity before those discounts, present only when a
427
+ * discount took something off (show it struck). `compareAtTotal`: the compare-at price × quantity, a sale.
428
+ */
429
+ cost: {
430
+ total: Money;
431
+ compareAtTotal?: Money | null;
432
+ subtotal?: Money;
433
+ };
434
+ /** The line's own discounts by name (a code or an automatic discount's title) and what each takes off. Absent when none. */
435
+ discounts?: CartLineDiscount[];
436
+ /**
437
+ * The selling plan the line was added with (a subscription, NEW-SUB-2): its id and name, the per-delivery unit
438
+ * price the line is priced at (`variant.price` and `cost.total` already are) and the one-time unit it was
439
+ * discounted from, both in the cart's currency. Absent on a one-time line.
440
+ */
441
+ sellingPlan?: CartLineSellingPlan;
442
+ /**
443
+ * The line's custom attributes as the cart holds them (a gift card's recipient: `Recipient email`, `Recipient name`,
444
+ * `Message`, `Send on`; NEW-PROD-12), in the order the source sent them. Absent when the line has none.
445
+ */
446
+ attributes?: Array<{
447
+ key: string;
448
+ value: string;
449
+ }>;
450
+ }
451
+ /** One discount on a cart line (see `CartLine.discounts`). */
452
+ export interface CartLineDiscount {
453
+ title: string;
454
+ amount: Money;
455
+ }
456
+ /** The plan on a cart line (see `CartLine.sellingPlan`). */
457
+ export interface CartLineSellingPlan {
458
+ id: string;
459
+ name: string;
460
+ perDeliveryPrice: Money;
461
+ compareAtPrice: Money;
462
+ }
463
+ /**
464
+ * A selling plan group on a product (storefront-query rev 2.39 `Product.sellingPlanGroups`, Products ›
465
+ * Subscriptions): its plans are offered for every variant, or only for `variantIds` when the merchant attached the
466
+ * group to some variants. A product without one is sold one-time only.
467
+ */
468
+ export interface ProductSellingPlanGroup {
469
+ id: string;
470
+ name: string;
471
+ description?: string;
472
+ /** The group's option matrix ("Deliver every": 1 week, 1 month), when the merchant set one. */
473
+ options?: {
474
+ name: string;
475
+ values: string[];
476
+ }[];
477
+ plans: ProductSellingPlan[];
478
+ variantIds?: string[];
479
+ }
480
+ /** One subscription plan: billed and delivered every `intervalCount` × `interval`, at the first-cycle `discount`. */
481
+ export interface ProductSellingPlan {
482
+ id: string;
483
+ name: string;
484
+ description?: string;
485
+ options?: {
486
+ name: string;
487
+ value: string;
488
+ }[];
489
+ interval: 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
490
+ intervalCount: number;
491
+ /**
492
+ * The first-delivery adjustment, absent when the plan changes no price: `percentage` = percent off the variant's
493
+ * price (0–100]; `fixed` = the amount off per unit and `price` = the per-unit price, both in the store's base
494
+ * currency (compute a per-delivery price only when the variant's price is in that currency; else show the plan and
495
+ * let checkout price it). Display only — the cart line the shopper adds is priced by checkout from the same policy.
496
+ */
497
+ discount?: {
498
+ type: 'percentage' | 'fixed' | 'price';
499
+ value: number;
500
+ };
501
+ }
502
+ /** One gallery item of `Product.media`: an image, or a hosted video with its files and poster frame. */
503
+ export type ProductMediaItem = {
504
+ type: 'image';
505
+ image: Image;
506
+ } | {
507
+ type: 'video';
508
+ sources: {
509
+ src: string;
510
+ type: string;
511
+ }[];
512
+ poster?: Image;
513
+ alt?: string;
514
+ }
515
+ /**
516
+ * A YouTube / Vimeo video (storefront-query rev 2.52): `embedUrl` is the host's privacy-enhanced player. Frame it only
517
+ * after the shopper asks to play it (a click-to-load facade), with `allow="autoplay; fullscreen; picture-in-picture"`.
518
+ */
519
+ | {
520
+ type: 'external_video';
521
+ host: 'youtube' | 'vimeo';
522
+ embedUrl: string;
523
+ alt?: string;
524
+ }
525
+ /**
526
+ * A 3D model (storefront-query rev 2.52): a binary glTF file. `src` is a same-origin URL (the platform's model route),
527
+ * so a viewer may read it; render it with `<ModelViewer>` (theme-kit), which loads the viewer only when asked.
528
+ */
529
+ | {
530
+ type: 'model';
531
+ src: string; /** iOS Quick Look file (`.usdz`), same-origin; absent ⇒ the viewer makes one. */
532
+ iosSrc?: string;
533
+ poster?: Image;
534
+ alt?: string;
535
+ };
536
+ /** An automatic discount on a product (see `Product.automaticDiscounts`). */
537
+ export interface ProductAutomaticDiscount {
538
+ id: string;
539
+ title: string;
540
+ valueType: 'percentage' | 'fixed';
541
+ /** Percentage (0–100], or the fixed amount off each item in the store's base currency. */
542
+ value: number;
543
+ /** ISO 8601. */
544
+ startsAt: string;
545
+ /** ISO 8601; absent = no end. */
546
+ endsAt?: string;
547
+ }
548
+ export interface Cart {
549
+ id: string;
550
+ lines: CartLine[];
551
+ note?: string;
552
+ itemCount: number;
553
+ subtotal: Money;
554
+ total: Money;
555
+ discounts?: {
556
+ code: string;
557
+ amount: Money;
558
+ }[];
559
+ /**
560
+ * The discount codes the shopper entered, in the order applied. `applicable: false` = the store kept the code but
561
+ * it does not apply to this cart (yet: a minimum not met, or it does not combine). Absent on older hosts.
562
+ */
563
+ discountCodes?: {
564
+ code: string;
565
+ applicable: boolean;
566
+ }[];
567
+ /**
568
+ * What the cart's discounts (automatic ones and codes) take off the order, from the cart's own totals
569
+ * (`subtotal + tax − total`). Absent when nothing is taken off or it cannot be told.
570
+ */
571
+ discountTotal?: Money;
572
+ /**
573
+ * The cart's order-level discounts by name, when the platform sends them: `title` for an automatic discount,
574
+ * `code` for a code. Absent on hosts that do not send them — show `discountTotal` under a generic label then.
575
+ */
576
+ discountAllocations?: {
577
+ title?: string;
578
+ code?: string;
579
+ amount: Money;
580
+ }[];
581
+ }
582
+ export interface Article {
583
+ id: string;
584
+ handle: string;
585
+ title: string;
586
+ excerpt?: string;
587
+ contentHtml?: string;
588
+ url: string;
589
+ image?: Image | null;
590
+ author?: string;
591
+ publishedAt: string;
592
+ readingMinutes?: number;
593
+ tags?: string[];
594
+ blogHandle: string;
595
+ /**
596
+ * The article's comments (storefront-query rev 2.44, NEW-OS-26), present only when its blog accepts comments —
597
+ * show the list and the comment form (`<form data-tq-form="comments">`) then; absent ⇒ neither.
598
+ */
599
+ comments?: ArticleCommentsData;
600
+ }
601
+ /** One published comment (rev 2.44). `author` is the display name the commenter chose; never contact data. */
602
+ export interface ArticleCommentData {
603
+ id: string;
604
+ author: string;
605
+ body: string;
606
+ createdAt: string;
607
+ }
608
+ /**
609
+ * An article's comments: `moderated` = a new comment waits for the merchant's approval (say so in the thanks);
610
+ * `count` = published comments; `comments` = the newest published, newest first (at most 50) — empty on listings,
611
+ * where only the count is sent.
612
+ */
613
+ export interface ArticleCommentsData {
614
+ moderated: boolean;
615
+ count: number;
616
+ comments: ArticleCommentData[];
617
+ }
618
+ export interface Blog {
619
+ id: string;
620
+ handle: string;
621
+ title: string;
622
+ url: string;
623
+ articles: Article[];
624
+ }
625
+ export interface SearchResults {
626
+ query: string;
627
+ products: Product[];
628
+ articles: Article[];
629
+ pages: {
630
+ title: string;
631
+ url: string;
632
+ excerpt?: string;
633
+ }[];
634
+ total: number;
635
+ }
636
+ export interface Review {
637
+ id: string;
638
+ author: string;
639
+ rating: 1 | 2 | 3 | 4 | 5;
640
+ title?: string;
641
+ body: string;
642
+ createdAt: string;
643
+ verified?: boolean;
644
+ productHandle?: string;
645
+ /** The variant the reviewer bought ("Queen · Oat"), when the source provides it. */
646
+ variant?: string;
647
+ photos?: Image[];
648
+ /** The merchant's public answer (storefront-query rev 2.38 `ProductReview.reply`), when there is one. */
649
+ reply?: {
650
+ body: string;
651
+ createdAt: string;
652
+ };
653
+ }
654
+ /**
655
+ * 12F product-reviews · what a reviews source returns for one product. On the Theme ABI path the source is the
656
+ * platform (storefront-query rev 2.38 `Product.rating` / `Product.reviews`, 2.0.0-alpha.6): `StoreContext.reviews`
657
+ * is set on the product route — `count: 0` for a product nobody has reviewed yet — and null everywhere else.
658
+ */
659
+ export interface ReviewsData {
660
+ average: number;
661
+ count: number;
662
+ /** Review counts for 5 · 4 · 3 · 2 · 1 stars. */
663
+ distribution: [number, number, number, number, number];
664
+ reviews: Review[];
665
+ }
666
+ export interface Testimonial {
667
+ id: string;
668
+ quote: string;
669
+ name: string;
670
+ role?: string;
671
+ avatar?: Image | null;
672
+ rating?: number | null;
673
+ }
674
+ export interface TeamMember {
675
+ id: string;
676
+ name: string;
677
+ role: string;
678
+ bio?: string;
679
+ image?: Image | null;
680
+ links?: Link[];
681
+ }
682
+ export interface UgcPost {
683
+ id: string;
684
+ image: Image;
685
+ handle: string;
686
+ caption?: string;
687
+ url?: string;
688
+ productHandles?: string[];
689
+ }
690
+ /** rev 2.73 (board 35 #117): one weekly opening period; `closes` earlier than `opens` closes after midnight. */
691
+ export interface StoreOpeningPeriod {
692
+ day: 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY';
693
+ opens: string;
694
+ closes: string;
695
+ }
696
+ export interface StoreLocation {
697
+ id: string;
698
+ name: string;
699
+ address: string[];
700
+ phone?: string;
701
+ email?: string;
702
+ /** Free text — the platform returns no structured hours or coordinates yet. */
703
+ hours?: string;
704
+ /** rev 2.52 (O3): the location's expected pickup time ("Usually ready in …"), for a theme to word. */
705
+ pickupReadyIn?: '4h' | '24h' | '1-2d' | '2-4d' | '5d+';
706
+ /** rev 2.73 (board 35 #117): offers local pickup; absent ⇒ yes (the rev 2.34 reading). */
707
+ pickup?: boolean;
708
+ /** rev 2.73: Physical storefront on, so a store locator lists it; absent ⇒ yes (the rev 2.34 reading). */
709
+ storefront?: boolean;
710
+ /** rev 2.73: the weekly opening hours, Monday first, 24-hour local `HH:MM`; a day not listed is closed; absent ⇒ not set. */
711
+ openingHours?: StoreOpeningPeriod[];
712
+ image?: Image | null;
713
+ url?: string;
714
+ }
715
+ export interface OrderSummary {
716
+ id: string;
717
+ number: string;
718
+ processedAt: string;
719
+ status: 'paid' | 'pending' | 'refunded' | 'fulfilled' | 'unfulfilled' | 'cancelled';
720
+ total: Money;
721
+ itemCount: number;
722
+ /** The order in the accounts app. */
723
+ url?: string;
724
+ }
725
+ export interface CustomerAccount {
726
+ firstName: string;
727
+ lastName: string;
728
+ email: string;
729
+ phone?: string;
730
+ orders: OrderSummary[];
731
+ addresses: {
732
+ id: string;
733
+ lines: string[];
734
+ default?: boolean;
735
+ }[];
736
+ }
737
+ export interface Policy {
738
+ handle: string;
739
+ title: string;
740
+ bodyHtml: string;
741
+ url: string;
742
+ /** Not in store data today (12G DATA REQUIREMENT) — "Last updated" renders only with it. */
743
+ updatedAt?: string;
744
+ }
745
+ /** What a product listing section receives from the runtime (products, paging, filters, sort). */
746
+ export interface ListingData {
747
+ /** The products the host has (load-more pages through them; more → onLoadMore). */
748
+ products?: Product[];
749
+ /** Products matching the current filters. */
750
+ total?: number;
751
+ facets?: Facet[];
752
+ sortOptions?: SortOption[];
753
+ sort?: string;
754
+ state?: 'ready' | 'loading' | 'error';
755
+ /** pages mode: the current page and a URL for any page. */
756
+ page?: number;
757
+ pageHref?: (page: number) => string;
758
+ shopAllHref?: string;
759
+ onToggleFilter?: (facetId: string, valueId: string) => void;
760
+ onPriceFilter?: (facetId: string, from?: number, to?: number) => void;
761
+ onClearFilters?: () => void;
762
+ onSortChange?: (id: string) => void;
763
+ /** Fetch the next page (the host appends to `products`). */
764
+ onLoadMore?: () => Promise<unknown> | void;
765
+ onRetry?: () => void;
766
+ onQuickAdd?: (product: Product) => void;
767
+ }
768
+ /** @deprecated Use `Image`. */
769
+ export type NovaImage = Image;
770
+ /** @deprecated Use `Video`. */
771
+ export type NovaVideo = Video;
772
+ /** @deprecated Use `Link`. */
773
+ export type NovaLink = Link;
774
+ /** @deprecated Use `MenuItem`. */
775
+ export type NovaMenuItem = MenuItem;
776
+ /** @deprecated Use `Menu`. */
777
+ export type NovaMenu = Menu;
778
+ /** @deprecated Use `SocialLink`. */
779
+ export type NovaSocialLink = SocialLink;
780
+ /** @deprecated Use `Shop`. */
781
+ export type NovaShop = Shop;
782
+ /** @deprecated Use `Market`. */
783
+ export type NovaMarket = Market;
784
+ /** @deprecated Use `Localization`. */
785
+ export type NovaLocalization = Localization;
786
+ /** @deprecated Use `CartSummary`. */
787
+ export type NovaCartSummary = CartSummary;
788
+ /** @deprecated Use `Customer`. */
789
+ export type NovaCustomer = Customer;