@encorekit/web-sdk 2.2.1 → 2.4.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.
- package/README.md +66 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/preview.cjs +2 -0
- package/dist/cjs/preview.cjs.map +1 -0
- package/dist/cjs/react.cjs +1 -1
- package/dist/cjs/react.cjs.map +1 -1
- package/dist/esm/chunks/ClaimReminder-DFyrm5bJ.js +2 -0
- package/dist/esm/chunks/ClaimReminder-DFyrm5bJ.js.map +1 -0
- package/dist/esm/chunks/GiftsButton-B0lVB463.js +2 -0
- package/dist/esm/chunks/GiftsButton-B0lVB463.js.map +1 -0
- package/dist/esm/chunks/TriggerHost-CNTiNrTH.js +2 -0
- package/dist/esm/chunks/TriggerHost-CNTiNrTH.js.map +1 -0
- package/dist/esm/chunks/autoPops-CngtK_R0.js +2 -0
- package/dist/esm/chunks/autoPops-CngtK_R0.js.map +1 -0
- package/dist/esm/chunks/customClaim-B4uj-aOc.js +2 -0
- package/dist/esm/chunks/customClaim-B4uj-aOc.js.map +1 -0
- package/dist/esm/chunks/eligibility-BY7fL8Ve.js +2 -0
- package/dist/esm/chunks/eligibility-BY7fL8Ve.js.map +1 -0
- package/dist/esm/chunks/index-CaBSqauy.js +2 -0
- package/dist/esm/chunks/index-CaBSqauy.js.map +1 -0
- package/dist/esm/chunks/lookValues-B9z2VWpH.js +2 -0
- package/dist/esm/chunks/lookValues-B9z2VWpH.js.map +1 -0
- package/dist/esm/chunks/sduiView-Ds7QtFId.js +2 -0
- package/dist/esm/chunks/sduiView-Ds7QtFId.js.map +1 -0
- package/dist/esm/chunks/spot-DkKMLpB-.js +2 -0
- package/dist/esm/chunks/spot-DkKMLpB-.js.map +1 -0
- package/dist/esm/chunks/template-B9p4CbPD.js +2 -0
- package/dist/esm/chunks/template-B9p4CbPD.js.map +1 -0
- package/dist/esm/chunks/textSlots-BnwxUg9V.js +2 -0
- package/dist/esm/chunks/textSlots-BnwxUg9V.js.map +1 -0
- package/dist/esm/chunks/timers-Bva4yoGM.js +2 -0
- package/dist/esm/chunks/timers-Bva4yoGM.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/preview.js +2 -0
- package/dist/esm/preview.js.map +1 -0
- package/dist/esm/react.js +1 -1
- package/dist/esm/react.js.map +1 -1
- package/dist/umd/encore.min.js +1 -1
- package/dist/umd/encore.min.js.map +1 -1
- package/package.json +9 -1
- package/types/analytics/DiagnosticsOutbox.d.ts +1 -0
- package/types/analytics/DiagnosticsOutbox.d.ts.map +1 -1
- package/types/analytics/events.d.ts +108 -8
- package/types/analytics/events.d.ts.map +1 -1
- package/types/analytics/models.d.ts +2 -0
- package/types/analytics/models.d.ts.map +1 -1
- package/types/analytics/transport.d.ts +6 -0
- package/types/analytics/transport.d.ts.map +1 -1
- package/types/api/APIClient.d.ts +70 -33
- package/types/api/APIClient.d.ts.map +1 -1
- package/types/api/contract.d.ts +4 -1
- package/types/api/contract.d.ts.map +1 -1
- package/types/api/generated/types.d.ts +994 -17
- package/types/api/generated/types.d.ts.map +1 -1
- package/types/api/models.d.ts +29 -8
- package/types/api/models.d.ts.map +1 -1
- package/types/api/offerBuilder.d.ts +51 -0
- package/types/api/offerBuilder.d.ts.map +1 -0
- package/types/core/Configuration.d.ts +9 -0
- package/types/core/Configuration.d.ts.map +1 -1
- package/types/core/Encore.d.ts +145 -3
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/OfferManager.d.ts +27 -5
- package/types/core/OfferManager.d.ts.map +1 -1
- package/types/core/PlacementBuilder.d.ts +6 -1
- package/types/core/PlacementBuilder.d.ts.map +1 -1
- package/types/core/SignalManager.d.ts.map +1 -1
- package/types/core/StorageManager.d.ts +3 -2
- package/types/core/StorageManager.d.ts.map +1 -1
- package/types/core/StrictUnlockReconciler.d.ts +1 -1
- package/types/core/StrictUnlockReconciler.d.ts.map +1 -1
- package/types/core/claimHandle.d.ts +44 -0
- package/types/core/claimHandle.d.ts.map +1 -0
- package/types/core/claimLog.d.ts +102 -0
- package/types/core/claimLog.d.ts.map +1 -0
- package/types/core/claimRefusal.d.ts +3 -0
- package/types/core/claimRefusal.d.ts.map +1 -0
- package/types/core/claimScreenVariant.d.ts +3 -0
- package/types/core/claimScreenVariant.d.ts.map +1 -0
- package/types/core/claimStatusCheck.d.ts +62 -0
- package/types/core/claimStatusCheck.d.ts.map +1 -0
- package/types/core/giftVariant.d.ts +5 -0
- package/types/core/giftVariant.d.ts.map +1 -1
- package/types/core/hostDisplay.d.ts +9 -2
- package/types/core/hostDisplay.d.ts.map +1 -1
- package/types/core/sduiVariables.d.ts +20 -0
- package/types/core/sduiVariables.d.ts.map +1 -0
- package/types/core/strings.d.ts +114 -0
- package/types/core/strings.d.ts.map +1 -0
- package/types/core/unlockCode.d.ts +12 -2
- package/types/core/unlockCode.d.ts.map +1 -1
- package/types/core/userKeys.d.ts +7 -0
- package/types/core/userKeys.d.ts.map +1 -0
- package/types/core/version.d.ts +1 -1
- package/types/experiments/ExposureOutbox.d.ts +1 -0
- package/types/experiments/ExposureOutbox.d.ts.map +1 -1
- package/types/preview.d.ts +51 -0
- package/types/preview.d.ts.map +1 -0
- package/types/react.d.ts +53 -1
- package/types/react.d.ts.map +1 -1
- package/types/sdui/actions.d.ts +93 -0
- package/types/sdui/actions.d.ts.map +1 -0
- package/types/sdui/bindings.d.ts +63 -0
- package/types/sdui/bindings.d.ts.map +1 -0
- package/types/sdui/compile.d.ts +88 -0
- package/types/sdui/compile.d.ts.map +1 -0
- package/types/sdui/conditions.d.ts +22 -0
- package/types/sdui/conditions.d.ts.map +1 -0
- package/types/sdui/context.d.ts +132 -0
- package/types/sdui/context.d.ts.map +1 -0
- package/types/sdui/countdown.d.ts +31 -0
- package/types/sdui/countdown.d.ts.map +1 -0
- package/types/sdui/decode.d.ts +35 -0
- package/types/sdui/decode.d.ts.map +1 -0
- package/types/sdui/deps.d.ts +43 -0
- package/types/sdui/deps.d.ts.map +1 -0
- package/types/sdui/dominantColor.d.ts +24 -0
- package/types/sdui/dominantColor.d.ts.map +1 -0
- package/types/sdui/elements/confetti.d.ts +38 -0
- package/types/sdui/elements/confetti.d.ts.map +1 -0
- package/types/sdui/elements/content.d.ts +27 -0
- package/types/sdui/elements/content.d.ts.map +1 -0
- package/types/sdui/elements/interactive.d.ts +48 -0
- package/types/sdui/elements/interactive.d.ts.map +1 -0
- package/types/sdui/elements/layout.d.ts +41 -0
- package/types/sdui/elements/layout.d.ts.map +1 -0
- package/types/sdui/elements/marquee.d.ts +17 -0
- package/types/sdui/elements/marquee.d.ts.map +1 -0
- package/types/sdui/elements/progress.d.ts +10 -0
- package/types/sdui/elements/progress.d.ts.map +1 -0
- package/types/sdui/elements/shared.d.ts +138 -0
- package/types/sdui/elements/shared.d.ts.map +1 -0
- package/types/sdui/elements/symbols.d.ts +22 -0
- package/types/sdui/elements/symbols.d.ts.map +1 -0
- package/types/sdui/elements/triggerText.d.ts +55 -0
- package/types/sdui/elements/triggerText.d.ts.map +1 -0
- package/types/sdui/host.d.ts +274 -0
- package/types/sdui/host.d.ts.map +1 -0
- package/types/sdui/inlineMarkup.d.ts +22 -0
- package/types/sdui/inlineMarkup.d.ts.map +1 -0
- package/types/sdui/lookValues.d.ts +50 -0
- package/types/sdui/lookValues.d.ts.map +1 -0
- package/types/sdui/model.d.ts +130 -0
- package/types/sdui/model.d.ts.map +1 -0
- package/types/sdui/motion.d.ts +37 -0
- package/types/sdui/motion.d.ts.map +1 -0
- package/types/sdui/precheck.d.ts +94 -0
- package/types/sdui/precheck.d.ts.map +1 -0
- package/types/sdui/scrollMath.d.ts +32 -0
- package/types/sdui/scrollMath.d.ts.map +1 -0
- package/types/sdui/style.d.ts +99 -0
- package/types/sdui/style.d.ts.map +1 -0
- package/types/sdui/triggerKit.d.ts +24 -0
- package/types/sdui/triggerKit.d.ts.map +1 -0
- package/types/sdui/unrunnable.d.ts +11 -0
- package/types/sdui/unrunnable.d.ts.map +1 -0
- package/types/sdui/vocabulary.d.ts +119 -0
- package/types/sdui/vocabulary.d.ts.map +1 -0
- package/types/triggers/claimReminder/ClaimReminder.d.ts +65 -0
- package/types/triggers/claimReminder/ClaimReminder.d.ts.map +1 -0
- package/types/triggers/claimReminder/bindings.d.ts +40 -0
- package/types/triggers/claimReminder/bindings.d.ts.map +1 -0
- package/types/triggers/claimReminder/config.d.ts +56 -0
- package/types/triggers/claimReminder/config.d.ts.map +1 -0
- package/types/triggers/claimReminder/eligibility.d.ts +37 -0
- package/types/triggers/claimReminder/eligibility.d.ts.map +1 -0
- package/types/triggers/claimReminder/servedWindow.d.ts +15 -0
- package/types/triggers/claimReminder/servedWindow.d.ts.map +1 -0
- package/types/triggers/claimReminder/source.d.ts +29 -0
- package/types/triggers/claimReminder/source.d.ts.map +1 -0
- package/types/triggers/giftsButton/GiftsButton.d.ts +60 -0
- package/types/triggers/giftsButton/GiftsButton.d.ts.map +1 -0
- package/types/triggers/giftsButton/config.d.ts +53 -0
- package/types/triggers/giftsButton/config.d.ts.map +1 -0
- package/types/triggers/giftsButton/spot.d.ts +54 -0
- package/types/triggers/giftsButton/spot.d.ts.map +1 -0
- package/types/triggers/host/TriggerHost.d.ts +127 -0
- package/types/triggers/host/TriggerHost.d.ts.map +1 -0
- package/types/triggers/host/autoPops.d.ts +16 -0
- package/types/triggers/host/autoPops.d.ts.map +1 -0
- package/types/triggers/host/configCache.d.ts +29 -0
- package/types/triggers/host/configCache.d.ts.map +1 -0
- package/types/triggers/host/customClaim.d.ts +85 -0
- package/types/triggers/host/customClaim.d.ts.map +1 -0
- package/types/triggers/host/dismissStore.d.ts +37 -0
- package/types/triggers/host/dismissStore.d.ts.map +1 -0
- package/types/triggers/host/readThrottle.d.ts +15 -0
- package/types/triggers/host/readThrottle.d.ts.map +1 -0
- package/types/triggers/host/registry.d.ts +17 -0
- package/types/triggers/host/registry.d.ts.map +1 -0
- package/types/triggers/host/sduiView.d.ts +31 -0
- package/types/triggers/host/sduiView.d.ts.map +1 -0
- package/types/triggers/host/template.d.ts +28 -0
- package/types/triggers/host/template.d.ts.map +1 -0
- package/types/triggers/host/textSlots.d.ts +35 -0
- package/types/triggers/host/textSlots.d.ts.map +1 -0
- package/types/triggers/host/theme.d.ts +87 -0
- package/types/triggers/host/theme.d.ts.map +1 -0
- package/types/triggers/host/timers.d.ts +11 -0
- package/types/triggers/host/timers.d.ts.map +1 -0
- package/types/triggers/host/types.d.ts +278 -0
- package/types/triggers/host/types.d.ts.map +1 -0
- package/types/triggers/host/wire.d.ts +55 -0
- package/types/triggers/host/wire.d.ts.map +1 -0
- package/types/triggers/preview.d.ts +78 -0
- package/types/triggers/preview.d.ts.map +1 -0
- package/types/triggers/request.d.ts +53 -0
- package/types/triggers/request.d.ts.map +1 -0
- package/types/types.d.ts +420 -4
- package/types/types.d.ts.map +1 -1
- package/types/ui/ClaimScreen.d.ts +62 -0
- package/types/ui/ClaimScreen.d.ts.map +1 -0
- package/types/ui/CodeUnlock.d.ts +26 -2
- package/types/ui/CodeUnlock.d.ts.map +1 -1
- package/types/ui/GiftHero.d.ts.map +1 -1
- package/types/ui/GiftList.d.ts.map +1 -1
- package/types/ui/GiftPicker.d.ts.map +1 -1
- package/types/ui/GiftPickerHero.d.ts.map +1 -1
- package/types/ui/GiftReveal.d.ts.map +1 -1
- package/types/ui/GiftSheet.d.ts +5 -5
- package/types/ui/GiftSheet.d.ts.map +1 -1
- package/types/ui/GiftUnwrap.d.ts.map +1 -1
- package/types/ui/OfferCard.d.ts.map +1 -1
- package/types/ui/OfferCarousel.d.ts.map +1 -1
- package/types/ui/OfferModal.d.ts +31 -6
- package/types/ui/OfferModal.d.ts.map +1 -1
- package/types/ui/PrimerScreen.d.ts +2 -0
- package/types/ui/PrimerScreen.d.ts.map +1 -1
- package/types/ui/RedemptionScreen.d.ts +5 -0
- package/types/ui/RedemptionScreen.d.ts.map +1 -1
- package/types/ui/RewardActions.d.ts.map +1 -1
- package/types/ui/RewardCard.d.ts.map +1 -1
- package/types/ui/SduiRewardSurface.d.ts +145 -0
- package/types/ui/SduiRewardSurface.d.ts.map +1 -0
- package/types/ui/Tooltip.d.ts.map +1 -1
- package/types/ui/brandComponents.d.ts.map +1 -1
- package/types/ui/brandTint.d.ts.map +1 -1
- package/types/ui/colorScheme.d.ts +15 -0
- package/types/ui/colorScheme.d.ts.map +1 -0
- package/types/ui/covered.d.ts +12 -0
- package/types/ui/covered.d.ts.map +1 -0
- package/types/ui/giftCategoryGroups.d.ts +13 -0
- package/types/ui/giftCategoryGroups.d.ts.map +1 -1
- package/types/ui/giftCopy.d.ts +14 -9
- package/types/ui/giftCopy.d.ts.map +1 -1
- package/types/ui/giftUnwrapCopy.d.ts.map +1 -1
- package/types/ui/imageURL.d.ts +44 -0
- package/types/ui/imageURL.d.ts.map +1 -0
- package/types/ui/impressionGate.d.ts +9 -0
- package/types/ui/impressionGate.d.ts.map +1 -1
- package/types/ui/offerBadge.d.ts.map +1 -1
- package/types/ui/rewardSurface.d.ts +11 -1
- package/types/ui/rewardSurface.d.ts.map +1 -1
- package/types/ui/sduiTheme.d.ts +48 -0
- package/types/ui/sduiTheme.d.ts.map +1 -0
- package/types/ui/sheetDetents.d.ts +28 -0
- package/types/ui/sheetDetents.d.ts.map +1 -0
- package/types/ui/styles.d.ts +11 -8
- package/types/ui/styles.d.ts.map +1 -1
- package/types/ui/termsLine.d.ts +3 -3
- package/types/ui/termsLine.d.ts.map +1 -1
- package/types/ui/toast.d.ts +11 -0
- package/types/ui/toast.d.ts.map +1 -0
- package/types/utils/logger.d.ts +10 -0
- package/types/utils/logger.d.ts.map +1 -1
- package/types/utils/text.d.ts +17 -0
- package/types/utils/text.d.ts.map +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll-driven visual maths, ported from Android's `SduiScrollMath`.
|
|
3
|
+
*
|
|
4
|
+
* Swift gets this free from `.scrollTransition(.interactive)`, whose contract is
|
|
5
|
+
* that `phase` is -1 at the leading edge, 0 at centre and +1 at the trailing
|
|
6
|
+
* edge, and that magnitude is used so both sides converge to identity at centre.
|
|
7
|
+
* That contract is the specification; the arithmetic below is Android's way of
|
|
8
|
+
* meeting it without such a modifier, which is the position web is in too.
|
|
9
|
+
*
|
|
10
|
+
* Pure functions on purpose. `phase` and `centreDistance` come from Compose's
|
|
11
|
+
* scroll state on Android and have to be COMPUTED here from scroll offset and
|
|
12
|
+
* element geometry, which is the one part that does not port.
|
|
13
|
+
*/
|
|
14
|
+
export interface ScrollTransitionSpec {
|
|
15
|
+
readonly rotation?: number;
|
|
16
|
+
readonly scale?: number;
|
|
17
|
+
readonly opacity?: number;
|
|
18
|
+
readonly yOffset?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const scrollTransitionScale: (t: ScrollTransitionSpec, phase: number) => number;
|
|
21
|
+
export declare const scrollTransitionOpacity: (t: ScrollTransitionSpec, phase: number) => number;
|
|
22
|
+
/** Signed, not magnitude: the two sides rotate opposite ways. */
|
|
23
|
+
export declare const scrollTransitionRotation: (t: ScrollTransitionSpec, phase: number) => number;
|
|
24
|
+
export declare const scrollTransitionYOffset: (t: ScrollTransitionSpec, phase: number) => number;
|
|
25
|
+
/** Distance 0 is centred. Values outside 0..1 clamp. */
|
|
26
|
+
export declare function scrollFadeOpacity(distance: number, centeredOpacity?: number, offCenterOpacity?: number): number;
|
|
27
|
+
/**
|
|
28
|
+
* Phase for an element inside a horizontal scroller: -1 leading, 0 centred,
|
|
29
|
+
* +1 trailing. This is the input Compose supplies and the DOM does not.
|
|
30
|
+
*/
|
|
31
|
+
export declare function phaseOf(elementCentre: number, viewportCentre: number, halfSpan: number): number;
|
|
32
|
+
//# sourceMappingURL=scrollMath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollMath.d.ts","sourceRoot":"","sources":["../../src/sdui/scrollMath.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAKD,eAAO,MAAM,qBAAqB,GAChC,GAAG,oBAAoB,EACvB,OAAO,MAAM,KACZ,MAAqD,CAAC;AAEzD,eAAO,MAAM,uBAAuB,GAClC,GAAG,oBAAoB,EACvB,OAAO,MAAM,KACZ,MAAuD,CAAC;AAE3D,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,GACnC,GAAG,oBAAoB,EACvB,OAAO,MAAM,KACZ,MAAmC,CAAC;AAEvC,eAAO,MAAM,uBAAuB,GAClC,GAAG,oBAAoB,EACvB,OAAO,MAAM,KACZ,MAA6C,CAAC;AAEjD,wDAAwD;AACxD,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,eAAe,SAAI,EACnB,gBAAgB,SAAI,GACnB,MAAM,CAGR;AAED;;;GAGG;AACH,wBAAgB,OAAO,CACrB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,GACf,MAAM,CAIR"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The 30 wire style properties, as CSS.
|
|
3
|
+
*
|
|
4
|
+
* Three groups, and the split is what makes this layer estimable:
|
|
5
|
+
*
|
|
6
|
+
* - 16 are a direct declaration.
|
|
7
|
+
* - 6 need a wrapper or a pseudo-element, so they return an intent for the
|
|
8
|
+
* element renderer to honour rather than a property.
|
|
9
|
+
* - 8 have no CSS equivalent at all. Four of those are SwiftUI layout
|
|
10
|
+
* concepts, and four are scroll-driven. Each is approximated deliberately
|
|
11
|
+
* and the approximation is named, because a silent near-miss in layout is
|
|
12
|
+
* the hardest kind of parity bug to find later.
|
|
13
|
+
*
|
|
14
|
+
* Values arrive raw from the decoder. Anything reaching CSS goes through
|
|
15
|
+
* `cssSafe`, because a style value is server-supplied.
|
|
16
|
+
*/
|
|
17
|
+
import type { SduiStyle } from "./model";
|
|
18
|
+
import type { SduiNode } from "./model";
|
|
19
|
+
/**
|
|
20
|
+
* What the style layer cannot express as a declaration, handed back for the
|
|
21
|
+
* element renderer to build. Keeping these OUT of the CSS map is deliberate:
|
|
22
|
+
* an overlay is a child element, and pretending otherwise is how it ends up
|
|
23
|
+
* silently dropped.
|
|
24
|
+
*/
|
|
25
|
+
export interface StructuralIntent {
|
|
26
|
+
/** A node to absolutely position ON TOP of the element. */
|
|
27
|
+
readonly overlay?: SduiNode;
|
|
28
|
+
/** A node to absolutely position BEHIND it. */
|
|
29
|
+
readonly backgroundElement?: SduiNode;
|
|
30
|
+
/** Gradient stroke: no CSS property exists, so a pseudo-element draws it. */
|
|
31
|
+
readonly gradientBorder?: Record<string, unknown>;
|
|
32
|
+
/** Per-state styles, applied by toggling a class so CSS transitions can run. */
|
|
33
|
+
readonly stateStyles?: Record<string, unknown>;
|
|
34
|
+
readonly stateAnimation?: Record<string, unknown>;
|
|
35
|
+
/** Mark this container's CHILDREN as snap targets, not the container itself. */
|
|
36
|
+
readonly scrollTargetLayout?: boolean;
|
|
37
|
+
/** Scroll-driven, so it needs a scroll listener rather than a declaration. */
|
|
38
|
+
readonly scrollTransition?: Record<string, unknown>;
|
|
39
|
+
readonly scrollFade?: Record<string, unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* A corner radius clips the CONTENT, never the shadow (Swift's
|
|
42
|
+
* `SDUISurfaceModifier`). Structural so a re-planned bound colour cannot undo
|
|
43
|
+
* a scroller's own overflow.
|
|
44
|
+
*/
|
|
45
|
+
readonly clipContent?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface StylePlan {
|
|
48
|
+
/** CSS property to value. Already sanitised. */
|
|
49
|
+
readonly css: Readonly<Record<string, string>>;
|
|
50
|
+
readonly structural: StructuralIntent;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Resolves an SDUI colour operand to a CSS colour string.
|
|
54
|
+
*
|
|
55
|
+
* The resolver is the ONLY place a server-supplied string reaches CSS: every
|
|
56
|
+
* other value here is built by this file out of decoded numbers, so it cannot
|
|
57
|
+
* carry a `;` or a `}`. Wrap any resolver with {@link safeColorResolver} unless
|
|
58
|
+
* it already guarantees an allow-listed colour.
|
|
59
|
+
*/
|
|
60
|
+
export type ColorResolver = (raw: unknown,
|
|
61
|
+
/**
|
|
62
|
+
* The live values dictionary. A `binding` colour resolves against it at
|
|
63
|
+
* RENDER time in Swift (`SDUIColor.resolved(in:values:)`), so a resolver with
|
|
64
|
+
* no access to it can never resolve one. `streaksCarousel` binds
|
|
65
|
+
* `selectedOfferDominantColor` on its page indicator and its cards.
|
|
66
|
+
*/
|
|
67
|
+
values?: Readonly<Record<string, string>>) => string | undefined;
|
|
68
|
+
/** Wraps a resolver so anything it returns must pass `cssSafe`'s colour grammar. */
|
|
69
|
+
/**
|
|
70
|
+
* The value keys a colour operand reads, so a renderer can depend on them.
|
|
71
|
+
*
|
|
72
|
+
* A `binding` colour resolves at render time, so an element painting one has to
|
|
73
|
+
* re-run when that key moves. Without this the page indicator and any
|
|
74
|
+
* bound-fill shape were painted once at mount and never again.
|
|
75
|
+
*/
|
|
76
|
+
export declare function colorBindingKeys(raw: unknown): string[];
|
|
77
|
+
/**
|
|
78
|
+
* Swift's `SDUIColor.Transforms`: lighten, then darken, then opacity, on ANY
|
|
79
|
+
* base form. Authored as sibling keys of `hex`/`semantic`/`appearance`/`binding`.
|
|
80
|
+
*
|
|
81
|
+
* Wrap a resolver that already sanitizes, not the other way round: the colour
|
|
82
|
+
* grammar rejects a nested `color-mix` on purpose, and everything composed here
|
|
83
|
+
* is a number this file clamped, so nothing new can escape the declaration.
|
|
84
|
+
*
|
|
85
|
+
* Transforms on a `fallback` are not applied, only those on the outer object. No
|
|
86
|
+
* served variant authors one, and Swift would apply both.
|
|
87
|
+
*/
|
|
88
|
+
export declare function withColorTransforms(css: string | undefined, raw: unknown): string | undefined;
|
|
89
|
+
export declare const safeColorResolver: (inner: ColorResolver) => ColorResolver;
|
|
90
|
+
/**
|
|
91
|
+
* Every value key any colour anywhere in a style object binds.
|
|
92
|
+
*
|
|
93
|
+
* A style resolves its colours through `planStyle`, which ran ONCE with no
|
|
94
|
+
* values, so a bound `backgroundColor`, `borderColor`, shadow or gradient-border
|
|
95
|
+
* stop painted its fallback for ever. `featuredOfferCarousel` binds 31 operands.
|
|
96
|
+
*/
|
|
97
|
+
export declare function styleBindingKeys(style: unknown, depth?: number): string[];
|
|
98
|
+
export declare function planStyle(style: SduiStyle | undefined, color: ColorResolver): StylePlan;
|
|
99
|
+
//# sourceMappingURL=style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/sdui/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAcxC;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAC5B,+CAA+C;IAC/C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IACtC,6EAA6E;IAC7E,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,gFAAgF;IAChF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD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
|
+
/**
|
|
2
|
+
* The engine code only a trigger (inline) mount uses: the `progress` and `marquee`
|
|
3
|
+
* elements, `style.loop`, ticking countdown text, one-line shrink to fit and text scale groups.
|
|
4
|
+
*
|
|
5
|
+
* The engine refers to it by type only. The trigger view (`triggers/host/sduiView.ts`),
|
|
6
|
+
* which loads with the trigger chunk on first mount, imports it and hands it to
|
|
7
|
+
* `mountSduiSurface({ mode: "inline", kit })`, so a page that only shows sheets never
|
|
8
|
+
* downloads any of it.
|
|
9
|
+
*/
|
|
10
|
+
import { registerProgressElement } from "./elements/progress";
|
|
11
|
+
import { registerMarqueeElement } from "./elements/marquee";
|
|
12
|
+
import { MotionSheet, attachLoop } from "./motion";
|
|
13
|
+
import { ScaleGroups, countdownText, oneLineFit } from "./elements/triggerText";
|
|
14
|
+
export declare const TRIGGER_KIT: Readonly<{
|
|
15
|
+
registerProgressElement: typeof registerProgressElement;
|
|
16
|
+
registerMarqueeElement: typeof registerMarqueeElement;
|
|
17
|
+
MotionSheet: typeof MotionSheet;
|
|
18
|
+
attachLoop: typeof attachLoop;
|
|
19
|
+
countdownText: typeof countdownText;
|
|
20
|
+
oneLineFit: typeof oneLineFit;
|
|
21
|
+
ScaleGroups: typeof ScaleGroups;
|
|
22
|
+
}>;
|
|
23
|
+
export type TriggerKit = typeof TRIGGER_KIT;
|
|
24
|
+
//# sourceMappingURL=triggerKit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggerKit.d.ts","sourceRoot":"","sources":["../../src/sdui/triggerKit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEhF,eAAO,MAAM,WAAW;;;;;;;;EAQtB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,OAAO,WAAW,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actions a template needs that web cannot run, as Swift's `templateReferencesIAP`:
|
|
3
|
+
* a template that needs a purchase or a lead falls back to the built-in surface.
|
|
4
|
+
*/
|
|
5
|
+
/** The actions no web surface can run. */
|
|
6
|
+
export declare const UNRUNNABLE_ON_WEB: ReadonlySet<string>;
|
|
7
|
+
/** Every action type the raw template names, on a button, a toggle or a state's `onEnter`. */
|
|
8
|
+
export declare function referencedActions(raw: unknown): Set<string>;
|
|
9
|
+
/** The first action the template needs that web cannot run, or undefined. */
|
|
10
|
+
export declare function unrunnableAction(raw: unknown): string | undefined;
|
|
11
|
+
//# sourceMappingURL=unrunnable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unrunnable.d.ts","sourceRoot":"","sources":["../../src/sdui/unrunnable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0CAA0C;AAC1C,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAGhD,CAAC;AAEH,8FAA8F;AAC9F,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAyB3D;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKjE"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SDUI wire vocabulary, as the backend actually serves it.
|
|
3
|
+
*
|
|
4
|
+
* 🔴 THE CLOSED SETS ARE THE CONTRACT. An unknown enum VALUE fails the whole
|
|
5
|
+
* config; an unknown FIELD is ignored. That asymmetry is deliberate and is why
|
|
6
|
+
* these live as frozen arrays rather than TypeScript unions alone: a union is
|
|
7
|
+
* erased at runtime, and the decoder has to REJECT at runtime, not just fail to
|
|
8
|
+
* compile. See `decode.ts` for the rule and the reason.
|
|
9
|
+
*
|
|
10
|
+
* Every list here was read off `swift` `origin/main` and cross-checked against
|
|
11
|
+
* `android` `origin/main` on 2026-09-22. The two agree on every value. Swift is
|
|
12
|
+
* canonical where they ever disagree: it is the reference implementation and the
|
|
13
|
+
* vocabulary was designed against it.
|
|
14
|
+
*/
|
|
15
|
+
/** 22 element types. The element is a node's single KEY, never a `type` field. */
|
|
16
|
+
export declare const ELEMENTS: readonly ["text", "systemImage", "asyncImage", "asyncVideo", "appIcon", "button", "vStack", "hStack", "zStack", "spacer", "shape", "gradient", "scrollView", "forEach", "conditional", "group", "textField", "toggle", "slideButton", "compactPageIndicator", "confetti", "empty"];
|
|
17
|
+
/** 21 conditions, Swift's full set, diffed name by name. */
|
|
18
|
+
export declare const CONDITIONS: readonly ["hasMultipleOffers", "isCurrentPage", "isCurrentPageBinding", "stateEquals", "valueEquals", "hasValue", "hasIntroOffer", "hasFreeTrial", "isSelectedOffer", "and", "or", "not", "equals", "hasOfferAttribute", "hasOfferProperty", "hasInstructionSubtitle", "hasInstructionImage", "isFirstOffer", "isLastOffer", "isMiddleOffer", "offerIndexEquals"];
|
|
19
|
+
/** Conditions that take nested conditions rather than a leaf operand. */
|
|
20
|
+
export declare const COMBINATORS: readonly ["and", "or", "not"];
|
|
21
|
+
/**
|
|
22
|
+
* The 11 wire actions. Accepted as a bare string OR an object with `type`.
|
|
23
|
+
*
|
|
24
|
+
* Anything else decodes to the `unknown` sentinel and does nothing, so one new
|
|
25
|
+
* action costs a dead button instead of the whole variant. `unknown` is not in
|
|
26
|
+
* this list: it is not a wire value, and a literal `"unknown"` lands on the
|
|
27
|
+
* sentinel by the same route as any other name this build does not know.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ACTIONS: readonly ["close", "claimOffer", "openUrl", "setState", "setValue", "selectOffer", "setOfferIndex", "triggerIAP", "submitLead", "share", "reportCompletion"];
|
|
30
|
+
export declare const OFFER_ATTRIBUTES: readonly ["badgeLabel", "perk", "advertiserName", "description", "category", "shareUrl", "termsUrl", "quickInstructions", "instructions"];
|
|
31
|
+
export declare const DATA_SOURCES: readonly ["offers", "pageIndicators", "categories", "instructions"];
|
|
32
|
+
export declare const TEXT_BINDINGS: readonly ["offerAdvertiserName", "offerDescription", "offerPerk", "offerCtaText", "offerQuickInstructions", "offerNewPrice", "offerOldPrice", "titleText", "accentTitleText", "subtitleText", "categoryName", "instructionTitle", "instructionSubtitle", "instructionCtaText", "instructionNumber"];
|
|
33
|
+
export declare const CREATIVE_BINDINGS: readonly ["offerPrimaryCreative", "offerLogoImage", "offerHeroImage", "instructionImage"];
|
|
34
|
+
/**
|
|
35
|
+
* The theme tokens a colour may name. Both natives decode this strictly, so an
|
|
36
|
+
* unknown one fails the whole config rather than painting nothing.
|
|
37
|
+
*/
|
|
38
|
+
export declare const APPEARANCE_COLORS: readonly ["accent", "onAccent", "accentTitle", "background", "onBackground", "surface", "onSurface", "border", "muted", "error"];
|
|
39
|
+
export declare const SEMANTIC_COLORS: readonly ["label", "secondaryLabel", "tertiaryLabel", "systemBackground", "secondarySystemBackground", "systemGroupedBackground", "secondarySystemGroupedBackground", "separator", "tertiarySystemFill"];
|
|
40
|
+
export declare const FONT_WEIGHTS: readonly ["ultraLight", "thin", "light", "regular", "medium", "semibold", "bold", "heavy", "black"];
|
|
41
|
+
export declare const ALIGNMENTS: readonly ["leading", "trailing", "center", "top", "bottom", "topLeading", "topTrailing", "bottomLeading", "bottomTrailing"];
|
|
42
|
+
export declare const SHAPE_TYPES: readonly ["rectangle", "roundedRectangle", "circle", "capsule"];
|
|
43
|
+
export declare const CLIP_SHAPES: readonly ["rectangle", "circle", "capsule"];
|
|
44
|
+
export declare const GRADIENT_DIRECTIONS: readonly ["topToBottom", "bottomToTop", "leadingToTrailing", "trailingToLeading"];
|
|
45
|
+
export declare const ANIMATION_CURVES: readonly ["linear", "easeIn", "easeOut", "easeInOut", "spring"];
|
|
46
|
+
export declare const SCROLL_AXES: readonly ["horizontal", "vertical"];
|
|
47
|
+
export declare const SCROLL_TARGET_BEHAVIORS: readonly ["viewAligned", "paging"];
|
|
48
|
+
export declare const SCROLL_ALIGNMENTS: readonly ["leading", "center"];
|
|
49
|
+
export declare const CONTENT_MODES: readonly ["fit", "fill"];
|
|
50
|
+
export declare const IMPRESSION_SOURCES: readonly ["row", "creative"];
|
|
51
|
+
/** `none` is the wire spelling, NOT `off`. */
|
|
52
|
+
export declare const IMPRESSION_PROBES: readonly ["row", "none"];
|
|
53
|
+
export declare const KEYBOARD_TYPES: readonly ["emailAddress"];
|
|
54
|
+
export declare const TEXT_CONTENT_TYPES: readonly ["emailAddress"];
|
|
55
|
+
/**
|
|
56
|
+
* The 30 style properties. Kept as a set so the decoder can tell a style key it
|
|
57
|
+
* does not know (ignored, per the field rule) from one it must still carry.
|
|
58
|
+
*/
|
|
59
|
+
export declare const STYLE_PROPERTIES: readonly ["padding", "frame", "cornerRadius", "cornerRadii", "backgroundColor", "shadow", "innerShadow", "opacity", "clipShape", "clipped", "ignoresSafeArea", "layoutPriority", "containerRelativeFrame", "scrollTargetLayout", "borderWidth", "borderColor", "fixedSize", "offset", "stateStyles", "stateAnimation", "scale", "rotation", "relativeWidth", "relativeHeight", "overlay", "backgroundElement", "gradientBorder", "scrollTransition", "scrollFade", "safeAreaPadding"];
|
|
60
|
+
/**
|
|
61
|
+
* Vocabulary a TRIGGER mount decodes and a sheet does not (the trigger SDUI
|
|
62
|
+
* vocabulary contract, v1). Kept apart from the sheet lists so a sheet naming
|
|
63
|
+
* one keeps failing exactly as before: no existing sheet decodes differently.
|
|
64
|
+
*/
|
|
65
|
+
export declare const TRIGGER_ELEMENTS: readonly ["progress", "marquee"];
|
|
66
|
+
export declare const TRIGGER_CONDITIONS: readonly ["listCountAtLeast"];
|
|
67
|
+
/** The trigger host's two actions; a sheet decodes them as the unknown no-op, as today. */
|
|
68
|
+
export declare const TRIGGER_ACTIONS: readonly ["trigger", "dismissTrigger"];
|
|
69
|
+
export declare const TRIGGER_ACTION_TARGETS: readonly ["card", "arrow", "button"];
|
|
70
|
+
export declare const TRIGGER_DATA_SOURCES: readonly ["hostList"];
|
|
71
|
+
export declare const TRIGGER_APPEARANCE_COLORS: readonly ["inkOnAccent", "secondary", "track", "backgroundEnd"];
|
|
72
|
+
export declare const TRIGGER_SHAPE_TYPES: readonly ["ellipse"];
|
|
73
|
+
export declare const TRIGGER_STYLE_PROPERTIES: readonly ["loop", "layoutDirection", "accessibilityHidden"];
|
|
74
|
+
/** `gradient.type`. Absent is `linear`, the existing `direction` form; `radial` is trigger-only. */
|
|
75
|
+
export declare const GRADIENT_TYPES: readonly ["linear", "radial"];
|
|
76
|
+
export declare const COUNTDOWN_FORMATS: readonly ["clock", "hoursMinutes", "hours", "minutes", "seconds", "largestUnit"];
|
|
77
|
+
/** `style.loop.curve`: the animation curves except `spring`. */
|
|
78
|
+
export declare const LOOP_CURVES: readonly ["linear", "easeIn", "easeOut", "easeInOut"];
|
|
79
|
+
export declare const MARQUEE_AXES: readonly ["horizontal", "vertical"];
|
|
80
|
+
export declare const LAYOUT_DIRECTIONS: readonly ["ltr"];
|
|
81
|
+
export type SduiElementName = (typeof ELEMENTS)[number] | (typeof TRIGGER_ELEMENTS)[number];
|
|
82
|
+
export type SduiConditionName = (typeof CONDITIONS)[number] | (typeof TRIGGER_CONDITIONS)[number];
|
|
83
|
+
export type SduiCombinator = (typeof COMBINATORS)[number];
|
|
84
|
+
/** The wire actions, plus the sentinel a name this build does not know lands on. */
|
|
85
|
+
export type SduiActionType = (typeof ACTIONS)[number] | (typeof TRIGGER_ACTIONS)[number] | "unknown";
|
|
86
|
+
export type SduiOfferAttribute = (typeof OFFER_ATTRIBUTES)[number];
|
|
87
|
+
export type SduiDataSource = (typeof DATA_SOURCES)[number] | (typeof TRIGGER_DATA_SOURCES)[number];
|
|
88
|
+
export type SduiTextBinding = (typeof TEXT_BINDINGS)[number];
|
|
89
|
+
export type SduiCreativeBinding = (typeof CREATIVE_BINDINGS)[number];
|
|
90
|
+
export type SduiSemanticColor = (typeof SEMANTIC_COLORS)[number];
|
|
91
|
+
export type SduiAppearanceColor = (typeof APPEARANCE_COLORS)[number];
|
|
92
|
+
export type SduiFontWeight = (typeof FONT_WEIGHTS)[number];
|
|
93
|
+
export type SduiAlignment = (typeof ALIGNMENTS)[number];
|
|
94
|
+
export type SduiShapeType = (typeof SHAPE_TYPES)[number];
|
|
95
|
+
export type SduiClipShapeType = (typeof CLIP_SHAPES)[number];
|
|
96
|
+
export type SduiGradientDirection = (typeof GRADIENT_DIRECTIONS)[number];
|
|
97
|
+
export type SduiAnimationCurve = (typeof ANIMATION_CURVES)[number];
|
|
98
|
+
export type SduiScrollAxis = (typeof SCROLL_AXES)[number];
|
|
99
|
+
export type SduiScrollTargetBehavior = (typeof SCROLL_TARGET_BEHAVIORS)[number];
|
|
100
|
+
export type SduiScrollAlignment = (typeof SCROLL_ALIGNMENTS)[number];
|
|
101
|
+
export type SduiContentMode = (typeof CONTENT_MODES)[number];
|
|
102
|
+
export type SduiImpressionSource = (typeof IMPRESSION_SOURCES)[number];
|
|
103
|
+
export type SduiImpressionProbe = (typeof IMPRESSION_PROBES)[number];
|
|
104
|
+
export type SduiStyleProperty = (typeof STYLE_PROPERTIES)[number] | (typeof TRIGGER_STYLE_PROPERTIES)[number];
|
|
105
|
+
export declare const ELEMENT_SET: ReadonlySet<string>;
|
|
106
|
+
export declare const CONDITION_SET: ReadonlySet<string>;
|
|
107
|
+
export declare const COMBINATOR_SET: ReadonlySet<string>;
|
|
108
|
+
export declare const ACTION_SET: ReadonlySet<string>;
|
|
109
|
+
export declare const OFFER_ATTRIBUTE_SET: ReadonlySet<string>;
|
|
110
|
+
export declare const DATA_SOURCE_SET: ReadonlySet<string>;
|
|
111
|
+
export declare const TEXT_BINDING_SET: ReadonlySet<string>;
|
|
112
|
+
export declare const CREATIVE_BINDING_SET: ReadonlySet<string>;
|
|
113
|
+
export declare const STYLE_PROPERTY_SET: ReadonlySet<string>;
|
|
114
|
+
export declare const TRIGGER_ELEMENT_SET: ReadonlySet<string>;
|
|
115
|
+
export declare const TRIGGER_CONDITION_SET: ReadonlySet<string>;
|
|
116
|
+
export declare const TRIGGER_ACTION_SET: ReadonlySet<string>;
|
|
117
|
+
export declare const TRIGGER_DATA_SOURCE_SET: ReadonlySet<string>;
|
|
118
|
+
export declare const TRIGGER_STYLE_PROPERTY_SET: ReadonlySet<string>;
|
|
119
|
+
//# sourceMappingURL=vocabulary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../../src/sdui/vocabulary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,kFAAkF;AAClF,eAAO,MAAM,QAAQ,oRAuBX,CAAC;AAEX,4DAA4D;AAC5D,eAAO,MAAM,UAAU,mWAsBb,CAAC;AAEX,yEAAyE;AACzE,eAAO,MAAM,WAAW,+BAAgC,CAAC;AAEzD;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,8JAYV,CAAC;AAEX,eAAO,MAAM,gBAAgB,2IAUnB,CAAC;AAEX,eAAO,MAAM,YAAY,qEAKf,CAAC;AAEX,eAAO,MAAM,aAAa,qSAgBhB,CAAC;AAEX,eAAO,MAAM,iBAAiB,2FAKpB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,iBAAiB,kIAWpB,CAAC;AAEX,eAAO,MAAM,eAAe,0MAUlB,CAAC;AAEX,eAAO,MAAM,YAAY,qGAUf,CAAC;AAEX,eAAO,MAAM,UAAU,6HAUb,CAAC;AAEX,eAAO,MAAM,WAAW,iEAKd,CAAC;AACX,eAAO,MAAM,WAAW,6CAA8C,CAAC;AACvE,eAAO,MAAM,mBAAmB,mFAKtB,CAAC;AACX,eAAO,MAAM,gBAAgB,iEAMnB,CAAC;AACX,eAAO,MAAM,WAAW,qCAAsC,CAAC;AAC/D,e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
+
* ClaimReminder, trigger plug-in #1: a card that reminds the user of their newest
|
|
3
|
+
* open claim, and on tap opens the Encore sheet for its use case and placement,
|
|
4
|
+
* where that offer is still listed. Behaviour is the cross-platform contract
|
|
5
|
+
* (contract.md, "Trigger behaviour"); the drawing is the served SDUI tree, fed by
|
|
6
|
+
* bindings.ts (trigger SDUI vocabulary contract §2). Everything every
|
|
7
|
+
* trigger shares (the config request, events, visibility, dismiss storage, identity
|
|
8
|
+
* re-runs, the sheet's presentation id) is the host's (triggers/host/TriggerHost.ts).
|
|
9
|
+
*/
|
|
10
|
+
import type { UseCase } from '../../types';
|
|
11
|
+
import type { SheetCheck, TriggerPlugin } from '../host/types';
|
|
12
|
+
import { type ReminderConfig } from './config';
|
|
13
|
+
import type { ClaimReminderSource, ReminderClaim } from './source';
|
|
14
|
+
import { type TriggerSduiModel } from '../host/sduiView';
|
|
15
|
+
export declare const CLAIM_REMINDER_ID: "claimReminder";
|
|
16
|
+
/** What the gate found: the open claims, and the campaigns the sheet holds for the tap. */
|
|
17
|
+
export interface ReminderContent {
|
|
18
|
+
useCase: UseCase;
|
|
19
|
+
/** The open claims the sheet still holds; empty when only a completion is left. */
|
|
20
|
+
claims: ReminderClaim[];
|
|
21
|
+
campaignIds: ReadonlySet<string>;
|
|
22
|
+
/**
|
|
23
|
+
* No claim to remind about, and an offer finished today that was not thanked yet (the
|
|
24
|
+
* request's `completed` state): its claim's id. Encore answers with the thanks look or
|
|
25
|
+
* nothing, as the look's behavior says.
|
|
26
|
+
*/
|
|
27
|
+
completion?: string;
|
|
28
|
+
/** The reminder window the gate used (the one last served here), in hours. */
|
|
29
|
+
windowHours?: number;
|
|
30
|
+
}
|
|
31
|
+
/** What one render of the card shows: the served tree and what it binds. */
|
|
32
|
+
export interface ReminderModel extends TriggerSduiModel {
|
|
33
|
+
useCase: UseCase;
|
|
34
|
+
placement: string | undefined;
|
|
35
|
+
/** The thanks look is drawn: a tap opens the sheet and ends it. */
|
|
36
|
+
thanks?: true;
|
|
37
|
+
}
|
|
38
|
+
export interface ClaimReminderDeps {
|
|
39
|
+
/**
|
|
40
|
+
* The claims adapter, read at call time. The SDK's is never null: this browser's claim
|
|
41
|
+
* log, merged with the claims bank once one is bound. Null renders nothing.
|
|
42
|
+
*/
|
|
43
|
+
source(): ClaimReminderSource | null;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the sheet for `useCase` at `placement` would open with offers, and which
|
|
46
|
+
* campaigns it holds (the same gate as GiftsButton's). `fresh` skips the held search.
|
|
47
|
+
*/
|
|
48
|
+
checkSheet(useCase: UseCase, placement: string | undefined, fresh: boolean): Promise<SheetCheck>;
|
|
49
|
+
/**
|
|
50
|
+
* A tap about to open the sheet: false when the shown claim is known to have ended
|
|
51
|
+
* (synchronous: the sheet opens inside the click). Absent: always open.
|
|
52
|
+
*/
|
|
53
|
+
claimTapped?(transactionId: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* An offer finished today with none claimed since, not thanked yet: its claim's id
|
|
56
|
+
* (the `completed` state). Absent or null: none.
|
|
57
|
+
*/
|
|
58
|
+
thanksFor?(): string | null;
|
|
59
|
+
/** The thanks look was tapped: it ends for the user's latest completion. */
|
|
60
|
+
thanksTapped?(): void;
|
|
61
|
+
/** Device storage for the window last served at each placement. Absent: the 24 hour default. */
|
|
62
|
+
storage?(): Storage | null;
|
|
63
|
+
}
|
|
64
|
+
export declare function claimReminderPlugin(deps: ClaimReminderDeps): TriggerPlugin<ReminderContent, ReminderConfig, ReminderModel>;
|
|
65
|
+
//# sourceMappingURL=ClaimReminder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClaimReminder.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/ClaimReminder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAM3C,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAqB,MAAM,eAA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AiB,GACtB,aAAa,CAAC,eAAe,EAAE,cAAc,EAAE,aAAa,CAAC,CAwO/D"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the claim reminder hands the SDUI engine (trigger SDUI contract §2.2 to
|
|
3
|
+
* §2.5): its values, its two time keys and its lists, built from the eligible
|
|
4
|
+
* claims. The served tree draws them; nothing here draws.
|
|
5
|
+
*/
|
|
6
|
+
import type { TriggerIconValues } from '../host/theme';
|
|
7
|
+
import type { SduiHostListItem } from '../../sdui/context';
|
|
8
|
+
import type { ReminderCopy } from './config';
|
|
9
|
+
import type { ReminderClaim } from './source';
|
|
10
|
+
export interface ReminderBindings {
|
|
11
|
+
values: Record<string, string>;
|
|
12
|
+
times: {
|
|
13
|
+
start: number;
|
|
14
|
+
deadline: number;
|
|
15
|
+
};
|
|
16
|
+
lists: Record<string, SduiHostListItem[]>;
|
|
17
|
+
}
|
|
18
|
+
export interface ReminderBindingInput {
|
|
19
|
+
copy: ReminderCopy;
|
|
20
|
+
windowHours: number;
|
|
21
|
+
/** The served layout name, exposed as `${layout}`. */
|
|
22
|
+
layout: string;
|
|
23
|
+
/** The icon the look draws, exposed as `${icon}` and `${appIconUrl}`. */
|
|
24
|
+
icon: TriggerIconValues;
|
|
25
|
+
/** Every string the served look declares (`template.strings`), each exposed as a value. */
|
|
26
|
+
lookStrings?: Readonly<Record<string, string>>;
|
|
27
|
+
/** The look's value defaults with the mount's values over them, for `${values.K}`. */
|
|
28
|
+
lookValues?: Readonly<Record<string, string>>;
|
|
29
|
+
/**
|
|
30
|
+
* The string the look's headline text slot names (`textSlots.headline`), already holding
|
|
31
|
+
* the app's headline when it set one: the spoken title on a named claim, as the card draws it.
|
|
32
|
+
*/
|
|
33
|
+
headlineKey?: string | null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The bindings for the newest eligible claim. `eligible` is newest first, as
|
|
37
|
+
* `eligibleClaims` returns it, and not empty.
|
|
38
|
+
*/
|
|
39
|
+
export declare function reminderBindings(eligible: readonly ReminderClaim[], input: ReminderBindingInput): ReminderBindings;
|
|
40
|
+
//# sourceMappingURL=bindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/bindings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAQ9C,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,IAAI,EAAE,iBAAiB,CAAC;IACxB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,sFAAsF;IACtF,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAsDD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,KAAK,EAAE,oBAAoB,GAC1B,gBAAgB,CAqFlB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading the claim reminder's served template. The host has already checked the
|
|
3
|
+
* envelope (`template.trigger == 'claimReminder'`) and owns the variant ids and the
|
|
4
|
+
* served locale.
|
|
5
|
+
*
|
|
6
|
+
* The variant is an SDUI tree plus the keys the host reads (trigger SDUI
|
|
7
|
+
* vocabulary contract §1):
|
|
8
|
+
*
|
|
9
|
+
* { trigger: 'claimReminder', layout, windowHours, dismissible, colors, strings, root }
|
|
10
|
+
*
|
|
11
|
+
* `root` is drawn by the engine; `layout` is only a label (events, `${layout}`).
|
|
12
|
+
* Everything here is tolerant: a missing or malformed field takes its default.
|
|
13
|
+
*/
|
|
14
|
+
import type { TriggerColors } from '../host/theme';
|
|
15
|
+
/** The copy the trigger draws. `${advertiserName}` is filled at render. */
|
|
16
|
+
export interface ReminderCopy {
|
|
17
|
+
title: string;
|
|
18
|
+
subtitle: string;
|
|
19
|
+
/** The open control's accessible name; the designs show no CTA text. */
|
|
20
|
+
cta: string;
|
|
21
|
+
/** The close control's accessible name. */
|
|
22
|
+
dismiss: string;
|
|
23
|
+
hours: string;
|
|
24
|
+
minutes: string;
|
|
25
|
+
seconds: string;
|
|
26
|
+
/** The title naming the claim's advertiser: "Finish your ${advertiserName} gift". */
|
|
27
|
+
offerTitle: string;
|
|
28
|
+
/** logoMarquee's title for several claims: "${claimCount} gifts still waiting". */
|
|
29
|
+
titleMany: string;
|
|
30
|
+
/** The word after the featured look's countdown: "23:32 left". */
|
|
31
|
+
left: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Built-in English, used per key when the template lacks one. Pinned across every
|
|
35
|
+
* platform to the backend fixture's values. The tone stays true for a reader who has
|
|
36
|
+
* already finished, and never says the offer ends or is lost.
|
|
37
|
+
*/
|
|
38
|
+
export declare const DEFAULT_REMINDER_COPY: Readonly<ReminderCopy>;
|
|
39
|
+
export type ReminderColors = TriggerColors;
|
|
40
|
+
export interface ReminderConfig {
|
|
41
|
+
/** The look's light colours (`lightColors`), used in the light scheme. */
|
|
42
|
+
lightColors: ReminderColors;
|
|
43
|
+
/** The served template, drawn by the SDUI engine. */
|
|
44
|
+
template: Record<string, unknown>;
|
|
45
|
+
/** The served layout name: a label, never a code path. */
|
|
46
|
+
layout: string;
|
|
47
|
+
windowHours: number;
|
|
48
|
+
dismissible: boolean;
|
|
49
|
+
colors: ReminderColors;
|
|
50
|
+
copy: ReminderCopy;
|
|
51
|
+
}
|
|
52
|
+
type Dict = Record<string, unknown>;
|
|
53
|
+
/** The config to draw from the served `ui.template`. */
|
|
54
|
+
export declare function decodeReminderTemplate(template: Dict): ReminderConfig;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,YAAY,CAWvD,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,aAAa,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,WAAW,EAAE,cAAc,CAAC;IAC5B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,YAAY,CAAC;CACpB;AAGD,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAoBpC,wDAAwD;AACxD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,IAAI,GAAG,cAAc,CAUrE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which claims the reminder may show (contract.md, behaviour 2).
|
|
3
|
+
*
|
|
4
|
+
* Eligible = available, inside the reminder window, with an advertiser to name, and
|
|
5
|
+
* not dismissed on this device. The window is the REMINDER's, not the offer's: when
|
|
6
|
+
* it ends the banner hides and the claim itself is untouched.
|
|
7
|
+
*/
|
|
8
|
+
import type { ReminderClaim } from './source';
|
|
9
|
+
/**
|
|
10
|
+
* How far ahead of this device's clock a claim time may be: the server stamps it, and
|
|
11
|
+
* a device clock running up to this far behind must still show a claim just made.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CLOCK_SKEW_MS: number;
|
|
14
|
+
/** When the reminder for this claim hides. NaN for an unparseable claim time. */
|
|
15
|
+
export declare function reminderEndsAt(claim: ReminderClaim, windowHours: number): number;
|
|
16
|
+
/** The eligible claims, newest first. The first one is the one to show. */
|
|
17
|
+
export declare function eligibleClaims(claims: readonly ReminderClaim[], windowHours: number, nowMs: number, dismissed: {
|
|
18
|
+
has(transactionId: string): boolean;
|
|
19
|
+
}): ReminderClaim[];
|
|
20
|
+
/** The longest reminder window any variant may serve (the backend validates 1..720). */
|
|
21
|
+
export declare const MAX_WINDOW_HOURS = 720;
|
|
22
|
+
/**
|
|
23
|
+
* Whether any claim could be shown: the gate before the config request, which assigns
|
|
24
|
+
* the experiment arm. Same rules as eligibility, under `windowHours`, the window last
|
|
25
|
+
* served at this placement (servedWindow.ts), capped at the longest any variant serves.
|
|
26
|
+
*/
|
|
27
|
+
export declare function hasReminderCandidate(claims: readonly ReminderClaim[], nowMs: number, dismissed: {
|
|
28
|
+
has(transactionId: string): boolean;
|
|
29
|
+
}, windowHours: number): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* When `hasReminderCandidate` next turns false by the clock alone: the first epoch ms past
|
|
32
|
+
* the window of the claim that leaves it first. Null when no claim is in it.
|
|
33
|
+
*/
|
|
34
|
+
export declare function reminderCandidateEnds(claims: readonly ReminderClaim[], nowMs: number, dismissed: {
|
|
35
|
+
has(transactionId: string): boolean;
|
|
36
|
+
}, windowHours: number): number | null;
|
|
37
|
+
//# sourceMappingURL=eligibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eligibility.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/eligibility.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAgB,CAAC;AAM3C,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE;IAAE,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACjD,aAAa,EAAE,CAYjB;AAED,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE;IAAE,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAClD,WAAW,EAAE,MAAM,GAClB,OAAO,CAWT;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE;IAAE,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAClD,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CASf"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reminder window last served at each placement, kept on the device so it outlives
|
|
3
|
+
* a reload: an open claim asks for the reminder (`state=claimOpen`) only inside it. The
|
|
4
|
+
* window is only known from a served look, so before one is served here it is the
|
|
5
|
+
* 24 hour default. Storage that fails, or holds anything but a window of 1..720 hours,
|
|
6
|
+
* reads as that default; nothing here throws.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SERVED_WINDOW_KEY = "encore.trigger.claimReminder.window";
|
|
9
|
+
/** Before any window was served at a placement (also the decoder's default). */
|
|
10
|
+
export declare const DEFAULT_WINDOW_HOURS = 24;
|
|
11
|
+
/** The window last served at `placement` on this device, else the 24 hour default. */
|
|
12
|
+
export declare function servedWindowHours(storage: Storage | null, placement: string | undefined): number;
|
|
13
|
+
/** Keep the window a look at `placement` was served with. */
|
|
14
|
+
export declare function rememberServedWindow(storage: Storage | null, placement: string | undefined, hours: number): void;
|
|
15
|
+
//# sourceMappingURL=servedWindow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"servedWindow.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/servedWindow.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,eAAO,MAAM,iBAAiB,wCAAwC,CAAC;AAEvE,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAqBvC,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEhG;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAWhH"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The claim reminder's view of the user's claims. INTERNAL.
|
|
3
|
+
*
|
|
4
|
+
* The trigger never reads the claims bank directly. It reads this adapter, so the
|
|
5
|
+
* trigger can be built and tested before the bank's `claims()` lands on main, and so
|
|
6
|
+
* the binding to it is one thin mapper (contract.md, "Dependency strategy"). The SDK's
|
|
7
|
+
* source is the claim log (the claims this browser saw), merged with the claims bank
|
|
8
|
+
* once one is bound (core/claimLog.ts).
|
|
9
|
+
*
|
|
10
|
+
* The same adapter exists on iOS and Android. A tap opens the Encore sheet, so
|
|
11
|
+
* the adapter only reads; nothing here reopens a claim.
|
|
12
|
+
*/
|
|
13
|
+
/** One open claim, reduced to what the reminder needs. */
|
|
14
|
+
export interface ReminderClaim {
|
|
15
|
+
transactionId: string;
|
|
16
|
+
campaignId: string;
|
|
17
|
+
advertiserName: string;
|
|
18
|
+
advertiserLogoUrl?: string | null;
|
|
19
|
+
/** The claimed offer's perk ("3 months free"), when known. */
|
|
20
|
+
perk?: string;
|
|
21
|
+
/** ISO-8601. The latest claim time when the server exposes it, else the creation time. */
|
|
22
|
+
claimedAt: string;
|
|
23
|
+
availability: 'available' | 'unavailable';
|
|
24
|
+
}
|
|
25
|
+
export interface ClaimReminderSource {
|
|
26
|
+
/** The user's open claims, freshly read. Rejects when the read fails. */
|
|
27
|
+
openClaims(): Promise<ReminderClaim[]>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0FAA0F;IAC1F,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,WAAW,GAAG,aAAa,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,UAAU,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;CACxC"}
|