@everfur/sdk 0.1.0 → 0.3.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/CHANGELOG.md +648 -1
- package/README.md +58 -23
- package/consent/package.json +8 -0
- package/dist/Chat-DPUD6dnc.d.cts +128 -0
- package/dist/Chat-DwAC2vhB.d.ts +128 -0
- package/dist/DepthViews-DNEM96Se.d.ts +16 -0
- package/dist/DepthViews-DP0R-DhB.d.cts +19 -0
- package/dist/DepthViews-D_3hl4xk.d.ts +19 -0
- package/dist/DepthViews-DbFhR4Du.d.cts +16 -0
- package/dist/ErrorPolicyPort-CNf4uQZP.d.cts +22 -0
- package/dist/ErrorPolicyPort-CwbfmxzJ.d.ts +22 -0
- package/dist/{EverfurResult-D92-uL82.d.cts → EverfurResult-DN9pL2Ab.d.cts} +11 -10
- package/dist/{EverfurResult-D92-uL82.d.ts → EverfurResult-DN9pL2Ab.d.ts} +11 -10
- package/dist/{PhotoController-BItt5M7u.d.cts → PhotoController-3l7MT9jA.d.cts} +1 -1
- package/dist/{PhotoController-D8zMTdcW.d.ts → PhotoController-vzY5bfY_.d.ts} +1 -1
- package/dist/animations/index.cjs +1 -1997
- package/dist/animations/index.d.cts +35 -35
- package/dist/animations/index.d.ts +35 -35
- package/dist/animations/index.js +1 -1972
- package/dist/attachments-5NeobOCd.d.ts +256 -0
- package/dist/attachments-Bw3iMQgu.d.ts +146 -0
- package/dist/attachments-CQgFrEQ7.d.cts +146 -0
- package/dist/attachments-D8T5re7e.d.cts +256 -0
- package/dist/casesRepository-ClLv6qMl.d.ts +188 -0
- package/dist/casesRepository-DHwtGRYY.d.cts +188 -0
- package/dist/chat/index.cjs +1 -1170
- package/dist/chat/index.d.cts +31 -53
- package/dist/chat/index.d.ts +31 -53
- package/dist/chat/index.js +1 -1167
- package/dist/client/index.cjs +9 -2315
- package/dist/client/index.d.cts +77 -15
- package/dist/client/index.d.ts +77 -15
- package/dist/client/index.js +9 -2215
- package/dist/{config-CiJ0PVBB.d.ts → config-CzTZGlfF.d.cts} +63 -25
- package/dist/{config-BSjBdxrZ.d.cts → config-DW60uRb9.d.ts} +63 -25
- package/dist/consent/index.cjs +1 -0
- package/dist/consent/index.d.cts +33 -0
- package/dist/consent/index.d.ts +33 -0
- package/dist/consent/index.js +1 -0
- package/dist/context-DXhqHlPU.d.ts +159 -0
- package/dist/context-XvTzq1tE.d.cts +159 -0
- package/dist/copy-Mjoo91aS.d.ts +198 -0
- package/dist/copy-bKDNigLb.d.cts +198 -0
- package/dist/core/index.cjs +13 -3175
- package/dist/core/index.d.cts +58 -12
- package/dist/core/index.d.ts +58 -12
- package/dist/core/index.js +13 -3163
- package/dist/depth-CErXCU8J.d.cts +502 -0
- package/dist/depth-DjDcJ6kH.d.ts +502 -0
- package/dist/entitlementRepository-DKdXFgTo.d.cts +698 -0
- package/dist/entitlementRepository-DSbzuyAW.d.ts +698 -0
- package/dist/{identity-DK9zORrG.d.ts → identity-BMx2SUOM.d.ts} +19 -6
- package/dist/{identity-Brl-lDd6.d.cts → identity-DI4eVx9S.d.cts} +19 -6
- package/dist/{ids-CJ1S6adf.d.cts → ids-B2GAAifq.d.cts} +1 -1
- package/dist/{ids-CJ1S6adf.d.ts → ids-B2GAAifq.d.ts} +1 -1
- package/dist/index.cjs +12 -4488
- package/dist/index.d.cts +29 -121
- package/dist/index.d.ts +29 -121
- package/dist/index.js +12 -4464
- package/dist/models-B-Uh2LTf.d.ts +214 -0
- package/dist/models-D2EUxPZY.d.cts +214 -0
- package/dist/notifications/index.cjs +2 -0
- package/dist/notifications/index.d.cts +17 -0
- package/dist/notifications/index.d.ts +17 -0
- package/dist/notifications/index.js +2 -0
- package/dist/pets-CtQdRpWo.d.ts +92 -0
- package/dist/pets-aB8q0JyX.d.cts +92 -0
- package/dist/photo/index.cjs +1 -2189
- package/dist/photo/index.d.cts +6 -6
- package/dist/photo/index.d.ts +6 -6
- package/dist/photo/index.js +1 -2186
- package/dist/ports-BN6RHF9W.d.cts +48 -0
- package/dist/ports-BN6RHF9W.d.ts +48 -0
- package/dist/ports-DEBzEhbp.d.cts +386 -0
- package/dist/ports-DMolTRzU.d.ts +386 -0
- package/dist/profile-CSs1wlXT.d.cts +93 -0
- package/dist/profile-CSs1wlXT.d.ts +93 -0
- package/dist/records/depth/index.cjs +2 -0
- package/dist/records/depth/index.d.cts +13 -0
- package/dist/records/depth/index.d.ts +13 -0
- package/dist/records/depth/index.js +2 -0
- package/dist/records/index.cjs +3 -2839
- package/dist/records/index.d.cts +137 -203
- package/dist/records/index.d.ts +137 -203
- package/dist/records/index.js +3 -2833
- package/dist/requestFunnel-CjW7uDuA.d.ts +87 -0
- package/dist/requestFunnel-L-BQfi0z.d.cts +87 -0
- package/dist/{resolve-Dq_4_agU.d.ts → resolve-D4Ywz5OS.d.cts} +10 -4
- package/dist/{resolve-Dq_4_agU.d.cts → resolve-D4Ywz5OS.d.ts} +10 -4
- package/dist/{runtime-BgQnA594.d.cts → runtime-B8s-_hv8.d.cts} +134 -59
- package/dist/{runtime-CBA-LvdM.d.ts → runtime-BR9ysG0J.d.ts} +134 -59
- package/dist/server/events/index.cjs +2 -0
- package/dist/server/events/index.d.cts +550 -0
- package/dist/server/events/index.d.ts +550 -0
- package/dist/server/events/index.js +2 -0
- package/dist/server/index.cjs +2 -533
- package/dist/server/index.d.cts +73 -18
- package/dist/server/index.d.ts +73 -18
- package/dist/server/index.js +2 -530
- package/dist/species-BXAIMh7I.d.cts +9 -0
- package/dist/species-BXAIMh7I.d.ts +9 -0
- package/dist/televet/index.cjs +1 -0
- package/dist/televet/index.d.cts +60 -0
- package/dist/televet/index.d.ts +60 -0
- package/dist/televet/index.js +1 -0
- package/dist/testing/index.cjs +5 -823
- package/dist/testing/index.d.cts +17 -3
- package/dist/testing/index.d.ts +17 -3
- package/dist/testing/index.js +5 -820
- package/dist/testing/rn/index.cjs +1 -449
- package/dist/testing/rn/index.d.cts +17 -29
- package/dist/testing/rn/index.d.ts +17 -29
- package/dist/testing/rn/index.js +1 -444
- package/dist/testing/web/index.cjs +1 -0
- package/dist/testing/web/index.d.cts +131 -0
- package/dist/testing/web/index.d.ts +131 -0
- package/dist/testing/web/index.js +1 -0
- package/dist/timelineRows-CaohZzXS.d.cts +19 -0
- package/dist/timelineRows-DZed6dAM.d.ts +19 -0
- package/dist/typeStyle-0TydiZ1w.d.cts +19 -0
- package/dist/typeStyle-CWMsoe6b.d.ts +19 -0
- package/dist/uploadTransport-D0M0T4hN.d.ts +38 -0
- package/dist/uploadTransport-DKJHs3Yj.d.cts +38 -0
- package/dist/useRecordsDepth-BHBzJ76R.d.cts +237 -0
- package/dist/useRecordsDepth-BU-OhzH6.d.ts +237 -0
- package/dist/useVetVisit-Bc84hWUU.d.cts +187 -0
- package/dist/useVetVisit-CjmMa896.d.ts +187 -0
- package/dist/video/index.cjs +1 -1941
- package/dist/video/index.d.cts +4 -4
- package/dist/video/index.d.ts +4 -4
- package/dist/video/index.js +1 -1938
- package/dist/view-C3qPIXGX.d.cts +310 -0
- package/dist/view-DtSPYpKa.d.ts +310 -0
- package/dist/visitIntent-D7_yVp1I.d.cts +8 -0
- package/dist/visitIntent-D7_yVp1I.d.ts +8 -0
- package/dist/web/consent/index.cjs +1 -0
- package/dist/web/consent/index.d.cts +34 -0
- package/dist/web/consent/index.d.ts +34 -0
- package/dist/web/consent/index.js +1 -0
- package/dist/web/index.cjs +14 -0
- package/dist/web/index.d.cts +217 -0
- package/dist/web/index.d.ts +217 -0
- package/dist/web/index.js +14 -0
- package/dist/web/notifications/index.cjs +2 -0
- package/dist/web/notifications/index.d.cts +213 -0
- package/dist/web/notifications/index.d.ts +213 -0
- package/dist/web/notifications/index.js +2 -0
- package/dist/web/records/depth/index.cjs +2 -0
- package/dist/web/records/depth/index.d.cts +12 -0
- package/dist/web/records/depth/index.d.ts +12 -0
- package/dist/web/records/depth/index.js +2 -0
- package/dist/web/records/index.cjs +4 -0
- package/dist/web/records/index.d.cts +194 -0
- package/dist/web/records/index.d.ts +194 -0
- package/dist/web/records/index.js +4 -0
- package/dist/web/televet/index.cjs +1 -0
- package/dist/web/televet/index.d.cts +50 -0
- package/dist/web/televet/index.d.ts +50 -0
- package/dist/web/televet/index.js +1 -0
- package/notifications/package.json +8 -0
- package/package.json +197 -9
- package/records/depth/package.json +8 -0
- package/server/events/device-blocked.cjs +15 -0
- package/server/events/package.json +9 -0
- package/televet/package.json +8 -0
- package/testing/web/native-blocked.cjs +12 -0
- package/testing/web/package.json +8 -0
- package/web/consent/native-blocked.cjs +12 -0
- package/web/consent/package.json +8 -0
- package/web/native-blocked.cjs +12 -0
- package/web/notifications/native-blocked.cjs +12 -0
- package/web/notifications/package.json +8 -0
- package/web/package.json +8 -0
- package/web/records/depth/native-blocked.cjs +12 -0
- package/web/records/depth/package.json +8 -0
- package/web/records/native-blocked.cjs +12 -0
- package/web/records/package.json +8 -0
- package/web/televet/native-blocked.cjs +12 -0
- package/web/televet/package.json +8 -0
- package/dist/ChatController-CKdBvPj2.d.ts +0 -146
- package/dist/ChatController-CpUMvvZf.d.cts +0 -146
- package/dist/FilePort-BabWrv7I.d.cts +0 -22
- package/dist/FilePort-BabWrv7I.d.ts +0 -22
- package/dist/petsRepository-BEGb97M9.d.cts +0 -326
- package/dist/petsRepository-Bu18r2kK.d.ts +0 -326
- package/dist/requestFunnel-DuUH-kAe.d.cts +0 -28
- package/dist/requestFunnel-dio5OmR9.d.ts +0 -28
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
import { E as EverfurError } from './EverfurResult-DN9pL2Ab.cjs';
|
|
2
|
+
import { R as RequestFunnel } from './requestFunnel-L-BQfi0z.cjs';
|
|
3
|
+
import { A as AuthContext } from './identity-DI4eVx9S.cjs';
|
|
4
|
+
import { E as EntitlementDecision } from './resolve-D4Ywz5OS.cjs';
|
|
5
|
+
|
|
6
|
+
/** The fixed set of slot names, in the order the surfaces list them. */
|
|
7
|
+
declare const THEME_SLOT_NAMES: readonly ["composerInput", "sendButton", "userBubble", "assistantBubble", "recordCard", "vetVisitButton", "primaryButton", "link"];
|
|
8
|
+
type EverfurThemeSlotName = (typeof THEME_SLOT_NAMES)[number];
|
|
9
|
+
/** The allow-listed paint keys a slot accepts. */
|
|
10
|
+
declare const THEME_SLOT_KEYS: readonly ["backgroundColor", "borderColor", "borderRadius", "textColor"];
|
|
11
|
+
type EverfurThemeSlotKey = (typeof THEME_SLOT_KEYS)[number];
|
|
12
|
+
/** One slot's paint: every key optional; a key that is absent keeps the surface's own token. */
|
|
13
|
+
interface EverfurThemeSlot {
|
|
14
|
+
/** Normalized colour (`#RRGGBB` or `rgba(...)`). */
|
|
15
|
+
readonly backgroundColor?: string;
|
|
16
|
+
readonly borderColor?: string;
|
|
17
|
+
/** A corner radius in dp/px; never negative. */
|
|
18
|
+
readonly borderRadius?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Normalized colour; guarded at 4.5:1 against `backgroundColor`, or against the slot's default ground when the
|
|
21
|
+
* slot sets no background (see `guardSlotContrast`).
|
|
22
|
+
*/
|
|
23
|
+
readonly textColor?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The slot map a resolved theme carries: only the slots that were set, each frozen. */
|
|
26
|
+
type EverfurThemeSlots = Readonly<Partial<Record<EverfurThemeSlotName, EverfurThemeSlot>>>;
|
|
27
|
+
/** The minimum text-on-background ratio a slot may paint (WCAG AA body text). */
|
|
28
|
+
declare const SLOT_MIN_CONTRAST = 4.5;
|
|
29
|
+
/**
|
|
30
|
+
* Parse an untrusted `slots` blob into the typed slot map. Unknown slot names and unknown keys are ignored, a
|
|
31
|
+
* malformed colour or radius is dropped, and a slot left with no valid key is dropped. Returns null when nothing
|
|
32
|
+
* valid remains (callers read null as "unset"). Never throws.
|
|
33
|
+
*/
|
|
34
|
+
declare function parseThemeSlots(json: unknown): EverfurThemeSlots | null;
|
|
35
|
+
/**
|
|
36
|
+
* Overlay `over` onto `base` slot by slot: a slot the overlay names REPLACES the base slot whole (the backend's
|
|
37
|
+
* overlay unit, so `slots.<name>` locks and overlays agree); a slot it does not name is kept. Either side may be
|
|
38
|
+
* null. Returns a frozen map (the same reference when one side is null or empty).
|
|
39
|
+
*/
|
|
40
|
+
declare function mergeThemeSlots(base: EverfurThemeSlots | null, over: EverfurThemeSlots | null): EverfurThemeSlots;
|
|
41
|
+
/** The minimum ratio a slot's edge may reach on its ground (WCAG 1.4.11, the boundary of a control). */
|
|
42
|
+
declare const SLOT_MIN_BORDER_CONTRAST = 3;
|
|
43
|
+
/**
|
|
44
|
+
* The ground each slot's text sits on when the slot sets no background of its own: the surface's default paint
|
|
45
|
+
* at that place, as the resolver knows it. Every slot lists at least one ground; a text colour must read on all
|
|
46
|
+
* of them (the link list names every ground a text link is drawn on).
|
|
47
|
+
*/
|
|
48
|
+
type SlotGrounds = Readonly<Record<EverfurThemeSlotName, readonly string[]>>;
|
|
49
|
+
/**
|
|
50
|
+
* The contrast guard: every text colour a slot paints must reach `SLOT_MIN_CONTRAST` on the ground it is drawn on,
|
|
51
|
+
* and every edge `SLOT_MIN_BORDER_CONTRAST` on the fill it bounds.
|
|
52
|
+
* - A TRANSLUCENT background whose seats straddle the white/black crossover is collapsed to the opaque colour
|
|
53
|
+
* it shows over the slot's primary ground FIRST (`collapseUnsatisfiableFill`), because such a slot has no
|
|
54
|
+
* readable ink while it means two colours at once. Everything below then measures against one seat.
|
|
55
|
+
* - A slot that supplies a background: its ink is measured on that fill AS THE EYE SEES IT (`seatsOf`, the fill
|
|
56
|
+
* composited onto the surface's default ground at that slot), and a missing or failing one is replaced by the
|
|
57
|
+
* ink that fill is guaranteed to carry (`legibleOn`), then pushed until it reads on every seat.
|
|
58
|
+
* - A slot without one: its `textColor` is measured on the slot's DEFAULT ground (`grounds`, the surface's own
|
|
59
|
+
* paint there) and, when it fails, pushed toward the legible pole of that ground until it reads, so a text-only
|
|
60
|
+
* slot can never paint invisible text either. Without `grounds` such a slot keeps its colour as supplied.
|
|
61
|
+
* - An edge (`borderColor`) is measured on the fill it bounds (the same seats) and pushed the same way when it
|
|
62
|
+
* reads below 3:1.
|
|
63
|
+
* Returns the same reference when nothing changes.
|
|
64
|
+
*/
|
|
65
|
+
declare function guardSlotContrast(slots: EverfurThemeSlots, grounds?: SlotGrounds): EverfurThemeSlots;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* One slot's paint on the `theme` prop; colours in any form `parseColor` reads, the radius in dp/px. The console's
|
|
69
|
+
* snake_case wire keys are accepted beside the camelCase ones.
|
|
70
|
+
*/
|
|
71
|
+
interface EverfurThemeSlotInput {
|
|
72
|
+
readonly backgroundColor?: string | number;
|
|
73
|
+
readonly background_color?: string | number;
|
|
74
|
+
readonly borderColor?: string | number;
|
|
75
|
+
readonly border_color?: string | number;
|
|
76
|
+
readonly borderRadius?: number | string;
|
|
77
|
+
readonly border_radius?: number | string;
|
|
78
|
+
readonly textColor?: string | number;
|
|
79
|
+
readonly text_color?: string | number;
|
|
80
|
+
}
|
|
81
|
+
/** The `slots` map on the `theme` prop: any subset of the eight slot names. */
|
|
82
|
+
type EverfurThemeSlotsInput = Readonly<Partial<Record<EverfurThemeSlotName, EverfurThemeSlotInput>>>;
|
|
83
|
+
/**
|
|
84
|
+
* The faces a theme names: the three text weights and the three mono weights (`EverfurFontFaceKey` on the tokens).
|
|
85
|
+
* A missing weight falls back along its chain: bold -> medium -> regular, monoBold -> monoMedium -> mono.
|
|
86
|
+
*/
|
|
87
|
+
type EverfurThemeFontFaceKey = 'regular' | 'medium' | 'bold' | 'mono' | 'monoMedium' | 'monoBold';
|
|
88
|
+
/** The `fonts` map on the `theme` prop: a registered family name per face, any subset. */
|
|
89
|
+
type EverfurThemeFontsInput = Readonly<Partial<Record<EverfurThemeFontFaceKey, string>>>;
|
|
90
|
+
/** The `font_urls` map on the `theme` prop (web only): a brand-font URL per face, any subset. */
|
|
91
|
+
type EverfurThemeFontUrlsInput = Readonly<Partial<Record<EverfurThemeFontFaceKey, string>>>;
|
|
92
|
+
/**
|
|
93
|
+
* The client `theme` prop. Any shape is tolerated (unknown keys are ignored, malformed values are dropped); the
|
|
94
|
+
* named keys are the ones the resolver reads, in the console's snake_case with camelCase twins.
|
|
95
|
+
*/
|
|
96
|
+
interface EverfurThemeInput {
|
|
97
|
+
readonly display_name?: string;
|
|
98
|
+
readonly displayName?: string;
|
|
99
|
+
readonly logo_url?: string;
|
|
100
|
+
readonly logoUrl?: string;
|
|
101
|
+
/** The logo shown on the dark palette; absent, `logo_url` is shown on both. */
|
|
102
|
+
readonly logo_url_dark?: string;
|
|
103
|
+
readonly logoUrlDark?: string;
|
|
104
|
+
readonly primary_color?: string | number;
|
|
105
|
+
readonly primaryColor?: string | number;
|
|
106
|
+
readonly accent_color?: string | number;
|
|
107
|
+
readonly accentColor?: string | number;
|
|
108
|
+
/** The primary fill on the dark palette; absent, it is derived from `primary_color` (`deriveDarkVariant`). */
|
|
109
|
+
readonly primary_color_dark?: string | number;
|
|
110
|
+
readonly primaryColorDark?: string | number;
|
|
111
|
+
readonly accent_color_dark?: string | number;
|
|
112
|
+
readonly accentColorDark?: string | number;
|
|
113
|
+
/**
|
|
114
|
+
* `light` or `dark` pins the palette; `auto` follows the device's scheme. Absent (here and in the console), the
|
|
115
|
+
* theme is LIGHT, as Everfur's own apps are: the device scheme is never read unless someone chose `auto`.
|
|
116
|
+
*/
|
|
117
|
+
readonly brightness?: string;
|
|
118
|
+
/** The console's name for `brightness` (`light`, `dark` or `auto`); `brightness` wins when both are set. */
|
|
119
|
+
readonly color_scheme?: string;
|
|
120
|
+
readonly colorScheme?: string;
|
|
121
|
+
readonly font_family?: string;
|
|
122
|
+
readonly fontFamily?: string;
|
|
123
|
+
readonly font_url?: string;
|
|
124
|
+
readonly fontUrl?: string;
|
|
125
|
+
/**
|
|
126
|
+
* The family per face. Two conventions, the same rendering on React Native and the web:
|
|
127
|
+
* - one registered face per weight, the way the Everfur app maps weight to family (`Azeret-Regular`,
|
|
128
|
+
* `Azeret-Medium`, `Azeret-Bold`, `AzeretMono-Regular`): a name no other weight of its group uses is a NAMED
|
|
129
|
+
* face, rendered with no weight of its own (React Native) or at the normal weight (the web);
|
|
130
|
+
* - one family for every weight (`Azeret`): a name shared across the weights of a group is a BASE family, and
|
|
131
|
+
* every face takes its numeric weight on both hosts.
|
|
132
|
+
* A missing weight falls back along its chain (regular -> medium -> bold, mono -> monoMedium -> monoBold). The host
|
|
133
|
+
* registers the faces itself (the native font files, or a web `@font-face`) and passes the NAMES only: the SDK
|
|
134
|
+
* bundles no font. Beats `font_family` for the weights it names. On React Native, when the app's font registry can
|
|
135
|
+
* tell (expo-font's), a named face that is not registered falls back to the platform font at its weight, with a
|
|
136
|
+
* development warning.
|
|
137
|
+
*/
|
|
138
|
+
readonly fonts?: EverfurThemeFontsInput;
|
|
139
|
+
/**
|
|
140
|
+
* Web only: the woff2 URL per face, loaded through the SDK's brand-font allow-list (a woff2 under `/fonts/`
|
|
141
|
+
* on the Everfur SDK CDN). A URL on any other origin is refused, so a host that serves its own licensed
|
|
142
|
+
* faces loads them with its own `@font-face` and passes `fonts` names only.
|
|
143
|
+
*/
|
|
144
|
+
readonly font_urls?: EverfurThemeFontUrlsInput;
|
|
145
|
+
readonly fontUrls?: EverfurThemeFontUrlsInput;
|
|
146
|
+
readonly chat_placeholder?: string;
|
|
147
|
+
readonly chatPlaceholder?: string;
|
|
148
|
+
readonly placeholder?: string;
|
|
149
|
+
/** Typed for completeness; INERT on the client. The server decides the attribution from the plan. */
|
|
150
|
+
readonly hide_powered_by?: boolean;
|
|
151
|
+
readonly hidePoweredBy?: boolean;
|
|
152
|
+
/** `white`, `cream` or `subtle`. */
|
|
153
|
+
readonly surface_style?: string;
|
|
154
|
+
readonly surfaceStyle?: string;
|
|
155
|
+
/** `sharp`, `default` or `round`. */
|
|
156
|
+
readonly radius_scale?: string;
|
|
157
|
+
readonly radiusScale?: string;
|
|
158
|
+
/**
|
|
159
|
+
* The cap on the CHROME text tiers (headings, controls, chips, badges): 1 to 3.1, or 0 for none (the default,
|
|
160
|
+
* the tiers alone: headings 2, controls 1.8, chips 1.5, badges 1.3). Flowing content is never capped.
|
|
161
|
+
*/
|
|
162
|
+
readonly accessibility_max_font_scale?: number | string;
|
|
163
|
+
readonly accessibilityMaxFontScale?: number | string;
|
|
164
|
+
/** Paint overrides at the named slots. */
|
|
165
|
+
readonly slots?: EverfurThemeSlotsInput;
|
|
166
|
+
/** Tolerated for any other key; ignored by the resolver. */
|
|
167
|
+
readonly [key: string]: unknown;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Recursively freeze a plain object/array tree in place and return it (typed as the input). */
|
|
171
|
+
declare function deepFreeze<T>(value: T): T;
|
|
172
|
+
/** Foreground text tokens; the semantic text ramp over surfaces. */
|
|
173
|
+
interface EverfurTextColorTokens {
|
|
174
|
+
readonly primary: string;
|
|
175
|
+
readonly secondary: string;
|
|
176
|
+
readonly muted: string;
|
|
177
|
+
/** The composer placeholder ink (the Everfur app's `rgba(61,61,61,0.75)`, 5:1 on cream; a lifted twin on dark). */
|
|
178
|
+
readonly placeholder: string;
|
|
179
|
+
/** Text drawn on the brand fill (a compiled default; resolve recomputes onPrimary/onAccent via WCAG). */
|
|
180
|
+
readonly onBrand: string;
|
|
181
|
+
readonly metaCool: string;
|
|
182
|
+
/** The message timestamp and copy glyph under a bubble (the Everfur app's footer ink; a lifted twin on dark). */
|
|
183
|
+
readonly timestamp: string;
|
|
184
|
+
}
|
|
185
|
+
/** The Everfur color system: brand + surfaces + text ramp + semantic palette + component washes. */
|
|
186
|
+
interface EverfurColorTokens {
|
|
187
|
+
readonly brand: string;
|
|
188
|
+
readonly brandSoft: string;
|
|
189
|
+
readonly brandSofter: string;
|
|
190
|
+
readonly brandBorder: string;
|
|
191
|
+
readonly borderHairlineGreen: string;
|
|
192
|
+
/** The brand at 55%: the edge of a floating card over the chat (the attachment popover, the Everfur app's). */
|
|
193
|
+
readonly brandBorderStrong: string;
|
|
194
|
+
/**
|
|
195
|
+
* The brand as TEXT or ICON ink. The resolver derives it from `brand`, pushed toward black (light palette) or
|
|
196
|
+
* white (dark palette) until it reads at 4.5:1 on every ground of the palette, so a light partner colour
|
|
197
|
+
* (yellow, mint, sky) keeps its hue as a fill and still reads as a label. Never use `brand` itself as ink.
|
|
198
|
+
*/
|
|
199
|
+
readonly brandInk: string;
|
|
200
|
+
/**
|
|
201
|
+
* The ink of a TEXT LINK (citation titles, the disclaimer's links, "earlier messages", record document
|
|
202
|
+
* links): the `link` slot's text colour, else `accent`, guarded by the resolver at 4.5:1 on every ground a
|
|
203
|
+
* link sits on. `accent` is the link and highlight colour; this is its legible ink.
|
|
204
|
+
*/
|
|
205
|
+
readonly linkInk: string;
|
|
206
|
+
readonly surface: string;
|
|
207
|
+
readonly surfaceCream: string;
|
|
208
|
+
readonly surfaceSubtle: string;
|
|
209
|
+
readonly background: string;
|
|
210
|
+
readonly borderRingCream: string;
|
|
211
|
+
/**
|
|
212
|
+
* The chat ground: the surface the thread, the empty state and the composer sit on. White by default (the
|
|
213
|
+
* Everfur app's shell); `surface_style` picks it. Kept apart from `surfaceCream` so choosing a ground never
|
|
214
|
+
* repaints the composer or the record cards.
|
|
215
|
+
*/
|
|
216
|
+
readonly chatGround: string;
|
|
217
|
+
/** The composer pill's fill: the Everfur app's fixed cream, whatever `surface_style` picks for the ground. */
|
|
218
|
+
readonly composerFill: string;
|
|
219
|
+
/** The composer pill's edge: the brand at 75% (the Everfur app's, 5:1 on white). */
|
|
220
|
+
readonly composerBorder: string;
|
|
221
|
+
/** The colour of the soft lift under a floating control (the composer, the popover): the Everfur app's. */
|
|
222
|
+
readonly shadow: string;
|
|
223
|
+
readonly text: EverfurTextColorTokens;
|
|
224
|
+
/** The primary CTA fill (server-overridable via primary_color). Foreground is `onPrimary`. */
|
|
225
|
+
readonly primary: string;
|
|
226
|
+
/** WCAG-legible foreground for `primary` (computed by resolveTheme, never passed through). */
|
|
227
|
+
readonly onPrimary: string;
|
|
228
|
+
/** The user/CTA accent fill (server-overridable via accent_color). Foreground is `onAccent`. */
|
|
229
|
+
readonly accent: string;
|
|
230
|
+
/** WCAG-legible foreground for `accent` (computed by resolveTheme). */
|
|
231
|
+
readonly onAccent: string;
|
|
232
|
+
/** The 0.5px bubble edge (a lightened brand / success green for the default). */
|
|
233
|
+
readonly accentEdge: string;
|
|
234
|
+
readonly success: string;
|
|
235
|
+
readonly danger: string;
|
|
236
|
+
readonly errorRed: string;
|
|
237
|
+
readonly warningStrong: string;
|
|
238
|
+
readonly cautionAccent: string;
|
|
239
|
+
readonly riskConcern: string;
|
|
240
|
+
/**
|
|
241
|
+
* The three feedback thumbs under an assistant reply, the Everfur app's Figma strokes: `up` (helpful) green,
|
|
242
|
+
* `neutral` amber, `down` (not helpful) red. The stroke at rest and the fill once recorded.
|
|
243
|
+
*/
|
|
244
|
+
readonly sentiment: {
|
|
245
|
+
readonly up: string;
|
|
246
|
+
readonly neutral: string;
|
|
247
|
+
readonly down: string;
|
|
248
|
+
};
|
|
249
|
+
readonly badgeBgPositive: string;
|
|
250
|
+
readonly badgeBgCaution: string;
|
|
251
|
+
readonly badgeBgCritical: string;
|
|
252
|
+
readonly badgeBgNeutral: string;
|
|
253
|
+
/** user bubble = accent fill; assistant bubble = bare surface (the mobile/Flutter asymmetry). */
|
|
254
|
+
readonly bubbleUser: string;
|
|
255
|
+
readonly bubbleAssistant: string;
|
|
256
|
+
readonly skeleton: string;
|
|
257
|
+
readonly scanButtonPink: string;
|
|
258
|
+
readonly checkupCardLowRiskBg: string;
|
|
259
|
+
readonly checkupCardConcernBg: string;
|
|
260
|
+
}
|
|
261
|
+
/** Spacing scale (dp). */
|
|
262
|
+
interface EverfurSpaceTokens {
|
|
263
|
+
readonly xs: number;
|
|
264
|
+
readonly sm: number;
|
|
265
|
+
readonly md: number;
|
|
266
|
+
readonly lg: number;
|
|
267
|
+
readonly xl: number;
|
|
268
|
+
readonly xxl: number;
|
|
269
|
+
}
|
|
270
|
+
/** Corner-radius scale (dp); `pill` is an effectively-infinite radius. */
|
|
271
|
+
interface EverfurRadiusTokens {
|
|
272
|
+
readonly tile: number;
|
|
273
|
+
readonly xs: number;
|
|
274
|
+
readonly sm: number;
|
|
275
|
+
readonly md: number;
|
|
276
|
+
readonly lg: number;
|
|
277
|
+
readonly xl: number;
|
|
278
|
+
readonly pill: number;
|
|
279
|
+
}
|
|
280
|
+
interface EverfurTypeSizeTokens {
|
|
281
|
+
readonly nano: number;
|
|
282
|
+
readonly small: number;
|
|
283
|
+
readonly micro: number;
|
|
284
|
+
readonly tiny: number;
|
|
285
|
+
readonly caption: number;
|
|
286
|
+
readonly bodyTight: number;
|
|
287
|
+
readonly body: number;
|
|
288
|
+
readonly subtitle: number;
|
|
289
|
+
readonly heading: number;
|
|
290
|
+
readonly verdict: number;
|
|
291
|
+
}
|
|
292
|
+
/** Line-height multipliers (applied to a size to derive an absolute lineHeight). */
|
|
293
|
+
interface EverfurLineHeightTokens {
|
|
294
|
+
readonly tight: number;
|
|
295
|
+
readonly snug: number;
|
|
296
|
+
readonly normal: number;
|
|
297
|
+
readonly relaxed: number;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* RN-assignable font-weight literals. Typed as the exact string literals we ship (not bare `string`) so a
|
|
301
|
+
* consumer can spread a weight token straight into a `Text` style: React Native's `TextStyle['fontWeight']`
|
|
302
|
+
* accepts these, but rejects `string`. Kept framework-free (no react-native import) to hold the client layer's
|
|
303
|
+
* no-framework boundary - these three literals are a subset of RN's fontWeight union.
|
|
304
|
+
*/
|
|
305
|
+
type EverfurFontWeight = '400' | '500' | '700';
|
|
306
|
+
/** RN fontWeight tokens. */
|
|
307
|
+
interface EverfurWeightTokens {
|
|
308
|
+
readonly regular: EverfurFontWeight;
|
|
309
|
+
readonly medium: EverfurFontWeight;
|
|
310
|
+
readonly bold: EverfurFontWeight;
|
|
311
|
+
}
|
|
312
|
+
interface EverfurLetterSpacingTokens {
|
|
313
|
+
readonly eyebrow: number;
|
|
314
|
+
readonly monoWide: number;
|
|
315
|
+
readonly headerBrand: number;
|
|
316
|
+
readonly tight: number;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* The faces a theme names: the three text weights and the three mono weights (the Everfur app registers
|
|
320
|
+
* `AzeretMono-Regular`, `-Medium` and `-Bold`). A missing weight falls back along its chain: bold -> medium ->
|
|
321
|
+
* regular, monoBold -> monoMedium -> mono.
|
|
322
|
+
*/
|
|
323
|
+
type EverfurFontFaceKey = 'regular' | 'medium' | 'bold' | 'mono' | 'monoMedium' | 'monoBold';
|
|
324
|
+
/**
|
|
325
|
+
* The text-scale tiers of the Everfur app (`fontScaling.ts`): how far a class of text may follow the user's text
|
|
326
|
+
* size. Flowing `content` (message bodies, card bodies, list rows) is never capped; the bounded chrome is:
|
|
327
|
+
* `heading` 2x, `control` (buttons) 1.8x, `compact` (chips, pills, inline meta) 1.5x, `badge` 1.3x.
|
|
328
|
+
*/
|
|
329
|
+
type EverfurTextScaleTier = 'content' | 'heading' | 'control' | 'compact' | 'badge';
|
|
330
|
+
/**
|
|
331
|
+
* The cap of each tier, React Native's `maxFontSizeMultiplier` semantics: 0 means no maximum. The Everfur app's
|
|
332
|
+
* values, verbatim. A tenant's `accessibility_max_font_scale` may lower the chrome tiers further, never content.
|
|
333
|
+
*/
|
|
334
|
+
declare const TEXT_SCALE_TIER_CAPS: Readonly<Record<EverfurTextScaleTier, number>>;
|
|
335
|
+
/** The family rendered at each face. Every entry is populated (the compiled default is the platform font). */
|
|
336
|
+
type EverfurFontFamilies = Readonly<Record<EverfurFontFaceKey, string>>;
|
|
337
|
+
/**
|
|
338
|
+
* Typography tokens. `families` is the family per face; a branding sets them through `fonts` (one registered
|
|
339
|
+
* face per weight, the Everfur app's own scheme) or the legacy single `font_family`, else the platform font.
|
|
340
|
+
* `family` / `mono` / `fontUrl` are aliases of the regular and mono entries, kept for every reader of the
|
|
341
|
+
* pre-`families` shape. A surface never reads these raw: `face(theme, weight)` (typeStyle.ts) picks the
|
|
342
|
+
* family and decides whether a numeric `fontWeight` belongs beside it.
|
|
343
|
+
*/
|
|
344
|
+
interface EverfurTypeTokens {
|
|
345
|
+
/** Alias of `families.regular`. */
|
|
346
|
+
readonly family: string;
|
|
347
|
+
/** Alias of `families.mono`. */
|
|
348
|
+
readonly mono: string;
|
|
349
|
+
/** Alias of `fontUrls.regular`; null unless an override supplies an https URL. */
|
|
350
|
+
readonly fontUrl: string | null;
|
|
351
|
+
readonly families: EverfurFontFamilies;
|
|
352
|
+
/**
|
|
353
|
+
* Per face: true when `families[face]` is a NAMED face from a `fonts` map (the weight is baked into the
|
|
354
|
+
* registered face, so `face()` sets no `fontWeight`); false when it is a base family (`font_family` or the
|
|
355
|
+
* platform font) that carries every weight and takes the numeric `weight` token.
|
|
356
|
+
*/
|
|
357
|
+
readonly namedFaces: Readonly<Record<EverfurFontFaceKey, boolean>>;
|
|
358
|
+
/** The brand-font URL per face (web only, `font_urls` / `font_url`); absent or null when none applies. */
|
|
359
|
+
readonly fontUrls: Readonly<Partial<Record<EverfurFontFaceKey, string | null>>>;
|
|
360
|
+
/**
|
|
361
|
+
* The type scale. On the web it ALREADY carries `scale` (CSS px do not follow the user's text setting on their
|
|
362
|
+
* own); on React Native it is the authored size, which the platform scales natively up to `maxScale`.
|
|
363
|
+
*/
|
|
364
|
+
readonly size: EverfurTypeSizeTokens;
|
|
365
|
+
readonly lineHeight: EverfurLineHeightTokens;
|
|
366
|
+
readonly weight: EverfurWeightTokens;
|
|
367
|
+
readonly letterSpacing: EverfurLetterSpacingTokens;
|
|
368
|
+
/**
|
|
369
|
+
* `size` per text-scale tier (`EverfurTextScaleTier`). On the web each tier carries the user's scale up to that
|
|
370
|
+
* tier's cap (`content` is `size` itself, uncapped); on React Native every tier is the authored `size` and the
|
|
371
|
+
* platform scales it natively under the tier's `maxFontSizeMultiplier` (`scaleCaps`, applied by the SDK's `Text`).
|
|
372
|
+
*/
|
|
373
|
+
readonly tierSizes: Readonly<Record<'content' | 'heading' | 'control' | 'compact' | 'badge', EverfurTypeSizeTokens>>;
|
|
374
|
+
/** The end user's effective text scale (their device setting, floored at `TEXT_SCALE_FLOOR`); 1 when unknown. */
|
|
375
|
+
readonly scale: number;
|
|
376
|
+
/**
|
|
377
|
+
* The tenant's cap on the CHROME tiers (`accessibility_max_font_scale`): 0 means none (the default), so the
|
|
378
|
+
* tier caps alone bound headings, controls, chips and badges. Flowing content is never capped.
|
|
379
|
+
*/
|
|
380
|
+
readonly maxScale: number;
|
|
381
|
+
/**
|
|
382
|
+
* The effective cap of each tier (`EverfurTextScaleTier`): the tier's own cap, lowered by `maxScale` for the
|
|
383
|
+
* chrome tiers; 0 means none (React Native's `maxFontSizeMultiplier` semantics).
|
|
384
|
+
*/
|
|
385
|
+
readonly scaleCaps: Readonly<Record<'content' | 'heading' | 'control' | 'compact' | 'badge', number>>;
|
|
386
|
+
}
|
|
387
|
+
interface EverfurSpringToken {
|
|
388
|
+
readonly damping: number;
|
|
389
|
+
readonly stiffness: number;
|
|
390
|
+
}
|
|
391
|
+
interface EverfurMotionDurationTokens {
|
|
392
|
+
readonly instant: number;
|
|
393
|
+
readonly fast: number;
|
|
394
|
+
readonly normal: number;
|
|
395
|
+
readonly slow: number;
|
|
396
|
+
}
|
|
397
|
+
/** Motion tokens. Under reduced-motion, resolveTheme collapses durations to 0 and stiffens the spring. */
|
|
398
|
+
interface EverfurMotionTokens {
|
|
399
|
+
readonly duration: EverfurMotionDurationTokens;
|
|
400
|
+
readonly spring: {
|
|
401
|
+
readonly gentle: EverfurSpringToken;
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* The Everfur app's curves as CSS `cubic-bezier()` values: `standard` for most transitions, `emphasized` for an
|
|
405
|
+
* entrance that should draw the eye, `exit` for a leave. `EASING_CURVES` holds the same curves as numbers.
|
|
406
|
+
*/
|
|
407
|
+
readonly easing: {
|
|
408
|
+
readonly standard: string;
|
|
409
|
+
readonly emphasized: string;
|
|
410
|
+
readonly exit: string;
|
|
411
|
+
};
|
|
412
|
+
/** true when the resolved theme has collapsed motion (AccessibilityInfo reduced-motion). */
|
|
413
|
+
readonly reducedMotion: boolean;
|
|
414
|
+
}
|
|
415
|
+
/** Non-visual identity + partner copy carried on the theme (server display_name/logo_url/placeholder overlay). */
|
|
416
|
+
interface EverfurThemeMeta {
|
|
417
|
+
readonly displayName: string;
|
|
418
|
+
readonly logoUrl: string | null;
|
|
419
|
+
/** Server-overridable composer placeholder (chat_placeholder/placeholder); null keeps Everfur's neutral default. */
|
|
420
|
+
readonly placeholder: string | null;
|
|
421
|
+
/** White-label switch (hide_powered_by): drop the "powered by everfur" attribution. Default false (shown). */
|
|
422
|
+
readonly hidePoweredBy: boolean;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* The frozen, never-null theme the rn layer renders. Read a token as `theme.color.brand`,
|
|
426
|
+
* `theme.space.md`, `theme.type.size.body`, `theme.radius.lg`, `theme.motion.duration.fast`; a slot's paint
|
|
427
|
+
* as `theme.slots.userBubble?.backgroundColor`.
|
|
428
|
+
*/
|
|
429
|
+
interface EverfurTheme {
|
|
430
|
+
readonly brightness: 'light' | 'dark';
|
|
431
|
+
/** true when the user asked for more contrast (`prefers-contrast: more`) and the palette was derived for it. */
|
|
432
|
+
readonly highContrast: boolean;
|
|
433
|
+
readonly meta: EverfurThemeMeta;
|
|
434
|
+
readonly color: EverfurColorTokens;
|
|
435
|
+
readonly space: EverfurSpaceTokens;
|
|
436
|
+
readonly radius: EverfurRadiusTokens;
|
|
437
|
+
readonly type: EverfurTypeTokens;
|
|
438
|
+
readonly motion: EverfurMotionTokens;
|
|
439
|
+
/** Paint overrides at the named slots (empty by default); each text colour is contrast-guarded. */
|
|
440
|
+
readonly slots: EverfurThemeSlots;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* The tenant's chrome cap when it sets none (`accessibility_max_font_scale`): 0, no cap beyond the tiers of
|
|
444
|
+
* `TEXT_SCALE_TIER_CAPS`, the Everfur app's own policy.
|
|
445
|
+
*/
|
|
446
|
+
declare const DEFAULT_MAX_FONT_SCALE = 0;
|
|
447
|
+
/** The RN token that means "the platform font"; every face of the compiled default. */
|
|
448
|
+
declare const SYSTEM_FONT_FAMILY = "System";
|
|
449
|
+
/**
|
|
450
|
+
* The generic mono keyword of the compiled default. React Native on iOS has no family of that name, so the
|
|
451
|
+
* React Native host maps it per platform (Menlo on iOS); the web host maps it to its mono stack.
|
|
452
|
+
*/
|
|
453
|
+
declare const SYSTEM_MONO_FAMILY = "monospace";
|
|
454
|
+
/** A cubic-bezier as its four control values (`[x1, y1, x2, y2]`). */
|
|
455
|
+
type EverfurEasingCurve = readonly [number, number, number, number];
|
|
456
|
+
/** The Everfur app's easing curves (`src/motion/tokens.ts`), as numbers; `motion.easing` holds them as CSS. */
|
|
457
|
+
declare const EASING_CURVES: Readonly<Record<'standard' | 'emphasized' | 'exit', EverfurEasingCurve>>;
|
|
458
|
+
/** `cubic-bezier(x1, y1, x2, y2)` for a curve. */
|
|
459
|
+
declare function cssCubicBezier(curve: EverfurEasingCurve): string;
|
|
460
|
+
/** The compiled LIGHT default (deeply frozen). */
|
|
461
|
+
declare const EVERFUR_LIGHT: EverfurTheme;
|
|
462
|
+
/** The compiled DARK default (deeply frozen). */
|
|
463
|
+
declare const EVERFUR_DARK: EverfurTheme;
|
|
464
|
+
|
|
465
|
+
interface ClientBranding {
|
|
466
|
+
readonly displayName: string | null;
|
|
467
|
+
/** normalized (https-hardened downstream) logo URL */
|
|
468
|
+
readonly logoUrl: string | null;
|
|
469
|
+
/** normalized color string (#RRGGBB or rgba(...)) or null */
|
|
470
|
+
readonly primaryColor: string | null;
|
|
471
|
+
readonly accentColor: string | null;
|
|
472
|
+
/**
|
|
473
|
+
* `light` or `dark` pins the palette; `auto` follows the device's scheme (an explicit opt-in). null (absent)
|
|
474
|
+
* resolves to LIGHT, as Everfur's own apps render. Read from `brightness`, or its console alias `color_scheme`
|
|
475
|
+
* (`colorScheme`).
|
|
476
|
+
*/
|
|
477
|
+
readonly brightness: 'light' | 'dark' | 'auto' | null;
|
|
478
|
+
readonly fontFamily: string | null;
|
|
479
|
+
readonly fontUrl: string | null;
|
|
480
|
+
/**
|
|
481
|
+
* fonts: one registered family per face (`regular` / `medium` / `bold` / `mono` / `monoMedium` / `monoBold`),
|
|
482
|
+
* any subset. A name used by one face of its group only is a named face, rendered without a synthetic
|
|
483
|
+
* `fontWeight`; a name repeated across the weights of a group is a base family and takes the numeric weights.
|
|
484
|
+
* Absent/null names none (the base families stand).
|
|
485
|
+
*/
|
|
486
|
+
readonly fonts?: Readonly<Partial<Record<EverfurFontFaceKey, string>>> | null;
|
|
487
|
+
/** font_urls: the brand-font URL per face (web only), any subset; hardened https-only downstream. */
|
|
488
|
+
readonly fontUrls?: Readonly<Partial<Record<EverfurFontFaceKey, string>>> | null;
|
|
489
|
+
/** composer placeholder override (chat_placeholder/placeholder); null keeps the base. */
|
|
490
|
+
readonly placeholder: string | null;
|
|
491
|
+
/**
|
|
492
|
+
* white-label switch (hide_powered_by): hide the powered-by attribution. null = unset (keep the base). Honoured
|
|
493
|
+
* from SERVER branding only: `resolveTheme` ignores it on the client override (attribution is server-only).
|
|
494
|
+
*/
|
|
495
|
+
readonly hidePoweredBy: boolean | null;
|
|
496
|
+
/** primary_color_dark: the primary fill used when the resolved palette is dark. Absent/null derives one. */
|
|
497
|
+
readonly primaryColorDark?: string | null;
|
|
498
|
+
/** accent_color_dark: the accent fill used when the resolved palette is dark. Absent/null derives one. */
|
|
499
|
+
readonly accentColorDark?: string | null;
|
|
500
|
+
/**
|
|
501
|
+
* surface_style: which compiled surface the chat ground (`chatGround`) uses. Absent/null keeps the palette's
|
|
502
|
+
* white ground (the Everfur app's shell). The composer and the record cards keep their cream either way.
|
|
503
|
+
*/
|
|
504
|
+
readonly surfaceStyle?: SurfaceStyle | null;
|
|
505
|
+
/** radius_scale: scales the corner radii (the pill radius is never scaled). Absent/null keeps the palette radii. */
|
|
506
|
+
readonly radiusScale?: RadiusScale | null;
|
|
507
|
+
/** logo_url_dark: the logo shown on the dark palette. Absent/null keeps logoUrl on both palettes. */
|
|
508
|
+
readonly logoUrlDark?: string | null;
|
|
509
|
+
/** slots: paint overrides at the named slots (schema 2). Absent/null paints none. */
|
|
510
|
+
readonly slots?: EverfurThemeSlots | null;
|
|
511
|
+
/**
|
|
512
|
+
* accessibility_max_font_scale: the tenant's cap on the CHROME text tiers (headings, controls, chips, badges),
|
|
513
|
+
* 1..3.1, or 0 for none. Flowing content is never capped. Absent/null keeps the default (0, the tiers alone).
|
|
514
|
+
*/
|
|
515
|
+
readonly accessibilityMaxFontScale?: number | null;
|
|
516
|
+
/**
|
|
517
|
+
* locked_fields: the wire names the tenant keeps server-wins (schema 2): a field, `slots` (every slot) or
|
|
518
|
+
* `slots.<name>` (one slot); the wire also lists `hide_powered_by`, which is locked whether listed or not.
|
|
519
|
+
* Meaningful on SERVER branding only; ignored on the client override. Absent/null locks nothing beyond the
|
|
520
|
+
* attribution.
|
|
521
|
+
*/
|
|
522
|
+
readonly lockedFields?: readonly ThemeLockName[] | null;
|
|
523
|
+
/**
|
|
524
|
+
* schema_version: the wire version the branding was written for. null when absent (schema 1); 0 when present but
|
|
525
|
+
* not a positive integer. A version this SDK does not know (`THEME_SCHEMA_VERSIONS`) drops the server branding.
|
|
526
|
+
*/
|
|
527
|
+
readonly schemaVersion?: number | null;
|
|
528
|
+
}
|
|
529
|
+
/** The compiled surface a branding may pick for the chat ground (`surface_style`). */
|
|
530
|
+
type SurfaceStyle = 'white' | 'cream' | 'subtle';
|
|
531
|
+
/** The corner-radius scale a branding may pick (`radius_scale`). */
|
|
532
|
+
type RadiusScale = 'sharp' | 'default' | 'round';
|
|
533
|
+
/**
|
|
534
|
+
* The wire names a tenant may list in `locked_fields` (every cosmetic field). `hide_powered_by` is not listed:
|
|
535
|
+
* it is server-wins unconditionally, so locking it is meaningless.
|
|
536
|
+
*/
|
|
537
|
+
declare const LOCKABLE_THEME_FIELDS: readonly ["display_name", "logo_url", "logo_url_dark", "primary_color", "accent_color", "primary_color_dark", "accent_color_dark", "brightness", "color_scheme", "font_family", "font_url", "fonts", "font_urls", "chat_placeholder", "surface_style", "radius_scale", "accessibility_max_font_scale", "slots"];
|
|
538
|
+
type LockableThemeField = (typeof LOCKABLE_THEME_FIELDS)[number];
|
|
539
|
+
/** The `locked_fields` key that locks one slot (`slots.<name>`), as EFBackend branding_slots.py emits it. */
|
|
540
|
+
declare const SLOT_LOCK_PREFIX = "slots.";
|
|
541
|
+
type SlotLockName = `${typeof SLOT_LOCK_PREFIX}${EverfurThemeSlotName}`;
|
|
542
|
+
/** Everything `locked_fields` may name: a cosmetic field, one slot, or the (always locked) attribution. */
|
|
543
|
+
type ThemeLockName = LockableThemeField | SlotLockName | 'hide_powered_by';
|
|
544
|
+
/** The branding wire versions this SDK reads: 1 (absent on the wire) and 2 (the 18 Sep 2026 fields). */
|
|
545
|
+
declare const THEME_SCHEMA_VERSIONS: readonly number[];
|
|
546
|
+
/**
|
|
547
|
+
* true when every field is null (no config) - treated by callers as "absent". The version stamp alone is not a
|
|
548
|
+
* value: a branding that carries only `schema_version` is empty.
|
|
549
|
+
*/
|
|
550
|
+
declare function isEmptyBranding(b: ClientBranding): boolean;
|
|
551
|
+
/** true when the branding is absent or written for a wire version this SDK knows. */
|
|
552
|
+
declare function isKnownBrandingSchema(b: ClientBranding | null): boolean;
|
|
553
|
+
/** The names a server branding keeps server-wins: its `locked_fields`, plus the attribution always. */
|
|
554
|
+
declare function lockedFieldsOf(b: ClientBranding | null): ReadonlySet<string>;
|
|
555
|
+
/**
|
|
556
|
+
* Parse an untrusted branding blob (from the entitlements render_hints, or the client `theme` prop) into a
|
|
557
|
+
* normalized `ClientBranding`. Accepts BOTH snake_case and camelCase keys. Returns null when the input is not
|
|
558
|
+
* an object OR when the result is empty (all fields null) - callers read null as "no config" (fail-closed to
|
|
559
|
+
* the compiled default). Never throws.
|
|
560
|
+
*/
|
|
561
|
+
declare function parseClientBranding(json: unknown): ClientBranding | null;
|
|
562
|
+
/** The largest cap a tenant may set on the chrome tiers: iOS's largest accessibility text size (AX5, 310%). */
|
|
563
|
+
declare const MAX_FONT_SCALE_CEILING = 3.1;
|
|
564
|
+
/**
|
|
565
|
+
* Return the URL only if it is an https URL with no embedded whitespace, else null (security invariant:
|
|
566
|
+
* https-only; rejects http:, javascript:, data:, etc.). Uses a protocol-locked regex rather than the URL
|
|
567
|
+
* constructor so it is portable + total on React Native (whose URL global is incomplete) and never throws.
|
|
568
|
+
*/
|
|
569
|
+
declare function hardenHttpsUrl(url: string | null): string | null;
|
|
570
|
+
/**
|
|
571
|
+
* Overlay `b` onto `base`, field by field: a non-null branding field WINS; a null field KEEPS the base. A
|
|
572
|
+
* valid brightness re-selects the matching compiled palette (light/dark); an invalid/absent brightness leaves
|
|
573
|
+
* the base palette untouched. Slots merge per slot, per key. Returns a NEW deeply-frozen theme; `base` and `b`
|
|
574
|
+
* are never mutated.
|
|
575
|
+
*
|
|
576
|
+
* The name is historical (the server was once the only overlay); `resolveTheme` applies it twice, server then
|
|
577
|
+
* client, which is how the client wins per field. NOTE: foreground legibility (onPrimary/onAccent, the slot
|
|
578
|
+
* guard) and URL hardening are applied by `resolveTheme`, the total entry point. Call this directly only when
|
|
579
|
+
* you will finalize the result yourself.
|
|
580
|
+
*/
|
|
581
|
+
declare function withServerBranding(base: EverfurTheme, b: ClientBranding | null): EverfurTheme;
|
|
582
|
+
/**
|
|
583
|
+
* Inputs to the total theme resolve. All optional; `resolveTheme(undefined)` yields the compiled Everfur
|
|
584
|
+
* default. Merge order: compiled default <- server branding (render_hints) <- client theme prop, per field, with
|
|
585
|
+
* the tenant's locked fields and the attribution kept from the server (see `resolveTheme`).
|
|
586
|
+
*/
|
|
587
|
+
interface ResolveThemeInput {
|
|
588
|
+
/** Server-driven branding from the live entitlements render_hints (the tenant's console branding). */
|
|
589
|
+
readonly branding?: ClientBranding | null;
|
|
590
|
+
/**
|
|
591
|
+
* The clamped client `theme` prop. It WINS per cosmetic field over the server branding, except the fields the
|
|
592
|
+
* server lists in `locked_fields`. Its hidePoweredBy is IGNORED: whether the Everfur attribution shows is
|
|
593
|
+
* decided by server branding alone.
|
|
594
|
+
*/
|
|
595
|
+
readonly clientOverride?: ClientBranding | null;
|
|
596
|
+
/**
|
|
597
|
+
* The device color scheme (useColorScheme / `prefers-color-scheme`). Read ONLY when the settled brightness is
|
|
598
|
+
* `auto` (an explicit opt-in); with no brightness set anywhere the theme is light, as Everfur's own apps are.
|
|
599
|
+
*/
|
|
600
|
+
readonly colorScheme?: 'light' | 'dark' | null;
|
|
601
|
+
/** AccessibilityInfo reduced-motion / `prefers-reduced-motion`: collapses the motion tokens. */
|
|
602
|
+
readonly reducedMotion?: boolean;
|
|
603
|
+
/**
|
|
604
|
+
* The user's text scale as the host reads it (React Native: `PixelRatio.getFontScale()`; the browser: the
|
|
605
|
+
* browser's default font size over 16px). Floored at `TEXT_SCALE_FLOOR`; absent or junk reads as 1. Flowing
|
|
606
|
+
* content follows it uncapped; each chrome tier follows it up to that tier's cap (`type.scaleCaps`).
|
|
607
|
+
*/
|
|
608
|
+
readonly textScale?: number;
|
|
609
|
+
/**
|
|
610
|
+
* Multiply the type sizes by the effective scale, per tier (`type.size` for content, `type.tierSizes` for every
|
|
611
|
+
* tier). A browser host passes true (CSS px do not follow the user's setting on their own); a React Native host
|
|
612
|
+
* leaves it false and lets the platform scale every Text natively, capped per tier by `maxFontSizeMultiplier`.
|
|
613
|
+
*/
|
|
614
|
+
readonly scaleTypeSizes?: boolean;
|
|
615
|
+
/** The user asked for more contrast (`prefers-contrast: more`): the palette is derived by `deriveHighContrast`. */
|
|
616
|
+
readonly highContrast?: boolean;
|
|
617
|
+
/**
|
|
618
|
+
* The family the platform's generic mono keyword (`SYSTEM_MONO_FAMILY`) maps to on this host. React Native on iOS
|
|
619
|
+
* has no family named `monospace` (a Text asking for it renders proportional, and the legacy architecture
|
|
620
|
+
* red-boxes in development), so the React Native host passes `Menlo` there. Applied to the compiled default mono
|
|
621
|
+
* only: a partner's own mono face is never touched. Absent or blank, the keyword stands (the web maps it to its
|
|
622
|
+
* mono stack in CSS).
|
|
623
|
+
*/
|
|
624
|
+
readonly platformMonoFamily?: string;
|
|
625
|
+
/**
|
|
626
|
+
* Whether a family name is registered with the platform, when the host can tell: true or false, else null. A
|
|
627
|
+
* NAMED face (one per-weight name, rendered without a weight) that the host reports unregistered falls back to
|
|
628
|
+
* the platform font of its group WITH its numeric weight, so medium and bold survive instead of every weight
|
|
629
|
+
* collapsing to the platform's regular. Only named faces are asked about; a throw reads as null.
|
|
630
|
+
*/
|
|
631
|
+
readonly isFontRegistered?: (family: string) => boolean | null;
|
|
632
|
+
}
|
|
633
|
+
/** The smallest effective text scale the resolver will report (a device may ask for less; the surfaces stop here). */
|
|
634
|
+
declare const TEXT_SCALE_FLOOR = 0.5;
|
|
635
|
+
/**
|
|
636
|
+
* Resolve the final, legible, deeply-frozen theme. Never throws, never returns null/transparent.
|
|
637
|
+
*
|
|
638
|
+
* PRECEDENCE (per field, owner decision of 18 September 2026; the same rule EFBackend render_hint_fold states):
|
|
639
|
+
* a field in `locked_fields` (plus `hide_powered_by` always) is server-wins; every other cosmetic field is
|
|
640
|
+
* client-wins.
|
|
641
|
+
* - A server branding with an unknown `schema_version` is dropped whole (default plus client theme).
|
|
642
|
+
* - `hide_powered_by`, and every name the server lists in `locked_fields`, are SERVER-WINS: the client's value
|
|
643
|
+
* for such a field is discarded before the merge, so the server's value or the compiled default stands.
|
|
644
|
+
* `slots` in the list locks every slot; `slots.<name>` locks one.
|
|
645
|
+
* - Every other cosmetic field is CLIENT-WINS: the client `theme` prop overrides the console value, and the
|
|
646
|
+
* console fills the fields the prop leaves unset. Brightness is settled the same way; set nowhere, it is
|
|
647
|
+
* LIGHT (owner decision OD28: Everfur's own apps are light-only), and `auto` follows the device scheme.
|
|
648
|
+
* - Slots overlay slot by slot (a named slot replaces the one below it whole) in the same order, after the
|
|
649
|
+
* field precedence.
|
|
650
|
+
* Then the total-resolve guarantees: onPrimary/onAccent via WCAG, the slot contrast guard, https-only logo/font
|
|
651
|
+
* URLs, a non-empty displayName, the text scale (floored; tiered caps on the chrome), motion collapsed under reduced
|
|
652
|
+
* motion, and the high-contrast derivation when the user asked for it.
|
|
653
|
+
*/
|
|
654
|
+
declare function resolveTheme(input?: ResolveThemeInput): EverfurTheme;
|
|
655
|
+
/**
|
|
656
|
+
* The console's preview helper: resolve a draft branding exactly as the device would, from the raw shapes (the
|
|
657
|
+
* partner's `theme` prop and the server-shaped branding object the console is about to publish), with the device
|
|
658
|
+
* inputs of the preview. Pure and total: any shape is tolerated, nothing throws.
|
|
659
|
+
*/
|
|
660
|
+
declare function previewTheme(input: EverfurThemeInput | null, hints: unknown, options?: Omit<ResolveThemeInput, 'branding' | 'clientOverride'>): EverfurTheme;
|
|
661
|
+
|
|
662
|
+
/** The conditional-GET endpoint (SPEC-00 §5.3). Relative; the transport prefixes the resolved base URL. */
|
|
663
|
+
declare const ENTITLEMENTS_PATH = "/widget/v1/entitlements";
|
|
664
|
+
/**
|
|
665
|
+
* The settled outcome of one entitlement fetch. `updated` carries a fresh verdict + the cadence to re-poll on;
|
|
666
|
+
* `notModified` means the cached verdict still holds; `failed` carries a normalized error and means keep-last.
|
|
667
|
+
*/
|
|
668
|
+
type EntitlementResolution = {
|
|
669
|
+
readonly kind: 'updated';
|
|
670
|
+
readonly revision: number;
|
|
671
|
+
readonly region: string;
|
|
672
|
+
readonly ttlSeconds: number;
|
|
673
|
+
readonly decisions: readonly EntitlementDecision[];
|
|
674
|
+
/**
|
|
675
|
+
* Server-driven branding parsed from the SAME 200 body's render_hints (orthogonal to capabilities).
|
|
676
|
+
* null when absent or unparseable (fail-closed -> the compiled Everfur default theme). OPTIONAL so a
|
|
677
|
+
* hand-built resolution (tests / injected resolve) need not supply it.
|
|
678
|
+
*/
|
|
679
|
+
readonly branding?: ClientBranding | null;
|
|
680
|
+
} | {
|
|
681
|
+
readonly kind: 'notModified';
|
|
682
|
+
} | {
|
|
683
|
+
readonly kind: 'failed';
|
|
684
|
+
readonly error: EverfurError;
|
|
685
|
+
};
|
|
686
|
+
interface FetchEntitlementsArgs {
|
|
687
|
+
/** The revision we last stored; echoed as If-None-Match so an unchanged verdict returns 304. */
|
|
688
|
+
readonly cachedRevision?: number | null;
|
|
689
|
+
/** Optional region hint; forwarded as ?region. */
|
|
690
|
+
readonly region?: string;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Fetch the server-resolved entitlement verdict once. Never throws: a 304, a domain error, a network reject,
|
|
694
|
+
* and a malformed body all SETTLE to an EntitlementResolution. Fail-closed on every non-`updated` path.
|
|
695
|
+
*/
|
|
696
|
+
declare function fetchEntitlements(auth: AuthContext, args?: FetchEntitlementsArgs, funnel?: RequestFunnel): Promise<EntitlementResolution>;
|
|
697
|
+
|
|
698
|
+
export { TEXT_SCALE_FLOOR as $, THEME_SLOT_NAMES as A, previewTheme as B, type ClientBranding as C, DEFAULT_MAX_FONT_SCALE as D, type EverfurFontWeight as E, EASING_CURVES as F, ENTITLEMENTS_PATH as G, EVERFUR_DARK as H, EVERFUR_LIGHT as I, type EntitlementResolution as J, type EverfurEasingCurve as K, type EverfurTextScaleTier as L, type FetchEntitlementsArgs as M, LOCKABLE_THEME_FIELDS as N, type LockableThemeField as O, MAX_FONT_SCALE_CEILING as P, type ResolveThemeInput as Q, type RadiusScale as R, type SurfaceStyle as S, THEME_SLOT_KEYS as T, SLOT_LOCK_PREFIX as U, SLOT_MIN_BORDER_CONTRAST as V, SLOT_MIN_CONTRAST as W, SYSTEM_FONT_FAMILY as X, SYSTEM_MONO_FAMILY as Y, type SlotGrounds as Z, type SlotLockName as _, type EverfurTheme as a, TEXT_SCALE_TIER_CAPS as a0, THEME_SCHEMA_VERSIONS as a1, type ThemeLockName as a2, cssCubicBezier as a3, deepFreeze as a4, fetchEntitlements as a5, guardSlotContrast as a6, hardenHttpsUrl as a7, isEmptyBranding as a8, isKnownBrandingSchema as a9, lockedFieldsOf as aa, mergeThemeSlots as ab, parseClientBranding as ac, parseThemeSlots as ad, resolveTheme as ae, withServerBranding as af, type EverfurFontFaceKey as b, type EverfurThemeInput as c, type EverfurColorTokens as d, type EverfurFontFamilies as e, type EverfurLetterSpacingTokens as f, type EverfurLineHeightTokens as g, type EverfurMotionDurationTokens as h, type EverfurMotionTokens as i, type EverfurRadiusTokens as j, type EverfurSpaceTokens as k, type EverfurSpringToken as l, type EverfurTextColorTokens as m, type EverfurThemeFontFaceKey as n, type EverfurThemeFontUrlsInput as o, type EverfurThemeFontsInput as p, type EverfurThemeMeta as q, type EverfurThemeSlot as r, type EverfurThemeSlotInput as s, type EverfurThemeSlotKey as t, type EverfurThemeSlotName as u, type EverfurThemeSlots as v, type EverfurThemeSlotsInput as w, type EverfurTypeSizeTokens as x, type EverfurTypeTokens as y, type EverfurWeightTokens as z };
|