markswift 0.0.0-stage → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/CHANGELOG.md +234 -0
  2. package/LICENSE +21 -0
  3. package/README.md +592 -2
  4. package/dist/cli-jdrbzqfa.js +2975 -0
  5. package/dist/cli-qchh0m4d.js +14041 -0
  6. package/dist/cli.js +637 -0
  7. package/dist/compiler/index.js +20 -0
  8. package/dist/index.js +22 -0
  9. package/dist/types/analysis/alignment.d.ts +12 -0
  10. package/dist/types/analysis/bands.d.ts +53 -0
  11. package/dist/types/analysis/breakpoints.d.ts +22 -0
  12. package/dist/types/analysis/class-hints.d.ts +21 -0
  13. package/dist/types/analysis/context.d.ts +49 -0
  14. package/dist/types/analysis/controls.d.ts +97 -0
  15. package/dist/types/analysis/flex-row.d.ts +14 -0
  16. package/dist/types/analysis/flex-sizing.d.ts +5 -0
  17. package/dist/types/analysis/flow-layout.d.ts +18 -0
  18. package/dist/types/analysis/generated.d.ts +16 -0
  19. package/dist/types/analysis/geometry.d.ts +50 -0
  20. package/dist/types/analysis/grid-tracks.d.ts +44 -0
  21. package/dist/types/analysis/grid.d.ts +5 -0
  22. package/dist/types/analysis/infer.d.ts +18 -0
  23. package/dist/types/analysis/invisible.d.ts +6 -0
  24. package/dist/types/analysis/layers.d.ts +15 -0
  25. package/dist/types/analysis/measured-layout.d.ts +6 -0
  26. package/dist/types/analysis/motion.d.ts +29 -0
  27. package/dist/types/analysis/naming.d.ts +6 -0
  28. package/dist/types/analysis/node-base.d.ts +13 -0
  29. package/dist/types/analysis/size-constraints.d.ts +5 -0
  30. package/dist/types/analysis/sizing.d.ts +24 -0
  31. package/dist/types/analysis/style-background.d.ts +24 -0
  32. package/dist/types/analysis/style-border.d.ts +7 -0
  33. package/dist/types/analysis/style-effects.d.ts +4 -0
  34. package/dist/types/analysis/style.d.ts +9 -0
  35. package/dist/types/analysis/svg/attributes.d.ts +10 -0
  36. package/dist/types/analysis/svg/build.d.ts +6 -0
  37. package/dist/types/analysis/svg/context.d.ts +31 -0
  38. package/dist/types/analysis/svg/geometry.d.ts +11 -0
  39. package/dist/types/analysis/svg/gradients.d.ts +6 -0
  40. package/dist/types/analysis/svg/markup.d.ts +23 -0
  41. package/dist/types/analysis/svg/text.d.ts +7 -0
  42. package/dist/types/analysis/svg/transforms.d.ts +19 -0
  43. package/dist/types/analysis/svg/traversal.d.ts +4 -0
  44. package/dist/types/analysis/table-borders.d.ts +19 -0
  45. package/dist/types/analysis/table.d.ts +36 -0
  46. package/dist/types/analysis/text-layout.d.ts +65 -0
  47. package/dist/types/analysis/text-runs.d.ts +30 -0
  48. package/dist/types/analysis/text.d.ts +9 -0
  49. package/dist/types/analysis/tooltips.d.ts +16 -0
  50. package/dist/types/analysis/typography.d.ts +21 -0
  51. package/dist/types/analysis/wrapping.d.ts +5 -0
  52. package/dist/types/api/bands.d.ts +58 -0
  53. package/dist/types/api/build.d.ts +51 -0
  54. package/dist/types/api/convert.d.ts +13 -0
  55. package/dist/types/api/types.d.ts +69 -0
  56. package/dist/types/browser/capture.d.ts +89 -0
  57. package/dist/types/browser/conditions.d.ts +25 -0
  58. package/dist/types/browser/fonts.d.ts +34 -0
  59. package/dist/types/browser/images.d.ts +3 -0
  60. package/dist/types/browser/layers.d.ts +132 -0
  61. package/dist/types/browser/motion.d.ts +44 -0
  62. package/dist/types/browser/settle.d.ts +27 -0
  63. package/dist/types/browser/sizing.d.ts +10 -0
  64. package/dist/types/browser/snapshot.d.ts +155 -0
  65. package/dist/types/browser/states.d.ts +36 -0
  66. package/dist/types/cli/args.d.ts +31 -0
  67. package/dist/types/cli/config.d.ts +78 -0
  68. package/dist/types/cli/css.d.ts +9 -0
  69. package/dist/types/cli/manifest.d.ts +20 -0
  70. package/dist/types/cli/output.d.ts +27 -0
  71. package/dist/types/cli/run.d.ts +4 -0
  72. package/dist/types/cli.d.ts +2 -0
  73. package/dist/types/compiler/index.d.ts +91 -0
  74. package/dist/types/compiler/naming.d.ts +1 -0
  75. package/dist/types/css/background.d.ts +16 -0
  76. package/dist/types/css/blend.d.ts +9 -0
  77. package/dist/types/css/color.d.ts +14 -0
  78. package/dist/types/css/counter.d.ts +10 -0
  79. package/dist/types/css/easing.d.ts +4 -0
  80. package/dist/types/css/effects.d.ts +18 -0
  81. package/dist/types/css/grid.d.ts +29 -0
  82. package/dist/types/css/index.d.ts +15 -0
  83. package/dist/types/css/media.d.ts +16 -0
  84. package/dist/types/css/paint.d.ts +33 -0
  85. package/dist/types/css/radius.d.ts +5 -0
  86. package/dist/types/css/raster.d.ts +10 -0
  87. package/dist/types/css/shadows.d.ts +3 -0
  88. package/dist/types/css/syntax.d.ts +12 -0
  89. package/dist/types/css/transforms.d.ts +45 -0
  90. package/dist/types/css/typography.d.ts +8 -0
  91. package/dist/types/fonts/converter.d.ts +16 -0
  92. package/dist/types/fonts/metadata.d.ts +6 -0
  93. package/dist/types/fonts/package.d.ts +12 -0
  94. package/dist/types/fonts/registration.d.ts +13 -0
  95. package/dist/types/fonts/source.d.ts +14 -0
  96. package/dist/types/fonts/types.d.ts +28 -0
  97. package/dist/types/html/elements.d.ts +8 -0
  98. package/dist/types/html/index.d.ts +4 -0
  99. package/dist/types/html/inputs.d.ts +4 -0
  100. package/dist/types/html/policy.d.ts +3 -0
  101. package/dist/types/html/types.d.ts +12 -0
  102. package/dist/types/index.d.ts +8 -0
  103. package/dist/types/input/identity.d.ts +3 -0
  104. package/dist/types/input/mime.d.ts +1 -0
  105. package/dist/types/input/root.d.ts +1 -0
  106. package/dist/types/input/server.d.ts +11 -0
  107. package/dist/types/input/source.d.ts +9 -0
  108. package/dist/types/input/types.d.ts +54 -0
  109. package/dist/types/model/fonts.d.ts +26 -0
  110. package/dist/types/model/interactive.d.ts +10 -0
  111. package/dist/types/model/layout.d.ts +528 -0
  112. package/dist/types/model/semantic.d.ts +984 -0
  113. package/dist/types/model/values.d.ts +125 -0
  114. package/dist/types/model/version.d.ts +4 -0
  115. package/dist/types/swift/borders.d.ts +13 -0
  116. package/dist/types/swift/components.d.ts +115 -0
  117. package/dist/types/swift/context.d.ts +184 -0
  118. package/dist/types/swift/control-state.d.ts +19 -0
  119. package/dist/types/swift/controls.d.ts +62 -0
  120. package/dist/types/swift/diagnostics.d.ts +3 -0
  121. package/dist/types/swift/effects.d.ts +23 -0
  122. package/dist/types/swift/emit.d.ts +6 -0
  123. package/dist/types/swift/format.d.ts +91 -0
  124. package/dist/types/swift/frames.d.ts +17 -0
  125. package/dist/types/swift/images.d.ts +25 -0
  126. package/dist/types/swift/layout.d.ts +5 -0
  127. package/dist/types/swift/measured-layout.d.ts +4 -0
  128. package/dist/types/swift/modifiers.d.ts +30 -0
  129. package/dist/types/swift/motion.d.ts +20 -0
  130. package/dist/types/swift/nodes.d.ts +4 -0
  131. package/dist/types/swift/paint.d.ts +22 -0
  132. package/dist/types/swift/runtime.d.ts +6 -0
  133. package/dist/types/swift/shadows.d.ts +7 -0
  134. package/dist/types/swift/states.d.ts +3 -0
  135. package/dist/types/swift/svg.d.ts +14 -0
  136. package/dist/types/swift/text-box.d.ts +12 -0
  137. package/dist/types/swift/text.d.ts +3 -0
  138. package/dist/types/swift/tokens/emit.d.ts +26 -0
  139. package/dist/types/swift/tokens/extract.d.ts +21 -0
  140. package/dist/types/swift/tokens/naming.d.ts +22 -0
  141. package/dist/types/swift/tokens/slots.d.ts +18 -0
  142. package/dist/types/swift/tokens/types.d.ts +77 -0
  143. package/dist/types/swift/tokens.d.ts +6 -0
  144. package/dist/types/swift/traversal.d.ts +2 -0
  145. package/dist/types/swift/wrapping.d.ts +4 -0
  146. package/package.json +66 -4
@@ -0,0 +1,26 @@
1
+ /** Font data passed explicitly through one conversion. No process-wide state. */
2
+ export interface BundledFamily {
3
+ /** `font-weight` range the family covers; `[400, 400]` for a single static face. */
4
+ weight: [number, number];
5
+ /** `wght` axis range, when the file has one; without it each weight is its own static face. */
6
+ wght?: [number, number];
7
+ /** `opsz` axis range, when the file has one — `font-size` is clamped into it. */
8
+ opsz?: [number, number];
9
+ /** Variation axes other than `wght`/`opsz` the file declares (`wdth`, `GRAD`, …), by tag. */
10
+ axes?: Record<string, [number, number]>;
11
+ }
12
+ export type BundledFamilies = Readonly<Record<string, BundledFamily>>;
13
+ /**
14
+ * Vertical metrics of a packaged face, in font units (`upem`). `descent` is absolute
15
+ * (positive-down). The pair is the one the rendering engine uses: `OS/2` sTypo* when
16
+ * `fsSelection` bit 7 (USE_TYPO_METRICS) is set, else `hhea`.
17
+ */
18
+ export interface FaceMetrics {
19
+ upem: number;
20
+ ascent: number;
21
+ descent: number;
22
+ lineGap: number;
23
+ useTypoMetrics: boolean;
24
+ }
25
+ /** Lowercase CSS family name to packaged font metrics. */
26
+ export type FontMetrics = Readonly<Record<string, FaceMetrics>>;
@@ -0,0 +1,10 @@
1
+ /** ARIA widget roles a tap activates: an element carrying one is a Button in the generated view (see `activatableAction`). */
2
+ export declare const ACTIVATABLE_ROLES: Readonly<Record<string, true>>;
3
+ /** `role` (as authored) names one of `ACTIVATABLE_ROLES`. */
4
+ export declare const isActivatableRole: (role: string | undefined) => boolean;
5
+ /** `role` (as authored) names one of `TOGGLE_ROLES`. */
6
+ export declare const isToggleRole: (role: string | undefined) => boolean;
7
+ /** Elements whose `:hover`+`:active` paint is captured as the pressed look: what the emitter makes a Button. */
8
+ export declare const PRESSABLE_SELECTOR: string;
9
+ /** Text-entry controls whose `:focus`+`:focus-visible` paint is captured as the focused look. */
10
+ export declare const TEXT_ENTRY_SELECTOR: string;
@@ -0,0 +1,528 @@
1
+ /**
2
+ * Layout IR — what the browser measured. Target-agnostic, one tree per
3
+ * (screen, theme) combination. Produced from CDP DOMSnapshot; consumed
4
+ * by the semantic inference pass. Nothing here knows about SwiftUI.
5
+ */
6
+ import { z } from "zod";
7
+ export declare const Rect: z.ZodObject<{
8
+ x: z.ZodNumber;
9
+ y: z.ZodNumber;
10
+ w: z.ZodNumber;
11
+ h: z.ZodNumber;
12
+ }, z.core.$strip>;
13
+ export type Rect = z.infer<typeof Rect>;
14
+ /** CSS Typed OM preserves auto/percent/px intent before used values become measured pixels. */
15
+ export declare const PreferredSize: z.ZodObject<{
16
+ width: z.ZodString;
17
+ height: z.ZodString;
18
+ insets: z.ZodOptional<z.ZodObject<{
19
+ top: z.ZodString;
20
+ right: z.ZodString;
21
+ bottom: z.ZodString;
22
+ left: z.ZodString;
23
+ }, z.core.$strip>>;
24
+ autoMargins: z.ZodOptional<z.ZodArray<z.ZodEnum<{
25
+ top: "top";
26
+ right: "right";
27
+ bottom: "bottom";
28
+ left: "left";
29
+ }>>>;
30
+ gridTemplateColumns: z.ZodOptional<z.ZodString>;
31
+ gridTemplateRows: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>;
33
+ export type PreferredSize = z.infer<typeof PreferredSize>;
34
+ /** One computed keyframe (`getKeyframes()`): offset, the easing of the segment it starts, CSS property → value. */
35
+ export declare const Keyframe: z.ZodObject<{
36
+ offset: z.ZodNumber;
37
+ easing: z.ZodString;
38
+ values: z.ZodRecord<z.ZodString, z.ZodString>;
39
+ }, z.core.$strip>;
40
+ /** One CSS animation as Chrome's `CSSAnimation` reports it (`var()`-resolved, per element). Times in ms. */
41
+ export declare const Anim: z.ZodObject<{
42
+ name: z.ZodString;
43
+ pseudo: z.ZodOptional<z.ZodEnum<{
44
+ "::before": "::before";
45
+ "::after": "::after";
46
+ }>>;
47
+ duration: z.ZodNumber;
48
+ delay: z.ZodNumber;
49
+ iterations: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"infinite">]>;
50
+ direction: z.ZodEnum<{
51
+ reverse: "reverse";
52
+ normal: "normal";
53
+ alternate: "alternate";
54
+ "alternate-reverse": "alternate-reverse";
55
+ }>;
56
+ fill: z.ZodEnum<{
57
+ none: "none";
58
+ forwards: "forwards";
59
+ backwards: "backwards";
60
+ both: "both";
61
+ }>;
62
+ composite: z.ZodOptional<z.ZodEnum<{
63
+ add: "add";
64
+ accumulate: "accumulate";
65
+ }>>;
66
+ timeline: z.ZodOptional<z.ZodString>;
67
+ keyframes: z.ZodArray<z.ZodObject<{
68
+ offset: z.ZodNumber;
69
+ easing: z.ZodString;
70
+ values: z.ZodRecord<z.ZodString, z.ZodString>;
71
+ }, z.core.$strip>>;
72
+ }, z.core.$strip>;
73
+ export type Anim = z.infer<typeof Anim>;
74
+ /** One `CSSTransition` a forced state started (or ended). Times in ms. */
75
+ export declare const Transition: z.ZodObject<{
76
+ property: z.ZodString;
77
+ duration: z.ZodNumber;
78
+ delay: z.ZodNumber;
79
+ easing: z.ZodString;
80
+ from: z.ZodString;
81
+ to: z.ZodString;
82
+ }, z.core.$strip>;
83
+ export type Transition = z.infer<typeof Transition>;
84
+ /**
85
+ * The reduced rule: a `reduced` list is present when the page has a `prefers-reduced-motion` media rule (the
86
+ * author decided) or when it differs from the `no-preference` list; absent = no author decision, `[]` = none run.
87
+ */
88
+ export declare const Motion: z.ZodObject<{
89
+ animations: z.ZodOptional<z.ZodArray<z.ZodObject<{
90
+ name: z.ZodString;
91
+ pseudo: z.ZodOptional<z.ZodEnum<{
92
+ "::before": "::before";
93
+ "::after": "::after";
94
+ }>>;
95
+ duration: z.ZodNumber;
96
+ delay: z.ZodNumber;
97
+ iterations: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"infinite">]>;
98
+ direction: z.ZodEnum<{
99
+ reverse: "reverse";
100
+ normal: "normal";
101
+ alternate: "alternate";
102
+ "alternate-reverse": "alternate-reverse";
103
+ }>;
104
+ fill: z.ZodEnum<{
105
+ none: "none";
106
+ forwards: "forwards";
107
+ backwards: "backwards";
108
+ both: "both";
109
+ }>;
110
+ composite: z.ZodOptional<z.ZodEnum<{
111
+ add: "add";
112
+ accumulate: "accumulate";
113
+ }>>;
114
+ timeline: z.ZodOptional<z.ZodString>;
115
+ keyframes: z.ZodArray<z.ZodObject<{
116
+ offset: z.ZodNumber;
117
+ easing: z.ZodString;
118
+ values: z.ZodRecord<z.ZodString, z.ZodString>;
119
+ }, z.core.$strip>>;
120
+ }, z.core.$strip>>>;
121
+ reduced: z.ZodOptional<z.ZodArray<z.ZodObject<{
122
+ name: z.ZodString;
123
+ pseudo: z.ZodOptional<z.ZodEnum<{
124
+ "::before": "::before";
125
+ "::after": "::after";
126
+ }>>;
127
+ duration: z.ZodNumber;
128
+ delay: z.ZodNumber;
129
+ iterations: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"infinite">]>;
130
+ direction: z.ZodEnum<{
131
+ reverse: "reverse";
132
+ normal: "normal";
133
+ alternate: "alternate";
134
+ "alternate-reverse": "alternate-reverse";
135
+ }>;
136
+ fill: z.ZodEnum<{
137
+ none: "none";
138
+ forwards: "forwards";
139
+ backwards: "backwards";
140
+ both: "both";
141
+ }>;
142
+ composite: z.ZodOptional<z.ZodEnum<{
143
+ add: "add";
144
+ accumulate: "accumulate";
145
+ }>>;
146
+ timeline: z.ZodOptional<z.ZodString>;
147
+ keyframes: z.ZodArray<z.ZodObject<{
148
+ offset: z.ZodNumber;
149
+ easing: z.ZodString;
150
+ values: z.ZodRecord<z.ZodString, z.ZodString>;
151
+ }, z.core.$strip>>;
152
+ }, z.core.$strip>>>;
153
+ transitions: z.ZodOptional<z.ZodObject<{
154
+ pressed: z.ZodOptional<z.ZodObject<{
155
+ in: z.ZodArray<z.ZodObject<{
156
+ property: z.ZodString;
157
+ duration: z.ZodNumber;
158
+ delay: z.ZodNumber;
159
+ easing: z.ZodString;
160
+ from: z.ZodString;
161
+ to: z.ZodString;
162
+ }, z.core.$strip>>;
163
+ out: z.ZodArray<z.ZodObject<{
164
+ property: z.ZodString;
165
+ duration: z.ZodNumber;
166
+ delay: z.ZodNumber;
167
+ easing: z.ZodString;
168
+ from: z.ZodString;
169
+ to: z.ZodString;
170
+ }, z.core.$strip>>;
171
+ reduced: z.ZodOptional<z.ZodObject<{
172
+ in: z.ZodArray<z.ZodObject<{
173
+ property: z.ZodString;
174
+ duration: z.ZodNumber;
175
+ delay: z.ZodNumber;
176
+ easing: z.ZodString;
177
+ from: z.ZodString;
178
+ to: z.ZodString;
179
+ }, z.core.$strip>>;
180
+ out: z.ZodArray<z.ZodObject<{
181
+ property: z.ZodString;
182
+ duration: z.ZodNumber;
183
+ delay: z.ZodNumber;
184
+ easing: z.ZodString;
185
+ from: z.ZodString;
186
+ to: z.ZodString;
187
+ }, z.core.$strip>>;
188
+ }, z.core.$strip>>;
189
+ }, z.core.$strip>>;
190
+ focused: z.ZodOptional<z.ZodObject<{
191
+ in: z.ZodArray<z.ZodObject<{
192
+ property: z.ZodString;
193
+ duration: z.ZodNumber;
194
+ delay: z.ZodNumber;
195
+ easing: z.ZodString;
196
+ from: z.ZodString;
197
+ to: z.ZodString;
198
+ }, z.core.$strip>>;
199
+ out: z.ZodArray<z.ZodObject<{
200
+ property: z.ZodString;
201
+ duration: z.ZodNumber;
202
+ delay: z.ZodNumber;
203
+ easing: z.ZodString;
204
+ from: z.ZodString;
205
+ to: z.ZodString;
206
+ }, z.core.$strip>>;
207
+ reduced: z.ZodOptional<z.ZodObject<{
208
+ in: z.ZodArray<z.ZodObject<{
209
+ property: z.ZodString;
210
+ duration: z.ZodNumber;
211
+ delay: z.ZodNumber;
212
+ easing: z.ZodString;
213
+ from: z.ZodString;
214
+ to: z.ZodString;
215
+ }, z.core.$strip>>;
216
+ out: z.ZodArray<z.ZodObject<{
217
+ property: z.ZodString;
218
+ duration: z.ZodNumber;
219
+ delay: z.ZodNumber;
220
+ easing: z.ZodString;
221
+ from: z.ZodString;
222
+ to: z.ZodString;
223
+ }, z.core.$strip>>;
224
+ }, z.core.$strip>>;
225
+ }, z.core.$strip>>;
226
+ }, z.core.$strip>>;
227
+ enter: z.ZodOptional<z.ZodArray<z.ZodObject<{
228
+ name: z.ZodString;
229
+ pseudo: z.ZodOptional<z.ZodEnum<{
230
+ "::before": "::before";
231
+ "::after": "::after";
232
+ }>>;
233
+ duration: z.ZodNumber;
234
+ delay: z.ZodNumber;
235
+ iterations: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"infinite">]>;
236
+ direction: z.ZodEnum<{
237
+ reverse: "reverse";
238
+ normal: "normal";
239
+ alternate: "alternate";
240
+ "alternate-reverse": "alternate-reverse";
241
+ }>;
242
+ fill: z.ZodEnum<{
243
+ none: "none";
244
+ forwards: "forwards";
245
+ backwards: "backwards";
246
+ both: "both";
247
+ }>;
248
+ composite: z.ZodOptional<z.ZodEnum<{
249
+ add: "add";
250
+ accumulate: "accumulate";
251
+ }>>;
252
+ timeline: z.ZodOptional<z.ZodString>;
253
+ keyframes: z.ZodArray<z.ZodObject<{
254
+ offset: z.ZodNumber;
255
+ easing: z.ZodString;
256
+ values: z.ZodRecord<z.ZodString, z.ZodString>;
257
+ }, z.core.$strip>>;
258
+ }, z.core.$strip>>>;
259
+ exit: z.ZodOptional<z.ZodArray<z.ZodObject<{
260
+ name: z.ZodString;
261
+ pseudo: z.ZodOptional<z.ZodEnum<{
262
+ "::before": "::before";
263
+ "::after": "::after";
264
+ }>>;
265
+ duration: z.ZodNumber;
266
+ delay: z.ZodNumber;
267
+ iterations: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"infinite">]>;
268
+ direction: z.ZodEnum<{
269
+ reverse: "reverse";
270
+ normal: "normal";
271
+ alternate: "alternate";
272
+ "alternate-reverse": "alternate-reverse";
273
+ }>;
274
+ fill: z.ZodEnum<{
275
+ none: "none";
276
+ forwards: "forwards";
277
+ backwards: "backwards";
278
+ both: "both";
279
+ }>;
280
+ composite: z.ZodOptional<z.ZodEnum<{
281
+ add: "add";
282
+ accumulate: "accumulate";
283
+ }>>;
284
+ timeline: z.ZodOptional<z.ZodString>;
285
+ keyframes: z.ZodArray<z.ZodObject<{
286
+ offset: z.ZodNumber;
287
+ easing: z.ZodString;
288
+ values: z.ZodRecord<z.ZodString, z.ZodString>;
289
+ }, z.core.$strip>>;
290
+ }, z.core.$strip>>>;
291
+ }, z.core.$strip>;
292
+ export type Motion = z.infer<typeof Motion>;
293
+ /**
294
+ * One laid-out DOM node. `display: contents` elements are not here — their
295
+ * children are spliced into the parent's `children` (the wrapper's attrs/id
296
+ * are lost). `visibility: hidden` nodes are present with their box.
297
+ */
298
+ export interface LayoutNode {
299
+ /** Stable node identity (`#id`, `data-markswift`, other identity attributes, or element-index path); absent for text nodes. */
300
+ id?: string;
301
+ /**
302
+ * Lower-case tag name, `#text`, or a pseudo-element: `::before` / `::after` /
303
+ * `::marker` (generated content materialised by the snapshot: styles, border
304
+ * box, and `#text` children (consecutive text parts merged) with the browser-resolved text — counters,
305
+ * quotes, list markers). `::before`/`::after`/`::marker` also get one `img` child per image the browser laid
306
+ * out from `content: url()` / `list-style-image` (`attrs.src`, its box), `#text` and `img` children in layout
307
+ * order. `::after` follows the element's real children.
308
+ */
309
+ tag: string;
310
+ /** Raw attributes. */
311
+ attrs: Record<string, string>;
312
+ /**
313
+ * `<img>` only: the source the browser loaded when it chose a `srcset`/`<picture>` candidate
314
+ * other than `src` (spelled as authored), or the inlined data URL. Consumers read
315
+ * `currentSrc ?? attrs["src"]`.
316
+ */
317
+ currentSrc?: string;
318
+ /** Whitelisted computed styles, resolved by the browser (cascade, vars, color-mix). */
319
+ styles: Record<string, string>;
320
+ /** Authored/cascaded size intent, independent of measured bounds; absent for text and pseudo-element nodes. */
321
+ preferredSize?: PreferredSize;
322
+ /** Box relative to the capture root, CSS px. */
323
+ bounds: Rect;
324
+ /** Laid-out text for `#text` nodes. */
325
+ text?: string;
326
+ /**
327
+ * Measured line boxes of a `#text` node (CDP `DOMSnapshot` `textBoxes`), document-relative,
328
+ * in layout order. `start`/`length` index the raw `text` string, so a box boundary is the
329
+ * browser's line division; `fidelity` emit reproduces it instead of letting CoreText re-wrap.
330
+ * Absent when the snapshot reported no boxes (empty or whitespace-only nodes).
331
+ */
332
+ lines?: Array<{
333
+ bounds: Rect;
334
+ start: number;
335
+ length: number;
336
+ }>;
337
+ /** Global paint order index (stacking), when available. */
338
+ paint?: number;
339
+ /** Paint the element shows in an interaction state: computed values of whitelisted paint properties that differ from rest (`:hover`+`:active` = pressed, `:focus`+`:focus-visible` = focused), captured by forcing the state over CDP. `open`: paint while the layer this node triggers (or sits inside the trigger of) is open — PAINT_KEYS that differ from rest. */
340
+ states?: {
341
+ pressed?: Record<string, string>;
342
+ focused?: Record<string, string>;
343
+ open?: Record<string, string>;
344
+ };
345
+ /** Indices into `LayoutDoc.conditions` whose inner rules match this element (stamped at capture). Absent when none. */
346
+ conditional?: number[];
347
+ /** Pseudo-element styles DOMSnapshot does not report, read with getComputedStyle(el, "::<name>"). `placeholder`: inputs and textareas with a `placeholder` attribute (color, -webkit-text-fill-color, opacity, font-style, font-weight). `backdrop`: `::backdrop` of a top-layer element (`overlay: auto`) — background-color, background-image, opacity, filter; its box is the viewport. */
348
+ pseudoStyles?: {
349
+ placeholder?: Record<string, string>;
350
+ backdrop?: Record<string, string>;
351
+ };
352
+ /** CSS animations and state transitions read from Chrome's Web Animations objects before settle (browser/motion.ts). */
353
+ motion?: Motion;
354
+ children: LayoutNode[];
355
+ }
356
+ export declare const LayoutNode: z.ZodType<LayoutNode>;
357
+ /**
358
+ * One `@font-face` rule the captured page declared, as the browser resolved it. Collected at
359
+ * capture time (`browser/fonts.ts`): the CSS rules give family, axis ranges and `src`, and
360
+ * `document.fonts` says which of them actually loaded. Target-agnostic — a webfont is an input
361
+ * fact, not a SwiftUI decision; `fonts/package.ts` turns these into bundled font files.
362
+ */
363
+ export declare const FontFace: z.ZodObject<{
364
+ family: z.ZodString;
365
+ weight: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
366
+ style: z.ZodEnum<{
367
+ normal: "normal";
368
+ italic: "italic";
369
+ oblique: "oblique";
370
+ }>;
371
+ unicodeRange: z.ZodOptional<z.ZodString>;
372
+ src: z.ZodArray<z.ZodObject<{
373
+ url: z.ZodString;
374
+ format: z.ZodOptional<z.ZodString>;
375
+ file: z.ZodOptional<z.ZodString>;
376
+ }, z.core.$strip>>;
377
+ loaded: z.ZodBoolean;
378
+ }, z.core.$strip>;
379
+ export type FontFace = z.infer<typeof FontFace>;
380
+ export declare const Combo: z.ZodObject<{
381
+ screen: z.ZodString;
382
+ theme: z.ZodEnum<{
383
+ light: "light";
384
+ dark: "dark";
385
+ }>;
386
+ }, z.core.$strip>;
387
+ export type Combo = z.infer<typeof Combo>;
388
+ export type Theme = Combo["theme"];
389
+ /** Version of the saved-capture format. Bump it with any STYLE_WHITELIST or schema change, or a change in what a
390
+ * captured value means — once per release cycle: while the version is unreleased (see
391
+ * tests/architecture/layout-doc.test.ts, which pins the schema to it) later changes re-pin its fingerprint. */
392
+ export declare const LAYOUT_DOC_VERSION = 4;
393
+ /** Capture marks elements an author rule styles through :valid/:invalid (or :user-*); analysis reports them. */
394
+ export declare const VALIDATION_MARK = "data-markswift-validation";
395
+ /** Capture stamps the indices (space-separated) of the `conditions` whose inner rules match an element; moved to `conditional`. */
396
+ export declare const CONDITIONAL_MARK = "data-markswift-conditional";
397
+ /** Capture stamps a serial on the query container of a `@container` condition; resolved to its node id. */
398
+ export declare const CONTAINER_MARK = "data-markswift-container";
399
+ /** A size `@media`/`@container` condition whose rules hit captured elements; `matches` at this capture's viewport;
400
+ * `container` is the query container's node id. Order is capture-local (`LayoutNode.conditional` indexes it). */
401
+ export declare const LayoutCondition: z.ZodObject<{
402
+ kind: z.ZodEnum<{
403
+ media: "media";
404
+ container: "container";
405
+ }>;
406
+ query: z.ZodString;
407
+ matches: z.ZodBoolean;
408
+ container: z.ZodOptional<z.ZodString>;
409
+ }, z.core.$strip>;
410
+ export type LayoutCondition = z.infer<typeof LayoutCondition>;
411
+ /** What a trigger shows when activated, captured in a fresh page (`browser/layers.ts`). */
412
+ export declare const Layer: z.ZodObject<{
413
+ id: z.ZodString;
414
+ trigger: z.ZodString;
415
+ activation: z.ZodEnum<{
416
+ click: "click";
417
+ hover: "hover";
418
+ contextmenu: "contextmenu";
419
+ }>;
420
+ relation: z.ZodEnum<{
421
+ "aria-controls": "aria-controls";
422
+ "aria-describedby": "aria-describedby";
423
+ popovertarget: "popovertarget";
424
+ commandfor: "commandfor";
425
+ interestfor: "interestfor";
426
+ details: "details";
427
+ "dom-diff": "dom-diff";
428
+ }>;
429
+ modal: z.ZodBoolean;
430
+ placement: z.ZodEnum<{
431
+ viewport: "viewport";
432
+ anchored: "anchored";
433
+ inflow: "inflow";
434
+ }>;
435
+ parent: z.ZodOptional<z.ZodString>;
436
+ index: z.ZodOptional<z.ZodNumber>;
437
+ nodes: z.ZodArray<z.ZodType<LayoutNode, unknown, z.core.$ZodTypeInternals<LayoutNode, unknown>>>;
438
+ dismiss: z.ZodObject<{
439
+ escape: z.ZodBoolean;
440
+ outside: z.ZodBoolean;
441
+ buttons: z.ZodArray<z.ZodString>;
442
+ }, z.core.$strip>;
443
+ }, z.core.$strip>;
444
+ export type Layer = z.infer<typeof Layer>;
445
+ export declare const LayoutDoc: z.ZodObject<{
446
+ version: z.ZodLiteral<4>;
447
+ source: z.ZodString;
448
+ combo: z.ZodObject<{
449
+ screen: z.ZodString;
450
+ theme: z.ZodEnum<{
451
+ light: "light";
452
+ dark: "dark";
453
+ }>;
454
+ }, z.core.$strip>;
455
+ size: z.ZodObject<{
456
+ w: z.ZodNumber;
457
+ h: z.ZodNumber;
458
+ }, z.core.$strip>;
459
+ viewport: z.ZodObject<{
460
+ x: z.ZodNumber;
461
+ y: z.ZodNumber;
462
+ w: z.ZodNumber;
463
+ h: z.ZodNumber;
464
+ }, z.core.$strip>;
465
+ conditions: z.ZodDefault<z.ZodArray<z.ZodObject<{
466
+ kind: z.ZodEnum<{
467
+ media: "media";
468
+ container: "container";
469
+ }>;
470
+ query: z.ZodString;
471
+ matches: z.ZodBoolean;
472
+ container: z.ZodOptional<z.ZodString>;
473
+ }, z.core.$strip>>>;
474
+ dpr: z.ZodNumber;
475
+ canvas: z.ZodDefault<z.ZodString>;
476
+ fonts: z.ZodArray<z.ZodObject<{
477
+ family: z.ZodString;
478
+ weight: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
479
+ style: z.ZodEnum<{
480
+ normal: "normal";
481
+ italic: "italic";
482
+ oblique: "oblique";
483
+ }>;
484
+ unicodeRange: z.ZodOptional<z.ZodString>;
485
+ src: z.ZodArray<z.ZodObject<{
486
+ url: z.ZodString;
487
+ format: z.ZodOptional<z.ZodString>;
488
+ file: z.ZodOptional<z.ZodString>;
489
+ }, z.core.$strip>>;
490
+ loaded: z.ZodBoolean;
491
+ }, z.core.$strip>>;
492
+ root: z.ZodType<LayoutNode, unknown, z.core.$ZodTypeInternals<LayoutNode, unknown>>;
493
+ layers: z.ZodOptional<z.ZodArray<z.ZodObject<{
494
+ id: z.ZodString;
495
+ trigger: z.ZodString;
496
+ activation: z.ZodEnum<{
497
+ click: "click";
498
+ hover: "hover";
499
+ contextmenu: "contextmenu";
500
+ }>;
501
+ relation: z.ZodEnum<{
502
+ "aria-controls": "aria-controls";
503
+ "aria-describedby": "aria-describedby";
504
+ popovertarget: "popovertarget";
505
+ commandfor: "commandfor";
506
+ interestfor: "interestfor";
507
+ details: "details";
508
+ "dom-diff": "dom-diff";
509
+ }>;
510
+ modal: z.ZodBoolean;
511
+ placement: z.ZodEnum<{
512
+ viewport: "viewport";
513
+ anchored: "anchored";
514
+ inflow: "inflow";
515
+ }>;
516
+ parent: z.ZodOptional<z.ZodString>;
517
+ index: z.ZodOptional<z.ZodNumber>;
518
+ nodes: z.ZodArray<z.ZodType<LayoutNode, unknown, z.core.$ZodTypeInternals<LayoutNode, unknown>>>;
519
+ dismiss: z.ZodObject<{
520
+ escape: z.ZodBoolean;
521
+ outside: z.ZodBoolean;
522
+ buttons: z.ZodArray<z.ZodString>;
523
+ }, z.core.$strip>;
524
+ }, z.core.$strip>>>;
525
+ }, z.core.$strip>;
526
+ export type LayoutDoc = z.infer<typeof LayoutDoc>;
527
+ /** Computed-style whitelist requested from DOMSnapshot. Keep sorted; order is the styles[] index. */
528
+ export declare const STYLE_WHITELIST: readonly ["accent-color", "align-content", "align-items", "align-self", "animation-name", "appearance", "aspect-ratio", "backdrop-filter", "background-blend-mode", "background-clip", "background-color", "background-image", "background-position", "background-repeat", "background-size", "border-bottom-color", "border-bottom-left-radius", "border-bottom-right-radius", "border-bottom-style", "border-bottom-width", "border-collapse", "border-left-color", "border-left-style", "border-left-width", "border-right-color", "border-right-style", "border-right-width", "border-spacing", "border-top-color", "border-top-left-radius", "border-top-right-radius", "border-top-style", "border-top-width", "bottom", "box-shadow", "box-sizing", "clear", "clip-path", "color", "color-scheme", "column-gap", "container-name", "container-type", "content", "direction", "display", "empty-cells", "fill", "fill-opacity", "fill-rule", "filter", "flex-basis", "flex-direction", "flex-grow", "flex-shrink", "flex-wrap", "float", "font-family", "font-feature-settings", "font-optical-sizing", "font-size", "font-stretch", "font-style", "font-variant-caps", "font-variant-numeric", "font-variation-settings", "font-weight", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows", "grid-column-end", "grid-column-start", "grid-row-end", "grid-row-start", "grid-template-areas", "grid-template-columns", "grid-template-rows", "height", "hyphens", "justify-content", "justify-items", "justify-self", "left", "letter-spacing", "line-height", "list-style-image", "list-style-type", "margin-bottom", "margin-left", "margin-right", "margin-top", "mask-image", "mask-position", "mask-repeat", "mask-size", "max-height", "max-width", "min-height", "min-width", "mix-blend-mode", "object-fit", "object-position", "opacity", "order", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow-wrap", "overflow-x", "overflow-y", "overlay", "padding-bottom", "padding-left", "padding-right", "padding-top", "pointer-events", "position", "right", "rotate", "row-gap", "scale", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-opacity", "stroke-width", "tab-size", "table-layout", "text-align", "text-decoration-color", "text-decoration-line", "text-decoration-style", "text-decoration-thickness", "text-indent", "text-overflow", "text-shadow", "text-transform", "text-underline-offset", "text-wrap-mode", "text-wrap-style", "top", "transform", "transform-origin", "translate", "unicode-bidi", "vertical-align", "visibility", "-webkit-line-clamp", "-webkit-text-decorations-in-effect", "-webkit-text-fill-color", "white-space", "white-space-collapse", "width", "word-break", "word-spacing", "writing-mode"];