@oyerinde/caliper 0.1.4 → 0.2.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 +20 -0
- package/README.md +134 -25
- package/dist/bridge.cjs +50 -0
- package/dist/bridge.d.cts +1649 -0
- package/dist/bridge.d.ts +1649 -0
- package/dist/bridge.js +1 -0
- package/dist/bridge.server.cjs +34 -0
- package/dist/bridge.server.js +31 -0
- package/dist/chunk-3W2YKDGV.cjs +18631 -0
- package/dist/chunk-ACV6FK43.js +18619 -0
- package/dist/chunk-OSQHATBH.cjs +5891 -0
- package/dist/chunk-XYBNY4BT.js +5885 -0
- package/dist/index.cjs +24 -5131
- package/dist/index.d.cts +975 -18
- package/dist/index.d.ts +975 -2
- package/dist/index.global.js +154 -4878
- package/dist/index.global.js.map +1 -0
- package/dist/index.global.min.js +327 -0
- package/dist/index.global.min.js.map +1 -0
- package/dist/index.js +1 -5128
- package/dist/index.server.cjs +19 -8
- package/dist/index.server.js +19 -9
- package/dist/mcp.cjs +2305 -0
- package/dist/mcp.js +2303 -0
- package/dist/preset.cjs +44 -0
- package/dist/preset.d.cts +964 -0
- package/dist/preset.d.ts +964 -0
- package/dist/preset.js +31 -0
- package/dist/preset.server.cjs +43 -0
- package/dist/preset.server.js +39 -0
- package/dist/version.json +2 -2
- package/package.json +46 -8
package/dist/bridge.d.ts
ADDED
|
@@ -0,0 +1,1649 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import * as z_2 from 'zod/v4';
|
|
3
|
+
|
|
4
|
+
declare interface AgentBridgeConfig {
|
|
5
|
+
/** Enable the agentic bridge for AI integration (default: false) */
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
/** WebSocket port for the MCP relay (default: 9876) */
|
|
8
|
+
wsPort?: number;
|
|
9
|
+
/** Callback for agent state changes */
|
|
10
|
+
onStateChange?: (state: CaliperAgentState) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare interface CalculatorIntegration {
|
|
14
|
+
getState: () => CalculatorState;
|
|
15
|
+
open: (baseValue: number) => void;
|
|
16
|
+
handleInput: (key: string) => void;
|
|
17
|
+
handleBackspace: () => void;
|
|
18
|
+
handleDelete: () => void;
|
|
19
|
+
handleEnter: () => void;
|
|
20
|
+
close: () => void;
|
|
21
|
+
syncValue: (value: number) => void;
|
|
22
|
+
getResult: () => number | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Calculator state machine
|
|
27
|
+
*/
|
|
28
|
+
declare type CalculatorOperation = "+" | "-" | "*" | "/";
|
|
29
|
+
|
|
30
|
+
declare interface CalculatorState {
|
|
31
|
+
baseValue: number;
|
|
32
|
+
operation: CalculatorOperation | null;
|
|
33
|
+
inputValue: string;
|
|
34
|
+
result: number | null;
|
|
35
|
+
isActive: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare const CALIPER_METHODS: {
|
|
39
|
+
readonly SELECT: "CALIPER_SELECT";
|
|
40
|
+
readonly MEASURE: "CALIPER_MEASURE";
|
|
41
|
+
readonly INSPECT: "CALIPER_INSPECT";
|
|
42
|
+
readonly FREEZE: "CALIPER_FREEZE";
|
|
43
|
+
readonly CLEAR: "CALIPER_CLEAR";
|
|
44
|
+
readonly WALK_DOM: "CALIPER_WALK_DOM";
|
|
45
|
+
readonly WALK_AND_MEASURE: "CALIPER_WALK_AND_MEASURE";
|
|
46
|
+
readonly GET_CONTEXT: "CALIPER_GET_CONTEXT";
|
|
47
|
+
readonly REGISTER_TAB: "caliper/registerTab";
|
|
48
|
+
readonly TAB_UPDATE: "caliper/tabUpdate";
|
|
49
|
+
readonly STATE_UPDATE: "caliper/stateUpdate";
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export declare type CaliperActionResult = z.infer<typeof CaliperActionResultSchema>;
|
|
53
|
+
|
|
54
|
+
export declare const CaliperActionResultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
55
|
+
success: z.ZodLiteral<true>;
|
|
56
|
+
method: z.ZodLiteral<"CALIPER_SELECT">;
|
|
57
|
+
selector: z.ZodString;
|
|
58
|
+
selection: z.ZodObject<{
|
|
59
|
+
rect: z.ZodNullable<z.ZodObject<{
|
|
60
|
+
top: z.ZodNumber;
|
|
61
|
+
right: z.ZodNumber;
|
|
62
|
+
bottom: z.ZodNumber;
|
|
63
|
+
left: z.ZodNumber;
|
|
64
|
+
width: z.ZodNumber;
|
|
65
|
+
height: z.ZodNumber;
|
|
66
|
+
x: z.ZodNumber;
|
|
67
|
+
y: z.ZodNumber;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
scrollHierarchy: z.ZodArray<z.ZodObject<{
|
|
70
|
+
initialScrollTop: z.ZodNumber;
|
|
71
|
+
initialScrollLeft: z.ZodNumber;
|
|
72
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
73
|
+
top: z.ZodNumber;
|
|
74
|
+
right: z.ZodNumber;
|
|
75
|
+
bottom: z.ZodNumber;
|
|
76
|
+
left: z.ZodNumber;
|
|
77
|
+
width: z.ZodNumber;
|
|
78
|
+
height: z.ZodNumber;
|
|
79
|
+
x: z.ZodNumber;
|
|
80
|
+
y: z.ZodNumber;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
absoluteDepth: z.ZodNumber;
|
|
83
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
}, z.core.$strip>>;
|
|
85
|
+
position: z.ZodEnum<{
|
|
86
|
+
static: "static";
|
|
87
|
+
relative: "relative";
|
|
88
|
+
absolute: "absolute";
|
|
89
|
+
fixed: "fixed";
|
|
90
|
+
sticky: "sticky";
|
|
91
|
+
}>;
|
|
92
|
+
stickyConfig: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
94
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
95
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
96
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
97
|
+
naturalTop: z.ZodNumber;
|
|
98
|
+
naturalLeft: z.ZodNumber;
|
|
99
|
+
containerWidth: z.ZodNumber;
|
|
100
|
+
containerHeight: z.ZodNumber;
|
|
101
|
+
elementWidth: z.ZodNumber;
|
|
102
|
+
elementHeight: z.ZodNumber;
|
|
103
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
initialWindowX: z.ZodNumber;
|
|
106
|
+
initialWindowY: z.ZodNumber;
|
|
107
|
+
depth: z.ZodNumber;
|
|
108
|
+
hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
timestamp: z.ZodNumber;
|
|
111
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
112
|
+
success: z.ZodLiteral<true>;
|
|
113
|
+
method: z.ZodLiteral<"CALIPER_MEASURE">;
|
|
114
|
+
selector: z.ZodString;
|
|
115
|
+
measurement: z.ZodObject<{
|
|
116
|
+
context: z.ZodNullable<z.ZodEnum<{
|
|
117
|
+
parent: "parent";
|
|
118
|
+
child: "child";
|
|
119
|
+
sibling: "sibling";
|
|
120
|
+
}>>;
|
|
121
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
122
|
+
type: z.ZodEnum<{
|
|
123
|
+
top: "top";
|
|
124
|
+
right: "right";
|
|
125
|
+
bottom: "bottom";
|
|
126
|
+
left: "left";
|
|
127
|
+
distance: "distance";
|
|
128
|
+
}>;
|
|
129
|
+
value: z.ZodNumber;
|
|
130
|
+
start: z.ZodObject<{
|
|
131
|
+
x: z.ZodNumber;
|
|
132
|
+
y: z.ZodNumber;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
end: z.ZodObject<{
|
|
135
|
+
x: z.ZodNumber;
|
|
136
|
+
y: z.ZodNumber;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
startSync: z.ZodOptional<z.ZodEnum<{
|
|
139
|
+
primary: "primary";
|
|
140
|
+
secondary: "secondary";
|
|
141
|
+
}>>;
|
|
142
|
+
endSync: z.ZodOptional<z.ZodEnum<{
|
|
143
|
+
primary: "primary";
|
|
144
|
+
secondary: "secondary";
|
|
145
|
+
}>>;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
primary: z.ZodObject<{
|
|
148
|
+
top: z.ZodNumber;
|
|
149
|
+
right: z.ZodNumber;
|
|
150
|
+
bottom: z.ZodNumber;
|
|
151
|
+
left: z.ZodNumber;
|
|
152
|
+
width: z.ZodNumber;
|
|
153
|
+
height: z.ZodNumber;
|
|
154
|
+
x: z.ZodNumber;
|
|
155
|
+
y: z.ZodNumber;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
secondary: z.ZodNullable<z.ZodObject<{
|
|
158
|
+
top: z.ZodNumber;
|
|
159
|
+
right: z.ZodNumber;
|
|
160
|
+
bottom: z.ZodNumber;
|
|
161
|
+
left: z.ZodNumber;
|
|
162
|
+
width: z.ZodNumber;
|
|
163
|
+
height: z.ZodNumber;
|
|
164
|
+
x: z.ZodNumber;
|
|
165
|
+
y: z.ZodNumber;
|
|
166
|
+
}, z.core.$strip>>;
|
|
167
|
+
timestamp: z.ZodNumber;
|
|
168
|
+
primaryHierarchy: z.ZodArray<z.ZodObject<{
|
|
169
|
+
initialScrollTop: z.ZodNumber;
|
|
170
|
+
initialScrollLeft: z.ZodNumber;
|
|
171
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
172
|
+
top: z.ZodNumber;
|
|
173
|
+
right: z.ZodNumber;
|
|
174
|
+
bottom: z.ZodNumber;
|
|
175
|
+
left: z.ZodNumber;
|
|
176
|
+
width: z.ZodNumber;
|
|
177
|
+
height: z.ZodNumber;
|
|
178
|
+
x: z.ZodNumber;
|
|
179
|
+
y: z.ZodNumber;
|
|
180
|
+
}, z.core.$strip>>;
|
|
181
|
+
absoluteDepth: z.ZodNumber;
|
|
182
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
secondaryHierarchy: z.ZodArray<z.ZodObject<{
|
|
185
|
+
initialScrollTop: z.ZodNumber;
|
|
186
|
+
initialScrollLeft: z.ZodNumber;
|
|
187
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
188
|
+
top: z.ZodNumber;
|
|
189
|
+
right: z.ZodNumber;
|
|
190
|
+
bottom: z.ZodNumber;
|
|
191
|
+
left: z.ZodNumber;
|
|
192
|
+
width: z.ZodNumber;
|
|
193
|
+
height: z.ZodNumber;
|
|
194
|
+
x: z.ZodNumber;
|
|
195
|
+
y: z.ZodNumber;
|
|
196
|
+
}, z.core.$strip>>;
|
|
197
|
+
absoluteDepth: z.ZodNumber;
|
|
198
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
199
|
+
}, z.core.$strip>>;
|
|
200
|
+
primaryPosition: z.ZodEnum<{
|
|
201
|
+
static: "static";
|
|
202
|
+
relative: "relative";
|
|
203
|
+
absolute: "absolute";
|
|
204
|
+
fixed: "fixed";
|
|
205
|
+
sticky: "sticky";
|
|
206
|
+
}>;
|
|
207
|
+
secondaryPosition: z.ZodEnum<{
|
|
208
|
+
static: "static";
|
|
209
|
+
relative: "relative";
|
|
210
|
+
absolute: "absolute";
|
|
211
|
+
fixed: "fixed";
|
|
212
|
+
sticky: "sticky";
|
|
213
|
+
}>;
|
|
214
|
+
primaryWinX: z.ZodNumber;
|
|
215
|
+
primaryWinY: z.ZodNumber;
|
|
216
|
+
secondaryWinX: z.ZodNumber;
|
|
217
|
+
secondaryWinY: z.ZodNumber;
|
|
218
|
+
primarySticky: z.ZodOptional<z.ZodObject<{
|
|
219
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
220
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
221
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
222
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
223
|
+
naturalTop: z.ZodNumber;
|
|
224
|
+
naturalLeft: z.ZodNumber;
|
|
225
|
+
containerWidth: z.ZodNumber;
|
|
226
|
+
containerHeight: z.ZodNumber;
|
|
227
|
+
elementWidth: z.ZodNumber;
|
|
228
|
+
elementHeight: z.ZodNumber;
|
|
229
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
230
|
+
}, z.core.$strip>>;
|
|
231
|
+
secondarySticky: z.ZodOptional<z.ZodObject<{
|
|
232
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
233
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
234
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
235
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
236
|
+
naturalTop: z.ZodNumber;
|
|
237
|
+
naturalLeft: z.ZodNumber;
|
|
238
|
+
containerWidth: z.ZodNumber;
|
|
239
|
+
containerHeight: z.ZodNumber;
|
|
240
|
+
elementWidth: z.ZodNumber;
|
|
241
|
+
elementHeight: z.ZodNumber;
|
|
242
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
243
|
+
}, z.core.$strip>>;
|
|
244
|
+
primaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
245
|
+
secondaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
246
|
+
}, z.core.$strip>;
|
|
247
|
+
timestamp: z.ZodNumber;
|
|
248
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
249
|
+
success: z.ZodLiteral<true>;
|
|
250
|
+
method: z.ZodLiteral<"CALIPER_INSPECT">;
|
|
251
|
+
selector: z.ZodString;
|
|
252
|
+
distances: z.ZodObject<{
|
|
253
|
+
top: z.ZodNumber;
|
|
254
|
+
right: z.ZodNumber;
|
|
255
|
+
bottom: z.ZodNumber;
|
|
256
|
+
left: z.ZodNumber;
|
|
257
|
+
horizontal: z.ZodNumber;
|
|
258
|
+
vertical: z.ZodNumber;
|
|
259
|
+
}, z.core.$strip>;
|
|
260
|
+
computedStyles: z.ZodObject<{
|
|
261
|
+
display: z.ZodOptional<z.ZodString>;
|
|
262
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
263
|
+
position: z.ZodOptional<z.ZodString>;
|
|
264
|
+
boxSizing: z.ZodOptional<z.ZodString>;
|
|
265
|
+
padding: z.ZodOptional<z.ZodObject<{
|
|
266
|
+
top: z.ZodNumber;
|
|
267
|
+
right: z.ZodNumber;
|
|
268
|
+
bottom: z.ZodNumber;
|
|
269
|
+
left: z.ZodNumber;
|
|
270
|
+
}, z.core.$strip>>;
|
|
271
|
+
margin: z.ZodOptional<z.ZodObject<{
|
|
272
|
+
top: z.ZodNumber;
|
|
273
|
+
right: z.ZodNumber;
|
|
274
|
+
bottom: z.ZodNumber;
|
|
275
|
+
left: z.ZodNumber;
|
|
276
|
+
}, z.core.$strip>>;
|
|
277
|
+
border: z.ZodOptional<z.ZodObject<{
|
|
278
|
+
top: z.ZodNumber;
|
|
279
|
+
right: z.ZodNumber;
|
|
280
|
+
bottom: z.ZodNumber;
|
|
281
|
+
left: z.ZodNumber;
|
|
282
|
+
}, z.core.$strip>>;
|
|
283
|
+
gap: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
284
|
+
flexDirection: z.ZodOptional<z.ZodString>;
|
|
285
|
+
justifyContent: z.ZodOptional<z.ZodString>;
|
|
286
|
+
alignItems: z.ZodOptional<z.ZodString>;
|
|
287
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
288
|
+
fontWeight: z.ZodOptional<z.ZodString>;
|
|
289
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
290
|
+
lineHeight: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
291
|
+
letterSpacing: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
292
|
+
color: z.ZodOptional<z.ZodString>;
|
|
293
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
294
|
+
borderColor: z.ZodOptional<z.ZodString>;
|
|
295
|
+
borderRadius: z.ZodOptional<z.ZodString>;
|
|
296
|
+
boxShadow: z.ZodOptional<z.ZodString>;
|
|
297
|
+
opacity: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
298
|
+
outline: z.ZodOptional<z.ZodString>;
|
|
299
|
+
outlineColor: z.ZodOptional<z.ZodString>;
|
|
300
|
+
zIndex: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
301
|
+
overflow: z.ZodOptional<z.ZodString>;
|
|
302
|
+
overflowX: z.ZodOptional<z.ZodString>;
|
|
303
|
+
overflowY: z.ZodOptional<z.ZodString>;
|
|
304
|
+
contentVisibility: z.ZodOptional<z.ZodString>;
|
|
305
|
+
}, z.core.$strip>;
|
|
306
|
+
selection: z.ZodObject<{
|
|
307
|
+
rect: z.ZodNullable<z.ZodObject<{
|
|
308
|
+
top: z.ZodNumber;
|
|
309
|
+
right: z.ZodNumber;
|
|
310
|
+
bottom: z.ZodNumber;
|
|
311
|
+
left: z.ZodNumber;
|
|
312
|
+
width: z.ZodNumber;
|
|
313
|
+
height: z.ZodNumber;
|
|
314
|
+
x: z.ZodNumber;
|
|
315
|
+
y: z.ZodNumber;
|
|
316
|
+
}, z.core.$strip>>;
|
|
317
|
+
scrollHierarchy: z.ZodArray<z.ZodObject<{
|
|
318
|
+
initialScrollTop: z.ZodNumber;
|
|
319
|
+
initialScrollLeft: z.ZodNumber;
|
|
320
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
321
|
+
top: z.ZodNumber;
|
|
322
|
+
right: z.ZodNumber;
|
|
323
|
+
bottom: z.ZodNumber;
|
|
324
|
+
left: z.ZodNumber;
|
|
325
|
+
width: z.ZodNumber;
|
|
326
|
+
height: z.ZodNumber;
|
|
327
|
+
x: z.ZodNumber;
|
|
328
|
+
y: z.ZodNumber;
|
|
329
|
+
}, z.core.$strip>>;
|
|
330
|
+
absoluteDepth: z.ZodNumber;
|
|
331
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
332
|
+
}, z.core.$strip>>;
|
|
333
|
+
position: z.ZodEnum<{
|
|
334
|
+
static: "static";
|
|
335
|
+
relative: "relative";
|
|
336
|
+
absolute: "absolute";
|
|
337
|
+
fixed: "fixed";
|
|
338
|
+
sticky: "sticky";
|
|
339
|
+
}>;
|
|
340
|
+
stickyConfig: z.ZodOptional<z.ZodObject<{
|
|
341
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
342
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
343
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
344
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
345
|
+
naturalTop: z.ZodNumber;
|
|
346
|
+
naturalLeft: z.ZodNumber;
|
|
347
|
+
containerWidth: z.ZodNumber;
|
|
348
|
+
containerHeight: z.ZodNumber;
|
|
349
|
+
elementWidth: z.ZodNumber;
|
|
350
|
+
elementHeight: z.ZodNumber;
|
|
351
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
352
|
+
}, z.core.$strip>>;
|
|
353
|
+
initialWindowX: z.ZodNumber;
|
|
354
|
+
initialWindowY: z.ZodNumber;
|
|
355
|
+
depth: z.ZodNumber;
|
|
356
|
+
hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
immediateChildCount: z.ZodOptional<z.ZodNumber>;
|
|
359
|
+
descendantCount: z.ZodOptional<z.ZodNumber>;
|
|
360
|
+
descendantsTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
361
|
+
sourceHints: z.ZodOptional<z.ZodObject<{
|
|
362
|
+
stableAnchors: z.ZodArray<z.ZodString>;
|
|
363
|
+
suggestedGrep: z.ZodOptional<z.ZodString>;
|
|
364
|
+
textContent: z.ZodOptional<z.ZodString>;
|
|
365
|
+
accessibleName: z.ZodOptional<z.ZodString>;
|
|
366
|
+
unstableClasses: z.ZodArray<z.ZodString>;
|
|
367
|
+
tagName: z.ZodString;
|
|
368
|
+
}, z.core.$strip>>;
|
|
369
|
+
timestamp: z.ZodNumber;
|
|
370
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
371
|
+
success: z.ZodLiteral<true>;
|
|
372
|
+
method: z.ZodLiteral<"CALIPER_FREEZE">;
|
|
373
|
+
timestamp: z.ZodNumber;
|
|
374
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
375
|
+
success: z.ZodLiteral<true>;
|
|
376
|
+
method: z.ZodLiteral<"CALIPER_CLEAR">;
|
|
377
|
+
timestamp: z.ZodNumber;
|
|
378
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
379
|
+
success: z.ZodLiteral<true>;
|
|
380
|
+
method: z.ZodLiteral<"CALIPER_WALK_DOM">;
|
|
381
|
+
selector: z.ZodString;
|
|
382
|
+
domContext: z.ZodObject<{
|
|
383
|
+
element: z.ZodObject<{
|
|
384
|
+
tagName: z.ZodString;
|
|
385
|
+
id: z.ZodOptional<z.ZodString>;
|
|
386
|
+
classList: z.ZodArray<z.ZodString>;
|
|
387
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
388
|
+
text: z.ZodOptional<z.ZodString>;
|
|
389
|
+
}, z.core.$strip>;
|
|
390
|
+
parent: z.ZodNullable<z.ZodObject<{
|
|
391
|
+
tagName: z.ZodString;
|
|
392
|
+
id: z.ZodOptional<z.ZodString>;
|
|
393
|
+
classList: z.ZodArray<z.ZodString>;
|
|
394
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
395
|
+
text: z.ZodOptional<z.ZodString>;
|
|
396
|
+
}, z.core.$strip>>;
|
|
397
|
+
children: z.ZodArray<z.ZodObject<{
|
|
398
|
+
tagName: z.ZodString;
|
|
399
|
+
id: z.ZodOptional<z.ZodString>;
|
|
400
|
+
classList: z.ZodArray<z.ZodString>;
|
|
401
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
402
|
+
text: z.ZodOptional<z.ZodString>;
|
|
403
|
+
}, z.core.$strip>>;
|
|
404
|
+
}, z.core.$strip>;
|
|
405
|
+
timestamp: z.ZodNumber;
|
|
406
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
407
|
+
success: z.ZodLiteral<true>;
|
|
408
|
+
method: z.ZodLiteral<"CALIPER_WALK_AND_MEASURE">;
|
|
409
|
+
selector: z.ZodString;
|
|
410
|
+
walkResult: z.ZodObject<{
|
|
411
|
+
root: z.ZodOptional<z.ZodType<CaliperNode, unknown, z.core.$ZodTypeInternals<CaliperNode, unknown>>>;
|
|
412
|
+
nodeCount: z.ZodNumber;
|
|
413
|
+
maxDepthReached: z.ZodNumber;
|
|
414
|
+
walkDurationMs: z.ZodNumber;
|
|
415
|
+
hasMore: z.ZodOptional<z.ZodBoolean>;
|
|
416
|
+
batchInstructions: z.ZodOptional<z.ZodString>;
|
|
417
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
418
|
+
}, z.core.$strip>;
|
|
419
|
+
timestamp: z.ZodNumber;
|
|
420
|
+
binaryPayload: z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
421
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
422
|
+
success: z.ZodLiteral<true>;
|
|
423
|
+
method: z.ZodLiteral<"CALIPER_GET_CONTEXT">;
|
|
424
|
+
context: z.ZodObject<{
|
|
425
|
+
rootFontSize: z.ZodNumber;
|
|
426
|
+
devicePixelRatio: z.ZodNumber;
|
|
427
|
+
viewportWidth: z.ZodNumber;
|
|
428
|
+
viewportHeight: z.ZodNumber;
|
|
429
|
+
visualViewportWidth: z.ZodOptional<z.ZodNumber>;
|
|
430
|
+
visualViewportHeight: z.ZodOptional<z.ZodNumber>;
|
|
431
|
+
scrollX: z.ZodNumber;
|
|
432
|
+
scrollY: z.ZodNumber;
|
|
433
|
+
documentWidth: z.ZodNumber;
|
|
434
|
+
documentHeight: z.ZodNumber;
|
|
435
|
+
orientation: z.ZodEnum<{
|
|
436
|
+
portrait: "portrait";
|
|
437
|
+
landscape: "landscape";
|
|
438
|
+
}>;
|
|
439
|
+
preferences: z.ZodObject<{
|
|
440
|
+
colorScheme: z.ZodEnum<{
|
|
441
|
+
light: "light";
|
|
442
|
+
dark: "dark";
|
|
443
|
+
"no-preference": "no-preference";
|
|
444
|
+
}>;
|
|
445
|
+
reducedMotion: z.ZodBoolean;
|
|
446
|
+
}, z.core.$strip>;
|
|
447
|
+
}, z.core.$strip>;
|
|
448
|
+
timestamp: z.ZodNumber;
|
|
449
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
450
|
+
success: z.ZodLiteral<false>;
|
|
451
|
+
method: z.ZodEnum<{
|
|
452
|
+
CALIPER_SELECT: "CALIPER_SELECT";
|
|
453
|
+
CALIPER_MEASURE: "CALIPER_MEASURE";
|
|
454
|
+
CALIPER_INSPECT: "CALIPER_INSPECT";
|
|
455
|
+
CALIPER_FREEZE: "CALIPER_FREEZE";
|
|
456
|
+
CALIPER_CLEAR: "CALIPER_CLEAR";
|
|
457
|
+
CALIPER_WALK_DOM: "CALIPER_WALK_DOM";
|
|
458
|
+
CALIPER_WALK_AND_MEASURE: "CALIPER_WALK_AND_MEASURE";
|
|
459
|
+
CALIPER_GET_CONTEXT: "CALIPER_GET_CONTEXT";
|
|
460
|
+
"caliper/registerTab": "caliper/registerTab";
|
|
461
|
+
"caliper/tabUpdate": "caliper/tabUpdate";
|
|
462
|
+
"caliper/stateUpdate": "caliper/stateUpdate";
|
|
463
|
+
}>;
|
|
464
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
465
|
+
error: z.ZodString;
|
|
466
|
+
timestamp: z.ZodNumber;
|
|
467
|
+
binaryPayload: z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
|
|
468
|
+
}, z.core.$strip>]>;
|
|
469
|
+
|
|
470
|
+
export declare type CaliperAgentState = z.infer<typeof CaliperAgentStateSchema>;
|
|
471
|
+
|
|
472
|
+
export declare const CaliperAgentStateSchema: z.ZodObject<{
|
|
473
|
+
viewport: z.ZodObject<{
|
|
474
|
+
width: z.ZodNumber;
|
|
475
|
+
height: z.ZodNumber;
|
|
476
|
+
scrollX: z.ZodNumber;
|
|
477
|
+
scrollY: z.ZodNumber;
|
|
478
|
+
}, z.core.$strip>;
|
|
479
|
+
activeSelection: z.ZodNullable<z.ZodObject<{
|
|
480
|
+
rect: z.ZodNullable<z.ZodObject<{
|
|
481
|
+
top: z.ZodNumber;
|
|
482
|
+
right: z.ZodNumber;
|
|
483
|
+
bottom: z.ZodNumber;
|
|
484
|
+
left: z.ZodNumber;
|
|
485
|
+
width: z.ZodNumber;
|
|
486
|
+
height: z.ZodNumber;
|
|
487
|
+
x: z.ZodNumber;
|
|
488
|
+
y: z.ZodNumber;
|
|
489
|
+
}, z.core.$strip>>;
|
|
490
|
+
scrollHierarchy: z.ZodArray<z.ZodObject<{
|
|
491
|
+
initialScrollTop: z.ZodNumber;
|
|
492
|
+
initialScrollLeft: z.ZodNumber;
|
|
493
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
494
|
+
top: z.ZodNumber;
|
|
495
|
+
right: z.ZodNumber;
|
|
496
|
+
bottom: z.ZodNumber;
|
|
497
|
+
left: z.ZodNumber;
|
|
498
|
+
width: z.ZodNumber;
|
|
499
|
+
height: z.ZodNumber;
|
|
500
|
+
x: z.ZodNumber;
|
|
501
|
+
y: z.ZodNumber;
|
|
502
|
+
}, z.core.$strip>>;
|
|
503
|
+
absoluteDepth: z.ZodNumber;
|
|
504
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
505
|
+
}, z.core.$strip>>;
|
|
506
|
+
position: z.ZodEnum<{
|
|
507
|
+
static: "static";
|
|
508
|
+
relative: "relative";
|
|
509
|
+
absolute: "absolute";
|
|
510
|
+
fixed: "fixed";
|
|
511
|
+
sticky: "sticky";
|
|
512
|
+
}>;
|
|
513
|
+
stickyConfig: z.ZodOptional<z.ZodObject<{
|
|
514
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
515
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
516
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
517
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
518
|
+
naturalTop: z.ZodNumber;
|
|
519
|
+
naturalLeft: z.ZodNumber;
|
|
520
|
+
containerWidth: z.ZodNumber;
|
|
521
|
+
containerHeight: z.ZodNumber;
|
|
522
|
+
elementWidth: z.ZodNumber;
|
|
523
|
+
elementHeight: z.ZodNumber;
|
|
524
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
525
|
+
}, z.core.$strip>>;
|
|
526
|
+
initialWindowX: z.ZodNumber;
|
|
527
|
+
initialWindowY: z.ZodNumber;
|
|
528
|
+
depth: z.ZodNumber;
|
|
529
|
+
hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
530
|
+
}, z.core.$strip>>;
|
|
531
|
+
selectionFingerprint: z.ZodNullable<z.ZodObject<{
|
|
532
|
+
selector: z.ZodString;
|
|
533
|
+
tag: z.ZodString;
|
|
534
|
+
timestamp: z.ZodNumber;
|
|
535
|
+
id: z.ZodOptional<z.ZodString>;
|
|
536
|
+
text: z.ZodOptional<z.ZodString>;
|
|
537
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
538
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
539
|
+
nthChild: z.ZodOptional<z.ZodNumber>;
|
|
540
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
541
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
542
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
543
|
+
marker: z.ZodOptional<z.ZodString>;
|
|
544
|
+
scrollHierarchy: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
545
|
+
initialScrollTop: z.ZodNumber;
|
|
546
|
+
initialScrollLeft: z.ZodNumber;
|
|
547
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
548
|
+
top: z.ZodNumber;
|
|
549
|
+
right: z.ZodNumber;
|
|
550
|
+
bottom: z.ZodNumber;
|
|
551
|
+
left: z.ZodNumber;
|
|
552
|
+
width: z.ZodNumber;
|
|
553
|
+
height: z.ZodNumber;
|
|
554
|
+
x: z.ZodNumber;
|
|
555
|
+
y: z.ZodNumber;
|
|
556
|
+
}, z.core.$strip>>;
|
|
557
|
+
absoluteDepth: z.ZodNumber;
|
|
558
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
559
|
+
}, z.core.$strip>>>;
|
|
560
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
561
|
+
static: "static";
|
|
562
|
+
relative: "relative";
|
|
563
|
+
absolute: "absolute";
|
|
564
|
+
fixed: "fixed";
|
|
565
|
+
sticky: "sticky";
|
|
566
|
+
}>>;
|
|
567
|
+
stickyConfig: z.ZodOptional<z.ZodObject<{
|
|
568
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
569
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
570
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
571
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
572
|
+
naturalTop: z.ZodNumber;
|
|
573
|
+
naturalLeft: z.ZodNumber;
|
|
574
|
+
containerWidth: z.ZodNumber;
|
|
575
|
+
containerHeight: z.ZodNumber;
|
|
576
|
+
elementWidth: z.ZodNumber;
|
|
577
|
+
elementHeight: z.ZodNumber;
|
|
578
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
579
|
+
}, z.core.$strip>>;
|
|
580
|
+
initialWindowX: z.ZodOptional<z.ZodNumber>;
|
|
581
|
+
initialWindowY: z.ZodOptional<z.ZodNumber>;
|
|
582
|
+
hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
583
|
+
rect: z.ZodOptional<z.ZodObject<{
|
|
584
|
+
top: z.ZodNumber;
|
|
585
|
+
right: z.ZodNumber;
|
|
586
|
+
bottom: z.ZodNumber;
|
|
587
|
+
left: z.ZodNumber;
|
|
588
|
+
width: z.ZodNumber;
|
|
589
|
+
height: z.ZodNumber;
|
|
590
|
+
x: z.ZodNumber;
|
|
591
|
+
y: z.ZodNumber;
|
|
592
|
+
}, z.core.$strip>>;
|
|
593
|
+
}, z.core.$strip>>;
|
|
594
|
+
lastMeasurement: z.ZodNullable<z.ZodObject<{
|
|
595
|
+
context: z.ZodNullable<z.ZodEnum<{
|
|
596
|
+
parent: "parent";
|
|
597
|
+
child: "child";
|
|
598
|
+
sibling: "sibling";
|
|
599
|
+
}>>;
|
|
600
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
601
|
+
type: z.ZodEnum<{
|
|
602
|
+
top: "top";
|
|
603
|
+
right: "right";
|
|
604
|
+
bottom: "bottom";
|
|
605
|
+
left: "left";
|
|
606
|
+
distance: "distance";
|
|
607
|
+
}>;
|
|
608
|
+
value: z.ZodNumber;
|
|
609
|
+
start: z.ZodObject<{
|
|
610
|
+
x: z.ZodNumber;
|
|
611
|
+
y: z.ZodNumber;
|
|
612
|
+
}, z.core.$strip>;
|
|
613
|
+
end: z.ZodObject<{
|
|
614
|
+
x: z.ZodNumber;
|
|
615
|
+
y: z.ZodNumber;
|
|
616
|
+
}, z.core.$strip>;
|
|
617
|
+
startSync: z.ZodOptional<z.ZodEnum<{
|
|
618
|
+
primary: "primary";
|
|
619
|
+
secondary: "secondary";
|
|
620
|
+
}>>;
|
|
621
|
+
endSync: z.ZodOptional<z.ZodEnum<{
|
|
622
|
+
primary: "primary";
|
|
623
|
+
secondary: "secondary";
|
|
624
|
+
}>>;
|
|
625
|
+
}, z.core.$strip>>;
|
|
626
|
+
primary: z.ZodObject<{
|
|
627
|
+
top: z.ZodNumber;
|
|
628
|
+
right: z.ZodNumber;
|
|
629
|
+
bottom: z.ZodNumber;
|
|
630
|
+
left: z.ZodNumber;
|
|
631
|
+
width: z.ZodNumber;
|
|
632
|
+
height: z.ZodNumber;
|
|
633
|
+
x: z.ZodNumber;
|
|
634
|
+
y: z.ZodNumber;
|
|
635
|
+
}, z.core.$strip>;
|
|
636
|
+
secondary: z.ZodNullable<z.ZodObject<{
|
|
637
|
+
top: z.ZodNumber;
|
|
638
|
+
right: z.ZodNumber;
|
|
639
|
+
bottom: z.ZodNumber;
|
|
640
|
+
left: z.ZodNumber;
|
|
641
|
+
width: z.ZodNumber;
|
|
642
|
+
height: z.ZodNumber;
|
|
643
|
+
x: z.ZodNumber;
|
|
644
|
+
y: z.ZodNumber;
|
|
645
|
+
}, z.core.$strip>>;
|
|
646
|
+
timestamp: z.ZodNumber;
|
|
647
|
+
primaryHierarchy: z.ZodArray<z.ZodObject<{
|
|
648
|
+
initialScrollTop: z.ZodNumber;
|
|
649
|
+
initialScrollLeft: z.ZodNumber;
|
|
650
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
651
|
+
top: z.ZodNumber;
|
|
652
|
+
right: z.ZodNumber;
|
|
653
|
+
bottom: z.ZodNumber;
|
|
654
|
+
left: z.ZodNumber;
|
|
655
|
+
width: z.ZodNumber;
|
|
656
|
+
height: z.ZodNumber;
|
|
657
|
+
x: z.ZodNumber;
|
|
658
|
+
y: z.ZodNumber;
|
|
659
|
+
}, z.core.$strip>>;
|
|
660
|
+
absoluteDepth: z.ZodNumber;
|
|
661
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
662
|
+
}, z.core.$strip>>;
|
|
663
|
+
secondaryHierarchy: z.ZodArray<z.ZodObject<{
|
|
664
|
+
initialScrollTop: z.ZodNumber;
|
|
665
|
+
initialScrollLeft: z.ZodNumber;
|
|
666
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
667
|
+
top: z.ZodNumber;
|
|
668
|
+
right: z.ZodNumber;
|
|
669
|
+
bottom: z.ZodNumber;
|
|
670
|
+
left: z.ZodNumber;
|
|
671
|
+
width: z.ZodNumber;
|
|
672
|
+
height: z.ZodNumber;
|
|
673
|
+
x: z.ZodNumber;
|
|
674
|
+
y: z.ZodNumber;
|
|
675
|
+
}, z.core.$strip>>;
|
|
676
|
+
absoluteDepth: z.ZodNumber;
|
|
677
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
678
|
+
}, z.core.$strip>>;
|
|
679
|
+
primaryPosition: z.ZodEnum<{
|
|
680
|
+
static: "static";
|
|
681
|
+
relative: "relative";
|
|
682
|
+
absolute: "absolute";
|
|
683
|
+
fixed: "fixed";
|
|
684
|
+
sticky: "sticky";
|
|
685
|
+
}>;
|
|
686
|
+
secondaryPosition: z.ZodEnum<{
|
|
687
|
+
static: "static";
|
|
688
|
+
relative: "relative";
|
|
689
|
+
absolute: "absolute";
|
|
690
|
+
fixed: "fixed";
|
|
691
|
+
sticky: "sticky";
|
|
692
|
+
}>;
|
|
693
|
+
primaryWinX: z.ZodNumber;
|
|
694
|
+
primaryWinY: z.ZodNumber;
|
|
695
|
+
secondaryWinX: z.ZodNumber;
|
|
696
|
+
secondaryWinY: z.ZodNumber;
|
|
697
|
+
primarySticky: z.ZodOptional<z.ZodObject<{
|
|
698
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
699
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
700
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
701
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
702
|
+
naturalTop: z.ZodNumber;
|
|
703
|
+
naturalLeft: z.ZodNumber;
|
|
704
|
+
containerWidth: z.ZodNumber;
|
|
705
|
+
containerHeight: z.ZodNumber;
|
|
706
|
+
elementWidth: z.ZodNumber;
|
|
707
|
+
elementHeight: z.ZodNumber;
|
|
708
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
709
|
+
}, z.core.$strip>>;
|
|
710
|
+
secondarySticky: z.ZodOptional<z.ZodObject<{
|
|
711
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
712
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
713
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
714
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
715
|
+
naturalTop: z.ZodNumber;
|
|
716
|
+
naturalLeft: z.ZodNumber;
|
|
717
|
+
containerWidth: z.ZodNumber;
|
|
718
|
+
containerHeight: z.ZodNumber;
|
|
719
|
+
elementWidth: z.ZodNumber;
|
|
720
|
+
elementHeight: z.ZodNumber;
|
|
721
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
722
|
+
}, z.core.$strip>>;
|
|
723
|
+
primaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
724
|
+
secondaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
725
|
+
}, z.core.$strip>>;
|
|
726
|
+
measurementFingerprint: z.ZodNullable<z.ZodObject<{
|
|
727
|
+
primary: z.ZodObject<{
|
|
728
|
+
selector: z.ZodString;
|
|
729
|
+
tag: z.ZodString;
|
|
730
|
+
timestamp: z.ZodNumber;
|
|
731
|
+
id: z.ZodOptional<z.ZodString>;
|
|
732
|
+
text: z.ZodOptional<z.ZodString>;
|
|
733
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
734
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
735
|
+
nthChild: z.ZodOptional<z.ZodNumber>;
|
|
736
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
737
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
738
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
739
|
+
marker: z.ZodOptional<z.ZodString>;
|
|
740
|
+
scrollHierarchy: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
741
|
+
initialScrollTop: z.ZodNumber;
|
|
742
|
+
initialScrollLeft: z.ZodNumber;
|
|
743
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
744
|
+
top: z.ZodNumber;
|
|
745
|
+
right: z.ZodNumber;
|
|
746
|
+
bottom: z.ZodNumber;
|
|
747
|
+
left: z.ZodNumber;
|
|
748
|
+
width: z.ZodNumber;
|
|
749
|
+
height: z.ZodNumber;
|
|
750
|
+
x: z.ZodNumber;
|
|
751
|
+
y: z.ZodNumber;
|
|
752
|
+
}, z.core.$strip>>;
|
|
753
|
+
absoluteDepth: z.ZodNumber;
|
|
754
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
755
|
+
}, z.core.$strip>>>;
|
|
756
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
757
|
+
static: "static";
|
|
758
|
+
relative: "relative";
|
|
759
|
+
absolute: "absolute";
|
|
760
|
+
fixed: "fixed";
|
|
761
|
+
sticky: "sticky";
|
|
762
|
+
}>>;
|
|
763
|
+
stickyConfig: z.ZodOptional<z.ZodObject<{
|
|
764
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
765
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
766
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
767
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
768
|
+
naturalTop: z.ZodNumber;
|
|
769
|
+
naturalLeft: z.ZodNumber;
|
|
770
|
+
containerWidth: z.ZodNumber;
|
|
771
|
+
containerHeight: z.ZodNumber;
|
|
772
|
+
elementWidth: z.ZodNumber;
|
|
773
|
+
elementHeight: z.ZodNumber;
|
|
774
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
775
|
+
}, z.core.$strip>>;
|
|
776
|
+
initialWindowX: z.ZodOptional<z.ZodNumber>;
|
|
777
|
+
initialWindowY: z.ZodOptional<z.ZodNumber>;
|
|
778
|
+
hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
779
|
+
rect: z.ZodOptional<z.ZodObject<{
|
|
780
|
+
top: z.ZodNumber;
|
|
781
|
+
right: z.ZodNumber;
|
|
782
|
+
bottom: z.ZodNumber;
|
|
783
|
+
left: z.ZodNumber;
|
|
784
|
+
width: z.ZodNumber;
|
|
785
|
+
height: z.ZodNumber;
|
|
786
|
+
x: z.ZodNumber;
|
|
787
|
+
y: z.ZodNumber;
|
|
788
|
+
}, z.core.$strip>>;
|
|
789
|
+
}, z.core.$strip>;
|
|
790
|
+
secondary: z.ZodObject<{
|
|
791
|
+
selector: z.ZodString;
|
|
792
|
+
tag: z.ZodString;
|
|
793
|
+
timestamp: z.ZodNumber;
|
|
794
|
+
id: z.ZodOptional<z.ZodString>;
|
|
795
|
+
text: z.ZodOptional<z.ZodString>;
|
|
796
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
797
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
798
|
+
nthChild: z.ZodOptional<z.ZodNumber>;
|
|
799
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
800
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
801
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
802
|
+
marker: z.ZodOptional<z.ZodString>;
|
|
803
|
+
scrollHierarchy: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
804
|
+
initialScrollTop: z.ZodNumber;
|
|
805
|
+
initialScrollLeft: z.ZodNumber;
|
|
806
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
807
|
+
top: z.ZodNumber;
|
|
808
|
+
right: z.ZodNumber;
|
|
809
|
+
bottom: z.ZodNumber;
|
|
810
|
+
left: z.ZodNumber;
|
|
811
|
+
width: z.ZodNumber;
|
|
812
|
+
height: z.ZodNumber;
|
|
813
|
+
x: z.ZodNumber;
|
|
814
|
+
y: z.ZodNumber;
|
|
815
|
+
}, z.core.$strip>>;
|
|
816
|
+
absoluteDepth: z.ZodNumber;
|
|
817
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
818
|
+
}, z.core.$strip>>>;
|
|
819
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
820
|
+
static: "static";
|
|
821
|
+
relative: "relative";
|
|
822
|
+
absolute: "absolute";
|
|
823
|
+
fixed: "fixed";
|
|
824
|
+
sticky: "sticky";
|
|
825
|
+
}>>;
|
|
826
|
+
stickyConfig: z.ZodOptional<z.ZodObject<{
|
|
827
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
828
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
829
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
830
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
831
|
+
naturalTop: z.ZodNumber;
|
|
832
|
+
naturalLeft: z.ZodNumber;
|
|
833
|
+
containerWidth: z.ZodNumber;
|
|
834
|
+
containerHeight: z.ZodNumber;
|
|
835
|
+
elementWidth: z.ZodNumber;
|
|
836
|
+
elementHeight: z.ZodNumber;
|
|
837
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
838
|
+
}, z.core.$strip>>;
|
|
839
|
+
initialWindowX: z.ZodOptional<z.ZodNumber>;
|
|
840
|
+
initialWindowY: z.ZodOptional<z.ZodNumber>;
|
|
841
|
+
hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
842
|
+
rect: z.ZodOptional<z.ZodObject<{
|
|
843
|
+
top: z.ZodNumber;
|
|
844
|
+
right: z.ZodNumber;
|
|
845
|
+
bottom: z.ZodNumber;
|
|
846
|
+
left: z.ZodNumber;
|
|
847
|
+
width: z.ZodNumber;
|
|
848
|
+
height: z.ZodNumber;
|
|
849
|
+
x: z.ZodNumber;
|
|
850
|
+
y: z.ZodNumber;
|
|
851
|
+
}, z.core.$strip>>;
|
|
852
|
+
}, z.core.$strip>;
|
|
853
|
+
}, z.core.$strip>>;
|
|
854
|
+
lastUpdated: z.ZodNumber;
|
|
855
|
+
}, z.core.$strip>;
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* @caliper/agent-bridge
|
|
859
|
+
* Enables AI agents to use Caliper's high-precision measurement engine
|
|
860
|
+
*
|
|
861
|
+
* @example
|
|
862
|
+
* ```typescript
|
|
863
|
+
* import { createMeasurementSystem, createSelectionSystem } from "@oyerinde/caliper/core";
|
|
864
|
+
* import { bridge } from "@oyerinde/caliper-bridge";
|
|
865
|
+
*
|
|
866
|
+
* const measurementSystem = createMeasurementSystem();
|
|
867
|
+
* const selectionSystem = createSelectionSystem();
|
|
868
|
+
*
|
|
869
|
+
* const cleanup = bridge({
|
|
870
|
+
* enabled: true,
|
|
871
|
+
* systems: { measurementSystem, selectionSystem }
|
|
872
|
+
* });
|
|
873
|
+
* ```
|
|
874
|
+
*/
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* CaliperBridge Plugin Factory
|
|
878
|
+
*
|
|
879
|
+
* Creates a Caliper plugin that enables AI agents to interact with the overlay via
|
|
880
|
+
* a WebSocket bridge (local MCP relay) or direct global intent dispatching.
|
|
881
|
+
*
|
|
882
|
+
* When installed, this plugin:
|
|
883
|
+
* 1. Starts a local WebSocket server (or connects to one) to receive agent commands.
|
|
884
|
+
* 2. Exposes `window.dispatchCaliperIntent` for manual/in-page agentic calls.
|
|
885
|
+
* 3. Syncs the overlay state (camera, selection, measurements) back to the agent.
|
|
886
|
+
*
|
|
887
|
+
* @example
|
|
888
|
+
* ```ts
|
|
889
|
+
* import { init } from "@oyerinde/caliper/preset";
|
|
890
|
+
* import { CaliperBridge } from "@oyerinde/caliper/bridge";
|
|
891
|
+
*
|
|
892
|
+
* init({ ... }, [
|
|
893
|
+
* new CaliperBridge({
|
|
894
|
+
* enabled: true,
|
|
895
|
+
* wsPort: 3010,
|
|
896
|
+
* onStateChange: (state) => console.log("New Agent State:", state)
|
|
897
|
+
* })
|
|
898
|
+
* ]);
|
|
899
|
+
* ```
|
|
900
|
+
*
|
|
901
|
+
* @param config - The bridge configuration settings.
|
|
902
|
+
* @returns A CaliperPlugin that can be used with `caliper.use()` or in `init()`.
|
|
903
|
+
*/
|
|
904
|
+
export declare function CaliperBridge(config: AgentBridgeConfig): CaliperPlugin;
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* All relevant computed styles extracted from getComputedStyle().
|
|
908
|
+
* Values are parsed to numbers where applicable.
|
|
909
|
+
*/
|
|
910
|
+
declare const CaliperComputedStylesSchema: z.ZodObject<{
|
|
911
|
+
display: z.ZodOptional<z.ZodString>;
|
|
912
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
913
|
+
position: z.ZodOptional<z.ZodString>;
|
|
914
|
+
boxSizing: z.ZodOptional<z.ZodString>;
|
|
915
|
+
padding: z.ZodOptional<z.ZodObject<{
|
|
916
|
+
top: z.ZodNumber;
|
|
917
|
+
right: z.ZodNumber;
|
|
918
|
+
bottom: z.ZodNumber;
|
|
919
|
+
left: z.ZodNumber;
|
|
920
|
+
}, z.core.$strip>>;
|
|
921
|
+
margin: z.ZodOptional<z.ZodObject<{
|
|
922
|
+
top: z.ZodNumber;
|
|
923
|
+
right: z.ZodNumber;
|
|
924
|
+
bottom: z.ZodNumber;
|
|
925
|
+
left: z.ZodNumber;
|
|
926
|
+
}, z.core.$strip>>;
|
|
927
|
+
border: z.ZodOptional<z.ZodObject<{
|
|
928
|
+
top: z.ZodNumber;
|
|
929
|
+
right: z.ZodNumber;
|
|
930
|
+
bottom: z.ZodNumber;
|
|
931
|
+
left: z.ZodNumber;
|
|
932
|
+
}, z.core.$strip>>;
|
|
933
|
+
gap: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
934
|
+
flexDirection: z.ZodOptional<z.ZodString>;
|
|
935
|
+
justifyContent: z.ZodOptional<z.ZodString>;
|
|
936
|
+
alignItems: z.ZodOptional<z.ZodString>;
|
|
937
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
938
|
+
fontWeight: z.ZodOptional<z.ZodString>;
|
|
939
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
940
|
+
lineHeight: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
941
|
+
letterSpacing: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
942
|
+
color: z.ZodOptional<z.ZodString>;
|
|
943
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
944
|
+
borderColor: z.ZodOptional<z.ZodString>;
|
|
945
|
+
borderRadius: z.ZodOptional<z.ZodString>;
|
|
946
|
+
boxShadow: z.ZodOptional<z.ZodString>;
|
|
947
|
+
opacity: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
948
|
+
outline: z.ZodOptional<z.ZodString>;
|
|
949
|
+
outlineColor: z.ZodOptional<z.ZodString>;
|
|
950
|
+
zIndex: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
951
|
+
overflow: z.ZodOptional<z.ZodString>;
|
|
952
|
+
overflowX: z.ZodOptional<z.ZodString>;
|
|
953
|
+
overflowY: z.ZodOptional<z.ZodString>;
|
|
954
|
+
contentVisibility: z.ZodOptional<z.ZodString>;
|
|
955
|
+
}, z.core.$strip>;
|
|
956
|
+
|
|
957
|
+
declare interface CaliperCoreSystems {
|
|
958
|
+
measurementSystem: MeasurementSystem;
|
|
959
|
+
selectionSystem: SelectionSystem;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
export declare type CaliperGetContextPayload = z.infer<typeof CaliperGetContextPayloadSchema>;
|
|
963
|
+
|
|
964
|
+
export declare const CaliperGetContextPayloadSchema: z.ZodObject<{}, z.core.$strip>;
|
|
965
|
+
|
|
966
|
+
export declare type CaliperInspectPayload = z.infer<typeof CaliperInspectPayloadSchema>;
|
|
967
|
+
|
|
968
|
+
export declare const CaliperInspectPayloadSchema: z.ZodObject<{
|
|
969
|
+
selector: z.ZodString;
|
|
970
|
+
}, z.core.$strip>;
|
|
971
|
+
|
|
972
|
+
export declare type CaliperIntent = JsonRpcRequest & ({
|
|
973
|
+
method: typeof CALIPER_METHODS.SELECT;
|
|
974
|
+
params: CaliperSelectPayload;
|
|
975
|
+
} | {
|
|
976
|
+
method: typeof CALIPER_METHODS.MEASURE;
|
|
977
|
+
params: CaliperMeasurePayload;
|
|
978
|
+
} | {
|
|
979
|
+
method: typeof CALIPER_METHODS.INSPECT;
|
|
980
|
+
params: CaliperInspectPayload;
|
|
981
|
+
} | {
|
|
982
|
+
method: typeof CALIPER_METHODS.FREEZE;
|
|
983
|
+
params: {};
|
|
984
|
+
} | {
|
|
985
|
+
method: typeof CALIPER_METHODS.CLEAR;
|
|
986
|
+
params: {};
|
|
987
|
+
} | {
|
|
988
|
+
method: typeof CALIPER_METHODS.WALK_DOM;
|
|
989
|
+
params: CaliperWalkDomPayload;
|
|
990
|
+
} | {
|
|
991
|
+
method: typeof CALIPER_METHODS.WALK_AND_MEASURE;
|
|
992
|
+
params: CaliperWalkAndMeasurePayload;
|
|
993
|
+
} | {
|
|
994
|
+
method: typeof CALIPER_METHODS.GET_CONTEXT;
|
|
995
|
+
params: CaliperGetContextPayload;
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
/**
|
|
999
|
+
* All structural measurements for a node.
|
|
1000
|
+
*/
|
|
1001
|
+
declare const CaliperMeasurementsSchema: z.ZodObject<{
|
|
1002
|
+
toParent: z.ZodObject<{
|
|
1003
|
+
top: z.ZodNumber;
|
|
1004
|
+
left: z.ZodNumber;
|
|
1005
|
+
bottom: z.ZodNumber;
|
|
1006
|
+
right: z.ZodNumber;
|
|
1007
|
+
}, z.core.$strip>;
|
|
1008
|
+
toPreviousSibling: z.ZodNullable<z.ZodObject<{
|
|
1009
|
+
distance: z.ZodNumber;
|
|
1010
|
+
direction: z.ZodNullable<z.ZodEnum<{
|
|
1011
|
+
right: "right";
|
|
1012
|
+
left: "left";
|
|
1013
|
+
above: "above";
|
|
1014
|
+
below: "below";
|
|
1015
|
+
}>>;
|
|
1016
|
+
}, z.core.$strip>>;
|
|
1017
|
+
toNextSibling: z.ZodNullable<z.ZodObject<{
|
|
1018
|
+
distance: z.ZodNumber;
|
|
1019
|
+
direction: z.ZodNullable<z.ZodEnum<{
|
|
1020
|
+
right: "right";
|
|
1021
|
+
left: "left";
|
|
1022
|
+
above: "above";
|
|
1023
|
+
below: "below";
|
|
1024
|
+
}>>;
|
|
1025
|
+
}, z.core.$strip>>;
|
|
1026
|
+
indexInParent: z.ZodNumber;
|
|
1027
|
+
siblingCount: z.ZodNumber;
|
|
1028
|
+
}, z.core.$strip>;
|
|
1029
|
+
|
|
1030
|
+
export declare type CaliperMeasurePayload = z.infer<typeof CaliperMeasurePayloadSchema>;
|
|
1031
|
+
|
|
1032
|
+
export declare const CaliperMeasurePayloadSchema: z.ZodObject<{
|
|
1033
|
+
primarySelector: z.ZodString;
|
|
1034
|
+
secondarySelector: z.ZodString;
|
|
1035
|
+
}, z.core.$strip>;
|
|
1036
|
+
|
|
1037
|
+
export declare interface CaliperNode {
|
|
1038
|
+
agentId: string;
|
|
1039
|
+
selector: string;
|
|
1040
|
+
tag: string;
|
|
1041
|
+
htmlId?: string;
|
|
1042
|
+
classes: string[];
|
|
1043
|
+
textContent?: string;
|
|
1044
|
+
rect: z.infer<typeof RectSchema>;
|
|
1045
|
+
viewportRect: {
|
|
1046
|
+
top: number;
|
|
1047
|
+
left: number;
|
|
1048
|
+
};
|
|
1049
|
+
styles: z.infer<typeof CaliperComputedStylesSchema>;
|
|
1050
|
+
measurements: z.infer<typeof CaliperMeasurementsSchema>;
|
|
1051
|
+
depth: number;
|
|
1052
|
+
parentAgentId?: string;
|
|
1053
|
+
childCount: number;
|
|
1054
|
+
children: CaliperNode[];
|
|
1055
|
+
marker?: string;
|
|
1056
|
+
ariaHidden?: boolean;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* A plugin allows extending Caliper's functionality by accessing the
|
|
1061
|
+
* OverlayInstance and internal systems.
|
|
1062
|
+
*/
|
|
1063
|
+
declare interface CaliperPlugin {
|
|
1064
|
+
/** Unique identifier for the plugin. Used for deduplication. */
|
|
1065
|
+
name: string;
|
|
1066
|
+
/** Called when the plugin is installed on an overlay instance. */
|
|
1067
|
+
install: (instance: OverlayInstance) => void;
|
|
1068
|
+
/** Optional cleanup logic called when the overlay is disposed. */
|
|
1069
|
+
dispose?: () => void;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
export declare type CaliperSelectorInput = z.infer<typeof CaliperSelectorInputSchema>;
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* The input data structure for a Caliper selection copy.
|
|
1076
|
+
*/
|
|
1077
|
+
declare const CaliperSelectorInputSchema: z.ZodObject<{
|
|
1078
|
+
selector: z.ZodString;
|
|
1079
|
+
tag: z.ZodString;
|
|
1080
|
+
timestamp: z.ZodNumber;
|
|
1081
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1082
|
+
text: z.ZodOptional<z.ZodString>;
|
|
1083
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1084
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
1085
|
+
nthChild: z.ZodOptional<z.ZodNumber>;
|
|
1086
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
1087
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
1088
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
1089
|
+
marker: z.ZodOptional<z.ZodString>;
|
|
1090
|
+
scrollHierarchy: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1091
|
+
initialScrollTop: z.ZodNumber;
|
|
1092
|
+
initialScrollLeft: z.ZodNumber;
|
|
1093
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
1094
|
+
top: z.ZodNumber;
|
|
1095
|
+
right: z.ZodNumber;
|
|
1096
|
+
bottom: z.ZodNumber;
|
|
1097
|
+
left: z.ZodNumber;
|
|
1098
|
+
width: z.ZodNumber;
|
|
1099
|
+
height: z.ZodNumber;
|
|
1100
|
+
x: z.ZodNumber;
|
|
1101
|
+
y: z.ZodNumber;
|
|
1102
|
+
}, z.core.$strip>>;
|
|
1103
|
+
absoluteDepth: z.ZodNumber;
|
|
1104
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
1105
|
+
}, z.core.$strip>>>;
|
|
1106
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
1107
|
+
static: "static";
|
|
1108
|
+
relative: "relative";
|
|
1109
|
+
absolute: "absolute";
|
|
1110
|
+
fixed: "fixed";
|
|
1111
|
+
sticky: "sticky";
|
|
1112
|
+
}>>;
|
|
1113
|
+
stickyConfig: z.ZodOptional<z.ZodObject<{
|
|
1114
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
1115
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
1116
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
1117
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
1118
|
+
naturalTop: z.ZodNumber;
|
|
1119
|
+
naturalLeft: z.ZodNumber;
|
|
1120
|
+
containerWidth: z.ZodNumber;
|
|
1121
|
+
containerHeight: z.ZodNumber;
|
|
1122
|
+
elementWidth: z.ZodNumber;
|
|
1123
|
+
elementHeight: z.ZodNumber;
|
|
1124
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
1125
|
+
}, z.core.$strip>>;
|
|
1126
|
+
initialWindowX: z.ZodOptional<z.ZodNumber>;
|
|
1127
|
+
initialWindowY: z.ZodOptional<z.ZodNumber>;
|
|
1128
|
+
hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
1129
|
+
rect: z.ZodOptional<z.ZodObject<{
|
|
1130
|
+
top: z.ZodNumber;
|
|
1131
|
+
right: z.ZodNumber;
|
|
1132
|
+
bottom: z.ZodNumber;
|
|
1133
|
+
left: z.ZodNumber;
|
|
1134
|
+
width: z.ZodNumber;
|
|
1135
|
+
height: z.ZodNumber;
|
|
1136
|
+
x: z.ZodNumber;
|
|
1137
|
+
y: z.ZodNumber;
|
|
1138
|
+
}, z.core.$strip>>;
|
|
1139
|
+
}, z.core.$strip>;
|
|
1140
|
+
|
|
1141
|
+
export declare type CaliperSelectPayload = z.infer<typeof CaliperSelectPayloadSchema>;
|
|
1142
|
+
|
|
1143
|
+
export declare const CaliperSelectPayloadSchema: z.ZodObject<{
|
|
1144
|
+
selector: z.ZodString;
|
|
1145
|
+
}, z.core.$strip>;
|
|
1146
|
+
|
|
1147
|
+
export declare type CaliperWalkAndMeasurePayload = z.infer<typeof CaliperWalkAndMeasurePayloadSchema>;
|
|
1148
|
+
|
|
1149
|
+
export declare const CaliperWalkAndMeasurePayloadSchema: z.ZodObject<{
|
|
1150
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
1151
|
+
maxNodes: z.ZodOptional<z.ZodNumber>;
|
|
1152
|
+
continueFrom: z.ZodOptional<z.ZodString>;
|
|
1153
|
+
minElementSize: z.ZodOptional<z.ZodNumber>;
|
|
1154
|
+
ignoreSelectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1155
|
+
selector: z.ZodString;
|
|
1156
|
+
}, z.core.$strip>;
|
|
1157
|
+
|
|
1158
|
+
export declare type CaliperWalkDomPayload = z.infer<typeof CaliperWalkDomPayloadSchema>;
|
|
1159
|
+
|
|
1160
|
+
export declare const CaliperWalkDomPayloadSchema: z.ZodObject<{
|
|
1161
|
+
selector: z.ZodString;
|
|
1162
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
1163
|
+
}, z.core.$strip>;
|
|
1164
|
+
|
|
1165
|
+
export declare type CursorContext = Prettify<z.infer<typeof CursorContextSchema>>;
|
|
1166
|
+
|
|
1167
|
+
declare const CursorContextSchema: z.ZodEnum<{
|
|
1168
|
+
parent: "parent";
|
|
1169
|
+
child: "child";
|
|
1170
|
+
sibling: "sibling";
|
|
1171
|
+
}>;
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* Dispatches a high-level intent to the Caliper engine.
|
|
1175
|
+
*
|
|
1176
|
+
* This function is used to programmatically trigger Caliper actions (like measuring between elements)
|
|
1177
|
+
* using the standardized intent format. Requires a `CaliperBridge` to be installed and active.
|
|
1178
|
+
*
|
|
1179
|
+
* @param intent - The action to perform (e.g., 'measure', 'select', 'inspect').
|
|
1180
|
+
* @returns A promise resolving to the result of the action, containing success status and metrics.
|
|
1181
|
+
*/
|
|
1182
|
+
export declare function dispatchCaliperIntent(intent: CaliperIntent): Promise<CaliperActionResult>;
|
|
1183
|
+
|
|
1184
|
+
declare type Flatten<T> = T extends Primitive ? T : T extends Array<infer U> ? Array<Flatten<U>> : T extends Set<infer U> ? Set<Flatten<U>> : T extends Map<infer K, infer V> ? Map<Flatten<K>, Flatten<V>> : T extends object ? {
|
|
1185
|
+
[K in keyof T]: Flatten<T[K]>;
|
|
1186
|
+
} : T;
|
|
1187
|
+
|
|
1188
|
+
declare type Infer<Schema extends z_2.ZodTypeAny> = Flatten<z_2.infer<Schema>>;
|
|
1189
|
+
|
|
1190
|
+
export declare type JSONRPCRequest = Infer<typeof JSONRPCRequestSchema>;
|
|
1191
|
+
|
|
1192
|
+
declare type JsonRpcRequest = JSONRPCRequest;
|
|
1193
|
+
|
|
1194
|
+
/**
|
|
1195
|
+
* A request that expects a response.
|
|
1196
|
+
*/
|
|
1197
|
+
declare const JSONRPCRequestSchema: z_2.ZodObject<{
|
|
1198
|
+
method: z_2.ZodString;
|
|
1199
|
+
params: z_2.ZodOptional<z_2.ZodObject<{
|
|
1200
|
+
_meta: z_2.ZodOptional<z_2.ZodObject<{
|
|
1201
|
+
/**
|
|
1202
|
+
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
|
1203
|
+
*/
|
|
1204
|
+
progressToken: z_2.ZodOptional<z_2.ZodUnion<readonly [z_2.ZodString, z_2.ZodNumber]>>;
|
|
1205
|
+
/**
|
|
1206
|
+
* If specified, this request is related to the provided task.
|
|
1207
|
+
*/
|
|
1208
|
+
"io.modelcontextprotocol/related-task": z_2.ZodOptional<z_2.ZodObject<{
|
|
1209
|
+
taskId: z_2.ZodString;
|
|
1210
|
+
}, z_2.core.$strip>>;
|
|
1211
|
+
}, z_2.core.$loose>>;
|
|
1212
|
+
}, z_2.core.$loose>>;
|
|
1213
|
+
jsonrpc: z_2.ZodLiteral<"2.0">;
|
|
1214
|
+
id: z_2.ZodUnion<readonly [z_2.ZodString, z_2.ZodNumber]>;
|
|
1215
|
+
}, z_2.core.$strict>;
|
|
1216
|
+
|
|
1217
|
+
export declare type MeasurementLine = Prettify<z.infer<typeof MeasurementLineSchema>>;
|
|
1218
|
+
|
|
1219
|
+
declare const MeasurementLineSchema: z.ZodObject<{
|
|
1220
|
+
type: z.ZodEnum<{
|
|
1221
|
+
top: "top";
|
|
1222
|
+
right: "right";
|
|
1223
|
+
bottom: "bottom";
|
|
1224
|
+
left: "left";
|
|
1225
|
+
distance: "distance";
|
|
1226
|
+
}>;
|
|
1227
|
+
value: z.ZodNumber;
|
|
1228
|
+
start: z.ZodObject<{
|
|
1229
|
+
x: z.ZodNumber;
|
|
1230
|
+
y: z.ZodNumber;
|
|
1231
|
+
}, z.core.$strip>;
|
|
1232
|
+
end: z.ZodObject<{
|
|
1233
|
+
x: z.ZodNumber;
|
|
1234
|
+
y: z.ZodNumber;
|
|
1235
|
+
}, z.core.$strip>;
|
|
1236
|
+
startSync: z.ZodOptional<z.ZodEnum<{
|
|
1237
|
+
primary: "primary";
|
|
1238
|
+
secondary: "secondary";
|
|
1239
|
+
}>>;
|
|
1240
|
+
endSync: z.ZodOptional<z.ZodEnum<{
|
|
1241
|
+
primary: "primary";
|
|
1242
|
+
secondary: "secondary";
|
|
1243
|
+
}>>;
|
|
1244
|
+
}, z.core.$strip>;
|
|
1245
|
+
|
|
1246
|
+
export declare type MeasurementResult = Prettify<z.infer<typeof MeasurementResultSchema>>;
|
|
1247
|
+
|
|
1248
|
+
declare type MeasurementResult_2 = Remap<MeasurementResult, {
|
|
1249
|
+
primary: DOMRect;
|
|
1250
|
+
secondary: DOMRect | null;
|
|
1251
|
+
primaryHierarchy: ScrollState_2[];
|
|
1252
|
+
secondaryHierarchy: ScrollState_2[];
|
|
1253
|
+
secondaryElement: Element | null;
|
|
1254
|
+
}>;
|
|
1255
|
+
|
|
1256
|
+
declare const MeasurementResultSchema: z.ZodObject<{
|
|
1257
|
+
context: z.ZodNullable<z.ZodEnum<{
|
|
1258
|
+
parent: "parent";
|
|
1259
|
+
child: "child";
|
|
1260
|
+
sibling: "sibling";
|
|
1261
|
+
}>>;
|
|
1262
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
1263
|
+
type: z.ZodEnum<{
|
|
1264
|
+
top: "top";
|
|
1265
|
+
right: "right";
|
|
1266
|
+
bottom: "bottom";
|
|
1267
|
+
left: "left";
|
|
1268
|
+
distance: "distance";
|
|
1269
|
+
}>;
|
|
1270
|
+
value: z.ZodNumber;
|
|
1271
|
+
start: z.ZodObject<{
|
|
1272
|
+
x: z.ZodNumber;
|
|
1273
|
+
y: z.ZodNumber;
|
|
1274
|
+
}, z.core.$strip>;
|
|
1275
|
+
end: z.ZodObject<{
|
|
1276
|
+
x: z.ZodNumber;
|
|
1277
|
+
y: z.ZodNumber;
|
|
1278
|
+
}, z.core.$strip>;
|
|
1279
|
+
startSync: z.ZodOptional<z.ZodEnum<{
|
|
1280
|
+
primary: "primary";
|
|
1281
|
+
secondary: "secondary";
|
|
1282
|
+
}>>;
|
|
1283
|
+
endSync: z.ZodOptional<z.ZodEnum<{
|
|
1284
|
+
primary: "primary";
|
|
1285
|
+
secondary: "secondary";
|
|
1286
|
+
}>>;
|
|
1287
|
+
}, z.core.$strip>>;
|
|
1288
|
+
primary: z.ZodObject<{
|
|
1289
|
+
top: z.ZodNumber;
|
|
1290
|
+
right: z.ZodNumber;
|
|
1291
|
+
bottom: z.ZodNumber;
|
|
1292
|
+
left: z.ZodNumber;
|
|
1293
|
+
width: z.ZodNumber;
|
|
1294
|
+
height: z.ZodNumber;
|
|
1295
|
+
x: z.ZodNumber;
|
|
1296
|
+
y: z.ZodNumber;
|
|
1297
|
+
}, z.core.$strip>;
|
|
1298
|
+
secondary: z.ZodNullable<z.ZodObject<{
|
|
1299
|
+
top: z.ZodNumber;
|
|
1300
|
+
right: z.ZodNumber;
|
|
1301
|
+
bottom: z.ZodNumber;
|
|
1302
|
+
left: z.ZodNumber;
|
|
1303
|
+
width: z.ZodNumber;
|
|
1304
|
+
height: z.ZodNumber;
|
|
1305
|
+
x: z.ZodNumber;
|
|
1306
|
+
y: z.ZodNumber;
|
|
1307
|
+
}, z.core.$strip>>;
|
|
1308
|
+
timestamp: z.ZodNumber;
|
|
1309
|
+
primaryHierarchy: z.ZodArray<z.ZodObject<{
|
|
1310
|
+
initialScrollTop: z.ZodNumber;
|
|
1311
|
+
initialScrollLeft: z.ZodNumber;
|
|
1312
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
1313
|
+
top: z.ZodNumber;
|
|
1314
|
+
right: z.ZodNumber;
|
|
1315
|
+
bottom: z.ZodNumber;
|
|
1316
|
+
left: z.ZodNumber;
|
|
1317
|
+
width: z.ZodNumber;
|
|
1318
|
+
height: z.ZodNumber;
|
|
1319
|
+
x: z.ZodNumber;
|
|
1320
|
+
y: z.ZodNumber;
|
|
1321
|
+
}, z.core.$strip>>;
|
|
1322
|
+
absoluteDepth: z.ZodNumber;
|
|
1323
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
1324
|
+
}, z.core.$strip>>;
|
|
1325
|
+
secondaryHierarchy: z.ZodArray<z.ZodObject<{
|
|
1326
|
+
initialScrollTop: z.ZodNumber;
|
|
1327
|
+
initialScrollLeft: z.ZodNumber;
|
|
1328
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
1329
|
+
top: z.ZodNumber;
|
|
1330
|
+
right: z.ZodNumber;
|
|
1331
|
+
bottom: z.ZodNumber;
|
|
1332
|
+
left: z.ZodNumber;
|
|
1333
|
+
width: z.ZodNumber;
|
|
1334
|
+
height: z.ZodNumber;
|
|
1335
|
+
x: z.ZodNumber;
|
|
1336
|
+
y: z.ZodNumber;
|
|
1337
|
+
}, z.core.$strip>>;
|
|
1338
|
+
absoluteDepth: z.ZodNumber;
|
|
1339
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
1340
|
+
}, z.core.$strip>>;
|
|
1341
|
+
primaryPosition: z.ZodEnum<{
|
|
1342
|
+
static: "static";
|
|
1343
|
+
relative: "relative";
|
|
1344
|
+
absolute: "absolute";
|
|
1345
|
+
fixed: "fixed";
|
|
1346
|
+
sticky: "sticky";
|
|
1347
|
+
}>;
|
|
1348
|
+
secondaryPosition: z.ZodEnum<{
|
|
1349
|
+
static: "static";
|
|
1350
|
+
relative: "relative";
|
|
1351
|
+
absolute: "absolute";
|
|
1352
|
+
fixed: "fixed";
|
|
1353
|
+
sticky: "sticky";
|
|
1354
|
+
}>;
|
|
1355
|
+
primaryWinX: z.ZodNumber;
|
|
1356
|
+
primaryWinY: z.ZodNumber;
|
|
1357
|
+
secondaryWinX: z.ZodNumber;
|
|
1358
|
+
secondaryWinY: z.ZodNumber;
|
|
1359
|
+
primarySticky: z.ZodOptional<z.ZodObject<{
|
|
1360
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
1361
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
1362
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
1363
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
1364
|
+
naturalTop: z.ZodNumber;
|
|
1365
|
+
naturalLeft: z.ZodNumber;
|
|
1366
|
+
containerWidth: z.ZodNumber;
|
|
1367
|
+
containerHeight: z.ZodNumber;
|
|
1368
|
+
elementWidth: z.ZodNumber;
|
|
1369
|
+
elementHeight: z.ZodNumber;
|
|
1370
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
1371
|
+
}, z.core.$strip>>;
|
|
1372
|
+
secondarySticky: z.ZodOptional<z.ZodObject<{
|
|
1373
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
1374
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
1375
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
1376
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
1377
|
+
naturalTop: z.ZodNumber;
|
|
1378
|
+
naturalLeft: z.ZodNumber;
|
|
1379
|
+
containerWidth: z.ZodNumber;
|
|
1380
|
+
containerHeight: z.ZodNumber;
|
|
1381
|
+
elementWidth: z.ZodNumber;
|
|
1382
|
+
elementHeight: z.ZodNumber;
|
|
1383
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
1384
|
+
}, z.core.$strip>>;
|
|
1385
|
+
primaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
1386
|
+
secondaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
1387
|
+
}, z.core.$strip>;
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* Measurement state machine
|
|
1391
|
+
* IDLE → ARMED → MEASURING → FROZEN → IDLE
|
|
1392
|
+
*/
|
|
1393
|
+
declare type MeasurementState = "IDLE" | "ARMED" | "MEASURING" | "FROZEN";
|
|
1394
|
+
|
|
1395
|
+
declare interface MeasurementSystem {
|
|
1396
|
+
measure: (selectedElement: Element, cursor: {
|
|
1397
|
+
x: number;
|
|
1398
|
+
y: number;
|
|
1399
|
+
}) => void;
|
|
1400
|
+
abort: () => void;
|
|
1401
|
+
stop: () => void;
|
|
1402
|
+
freeze: () => void;
|
|
1403
|
+
unfreeze: (isAltDown: boolean) => void;
|
|
1404
|
+
cleanup: () => void;
|
|
1405
|
+
getState: () => MeasurementState;
|
|
1406
|
+
getCurrentResult: () => MeasurementResult_2 | null;
|
|
1407
|
+
getSecondaryElement: () => Element | null;
|
|
1408
|
+
getCalculator: () => CalculatorIntegration;
|
|
1409
|
+
getProjection: () => ProjectionSystem;
|
|
1410
|
+
getRuler: () => RulerSystem;
|
|
1411
|
+
onStateChange: (listener: MeasurementSystemListener) => () => void;
|
|
1412
|
+
updatePrimaryRect: (rect: DOMRect) => void;
|
|
1413
|
+
updateSecondaryRect: (rect: DOMRect) => void;
|
|
1414
|
+
applyResult: (result: MeasurementResult_2) => void;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
declare type MeasurementSystemListener = () => void;
|
|
1418
|
+
|
|
1419
|
+
/**
|
|
1420
|
+
* Handle to a running Caliper overlay.
|
|
1421
|
+
*/
|
|
1422
|
+
declare interface OverlayInstance {
|
|
1423
|
+
/**
|
|
1424
|
+
* Mounts the overlay into the DOM.
|
|
1425
|
+
* By default, it mounts into document.documentElement (safe for Shadow DOM).
|
|
1426
|
+
*/
|
|
1427
|
+
mount: (container?: HTMLElement) => void;
|
|
1428
|
+
/**
|
|
1429
|
+
* Removes the overlay from the DOM and cleans up all event listeners and systems.
|
|
1430
|
+
*/
|
|
1431
|
+
dispose: () => void;
|
|
1432
|
+
/**
|
|
1433
|
+
* Synchronously returns the internal systems if they are initialized.
|
|
1434
|
+
*/
|
|
1435
|
+
getSystems: () => CaliperCoreSystems | null;
|
|
1436
|
+
/**
|
|
1437
|
+
* Asynchronous helper that resolves when the internal systems are ready.
|
|
1438
|
+
* Useful for plugins that need to interact with the DOM or state immediately.
|
|
1439
|
+
*/
|
|
1440
|
+
waitForSystems: () => Promise<CaliperCoreSystems>;
|
|
1441
|
+
/**
|
|
1442
|
+
* Registers a plugin with this instance.
|
|
1443
|
+
*/
|
|
1444
|
+
use: (plugin: CaliperPlugin) => OverlayInstance;
|
|
1445
|
+
/** Whether the overlay is currently mounted in the document. */
|
|
1446
|
+
mounted: boolean;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
export declare type PositionMode = Prettify<z.infer<typeof PositionModeSchema>>;
|
|
1450
|
+
|
|
1451
|
+
declare const PositionModeSchema: z.ZodEnum<{
|
|
1452
|
+
static: "static";
|
|
1453
|
+
relative: "relative";
|
|
1454
|
+
absolute: "absolute";
|
|
1455
|
+
fixed: "fixed";
|
|
1456
|
+
sticky: "sticky";
|
|
1457
|
+
}>;
|
|
1458
|
+
|
|
1459
|
+
declare type Prettify<T> = {
|
|
1460
|
+
[K in keyof T]: T[K];
|
|
1461
|
+
} & {};
|
|
1462
|
+
|
|
1463
|
+
declare type Prettify_2<T> = {
|
|
1464
|
+
[K in keyof T]: T[K];
|
|
1465
|
+
} & {};
|
|
1466
|
+
|
|
1467
|
+
declare type Primitive = string | number | boolean | bigint | null | undefined;
|
|
1468
|
+
|
|
1469
|
+
declare type ProjectionDirection = "top" | "right" | "bottom" | "left";
|
|
1470
|
+
|
|
1471
|
+
declare type ProjectionListener = (state: ProjectionState) => void;
|
|
1472
|
+
|
|
1473
|
+
declare interface ProjectionState {
|
|
1474
|
+
direction: ProjectionDirection | null;
|
|
1475
|
+
value: string;
|
|
1476
|
+
element: HTMLElement | null;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
declare interface ProjectionSystem {
|
|
1480
|
+
getState: () => ProjectionState;
|
|
1481
|
+
setDirection: (direction: ProjectionDirection | null) => void;
|
|
1482
|
+
setElement: (element: HTMLElement | null) => void;
|
|
1483
|
+
appendValue: (char: string, max?: number) => void;
|
|
1484
|
+
capValue: (max: number) => void;
|
|
1485
|
+
backspace: () => void;
|
|
1486
|
+
clear: () => void;
|
|
1487
|
+
onUpdate: (listener: ProjectionListener) => () => void;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
export declare type Rect = Prettify<z.infer<typeof RectSchema>>;
|
|
1491
|
+
|
|
1492
|
+
declare const RectSchema: z.ZodObject<{
|
|
1493
|
+
top: z.ZodNumber;
|
|
1494
|
+
right: z.ZodNumber;
|
|
1495
|
+
bottom: z.ZodNumber;
|
|
1496
|
+
left: z.ZodNumber;
|
|
1497
|
+
width: z.ZodNumber;
|
|
1498
|
+
height: z.ZodNumber;
|
|
1499
|
+
x: z.ZodNumber;
|
|
1500
|
+
y: z.ZodNumber;
|
|
1501
|
+
}, z.core.$strip>;
|
|
1502
|
+
|
|
1503
|
+
declare type Remap<T, U> = Prettify_2<Omit<T, keyof U> & U>;
|
|
1504
|
+
|
|
1505
|
+
declare interface RulerLine {
|
|
1506
|
+
id: string;
|
|
1507
|
+
type: "horizontal" | "vertical";
|
|
1508
|
+
position: number;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
declare type RulerListener = (state: RulerState) => void;
|
|
1512
|
+
|
|
1513
|
+
declare interface RulerState {
|
|
1514
|
+
lines: RulerLine[];
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
declare interface RulerSystem {
|
|
1518
|
+
getState: () => RulerState;
|
|
1519
|
+
addPair: (x: number, y: number) => string | null;
|
|
1520
|
+
updateLine: (id: string, position: number) => void;
|
|
1521
|
+
removeLine: (id: string) => void;
|
|
1522
|
+
clear: () => void;
|
|
1523
|
+
onUpdate: (listener: RulerListener) => () => void;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
export declare type ScrollState = Prettify<z.infer<typeof ScrollStateSchema>>;
|
|
1527
|
+
|
|
1528
|
+
declare interface ScrollState_2 extends ScrollState {
|
|
1529
|
+
element?: HTMLElement;
|
|
1530
|
+
containerRect: DOMRect | null;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
declare const ScrollStateSchema: z.ZodObject<{
|
|
1534
|
+
initialScrollTop: z.ZodNumber;
|
|
1535
|
+
initialScrollLeft: z.ZodNumber;
|
|
1536
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
1537
|
+
top: z.ZodNumber;
|
|
1538
|
+
right: z.ZodNumber;
|
|
1539
|
+
bottom: z.ZodNumber;
|
|
1540
|
+
left: z.ZodNumber;
|
|
1541
|
+
width: z.ZodNumber;
|
|
1542
|
+
height: z.ZodNumber;
|
|
1543
|
+
x: z.ZodNumber;
|
|
1544
|
+
y: z.ZodNumber;
|
|
1545
|
+
}, z.core.$strip>>;
|
|
1546
|
+
absoluteDepth: z.ZodNumber;
|
|
1547
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
1548
|
+
}, z.core.$strip>;
|
|
1549
|
+
|
|
1550
|
+
export declare type SelectionMetadata = Prettify<z.infer<typeof SelectionMetadataSchema>>;
|
|
1551
|
+
|
|
1552
|
+
/**
|
|
1553
|
+
* Selection system for tracking selected elements
|
|
1554
|
+
*/
|
|
1555
|
+
declare type SelectionMetadata_2 = Remap<SelectionMetadata, {
|
|
1556
|
+
element: Element | null;
|
|
1557
|
+
rect: DOMRect | null;
|
|
1558
|
+
scrollHierarchy: ScrollState_2[];
|
|
1559
|
+
}>;
|
|
1560
|
+
|
|
1561
|
+
declare const SelectionMetadataSchema: z.ZodObject<{
|
|
1562
|
+
rect: z.ZodNullable<z.ZodObject<{
|
|
1563
|
+
top: z.ZodNumber;
|
|
1564
|
+
right: z.ZodNumber;
|
|
1565
|
+
bottom: z.ZodNumber;
|
|
1566
|
+
left: z.ZodNumber;
|
|
1567
|
+
width: z.ZodNumber;
|
|
1568
|
+
height: z.ZodNumber;
|
|
1569
|
+
x: z.ZodNumber;
|
|
1570
|
+
y: z.ZodNumber;
|
|
1571
|
+
}, z.core.$strip>>;
|
|
1572
|
+
scrollHierarchy: z.ZodArray<z.ZodObject<{
|
|
1573
|
+
initialScrollTop: z.ZodNumber;
|
|
1574
|
+
initialScrollLeft: z.ZodNumber;
|
|
1575
|
+
containerRect: z.ZodNullable<z.ZodObject<{
|
|
1576
|
+
top: z.ZodNumber;
|
|
1577
|
+
right: z.ZodNumber;
|
|
1578
|
+
bottom: z.ZodNumber;
|
|
1579
|
+
left: z.ZodNumber;
|
|
1580
|
+
width: z.ZodNumber;
|
|
1581
|
+
height: z.ZodNumber;
|
|
1582
|
+
x: z.ZodNumber;
|
|
1583
|
+
y: z.ZodNumber;
|
|
1584
|
+
}, z.core.$strip>>;
|
|
1585
|
+
absoluteDepth: z.ZodNumber;
|
|
1586
|
+
hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
|
|
1587
|
+
}, z.core.$strip>>;
|
|
1588
|
+
position: z.ZodEnum<{
|
|
1589
|
+
static: "static";
|
|
1590
|
+
relative: "relative";
|
|
1591
|
+
absolute: "absolute";
|
|
1592
|
+
fixed: "fixed";
|
|
1593
|
+
sticky: "sticky";
|
|
1594
|
+
}>;
|
|
1595
|
+
stickyConfig: z.ZodOptional<z.ZodObject<{
|
|
1596
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
1597
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
1598
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
1599
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
1600
|
+
naturalTop: z.ZodNumber;
|
|
1601
|
+
naturalLeft: z.ZodNumber;
|
|
1602
|
+
containerWidth: z.ZodNumber;
|
|
1603
|
+
containerHeight: z.ZodNumber;
|
|
1604
|
+
elementWidth: z.ZodNumber;
|
|
1605
|
+
elementHeight: z.ZodNumber;
|
|
1606
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
1607
|
+
}, z.core.$strip>>;
|
|
1608
|
+
initialWindowX: z.ZodNumber;
|
|
1609
|
+
initialWindowY: z.ZodNumber;
|
|
1610
|
+
depth: z.ZodNumber;
|
|
1611
|
+
hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
|
|
1612
|
+
}, z.core.$strip>;
|
|
1613
|
+
|
|
1614
|
+
declare interface SelectionSystem {
|
|
1615
|
+
select: (element: Element | null) => void;
|
|
1616
|
+
getSelected: () => Element | null;
|
|
1617
|
+
getSelectedRect: () => DOMRect | null;
|
|
1618
|
+
getMetadata: () => SelectionMetadata_2;
|
|
1619
|
+
clear: () => void;
|
|
1620
|
+
onUpdate: (callback: (metadata: SelectionMetadata_2) => void) => () => void;
|
|
1621
|
+
updateRect: (rect: DOMRect) => void;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
export declare type StickyConfig = Prettify<z.infer<typeof StickyConfigSchema>>;
|
|
1625
|
+
|
|
1626
|
+
declare const StickyConfigSchema: z.ZodObject<{
|
|
1627
|
+
top: z.ZodNullable<z.ZodNumber>;
|
|
1628
|
+
bottom: z.ZodNullable<z.ZodNumber>;
|
|
1629
|
+
left: z.ZodNullable<z.ZodNumber>;
|
|
1630
|
+
right: z.ZodNullable<z.ZodNumber>;
|
|
1631
|
+
naturalTop: z.ZodNumber;
|
|
1632
|
+
naturalLeft: z.ZodNumber;
|
|
1633
|
+
containerWidth: z.ZodNumber;
|
|
1634
|
+
containerHeight: z.ZodNumber;
|
|
1635
|
+
elementWidth: z.ZodNumber;
|
|
1636
|
+
elementHeight: z.ZodNumber;
|
|
1637
|
+
anchorAbsoluteDepth: z.ZodNumber;
|
|
1638
|
+
}, z.core.$strip>;
|
|
1639
|
+
|
|
1640
|
+
declare const ViewportSchema: z.ZodObject<{
|
|
1641
|
+
width: z.ZodNumber;
|
|
1642
|
+
height: z.ZodNumber;
|
|
1643
|
+
scrollX: z.ZodNumber;
|
|
1644
|
+
scrollY: z.ZodNumber;
|
|
1645
|
+
}, z.core.$strip>;
|
|
1646
|
+
|
|
1647
|
+
export declare type ViewportState = z.infer<typeof ViewportSchema>;
|
|
1648
|
+
|
|
1649
|
+
export { }
|