@labpics/colors 0.10.0 → 1.0.3
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/LICENSE +1 -1
- package/LICENSES/CC-BY-4.0.txt +396 -0
- package/LICENSES/CC-BY-SA-4.0.txt +428 -0
- package/NOTICE.md +65 -0
- package/README.md +312 -330
- package/build-metadata.json +16 -12
- package/evidence/point-support-reference-surplus-q55-bps-proof-v1.json +1 -0
- package/evidence/wcag22-srgb8-q55-proof-v1.json +1 -0
- package/evidence/wcag22-srgb8-q55-v1.bin +0 -0
- package/evidence/wcag22-srgb8-v1.json +1 -0
- package/index.d.ts +204 -63
- package/index.js +495 -17
- package/package.json +38 -39
- package/pkg/labcolors.d.ts +227 -491
- package/pkg/labcolors.js +945 -178
- package/pkg/labcolors_bg.wasm +0 -0
- package/pkg/labcolors_bg.wasm.d.ts +61 -12
- package/pkg/snippets/labcolors-wasm-9fb8b927594c3d6f/inline0.js +108 -0
- package/program-wire/abi-v1.d.ts +84 -0
- package/program-wire/abi-v1.js +323 -0
- package/program-wire/abi-v2.d.ts +17 -0
- package/program-wire/abi-v2.js +62 -0
- package/program-wire/encoding.js +210 -0
- package/wcag22.d.ts +6 -0
- package/adapt-theme.d.ts +0 -76
- package/adapt-theme.js +0 -738
- package/apply-theme.d.ts +0 -16
- package/apply-theme.js +0 -45
- package/effective-bg.d.ts +0 -51
- package/effective-bg.js +0 -501
- package/watch-theme.d.ts +0 -57
- package/watch-theme.js +0 -144
package/pkg/labcolors.d.ts
CHANGED
|
@@ -1,536 +1,272 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
readonly
|
|
10
|
-
|
|
11
|
-
readonly
|
|
12
|
-
|
|
13
|
-
readonly
|
|
14
|
-
/** Ready-to-serve CSS value: "oklch(L% C H)". `vars` carries the same string. */
|
|
15
|
-
readonly css: string;
|
|
16
|
-
/** Signed perceptual contrast (Lc) against the background. */
|
|
17
|
-
readonly lc: number;
|
|
18
|
-
/** WCAG 2.1 ratio (1–21) against the background. */
|
|
19
|
-
readonly wcagRatio: number;
|
|
20
|
-
/** The legal floor squeezed this role onto the smallest step below its senior. */
|
|
21
|
-
readonly compressed: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* `true` when a coloured family label (M1) lost perceptible colour on its
|
|
24
|
-
* contract-solved lightness: the colour's M′ fell below the tint perceptibility
|
|
25
|
-
* floor, so at the family curve's extremes (near-white / near-black) the hue is
|
|
26
|
-
* physically indistinguishable. An honest, flagged outcome — not a silent
|
|
27
|
-
* degradation to grey. `false` for neutral labels and coloured labels that kept
|
|
28
|
-
* a distinguishable colour.
|
|
29
|
-
*/
|
|
30
|
-
readonly hueVanished: boolean;
|
|
31
|
-
/** Честный замер |ΔJ'| на отданном hex для dJ'-ролей; null у контраст-ролей (метрика — lc). */
|
|
32
|
-
readonly achievedDj: number | null;
|
|
33
|
-
/** The WCAG floor overrode the perceptual target. */
|
|
34
|
-
readonly floorOverride: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* The minimum WCAG ratio this role is legally clamped to (4.5 for AA text,
|
|
37
|
-
* 3.0 for AA UI), or `null` for decorative / zero roles. A property of
|
|
38
|
-
* the role's contract, not of this solve: a runtime easing between themes
|
|
39
|
-
* uses it to hold the floor every frame of the transition.
|
|
40
|
-
*/
|
|
41
|
-
readonly legalFloor: number | null;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** The explicit zero token: no colour here, by design (not a failure). */
|
|
45
|
-
export interface NoneRole {
|
|
46
|
-
readonly kind: "none";
|
|
47
|
-
readonly cssVar: string;
|
|
4
|
+
/** Proof-capable V2 site. Empty arrays explicitly mean no admitted evidence. */
|
|
5
|
+
export interface NumericalCapabilitySiteV2 {
|
|
6
|
+
readonly siteId: string;
|
|
7
|
+
readonly stableOutcomes: ReadonlyArray<string>;
|
|
8
|
+
readonly compatibilityReleases: ReadonlyArray<string>;
|
|
9
|
+
readonly evidenceClasses: ReadonlyArray<string>;
|
|
10
|
+
readonly artifactIds: ReadonlyArray<string>;
|
|
11
|
+
readonly boundIds: ReadonlyArray<string>;
|
|
12
|
+
readonly proofIds: ReadonlyArray<string>;
|
|
13
|
+
readonly runtimeAttestations: ReadonlyArray<string>;
|
|
48
14
|
}
|
|
49
15
|
|
|
50
|
-
/**
|
|
51
|
-
export interface
|
|
52
|
-
readonly
|
|
53
|
-
readonly
|
|
54
|
-
|
|
55
|
-
readonly
|
|
56
|
-
/** Human-readable explanation. */
|
|
57
|
-
readonly message: string;
|
|
16
|
+
/** Proof-capable numerical capability manifest. */
|
|
17
|
+
export interface NumericalCapabilityManifestV2 {
|
|
18
|
+
readonly schemaVersion: 2;
|
|
19
|
+
readonly coverage: string;
|
|
20
|
+
readonly sites: ReadonlyArray<NumericalCapabilitySiteV2>;
|
|
21
|
+
readonly checksum: string;
|
|
58
22
|
}
|
|
59
23
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
readonly
|
|
70
|
-
/** Signed perceptual contrast (Lc) of the composite. */
|
|
71
|
-
readonly compositeLc: number;
|
|
72
|
-
/** WCAG 2.1 ratio of the composite. */
|
|
73
|
-
readonly compositeWcag: number;
|
|
74
|
-
/**
|
|
75
|
-
* `true`, если запрошенная alpha не допускает ни одного byte-тинта,
|
|
76
|
-
* воспроизводящего цель в affine encoded-sRGB8 reference, и потому поднята до
|
|
77
|
-
* первого проходящего `binary64`. Композит остаётся побайтно равен целевому
|
|
78
|
-
* солиду; меняется только явно возвращённая `alpha`. У прямой лестницы всегда
|
|
79
|
-
* `false`.
|
|
80
|
-
*/
|
|
81
|
-
readonly alphaCoerced: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* `true` when a solid family border (`border-<family>-strong`, M2) was darkened
|
|
84
|
-
* along the family curve to meet the AA UI floor (3:1), because the raw family
|
|
85
|
-
* tint did not clear it on this background — an honest, flagged minimal legal
|
|
86
|
-
* shift (family hue/chroma preserved, only lightness moved). `false` for a
|
|
87
|
-
* direct ladder emission and for legal family solids.
|
|
88
|
-
*/
|
|
89
|
-
readonly floorCoerced: boolean;
|
|
90
|
-
/** Ready-to-serve CSS value: "oklch(L% C H / A)". `vars` carries the same string. */
|
|
91
|
-
readonly css: string;
|
|
24
|
+
export type Wcag22CriterionV1 =
|
|
25
|
+
| "sc-1.4.3-text-default"
|
|
26
|
+
| "sc-1.4.3-text-large-scale"
|
|
27
|
+
| "sc-1.4.11-ui-component-or-state"
|
|
28
|
+
| "sc-1.4.11-graphical-object";
|
|
29
|
+
export type Wcag22DecisionV1 = "pass" | "fail";
|
|
30
|
+
export interface Wcag22Q55BoundsV1 {
|
|
31
|
+
/** Decimal u64 string: Q55 values exceed JavaScript's safe integer range. */
|
|
32
|
+
readonly lower: string;
|
|
33
|
+
readonly upper: string;
|
|
92
34
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
readonly
|
|
113
|
-
readonly
|
|
114
|
-
readonly
|
|
35
|
+
export interface Wcag22AssessmentV1 {
|
|
36
|
+
readonly kind: "evaluated";
|
|
37
|
+
readonly profileId: "wcag22-srgb8-contrast-v1";
|
|
38
|
+
readonly criterion: Wcag22CriterionV1;
|
|
39
|
+
readonly foreground: string;
|
|
40
|
+
readonly background: string;
|
|
41
|
+
readonly foregroundLuminanceQ55: Wcag22Q55BoundsV1;
|
|
42
|
+
readonly backgroundLuminanceQ55: Wcag22Q55BoundsV1;
|
|
43
|
+
readonly q55Scale: string;
|
|
44
|
+
readonly decision: Wcag22DecisionV1;
|
|
45
|
+
readonly evidence: {
|
|
46
|
+
readonly kind: "canonical-finite-bounded";
|
|
47
|
+
readonly artifactId: "wcag22-srgb8-luminance-q55-v1";
|
|
48
|
+
readonly artifactSha256: string;
|
|
49
|
+
readonly boundId: "wcag22-srgb8-outward-q55-v1";
|
|
50
|
+
readonly proofId: "wcag22-srgb8-full-domain-q55-v1";
|
|
51
|
+
readonly proofSha256: string;
|
|
52
|
+
readonly proofPayloadSha256: string;
|
|
53
|
+
readonly generatorSha256: string;
|
|
54
|
+
readonly verifierSha256: string;
|
|
55
|
+
readonly profileChecksum: string;
|
|
56
|
+
readonly profileSha256: string;
|
|
115
57
|
};
|
|
116
|
-
};
|
|
117
|
-
export interface GlowBitExactDecisionGuaranteeV1 {
|
|
118
|
-
readonly kind: "bit-exact";
|
|
119
|
-
}
|
|
120
|
-
export interface GlowLegacyDecisionGuaranteeV1 {
|
|
121
|
-
readonly kind: "legacy-platform-dependent-v1";
|
|
122
|
-
}
|
|
123
|
-
export type GlowDecisionGuaranteeV1 =
|
|
124
|
-
| GlowBitExactDecisionGuaranteeV1
|
|
125
|
-
| GlowLegacyDecisionGuaranteeV1;
|
|
126
|
-
|
|
127
|
-
/** Поля, общие для трёх конструктивно допустимых определённых исходов Glow. */
|
|
128
|
-
export interface GlowDeterminateRoleBase {
|
|
129
|
-
readonly kind: "glow";
|
|
130
|
-
readonly cssVar: string;
|
|
131
|
-
/** Core, предназначенный потребителем для меньшего blur; геометрия не моделируется. */
|
|
132
|
-
readonly coreHex: string;
|
|
133
|
-
/** Halo, предназначенный потребителем для большего blur; в recipe v1 это источник. */
|
|
134
|
-
readonly haloHex: string;
|
|
135
|
-
/** Интенсивность screen-слоя, (0, 1]. */
|
|
136
|
-
readonly alpha: number;
|
|
137
|
-
/** Каноническая CSS-запись той же alpha; vars использует буквально её. */
|
|
138
|
-
readonly alphaCss: string;
|
|
139
|
-
/** Exact reference-домен point-композита; не renderer/display certificate. */
|
|
140
|
-
readonly compositeProfile: "encoded-srgb8-screen-v1";
|
|
141
|
-
readonly compositeGuarantee: "bit-exact";
|
|
142
|
-
/** Версионированный алгоритм, построивший анатомию core/halo. */
|
|
143
|
-
readonly layerRecipeProfile: GlowLayerRecipeProfileV1;
|
|
144
|
-
/** Модель внешнего вида полного результата; обязательна, потому coreAchievedDj вычислен через CAM16. */
|
|
145
|
-
readonly appearanceDiagnosticProfile: GlowDiagnosticProfileV1;
|
|
146
|
-
/** Цель решается только по изолированному halo. */
|
|
147
|
-
readonly constraintLayer: "halo";
|
|
148
|
-
/** Запрошенный |ΔJ'| halo-композита. */
|
|
149
|
-
readonly targetDj: number;
|
|
150
|
-
/** Reference-композит изолированного halo на фоне резолва. */
|
|
151
|
-
readonly haloCompositeHex: string;
|
|
152
|
-
/** Фактический |ΔJ'| изолированного halo-композита. */
|
|
153
|
-
readonly haloAchievedDj: number;
|
|
154
|
-
/** Reference-композит изолированного core с той же alpha. */
|
|
155
|
-
readonly coreCompositeHex: string;
|
|
156
|
-
/** Фактический |ΔJ'| изолированного core-композита. */
|
|
157
|
-
readonly coreAchievedDj: number;
|
|
158
|
-
/** @deprecated Alias `haloAchievedDj` для совместимости. */
|
|
159
|
-
readonly achievedDj: number;
|
|
160
|
-
/** CSS-значение halo: `oklch(L% C H)`. */
|
|
161
|
-
readonly css: string;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/** Точный no-op: выбор не вызывает CAM16 и не может достигнуть положительную цель. */
|
|
165
|
-
export interface GlowStableExactNoopRole extends GlowDeterminateRoleBase {
|
|
166
|
-
readonly decisionProfile: "stable-v1";
|
|
167
|
-
readonly decisionGuarantee: GlowBitExactDecisionGuaranteeV1;
|
|
168
|
-
readonly selectionDiagnosticProfile: null;
|
|
169
|
-
readonly targetStatus: "exact-noop-unreachable";
|
|
170
|
-
/** @deprecated Выведено из targetStatus. */
|
|
171
|
-
readonly degraded: true;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/** Legacy-выбор CAM16 достиг целевого |ΔJ'| в охарактеризованной среде исполнения. */
|
|
175
|
-
export interface GlowLegacyReachedRole extends GlowDeterminateRoleBase {
|
|
176
|
-
readonly decisionProfile: "legacy-platform-dependent-v1";
|
|
177
|
-
readonly decisionGuarantee: GlowLegacyDecisionGuaranteeV1;
|
|
178
|
-
readonly selectionDiagnosticProfile: GlowDiagnosticProfileV1;
|
|
179
|
-
readonly targetStatus: "legacy-reached";
|
|
180
|
-
/** @deprecated Выведено из targetStatus. */
|
|
181
|
-
readonly degraded: false;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/** Legacy-выбор CAM16 вернул максимум, не достигший целевого |ΔJ'|. */
|
|
185
|
-
export interface GlowLegacyUnreachableRole extends GlowDeterminateRoleBase {
|
|
186
|
-
readonly decisionProfile: "legacy-platform-dependent-v1";
|
|
187
|
-
readonly decisionGuarantee: GlowLegacyDecisionGuaranteeV1;
|
|
188
|
-
readonly selectionDiagnosticProfile: GlowDiagnosticProfileV1;
|
|
189
|
-
readonly targetStatus: "legacy-unreachable";
|
|
190
|
-
/** @deprecated Выведено из targetStatus. */
|
|
191
|
-
readonly degraded: true;
|
|
192
58
|
}
|
|
193
59
|
|
|
194
|
-
export type GlowDeterminateRole =
|
|
195
|
-
| GlowStableExactNoopRole
|
|
196
|
-
| GlowLegacyReachedRole
|
|
197
|
-
| GlowLegacyUnreachableRole;
|
|
198
60
|
|
|
199
|
-
/** Stable terminal outcome: no sound target/max decision, therefore no CSS vars. */
|
|
200
|
-
export interface GlowIndeterminateRoleBase {
|
|
201
|
-
readonly kind: "glow-indeterminate";
|
|
202
|
-
readonly cssVar: string;
|
|
203
|
-
readonly sourceHex: string;
|
|
204
|
-
readonly targetDj: number;
|
|
205
|
-
readonly constraintLayer: "halo";
|
|
206
|
-
readonly decisionProfile: "stable-v1";
|
|
207
|
-
readonly numericalSiteId: "glow-target-or-maximum-v1";
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export type GlowIndeterminateRole = GlowIndeterminateRoleBase & NumericalIndeterminacyV1;
|
|
211
|
-
|
|
212
|
-
export type GlowRole = GlowDeterminateRole | GlowIndeterminateRole;
|
|
213
|
-
|
|
214
|
-
/** Численное свидетельство выбора material-alpha. Оно характеризует повторно
|
|
215
|
-
* проверенный результат профиля, а не строгую межплатформенную границу
|
|
216
|
-
* минимальной alpha. */
|
|
217
|
-
export interface MaterialAlphaGuaranteeBaseV1 {
|
|
218
|
-
/** Byte-scale affine binary64 compositor + original WCAG 2.1 (2018)
|
|
219
|
-
* `0.03928` EOTF, with a conservative channel envelope and both crossed seam
|
|
220
|
-
* sides. Platform-characterized because `powf` is not outward-bounded. */
|
|
221
|
-
readonly numericalProfile: "encoded-srgb-byte-scale-affine-platform-binary64-powf-v1";
|
|
222
|
-
}
|
|
223
|
-
/** Rechecked fail/pass endpoints from a fixed-step binary partition after the
|
|
224
|
-
* directed-search guard. No global-monotonicity, first-state or minimum claim. */
|
|
225
|
-
export interface MaterialBisectionBracketGuaranteeV1 extends MaterialAlphaGuaranteeBaseV1 {
|
|
226
|
-
readonly kind: "bisection-bracket-characterized-v1";
|
|
227
|
-
readonly iterations: number;
|
|
228
|
-
readonly lowerAlpha: number;
|
|
229
|
-
readonly upperAlpha: number;
|
|
230
|
-
}
|
|
231
|
-
export interface MaterialTransparentEndpointGuaranteeV1 extends MaterialAlphaGuaranteeBaseV1 {
|
|
232
|
-
readonly kind: "transparent-endpoint-characterized-v1";
|
|
233
|
-
}
|
|
234
|
-
export interface MaterialOpaqueEndpointGuaranteeV1 extends MaterialAlphaGuaranteeBaseV1 {
|
|
235
|
-
readonly kind: "opaque-endpoint-characterized-v1";
|
|
236
|
-
}
|
|
237
|
-
export type MaterialAlphaGuaranteeV1 =
|
|
238
|
-
| MaterialBisectionBracketGuaranteeV1
|
|
239
|
-
| MaterialTransparentEndpointGuaranteeV1
|
|
240
|
-
| MaterialOpaqueEndpointGuaranteeV1;
|
|
241
|
-
|
|
242
|
-
/** Двухслойный материал (kind material, #89): тинт `01` (с выведенной α) над
|
|
243
|
-
* опаковой базой `02`, обе — один тон. `vars` несёт --lab-<role> (солид-канон,
|
|
244
|
-
* опаковый), --lab-<role>-01 (тинт oklch/α) и --lab-<role>-02 (база, опаковая).
|
|
245
|
-
* Композит-гарантия читаемости пересчитываема из toneHex/alpha (α-граница). */
|
|
246
|
-
export interface MaterialRoleBase {
|
|
247
|
-
readonly kind: "material";
|
|
248
|
-
readonly cssVar: string;
|
|
249
|
-
/** Тон #RRGGBB: тинт 01, база 02 и солид-канон одновременно (равны). */
|
|
250
|
-
readonly toneHex: string;
|
|
251
|
-
/** Худший WCAG-контраст коммит-полюса по коридору [чёрный, белый]. */
|
|
252
|
-
readonly worstContrast: number;
|
|
253
|
-
/** Запрошенный WCAG-пол (4.5 / 3.0); держится только при `alphaStatus: "satisfied"`. */
|
|
254
|
-
readonly floor: number;
|
|
255
|
-
/** Коммит-полюс поверхности белый (true, тёмный тон) или чёрный (false). */
|
|
256
|
-
readonly poleWhite: boolean;
|
|
257
|
-
/** Фактический |ΔJ'| тона-базы от фона — различимость поверхности. */
|
|
258
|
-
readonly achievedDj: number;
|
|
259
|
-
/** Целевой |ΔJ'| тона был недостижим — ближайший достижимый (ADR-0002). */
|
|
260
|
-
readonly toneCompressed: boolean;
|
|
261
|
-
/** Оттенок семьи выродился у края гамута (честный флаг; false у нейтрали). */
|
|
262
|
-
readonly hueVanished: boolean;
|
|
263
|
-
/** Солид-канон отличим от фона резолва на 8-битной сетке. */
|
|
264
|
-
readonly distinct: boolean;
|
|
265
|
-
/** Ready-to-serve CSS value солид-канона: "oklch(L% C H)". */
|
|
266
|
-
readonly css: string;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
/** Уже прозрачная граничная точка держит запрошенный пол. */
|
|
270
|
-
export interface MaterialSatisfiedTransparentRole extends MaterialRoleBase {
|
|
271
|
-
readonly alpha: 0;
|
|
272
|
-
readonly alphaGuarantee: MaterialTransparentEndpointGuaranteeV1;
|
|
273
|
-
readonly alphaStatus: "satisfied";
|
|
274
|
-
readonly guaranteed: true;
|
|
275
|
-
}
|
|
276
61
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
| MaterialSatisfiedTransparentRole
|
|
295
|
-
| MaterialSatisfiedBracketRole
|
|
296
|
-
| MaterialDegradedOpaqueRole;
|
|
297
|
-
|
|
298
|
-
export type RoleResult =
|
|
299
|
-
| SolvedColor
|
|
300
|
-
| TranslucentRole
|
|
301
|
-
| GlowRole
|
|
302
|
-
| MaterialRole
|
|
303
|
-
| NoneRole
|
|
304
|
-
| UnreachableRole;
|
|
305
|
-
|
|
306
|
-
/** Пер-темная четвёрка якорных hex (light / dark / light-ic / dark-ic). */
|
|
307
|
-
export interface ThemeAnchors {
|
|
308
|
-
readonly light: string;
|
|
309
|
-
readonly dark: string;
|
|
310
|
-
readonly light_ic: string;
|
|
311
|
-
readonly dark_ic: string;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/** Источник тинта лестницы/альфа-аналога. */
|
|
315
|
-
export type LadderSource =
|
|
316
|
-
| { kind: "brand" }
|
|
317
|
-
| { kind: "family"; key: string }
|
|
318
|
-
| { kind: "sentiment"; name: string }
|
|
319
|
-
| { kind: "neutral"; pick: "mid" | "edge" | "inverted" | "light" | "dark" };
|
|
320
|
-
|
|
321
|
-
/** Closed physical ladder menu accepted by the config compiler. */
|
|
322
|
-
export type LadderPositionV1 =
|
|
323
|
-
| "label-primary"
|
|
324
|
-
| "label-secondary"
|
|
325
|
-
| "label-tertiary"
|
|
326
|
-
| "label-quaternary"
|
|
327
|
-
| "fill-primary"
|
|
328
|
-
| "fill-secondary"
|
|
329
|
-
| "fill-tertiary"
|
|
330
|
-
| "fill-quaternary"
|
|
331
|
-
| "border-base"
|
|
332
|
-
| "border-soft"
|
|
333
|
-
| "border-strong"
|
|
334
|
-
| "focus-ring"
|
|
335
|
-
| "glow"
|
|
336
|
-
| "skeleton-base"
|
|
337
|
-
| "skeleton-highlight"
|
|
338
|
-
| "neutral-fill-primary"
|
|
339
|
-
| "neutral-fill-secondary"
|
|
340
|
-
| "neutral-fill-tertiary"
|
|
341
|
-
| "neutral-fill-quaternary"
|
|
342
|
-
| "neutral-border-base"
|
|
343
|
-
| "neutral-border-soft"
|
|
344
|
-
| "shadow-minor"
|
|
345
|
-
| "shadow-ambient"
|
|
346
|
-
| "shadow-penumbra"
|
|
347
|
-
| "shadow-major";
|
|
348
|
-
|
|
349
|
-
/** Рецепт роли из физического меню движка. */
|
|
350
|
-
export type RoleRecipe =
|
|
351
|
-
| {
|
|
352
|
-
kind: "text-anchor";
|
|
353
|
-
fraction: number;
|
|
354
|
-
floor: "aa-text" | "aa-ui" | "none";
|
|
355
|
-
hue?: LadderSource;
|
|
356
|
-
}
|
|
357
|
-
| { kind: "dj-anchor"; light: number; dark: number }
|
|
358
|
-
| { kind: "decorative-lc"; magnitude: number }
|
|
359
|
-
| {
|
|
360
|
-
kind: "ladder";
|
|
361
|
-
source: LadderSource;
|
|
362
|
-
position: LadderPositionV1;
|
|
363
|
-
floor?: "aa-text" | "aa-ui" | "none";
|
|
364
|
-
}
|
|
365
|
-
| {
|
|
366
|
-
kind: "glow";
|
|
367
|
-
source: LadderSource;
|
|
368
|
-
step: "subtle" | "base" | "bloom";
|
|
369
|
-
decision_profile: GlowDecisionProfileV1;
|
|
62
|
+
export class AttachedMaterializationAuthority {
|
|
63
|
+
private constructor();
|
|
64
|
+
free(): void;
|
|
65
|
+
[Symbol.dispose](): void;
|
|
66
|
+
bindingEpoch(): bigint;
|
|
67
|
+
contentIdentity(): Uint8Array;
|
|
68
|
+
contextIdentity(): Uint8Array;
|
|
69
|
+
occurrence(): number;
|
|
70
|
+
outputOpacity(): number;
|
|
71
|
+
outputRgb(): Uint8Array;
|
|
72
|
+
outputSlot(): number;
|
|
73
|
+
physicalIdentity(): string;
|
|
74
|
+
presentationRoot(): number;
|
|
75
|
+
rendererProvenance(): string;
|
|
76
|
+
revision(): bigint;
|
|
77
|
+
sinkSequence(): bigint;
|
|
78
|
+
terminalCompositeRgb(): Uint8Array;
|
|
370
79
|
}
|
|
371
|
-
| { kind: "pair-fill"; source: LadderSource }
|
|
372
|
-
| { kind: "pair-label"; source: LadderSource; fraction: number; floor: "aa-text" | "aa-ui" | "none" }
|
|
373
|
-
| { kind: "alpha-analog"; of: LadderSource; alpha: number }
|
|
374
|
-
| { kind: "material"; source: LadderSource; tone_light: number; tone_dark: number; floor: "aa-text" | "aa-ui" }
|
|
375
|
-
| { kind: "zero" };
|
|
376
80
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
name: string;
|
|
395
|
-
family: string;
|
|
396
|
-
hue_floor_deg?: number;
|
|
397
|
-
preferred_side?: -1 | 1;
|
|
398
|
-
}>;
|
|
399
|
-
readonly hardness: number;
|
|
400
|
-
readonly chroma_fraction: number;
|
|
401
|
-
};
|
|
402
|
-
readonly themes: ReadonlyArray<{ name: string; preset: "srgb" | "dim" | "srgb-ic" | "dim-ic" }>;
|
|
403
|
-
/** Словарь ролей дизайн-системы. Конфиг обязан нести собственные роли; пустой
|
|
404
|
-
* контракт (без `roles` и `aliases`) отклоняется на загрузке. */
|
|
405
|
-
readonly roles: ReadonlyArray<{ name: string; recipe: RoleRecipe }>;
|
|
406
|
-
readonly aliases?: ReadonlyArray<{ alias: string; target: string }>;
|
|
81
|
+
export class ProgramAttachedRender {
|
|
82
|
+
private constructor();
|
|
83
|
+
free(): void;
|
|
84
|
+
[Symbol.dispose](): void;
|
|
85
|
+
bindingEpoch(): bigint;
|
|
86
|
+
contentIdentity(): Uint8Array;
|
|
87
|
+
contextIdentity(): Uint8Array;
|
|
88
|
+
occurrence(): number;
|
|
89
|
+
outputOpacity(): number;
|
|
90
|
+
outputRgb(): Uint8Array;
|
|
91
|
+
outputSlot(): number;
|
|
92
|
+
physicalIdentity(): string;
|
|
93
|
+
presentationRoot(): number;
|
|
94
|
+
revision(): bigint;
|
|
95
|
+
sinkOutput(): number;
|
|
96
|
+
sinkSequence(): bigint;
|
|
97
|
+
terminalCompositeRgb(): Uint8Array | undefined;
|
|
407
98
|
}
|
|
408
99
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
* Scope: this is resolveTheme's contract (applyTheme/watchTheme inject it
|
|
421
|
-
* verbatim); adaptTheme's per-frame easing writes concrete interpolated
|
|
422
|
-
* colours and is not bound by the emission form.
|
|
423
|
-
*/
|
|
424
|
-
readonly vars: Record<string, string>;
|
|
425
|
-
/** Every role, keyed by its stable role key (without the --lab- prefix). */
|
|
426
|
-
readonly roles: Record<string, RoleResult>;
|
|
100
|
+
export class ProgramAttachedSnapshot {
|
|
101
|
+
private constructor();
|
|
102
|
+
free(): void;
|
|
103
|
+
[Symbol.dispose](): void;
|
|
104
|
+
hasRender(): boolean;
|
|
105
|
+
outputCount(): number;
|
|
106
|
+
outputOpacity(index: number): number;
|
|
107
|
+
outputRgb(index: number): Uint8Array;
|
|
108
|
+
outputSlot(index: number): number;
|
|
109
|
+
render(): ProgramAttachedRender | undefined;
|
|
110
|
+
readonly state: string;
|
|
427
111
|
}
|
|
428
112
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* A contrast engine over a consumer-supplied design system. Construct with
|
|
433
|
-
* [`LabColors::new`], load a config with [`loadConfig`](LabColors::load_config),
|
|
434
|
-
* then call [`resolve_theme`](LabColors::resolve_theme) many times; identical
|
|
435
|
-
* calls are served from the contract cache.
|
|
436
|
-
*/
|
|
437
|
-
export class LabColors {
|
|
113
|
+
export class ProgramAttachment {
|
|
114
|
+
private constructor();
|
|
438
115
|
free(): void;
|
|
439
116
|
[Symbol.dispose](): void;
|
|
440
117
|
/**
|
|
441
|
-
*
|
|
442
|
-
* layer is a byte-for-byte no-op for every alpha under encoded sRGB8.
|
|
443
|
-
* `adaptTheme` uses this cheap core-owned predicate to detect the only
|
|
444
|
-
* stable determinate/indeterminate class transition without running CAM16
|
|
445
|
-
* or re-solving on every animated-background frame.
|
|
118
|
+
* Потребляет attachment только после подтверждения внешнего revoke caller-ом.
|
|
446
119
|
*/
|
|
447
|
-
|
|
120
|
+
dispose(confirmed: boolean): void;
|
|
448
121
|
/**
|
|
449
|
-
*
|
|
450
|
-
*
|
|
451
|
-
* Полный preflight движка: невалидный конфиг отклоняется структурной
|
|
452
|
-
* ошибкой `invalid_config: …` и НЕ меняет состояние. После успешной
|
|
453
|
-
* загрузки `resolveTheme` эмитит роли конфига (включая полупрозрачные
|
|
454
|
-
* роли лестницы — эмиссия `oklch(L% C H / α)`). Возвращает отпечаток
|
|
455
|
-
* конфига — 16 hex-символов;
|
|
456
|
-
* разные конфиги дают разные отпечатки (и разные кэш-пространства).
|
|
122
|
+
* Допускает authority только из текущего committed head attachment.
|
|
457
123
|
*/
|
|
458
|
-
|
|
124
|
+
materializationAuthority(): AttachedMaterializationAuthority;
|
|
459
125
|
/**
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
* This is an experimental compatibility proxy: it reproduces the historic
|
|
463
|
-
* numeric API, but is not an observer-validated human clean/dirty verdict
|
|
464
|
-
* or a production decision. The legacy identifier is retained only for
|
|
465
|
-
* compatibility.
|
|
126
|
+
* Проверяет переданные caller-ом revision, identity и epoch против current head.
|
|
466
127
|
*/
|
|
467
|
-
|
|
128
|
+
materializationAuthorityFor(revision: bigint, content_identity: Uint8Array, binding_epoch: bigint): AttachedMaterializationAuthority;
|
|
468
129
|
/**
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
* The engine is agnostic (ADR-0001): it carries no built-in role table, so
|
|
472
|
-
* [`resolveTheme`](LabColors::resolve_theme) rejects with `config_required`
|
|
473
|
-
* until [`loadConfig`](LabColors::load_config) supplies a design system.
|
|
130
|
+
* Атомарно применяет observed revision через host sink.
|
|
474
131
|
*/
|
|
475
|
-
|
|
132
|
+
updateObserved(revision: bigint, scenario_ids: Uint32Array, surfaces: Uint8Array, surface_count: number): ProgramAttachedSnapshot;
|
|
476
133
|
/**
|
|
477
|
-
*
|
|
478
|
-
* the cheap per-frame primitive a reactive runtime uses to decide whether
|
|
479
|
-
* already-resolved colours still pass against a changed background (re-solve
|
|
480
|
-
* only when they stably do not). No full solve: one perceptual-model forward
|
|
481
|
-
* for the background plus one per foreground.
|
|
482
|
-
*
|
|
483
|
-
* Returns a `Float64Array` of `[lc, wcagRatio]` pairs, interleaved and in the
|
|
484
|
-
* order of `fgHexes`: index `2*i` is foreground `i`'s signed `Lc`, `2*i+1`
|
|
485
|
-
* its WCAG ratio. Rejects (structured `{code, message}`) on an invalid hex or
|
|
486
|
-
* an unknown theme.
|
|
134
|
+
* Атомарно отзывает owned sink для недоступной revision.
|
|
487
135
|
*/
|
|
488
|
-
|
|
136
|
+
updateUnknown(revision: bigint, reason_id: number): ProgramAttachedSnapshot;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Публичный runtime одного скомпилированного Program.
|
|
141
|
+
*/
|
|
142
|
+
export class ProgramRuntime {
|
|
143
|
+
private constructor();
|
|
144
|
+
free(): void;
|
|
145
|
+
[Symbol.dispose](): void;
|
|
489
146
|
/**
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
* foregrounds against every sample of a varying backdrop (gradient / image /
|
|
493
|
-
* bg-blur / glass); the dominant per-foreground CAM16 forward is background-
|
|
494
|
-
* independent, so this shares it across all samples instead of recomputing it
|
|
495
|
-
* per `recheckContrast` call — a measured ~2.6x on the multi-sample recheck.
|
|
496
|
-
*
|
|
497
|
-
* Returns a flat, background-major `Float64Array`: sample `s`, foreground `i`
|
|
498
|
-
* is at `(s * fgHexes.length + i) * 2` (`lc`) and `+1` (`wcagRatio`). The
|
|
499
|
-
* values are byte-identical to calling `recheckContrast(bgHexes[s], fgHexes,
|
|
500
|
-
* theme)` for each `s`.
|
|
147
|
+
* Атомарный observed update. `surfaces` — row-major
|
|
148
|
+
* `scenario_ids.len() × surface_count × 3` bytes.
|
|
501
149
|
*/
|
|
502
|
-
|
|
150
|
+
updateObserved(revision: bigint, scenario_ids: Uint32Array, surfaces: Uint8Array, surface_count: number): ProgramSnapshot;
|
|
151
|
+
updateUnknown(revision: bigint, reason_id: number): ProgramSnapshot;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Owned snapshot одного Program update.
|
|
156
|
+
*/
|
|
157
|
+
export class ProgramSnapshot {
|
|
158
|
+
private constructor();
|
|
159
|
+
free(): void;
|
|
160
|
+
[Symbol.dispose](): void;
|
|
161
|
+
outputCount(): number;
|
|
162
|
+
outputOpacity(index: number): number;
|
|
163
|
+
outputRgb(index: number): Uint8Array;
|
|
164
|
+
outputSlot(index: number): number;
|
|
503
165
|
/**
|
|
504
|
-
*
|
|
505
|
-
* "light-ic" | "dark-ic"`).
|
|
506
|
-
*
|
|
507
|
-
* Returns a `ResolvedTheme` object. Per-role unreachability is part of a
|
|
508
|
-
* successful result (each role carries its own `kind`); only whole-call
|
|
509
|
-
* failures reject (no config loaded yet as `config_required`, invalid hex,
|
|
510
|
-
* unknown theme, a core invariant failure, and the by-construction-
|
|
511
|
-
* unreachable oklch serialisation failure as `internal_error`) — as a
|
|
512
|
-
* structured `"<code>: <message>"` error, never an unwound panic.
|
|
166
|
+
* Stable lifecycle key: waiting|ready|stale|failed.
|
|
513
167
|
*/
|
|
514
|
-
|
|
168
|
+
readonly state: string;
|
|
515
169
|
}
|
|
516
170
|
|
|
171
|
+
/**
|
|
172
|
+
* Создаёт один публичный attachment и передаёт все внешние эффекты в `host`.
|
|
173
|
+
*/
|
|
174
|
+
export function attachProgramWire(bytes: Uint8Array, stream_id: number, output_slot: number, sink_output: number, presentation_root: number, occurrence: number, host: Function): ProgramAttachment;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Компилирует canonical Program wire bytes и создаёт одну runtime Session.
|
|
178
|
+
*/
|
|
179
|
+
export function compileProgramWire(bytes: Uint8Array, stream_id: number): ProgramRuntime;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Decodes untrusted certificate bytes into immutable metadata for inspection
|
|
183
|
+
* only. The opaque body, producer capability, and admission state stay in
|
|
184
|
+
* Core and are not projected to JavaScript.
|
|
185
|
+
*/
|
|
186
|
+
export function decodeCertificateEnvelope(bytes: Uint8Array): any;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Точная оценка WCAG 2.2 одной финальной пары sRGB8.
|
|
190
|
+
*/
|
|
191
|
+
export function evaluateWcag22(foreground_hex: string, background_hex: string, criterion: string): Wcag22AssessmentV1;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Выдаёт собственную копию байтов сертификата встроенного дескриптора исходников Core.
|
|
195
|
+
* Идентичность и маркер создаёт Core; capability и состояние приёма остаются внутри.
|
|
196
|
+
*/
|
|
197
|
+
export function issueSourceCertificateEnvelope(): Uint8Array;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Единственный публичный манифест численных возможностей.
|
|
201
|
+
*/
|
|
202
|
+
export function numericalCapabilityManifest(): NumericalCapabilityManifestV2;
|
|
203
|
+
|
|
517
204
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
518
205
|
|
|
519
206
|
export interface InitOutput {
|
|
520
207
|
readonly memory: WebAssembly.Memory;
|
|
521
|
-
readonly
|
|
522
|
-
readonly
|
|
523
|
-
readonly
|
|
524
|
-
readonly
|
|
525
|
-
readonly
|
|
526
|
-
readonly
|
|
527
|
-
readonly
|
|
528
|
-
readonly
|
|
529
|
-
readonly
|
|
530
|
-
readonly
|
|
531
|
-
readonly
|
|
208
|
+
readonly __wbg_attachedmaterializationauthority_free: (a: number, b: number) => void;
|
|
209
|
+
readonly __wbg_programattachedrender_free: (a: number, b: number) => void;
|
|
210
|
+
readonly __wbg_programattachedsnapshot_free: (a: number, b: number) => void;
|
|
211
|
+
readonly __wbg_programattachment_free: (a: number, b: number) => void;
|
|
212
|
+
readonly __wbg_programruntime_free: (a: number, b: number) => void;
|
|
213
|
+
readonly __wbg_programsnapshot_free: (a: number, b: number) => void;
|
|
214
|
+
readonly attachProgramWire: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
215
|
+
readonly attachedmaterializationauthority_bindingEpoch: (a: number) => bigint;
|
|
216
|
+
readonly attachedmaterializationauthority_contentIdentity: (a: number, b: number) => void;
|
|
217
|
+
readonly attachedmaterializationauthority_contextIdentity: (a: number, b: number) => void;
|
|
218
|
+
readonly attachedmaterializationauthority_occurrence: (a: number) => number;
|
|
219
|
+
readonly attachedmaterializationauthority_outputOpacity: (a: number) => number;
|
|
220
|
+
readonly attachedmaterializationauthority_outputRgb: (a: number, b: number) => void;
|
|
221
|
+
readonly attachedmaterializationauthority_outputSlot: (a: number) => number;
|
|
222
|
+
readonly attachedmaterializationauthority_physicalIdentity: (a: number, b: number) => void;
|
|
223
|
+
readonly attachedmaterializationauthority_presentationRoot: (a: number) => number;
|
|
224
|
+
readonly attachedmaterializationauthority_rendererProvenance: (a: number, b: number) => void;
|
|
225
|
+
readonly attachedmaterializationauthority_revision: (a: number) => bigint;
|
|
226
|
+
readonly attachedmaterializationauthority_sinkSequence: (a: number) => bigint;
|
|
227
|
+
readonly attachedmaterializationauthority_terminalCompositeRgb: (a: number, b: number) => void;
|
|
228
|
+
readonly compileProgramWire: (a: number, b: number, c: number, d: number) => void;
|
|
229
|
+
readonly decodeCertificateEnvelope: (a: number, b: number, c: number) => void;
|
|
230
|
+
readonly evaluateWcag22: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
231
|
+
readonly issueSourceCertificateEnvelope: (a: number) => void;
|
|
232
|
+
readonly numericalCapabilityManifest: (a: number) => void;
|
|
233
|
+
readonly programattachedrender_bindingEpoch: (a: number) => bigint;
|
|
234
|
+
readonly programattachedrender_contentIdentity: (a: number, b: number) => void;
|
|
235
|
+
readonly programattachedrender_contextIdentity: (a: number, b: number) => void;
|
|
236
|
+
readonly programattachedrender_occurrence: (a: number) => number;
|
|
237
|
+
readonly programattachedrender_outputOpacity: (a: number) => number;
|
|
238
|
+
readonly programattachedrender_outputRgb: (a: number, b: number) => void;
|
|
239
|
+
readonly programattachedrender_outputSlot: (a: number) => number;
|
|
240
|
+
readonly programattachedrender_physicalIdentity: (a: number, b: number) => void;
|
|
241
|
+
readonly programattachedrender_presentationRoot: (a: number) => number;
|
|
242
|
+
readonly programattachedrender_revision: (a: number) => bigint;
|
|
243
|
+
readonly programattachedrender_sinkOutput: (a: number) => number;
|
|
244
|
+
readonly programattachedrender_sinkSequence: (a: number) => bigint;
|
|
245
|
+
readonly programattachedrender_terminalCompositeRgb: (a: number, b: number) => void;
|
|
246
|
+
readonly programattachedsnapshot_hasRender: (a: number) => number;
|
|
247
|
+
readonly programattachedsnapshot_outputCount: (a: number) => number;
|
|
248
|
+
readonly programattachedsnapshot_outputOpacity: (a: number, b: number, c: number) => void;
|
|
249
|
+
readonly programattachedsnapshot_outputRgb: (a: number, b: number, c: number) => void;
|
|
250
|
+
readonly programattachedsnapshot_outputSlot: (a: number, b: number, c: number) => void;
|
|
251
|
+
readonly programattachedsnapshot_render: (a: number) => number;
|
|
252
|
+
readonly programattachedsnapshot_state: (a: number, b: number) => void;
|
|
253
|
+
readonly programattachment_dispose: (a: number, b: number, c: number) => void;
|
|
254
|
+
readonly programattachment_materializationAuthority: (a: number, b: number) => void;
|
|
255
|
+
readonly programattachment_materializationAuthorityFor: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
256
|
+
readonly programattachment_updateObserved: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
257
|
+
readonly programattachment_updateUnknown: (a: number, b: number, c: number, d: number) => void;
|
|
258
|
+
readonly programruntime_updateObserved: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
259
|
+
readonly programruntime_updateUnknown: (a: number, b: number, c: number, d: number) => void;
|
|
260
|
+
readonly programsnapshot_outputCount: (a: number) => number;
|
|
261
|
+
readonly programsnapshot_outputOpacity: (a: number, b: number, c: number) => void;
|
|
262
|
+
readonly programsnapshot_outputRgb: (a: number, b: number, c: number) => void;
|
|
263
|
+
readonly programsnapshot_outputSlot: (a: number, b: number, c: number) => void;
|
|
264
|
+
readonly programsnapshot_state: (a: number, b: number) => void;
|
|
265
|
+
readonly __wbindgen_export: (a: number) => void;
|
|
532
266
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
533
|
-
readonly
|
|
267
|
+
readonly __wbindgen_export2: (a: number, b: number) => number;
|
|
268
|
+
readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
|
|
269
|
+
readonly __wbindgen_export4: (a: number, b: number, c: number, d: number) => number;
|
|
534
270
|
}
|
|
535
271
|
|
|
536
272
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|