@everfur/sdk 0.17.0 → 0.18.1
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.
- package/CHANGELOG.md +167 -26
- package/care/package.json +8 -0
- package/dist/{Chat.d-uETscjrL.d.ts → Chat.d-Bz4iJ7d2.d.ts} +1 -1
- package/dist/{Chat.d-BYY1U61e.d.cts → Chat.d-C2ddC2u7.d.cts} +1 -1
- package/dist/{DepthViews.d-BsZ73mzL.d.ts → DepthViews.d-C6-Kzs6H.d.ts} +1 -1
- package/dist/{DepthViews.d-D_Qp4glO.d.cts → DepthViews.d-Chjs8H9V.d.cts} +1 -1
- package/dist/{DepthViews.d-DL8MP_kA.d.cts → DepthViews.d-pFL_ZBZT.d.cts} +1 -1
- package/dist/{DepthViews.d-B4SE5GUD.d.ts → DepthViews.d-qXt9OMgz.d.ts} +1 -1
- package/dist/{RecordsPage.d-CYotk2R9.d.cts → RecordsPage.d-Cmny6Q7g.d.cts} +2 -2
- package/dist/{RecordsPage.d-D4gP4leq.d.ts → RecordsPage.d-sNRolVdy.d.ts} +2 -2
- package/dist/animations/index.d.cts +5 -5
- package/dist/animations/index.d.ts +5 -5
- package/dist/{appStateLifecycle.d-DJXdDOJY.d.cts → appStateLifecycle.d-Bt70TQog.d.cts} +7 -7
- package/dist/{appStateLifecycle.d-CXJzBS3c.d.ts → appStateLifecycle.d-Jdg9_PFt.d.ts} +7 -7
- package/dist/{attachments.d-B8kOCb6q.d.cts → attachments.d-BVp3r6Ms.d.cts} +5 -5
- package/dist/{attachments.d-C61URT8r.d.cts → attachments.d-CF4_n-DZ.d.cts} +2 -2
- package/dist/{attachments.d-BTIGzXWD.d.ts → attachments.d-DnSCMjH0.d.ts} +5 -5
- package/dist/{attachments.d-BgatKf7d.d.ts → attachments.d-DsUZpMad.d.ts} +2 -2
- package/dist/{bookingCopy.d-B-bSYgqS.d.cts → bookingCopy.d-BHqE9Ozq.d.cts} +16 -16
- package/dist/{bookingCopy.d-JQW2SLM-.d.ts → bookingCopy.d-Ca4AQGZ7.d.ts} +16 -16
- package/dist/{branding.d-Bbc6p1XY.d.cts → branding.d-BFauULV6.d.cts} +1 -1
- package/dist/{branding.d-y6c0UwhE.d.ts → branding.d-DpNGEdDL.d.ts} +1 -1
- package/dist/care/index.cjs +3 -0
- package/dist/care/index.d.cts +434 -0
- package/dist/care/index.d.ts +434 -0
- package/dist/care/index.js +3 -0
- package/dist/{casesRepository.d-CVG2EXcg.d.cts → casesRepository.d-DFwD2kiS.d.cts} +1 -1
- package/dist/{casesRepository.d-CHEjzT4h.d.ts → casesRepository.d-VzxEyq2N.d.ts} +1 -1
- package/dist/chat/index.cjs +14 -13
- package/dist/chat/index.d.cts +13 -13
- package/dist/chat/index.d.ts +13 -13
- package/dist/chat/index.js +14 -13
- package/dist/chat/lite/index.cjs +14 -13
- package/dist/chat/lite/index.d.cts +13 -13
- package/dist/chat/lite/index.d.ts +13 -13
- package/dist/chat/lite/index.js +14 -13
- package/dist/chunk-Y3Q4GW47.js +31 -0
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +10 -10
- package/dist/client/index.d.ts +10 -10
- package/dist/client/index.js +1 -1
- package/dist/{clinicBatch.d-DdlFy4pD.d.cts → clinicBatch.d-CLqaih2C.d.cts} +2 -2
- package/dist/{clinicBatch.d-oNwH_dbI.d.ts → clinicBatch.d-DXDIL1lC.d.ts} +2 -2
- package/dist/{config.d-Cy_hJBJG.d.cts → config.d-7bCXvOGn.d.cts} +1 -1
- package/dist/{config.d-DopRLD4f.d.ts → config.d-cqyvpzDb.d.ts} +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context.d-C42juGn6.d.cts → context.d-BeRanUXQ.d.cts} +7 -7
- package/dist/{context.d-Ban-Hhqu.d.ts → context.d-DAnmDYGr.d.ts} +7 -7
- package/dist/{copy.d-BTS5l6Ri.d.cts → copy.d-BPqs8swm.d.cts} +2 -2
- package/dist/{copy.d-qdbygul9.d.ts → copy.d-CxFzeuvo.d.ts} +2 -2
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +17 -17
- package/dist/core/index.d.ts +17 -17
- package/dist/core/index.js +1 -1
- package/dist/{depth.d-BGkHm2Se.d.ts → depth.d-C6XbnFig.d.ts} +2 -2
- package/dist/{depth.d-BfVrhq9o.d.cts → depth.d-qHdXHDd-.d.cts} +2 -2
- package/dist/{entitlementRepository.d-npT7L_7_.d.cts → entitlementRepository.d-C6uTDswj.d.cts} +4 -4
- package/dist/{entitlementRepository.d-CjwqCyhS.d.ts → entitlementRepository.d-D_cc7g4l.d.ts} +4 -4
- package/dist/{focus.d-S0nq_k1A.d.ts → focus.d-DiWvQR2j.d.ts} +193 -21
- package/dist/{focus.d-DS7Ze1Pp.d.cts → focus.d-HSkMHd-i.d.cts} +193 -21
- package/dist/health-plan/index.cjs +261 -176
- package/dist/health-plan/index.d.cts +627 -19
- package/dist/health-plan/index.d.ts +627 -19
- package/dist/health-plan/index.js +261 -176
- package/dist/{idempotency.d-COIrwuCb.d.ts → idempotency.d-CF5AvlYp.d.ts} +18 -639
- package/dist/{idempotency.d-gfiN4Qnp.d.cts → idempotency.d-DrO2zEZO.d.cts} +18 -639
- package/dist/{identity.d-D76vXtkJ.d.cts → identity.d-84x0dV7-.d.cts} +1 -1
- package/dist/{identity.d-B3mFvvRq.d.ts → identity.d-BXztMVYM.d.ts} +1 -1
- package/dist/index.cjs +12 -11
- package/dist/index.d.cts +21 -21
- package/dist/index.d.ts +21 -21
- package/dist/index.js +12 -11
- package/dist/{introEvents.d-3FLEemX3.d.cts → introEvents.d-Cwv72ER-.d.cts} +11 -11
- package/dist/{introEvents.d-BYnr37bd.d.ts → introEvents.d-DYU3znJs.d.ts} +11 -11
- package/dist/notifications/index.d.cts +4 -4
- package/dist/notifications/index.d.ts +4 -4
- package/dist/omsErrors.d-VF5tnr20.d.cts +633 -0
- package/dist/omsErrors.d-VF5tnr20.d.ts +633 -0
- package/dist/omsFields.d-BHntKIAH.d.cts +153 -0
- package/dist/omsFields.d-Cvfw8wWU.d.ts +153 -0
- package/dist/{optInView.d-DXRUGDiD.d.cts → optInView.d-4Hl4HbQh.d.cts} +3 -3
- package/dist/{optInView.d-BqFMcum4.d.ts → optInView.d-pq8tUTf6.d.ts} +3 -3
- package/dist/{parse.d-CY22hFxb.d.ts → parse.d-BJhhYfkv.d.ts} +1 -1
- package/dist/{parse.d-rvA_aRSO.d.cts → parse.d-D0v06qxx.d.cts} +1 -1
- package/dist/{pets.d-Cicz-aIO.d.ts → pets.d-1_CHpfgB.d.ts} +1 -1
- package/dist/{pets.d-RoHTZsaV.d.cts → pets.d-C4n-MDC4.d.cts} +1 -1
- package/dist/{petsRepository.d-DtAZf_Ja.d.ts → petsRepository.d-BuomdFjZ.d.ts} +1 -1
- package/dist/{petsRepository.d-BxMyt6Aj.d.cts → petsRepository.d-Dd95xh-M.d.cts} +1 -1
- package/dist/{ports.d-D7cjFUoL.d.cts → ports.d-Bf3tp7Pn.d.cts} +4 -4
- package/dist/{ports.d-DrgKa73F.d.ts → ports.d-ChZHFd-q.d.ts} +4 -4
- package/dist/{presentation.d-vy8kTGfR.d.cts → presentation.d-Bs8xQ4gD.d.cts} +4 -4
- package/dist/{presentation.d-vy8kTGfR.d.ts → presentation.d-Bs8xQ4gD.d.ts} +4 -4
- package/dist/records/depth/index.d.cts +9 -9
- package/dist/records/depth/index.d.ts +9 -9
- package/dist/records/index.cjs +11 -10
- package/dist/records/index.d.cts +24 -23
- package/dist/records/index.d.ts +24 -23
- package/dist/records/index.js +11 -10
- package/dist/{requestFunnel.d-BdQf53zs.d.cts → requestFunnel.d-CWI2pD3V.d.cts} +2 -2
- package/dist/{requestFunnel.d-B5y7Py8Z.d.ts → requestFunnel.d-DcQIAs45.d.ts} +2 -2
- package/dist/{resolve.d-CoQWUy1Y.d.cts → resolve.d-BTC3b6FW.d.cts} +1 -1
- package/dist/{resolve.d-CoQWUy1Y.d.ts → resolve.d-BTC3b6FW.d.ts} +1 -1
- package/dist/{runtimeTypes.d-r4Q5vASZ.d.cts → runtimeTypes.d-CIOVzjEK.d.cts} +6 -6
- package/dist/{runtimeTypes.d-D5EDgS3Y.d.ts → runtimeTypes.d-rbuONrIv.d.ts} +6 -6
- package/dist/{screenProps.d-v4a4kzxA.d.cts → screenProps.d-CFZe27oI.d.cts} +1 -1
- package/dist/{screenProps.d-KLCrP43b.d.ts → screenProps.d-yUA4k6yK.d.ts} +1 -1
- package/dist/server/events/index.cjs +2 -2
- package/dist/server/events/index.d.cts +49 -6
- package/dist/server/events/index.d.ts +49 -6
- package/dist/server/events/index.js +2 -2
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/shop/index.cjs +6 -6
- package/dist/shop/index.d.cts +9 -8
- package/dist/shop/index.d.ts +9 -8
- package/dist/shop/index.js +6 -6
- package/dist/shop/orders-v2/index.d.cts +2 -2
- package/dist/shop/orders-v2/index.d.ts +2 -2
- package/dist/tabs/index.cjs +4 -4
- package/dist/tabs/index.d.cts +14 -14
- package/dist/tabs/index.d.ts +14 -14
- package/dist/tabs/index.js +4 -4
- package/dist/{tabsModel.d-B7QMug1u.d.ts → tabsModel.d-D9GWPFrL.d.cts} +1 -1
- package/dist/{tabsModel.d-B7QMug1u.d.cts → tabsModel.d-D9GWPFrL.d.ts} +1 -1
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.d.cts +85 -2
- package/dist/testing/index.d.ts +85 -2
- package/dist/testing/index.js +1 -1
- package/dist/testing/rn/index.d.cts +10 -10
- package/dist/testing/rn/index.d.ts +10 -10
- package/dist/testing/web/index.d.cts +10 -10
- package/dist/testing/web/index.d.ts +10 -10
- package/dist/texting/index.d.cts +6 -6
- package/dist/texting/index.d.ts +6 -6
- package/dist/{threadOptions.d-EFJaNBP1.d.cts → threadOptions.d-CRbFXnlq.d.cts} +66 -11
- package/dist/{threadOptions.d-GPJPprkn.d.cts → threadOptions.d-CW51PyVd.d.cts} +28 -1
- package/dist/{threadOptions.d-GPJPprkn.d.ts → threadOptions.d-CW51PyVd.d.ts} +28 -1
- package/dist/{threadOptions.d-B0folrKm.d.cts → threadOptions.d-U5YBUKM-.d.ts} +2 -2
- package/dist/{threadOptions.d-Crh_LiDe.d.ts → threadOptions.d-aK8FkszA.d.ts} +66 -11
- package/dist/{threadOptions.d-DTsJFkL-.d.ts → threadOptions.d-bEAFkIsC.d.cts} +2 -2
- package/dist/{timelineRows.d-DpSis9HR.d.ts → timelineRows.d-BbCLvjy1.d.ts} +1 -1
- package/dist/{timelineRows.d-6-Cw8xGd.d.cts → timelineRows.d-BvA_BoOe.d.cts} +1 -1
- package/dist/{typeStyle.d-B3Kdtjie.d.ts → typeStyle.d-B9Jo5mDX.d.ts} +1 -1
- package/dist/{typeStyle.d-DmlwyJq-.d.cts → typeStyle.d-Ckdh_S-t.d.cts} +1 -1
- package/dist/types.d-d3RdaeAA.d.cts +317 -0
- package/dist/types.d-d3RdaeAA.d.ts +317 -0
- package/dist/ui/index.cjs +68 -0
- package/dist/ui/index.d.cts +73 -0
- package/dist/ui/index.d.ts +73 -0
- package/dist/ui/index.js +68 -0
- package/dist/useHealthPlanSubscription.d-BN40CVK6.d.cts +756 -0
- package/dist/useHealthPlanSubscription.d-BYehTI7R.d.ts +756 -0
- package/dist/{usePresentation.d-CRG3Gaaq.d.ts → usePresentation.d-BfcyAEFt.d.ts} +66 -7
- package/dist/{usePresentation.d-C8rqY56C.d.cts → usePresentation.d-C39kKhoO.d.cts} +66 -7
- package/dist/{useRecordsDepth.d-DlRda5jp.d.ts → useRecordsDepth.d-B2ewVbRm.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-BYk7m7gF.d.cts → useRecordsDepth.d-CKXAAHXI.d.cts} +1 -1
- package/dist/{view.d-DuIXHr08.d.ts → view.d-BnUDSQXz.d.ts} +3 -3
- package/dist/{view.d-B31M8rCG.d.cts → view.d-CbcJKNJj.d.cts} +1 -1
- package/dist/{view.d-B31M8rCG.d.ts → view.d-CbcJKNJj.d.ts} +1 -1
- package/dist/{view.d-CLpEHKOp.d.cts → view.d-DTNPjiZ1.d.cts} +3 -3
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/health-plan/index.cjs +335 -180
- package/dist/web/health-plan/index.d.cts +576 -19
- package/dist/web/health-plan/index.d.ts +576 -19
- package/dist/web/health-plan/index.js +297 -162
- package/dist/web/health-plan/styles.css +233 -0
- package/dist/web/health-plan/today/index.cjs +7 -0
- package/dist/web/health-plan/today/index.d.cts +15 -0
- package/dist/web/health-plan/today/index.d.ts +15 -0
- package/dist/web/health-plan/today/index.js +7 -0
- package/dist/web/index.cjs +36 -33
- package/dist/web/index.d.cts +60 -37
- package/dist/web/index.d.ts +60 -37
- package/dist/web/index.js +36 -33
- package/dist/web/intro/index.cjs +2 -2
- package/dist/web/intro/index.d.cts +8 -8
- package/dist/web/intro/index.d.ts +8 -8
- package/dist/web/intro/index.js +2 -2
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/records/depth/index.d.cts +9 -9
- package/dist/web/records/depth/index.d.ts +9 -9
- package/dist/web/records/index.cjs +1 -1
- package/dist/web/records/index.d.cts +11 -11
- package/dist/web/records/index.d.ts +11 -11
- package/dist/web/records/index.js +1 -1
- package/dist/web/records-sheet/index.cjs +13 -12
- package/dist/web/records-sheet/index.d.cts +13 -10
- package/dist/web/records-sheet/index.d.ts +13 -10
- package/dist/web/records-sheet/index.js +13 -12
- package/dist/web/shop/index.cjs +6 -6
- package/dist/web/shop/index.d.cts +8 -7
- package/dist/web/shop/index.d.ts +8 -7
- package/dist/web/shop/index.js +6 -6
- package/dist/web/shop/orders-v2/index.d.cts +1 -1
- package/dist/web/shop/orders-v2/index.d.ts +1 -1
- package/dist/web/televet/booking/index.cjs +1 -1
- package/dist/web/televet/booking/index.d.cts +6 -6
- package/dist/web/televet/booking/index.d.ts +6 -6
- package/dist/web/televet/booking/index.js +1 -1
- package/dist/web/texting/index.cjs +1 -1
- package/dist/web/texting/index.d.cts +6 -6
- package/dist/web/texting/index.d.ts +6 -6
- package/dist/web/texting/index.js +1 -1
- package/dist/web/ui/index.cjs +70 -0
- package/dist/web/ui/index.d.cts +78 -0
- package/dist/web/ui/index.d.ts +78 -0
- package/dist/web/ui/index.js +48 -0
- package/dist/web/ui/styles.css +244 -0
- package/package.json +71 -5
- package/ui/package.json +8 -0
- package/web/health-plan/today/native-blocked.cjs +12 -0
- package/web/health-plan/today/package.json +8 -0
- package/web/ui/native-blocked.cjs +12 -0
- package/web/ui/package.json +8 -0
- package/dist/useHealthPlanSubscription.d-DD30EkUR.d.ts +0 -205
- package/dist/useHealthPlanSubscription.d-DWrzUXf4.d.cts +0 -205
|
@@ -0,0 +1,756 @@
|
|
|
1
|
+
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
+
import { f as HealthPlanFocusIcon, m as HealthPlanFocusPrices, c as HealthPlanFocusDesign, b as HealthPlanItem, n as HealthPlanFocusExtra, o as HealthPlanFocusWait, p as HealthPlan, j as HealthPlanPageRepository, H as HealthPlanPage, q as HealthPlanRepository, i as HealthPlanSubscriptionRepository, r as HealthPlanSubscriptionQuote, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder } from './focus.d-HSkMHd-i.cjs';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { P as PetRef } from './ids.d-B2GAAifq.cjs';
|
|
5
|
+
import { d as HealthPlanCart } from './usePresentation.d-C39kKhoO.cjs';
|
|
6
|
+
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
|
|
7
|
+
import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.cjs';
|
|
8
|
+
import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The vet, one setting (`design.byline`): every vet mention reads it.
|
|
12
|
+
*
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
type HealthPlanVet = NonNullable<HealthPlanFocusDesign['byline']>;
|
|
16
|
+
/**
|
|
17
|
+
* The focus card's content (`design.focus`).
|
|
18
|
+
*
|
|
19
|
+
* @beta
|
|
20
|
+
*/
|
|
21
|
+
type HealthPlanFocusContent = NonNullable<HealthPlanFocusDesign['focus']>;
|
|
22
|
+
/**
|
|
23
|
+
* One icon and label (the trust row, a checkout fact without its value).
|
|
24
|
+
*
|
|
25
|
+
* @beta
|
|
26
|
+
*/
|
|
27
|
+
interface HealthPlanIconLabel {
|
|
28
|
+
readonly icon: HealthPlanFocusIcon;
|
|
29
|
+
readonly label: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One checkout fact ("Pay with", "Test card").
|
|
33
|
+
*
|
|
34
|
+
* @beta
|
|
35
|
+
*/
|
|
36
|
+
interface HealthPlanFactRow {
|
|
37
|
+
readonly icon: HealthPlanFocusIcon;
|
|
38
|
+
readonly label: string;
|
|
39
|
+
readonly value: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Subscribe, or one box.
|
|
43
|
+
*
|
|
44
|
+
* @beta
|
|
45
|
+
*/
|
|
46
|
+
type HealthPlanBuyMode = 'sub' | 'once';
|
|
47
|
+
/**
|
|
48
|
+
* The shop's row over the page: the eyebrow on the left, the orders and the cart (with its count) on the right.
|
|
49
|
+
*
|
|
50
|
+
* @beta
|
|
51
|
+
*/
|
|
52
|
+
interface HealthPlanToolbarData {
|
|
53
|
+
readonly eyebrow?: string | undefined;
|
|
54
|
+
readonly cartCount: number;
|
|
55
|
+
readonly onOpenOrders: () => void;
|
|
56
|
+
readonly onOpenCart: () => void;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The page's head: the eyebrow (omit it when the toolbar carries it), the title, the line under it and the photo.
|
|
60
|
+
*
|
|
61
|
+
* @beta
|
|
62
|
+
*/
|
|
63
|
+
interface HealthPlanHeaderData {
|
|
64
|
+
readonly eyebrow?: string | undefined;
|
|
65
|
+
readonly title: string;
|
|
66
|
+
readonly subtitle?: string | undefined;
|
|
67
|
+
readonly imageUrl?: string | undefined;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* "Built with {name}": the vet's photo, name and role.
|
|
71
|
+
*
|
|
72
|
+
* @beta
|
|
73
|
+
*/
|
|
74
|
+
interface HealthPlanBylineData {
|
|
75
|
+
readonly vet: HealthPlanVet;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* One row that asks for something (her vet records, her weight): an icon, a title, a line and the whole row a button.
|
|
79
|
+
*
|
|
80
|
+
* @beta
|
|
81
|
+
*/
|
|
82
|
+
interface HealthPlanAskRowData {
|
|
83
|
+
readonly icon: HealthPlanFocusIcon;
|
|
84
|
+
readonly title: string;
|
|
85
|
+
readonly body: string;
|
|
86
|
+
readonly onPress: () => void;
|
|
87
|
+
/** Drawn inside a section (its own spacing). */
|
|
88
|
+
readonly inSection?: boolean | undefined;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The waiting card (`design.wait`): the plan's sections give way to it.
|
|
92
|
+
*
|
|
93
|
+
* @beta
|
|
94
|
+
*/
|
|
95
|
+
interface HealthPlanWaitCardData {
|
|
96
|
+
readonly wait: HealthPlanFocusWait;
|
|
97
|
+
readonly vetName?: string | null | undefined;
|
|
98
|
+
readonly onAction?: (() => void) | undefined;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The strip under the focus card that jumps to the pick. Without `onJump` it is not a control.
|
|
102
|
+
*
|
|
103
|
+
* @beta
|
|
104
|
+
*/
|
|
105
|
+
interface HealthPlanJumpStripData {
|
|
106
|
+
readonly title: string;
|
|
107
|
+
readonly go: string;
|
|
108
|
+
/** The small line over the title (`copy.jumpKicker`); null draws none. */
|
|
109
|
+
readonly kicker: string | null;
|
|
110
|
+
readonly imageUrl?: string | null | undefined;
|
|
111
|
+
readonly onJump?: (() => void) | undefined;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The vet's note in the focus card: the vet's photo and short name, the words and their tag.
|
|
115
|
+
*
|
|
116
|
+
* @beta
|
|
117
|
+
*/
|
|
118
|
+
interface HealthPlanVetQuoteData {
|
|
119
|
+
readonly quote: NonNullable<HealthPlanFocusContent['quote']>;
|
|
120
|
+
readonly vet: HealthPlanVet;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The focus card: the kicker and sources, the title, the risk, the odds, the vet's note and the jump strip.
|
|
124
|
+
*
|
|
125
|
+
* @beta
|
|
126
|
+
*/
|
|
127
|
+
interface HealthPlanFocusCardData {
|
|
128
|
+
readonly focus: HealthPlanFocusContent;
|
|
129
|
+
/** The vet; null hides the vet's note. */
|
|
130
|
+
readonly vet: HealthPlanVet | null;
|
|
131
|
+
/** The jump strip; null draws none. */
|
|
132
|
+
readonly jump?: HealthPlanJumpStripData | null | undefined;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The free tips (`design.routine`), numbered as a section of the page.
|
|
136
|
+
*
|
|
137
|
+
* @beta
|
|
138
|
+
*/
|
|
139
|
+
interface HealthPlanTipsData {
|
|
140
|
+
readonly routine: NonNullable<HealthPlanFocusDesign['routine']>;
|
|
141
|
+
/** The section's number on the page. */
|
|
142
|
+
readonly number: number;
|
|
143
|
+
/** The vet's short name for "From {name}" on a vet's tip; absent, that line hides. */
|
|
144
|
+
readonly vetShortName?: string | null | undefined;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* No product for her (`pick.none`): one line in place of the pick.
|
|
148
|
+
*
|
|
149
|
+
* @beta
|
|
150
|
+
*/
|
|
151
|
+
interface HealthPlanNoPickData {
|
|
152
|
+
readonly text: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The pick: its section head, the product's photo, title, stars and line, then the parts passed as children.
|
|
156
|
+
*
|
|
157
|
+
* @beta
|
|
158
|
+
*/
|
|
159
|
+
interface HealthPlanProductPickData {
|
|
160
|
+
readonly item: HealthPlanItem;
|
|
161
|
+
readonly pick: HealthPlanFocusDesign['pick'];
|
|
162
|
+
/** The section's number on the page. */
|
|
163
|
+
readonly number: number;
|
|
164
|
+
/** The "Why this product?" link (`pick.more`); omit it and the link is not drawn. */
|
|
165
|
+
readonly onMore?: (() => void) | undefined;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The pick's reviews (`pick.reviews`), a row of cards.
|
|
169
|
+
*
|
|
170
|
+
* @beta
|
|
171
|
+
*/
|
|
172
|
+
interface HealthPlanReviewsData {
|
|
173
|
+
readonly reviews: NonNullable<HealthPlanFocusDesign['pick']['reviews']>;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Why it fits her (`pick.why`): the reason rows and, with two or more, the fit score.
|
|
177
|
+
*
|
|
178
|
+
* @beta
|
|
179
|
+
*/
|
|
180
|
+
interface HealthPlanWhyItFitsData {
|
|
181
|
+
readonly why: NonNullable<HealthPlanFocusDesign['pick']['why']>;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The dose card (`pick.dose`).
|
|
185
|
+
*
|
|
186
|
+
* @beta
|
|
187
|
+
*/
|
|
188
|
+
interface HealthPlanDoseCardData {
|
|
189
|
+
readonly dose: NonNullable<HealthPlanFocusDesign['pick']['dose']>;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The ingredients line (`pick.ingredients`).
|
|
193
|
+
*
|
|
194
|
+
* @beta
|
|
195
|
+
*/
|
|
196
|
+
interface HealthPlanIngredientsData {
|
|
197
|
+
readonly ingredients: NonNullable<HealthPlanFocusDesign['pick']['ingredients']>;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Subscribe or one box: two radio cards with their prices.
|
|
201
|
+
*
|
|
202
|
+
* @beta
|
|
203
|
+
*/
|
|
204
|
+
interface HealthPlanBuyOptionsData {
|
|
205
|
+
readonly mode: HealthPlanBuyMode;
|
|
206
|
+
readonly onModeChange: (mode: HealthPlanBuyMode) => void;
|
|
207
|
+
readonly prices: HealthPlanFocusPrices;
|
|
208
|
+
/** The first-box offer applies: "Best value" and the struck box price. */
|
|
209
|
+
readonly offer: boolean;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The buy button (Subscribe, Buy once, Add to cart, View cart).
|
|
213
|
+
*
|
|
214
|
+
* @beta
|
|
215
|
+
*/
|
|
216
|
+
interface HealthPlanBuyButtonData {
|
|
217
|
+
readonly label: string;
|
|
218
|
+
readonly onPress: () => void;
|
|
219
|
+
readonly disabled?: boolean | undefined;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* The pick's social proof line (`pick.proof`).
|
|
223
|
+
*
|
|
224
|
+
* @beta
|
|
225
|
+
*/
|
|
226
|
+
interface HealthPlanProofData {
|
|
227
|
+
readonly text: string;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* The trust row under the buy button.
|
|
231
|
+
*
|
|
232
|
+
* @beta
|
|
233
|
+
*/
|
|
234
|
+
interface HealthPlanTrustRowData {
|
|
235
|
+
readonly items: readonly HealthPlanIconLabel[];
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* The pick is subscribed: the check, the line with the next box and Manage.
|
|
239
|
+
*
|
|
240
|
+
* @beta
|
|
241
|
+
*/
|
|
242
|
+
interface HealthPlanSubscribedBoxData {
|
|
243
|
+
readonly prices: HealthPlanFocusPrices;
|
|
244
|
+
/** The next box's day ("Nov 20"), or null when unknown. */
|
|
245
|
+
readonly nextBoxDay: string | null;
|
|
246
|
+
readonly onManage: () => void;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* One of the plan's other items, with its button already worded.
|
|
250
|
+
*
|
|
251
|
+
* @beta
|
|
252
|
+
*/
|
|
253
|
+
interface HealthPlanOtherItemRow {
|
|
254
|
+
readonly item: HealthPlanItem;
|
|
255
|
+
readonly buyLabel: string;
|
|
256
|
+
readonly buyDisabled: boolean;
|
|
257
|
+
readonly onBuy: () => void;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* The plan's other items under the pick.
|
|
261
|
+
*
|
|
262
|
+
* @beta
|
|
263
|
+
*/
|
|
264
|
+
interface HealthPlanOtherItemsData {
|
|
265
|
+
readonly items: readonly HealthPlanOtherItemRow[];
|
|
266
|
+
/** Draws each item's category over its title. */
|
|
267
|
+
readonly showCategory?: boolean | undefined;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* The signs to watch (`design.signs`), numbered; the checkup questions and an ask row may follow as children.
|
|
271
|
+
*
|
|
272
|
+
* @beta
|
|
273
|
+
*/
|
|
274
|
+
interface HealthPlanSignsData {
|
|
275
|
+
readonly signs: NonNullable<HealthPlanFocusDesign['signs']>;
|
|
276
|
+
readonly number: number;
|
|
277
|
+
/** The title for a "call the vet" sign (no vet yet, no records); absent, the sign's own. */
|
|
278
|
+
readonly callVetTitle?: string | undefined;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* The checkup questions (`design.checkup`) and the button that adds them to the next visit.
|
|
282
|
+
*
|
|
283
|
+
* @beta
|
|
284
|
+
*/
|
|
285
|
+
interface HealthPlanCheckupData {
|
|
286
|
+
readonly checkup: NonNullable<HealthPlanFocusDesign['checkup']>;
|
|
287
|
+
readonly added: boolean;
|
|
288
|
+
/** The button's words ('' hides the button). */
|
|
289
|
+
readonly addLabel: string;
|
|
290
|
+
readonly onToggle: (questions: readonly string[]) => void;
|
|
291
|
+
/** Under its own small kicker inside the signs section, or a numbered section of its own. */
|
|
292
|
+
readonly variant: 'kicker' | 'section';
|
|
293
|
+
/** The section's number (variant `section`). */
|
|
294
|
+
readonly number?: number | undefined;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* One extra offer, with its state and button already worded.
|
|
298
|
+
*
|
|
299
|
+
* @beta
|
|
300
|
+
*/
|
|
301
|
+
interface HealthPlanExtraRow {
|
|
302
|
+
readonly extra: HealthPlanFocusExtra;
|
|
303
|
+
/** The price to draw, or null. */
|
|
304
|
+
readonly price: string | null;
|
|
305
|
+
readonly on: boolean;
|
|
306
|
+
readonly label: string;
|
|
307
|
+
readonly onPress: () => void;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* The extras (`design.extras`): the partner's offers.
|
|
311
|
+
*
|
|
312
|
+
* @beta
|
|
313
|
+
*/
|
|
314
|
+
interface HealthPlanExtrasData {
|
|
315
|
+
readonly title: string;
|
|
316
|
+
readonly items: readonly HealthPlanExtraRow[];
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* The page's fine print (`design.fine`).
|
|
320
|
+
*
|
|
321
|
+
* @beta
|
|
322
|
+
*/
|
|
323
|
+
interface HealthPlanFineData {
|
|
324
|
+
readonly text: string;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* The toast: one line, or null for none.
|
|
328
|
+
*
|
|
329
|
+
* @beta
|
|
330
|
+
*/
|
|
331
|
+
interface HealthPlanToastData {
|
|
332
|
+
readonly message: string | null;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* The checkout sheet's body: the product, Subscribe or one box (with ship-every), the facts and the button.
|
|
336
|
+
*
|
|
337
|
+
* @beta
|
|
338
|
+
*/
|
|
339
|
+
interface HealthPlanCheckoutSheetData {
|
|
340
|
+
readonly item: HealthPlanItem;
|
|
341
|
+
/** The product's line in the sheet ('' draws none). */
|
|
342
|
+
readonly line: string;
|
|
343
|
+
/** The prices at the chosen interval. */
|
|
344
|
+
readonly prices: HealthPlanFocusPrices;
|
|
345
|
+
readonly mode: HealthPlanBuyMode;
|
|
346
|
+
readonly every: number;
|
|
347
|
+
readonly intervals: readonly number[];
|
|
348
|
+
readonly offer: boolean;
|
|
349
|
+
/** A one-box discount applies (its offer line is drawn). */
|
|
350
|
+
readonly oneBoxOffer: boolean;
|
|
351
|
+
readonly rows: readonly HealthPlanFactRow[];
|
|
352
|
+
readonly busy: boolean;
|
|
353
|
+
readonly confirmDisabled: boolean;
|
|
354
|
+
readonly onModeChange: (mode: HealthPlanBuyMode) => void;
|
|
355
|
+
readonly onEveryChange: (days: number) => void;
|
|
356
|
+
readonly onConfirm: () => void;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* The manage sheet's body: the product, ship-every, skip, cancel and (with the shop) her orders.
|
|
360
|
+
*
|
|
361
|
+
* @beta
|
|
362
|
+
*/
|
|
363
|
+
interface HealthPlanManageSheetData {
|
|
364
|
+
readonly item: HealthPlanItem;
|
|
365
|
+
readonly prices: HealthPlanFocusPrices;
|
|
366
|
+
readonly nextBoxDay: string | null;
|
|
367
|
+
readonly every: number;
|
|
368
|
+
readonly intervals: readonly number[];
|
|
369
|
+
readonly busy: boolean;
|
|
370
|
+
readonly onEveryChange: (days: number) => void;
|
|
371
|
+
readonly onSkip: () => void;
|
|
372
|
+
readonly onCancel: () => void;
|
|
373
|
+
/** "See her orders"; null draws none. */
|
|
374
|
+
readonly onSeeOrders?: (() => void) | null | undefined;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* The weight sheet's body: the field (in the unit), the error and Save.
|
|
378
|
+
*
|
|
379
|
+
* @beta
|
|
380
|
+
*/
|
|
381
|
+
interface HealthPlanWeightSheetData {
|
|
382
|
+
readonly prices: HealthPlanFocusPrices;
|
|
383
|
+
readonly value: string;
|
|
384
|
+
readonly onChange: (text: string) => void;
|
|
385
|
+
/** '' draws none. */
|
|
386
|
+
readonly error: string;
|
|
387
|
+
readonly saving: boolean;
|
|
388
|
+
readonly unit: 'lb' | 'kg';
|
|
389
|
+
readonly onSave: () => void;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* One row of a done screen: a tile (an icon, or a photo), a small day and a line.
|
|
393
|
+
*
|
|
394
|
+
* @beta
|
|
395
|
+
*/
|
|
396
|
+
interface HealthPlanNextRow {
|
|
397
|
+
readonly key: string;
|
|
398
|
+
readonly icon: HealthPlanFocusIcon;
|
|
399
|
+
/** A photo in place of the icon. */
|
|
400
|
+
readonly imageUrl?: string | null | undefined;
|
|
401
|
+
readonly when: string;
|
|
402
|
+
readonly what: string;
|
|
403
|
+
/** A product's row: its tile clips the photo (or the box icon standing in for it). */
|
|
404
|
+
readonly product?: boolean | undefined;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* The plan started (or the box ordered): the check, the title, when and who, and what comes next.
|
|
408
|
+
*
|
|
409
|
+
* @beta
|
|
410
|
+
*/
|
|
411
|
+
interface HealthPlanStartedData {
|
|
412
|
+
readonly title: string;
|
|
413
|
+
/** '' draws none. */
|
|
414
|
+
readonly what: string;
|
|
415
|
+
/** '' draws none. */
|
|
416
|
+
readonly note: string;
|
|
417
|
+
readonly steps: readonly HealthPlanNextRow[];
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* The order placed from the cart: the check, the title, when it arrives, its number, its rows and its total.
|
|
421
|
+
*
|
|
422
|
+
* @beta
|
|
423
|
+
*/
|
|
424
|
+
interface HealthPlanPlacedData {
|
|
425
|
+
readonly title: string;
|
|
426
|
+
/** The day it arrives by (worded "Arrives by {day}"); null draws none. */
|
|
427
|
+
readonly arrives: string | null;
|
|
428
|
+
/** The order's number (worded "Order {number}"); null draws none. */
|
|
429
|
+
readonly orderNumber: string | null;
|
|
430
|
+
readonly rows: readonly HealthPlanNextRow[];
|
|
431
|
+
/** The total of several orders; null draws none. */
|
|
432
|
+
readonly total: string | null;
|
|
433
|
+
/** '' draws none. */
|
|
434
|
+
readonly note: string;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* The cart's handlers: quantity, remove, the Subscribe / One box choice, ship-every and "See her orders".
|
|
438
|
+
*
|
|
439
|
+
* @beta
|
|
440
|
+
*/
|
|
441
|
+
interface HealthPlanCartHandlers {
|
|
442
|
+
readonly onQuantity: (key: string, by: number) => void;
|
|
443
|
+
readonly onRemove: (key: string) => void;
|
|
444
|
+
readonly onMode: (key: string, mode: HealthPlanBuyMode) => void;
|
|
445
|
+
readonly onEvery: (key: string, days: number) => void;
|
|
446
|
+
readonly onOrders: () => void;
|
|
447
|
+
/** Web only: opens a line's product page (`productPage`, design round 14); the image and the name become its buttons. */
|
|
448
|
+
readonly onOpen?: (key: string) => void;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* One cart line as drawn: the facts are the server's, already formatted.
|
|
452
|
+
*
|
|
453
|
+
* @beta
|
|
454
|
+
*/
|
|
455
|
+
interface HealthPlanShopLineView {
|
|
456
|
+
readonly key: string;
|
|
457
|
+
readonly name: string;
|
|
458
|
+
readonly imageUrl: string | null;
|
|
459
|
+
readonly quantity: number;
|
|
460
|
+
readonly subscription: boolean;
|
|
461
|
+
/** The line's price today and, struck, the regular one. */
|
|
462
|
+
readonly price: string | null;
|
|
463
|
+
readonly was: string | null;
|
|
464
|
+
/** A small tag after the price (an extra's "Illustrative"). */
|
|
465
|
+
readonly tag?: string | null;
|
|
466
|
+
/** The line under the price. */
|
|
467
|
+
readonly note: string | null;
|
|
468
|
+
/** The Subscribe / One box choice (the pick, not yet subscribed). */
|
|
469
|
+
readonly modes: {
|
|
470
|
+
readonly label: string;
|
|
471
|
+
readonly sub: {
|
|
472
|
+
readonly label: string;
|
|
473
|
+
readonly price: string | null;
|
|
474
|
+
};
|
|
475
|
+
readonly once: {
|
|
476
|
+
readonly label: string;
|
|
477
|
+
readonly price: string | null;
|
|
478
|
+
};
|
|
479
|
+
} | null;
|
|
480
|
+
/** The interval chips of a subscription line. */
|
|
481
|
+
readonly every: {
|
|
482
|
+
readonly options: readonly number[];
|
|
483
|
+
readonly selected: number;
|
|
484
|
+
} | null;
|
|
485
|
+
readonly maxQuantity: number;
|
|
486
|
+
readonly lp: HealthPlanFocusPrices;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* A normalized order: an Everfur one-box order or a partner's own.
|
|
490
|
+
*
|
|
491
|
+
* @beta
|
|
492
|
+
*/
|
|
493
|
+
interface HealthPlanShopOrderView {
|
|
494
|
+
readonly key: string;
|
|
495
|
+
readonly number: string | null;
|
|
496
|
+
/** 0 ordered .. 3 delivered. */
|
|
497
|
+
readonly step: number;
|
|
498
|
+
readonly dates: readonly (string | null)[];
|
|
499
|
+
/** Everfur's own: only the steps it knows are drawn. */
|
|
500
|
+
readonly everfur: boolean;
|
|
501
|
+
/** The step indexes (0..3) the tracker draws; absent, every step up to `step` for Everfur's own, all four otherwise. */
|
|
502
|
+
readonly steps?: readonly number[] | undefined;
|
|
503
|
+
readonly productId: string | null;
|
|
504
|
+
readonly items: readonly {
|
|
505
|
+
readonly title: string;
|
|
506
|
+
readonly quantity: number;
|
|
507
|
+
readonly price: number;
|
|
508
|
+
readonly imageUrl: string | null;
|
|
509
|
+
readonly icon: HealthPlanFocusIcon | null;
|
|
510
|
+
}[];
|
|
511
|
+
readonly total: number;
|
|
512
|
+
readonly currency: string;
|
|
513
|
+
readonly subscriptionBox: boolean;
|
|
514
|
+
readonly carrier: string | null;
|
|
515
|
+
readonly trackingNumber: string | null;
|
|
516
|
+
readonly trackingTag: string | null;
|
|
517
|
+
readonly trackingUrl: string | null;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* The member's orders: the plan's subscription first, then every order, newest first; or, none, the empty state.
|
|
521
|
+
*
|
|
522
|
+
* @beta
|
|
523
|
+
*/
|
|
524
|
+
interface HealthPlanOrdersData {
|
|
525
|
+
readonly subscription: {
|
|
526
|
+
readonly name: string;
|
|
527
|
+
readonly imageUrl: string | null;
|
|
528
|
+
readonly next: string | null;
|
|
529
|
+
readonly every: number;
|
|
530
|
+
readonly onManage: () => void;
|
|
531
|
+
} | null;
|
|
532
|
+
readonly orders: readonly HealthPlanShopOrderView[];
|
|
533
|
+
/** False while the list is still being read: nothing is drawn for it yet. */
|
|
534
|
+
readonly loaded: boolean;
|
|
535
|
+
readonly fmt: (n: number, currency: string) => string | null;
|
|
536
|
+
readonly day: (iso: string | null | undefined) => string | null;
|
|
537
|
+
readonly onOpen: (key: string) => void;
|
|
538
|
+
readonly onBack: () => void;
|
|
539
|
+
readonly petPrices: HealthPlanFocusPrices;
|
|
540
|
+
/** The list has another page: a "more" control reads it (the web also reads it as the list's end comes into view). */
|
|
541
|
+
readonly more?: {
|
|
542
|
+
readonly onMore: () => void;
|
|
543
|
+
readonly loading: boolean;
|
|
544
|
+
} | null | undefined;
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* One order: its tracker (only the steps known), the carrier when known, what is in it, the total and the facts.
|
|
548
|
+
*
|
|
549
|
+
* @beta
|
|
550
|
+
*/
|
|
551
|
+
interface HealthPlanOrderData {
|
|
552
|
+
readonly order: HealthPlanShopOrderView;
|
|
553
|
+
readonly fmt: (n: number, currency: string) => string | null;
|
|
554
|
+
readonly day: (iso: string | null | undefined) => string | null;
|
|
555
|
+
readonly rows: readonly HealthPlanFactRow[];
|
|
556
|
+
readonly onBuyAgain: (() => void) | null;
|
|
557
|
+
readonly onHelp: (() => void) | null;
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* The cart checkout sheet's body: the lines, the partner's facts, the summary, the one button and the fine print.
|
|
561
|
+
*
|
|
562
|
+
* @beta
|
|
563
|
+
*/
|
|
564
|
+
interface HealthPlanCartCheckoutData {
|
|
565
|
+
/** The lines checked out together. */
|
|
566
|
+
readonly lines: readonly HealthPlanShopLineView[];
|
|
567
|
+
/** A line's total, formatted, or null (draws none). */
|
|
568
|
+
readonly lineTotal: (line: HealthPlanShopLineView) => string | null;
|
|
569
|
+
/** The partner's checkout facts ("Pay with"). */
|
|
570
|
+
readonly rows: readonly HealthPlanFactRow[];
|
|
571
|
+
/** The total, formatted. */
|
|
572
|
+
readonly total: string;
|
|
573
|
+
/** A subscription line's renewal prices (its line under the total), or null. */
|
|
574
|
+
readonly renew: HealthPlanFocusPrices | null;
|
|
575
|
+
/** The one button: Place order. */
|
|
576
|
+
readonly place: {
|
|
577
|
+
readonly label: string;
|
|
578
|
+
readonly disabled: boolean;
|
|
579
|
+
readonly onPress: () => void;
|
|
580
|
+
};
|
|
581
|
+
/** The fine print ('' draws none). */
|
|
582
|
+
readonly fine: string;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* The cart's body: its lines (steppers, Subscribe or one box, ship-every), the summary and her orders; or, empty, the
|
|
586
|
+
* empty state.
|
|
587
|
+
*
|
|
588
|
+
* @beta
|
|
589
|
+
*/
|
|
590
|
+
interface HealthPlanCartScreenData {
|
|
591
|
+
readonly lines: readonly HealthPlanShopLineView[];
|
|
592
|
+
/** The subtotal, formatted. */
|
|
593
|
+
readonly subtotal: string;
|
|
594
|
+
/** A subscription line's renewal prices, or null. */
|
|
595
|
+
readonly renew: HealthPlanFocusPrices | null;
|
|
596
|
+
/** The pet's prices (the empty state's words). */
|
|
597
|
+
readonly petPrices: HealthPlanFocusPrices;
|
|
598
|
+
readonly handlers: HealthPlanCartHandlers;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/** What a docked bar needs, as the plan page last published it. */
|
|
602
|
+
interface HealthPlanCartDock {
|
|
603
|
+
/** The member's cart: the items in the plan, their count and subtotal. */
|
|
604
|
+
readonly cart: HealthPlanCart;
|
|
605
|
+
/** True while an add or remove is in flight (draw the checkout control disabled). */
|
|
606
|
+
readonly busy: boolean;
|
|
607
|
+
/** The pet whose plan the page shows, or null. */
|
|
608
|
+
readonly petRef: PetRef | null;
|
|
609
|
+
/** The plan the page shows, or null before it loads. */
|
|
610
|
+
readonly plan: HealthPlan | null;
|
|
611
|
+
/** Adds (`true`) or removes (`false`) one product, as the page's own control does. Resolves true when it took. */
|
|
612
|
+
readonly setInPlan: (productId: string, inPlan: boolean) => Promise<boolean>;
|
|
613
|
+
/** Adds every product not yet in the plan. Resolves true when every add took. */
|
|
614
|
+
readonly addAll: () => Promise<boolean>;
|
|
615
|
+
}
|
|
616
|
+
interface HealthPlanCartScopeProps {
|
|
617
|
+
readonly children?: ReactNode;
|
|
618
|
+
}
|
|
619
|
+
/** The scope a plan page with `cartBarPlacement: 'none'` publishes its cart to. Wrap the page and your bar in it. */
|
|
620
|
+
declare function HealthPlanCartScope({ children }: HealthPlanCartScopeProps): ReactNode;
|
|
621
|
+
/** The cart the plan page in the nearest `HealthPlanCartScope` published, or null (no scope, or no page yet). */
|
|
622
|
+
declare function useHealthPlanCartDock(): HealthPlanCartDock | null;
|
|
623
|
+
|
|
624
|
+
type HealthPlanPagePhase = 'idle' | 'loading' | 'failed' | 'ready';
|
|
625
|
+
interface HealthPlanPageOptions {
|
|
626
|
+
readonly petRef: PetRef | null;
|
|
627
|
+
/** False skips the read. Defaults to true. */
|
|
628
|
+
readonly enabled?: boolean;
|
|
629
|
+
/** A repository of your own (tests, a stub backend). Defaults to the one over the provider's runtime. */
|
|
630
|
+
readonly repository?: HealthPlanPageRepository;
|
|
631
|
+
/** Coming back to the foreground re-reads a page shown for more than a minute, quietly. Absent, it does not. */
|
|
632
|
+
readonly lifecycle?: LifecyclePort | null;
|
|
633
|
+
/** Change it to re-read the page now, quietly. */
|
|
634
|
+
readonly refreshKey?: string | number;
|
|
635
|
+
}
|
|
636
|
+
interface HealthPlanPageState {
|
|
637
|
+
readonly phase: HealthPlanPagePhase;
|
|
638
|
+
/** The answer for `petRef`, or null until it lands. */
|
|
639
|
+
readonly page: HealthPlanPage | null;
|
|
640
|
+
readonly error: EverfurError | null;
|
|
641
|
+
/** True when the read answered not found: this pet has no plan page. `phase` is then `ready` and `page` null. */
|
|
642
|
+
readonly missing: boolean;
|
|
643
|
+
refresh(): Promise<void>;
|
|
644
|
+
}
|
|
645
|
+
/** The plan page repository bound to the runtime under your provider. */
|
|
646
|
+
declare function useHealthPlanPageRepository(): HealthPlanPageRepository;
|
|
647
|
+
/** One pet's Health Plan page. Re-read when the pet changes. */
|
|
648
|
+
declare function useHealthPlanPage(options: HealthPlanPageOptions): HealthPlanPageState;
|
|
649
|
+
|
|
650
|
+
type HealthPlanPhase = 'idle' | 'loading' | 'failed' | 'ready';
|
|
651
|
+
interface HealthPlanSnapshot {
|
|
652
|
+
readonly phase: HealthPlanPhase;
|
|
653
|
+
readonly petRef: PetRef | null;
|
|
654
|
+
readonly plan: HealthPlan | null;
|
|
655
|
+
/** Product ids whose add or remove is in flight. */
|
|
656
|
+
readonly pending: readonly string[];
|
|
657
|
+
/** The last refused write per product id. */
|
|
658
|
+
readonly itemErrors: Readonly<Record<string, EverfurError>>;
|
|
659
|
+
/** The refused read, or null. */
|
|
660
|
+
readonly error: EverfurError | null;
|
|
661
|
+
}
|
|
662
|
+
declare class HealthPlanController {
|
|
663
|
+
private readonly repository;
|
|
664
|
+
private snapshot;
|
|
665
|
+
private readonly listeners;
|
|
666
|
+
private generation;
|
|
667
|
+
/** Bumped by every add or remove, so a quiet re-read that started before one never overwrites it. */
|
|
668
|
+
private writes;
|
|
669
|
+
/** Bumped by every quiet re-read, so an older one that settles after a newer one never overwrites it. */
|
|
670
|
+
private revalidations;
|
|
671
|
+
/** A host refresh asked for while a write was in flight: the quiet re-read runs once the last write settles. */
|
|
672
|
+
private refreshAfterWrites;
|
|
673
|
+
private disposed;
|
|
674
|
+
constructor(repository: HealthPlanRepository);
|
|
675
|
+
readonly subscribe: (listener: () => void) => (() => void);
|
|
676
|
+
readonly getSnapshot: () => HealthPlanSnapshot;
|
|
677
|
+
private set;
|
|
678
|
+
/** Read the plan for `petRef` (null clears to `idle`). A different pet drops the old plan before the read lands. */
|
|
679
|
+
load(petRef: PetRef | null): Promise<void>;
|
|
680
|
+
/**
|
|
681
|
+
* Re-read the shown plan WITHOUT a loading state (a member coming back to a page that sat open, a host's
|
|
682
|
+
* `refreshKey`). Only from `ready` with nothing in flight; the answer replaces the plan only while the same pet is
|
|
683
|
+
* shown and no add, remove or full read happened meanwhile. A refused re-read keeps the plan on screen.
|
|
684
|
+
*/
|
|
685
|
+
revalidate(): Promise<void>;
|
|
686
|
+
/**
|
|
687
|
+
* The host says the plan changed (its `refreshKey`), so the request is never dropped: from `ready` a quiet
|
|
688
|
+
* re-read, held until the last add or remove in flight settles; from `failed` or `loading` a full read for the
|
|
689
|
+
* shown pet (there is no plan to keep on screen, and a read in flight may predate the change).
|
|
690
|
+
*/
|
|
691
|
+
refresh(): Promise<void>;
|
|
692
|
+
private settleWrite;
|
|
693
|
+
/** Put an item in the plan (`true`) or take it out (`false`). Settles true when the server accepted it. */
|
|
694
|
+
setInPlan(productId: string, inPlan: boolean): Promise<boolean>;
|
|
695
|
+
dispose(): void;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/** Who said her records landed: the plan's own records read, or the host (a notification, the intro). */
|
|
699
|
+
type HealthPlanRecordsLandedSource = 'plan' | 'host';
|
|
700
|
+
/** Hears `notifyHealthPlanRecordsLanded`: which pet, and who said it. */
|
|
701
|
+
type HealthPlanRecordsLandedListener = (petRef: PetRef, source: HealthPlanRecordsLandedSource) => void;
|
|
702
|
+
/** Hears `setHealthPlanNoVet`: which pet, and whether it now has no vet. */
|
|
703
|
+
type HealthPlanNoVetListener = (petRef: PetRef, noVet: boolean) => void;
|
|
704
|
+
/**
|
|
705
|
+
* Says her records landed. The Health Plan reads her records again and, once they hold what her three blanks need,
|
|
706
|
+
* fills them with one yellow flash and the "Her records are in" toast. The plan calls it with `'plan'` when its own
|
|
707
|
+
* read sees them land; a host calls it (default `'host'`) from a notification or the intro.
|
|
708
|
+
*/
|
|
709
|
+
declare function notifyHealthPlanRecordsLanded(petRef: PetRef, source?: HealthPlanRecordsLandedSource): void;
|
|
710
|
+
/** Listens for `notifyHealthPlanRecordsLanded`. Returns the unsubscribe. */
|
|
711
|
+
declare function onHealthPlanRecordsLanded(listener: HealthPlanRecordsLandedListener): () => void;
|
|
712
|
+
/** Records that the member has no vet for this pet yet (true), or has one again (false). */
|
|
713
|
+
declare function setHealthPlanNoVet(petRef: PetRef, noVet: boolean): void;
|
|
714
|
+
/** True when `setHealthPlanNoVet(petRef, true)` was said for this pet on this page. */
|
|
715
|
+
declare function healthPlanNoVet(petRef: PetRef): boolean;
|
|
716
|
+
/** Listens for `setHealthPlanNoVet`. Returns the unsubscribe. */
|
|
717
|
+
declare function onHealthPlanNoVet(listener: HealthPlanNoVetListener): () => void;
|
|
718
|
+
|
|
719
|
+
type HealthPlanSubscriptionPhase = 'idle' | 'loading' | 'unavailable' | 'failed' | 'ready';
|
|
720
|
+
interface HealthPlanSubscriptionOptions {
|
|
721
|
+
readonly petRef: PetRef | null;
|
|
722
|
+
readonly productId: string | null;
|
|
723
|
+
/** False skips every read (a host that has not opted in). Defaults to true. */
|
|
724
|
+
readonly enabled?: boolean;
|
|
725
|
+
/** A repository of your own (tests, a stub backend). Defaults to the one over the provider's runtime. */
|
|
726
|
+
readonly repository?: HealthPlanSubscriptionRepository;
|
|
727
|
+
/** Coming back to the foreground re-reads a quote shown for more than a minute, quietly. Absent, it does not. */
|
|
728
|
+
readonly lifecycle?: LifecyclePort | null;
|
|
729
|
+
/** Change it to re-read the quote now, quietly (for example after your checkout completed). */
|
|
730
|
+
readonly refreshKey?: string | number;
|
|
731
|
+
}
|
|
732
|
+
interface HealthPlanSubscriptionState {
|
|
733
|
+
readonly phase: HealthPlanSubscriptionPhase;
|
|
734
|
+
readonly quote: HealthPlanSubscriptionQuote | null;
|
|
735
|
+
/** The member's row for this pet and product (active or cancelled), or null. */
|
|
736
|
+
readonly subscription: HealthPlanSubscription | null;
|
|
737
|
+
/** A write is in flight. */
|
|
738
|
+
readonly busy: boolean;
|
|
739
|
+
/** The last refused read or write, or null. */
|
|
740
|
+
readonly error: EverfurError | null;
|
|
741
|
+
/** Each write settles the server's new state, or the refusal (a write before the quote is ready is refused). */
|
|
742
|
+
subscribe(intervalDays: number): Promise<EverfurResult<HealthPlanSubscription>>;
|
|
743
|
+
changeInterval(intervalDays: number): Promise<EverfurResult<HealthPlanSubscription>>;
|
|
744
|
+
skip(): Promise<EverfurResult<HealthPlanSubscription>>;
|
|
745
|
+
cancel(): Promise<EverfurResult<HealthPlanSubscription>>;
|
|
746
|
+
restart(intervalDays?: number): Promise<EverfurResult<HealthPlanSubscription>>;
|
|
747
|
+
/** Buy one box (no renewal), then re-read the quote: a one-box order spends the first-box offer. */
|
|
748
|
+
buyOneBox(tapKey?: string): Promise<EverfurResult<HealthPlanOneBoxOrder>>;
|
|
749
|
+
refresh(): Promise<void>;
|
|
750
|
+
}
|
|
751
|
+
/** The subscription repository bound to the runtime under your provider. */
|
|
752
|
+
declare function useHealthPlanSubscriptionRepository(): HealthPlanSubscriptionRepository;
|
|
753
|
+
/** One product's subscription for one pet. `EverfurHealthPlan` with `layout="focus"` paints it. */
|
|
754
|
+
declare function useHealthPlanSubscription(options: HealthPlanSubscriptionOptions): HealthPlanSubscriptionState;
|
|
755
|
+
|
|
756
|
+
export { type HealthPlanRecordsLandedSource as $, type HealthPlanCheckoutSheetData as A, type HealthPlanManageSheetData as B, type HealthPlanWeightSheetData as C, type HealthPlanCartScreenData as D, type HealthPlanOrderData as E, type HealthPlanOrdersData as F, type HealthPlanPlacedData as G, type HealthPlanAskRowData as H, type HealthPlanStartedData as I, type HealthPlanBuyMode as J, type HealthPlanCartDock as K, type HealthPlanCartHandlers as L, HealthPlanCartScope as M, type HealthPlanCartScopeProps as N, HealthPlanController as O, type HealthPlanExtraRow as P, type HealthPlanFactRow as Q, type HealthPlanFocusContent as R, type HealthPlanIconLabel as S, type HealthPlanNextRow as T, type HealthPlanNoVetListener as U, type HealthPlanOtherItemRow as V, type HealthPlanPageOptions as W, type HealthPlanPagePhase as X, type HealthPlanPageState as Y, type HealthPlanPhase as Z, type HealthPlanRecordsLandedListener as _, type HealthPlanBylineData as a, type HealthPlanShopLineView as a0, type HealthPlanShopOrderView as a1, type HealthPlanSnapshot as a2, type HealthPlanSubscriptionOptions as a3, type HealthPlanSubscriptionPhase as a4, type HealthPlanSubscriptionState as a5, type HealthPlanVet as a6, healthPlanNoVet as a7, notifyHealthPlanRecordsLanded as a8, onHealthPlanNoVet as a9, onHealthPlanRecordsLanded as aa, setHealthPlanNoVet as ab, useHealthPlanCartDock as ac, useHealthPlanPage as ad, useHealthPlanPageRepository as ae, useHealthPlanSubscription as af, useHealthPlanSubscriptionRepository as ag, type HealthPlanCheckupData as b, type HealthPlanExtrasData as c, type HealthPlanFineData as d, type HealthPlanFocusCardData as e, type HealthPlanHeaderData as f, type HealthPlanJumpStripData as g, type HealthPlanNoPickData as h, type HealthPlanOtherItemsData as i, type HealthPlanSignsData as j, type HealthPlanTipsData as k, type HealthPlanToastData as l, type HealthPlanToolbarData as m, type HealthPlanVetQuoteData as n, type HealthPlanWaitCardData as o, type HealthPlanBuyButtonData as p, type HealthPlanBuyOptionsData as q, type HealthPlanDoseCardData as r, type HealthPlanIngredientsData as s, type HealthPlanProductPickData as t, type HealthPlanProofData as u, type HealthPlanReviewsData as v, type HealthPlanSubscribedBoxData as w, type HealthPlanTrustRowData as x, type HealthPlanWhyItFitsData as y, type HealthPlanCartCheckoutData as z };
|