@ansight/react-native 1.0.2-preview.1
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/AnsightReactNative.podspec +20 -0
- package/LICENSE +200 -0
- package/README.md +436 -0
- package/android/build.gradle +70 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/cpp/CMakeLists.txt +16 -0
- package/android/src/main/cpp/ansight_react_native_memory.cpp +57 -0
- package/android/src/main/kotlin/ai/ansight/reactnative/AnsightReactNativeModule.kt +1353 -0
- package/android/src/main/kotlin/ai/ansight/reactnative/AnsightReactNativePackage.kt +14 -0
- package/android/src/main/kotlin/ai/ansight/reactnative/ReactNativeMemoryProfiler.kt +167 -0
- package/index.d.ts +633 -0
- package/index.js +2303 -0
- package/ios/AnsightReactNative.swift +1635 -0
- package/ios/AnsightReactNativeMemorySampler.mm +130 -0
- package/ios/AnsightReactNativeModule.m +167 -0
- package/package.json +50 -0
- package/react-native.config.js +12 -0
- package/tsconfig.json +12 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,633 @@
|
|
|
1
|
+
export type AnsightLifecycleState = "unknown" | "foreground" | "background";
|
|
2
|
+
export type AnsightToolScope = "read" | "write" | "delete" | "Read" | "Write" | "Delete";
|
|
3
|
+
export type AnsightToolSecurityLevel =
|
|
4
|
+
| "unspecified"
|
|
5
|
+
| "low"
|
|
6
|
+
| "medium"
|
|
7
|
+
| "moderate"
|
|
8
|
+
| "high"
|
|
9
|
+
| "critical"
|
|
10
|
+
| "Unspecified"
|
|
11
|
+
| "Low"
|
|
12
|
+
| "Medium"
|
|
13
|
+
| "Moderate"
|
|
14
|
+
| "High"
|
|
15
|
+
| "Critical";
|
|
16
|
+
|
|
17
|
+
export interface AnsightChannel {
|
|
18
|
+
id: number;
|
|
19
|
+
name: string;
|
|
20
|
+
unit?: string;
|
|
21
|
+
type?: string;
|
|
22
|
+
colorHex?: string;
|
|
23
|
+
source?: string;
|
|
24
|
+
group?: string;
|
|
25
|
+
kind?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface AnsightReactNativeMemoryOptions {
|
|
29
|
+
enabled?: boolean;
|
|
30
|
+
jsHeap?: boolean;
|
|
31
|
+
jsHeapUsed?: boolean;
|
|
32
|
+
jsHeapTotal?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface AnsightSessionJpegCaptureOptions {
|
|
36
|
+
intervalMilliseconds?: number;
|
|
37
|
+
quality?: number;
|
|
38
|
+
maxWidth?: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface AnsightTouchCaptureOptions {
|
|
42
|
+
captureMoveEvents?: boolean;
|
|
43
|
+
captureCancelEvents?: boolean;
|
|
44
|
+
moveCaptureDistanceThreshold?: number;
|
|
45
|
+
moveCaptureFramesPerSecond?: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface AnsightNativeToolRoot {
|
|
49
|
+
alias: string;
|
|
50
|
+
path: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface AnsightFileSystemToolsOptions {
|
|
54
|
+
additionalRoots?: AnsightNativeToolRoot[];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface AnsightDatabaseToolsOptions {
|
|
58
|
+
additionalRoots?: AnsightNativeToolRoot[];
|
|
59
|
+
includePlatformRoots?: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface AnsightPreferencesToolsOptions {
|
|
63
|
+
defaultStore?: string;
|
|
64
|
+
allowedStores?: string[];
|
|
65
|
+
allowedKeys?: string[];
|
|
66
|
+
allowedKeyPrefixes?: string[];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface AnsightReflectionToolsOptions {
|
|
70
|
+
includeBuiltInRoots?: boolean;
|
|
71
|
+
allowedRootIds?: string[];
|
|
72
|
+
allowedTypePrefixes?: string[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface AnsightSecureStorageToolsOptions {
|
|
76
|
+
appleService?: string;
|
|
77
|
+
preferencesName?: string;
|
|
78
|
+
allowedKeys?: string[];
|
|
79
|
+
allowedKeyPrefixes?: string[];
|
|
80
|
+
allowedPrefixes?: string[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface AnsightVisualTreeToolsOptions {
|
|
84
|
+
enabled?: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface AnsightRemoteToolsOptions {
|
|
88
|
+
visualTree?: boolean | AnsightVisualTreeToolsOptions;
|
|
89
|
+
fileSystem?: AnsightFileSystemToolsOptions;
|
|
90
|
+
database?: AnsightDatabaseToolsOptions;
|
|
91
|
+
preferences?: AnsightPreferencesToolsOptions;
|
|
92
|
+
reflection?: AnsightReflectionToolsOptions;
|
|
93
|
+
secureStorage?: AnsightSecureStorageToolsOptions;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface AnsightOptions {
|
|
97
|
+
/**
|
|
98
|
+
* Applies the native iOS/Android all-in-one defaults when true.
|
|
99
|
+
*
|
|
100
|
+
* This is not a master SDK enable switch and does not inspect the app's
|
|
101
|
+
* runtime environment. Use your app's own condition, such as
|
|
102
|
+
* React Native's `__DEV__`, and configure `toolGuard`, capture options,
|
|
103
|
+
* `hostAutoProbe`, and `hostConnection` explicitly for the workflow.
|
|
104
|
+
*/
|
|
105
|
+
useNativeAllInOneDefaults?: boolean;
|
|
106
|
+
pairingConfig?: string | object;
|
|
107
|
+
bundledPairingConfig?: string | object;
|
|
108
|
+
pairingConfigJson?: string;
|
|
109
|
+
clientName?: string;
|
|
110
|
+
sampleFrequencyMilliseconds?: number;
|
|
111
|
+
retentionPeriodSeconds?: number;
|
|
112
|
+
enableFramesPerSecond?: boolean;
|
|
113
|
+
enableBatteryLevel?: boolean;
|
|
114
|
+
defaultMemoryChannels?: {
|
|
115
|
+
managedHeap?: boolean;
|
|
116
|
+
physicalFootprint?: boolean;
|
|
117
|
+
residentSetSize?: boolean;
|
|
118
|
+
javaHeap?: boolean;
|
|
119
|
+
nativeHeap?: boolean;
|
|
120
|
+
rss?: boolean;
|
|
121
|
+
};
|
|
122
|
+
reactNativeMemory?: false | AnsightReactNativeMemoryOptions;
|
|
123
|
+
sessionJpegCapture?: false | AnsightSessionJpegCaptureOptions;
|
|
124
|
+
touchCapture?: false | AnsightTouchCaptureOptions;
|
|
125
|
+
lifecycleCapture?: {
|
|
126
|
+
enabled?: boolean;
|
|
127
|
+
captureAppLifecycle?: boolean;
|
|
128
|
+
captureScreenViews?: boolean;
|
|
129
|
+
minimumScreenViewIntervalMilliseconds?: number;
|
|
130
|
+
};
|
|
131
|
+
toolGuard?: "disabled" | "readOnly" | "readWrite" | "full" | "fullAccess";
|
|
132
|
+
customProperties?: Record<string, Record<string, string>>;
|
|
133
|
+
hostAutoProbe?: {
|
|
134
|
+
enabled?: boolean;
|
|
135
|
+
initialDelayMilliseconds?: number;
|
|
136
|
+
probeIntervalMilliseconds?: number;
|
|
137
|
+
reconnectDelayMilliseconds?: number;
|
|
138
|
+
clientName?: string;
|
|
139
|
+
};
|
|
140
|
+
hostConnection?: {
|
|
141
|
+
savedConfigKey?: string;
|
|
142
|
+
bundledConfigJson?: string;
|
|
143
|
+
bundledDeveloperConfigJson?: string;
|
|
144
|
+
discoveryPort?: number;
|
|
145
|
+
connectionProfileRetentionSeconds?: number;
|
|
146
|
+
};
|
|
147
|
+
secureStorage?: {
|
|
148
|
+
preferencesName?: string;
|
|
149
|
+
allowedKeys?: string[];
|
|
150
|
+
allowedPrefixes?: string[];
|
|
151
|
+
};
|
|
152
|
+
remoteTools?: AnsightRemoteToolsOptions;
|
|
153
|
+
additionalChannels?: AnsightChannel[];
|
|
154
|
+
lifecycle?: boolean;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface AnsightOperationResult {
|
|
158
|
+
success: boolean;
|
|
159
|
+
message: string;
|
|
160
|
+
[key: string]: unknown;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface AnsightHostConnectionStatus {
|
|
164
|
+
isRuntimeActive: boolean;
|
|
165
|
+
isConnected: boolean;
|
|
166
|
+
connectionState: string;
|
|
167
|
+
hasCachedSession: boolean;
|
|
168
|
+
hasSavedConfig: boolean;
|
|
169
|
+
hasBundledConfig: boolean;
|
|
170
|
+
summaryKind: string;
|
|
171
|
+
summaryMessage: string;
|
|
172
|
+
[key: string]: unknown;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface AnsightHostConnectionCapabilities {
|
|
176
|
+
canConnectUsingSavedConfig: boolean;
|
|
177
|
+
canConnectUsingBundledConfig: boolean;
|
|
178
|
+
canChooseConfigFile: boolean;
|
|
179
|
+
canScanConfigQrCode: boolean;
|
|
180
|
+
canClearSavedConfigs: boolean;
|
|
181
|
+
[key: string]: unknown;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface AnsightHostConnectionStatusSnapshot {
|
|
185
|
+
status: AnsightHostConnectionStatus;
|
|
186
|
+
capabilities: AnsightHostConnectionCapabilities;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface AnsightLogEntry {
|
|
190
|
+
level: "debug" | "info" | "warning" | "error" | string;
|
|
191
|
+
message: string;
|
|
192
|
+
platform?: "ios" | "android" | string;
|
|
193
|
+
error?: string;
|
|
194
|
+
[key: string]: unknown;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface AnsightSubscription {
|
|
198
|
+
remove(): void;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface AnsightHostConnectionResult extends AnsightOperationResult {
|
|
202
|
+
kind?: string;
|
|
203
|
+
source?: string;
|
|
204
|
+
reasonCode?: string;
|
|
205
|
+
accepted?: boolean;
|
|
206
|
+
sessionId?: string;
|
|
207
|
+
configId?: string;
|
|
208
|
+
appId?: string;
|
|
209
|
+
resolvedHostAddress?: string;
|
|
210
|
+
usedEmbeddedDeveloperPairing?: boolean;
|
|
211
|
+
discoverySource?: string;
|
|
212
|
+
hostId?: string;
|
|
213
|
+
hostName?: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface AnsightScreenSnapshot {
|
|
217
|
+
name: string;
|
|
218
|
+
capturedAtUtc: string;
|
|
219
|
+
details?: Record<string, string>;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface AnsightDebugSnapshot {
|
|
223
|
+
initialized: boolean;
|
|
224
|
+
active: boolean;
|
|
225
|
+
sessionOpen: boolean;
|
|
226
|
+
lifecycleState?: string;
|
|
227
|
+
lifecycleChangedAtUtc?: string;
|
|
228
|
+
metricsRecorded: number;
|
|
229
|
+
eventsRecorded: number;
|
|
230
|
+
touchesRecorded?: number;
|
|
231
|
+
touchesCaptured?: number;
|
|
232
|
+
touchesSent?: number;
|
|
233
|
+
registeredTools: number;
|
|
234
|
+
executableTools?: number;
|
|
235
|
+
sessionMessage?: string;
|
|
236
|
+
connectionStatus: AnsightHostConnectionStatus;
|
|
237
|
+
channels: AnsightChannel[];
|
|
238
|
+
lastMetric?: AnsightRecordedMetric;
|
|
239
|
+
lastEvent?: AnsightRecordedEvent;
|
|
240
|
+
currentScreen?: AnsightScreenSnapshot;
|
|
241
|
+
[key: string]: unknown;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export type AnsightCurrentOptions = AnsightOptions & Record<string, unknown>;
|
|
245
|
+
|
|
246
|
+
export class AnsightOptionsBuilder {
|
|
247
|
+
constructor(options?: AnsightOptions);
|
|
248
|
+
withNativeAllInOneDefaults(): this;
|
|
249
|
+
withAnsightDefaults(): this;
|
|
250
|
+
withAnsightSdk(configure?: (builder: this) => void): this;
|
|
251
|
+
withSampleFrequencyMilliseconds(sampleFrequencyMilliseconds: number): this;
|
|
252
|
+
withFramesPerSecond(): this;
|
|
253
|
+
withoutFramesPerSecond(): this;
|
|
254
|
+
withBatteryLevel(): this;
|
|
255
|
+
withoutBatteryLevel(): this;
|
|
256
|
+
withRetentionPeriodSeconds(retentionPeriodSeconds: number): this;
|
|
257
|
+
withAdditionalChannels(additionalChannels: AnsightChannel[]): this;
|
|
258
|
+
addAdditionalChannel(additionalChannel: AnsightChannel): this;
|
|
259
|
+
withDefaultMemoryChannels(defaultMemoryChannels: NonNullable<AnsightOptions["defaultMemoryChannels"]>): this;
|
|
260
|
+
withoutDefaultMemoryChannels(defaultMemoryChannels: NonNullable<AnsightOptions["defaultMemoryChannels"]>): this;
|
|
261
|
+
withReactNativeMemoryProfiling(options?: AnsightReactNativeMemoryOptions): this;
|
|
262
|
+
withoutReactNativeMemoryProfiling(): this;
|
|
263
|
+
withSessionJpegCapture(options?: AnsightSessionJpegCaptureOptions): this;
|
|
264
|
+
withSessionJpegCapture(intervalMilliseconds: number, quality?: number, maxWidth?: number | null): this;
|
|
265
|
+
withoutSessionJpegCapture(): this;
|
|
266
|
+
withTouchCapture(touchCapture?: AnsightTouchCaptureOptions): this;
|
|
267
|
+
withoutTouchCapture(): this;
|
|
268
|
+
withLifecycleCapture(lifecycleCapture?: NonNullable<AnsightOptions["lifecycleCapture"]>): this;
|
|
269
|
+
withToolGuard(toolGuard: NonNullable<AnsightOptions["toolGuard"]>): this;
|
|
270
|
+
withToolsDisabled(): this;
|
|
271
|
+
withReadOnlyToolAccess(): this;
|
|
272
|
+
withReadWriteToolAccess(): this;
|
|
273
|
+
withAllToolAccess(): this;
|
|
274
|
+
registerCustomProperty(group: string, key: string, value: unknown): this;
|
|
275
|
+
removeCustomProperty(group: string, key: string): this;
|
|
276
|
+
clearCustomProperties(): this;
|
|
277
|
+
withHostAutoProbe(hostAutoProbe?: NonNullable<AnsightOptions["hostAutoProbe"]>): this;
|
|
278
|
+
withoutHostAutoProbe(): this;
|
|
279
|
+
withHostConnection(hostConnection?: NonNullable<AnsightOptions["hostConnection"]>): this;
|
|
280
|
+
configureHostConnection(
|
|
281
|
+
configure: (
|
|
282
|
+
hostConnection: NonNullable<AnsightOptions["hostConnection"]>
|
|
283
|
+
) => NonNullable<AnsightOptions["hostConnection"]> | void
|
|
284
|
+
): this;
|
|
285
|
+
withBundledHostConnection(options?: {
|
|
286
|
+
bundledDeveloperConfigJson?: string;
|
|
287
|
+
bundledConfigJson?: string;
|
|
288
|
+
}): this;
|
|
289
|
+
withHostConnectionDiscoveryPort(discoveryPort: number): this;
|
|
290
|
+
withHostConnectionProfileRetentionSeconds(connectionProfileRetentionSeconds: number): this;
|
|
291
|
+
withSecureStorage(secureStorage?: NonNullable<AnsightOptions["secureStorage"]>): this;
|
|
292
|
+
withRemoteTools(remoteTools?: AnsightRemoteToolsOptions): this;
|
|
293
|
+
withVisualTreeTools(options?: boolean | AnsightVisualTreeToolsOptions): this;
|
|
294
|
+
withoutVisualTreeTools(): this;
|
|
295
|
+
withFileSystemTools(options?: AnsightFileSystemToolsOptions): this;
|
|
296
|
+
withDatabaseTools(options?: AnsightDatabaseToolsOptions): this;
|
|
297
|
+
withPreferencesTools(options?: AnsightPreferencesToolsOptions): this;
|
|
298
|
+
withReflectionTools(options?: AnsightReflectionToolsOptions): this;
|
|
299
|
+
build(): AnsightOptions;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface AnsightToolSecurity {
|
|
303
|
+
level?: AnsightToolSecurityLevel;
|
|
304
|
+
summary?: string;
|
|
305
|
+
implications?: string[];
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface AnsightToolDefinition {
|
|
309
|
+
id: string;
|
|
310
|
+
name: string;
|
|
311
|
+
description?: string;
|
|
312
|
+
category?: string;
|
|
313
|
+
scope?: AnsightToolScope;
|
|
314
|
+
keywords?: string | string[];
|
|
315
|
+
argumentsSchema?: object;
|
|
316
|
+
resultSchema?: object;
|
|
317
|
+
security?: AnsightToolSecurity;
|
|
318
|
+
timeoutMilliseconds?: number;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export type AnsightToolResult =
|
|
322
|
+
| { success: true; message?: string; result?: unknown }
|
|
323
|
+
| { success: false; message: string; errorCode?: string; result?: unknown };
|
|
324
|
+
|
|
325
|
+
export type AnsightToolHandler = (
|
|
326
|
+
args: Record<string, string>,
|
|
327
|
+
context: {
|
|
328
|
+
requestId: string;
|
|
329
|
+
toolId: string;
|
|
330
|
+
nativeRequestId?: string;
|
|
331
|
+
sessionId?: string;
|
|
332
|
+
platform: "ios" | "android" | string;
|
|
333
|
+
}
|
|
334
|
+
) => AnsightToolResult | Promise<AnsightToolResult>;
|
|
335
|
+
|
|
336
|
+
export interface AnsightToolRegistration {
|
|
337
|
+
id: string;
|
|
338
|
+
ready: Promise<AnsightOperationResult>;
|
|
339
|
+
unregister(): Promise<AnsightOperationResult>;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export interface AnsightArtifactProviderDescriptor {
|
|
343
|
+
id: string;
|
|
344
|
+
name: string;
|
|
345
|
+
description?: string | null;
|
|
346
|
+
category?: string;
|
|
347
|
+
tags?: string[];
|
|
348
|
+
metadata?: Record<string, string>;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export interface AnsightArtifactContentDescriptor {
|
|
352
|
+
supportedMimeTypes: string[];
|
|
353
|
+
defaultMimeType?: string | null;
|
|
354
|
+
suggestedFileName?: string | null;
|
|
355
|
+
supportsText?: boolean;
|
|
356
|
+
supportsBinary?: boolean;
|
|
357
|
+
sizeKnownBeforeCreation?: boolean;
|
|
358
|
+
estimatedSizeBytes?: number | null;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export interface AnsightArtifactDefinition {
|
|
362
|
+
id: string;
|
|
363
|
+
name: string;
|
|
364
|
+
description?: string;
|
|
365
|
+
kind: string;
|
|
366
|
+
category: string;
|
|
367
|
+
content?: AnsightArtifactContentDescriptor;
|
|
368
|
+
mimeType?: string;
|
|
369
|
+
fileName?: string;
|
|
370
|
+
estimatedSizeBytes?: number | null;
|
|
371
|
+
argumentsSchema?: object;
|
|
372
|
+
security?: AnsightToolSecurity;
|
|
373
|
+
tags?: string[];
|
|
374
|
+
metadata?: Record<string, string>;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export interface AnsightArtifactMetadata {
|
|
378
|
+
artifactId: string;
|
|
379
|
+
providerId: string;
|
|
380
|
+
name: string;
|
|
381
|
+
kind: string;
|
|
382
|
+
mimeType: string;
|
|
383
|
+
fileName: string;
|
|
384
|
+
description?: string | null;
|
|
385
|
+
sizeBytes?: number | null;
|
|
386
|
+
createdAtUtc?: string;
|
|
387
|
+
tags?: string[];
|
|
388
|
+
metadata?: Record<string, string>;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export type AnsightArtifactPayload =
|
|
392
|
+
| string
|
|
393
|
+
| number[]
|
|
394
|
+
| ArrayBuffer
|
|
395
|
+
| Uint8Array
|
|
396
|
+
| {
|
|
397
|
+
text?: string;
|
|
398
|
+
base64?: string;
|
|
399
|
+
bytes?: number[] | ArrayBuffer | Uint8Array;
|
|
400
|
+
data?: number[] | ArrayBuffer | Uint8Array;
|
|
401
|
+
sizeBytes?: number;
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
export interface AnsightArtifactResult {
|
|
405
|
+
metadata: AnsightArtifactMetadata;
|
|
406
|
+
payload: AnsightArtifactPayload;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export interface AnsightArtifactQueryContext {
|
|
410
|
+
toolRequestId?: string;
|
|
411
|
+
sessionId?: string;
|
|
412
|
+
queriedAtUtc: string;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export interface AnsightArtifactRequestContext {
|
|
416
|
+
toolRequestId?: string;
|
|
417
|
+
sessionId?: string;
|
|
418
|
+
requestedAtUtc: string;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export interface AnsightArtifactRequest {
|
|
422
|
+
providerId: string;
|
|
423
|
+
artifactId: string;
|
|
424
|
+
arguments: Record<string, string>;
|
|
425
|
+
context: AnsightArtifactRequestContext;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export interface AnsightArtifactProvider {
|
|
429
|
+
descriptor: AnsightArtifactProviderDescriptor;
|
|
430
|
+
query?(context: AnsightArtifactQueryContext): AnsightArtifactDefinition[] | Promise<AnsightArtifactDefinition[]>;
|
|
431
|
+
queryArtifacts?(context: AnsightArtifactQueryContext): AnsightArtifactDefinition[] | Promise<AnsightArtifactDefinition[]>;
|
|
432
|
+
create?(request: AnsightArtifactRequest): AnsightArtifactResult | Promise<AnsightArtifactResult>;
|
|
433
|
+
createArtifact?(request: AnsightArtifactRequest): AnsightArtifactResult | Promise<AnsightArtifactResult>;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export interface AnsightArtifactProviderRegistration {
|
|
437
|
+
id: string;
|
|
438
|
+
ready: Promise<AnsightOperationResult & { id?: string }>;
|
|
439
|
+
unregister(): Promise<AnsightOperationResult & { id?: string }>;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export interface ReactNavigationTracker {
|
|
443
|
+
onReady(): void;
|
|
444
|
+
onStateChange(): void;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export interface AnsightReactToolsOptions {
|
|
448
|
+
includeBounds?: boolean;
|
|
449
|
+
includeProps?: boolean;
|
|
450
|
+
includeState?: boolean;
|
|
451
|
+
maxDepth?: number;
|
|
452
|
+
maxNodes?: number;
|
|
453
|
+
navigationRef?: unknown;
|
|
454
|
+
enableActions?: boolean;
|
|
455
|
+
allowedActionProps?: string[];
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export interface AnsightReactToolsRegistration {
|
|
459
|
+
ids: string[];
|
|
460
|
+
ready: Promise<AnsightOperationResult[]>;
|
|
461
|
+
unregister(): Promise<AnsightOperationResult[]>;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export interface AnsightConnectOptions {
|
|
465
|
+
clientName?: string;
|
|
466
|
+
expectedAppId?: string;
|
|
467
|
+
hostAddressOverride?: string;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
export interface AnsightOpenSessionOptions extends AnsightConnectOptions {}
|
|
471
|
+
|
|
472
|
+
export interface AnsightSavePairingOptions {
|
|
473
|
+
expectedAppId?: string;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export interface AnsightRecordedMetric {
|
|
477
|
+
value: number;
|
|
478
|
+
capturedAtUtc: string;
|
|
479
|
+
capturedAtEpochMs: number;
|
|
480
|
+
channel: number;
|
|
481
|
+
sequence: number;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export interface AnsightRecordedEvent {
|
|
485
|
+
id: string;
|
|
486
|
+
label: string;
|
|
487
|
+
type: string;
|
|
488
|
+
details?: string;
|
|
489
|
+
capturedAtUtc: string;
|
|
490
|
+
capturedAtEpochMs: number;
|
|
491
|
+
externalId?: string;
|
|
492
|
+
channel: number;
|
|
493
|
+
sequence: number;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export function createOptionsBuilder(options?: AnsightOptions): AnsightOptionsBuilder;
|
|
497
|
+
export function initialize(options?: AnsightOptions): Promise<AnsightDebugSnapshot>;
|
|
498
|
+
export function initializeAndActivate(options?: AnsightOptions): Promise<AnsightDebugSnapshot>;
|
|
499
|
+
export function activate(): Promise<AnsightDebugSnapshot>;
|
|
500
|
+
export function deactivate(): Promise<AnsightDebugSnapshot>;
|
|
501
|
+
export function clear(): Promise<AnsightDebugSnapshot>;
|
|
502
|
+
export function registerMetricChannel(channel: AnsightChannel): Promise<AnsightDebugSnapshot>;
|
|
503
|
+
export function metric(value: number, channel?: number): Promise<AnsightDebugSnapshot>;
|
|
504
|
+
export function recordMetric(value: number, channel?: number): Promise<AnsightDebugSnapshot>;
|
|
505
|
+
export function event(input: string | { label: string; type?: string; details?: string; channel?: number }): Promise<AnsightDebugSnapshot>;
|
|
506
|
+
export function recordEvent(input: string | { label: string; type?: string; details?: string; channel?: number }): Promise<AnsightDebugSnapshot>;
|
|
507
|
+
export function screenViewed(name: string, details?: Record<string, string>): Promise<AnsightDebugSnapshot>;
|
|
508
|
+
export function trackRoute(name: string, details?: Record<string, string>): Promise<AnsightDebugSnapshot>;
|
|
509
|
+
export function setAppLifecycleState(state: AnsightLifecycleState): Promise<AnsightDebugSnapshot>;
|
|
510
|
+
export function connect(pairingPayload?: string | object | null, options?: AnsightConnectOptions): Promise<AnsightHostConnectionResult>;
|
|
511
|
+
export function openSession(pairingPayload: string | object, options?: AnsightOpenSessionOptions): Promise<AnsightHostConnectionResult>;
|
|
512
|
+
export function disconnect(): Promise<AnsightHostConnectionResult>;
|
|
513
|
+
export function completeSession(): Promise<AnsightOperationResult>;
|
|
514
|
+
export function closeSession(): Promise<AnsightOperationResult>;
|
|
515
|
+
export function savePairingConfig(pairingPayload: string | object, options?: AnsightSavePairingOptions): Promise<AnsightHostConnectionResult>;
|
|
516
|
+
export function clearSavedPairing(): Promise<AnsightHostConnectionResult>;
|
|
517
|
+
export function clearSavedPairingConfig(): Promise<AnsightHostConnectionResult>;
|
|
518
|
+
export function clearCachedSession(): Promise<AnsightOperationResult>;
|
|
519
|
+
export function status(): Promise<AnsightDebugSnapshot>;
|
|
520
|
+
export function snapshot(): Promise<AnsightDebugSnapshot>;
|
|
521
|
+
export function hostConnectionStatus(): Promise<AnsightHostConnectionStatus>;
|
|
522
|
+
export function hostConnectionCapabilities(): Promise<AnsightHostConnectionCapabilities>;
|
|
523
|
+
export function notifyHostConnectionConfigChanged(): Promise<AnsightHostConnectionResult>;
|
|
524
|
+
export function addHostConnectionStatusListener(
|
|
525
|
+
listener: (
|
|
526
|
+
status: AnsightHostConnectionStatus,
|
|
527
|
+
capabilities: AnsightHostConnectionCapabilities,
|
|
528
|
+
snapshot: AnsightHostConnectionStatusSnapshot,
|
|
529
|
+
) => void,
|
|
530
|
+
options?: { emitCurrent?: boolean },
|
|
531
|
+
): AnsightSubscription;
|
|
532
|
+
export function currentOptions(): Promise<AnsightCurrentOptions>;
|
|
533
|
+
export function recordedMetrics(limit?: number): Promise<AnsightRecordedMetric[]>;
|
|
534
|
+
export function recordedEvents(limit?: number): Promise<AnsightRecordedEvent[]>;
|
|
535
|
+
export function sendClientLog(line: string): Promise<AnsightOperationResult>;
|
|
536
|
+
export function addLogListener(listener: (entry: AnsightLogEntry) => void): AnsightSubscription;
|
|
537
|
+
export function captureBuiltInTelemetrySample(): Promise<AnsightDebugSnapshot>;
|
|
538
|
+
export function isFramesPerSecondEnabled(): Promise<boolean>;
|
|
539
|
+
export function enableFramesPerSecond(): Promise<AnsightDebugSnapshot>;
|
|
540
|
+
export function disableFramesPerSecond(): Promise<AnsightDebugSnapshot>;
|
|
541
|
+
export function captureScreenFrame(options?: AnsightSessionJpegCaptureOptions): Promise<AnsightOperationResult>;
|
|
542
|
+
export function enableTouchCapture(): Promise<AnsightDebugSnapshot | AnsightOperationResult>;
|
|
543
|
+
export function disableTouchCapture(): Promise<AnsightDebugSnapshot | AnsightOperationResult>;
|
|
544
|
+
export function updateSessionProperties(properties: Record<string, Record<string, string>>): Promise<AnsightOperationResult>;
|
|
545
|
+
export function clearSessionProperties(): Promise<AnsightOperationResult>;
|
|
546
|
+
export function updateCustomProperties(properties: Record<string, Record<string, string>>): Promise<AnsightOperationResult>;
|
|
547
|
+
export function registerCustomProperty(group: string, key: string, value: string): Promise<AnsightOperationResult>;
|
|
548
|
+
export function removeCustomProperty(group: string, key: string): Promise<AnsightOperationResult>;
|
|
549
|
+
export function clearCustomProperties(): Promise<AnsightOperationResult>;
|
|
550
|
+
export function registerTool(definition: AnsightToolDefinition, handler: AnsightToolHandler): AnsightToolRegistration;
|
|
551
|
+
export function unregisterTool(id: string): Promise<AnsightOperationResult>;
|
|
552
|
+
export function registerArtifactProvider(provider: AnsightArtifactProvider): AnsightArtifactProviderRegistration;
|
|
553
|
+
export function registerArtifactProviders(providers: AnsightArtifactProvider[]): AnsightArtifactProviderRegistration[];
|
|
554
|
+
export function unregisterArtifactProvider(providerId: string): Promise<AnsightOperationResult>;
|
|
555
|
+
export function listRegisteredArtifactProviders(): AnsightArtifactProviderDescriptor[];
|
|
556
|
+
export function clearArtifactProviders(): Promise<AnsightOperationResult>;
|
|
557
|
+
export function listRegisteredTools(): string[];
|
|
558
|
+
export function clearRegisteredTools(): Promise<AnsightOperationResult>;
|
|
559
|
+
export function startAppStateTracking(): void;
|
|
560
|
+
export function stopAppStateTracking(): void;
|
|
561
|
+
export function installReactTools(options?: AnsightReactToolsOptions): AnsightReactToolsRegistration;
|
|
562
|
+
export function uninstallReactTools(): Promise<AnsightOperationResult[]>;
|
|
563
|
+
export function installErrorHandlers(options?: { chain?: boolean }): () => void;
|
|
564
|
+
export function createReactNavigationTracker(navigationRef: unknown, options?: { recordInitial?: boolean }): ReactNavigationTracker;
|
|
565
|
+
|
|
566
|
+
declare const Ansight: {
|
|
567
|
+
initialize: typeof initialize;
|
|
568
|
+
initializeAndActivate: typeof initializeAndActivate;
|
|
569
|
+
activate: typeof activate;
|
|
570
|
+
deactivate: typeof deactivate;
|
|
571
|
+
clear: typeof clear;
|
|
572
|
+
registerMetricChannel: typeof registerMetricChannel;
|
|
573
|
+
metric: typeof metric;
|
|
574
|
+
recordMetric: typeof recordMetric;
|
|
575
|
+
event: typeof event;
|
|
576
|
+
recordEvent: typeof recordEvent;
|
|
577
|
+
screenViewed: typeof screenViewed;
|
|
578
|
+
trackRoute: typeof trackRoute;
|
|
579
|
+
setAppLifecycleState: typeof setAppLifecycleState;
|
|
580
|
+
connect: typeof connect;
|
|
581
|
+
openSession: typeof openSession;
|
|
582
|
+
disconnect: typeof disconnect;
|
|
583
|
+
completeSession: typeof completeSession;
|
|
584
|
+
closeSession: typeof closeSession;
|
|
585
|
+
savePairingConfig: typeof savePairingConfig;
|
|
586
|
+
clearSavedPairing: typeof clearSavedPairing;
|
|
587
|
+
clearSavedPairingConfig: typeof clearSavedPairingConfig;
|
|
588
|
+
clearCachedSession: typeof clearCachedSession;
|
|
589
|
+
status: typeof status;
|
|
590
|
+
snapshot: typeof snapshot;
|
|
591
|
+
hostConnectionStatus: typeof hostConnectionStatus;
|
|
592
|
+
hostConnectionCapabilities: typeof hostConnectionCapabilities;
|
|
593
|
+
notifyHostConnectionConfigChanged: typeof notifyHostConnectionConfigChanged;
|
|
594
|
+
addHostConnectionStatusListener: typeof addHostConnectionStatusListener;
|
|
595
|
+
currentOptions: typeof currentOptions;
|
|
596
|
+
recordedMetrics: typeof recordedMetrics;
|
|
597
|
+
recordedEvents: typeof recordedEvents;
|
|
598
|
+
sendClientLog: typeof sendClientLog;
|
|
599
|
+
addLogListener: typeof addLogListener;
|
|
600
|
+
captureBuiltInTelemetrySample: typeof captureBuiltInTelemetrySample;
|
|
601
|
+
isFramesPerSecondEnabled: typeof isFramesPerSecondEnabled;
|
|
602
|
+
enableFramesPerSecond: typeof enableFramesPerSecond;
|
|
603
|
+
disableFramesPerSecond: typeof disableFramesPerSecond;
|
|
604
|
+
captureScreenFrame: typeof captureScreenFrame;
|
|
605
|
+
enableTouchCapture: typeof enableTouchCapture;
|
|
606
|
+
disableTouchCapture: typeof disableTouchCapture;
|
|
607
|
+
updateSessionProperties: typeof updateSessionProperties;
|
|
608
|
+
clearSessionProperties: typeof clearSessionProperties;
|
|
609
|
+
updateCustomProperties: typeof updateCustomProperties;
|
|
610
|
+
registerCustomProperty: typeof registerCustomProperty;
|
|
611
|
+
removeCustomProperty: typeof removeCustomProperty;
|
|
612
|
+
clearCustomProperties: typeof clearCustomProperties;
|
|
613
|
+
registerTool: typeof registerTool;
|
|
614
|
+
unregisterTool: typeof unregisterTool;
|
|
615
|
+
registerArtifactProvider: typeof registerArtifactProvider;
|
|
616
|
+
registerArtifactProviders: typeof registerArtifactProviders;
|
|
617
|
+
unregisterArtifactProvider: typeof unregisterArtifactProvider;
|
|
618
|
+
listRegisteredArtifactProviders: typeof listRegisteredArtifactProviders;
|
|
619
|
+
clearArtifactProviders: typeof clearArtifactProviders;
|
|
620
|
+
listRegisteredTools: typeof listRegisteredTools;
|
|
621
|
+
clearRegisteredTools: typeof clearRegisteredTools;
|
|
622
|
+
createOptionsBuilder: typeof createOptionsBuilder;
|
|
623
|
+
AnsightOptionsBuilder: typeof AnsightOptionsBuilder;
|
|
624
|
+
startAppStateTracking: typeof startAppStateTracking;
|
|
625
|
+
stopAppStateTracking: typeof stopAppStateTracking;
|
|
626
|
+
installReactTools: typeof installReactTools;
|
|
627
|
+
uninstallReactTools: typeof uninstallReactTools;
|
|
628
|
+
installErrorHandlers: typeof installErrorHandlers;
|
|
629
|
+
createReactNavigationTracker: typeof createReactNavigationTracker;
|
|
630
|
+
platform: "ios" | "android" | string;
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
export default Ansight;
|