@vectoriox/iox-ui 5.93.0 → 5.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/actions-core/index.d.ts +7 -2
  2. package/commerce-core/index.d.ts +863 -3
  3. package/composite-core/index.d.ts +290 -2
  4. package/design-core/index.d.ts +1049 -105
  5. package/fesm2022/vectoriox-iox-ui-actions-core.mjs +15 -4
  6. package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
  7. package/fesm2022/vectoriox-iox-ui-commerce-core.mjs +1509 -5
  8. package/fesm2022/vectoriox-iox-ui-commerce-core.mjs.map +1 -1
  9. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +1170 -177
  10. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  11. package/fesm2022/vectoriox-iox-ui-design-core.mjs +1147 -43
  12. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  13. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +2 -2
  14. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  15. package/fesm2022/vectoriox-iox-ui.mjs +8 -1
  16. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  17. package/generation-core/index.d.ts +2 -2
  18. package/index.d.ts +2 -0
  19. package/package.json +1 -1
  20. package/src/actions-core/action.model.ts +1 -1
  21. package/src/actions-core/element-actions.ts +17 -3
  22. package/src/commerce-core/cart-transport.ts +211 -0
  23. package/src/commerce-core/cart.ts +305 -0
  24. package/src/commerce-core/catalog.ts +42 -0
  25. package/src/commerce-core/checkout.ts +202 -0
  26. package/src/commerce-core/decimal.ts +28 -0
  27. package/src/commerce-core/labels.ts +29 -0
  28. package/src/commerce-core/limits.ts +9 -0
  29. package/src/commerce-core/money-error.ts +1 -0
  30. package/src/commerce-core/order-snapshot.ts +151 -0
  31. package/src/commerce-core/orders.ts +172 -0
  32. package/src/commerce-core/payments.ts +196 -0
  33. package/src/commerce-core/public-api.ts +19 -4
  34. package/src/commerce-core/quantity.ts +56 -0
  35. package/src/commerce-core/shipping.ts +168 -0
  36. package/src/commerce-core/shop-display.ts +117 -0
  37. package/src/commerce-core/text.ts +13 -0
  38. package/src/commerce-core/variants.ts +296 -0
  39. package/src/commerce-core/vat.ts +38 -0
  40. package/src/composite-core/exclusive-runtime.ts +20 -7
  41. package/src/composite-core/public-api.ts +2 -0
  42. package/src/composite-core/shop-runtime.ts +626 -0
  43. package/src/composite-core/shop.ts +433 -0
  44. package/src/design-core/flavor-spec.generated.ts +1147 -43
  45. package/src/generation-core/site-spec.generated.ts +2 -2
  46. package/styles/iox-design.css +95 -0
@@ -7,7 +7,8 @@ declare enum MoneyErrorCode {
7
7
  CurrencyMismatch = "currency-mismatch",
8
8
  NotWhole = "not-whole",
9
9
  Negative = "negative",
10
- Overflow = "overflow"
10
+ Overflow = "overflow",
11
+ OutOfRange = "out-of-range"
11
12
  }
12
13
  declare class MoneyError extends Error {
13
14
  readonly code: MoneyErrorCode;
@@ -84,5 +85,864 @@ declare function formatMoney(value: Money, locale: string): string;
84
85
  */
85
86
  declare function migrateMajorPrice(value: unknown, currency: CurrencyCode): number | null;
86
87
 
87
- export { CURRENCY_CODES, CURRENCY_EXPONENTS, CurrencyCode, MoneyError, MoneyErrorCode, addMoney, currencyExponent, formatMoney, isCurrencyCode, isMoney, majorToMinor, migrateMajorPrice, minorToMajor, money, percentOf, subtractMoney, timesMoney };
88
- export type { Money };
88
+ /**
89
+ * The words a refusal or a state is shown with. A string-rendered site and iox-cms's emails have no translation
90
+ * service, so the core carries English and Hebrew itself (the `blurbHe` / `sentWord` precedent); a host with its
91
+ * own translations may key them by the stable code instead.
92
+ */
93
+ declare enum CommerceLanguage {
94
+ En = "en",
95
+ He = "he"
96
+ }
97
+ interface CommerceLabel {
98
+ readonly en: string;
99
+ readonly he: string;
100
+ }
101
+ declare function commerceLanguage(lang: string | null | undefined): CommerceLanguage;
102
+ declare function labelIn(label: CommerceLabel, lang: string | null | undefined): string;
103
+
104
+ /** A cart holds at most this many distinct lines; more are dropped (`too-many-lines`). */
105
+ declare const MAX_CART_LINES = 100;
106
+ /** One line's quantity is capped here (`quantity-capped`), before stock. */
107
+ declare const MAX_LINE_QUANTITY = 999;
108
+ /**
109
+ * The largest subtotal, shipping price or threshold, in minor units. Subtotal + shipping stays far below 2^53, and
110
+ * the included-VAT arithmetic never forms a product past it.
111
+ */
112
+ declare const MAX_CART_AMOUNT: number;
113
+
114
+ declare const MAX_VAT_PERCENT = 100;
115
+ /** 17, 18, 7.7, 8.1 — four decimals is more than any rate in force; it also keeps the arithmetic below 2^53. */
116
+ declare const VAT_PERCENT_MAX_DECIMALS = 4;
117
+ declare function isVatPercent(value: unknown): value is number;
118
+ /**
119
+ * The VAT a VAT-INCLUSIVE amount already holds (C-D8): amount × v / (100 + v), rounded ONCE to a minor unit,
120
+ * half-to-even. Exact: v is read as the integer R = v·10^s (s ≤ 4 decimals), so the share is
121
+ * amount × R / (100·10^s + R) in whole numbers. 118.00 at 18 % → 18.00; 100.00 at 17 % → 14.53.
122
+ */
123
+ declare function includedVat(total: Money, vatPercent: number): Money;
124
+
125
+ /** The storefront's stock word (iox-cms `storefront-projection.ts` speaks the same values). */
126
+ declare enum Availability {
127
+ InStock = "in_stock",
128
+ Low = "low",
129
+ Out = "out"
130
+ }
131
+ /**
132
+ * One sellable unit as the seller knows it, in minor units: a product with no options is ONE entry with no
133
+ * `variantId`; a product with options is one entry per variant. iox-cms builds it from the product row (with the
134
+ * stock COUNT); the engine builds it from the storefront projection (with the availability WORD only).
135
+ */
136
+ interface CatalogEntry {
137
+ productId: string;
138
+ variantId?: string | null;
139
+ title: string;
140
+ variantName?: string | null;
141
+ /** null = no price set yet (a sample's placeholder): never sold. */
142
+ unitPrice: Money | null;
143
+ compareAt?: Money | null;
144
+ /** The count, where the caller knows it (iox-cms). Wins over `availability`. */
145
+ stock?: number | null;
146
+ /** The word, where only it is known (the engine). */
147
+ availability?: Availability | null;
148
+ /** A variant's switch; a product with no options is `true`. */
149
+ enabled: boolean;
150
+ published: boolean;
151
+ /** false = a digital product: no delivery address, no shipping method. */
152
+ requiresShipping: boolean;
153
+ image?: string | null;
154
+ }
155
+ /** How many units may be sold: the count, else 0 for `out` or nothing known, else null = unbounded here (the server checks the count). */
156
+ declare function sellableQuantity(entry: CatalogEntry): number | null;
157
+ declare const catalogKey: (productId: string, variantId?: string | null) => string;
158
+
159
+ /** Shipping v1 (C-D9): methods per studio, one country. Zones and weights come later. */
160
+ declare enum ShippingMethodKind {
161
+ Pickup = "pickup",
162
+ Flat = "flat",
163
+ /** A flat price that becomes free once the goods reach `freeOver`. */
164
+ FreeOver = "freeOver",
165
+ /** No address, nothing shipped — offered only when nothing in the cart ships. */
166
+ Digital = "digital"
167
+ }
168
+ /** What an owner must fill for a method of a kind. */
169
+ declare enum ShippingField {
170
+ Price = "price",
171
+ FreeOver = "freeOver",
172
+ PickupAddress = "pickupAddress"
173
+ }
174
+ interface ShippingMethod {
175
+ id: string;
176
+ kind: ShippingMethodKind;
177
+ name: string;
178
+ enabled: boolean;
179
+ price?: Money | null;
180
+ freeOver?: Money | null;
181
+ pickupAddress?: string | null;
182
+ pickupHours?: string | null;
183
+ }
184
+ interface ShippingKindRule {
185
+ readonly needsAddress: boolean;
186
+ /** Offered for a cart where something ships (true) or for one where nothing does (false). */
187
+ readonly forPhysical: boolean;
188
+ readonly requires: readonly ShippingField[];
189
+ readonly price: (method: ShippingMethod, goods: Money) => Money;
190
+ readonly label: CommerceLabel;
191
+ }
192
+ declare const SHIPPING_KINDS: Readonly<Record<ShippingMethodKind, ShippingKindRule>>;
193
+ declare const isShippingMethodKind: (value: unknown) => value is ShippingMethodKind;
194
+ declare function shippingNeedsAddress(kind: ShippingMethodKind): boolean;
195
+ /** The fields a method lacks (or holds in another currency) — empty = it can be offered. */
196
+ declare function shippingMethodProblems(method: ShippingMethod, currency: CurrencyCode): ShippingField[];
197
+ /** Enabled, complete, with an id and a name: the ONE rule both the offer and the checkout gate read. */
198
+ declare function shippingMethodReady(method: ShippingMethod, currency: CurrencyCode): boolean;
199
+ interface ShippingQuote {
200
+ methodId: string;
201
+ kind: ShippingMethodKind;
202
+ name: string;
203
+ price: Money;
204
+ /** A free-over method whose threshold the goods reached. */
205
+ free: boolean;
206
+ needsAddress: boolean;
207
+ }
208
+ /** What a quote reads of a cart. */
209
+ interface ShippingGoods {
210
+ currency: CurrencyCode;
211
+ /** The goods after discounts — what a free-over threshold is compared with. */
212
+ goods: Money;
213
+ requiresShipping: boolean;
214
+ lineCount: number;
215
+ }
216
+ /** The part of a `PricedCart` the offer reads. */
217
+ interface ShippingCart {
218
+ currency: CurrencyCode;
219
+ subtotal: Money;
220
+ discount: Money;
221
+ requiresShipping: boolean;
222
+ lines: readonly unknown[];
223
+ }
224
+ declare function quoteShipping(methods: readonly ShippingMethod[], cart: ShippingGoods): ShippingQuote[];
225
+ /**
226
+ * The methods a buyer may choose for this cart, each priced for it (free over: free when the goods after
227
+ * discounts are AT or above the threshold). A cart where nothing ships is offered Digital methods only; a cart
228
+ * where anything ships never is.
229
+ */
230
+ declare function availableShippingMethods(methods: readonly ShippingMethod[], pricedCart: ShippingCart): ShippingQuote[];
231
+
232
+ /** A cart names what and how many — never a price (C-D16, trap T1): every read prices it again. */
233
+ interface CartLine {
234
+ productId: string;
235
+ variantId?: string | null;
236
+ quantity: number;
237
+ }
238
+ interface Cart {
239
+ lines: readonly CartLine[];
240
+ }
241
+ interface StudioCommerce {
242
+ currency: CurrencyCode;
243
+ /** Prices INCLUDE it (C-D8). */
244
+ vatPercent: number;
245
+ shippingMethods: readonly ShippingMethod[];
246
+ }
247
+ interface PricingChoice {
248
+ shippingMethodId?: string | null;
249
+ }
250
+ declare enum CartIssueCode {
251
+ /** Not a whole number ≥ 1: the line is dropped. */
252
+ InvalidQuantity = "invalid-quantity",
253
+ /** The same product and variant twice: merged into the first. */
254
+ DuplicateLine = "duplicate-line",
255
+ TooManyLines = "too-many-lines",
256
+ QuantityCapped = "quantity-capped",
257
+ UnknownProduct = "unknown-product",
258
+ /** The product exists, this variant does not (or the product needs a variant chosen). */
259
+ UnknownVariant = "unknown-variant",
260
+ Unpublished = "unpublished",
261
+ VariantDisabled = "variant-disabled",
262
+ NoPrice = "no-price",
263
+ CurrencyMismatch = "currency-mismatch",
264
+ OutOfStock = "out-of-stock",
265
+ /** Fewer left than asked: the line keeps what is left. */
266
+ QuantityClamped = "quantity-clamped",
267
+ /** The line would push the subtotal past `MAX_CART_AMOUNT`: dropped. */
268
+ AmountTooLarge = "amount-too-large",
269
+ /** The chosen shipping method is not offered for this cart: no shipping is priced. */
270
+ ShippingUnavailable = "shipping-unavailable",
271
+ /** The studio's VAT is not a usable rate: the VAT line reads 0. */
272
+ VatInvalid = "vat-invalid"
273
+ }
274
+ declare const CART_ISSUE_LABELS: Readonly<Record<CartIssueCode, CommerceLabel>>;
275
+ interface CartIssue {
276
+ code: CartIssueCode;
277
+ productId?: string;
278
+ variantId?: string | null;
279
+ /** What the cart asked for. */
280
+ requested?: number;
281
+ /** What the priced line holds now (clamped / capped). */
282
+ quantity?: number;
283
+ shippingMethodId?: string;
284
+ }
285
+ interface PricedLine {
286
+ productId: string;
287
+ variantId: string | null;
288
+ title: string;
289
+ variantName: string | null;
290
+ quantity: number;
291
+ unitPrice: Money;
292
+ /** Shown struck through — only when it is above the price. */
293
+ compareAt: Money | null;
294
+ lineTotal: Money;
295
+ requiresShipping: boolean;
296
+ image: string | null;
297
+ }
298
+ interface PricedCart {
299
+ currency: CurrencyCode;
300
+ lines: PricedLine[];
301
+ subtotal: Money;
302
+ /** Zero until coupons (E4); `total` already subtracts it. */
303
+ discount: Money;
304
+ shipping: Money;
305
+ shippingMethod: ShippingQuote | null;
306
+ requiresShipping: boolean;
307
+ /** subtotal − discount + shipping: what the buyer pays. VAT is INSIDE it. */
308
+ total: Money;
309
+ /** The VAT `total` includes: total × v / (100 + v), rounded once half-to-even (`includedVat`). */
310
+ vat: Money;
311
+ vatPercent: number;
312
+ issues: CartIssue[];
313
+ }
314
+ /**
315
+ * THE pricing function (C-D7, trap T1): the engine shows its result, iox-cms recomputes it at checkout and at
316
+ * payment. Prices come from the catalog only — a cart line carries no number but a quantity. Every money value
317
+ * out is whole minor units in the studio currency. An unusable line is dropped or adjusted and SAID in `issues`.
318
+ */
319
+ declare function priceCart(cart: Cart, catalog: readonly CatalogEntry[], studio: StudioCommerce, choice?: PricingChoice | null): PricedCart;
320
+ /** The cart a priced cart stands for — what to store back once the buyer has seen the issues. */
321
+ declare function cartOf(priced: PricedCart): Cart;
322
+ /** Sign-in merge (E3): b's lines join a's; the same product and variant add up. priceCart caps and clamps later. */
323
+ declare function mergeCarts(a: Cart, b: Cart): Cart;
324
+
325
+ declare enum PaymentChannel {
326
+ /** The owner marks the order paid (C-D11). */
327
+ Manual = "manual",
328
+ /** The studio's PSP; only its verified callback marks the order paid. */
329
+ Online = "online"
330
+ }
331
+ declare enum PaymentMethodKind {
332
+ BankTransfer = "bankTransfer",
333
+ PayOnPickup = "payOnPickup",
334
+ CashOnDelivery = "cashOnDelivery",
335
+ Bit = "bit",
336
+ /** A PSP's hosted page (E2, Cardcom first) — typed now, not offered yet. */
337
+ Online = "online"
338
+ }
339
+ declare enum PaymentProvider {
340
+ Cardcom = "cardcom"
341
+ }
342
+ /** What an owner fills for a method. */
343
+ declare enum PaymentField {
344
+ AccountName = "accountName",
345
+ Bank = "bank",
346
+ Branch = "branch",
347
+ AccountNumber = "accountNumber",
348
+ BitPhone = "bitPhone",
349
+ Provider = "provider"
350
+ }
351
+ /** Which deliveries a method can be used with. */
352
+ declare enum DeliveryFit {
353
+ Any = "any",
354
+ /** Paid at the counter: only with a pickup method. */
355
+ PickupOnly = "pickupOnly",
356
+ /** Paid to the courier: only with a method that delivers to an address. */
357
+ AddressOnly = "addressOnly"
358
+ }
359
+ interface PaymentMethodRule {
360
+ readonly channel: PaymentChannel;
361
+ /** false = typed for a later phase, never shown to a buyer. */
362
+ readonly offered: boolean;
363
+ readonly fields: readonly PaymentField[];
364
+ readonly fit: DeliveryFit;
365
+ readonly label: CommerceLabel;
366
+ /** What the buyer reads after placing the order; `{total}`, `{orderNumber}` and the method's fields fill in. */
367
+ readonly instructions: CommerceLabel;
368
+ }
369
+ declare const PAYMENT_METHODS: Readonly<Record<PaymentMethodKind, PaymentMethodRule>>;
370
+ declare const PAYMENT_FIELD_LABELS: Readonly<Record<PaymentField, CommerceLabel>>;
371
+ interface PaymentMethodConfig {
372
+ kind: PaymentMethodKind;
373
+ enabled: boolean;
374
+ details?: Partial<Record<PaymentField, string>> | null;
375
+ /** The owner's own words, shown after the instructions. */
376
+ note?: string | null;
377
+ }
378
+ declare const isPaymentMethodKind: (value: unknown) => value is PaymentMethodKind;
379
+ declare function paymentChannelOf(kind: PaymentMethodKind): PaymentChannel;
380
+ /** The fields a method lacks or holds in a form it cannot be paid with. */
381
+ declare function paymentMethodProblems(config: PaymentMethodConfig): PaymentField[];
382
+ /** Enabled, offered in this phase, complete: the ONE rule the checkout and its gate read. */
383
+ declare function paymentMethodReady(config: PaymentMethodConfig): boolean;
384
+ /** The methods a buyer may pick with this delivery (null = nothing ships). */
385
+ declare function usablePaymentMethods(configs: readonly PaymentMethodConfig[], shippingKind?: ShippingMethodKind | null): PaymentMethodConfig[];
386
+ /** What the buyer is told to do, in their language: the method's sentence with the order, the amount and the owner's details, then the owner's note. */
387
+ declare function paymentInstructions(config: PaymentMethodConfig, order: {
388
+ orderNumber: string;
389
+ total: Money;
390
+ }, lang: string | null | undefined, locale?: string): string;
391
+
392
+ /** C-D11 — the order's closed states. */
393
+ declare enum OrderState {
394
+ /** A manual method: waiting for the owner to see the money. */
395
+ AwaitingPayment = "awaiting_payment",
396
+ /** An online method: the PSP's page is open. */
397
+ PendingPayment = "pending_payment",
398
+ Paid = "paid",
399
+ Fulfilled = "fulfilled",
400
+ Delivered = "delivered",
401
+ Cancelled = "cancelled",
402
+ PaymentFailed = "payment_failed",
403
+ Refunded = "refunded",
404
+ PartiallyRefunded = "partially_refunded"
405
+ }
406
+ declare enum OrderEvent {
407
+ /** The buyer tries to pay again after a failure. */
408
+ StartPayment = "startPayment",
409
+ /** The PSP's verified callback says paid. */
410
+ ConfirmPayment = "confirmPayment",
411
+ FailPayment = "failPayment",
412
+ /** The owner saw the money of a manual method. */
413
+ MarkPaid = "markPaid",
414
+ Fulfil = "fulfil",
415
+ Deliver = "deliver",
416
+ Cancel = "cancel",
417
+ /** Nobody paid in time (the jobs runner). */
418
+ Expire = "expire",
419
+ Refund = "refund",
420
+ PartialRefund = "partialRefund"
421
+ }
422
+ declare enum OrderActor {
423
+ Buyer = "buyer",
424
+ Owner = "owner",
425
+ /** A VERIFIED payment callback (trap T2) — never the browser's return redirect. */
426
+ PaymentCallback = "paymentCallback",
427
+ System = "system"
428
+ }
429
+ /** What an order holds of the stock in a state (C-D10). */
430
+ declare enum StockHold {
431
+ None = "none",
432
+ /** Held for `STOCK_RESERVATION_MINUTES` while a PSP payment is open. */
433
+ Reserved = "reserved",
434
+ /** Decremented: sold, or promised to a manual order. */
435
+ Taken = "taken"
436
+ }
437
+ /** What the server does to stock when an order moves — read from data, never decided per call site. */
438
+ declare enum StockEffect {
439
+ None = "none",
440
+ Reserve = "reserve",
441
+ CommitReservation = "commitReservation",
442
+ ReleaseReservation = "releaseReservation",
443
+ /** The conditional atomic decrement (E0's `takeStock`). */
444
+ Take = "take",
445
+ GiveBack = "giveBack"
446
+ }
447
+ declare enum OrderRefusal {
448
+ /** The event does not apply in this state. */
449
+ InvalidTransition = "invalid-transition",
450
+ /** It applies — but not from this actor (e.g. the owner marking an online payment paid). */
451
+ ActorNotAllowed = "actor-not-allowed",
452
+ /** Cancelled and refunded orders move no more. */
453
+ OrderFinal = "order-final"
454
+ }
455
+ declare const STOCK_RESERVATION_MINUTES = 15;
456
+ declare const ORDER_STOCK_HOLD: Readonly<Record<OrderState, StockHold>>;
457
+ /** from-hold → to-hold → effect. Taken → Reserved never happens (the transitions spec proves it). */
458
+ declare const STOCK_EFFECTS: Readonly<Record<StockHold, Readonly<Record<StockHold, StockEffect>>>>;
459
+ declare const FINAL_ORDER_STATES: readonly OrderState[];
460
+ interface OrderTransition {
461
+ readonly from: OrderState;
462
+ readonly event: OrderEvent;
463
+ readonly to: OrderState;
464
+ readonly actors: readonly OrderActor[];
465
+ }
466
+ /** THE order state machine (C-D11). Anything not listed is refused. */
467
+ declare const ORDER_TRANSITIONS: readonly OrderTransition[];
468
+ type OrderMove = {
469
+ ok: true;
470
+ state: OrderState;
471
+ stock: StockEffect;
472
+ } | {
473
+ ok: false;
474
+ refusal: OrderRefusal;
475
+ };
476
+ declare function stockEffect(from: OrderState | null, to: OrderState): StockEffect;
477
+ /** The ONE place an order moves: the next state and what to do to the stock, or why not. */
478
+ declare function nextOrderState(state: OrderState, event: OrderEvent, actor: OrderActor): OrderMove;
479
+ /** A new order's state and stock effect: a manual order takes its stock at once, an online one reserves it. */
480
+ declare function openingOrderState(kind: PaymentMethodKind): {
481
+ state: OrderState;
482
+ stock: StockEffect;
483
+ };
484
+ declare function reservationExpiresAt(now: Date): Date;
485
+ declare const ORDER_STATE_LABELS: Readonly<Record<OrderState, CommerceLabel>>;
486
+
487
+ /** The fixed checkout's steps, in order (C-D3); a checkout keeps the FURTHEST it reached (the journey, §3g). */
488
+ declare enum CheckoutStep {
489
+ Contact = "contact",
490
+ Delivery = "delivery",
491
+ Payment = "payment",
492
+ Paid = "paid"
493
+ }
494
+ declare const CHECKOUT_STEPS: readonly CheckoutStep[];
495
+ declare const CHECKOUT_STEP_LABELS: Readonly<Record<CheckoutStep, CommerceLabel>>;
496
+ declare function furthestStep(a: CheckoutStep | null | undefined, b: CheckoutStep | null | undefined): CheckoutStep;
497
+ /** The pages the OWNER writes and links from checkout (§3k). IOX never writes their text (T14). */
498
+ declare enum LegalPage {
499
+ Terms = "terms",
500
+ Returns = "returns",
501
+ Shipping = "shipping",
502
+ Privacy = "privacy"
503
+ }
504
+ /** Who sells, as Israel's Consumer Protection Law asks a distance seller to say (§3k). */
505
+ interface BusinessIdentity {
506
+ legalName?: string | null;
507
+ /** עוסק מורשה / ח.פ / ת.ז */
508
+ businessNumber?: string | null;
509
+ address?: string | null;
510
+ email?: string | null;
511
+ phone?: string | null;
512
+ }
513
+ interface CheckoutGateFacts {
514
+ currency: unknown;
515
+ vatPercent: unknown;
516
+ paymentMethods: readonly PaymentMethodConfig[];
517
+ shippingMethods: readonly ShippingMethod[];
518
+ /** Any product of the studio that is not digital. */
519
+ anyProductShips: boolean;
520
+ business: BusinessIdentity;
521
+ /** Each page exists and checkout links it. */
522
+ legalPages: Partial<Record<LegalPage, boolean>>;
523
+ }
524
+ declare enum CheckoutGateArea {
525
+ Payment = "payment",
526
+ Money = "money",
527
+ Shipping = "shipping",
528
+ Business = "business",
529
+ LegalPages = "legalPages"
530
+ }
531
+ declare enum CheckoutGateCode {
532
+ NoPaymentMethod = "no-payment-method",
533
+ CurrencyNotSet = "currency-not-set",
534
+ VatNotSet = "vat-not-set",
535
+ NoShippingMethod = "no-shipping-method",
536
+ BusinessNameMissing = "business-name-missing",
537
+ BusinessNumberMissing = "business-number-missing",
538
+ BusinessAddressMissing = "business-address-missing",
539
+ BusinessEmailMissing = "business-email-missing",
540
+ BusinessPhoneMissing = "business-phone-missing",
541
+ TermsPageMissing = "terms-page-missing",
542
+ ReturnsPageMissing = "returns-page-missing",
543
+ ShippingPageMissing = "shipping-page-missing",
544
+ PrivacyPageMissing = "privacy-page-missing"
545
+ }
546
+ interface CheckoutGateRule {
547
+ readonly code: CheckoutGateCode;
548
+ readonly area: CheckoutGateArea;
549
+ readonly refuses: (facts: CheckoutGateFacts) => boolean;
550
+ readonly label: CommerceLabel;
551
+ }
552
+ /** THE checkout gate (C-D19), in the order the owner fixes things. The server refuses with it; the admin shows the same rows. */
553
+ declare const CHECKOUT_GATE_RULES: readonly CheckoutGateRule[];
554
+ interface CheckoutGateRefusal {
555
+ code: CheckoutGateCode;
556
+ area: CheckoutGateArea;
557
+ label: CommerceLabel;
558
+ }
559
+ interface CheckoutGateResult {
560
+ open: boolean;
561
+ refusals: CheckoutGateRefusal[];
562
+ }
563
+ /** Checkout opens only when no rule refuses (C-D19, trap T9: the server's, never a hidden button). */
564
+ declare function checkoutGate(facts: CheckoutGateFacts): CheckoutGateResult;
565
+
566
+ interface PostalAddress {
567
+ line1: string;
568
+ line2?: string | null;
569
+ city: string;
570
+ postalCode?: string | null;
571
+ /** ISO 3166-1 alpha-2 — one country in v1 (C-D9). */
572
+ country: string;
573
+ }
574
+ interface OrderBuyer {
575
+ email: string;
576
+ name: string;
577
+ phone?: string | null;
578
+ /** Needed when the delivery method delivers to an address. */
579
+ address?: PostalAddress | null;
580
+ }
581
+ declare enum OrderSnapshotRefusal {
582
+ EmptyCart = "empty-cart",
583
+ /** The priced cart has issues the buyer has not seen: show them the priced cart first. */
584
+ CartChanged = "cart-changed",
585
+ ShippingNotChosen = "shipping-not-chosen",
586
+ AddressRequired = "address-required",
587
+ EmailRequired = "email-required",
588
+ NameRequired = "name-required",
589
+ /** Not enabled, not complete, not offered yet, or not usable with this delivery. */
590
+ PaymentMethodUnusable = "payment-method-unusable"
591
+ }
592
+ interface OrderSnapshotLine {
593
+ readonly productId: string;
594
+ readonly variantId: string | null;
595
+ readonly title: string;
596
+ readonly variantName: string | null;
597
+ readonly quantity: number;
598
+ readonly unitPrice: Money;
599
+ readonly lineTotal: Money;
600
+ readonly requiresShipping: boolean;
601
+ }
602
+ /** What an order stores: frozen, so a later price, name or bank-detail change never changes a placed order. */
603
+ interface OrderSnapshot {
604
+ readonly currency: CurrencyCode;
605
+ readonly lines: readonly OrderSnapshotLine[];
606
+ readonly subtotal: Money;
607
+ readonly discount: Money;
608
+ readonly shipping: Money;
609
+ readonly delivery: {
610
+ readonly methodId: string;
611
+ readonly kind: ShippingMethodKind;
612
+ readonly name: string;
613
+ } | null;
614
+ readonly total: Money;
615
+ readonly vat: {
616
+ readonly percent: number;
617
+ readonly amount: Money;
618
+ };
619
+ readonly payment: {
620
+ readonly kind: PaymentMethodKind;
621
+ readonly channel: PaymentChannel;
622
+ readonly details: Readonly<Partial<Record<PaymentField, string>>>;
623
+ readonly note: string | null;
624
+ };
625
+ readonly buyer: Readonly<OrderBuyer>;
626
+ }
627
+ type OrderSnapshotResult = {
628
+ ok: true;
629
+ snapshot: OrderSnapshot;
630
+ } | {
631
+ ok: false;
632
+ refusals: OrderSnapshotRefusal[];
633
+ };
634
+ /** Freezes what an order stores (lines, unit prices, totals, VAT, currency, delivery, payment, buyer) — or says why it cannot. */
635
+ declare function orderSnapshot(pricedCart: PricedCart, payment: PaymentMethodConfig, buyer: OrderBuyer): OrderSnapshotResult;
636
+
637
+ /**
638
+ * A product's OPTIONS and its VARIANTS as the storefront serves them (iox-cms `storefront-projection.ts`), read into
639
+ * what a product page needs (commerce plan §3i, trap T26): which values each option offers, which of them can still be
640
+ * bought given what is already chosen, and the variant a full choice names.
641
+ *
642
+ * A stored variant has no option map, only a flat NAME — the option values in option order joined by `-` (the admin's
643
+ * `product.component.ts` `generateCombinations`: "Red-M"). A name is matched against every combination of the options'
644
+ * values, never split on `-`, so a value that holds a `-` ("Off-white") still reads.
645
+ */
646
+ declare const VARIANT_NAME_SEPARATOR = "-";
647
+ /** The one variant row a product with no options keeps (iox-cms `DEFAULT_VARIANT_NAME`). */
648
+ declare const DEFAULT_VARIANT_NAME = "Default";
649
+ interface ProductOption {
650
+ name: string;
651
+ values: string[];
652
+ }
653
+ /** One variant row as the storefront serves it: prices in MAJOR units of the product's `currency`. */
654
+ interface StorefrontVariant {
655
+ _id?: string;
656
+ name?: string;
657
+ enable?: boolean;
658
+ image?: string | null;
659
+ price?: number | string | null;
660
+ compareat?: number | string | null;
661
+ availability?: string | null;
662
+ }
663
+ /** A product as the storefront serves it (the allowlist in iox-cms `STOREFRONT_FIELDS`). */
664
+ interface StorefrontProduct {
665
+ _id?: string;
666
+ title?: string;
667
+ slug?: string;
668
+ mainImage?: string | null;
669
+ productVariants?: boolean;
670
+ pricing?: {
671
+ price?: number | string | null;
672
+ compareat?: number | string | null;
673
+ } | null;
674
+ options?: ReadonlyArray<{
675
+ name?: string;
676
+ values?: ReadonlyArray<unknown>;
677
+ }> | null;
678
+ variants?: ReadonlyArray<StorefrontVariant> | null;
679
+ currency?: string | null;
680
+ availability?: string | null;
681
+ }
682
+ /** Option name → the value chosen. */
683
+ type VariantChoice = Readonly<Record<string, string>>;
684
+ /** One variant, read: its id (null for a product with no variant row), its choice, its money and whether it sells. */
685
+ interface ProductVariantView {
686
+ variantId: string | null;
687
+ name: string | null;
688
+ choice: VariantChoice;
689
+ price: Money | null;
690
+ /** Only when it is above the price (shown struck through). */
691
+ compareAt: Money | null;
692
+ image: string | null;
693
+ availability: Availability;
694
+ /** The variant's own switch (a product with no options: true). */
695
+ enabled: boolean;
696
+ /** Can be put in a cart: switched on, priced, not `out`. */
697
+ sellable: boolean;
698
+ }
699
+ interface OptionValueState {
700
+ value: string;
701
+ /** Some sellable variant has this value, given the choices of the options BEFORE this one. */
702
+ available: boolean;
703
+ selected: boolean;
704
+ }
705
+ interface OptionState {
706
+ name: string;
707
+ values: OptionValueState[];
708
+ }
709
+ /** True for something the storefront could have served as a product: a title and a price or variants. */
710
+ declare function isStorefrontProduct(value: unknown): value is StorefrontProduct;
711
+ /** The product's currency, or null when it names none we know (a price is then never shown — never guessed). */
712
+ declare function productCurrency(product: StorefrontProduct | null | undefined): CurrencyCode | null;
713
+ /** The options a product offers, cleaned: named, each value once, no empty value. None when it has no variants. */
714
+ declare function productOptions(product: StorefrontProduct | null | undefined): ProductOption[];
715
+ /** The choice a stored variant's flat name stands for, or null when no combination of the options writes it. */
716
+ declare function variantChoiceOf(variant: StorefrontVariant | null | undefined, options: ReadonlyArray<ProductOption>): VariantChoice | null;
717
+ /** A stored major-unit price as Money, or null (no price, a currency we do not know, a value that is no price). */
718
+ declare function storefrontMoney(value: unknown, currency: CurrencyCode | null): Money | null;
719
+ /**
720
+ * Every variant of a product, read. A product with no options is ONE view: its Default row's id (or null when it has
721
+ * no row) and the product's own price. A variant whose name matches no combination of the options is left out — the
722
+ * page cannot offer what it cannot name.
723
+ */
724
+ declare function productVariants(product: StorefrontProduct | null | undefined): ProductVariantView[];
725
+ /** The variant a FULL choice names, or null (a choice that misses an option, or names no stored variant). */
726
+ declare function findVariant(options: ReadonlyArray<ProductOption>, variants: ReadonlyArray<ProductVariantView>, choice: VariantChoice): ProductVariantView | null;
727
+ /**
728
+ * What each option offers now. Availability CASCADES in option order (the way a buyer reads the page, top to bottom):
729
+ * a value of the first option is available when ANY sellable variant has it; a value of a later option, when a
730
+ * sellable variant has it together with the values chosen for the options before it. So a buyer can always change an
731
+ * earlier option and the later ones follow (`chooseValue`) — never stuck behind a combination that is sold out.
732
+ */
733
+ declare function optionValueStates(options: ReadonlyArray<ProductOption>, variants: ReadonlyArray<ProductVariantView>, choice: VariantChoice): OptionState[];
734
+ /** The choice a page opens with: the first sellable variant's, else the first value of every option. */
735
+ declare function defaultChoice(options: ReadonlyArray<ProductOption>, variants: ReadonlyArray<ProductVariantView>): VariantChoice;
736
+ /**
737
+ * The buyer picks `value` for option `name`. The options AFTER it keep their value while it is still available after
738
+ * the change, else move to their first available value (else keep it — the page then says the combination is sold out).
739
+ * An unknown option or value changes nothing.
740
+ */
741
+ declare function chooseValue(options: ReadonlyArray<ProductOption>, variants: ReadonlyArray<ProductVariantView>, choice: VariantChoice, name: string, value: string): VariantChoice;
742
+ /** The catalog entries a storefront product sells (one per variant, or one for a product with no options) — what
743
+ * `priceCart` reads where only the storefront is known (the builder canvas's simulated cart). iox-cms builds its own
744
+ * from the stored row, with the stock COUNT. */
745
+ declare function storefrontCatalog(product: StorefrontProduct | null | undefined): CatalogEntry[];
746
+ /** The words a chosen variant is shown with in a cart line ("Sand · 32 cm"). */
747
+ declare function variantWords(choice: VariantChoice, options: ReadonlyArray<ProductOption>): string;
748
+ /**
749
+ * The product an element is about, the SAME rule on the builder canvas and the live site: the repeated row it sits in
750
+ * when that row is a product (a card in a product list), else the page's route item, else the first product the page's
751
+ * data holds (a product page bound to one product). Null when the page has none.
752
+ */
753
+ declare function productInScope(rowItem: unknown, data: Readonly<Record<string, unknown>> | null | undefined): StorefrontProduct | null;
754
+
755
+ /**
756
+ * The quantity a buyer may ask for — the stepper on a product page and on every cart line (commerce plan §3i). Whole
757
+ * numbers only, the forms-core number rule: anything that is not a whole number reads as the least. The most is the
758
+ * one-line cap (`MAX_LINE_QUANTITY`), lowered to the count when the count is known (iox-cms) — the storefront knows only
759
+ * a word, so it caps at the line cap and the server clamps (`priceCart` QuantityClamped).
760
+ */
761
+ declare const MIN_LINE_QUANTITY = 1;
762
+ interface QuantityBounds {
763
+ min: number;
764
+ /** Below `min` (0) when nothing can be bought: the stepper is off. */
765
+ max: number;
766
+ }
767
+ declare enum QuantityStep {
768
+ Down = -1,
769
+ Up = 1
770
+ }
771
+ /** What a stepper allows for a unit with this count / word. `out` (or a count of 0) allows nothing. */
772
+ declare function quantityBounds(unit?: {
773
+ stock?: number | null;
774
+ availability?: string | null;
775
+ } | null): QuantityBounds;
776
+ /** True when the bounds allow buying at all. */
777
+ declare function canBuy(bounds: QuantityBounds): boolean;
778
+ /** A quantity held within the bounds; not a whole number → the least. */
779
+ declare function clampQuantity(value: unknown, bounds: QuantityBounds): number;
780
+ /** True when a step in `direction` stays within the bounds. */
781
+ declare function canStep(value: number, direction: QuantityStep, bounds: QuantityBounds): boolean;
782
+ /** One step, held within the bounds. */
783
+ declare function stepQuantity(value: unknown, direction: QuantityStep, bounds: QuantityBounds): number;
784
+
785
+ /**
786
+ * The CART TRANSPORT CONTRACT (commerce plan §3d, C-D16) — what a host provides so the builder's shop parts can show and
787
+ * change a visitor's cart. The parts own no HTTP, exactly like a form (forms-core `transport.ts`, the §6b lesson: a
788
+ * part that emits and a host that never answers ships a dead button behind green tests):
789
+ *
790
+ * - the LIVE SITE (the engine, commerce E1d) implements it over iox-cms's hardened cart routes (`cartEndpointPath`): the
791
+ * server prices every read with `priceCart` and the transport hands back its `CartView` — a browser never computes a
792
+ * price it charges (trap T1);
793
+ * - the BUILDER CANVAS uses `simulatedCartTransport`: an in-memory cart over sample data, never written anywhere
794
+ * (trap T8: the canvas never writes a cart).
795
+ *
796
+ * Every method resolves with the WHOLE cart as it is now, or rejects with a `CartTransportError`.
797
+ */
798
+ /** One line of the cart a visitor sees: the server's priced line + the id its routes know it by + what it may hold. */
799
+ interface CartViewLine extends PricedLine {
800
+ lineId: string;
801
+ /** The most this line may hold (the stepper's top). */
802
+ maxQuantity: number;
803
+ }
804
+ interface CartView {
805
+ /** null only for a cart that has never been priced (the no-transport stub). */
806
+ currency: CurrencyCode | null;
807
+ lines: CartViewLine[];
808
+ /** How many units — the cart button's badge (`$cart.count`). */
809
+ count: number;
810
+ empty: boolean;
811
+ subtotal: Money | null;
812
+ total: Money | null;
813
+ vat: Money | null;
814
+ vatPercent: number;
815
+ issues: CartIssue[];
816
+ /** What is still missing for a free-delivery method, when the studio offers one (the drawer's note); else null. */
817
+ freeShippingRemaining: Money | null;
818
+ }
819
+ interface AddToCartRequest {
820
+ productId: string;
821
+ variantId?: string | null;
822
+ quantity: number;
823
+ }
824
+ interface CartTransport {
825
+ read(): Promise<CartView>;
826
+ add(request: AddToCartRequest): Promise<CartView>;
827
+ setQuantity(lineId: string, quantity: number): Promise<CartView>;
828
+ remove(lineId: string): Promise<CartView>;
829
+ }
830
+ declare enum CartTransportErrorCode {
831
+ /** No cart on this host (the engine before E1d, a site with no shop). */
832
+ Unavailable = "unavailable",
833
+ /** The server said no (a product no longer sold, a rate limit). */
834
+ Refused = "refused",
835
+ /** The call never reached the server. */
836
+ Network = "network"
837
+ }
838
+ declare const CART_TRANSPORT_ERROR_LABELS: Readonly<Record<CartTransportErrorCode, CommerceLabel>>;
839
+ declare class CartTransportError extends Error {
840
+ readonly code: CartTransportErrorCode;
841
+ constructor(code: CartTransportErrorCode, message?: string);
842
+ }
843
+ /** A line's id when the host has none of its own: the product and the variant, URL-safe. */
844
+ declare function cartLineId(productId: string, variantId?: string | null): string;
845
+ /** The public cart routes (§3d) — ROOT-relative, like the forms submit path (a relative path under the org's
846
+ * `<base href>` reaches the engine, never iox-cms). `lineId` addresses one line. */
847
+ declare function cartEndpointPath(orgId: string, lineId?: string | null): string;
848
+ /** The fixed checkout route (C-D3), relative to the site's `<base href="/<orgLabel>/">`. */
849
+ declare const CHECKOUT_PATH = "checkout";
850
+ /** The checkout's href: `/<orgLabel>/checkout` under a label, else `/checkout`. */
851
+ declare function checkoutHref(orgLabel?: string | null): string;
852
+ /** A cart with nothing in it. */
853
+ declare function emptyCartView(currency?: CurrencyCode | null): CartView;
854
+ /** The view of a priced cart. `lineIdOf` names each line the way the host's routes do (default `cartLineId`);
855
+ * `maxOf` says how many a line may hold (default the line cap). */
856
+ declare function cartViewOf(priced: PricedCart, options?: {
857
+ lineIdOf?: (line: PricedLine) => string;
858
+ maxOf?: (line: PricedLine) => number;
859
+ freeShippingRemaining?: Money | null;
860
+ }): CartView;
861
+ /** The cart iox-cms's public routes answer (E1b, `shop.md` "The cart"): the priced cart, each line under its own id
862
+ * (`ln_…`), and the unit count. */
863
+ interface SiteCartView extends PricedCart {
864
+ lines: Array<PricedLine & {
865
+ id: string;
866
+ }>;
867
+ itemCount?: number;
868
+ }
869
+ /** iox-cms's answer as the view the parts paint — the server's line ids, its prices untouched. */
870
+ declare function siteCartView(site: SiteCartView, freeShippingRemaining?: Money | null): CartView;
871
+ /** How a refused cart call is said: no cart service (501, 503) or a shop off the plan (403) is Unavailable, a
872
+ * status the server chose is Refused, anything that never got an answer is Network. */
873
+ declare function cartTransportErrorFor(status: number | null | undefined): CartTransportError;
874
+ /** The words a cart's issues are said with, once each. */
875
+ declare function cartIssueWords(view: Pick<CartView, 'issues'>, lang: string | null | undefined): string[];
876
+ /** The host with no cart yet (the engine until E1d binds its own): every read is an empty cart, every change refused. */
877
+ declare const NO_CART_TRANSPORT: CartTransport;
878
+ /**
879
+ * The builder canvas's cart: in memory, priced by the ONE `priceCart` over the catalog it is given (sample data, or the
880
+ * product on the canvas), written nowhere. `initial` is what it starts holding (a sample line, so the drawer has one to
881
+ * design). Every product the canvas adds must be in `catalog` — `addEntries` widens it.
882
+ */
883
+ interface SimulatedCartTransport extends CartTransport {
884
+ /** Make more units known to the simulation (the product an Add to cart on the canvas names). */
885
+ addEntries(entries: ReadonlyArray<CatalogEntry>): void;
886
+ /** The cart as it stands, priced — no promise (the canvas paints it at once). */
887
+ peek(): CartView;
888
+ }
889
+ declare function simulatedCartTransport(catalog: ReadonlyArray<CatalogEntry>, studio: StudioCommerce, initial?: Cart): SimulatedCartTransport;
890
+
891
+ /**
892
+ * How a price READS on a page — the `money` binding pipe (shop-aware plan A-D2, amended by C-D7) on the builder canvas,
893
+ * the engine's SSR and its hydration: ONE function, so the three never disagree on a digit.
894
+ *
895
+ * - a `Money` (minor units + its currency — `$variant.price`, a cart's totals) is formatted as it is;
896
+ * - a bare number or numeric string (`pricing.price` as the storefront serves it: MAJOR units) needs a currency — the
897
+ * pipe's own argument, else the studio's (`PipeContext.currency`); with none it is left as it was, never guessed;
898
+ * - nothing (null, undefined, '') reads as nothing.
899
+ * The locale is the page's language (`en` when unsaid, so the canvas and the server agree).
900
+ */
901
+ declare const DEFAULT_MONEY_LOCALE = "en";
902
+ declare function formatMoneyValue(value: unknown, currency?: string | null, locale?: string | null): unknown;
903
+ /**
904
+ * The two slots the shop parts write at runtime (the element-context channel — a slot is a `resolvedData` key written
905
+ * at runtime, element-context-state plan): the variant the buyer has chosen (`$variant.price | money`) and the cart
906
+ * (`$cart.count` on the cart button's badge). Written by the shop runtime through its host, read by ordinary bindings.
907
+ */
908
+ declare enum ShopSlot {
909
+ Variant = "$variant",
910
+ Cart = "$cart"
911
+ }
912
+ declare const SHOP_SLOTS: ReadonlyArray<string>;
913
+ declare enum ShopWord {
914
+ Added = "added",
915
+ SoldOut = "soldOut",
916
+ ValueSoldOut = "valueSoldOut",
917
+ Decrease = "decrease",
918
+ Increase = "increase",
919
+ Remove = "remove",
920
+ Cart = "cart",
921
+ CartCount = "cartCount",
922
+ Quantity = "quantity",
923
+ FreeShippingGap = "freeShippingGap",
924
+ ChooseOption = "chooseOption"
925
+ }
926
+ /** `{name}` / `{n}` / `{amount}` are filled by `shopWord`. */
927
+ declare const SHOP_WORDS: Readonly<Record<ShopWord, CommerceLabel>>;
928
+ declare function shopWord(word: ShopWord, lang: string | null | undefined, fill?: Readonly<Record<string, string | number>>): string;
929
+ /** Board 10's tall speckled vase: Glaze (Sand · Ash · Charcoal — Charcoal sold out) × Size (24 · 32 · 40 cm — 40 sold
930
+ * out), ₪240 against ₪280. Major units, as the storefront serves them. */
931
+ declare const SAMPLE_PRODUCT: StorefrontProduct;
932
+ /** The colours board 10 draws its sample glazes with (a sample value has no colour of its own). */
933
+ declare const SAMPLE_SWATCHES: Readonly<Record<string, string>>;
934
+ /** The sample studio's money (VAT 18 %, ₪). */
935
+ declare const SAMPLE_STUDIO: Readonly<{
936
+ currency: CurrencyCode.ILS;
937
+ vatPercent: 18;
938
+ shippingMethods: never[];
939
+ }>;
940
+ /** The cart the canvas starts with: one sample line, so the drawer has a line to design. */
941
+ declare const SAMPLE_CART_LINE: Readonly<{
942
+ productId: "sample-vase";
943
+ variantId: "sample-sand-32cm";
944
+ quantity: 1;
945
+ }>;
946
+
947
+ export { Availability, CART_ISSUE_LABELS, CART_TRANSPORT_ERROR_LABELS, CHECKOUT_GATE_RULES, CHECKOUT_PATH, CHECKOUT_STEPS, CHECKOUT_STEP_LABELS, CURRENCY_CODES, CURRENCY_EXPONENTS, CartIssueCode, CartTransportError, CartTransportErrorCode, CheckoutGateArea, CheckoutGateCode, CheckoutStep, CommerceLanguage, CurrencyCode, DEFAULT_MONEY_LOCALE, DEFAULT_VARIANT_NAME, DeliveryFit, FINAL_ORDER_STATES, LegalPage, MAX_CART_AMOUNT, MAX_CART_LINES, MAX_LINE_QUANTITY, MAX_VAT_PERCENT, MIN_LINE_QUANTITY, MoneyError, MoneyErrorCode, NO_CART_TRANSPORT, ORDER_STATE_LABELS, ORDER_STOCK_HOLD, ORDER_TRANSITIONS, OrderActor, OrderEvent, OrderRefusal, OrderSnapshotRefusal, OrderState, PAYMENT_FIELD_LABELS, PAYMENT_METHODS, PaymentChannel, PaymentField, PaymentMethodKind, PaymentProvider, QuantityStep, SAMPLE_CART_LINE, SAMPLE_PRODUCT, SAMPLE_STUDIO, SAMPLE_SWATCHES, SHIPPING_KINDS, SHOP_SLOTS, SHOP_WORDS, STOCK_EFFECTS, STOCK_RESERVATION_MINUTES, ShippingField, ShippingMethodKind, ShopSlot, ShopWord, StockEffect, StockHold, VARIANT_NAME_SEPARATOR, VAT_PERCENT_MAX_DECIMALS, addMoney, availableShippingMethods, canBuy, canStep, cartEndpointPath, cartIssueWords, cartLineId, cartOf, cartTransportErrorFor, cartViewOf, catalogKey, checkoutGate, checkoutHref, chooseValue, clampQuantity, commerceLanguage, currencyExponent, defaultChoice, emptyCartView, findVariant, formatMoney, formatMoneyValue, furthestStep, includedVat, isCurrencyCode, isMoney, isPaymentMethodKind, isShippingMethodKind, isStorefrontProduct, isVatPercent, labelIn, majorToMinor, mergeCarts, migrateMajorPrice, minorToMajor, money, nextOrderState, openingOrderState, optionValueStates, orderSnapshot, paymentChannelOf, paymentInstructions, paymentMethodProblems, paymentMethodReady, percentOf, priceCart, productCurrency, productInScope, productOptions, productVariants, quantityBounds, quoteShipping, reservationExpiresAt, sellableQuantity, shippingMethodProblems, shippingMethodReady, shippingNeedsAddress, shopWord, simulatedCartTransport, siteCartView, stepQuantity, stockEffect, storefrontCatalog, storefrontMoney, subtractMoney, timesMoney, usablePaymentMethods, variantChoiceOf, variantWords };
948
+ export type { AddToCartRequest, BusinessIdentity, Cart, CartIssue, CartLine, CartTransport, CartView, CartViewLine, CatalogEntry, CheckoutGateFacts, CheckoutGateRefusal, CheckoutGateResult, CommerceLabel, Money, OptionState, OptionValueState, OrderBuyer, OrderMove, OrderSnapshot, OrderSnapshotLine, OrderSnapshotResult, OrderTransition, PaymentMethodConfig, PostalAddress, PricedCart, PricedLine, PricingChoice, ProductOption, ProductVariantView, QuantityBounds, ShippingCart, ShippingGoods, ShippingMethod, ShippingQuote, SimulatedCartTransport, SiteCartView, StorefrontProduct, StorefrontVariant, StudioCommerce, VariantChoice };