@merittdev/horus-lens 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/browser.cjs +259 -209
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +3 -2
- package/dist/chunk-AS225HUA.js +15344 -0
- package/dist/chunk-AS225HUA.js.map +1 -0
- package/dist/{chunk-4E427AKG.js → chunk-RVIL2GL4.js} +5 -3
- package/dist/{chunk-4E427AKG.js.map → chunk-RVIL2GL4.js.map} +1 -1
- package/dist/chunk-XGZ7BZTS.js +15082 -0
- package/dist/chunk-XGZ7BZTS.js.map +1 -0
- package/dist/index.cjs +259 -209
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +4 -2
- package/dist/lens.min.js +31 -31
- package/dist/{chunk-25CZMYQK.js → react-native.cjs} +2741 -15984
- package/dist/react-native.cjs.map +1 -0
- package/dist/react-native.d.cts +492 -0
- package/dist/react-native.d.ts +492 -0
- package/dist/react-native.js +2105 -0
- package/dist/react-native.js.map +1 -0
- package/dist/react.cjs +259 -209
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +3 -2
- package/dist/react.js.map +1 -1
- package/package.json +25 -3
- package/dist/chunk-25CZMYQK.js.map +0 -1
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
declare const ConsoleEntrySchema: z.ZodObject<{
|
|
6
|
+
level: z.ZodEnum<{
|
|
7
|
+
log: "log";
|
|
8
|
+
info: "info";
|
|
9
|
+
warn: "warn";
|
|
10
|
+
error: "error";
|
|
11
|
+
debug: "debug";
|
|
12
|
+
}>;
|
|
13
|
+
args: z.ZodArray<z.ZodString>;
|
|
14
|
+
timestamp: z.ZodNumber;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
type ConsoleEntry = z.infer<typeof ConsoleEntrySchema>;
|
|
17
|
+
declare const NetworkEntrySchema: z.ZodObject<{
|
|
18
|
+
method: z.ZodString;
|
|
19
|
+
url: z.ZodString;
|
|
20
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
21
|
+
ok: z.ZodNullable<z.ZodBoolean>;
|
|
22
|
+
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
23
|
+
requestType: z.ZodEnum<{
|
|
24
|
+
fetch: "fetch";
|
|
25
|
+
xhr: "xhr";
|
|
26
|
+
}>;
|
|
27
|
+
startedAt: z.ZodNumber;
|
|
28
|
+
error: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
type NetworkEntry = z.infer<typeof NetworkEntrySchema>;
|
|
31
|
+
declare const ErrorEntrySchema: z.ZodObject<{
|
|
32
|
+
message: z.ZodString;
|
|
33
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
34
|
+
source: z.ZodEnum<{
|
|
35
|
+
"window.onerror": "window.onerror";
|
|
36
|
+
unhandledrejection: "unhandledrejection";
|
|
37
|
+
"console.error": "console.error";
|
|
38
|
+
"react-boundary": "react-boundary";
|
|
39
|
+
}>;
|
|
40
|
+
timestamp: z.ZodNumber;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
type ErrorEntry = z.infer<typeof ErrorEntrySchema>;
|
|
43
|
+
declare const AppContextSchema: z.ZodObject<{
|
|
44
|
+
release: z.ZodOptional<z.ZodString>;
|
|
45
|
+
gitSha: z.ZodOptional<z.ZodString>;
|
|
46
|
+
environment: z.ZodOptional<z.ZodString>;
|
|
47
|
+
featureFlags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber]>>>;
|
|
48
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
id: z.ZodOptional<z.ZodString>;
|
|
50
|
+
email: z.ZodOptional<z.ZodString>;
|
|
51
|
+
name: z.ZodOptional<z.ZodString>;
|
|
52
|
+
organization: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
type AppContext = z.infer<typeof AppContextSchema>;
|
|
57
|
+
/** DOM path + React fiber path of the element the reporter targeted. */
|
|
58
|
+
declare const TargetElementSchema: z.ZodObject<{
|
|
59
|
+
domPath: z.ZodOptional<z.ZodString>;
|
|
60
|
+
tagName: z.ZodOptional<z.ZodString>;
|
|
61
|
+
text: z.ZodOptional<z.ZodString>;
|
|
62
|
+
boundingRect: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
x: z.ZodNumber;
|
|
64
|
+
y: z.ZodNumber;
|
|
65
|
+
width: z.ZodNumber;
|
|
66
|
+
height: z.ZodNumber;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
reactComponents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
type TargetElement = z.infer<typeof TargetElementSchema>;
|
|
71
|
+
declare const AnnotationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
72
|
+
kind: z.ZodLiteral<"rect">;
|
|
73
|
+
x: z.ZodNumber;
|
|
74
|
+
y: z.ZodNumber;
|
|
75
|
+
width: z.ZodNumber;
|
|
76
|
+
height: z.ZodNumber;
|
|
77
|
+
viewport: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
width: z.ZodNumber;
|
|
79
|
+
height: z.ZodNumber;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
id: z.ZodOptional<z.ZodString>;
|
|
82
|
+
color: z.ZodOptional<z.ZodString>;
|
|
83
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
85
|
+
kind: z.ZodLiteral<"ellipse">;
|
|
86
|
+
x: z.ZodNumber;
|
|
87
|
+
y: z.ZodNumber;
|
|
88
|
+
width: z.ZodNumber;
|
|
89
|
+
height: z.ZodNumber;
|
|
90
|
+
id: z.ZodOptional<z.ZodString>;
|
|
91
|
+
color: z.ZodOptional<z.ZodString>;
|
|
92
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
94
|
+
kind: z.ZodLiteral<"blur">;
|
|
95
|
+
x: z.ZodNumber;
|
|
96
|
+
y: z.ZodNumber;
|
|
97
|
+
width: z.ZodNumber;
|
|
98
|
+
height: z.ZodNumber;
|
|
99
|
+
id: z.ZodOptional<z.ZodString>;
|
|
100
|
+
color: z.ZodOptional<z.ZodString>;
|
|
101
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
103
|
+
kind: z.ZodLiteral<"arrow">;
|
|
104
|
+
x1: z.ZodNumber;
|
|
105
|
+
y1: z.ZodNumber;
|
|
106
|
+
x2: z.ZodNumber;
|
|
107
|
+
y2: z.ZodNumber;
|
|
108
|
+
id: z.ZodOptional<z.ZodString>;
|
|
109
|
+
color: z.ZodOptional<z.ZodString>;
|
|
110
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
112
|
+
kind: z.ZodLiteral<"line">;
|
|
113
|
+
x1: z.ZodNumber;
|
|
114
|
+
y1: z.ZodNumber;
|
|
115
|
+
x2: z.ZodNumber;
|
|
116
|
+
y2: z.ZodNumber;
|
|
117
|
+
id: z.ZodOptional<z.ZodString>;
|
|
118
|
+
color: z.ZodOptional<z.ZodString>;
|
|
119
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
121
|
+
kind: z.ZodLiteral<"pencil">;
|
|
122
|
+
points: z.ZodArray<z.ZodObject<{
|
|
123
|
+
x: z.ZodNumber;
|
|
124
|
+
y: z.ZodNumber;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
id: z.ZodOptional<z.ZodString>;
|
|
127
|
+
color: z.ZodOptional<z.ZodString>;
|
|
128
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
130
|
+
kind: z.ZodLiteral<"highlighter">;
|
|
131
|
+
points: z.ZodArray<z.ZodObject<{
|
|
132
|
+
x: z.ZodNumber;
|
|
133
|
+
y: z.ZodNumber;
|
|
134
|
+
}, z.core.$strip>>;
|
|
135
|
+
id: z.ZodOptional<z.ZodString>;
|
|
136
|
+
color: z.ZodOptional<z.ZodString>;
|
|
137
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
139
|
+
kind: z.ZodLiteral<"text">;
|
|
140
|
+
x: z.ZodNumber;
|
|
141
|
+
y: z.ZodNumber;
|
|
142
|
+
text: z.ZodString;
|
|
143
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
id: z.ZodOptional<z.ZodString>;
|
|
145
|
+
color: z.ZodOptional<z.ZodString>;
|
|
146
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
148
|
+
kind: z.ZodLiteral<"step">;
|
|
149
|
+
x: z.ZodNumber;
|
|
150
|
+
y: z.ZodNumber;
|
|
151
|
+
n: z.ZodNumber;
|
|
152
|
+
id: z.ZodOptional<z.ZodString>;
|
|
153
|
+
color: z.ZodOptional<z.ZodString>;
|
|
154
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
}, z.core.$strip>], "kind">;
|
|
156
|
+
type Annotation = z.infer<typeof AnnotationSchema>;
|
|
157
|
+
/**
|
|
158
|
+
* What caused the report to be submitted:
|
|
159
|
+
* - `user` — an explicit submit from the overlay UI.
|
|
160
|
+
* - `api` — a programmatic `useLens().report()` / `client.submitReport()`.
|
|
161
|
+
* - `error` — an unhandled error auto-captured by the SDK (no user intent).
|
|
162
|
+
*/
|
|
163
|
+
declare const ReportTriggerSchema: z.ZodEnum<{
|
|
164
|
+
error: "error";
|
|
165
|
+
user: "user";
|
|
166
|
+
api: "api";
|
|
167
|
+
}>;
|
|
168
|
+
type ReportTrigger = z.infer<typeof ReportTriggerSchema>;
|
|
169
|
+
declare const ReportMetadataSchema: z.ZodObject<{
|
|
170
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
171
|
+
annotations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
172
|
+
kind: z.ZodLiteral<"rect">;
|
|
173
|
+
x: z.ZodNumber;
|
|
174
|
+
y: z.ZodNumber;
|
|
175
|
+
width: z.ZodNumber;
|
|
176
|
+
height: z.ZodNumber;
|
|
177
|
+
viewport: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
width: z.ZodNumber;
|
|
179
|
+
height: z.ZodNumber;
|
|
180
|
+
}, z.core.$strip>>;
|
|
181
|
+
id: z.ZodOptional<z.ZodString>;
|
|
182
|
+
color: z.ZodOptional<z.ZodString>;
|
|
183
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
185
|
+
kind: z.ZodLiteral<"ellipse">;
|
|
186
|
+
x: z.ZodNumber;
|
|
187
|
+
y: z.ZodNumber;
|
|
188
|
+
width: z.ZodNumber;
|
|
189
|
+
height: z.ZodNumber;
|
|
190
|
+
id: z.ZodOptional<z.ZodString>;
|
|
191
|
+
color: z.ZodOptional<z.ZodString>;
|
|
192
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
194
|
+
kind: z.ZodLiteral<"blur">;
|
|
195
|
+
x: z.ZodNumber;
|
|
196
|
+
y: z.ZodNumber;
|
|
197
|
+
width: z.ZodNumber;
|
|
198
|
+
height: z.ZodNumber;
|
|
199
|
+
id: z.ZodOptional<z.ZodString>;
|
|
200
|
+
color: z.ZodOptional<z.ZodString>;
|
|
201
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
203
|
+
kind: z.ZodLiteral<"arrow">;
|
|
204
|
+
x1: z.ZodNumber;
|
|
205
|
+
y1: z.ZodNumber;
|
|
206
|
+
x2: z.ZodNumber;
|
|
207
|
+
y2: z.ZodNumber;
|
|
208
|
+
id: z.ZodOptional<z.ZodString>;
|
|
209
|
+
color: z.ZodOptional<z.ZodString>;
|
|
210
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
212
|
+
kind: z.ZodLiteral<"line">;
|
|
213
|
+
x1: z.ZodNumber;
|
|
214
|
+
y1: z.ZodNumber;
|
|
215
|
+
x2: z.ZodNumber;
|
|
216
|
+
y2: z.ZodNumber;
|
|
217
|
+
id: z.ZodOptional<z.ZodString>;
|
|
218
|
+
color: z.ZodOptional<z.ZodString>;
|
|
219
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
221
|
+
kind: z.ZodLiteral<"pencil">;
|
|
222
|
+
points: z.ZodArray<z.ZodObject<{
|
|
223
|
+
x: z.ZodNumber;
|
|
224
|
+
y: z.ZodNumber;
|
|
225
|
+
}, z.core.$strip>>;
|
|
226
|
+
id: z.ZodOptional<z.ZodString>;
|
|
227
|
+
color: z.ZodOptional<z.ZodString>;
|
|
228
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
229
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
230
|
+
kind: z.ZodLiteral<"highlighter">;
|
|
231
|
+
points: z.ZodArray<z.ZodObject<{
|
|
232
|
+
x: z.ZodNumber;
|
|
233
|
+
y: z.ZodNumber;
|
|
234
|
+
}, z.core.$strip>>;
|
|
235
|
+
id: z.ZodOptional<z.ZodString>;
|
|
236
|
+
color: z.ZodOptional<z.ZodString>;
|
|
237
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
238
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
239
|
+
kind: z.ZodLiteral<"text">;
|
|
240
|
+
x: z.ZodNumber;
|
|
241
|
+
y: z.ZodNumber;
|
|
242
|
+
text: z.ZodString;
|
|
243
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
244
|
+
id: z.ZodOptional<z.ZodString>;
|
|
245
|
+
color: z.ZodOptional<z.ZodString>;
|
|
246
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
247
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
248
|
+
kind: z.ZodLiteral<"step">;
|
|
249
|
+
x: z.ZodNumber;
|
|
250
|
+
y: z.ZodNumber;
|
|
251
|
+
n: z.ZodNumber;
|
|
252
|
+
id: z.ZodOptional<z.ZodString>;
|
|
253
|
+
color: z.ZodOptional<z.ZodString>;
|
|
254
|
+
strokeWidth: z.ZodOptional<z.ZodNumber>;
|
|
255
|
+
}, z.core.$strip>], "kind">>>;
|
|
256
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
257
|
+
domPath: z.ZodOptional<z.ZodString>;
|
|
258
|
+
tagName: z.ZodOptional<z.ZodString>;
|
|
259
|
+
text: z.ZodOptional<z.ZodString>;
|
|
260
|
+
boundingRect: z.ZodOptional<z.ZodObject<{
|
|
261
|
+
x: z.ZodNumber;
|
|
262
|
+
y: z.ZodNumber;
|
|
263
|
+
width: z.ZodNumber;
|
|
264
|
+
height: z.ZodNumber;
|
|
265
|
+
}, z.core.$strip>>;
|
|
266
|
+
reactComponents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
267
|
+
}, z.core.$strip>>;
|
|
268
|
+
env: z.ZodObject<{
|
|
269
|
+
url: z.ZodString;
|
|
270
|
+
route: z.ZodOptional<z.ZodString>;
|
|
271
|
+
referrer: z.ZodOptional<z.ZodString>;
|
|
272
|
+
userAgent: z.ZodString;
|
|
273
|
+
browser: z.ZodOptional<z.ZodString>;
|
|
274
|
+
os: z.ZodOptional<z.ZodString>;
|
|
275
|
+
device: z.ZodOptional<z.ZodEnum<{
|
|
276
|
+
desktop: "desktop";
|
|
277
|
+
tablet: "tablet";
|
|
278
|
+
mobile: "mobile";
|
|
279
|
+
}>>;
|
|
280
|
+
viewport: z.ZodObject<{
|
|
281
|
+
width: z.ZodNumber;
|
|
282
|
+
height: z.ZodNumber;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
screen: z.ZodObject<{
|
|
285
|
+
width: z.ZodNumber;
|
|
286
|
+
height: z.ZodNumber;
|
|
287
|
+
}, z.core.$strip>;
|
|
288
|
+
devicePixelRatio: z.ZodNumber;
|
|
289
|
+
language: z.ZodString;
|
|
290
|
+
timezone: z.ZodString;
|
|
291
|
+
theme: z.ZodOptional<z.ZodEnum<{
|
|
292
|
+
light: "light";
|
|
293
|
+
dark: "dark";
|
|
294
|
+
}>>;
|
|
295
|
+
online: z.ZodOptional<z.ZodBoolean>;
|
|
296
|
+
capturedAt: z.ZodNumber;
|
|
297
|
+
}, z.core.$strip>;
|
|
298
|
+
app: z.ZodOptional<z.ZodObject<{
|
|
299
|
+
release: z.ZodOptional<z.ZodString>;
|
|
300
|
+
gitSha: z.ZodOptional<z.ZodString>;
|
|
301
|
+
environment: z.ZodOptional<z.ZodString>;
|
|
302
|
+
featureFlags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber]>>>;
|
|
303
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
304
|
+
id: z.ZodOptional<z.ZodString>;
|
|
305
|
+
email: z.ZodOptional<z.ZodString>;
|
|
306
|
+
name: z.ZodOptional<z.ZodString>;
|
|
307
|
+
organization: z.ZodOptional<z.ZodString>;
|
|
308
|
+
}, z.core.$strip>>;
|
|
309
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
310
|
+
}, z.core.$strip>>;
|
|
311
|
+
errors: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
312
|
+
message: z.ZodString;
|
|
313
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
314
|
+
source: z.ZodEnum<{
|
|
315
|
+
"window.onerror": "window.onerror";
|
|
316
|
+
unhandledrejection: "unhandledrejection";
|
|
317
|
+
"console.error": "console.error";
|
|
318
|
+
"react-boundary": "react-boundary";
|
|
319
|
+
}>;
|
|
320
|
+
timestamp: z.ZodNumber;
|
|
321
|
+
}, z.core.$strip>>>;
|
|
322
|
+
consoleTail: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
323
|
+
level: z.ZodEnum<{
|
|
324
|
+
log: "log";
|
|
325
|
+
info: "info";
|
|
326
|
+
warn: "warn";
|
|
327
|
+
error: "error";
|
|
328
|
+
debug: "debug";
|
|
329
|
+
}>;
|
|
330
|
+
args: z.ZodArray<z.ZodString>;
|
|
331
|
+
timestamp: z.ZodNumber;
|
|
332
|
+
}, z.core.$strip>>>;
|
|
333
|
+
networkTail: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
334
|
+
method: z.ZodString;
|
|
335
|
+
url: z.ZodString;
|
|
336
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
337
|
+
ok: z.ZodNullable<z.ZodBoolean>;
|
|
338
|
+
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
339
|
+
requestType: z.ZodEnum<{
|
|
340
|
+
fetch: "fetch";
|
|
341
|
+
xhr: "xhr";
|
|
342
|
+
}>;
|
|
343
|
+
startedAt: z.ZodNumber;
|
|
344
|
+
error: z.ZodOptional<z.ZodString>;
|
|
345
|
+
}, z.core.$strip>>>;
|
|
346
|
+
trigger: z.ZodOptional<z.ZodEnum<{
|
|
347
|
+
error: "error";
|
|
348
|
+
user: "user";
|
|
349
|
+
api: "api";
|
|
350
|
+
}>>;
|
|
351
|
+
sdk: z.ZodObject<{
|
|
352
|
+
name: z.ZodString;
|
|
353
|
+
version: z.ZodString;
|
|
354
|
+
}, z.core.$strip>;
|
|
355
|
+
}, z.core.$strip>;
|
|
356
|
+
type ReportMetadata = z.infer<typeof ReportMetadataSchema>;
|
|
357
|
+
|
|
358
|
+
interface NativeImage {
|
|
359
|
+
/** PNG/JPEG data URI or a native screenshot temporary file URI. */
|
|
360
|
+
uri: string;
|
|
361
|
+
width: number;
|
|
362
|
+
height: number;
|
|
363
|
+
}
|
|
364
|
+
type NativeScreenCapture = (purpose: "screenshot" | "replay") => Promise<NativeImage | null>;
|
|
365
|
+
interface NativeFrame extends NativeImage {
|
|
366
|
+
timestamp: number;
|
|
367
|
+
route: string;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
interface NativeCapture {
|
|
371
|
+
metadata: ReportMetadata;
|
|
372
|
+
console: ConsoleEntry[];
|
|
373
|
+
network: NetworkEntry[];
|
|
374
|
+
screenshot?: NativeImage;
|
|
375
|
+
replay: NativeFrame[];
|
|
376
|
+
}
|
|
377
|
+
interface NativeLensConfig {
|
|
378
|
+
accessId: string;
|
|
379
|
+
/** HTTP(S) site origin already allowed by this Lens project in Horus Cloud. */
|
|
380
|
+
origin: string;
|
|
381
|
+
endpoint?: string;
|
|
382
|
+
app?: AppContext;
|
|
383
|
+
/** Console logs may contain personal data. Disabled unless explicitly enabled. */
|
|
384
|
+
captureConsole?: boolean;
|
|
385
|
+
captureNetwork?: boolean;
|
|
386
|
+
/** Redact both uploaded assets and inline metadata, or return null to cancel. */
|
|
387
|
+
beforeSend?: (capture: NativeCapture) => NativeCapture | null;
|
|
388
|
+
/** Native host view capture; never invoked until the reporter requests it. */
|
|
389
|
+
captureScreen?: NativeScreenCapture;
|
|
390
|
+
}
|
|
391
|
+
interface NativeReportInput {
|
|
392
|
+
comment?: string;
|
|
393
|
+
trigger?: ReportTrigger;
|
|
394
|
+
include?: {
|
|
395
|
+
console?: boolean;
|
|
396
|
+
network?: boolean;
|
|
397
|
+
errors?: boolean;
|
|
398
|
+
screenshot?: boolean;
|
|
399
|
+
replay?: boolean;
|
|
400
|
+
};
|
|
401
|
+
screenshot?: NativeImage;
|
|
402
|
+
annotations?: Annotation[];
|
|
403
|
+
target?: TargetElement;
|
|
404
|
+
}
|
|
405
|
+
declare class NativeLensClient {
|
|
406
|
+
private readonly config;
|
|
407
|
+
private readonly origin;
|
|
408
|
+
private transport;
|
|
409
|
+
private lifecycle;
|
|
410
|
+
private readonly logs;
|
|
411
|
+
private readonly requests;
|
|
412
|
+
private readonly errors;
|
|
413
|
+
private readonly breadcrumbs;
|
|
414
|
+
private teardowns;
|
|
415
|
+
private started;
|
|
416
|
+
private submitting;
|
|
417
|
+
private retryCapture?;
|
|
418
|
+
private route;
|
|
419
|
+
private language?;
|
|
420
|
+
private app;
|
|
421
|
+
private readonly recording?;
|
|
422
|
+
private readonly rawFetch;
|
|
423
|
+
constructor(config: NativeLensConfig);
|
|
424
|
+
start(): void;
|
|
425
|
+
stop(): void;
|
|
426
|
+
captureScreen(): Promise<NativeImage | null>;
|
|
427
|
+
startRecording(): void;
|
|
428
|
+
stopRecording(): Promise<NativeFrame[] | never[]>;
|
|
429
|
+
discardDraft(): void;
|
|
430
|
+
discardRecording(): void;
|
|
431
|
+
getRecording(): {
|
|
432
|
+
active: boolean;
|
|
433
|
+
frameCount: number;
|
|
434
|
+
durationMs: number;
|
|
435
|
+
error: string | undefined;
|
|
436
|
+
};
|
|
437
|
+
getContext(): {
|
|
438
|
+
url: string;
|
|
439
|
+
userAgent: string;
|
|
440
|
+
viewport: {
|
|
441
|
+
width: number;
|
|
442
|
+
height: number;
|
|
443
|
+
};
|
|
444
|
+
screen: {
|
|
445
|
+
width: number;
|
|
446
|
+
height: number;
|
|
447
|
+
};
|
|
448
|
+
devicePixelRatio: number;
|
|
449
|
+
language: string;
|
|
450
|
+
timezone: string;
|
|
451
|
+
capturedAt: number;
|
|
452
|
+
route?: string | undefined;
|
|
453
|
+
referrer?: string | undefined;
|
|
454
|
+
browser?: string | undefined;
|
|
455
|
+
os?: string | undefined;
|
|
456
|
+
device?: "desktop" | "tablet" | "mobile" | undefined;
|
|
457
|
+
theme?: "light" | "dark" | undefined;
|
|
458
|
+
online?: boolean | undefined;
|
|
459
|
+
};
|
|
460
|
+
setRoute(route: string, language?: string): void;
|
|
461
|
+
setApp(app: Partial<AppContext>): void;
|
|
462
|
+
captureError(error: Error, componentStack?: string): void;
|
|
463
|
+
private addBreadcrumb;
|
|
464
|
+
submitReport(input?: NativeReportInput): Promise<{
|
|
465
|
+
reportId: string;
|
|
466
|
+
}>;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
interface LensProps extends NativeLensConfig {
|
|
470
|
+
enabled?: boolean;
|
|
471
|
+
route?: string;
|
|
472
|
+
language?: string;
|
|
473
|
+
showButton?: boolean;
|
|
474
|
+
children?: ReactNode;
|
|
475
|
+
}
|
|
476
|
+
declare function Lens(props: LensProps): react.JSX.Element;
|
|
477
|
+
declare const LensProvider: typeof Lens;
|
|
478
|
+
declare function useLens(): {
|
|
479
|
+
active: boolean;
|
|
480
|
+
open: () => void;
|
|
481
|
+
close: () => void;
|
|
482
|
+
identify: (user: NonNullable<AppContext["user"]>) => void | undefined;
|
|
483
|
+
setApp: (app: Partial<AppContext>) => void | undefined;
|
|
484
|
+
captureError: (error: Error, componentStack?: string) => void | undefined;
|
|
485
|
+
record: () => void | undefined;
|
|
486
|
+
stopRecording: () => Promise<NativeFrame[] | never[]>;
|
|
487
|
+
report: (input?: NativeReportInput) => Promise<{
|
|
488
|
+
reportId: string;
|
|
489
|
+
} | null>;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
export { type Annotation, type AppContext, type ConsoleEntry, type ErrorEntry, Lens, type LensProps, LensProvider, type NativeCapture, type NativeFrame, type NativeImage, NativeLensClient, type NativeLensConfig, type NativeReportInput, type NativeScreenCapture, type NetworkEntry, type ReportMetadata, type TargetElement, useLens };
|