@parallax-rn/protocol 0.0.0-stage → 0.1.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +72 -0
- package/README.md +34 -2
- package/contract.snapshot.json +1142 -0
- package/dist/contract.d.ts +517 -0
- package/dist/contract.js +264 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +37 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +63 -0
- package/dist/metro-requests.d.ts +2 -0
- package/dist/metro-requests.js +15 -0
- package/dist/names.d.ts +5 -0
- package/dist/names.js +9 -0
- package/dist/registration.d.ts +3 -0
- package/dist/registration.js +24 -0
- package/dist/rules.d.ts +43 -0
- package/dist/rules.js +159 -0
- package/dist/schema.d.ts +85 -0
- package/dist/schema.js +167 -0
- package/dist/source-id.d.ts +7 -0
- package/dist/source-id.js +25 -0
- package/dist/sources.d.ts +9 -0
- package/dist/sources.js +22 -0
- package/dist/version.d.ts +17 -0
- package/dist/version.js +30 -0
- package/package.json +20 -4
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
import { type Infer, type Result, type Typed } from './schema.js';
|
|
2
|
+
export declare const protocolVersionT: Typed<[number, number]>;
|
|
3
|
+
export declare const logLevelT: Typed<"debug" | "error" | "info" | "log" | "warn">;
|
|
4
|
+
/** `truncated` is true when the SDK cut the message to its per-entry size cap. */
|
|
5
|
+
export declare const logEntryT: Typed<{
|
|
6
|
+
level: "debug" | "error" | "info" | "log" | "warn";
|
|
7
|
+
message: string;
|
|
8
|
+
seq: number;
|
|
9
|
+
time: number;
|
|
10
|
+
truncated?: boolean | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
/** `truncated` is true when the SDK cut the message or the stack to its per-entry size cap. */
|
|
13
|
+
export declare const errorEntryT: Typed<{
|
|
14
|
+
fatal: boolean;
|
|
15
|
+
message: string;
|
|
16
|
+
name?: string | undefined;
|
|
17
|
+
seq: number;
|
|
18
|
+
stack?: string | undefined;
|
|
19
|
+
time: number;
|
|
20
|
+
truncated?: boolean | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
/** `last` is 0 until the first entry; `first` is the oldest retained seq (last + 1 when empty); `dropped` counts evictions since the context started. */
|
|
23
|
+
export declare const bufferStateT: Typed<{
|
|
24
|
+
dropped: number;
|
|
25
|
+
first: number;
|
|
26
|
+
last: number;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* One entry of a namespaced data source (protocol 0.5): `seq` is per source and per context like the logs', `data` is the source's own payload.
|
|
30
|
+
* The SDK redacts secrets before it sends anything; the core redacts again before it stores (a source's own rule).
|
|
31
|
+
*/
|
|
32
|
+
export declare const sourceEntryT: Typed<{
|
|
33
|
+
data: unknown;
|
|
34
|
+
seq: number;
|
|
35
|
+
time: number;
|
|
36
|
+
}>;
|
|
37
|
+
/** One finished or failed request of the `network` source (a request still in flight is not an entry). Times are epoch milliseconds; headers are as captured (the agent paths scrub them). */
|
|
38
|
+
export declare const networkEntryT: Typed<{
|
|
39
|
+
canceled?: boolean | undefined;
|
|
40
|
+
durationMs?: number | undefined;
|
|
41
|
+
encodedBytes?: number | undefined;
|
|
42
|
+
errorText?: string | undefined;
|
|
43
|
+
failed?: boolean | undefined;
|
|
44
|
+
id: string;
|
|
45
|
+
initiator?: string | undefined;
|
|
46
|
+
method: string;
|
|
47
|
+
mimeType?: string | undefined;
|
|
48
|
+
redirectedFrom?: string | undefined;
|
|
49
|
+
requestBody?: string | undefined;
|
|
50
|
+
requestBodyBytes?: number | undefined;
|
|
51
|
+
requestHeaders?: {
|
|
52
|
+
[key: string]: string;
|
|
53
|
+
} | undefined;
|
|
54
|
+
responseBody?: string | undefined;
|
|
55
|
+
responseBodyBytes?: number | undefined;
|
|
56
|
+
responseBodyState?: "binary" | "cut" | "kept" | "not_fetched" | "unavailable" | undefined;
|
|
57
|
+
responseHeaders?: {
|
|
58
|
+
[key: string]: string;
|
|
59
|
+
} | undefined;
|
|
60
|
+
startedAt: number;
|
|
61
|
+
status?: number | undefined;
|
|
62
|
+
statusText?: string | undefined;
|
|
63
|
+
url: string;
|
|
64
|
+
via: "cdp" | "sdk";
|
|
65
|
+
}>;
|
|
66
|
+
/** One snapshot of an app store (`state:<name>`: Redux, Zustand, any `getState`/`subscribe` object) or of a TanStack Query client (`query:<name>`). `state` is the capped, masked value. */
|
|
67
|
+
export declare const stateEntryT: Typed<{
|
|
68
|
+
action?: string | undefined;
|
|
69
|
+
changedKeys?: string[] | undefined;
|
|
70
|
+
kind: "query" | "snapshot";
|
|
71
|
+
state: unknown;
|
|
72
|
+
truncated?: boolean | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
/** One state of the app's navigation container (`navigation`): the focused route, its params, the path when there is one, the route names from the root, the nested state (capped), and who read it: `adapter` (the SDK's `registerNavigation`, with history) or `generic` (the injected fiber read, a snapshot). */
|
|
75
|
+
export declare const navigationEntryT: Typed<{
|
|
76
|
+
kind: "state";
|
|
77
|
+
params?: unknown;
|
|
78
|
+
path?: string | undefined;
|
|
79
|
+
producer?: "adapter" | "generic" | undefined;
|
|
80
|
+
rootState?: unknown;
|
|
81
|
+
route: string;
|
|
82
|
+
stack: string[];
|
|
83
|
+
}>;
|
|
84
|
+
export declare const handshakeT: Typed<{
|
|
85
|
+
buffers: {
|
|
86
|
+
errors: {
|
|
87
|
+
dropped: number;
|
|
88
|
+
first: number;
|
|
89
|
+
last: number;
|
|
90
|
+
};
|
|
91
|
+
logs: {
|
|
92
|
+
dropped: number;
|
|
93
|
+
first: number;
|
|
94
|
+
last: number;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
contextId: string;
|
|
98
|
+
protocol: [number, number];
|
|
99
|
+
sdk: string;
|
|
100
|
+
sources?: {
|
|
101
|
+
[key: string]: {
|
|
102
|
+
dropped: number;
|
|
103
|
+
first: number;
|
|
104
|
+
last: number;
|
|
105
|
+
};
|
|
106
|
+
} | undefined;
|
|
107
|
+
startedAt: number;
|
|
108
|
+
}>;
|
|
109
|
+
/** Cursors are the last seq the caller has seen (0 = from the start). */
|
|
110
|
+
/** Protocol 0.5: `sources` carries a cursor per source the caller wants (absent: none asked for). */
|
|
111
|
+
export declare const drainRequestT: Typed<{
|
|
112
|
+
errors: number;
|
|
113
|
+
limit?: number | undefined;
|
|
114
|
+
logs: number;
|
|
115
|
+
sources?: {
|
|
116
|
+
[key: string]: number;
|
|
117
|
+
} | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
export declare const drainResultT: Typed<{
|
|
120
|
+
contextId: string;
|
|
121
|
+
errors: {
|
|
122
|
+
dropped: number;
|
|
123
|
+
entries: {
|
|
124
|
+
fatal: boolean;
|
|
125
|
+
message: string;
|
|
126
|
+
name?: string | undefined;
|
|
127
|
+
seq: number;
|
|
128
|
+
stack?: string | undefined;
|
|
129
|
+
time: number;
|
|
130
|
+
truncated?: boolean | undefined;
|
|
131
|
+
}[];
|
|
132
|
+
next: number;
|
|
133
|
+
};
|
|
134
|
+
logs: {
|
|
135
|
+
dropped: number;
|
|
136
|
+
entries: {
|
|
137
|
+
level: "debug" | "error" | "info" | "log" | "warn";
|
|
138
|
+
message: string;
|
|
139
|
+
seq: number;
|
|
140
|
+
time: number;
|
|
141
|
+
truncated?: boolean | undefined;
|
|
142
|
+
}[];
|
|
143
|
+
next: number;
|
|
144
|
+
};
|
|
145
|
+
sources?: {
|
|
146
|
+
[key: string]: {
|
|
147
|
+
dropped: number;
|
|
148
|
+
entries: {
|
|
149
|
+
data: unknown;
|
|
150
|
+
seq: number;
|
|
151
|
+
time: number;
|
|
152
|
+
}[];
|
|
153
|
+
next: number;
|
|
154
|
+
};
|
|
155
|
+
} | undefined;
|
|
156
|
+
}>;
|
|
157
|
+
/** The payload of one push through the binding. Continuity is judged by seq against the caller's cursor; a gap triggers a drain. */
|
|
158
|
+
export declare const pushBatchT: Typed<{
|
|
159
|
+
contextId: string;
|
|
160
|
+
errors: {
|
|
161
|
+
fatal: boolean;
|
|
162
|
+
message: string;
|
|
163
|
+
name?: string | undefined;
|
|
164
|
+
seq: number;
|
|
165
|
+
stack?: string | undefined;
|
|
166
|
+
time: number;
|
|
167
|
+
truncated?: boolean | undefined;
|
|
168
|
+
}[];
|
|
169
|
+
logs: {
|
|
170
|
+
level: "debug" | "error" | "info" | "log" | "warn";
|
|
171
|
+
message: string;
|
|
172
|
+
seq: number;
|
|
173
|
+
time: number;
|
|
174
|
+
truncated?: boolean | undefined;
|
|
175
|
+
}[];
|
|
176
|
+
sources?: {
|
|
177
|
+
[key: string]: {
|
|
178
|
+
data: unknown;
|
|
179
|
+
seq: number;
|
|
180
|
+
time: number;
|
|
181
|
+
}[];
|
|
182
|
+
} | undefined;
|
|
183
|
+
}>;
|
|
184
|
+
/** `argsHint` is a short human-readable description of the arguments the command accepts, for example `{ id: string }`; omitted when it takes none. */
|
|
185
|
+
export declare const commandInfoT: Typed<{
|
|
186
|
+
argsHint?: string | undefined;
|
|
187
|
+
description?: string | undefined;
|
|
188
|
+
name: string;
|
|
189
|
+
}>;
|
|
190
|
+
export declare const commandListT: Typed<{
|
|
191
|
+
argsHint?: string | undefined;
|
|
192
|
+
description?: string | undefined;
|
|
193
|
+
name: string;
|
|
194
|
+
}[]>;
|
|
195
|
+
export declare const commandCallT: Typed<{
|
|
196
|
+
args?: unknown;
|
|
197
|
+
name: string;
|
|
198
|
+
}>;
|
|
199
|
+
export declare const commandResultT: Typed<{
|
|
200
|
+
ok: true;
|
|
201
|
+
value: unknown;
|
|
202
|
+
} | {
|
|
203
|
+
error: {
|
|
204
|
+
code: "command_failed" | "command_not_found";
|
|
205
|
+
message: string;
|
|
206
|
+
};
|
|
207
|
+
ok: false;
|
|
208
|
+
}>;
|
|
209
|
+
export declare const errorShapeT: Typed<{
|
|
210
|
+
code: "app_not_frontmost" | "app_reloading" | "axe_missing" | "command_failed" | "command_not_found" | "core_unavailable" | "core_version_mismatch" | "denied_by_user" | "device_not_booted" | "element_not_found" | "invalid_input" | "metro_unreachable" | "no_app_target" | "no_simulator" | "reconnecting" | "rn_unsupported" | "sdk_missing" | "sdk_not_ready" | "timeout" | "tree_unavailable" | "vm_paused";
|
|
211
|
+
hint?: string | undefined;
|
|
212
|
+
message: string;
|
|
213
|
+
}>;
|
|
214
|
+
/**
|
|
215
|
+
* One JSX element, in this order: element number in the file (n), line, column (1-based, at the `<`), tag name,
|
|
216
|
+
* enclosing component name, its declaration line, its declaration column, whether a testID was injected
|
|
217
|
+
* (see injectedTestId), the user's own testID (a literal, or a pattern with `*` for dynamic parts) and the module
|
|
218
|
+
* specifier the tag was imported from. Extra trailing items are ignored by readers.
|
|
219
|
+
*/
|
|
220
|
+
export declare const sourceRowT: Typed<[number, number, number, string, string | null, number | null, number | null, boolean, string | null, string | null]>;
|
|
221
|
+
export declare const sourceTableT: Typed<{
|
|
222
|
+
comps: [string, number, number][];
|
|
223
|
+
els: [number, number, number, string, string | null, number | null, number | null, boolean, string | null, string | null][];
|
|
224
|
+
file: string;
|
|
225
|
+
injected: boolean;
|
|
226
|
+
p: [number, number];
|
|
227
|
+
plugin?: string | undefined;
|
|
228
|
+
root?: string | undefined;
|
|
229
|
+
}>;
|
|
230
|
+
export type LogLevel = Infer<typeof logLevelT>;
|
|
231
|
+
export type LogEntry = Infer<typeof logEntryT>;
|
|
232
|
+
export type ErrorEntry = Infer<typeof errorEntryT>;
|
|
233
|
+
export type BufferState = Infer<typeof bufferStateT>;
|
|
234
|
+
export type SourceEntry = Infer<typeof sourceEntryT>;
|
|
235
|
+
export type NetworkEntry = Infer<typeof networkEntryT>;
|
|
236
|
+
export type StateEntry = Infer<typeof stateEntryT>;
|
|
237
|
+
export type NavigationEntry = Infer<typeof navigationEntryT>;
|
|
238
|
+
export type Handshake = Infer<typeof handshakeT>;
|
|
239
|
+
export type DrainRequest = Infer<typeof drainRequestT>;
|
|
240
|
+
export type DrainResult = Infer<typeof drainResultT>;
|
|
241
|
+
export type PushBatch = Infer<typeof pushBatchT>;
|
|
242
|
+
export type CommandInfo = Infer<typeof commandInfoT>;
|
|
243
|
+
export type CommandCall = Infer<typeof commandCallT>;
|
|
244
|
+
export type CommandResult = Infer<typeof commandResultT>;
|
|
245
|
+
export type ErrorShape = Infer<typeof errorShapeT>;
|
|
246
|
+
export type SourceRow = Infer<typeof sourceRowT>;
|
|
247
|
+
export type SourceTable = Infer<typeof sourceTableT>;
|
|
248
|
+
/** What the SDK puts under `sdk` in the container. Every method takes zero or one JSON string and returns a JSON string. */
|
|
249
|
+
export interface SdkApi {
|
|
250
|
+
handshake(): string;
|
|
251
|
+
drain(requestJson: string): string;
|
|
252
|
+
commands(): string;
|
|
253
|
+
call(requestJson: string): Promise<string>;
|
|
254
|
+
}
|
|
255
|
+
/** The shape of `globalThis[GLOBAL_NAME]`. Field names are only ever added (decision 0012). */
|
|
256
|
+
export interface ParallaxGlobal {
|
|
257
|
+
sources?: {
|
|
258
|
+
[file: string]: SourceTable;
|
|
259
|
+
};
|
|
260
|
+
sdk?: SdkApi;
|
|
261
|
+
}
|
|
262
|
+
export declare const schemas: {
|
|
263
|
+
readonly protocolVersion: Typed<[number, number]>;
|
|
264
|
+
readonly logEntry: Typed<{
|
|
265
|
+
level: "debug" | "error" | "info" | "log" | "warn";
|
|
266
|
+
message: string;
|
|
267
|
+
seq: number;
|
|
268
|
+
time: number;
|
|
269
|
+
truncated?: boolean | undefined;
|
|
270
|
+
}>;
|
|
271
|
+
readonly errorEntry: Typed<{
|
|
272
|
+
fatal: boolean;
|
|
273
|
+
message: string;
|
|
274
|
+
name?: string | undefined;
|
|
275
|
+
seq: number;
|
|
276
|
+
stack?: string | undefined;
|
|
277
|
+
time: number;
|
|
278
|
+
truncated?: boolean | undefined;
|
|
279
|
+
}>;
|
|
280
|
+
readonly bufferState: Typed<{
|
|
281
|
+
dropped: number;
|
|
282
|
+
first: number;
|
|
283
|
+
last: number;
|
|
284
|
+
}>;
|
|
285
|
+
readonly sourceEntry: Typed<{
|
|
286
|
+
data: unknown;
|
|
287
|
+
seq: number;
|
|
288
|
+
time: number;
|
|
289
|
+
}>;
|
|
290
|
+
readonly networkEntry: Typed<{
|
|
291
|
+
canceled?: boolean | undefined;
|
|
292
|
+
durationMs?: number | undefined;
|
|
293
|
+
encodedBytes?: number | undefined;
|
|
294
|
+
errorText?: string | undefined;
|
|
295
|
+
failed?: boolean | undefined;
|
|
296
|
+
id: string;
|
|
297
|
+
initiator?: string | undefined;
|
|
298
|
+
method: string;
|
|
299
|
+
mimeType?: string | undefined;
|
|
300
|
+
redirectedFrom?: string | undefined;
|
|
301
|
+
requestBody?: string | undefined;
|
|
302
|
+
requestBodyBytes?: number | undefined;
|
|
303
|
+
requestHeaders?: {
|
|
304
|
+
[key: string]: string;
|
|
305
|
+
} | undefined;
|
|
306
|
+
responseBody?: string | undefined;
|
|
307
|
+
responseBodyBytes?: number | undefined;
|
|
308
|
+
responseBodyState?: "binary" | "cut" | "kept" | "not_fetched" | "unavailable" | undefined;
|
|
309
|
+
responseHeaders?: {
|
|
310
|
+
[key: string]: string;
|
|
311
|
+
} | undefined;
|
|
312
|
+
startedAt: number;
|
|
313
|
+
status?: number | undefined;
|
|
314
|
+
statusText?: string | undefined;
|
|
315
|
+
url: string;
|
|
316
|
+
via: "cdp" | "sdk";
|
|
317
|
+
}>;
|
|
318
|
+
readonly stateEntry: Typed<{
|
|
319
|
+
action?: string | undefined;
|
|
320
|
+
changedKeys?: string[] | undefined;
|
|
321
|
+
kind: "query" | "snapshot";
|
|
322
|
+
state: unknown;
|
|
323
|
+
truncated?: boolean | undefined;
|
|
324
|
+
}>;
|
|
325
|
+
readonly navigationEntry: Typed<{
|
|
326
|
+
kind: "state";
|
|
327
|
+
params?: unknown;
|
|
328
|
+
path?: string | undefined;
|
|
329
|
+
producer?: "adapter" | "generic" | undefined;
|
|
330
|
+
rootState?: unknown;
|
|
331
|
+
route: string;
|
|
332
|
+
stack: string[];
|
|
333
|
+
}>;
|
|
334
|
+
readonly handshake: Typed<{
|
|
335
|
+
buffers: {
|
|
336
|
+
errors: {
|
|
337
|
+
dropped: number;
|
|
338
|
+
first: number;
|
|
339
|
+
last: number;
|
|
340
|
+
};
|
|
341
|
+
logs: {
|
|
342
|
+
dropped: number;
|
|
343
|
+
first: number;
|
|
344
|
+
last: number;
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
contextId: string;
|
|
348
|
+
protocol: [number, number];
|
|
349
|
+
sdk: string;
|
|
350
|
+
sources?: {
|
|
351
|
+
[key: string]: {
|
|
352
|
+
dropped: number;
|
|
353
|
+
first: number;
|
|
354
|
+
last: number;
|
|
355
|
+
};
|
|
356
|
+
} | undefined;
|
|
357
|
+
startedAt: number;
|
|
358
|
+
}>;
|
|
359
|
+
readonly drainRequest: Typed<{
|
|
360
|
+
errors: number;
|
|
361
|
+
limit?: number | undefined;
|
|
362
|
+
logs: number;
|
|
363
|
+
sources?: {
|
|
364
|
+
[key: string]: number;
|
|
365
|
+
} | undefined;
|
|
366
|
+
}>;
|
|
367
|
+
readonly drainResult: Typed<{
|
|
368
|
+
contextId: string;
|
|
369
|
+
errors: {
|
|
370
|
+
dropped: number;
|
|
371
|
+
entries: {
|
|
372
|
+
fatal: boolean;
|
|
373
|
+
message: string;
|
|
374
|
+
name?: string | undefined;
|
|
375
|
+
seq: number;
|
|
376
|
+
stack?: string | undefined;
|
|
377
|
+
time: number;
|
|
378
|
+
truncated?: boolean | undefined;
|
|
379
|
+
}[];
|
|
380
|
+
next: number;
|
|
381
|
+
};
|
|
382
|
+
logs: {
|
|
383
|
+
dropped: number;
|
|
384
|
+
entries: {
|
|
385
|
+
level: "debug" | "error" | "info" | "log" | "warn";
|
|
386
|
+
message: string;
|
|
387
|
+
seq: number;
|
|
388
|
+
time: number;
|
|
389
|
+
truncated?: boolean | undefined;
|
|
390
|
+
}[];
|
|
391
|
+
next: number;
|
|
392
|
+
};
|
|
393
|
+
sources?: {
|
|
394
|
+
[key: string]: {
|
|
395
|
+
dropped: number;
|
|
396
|
+
entries: {
|
|
397
|
+
data: unknown;
|
|
398
|
+
seq: number;
|
|
399
|
+
time: number;
|
|
400
|
+
}[];
|
|
401
|
+
next: number;
|
|
402
|
+
};
|
|
403
|
+
} | undefined;
|
|
404
|
+
}>;
|
|
405
|
+
readonly pushBatch: Typed<{
|
|
406
|
+
contextId: string;
|
|
407
|
+
errors: {
|
|
408
|
+
fatal: boolean;
|
|
409
|
+
message: string;
|
|
410
|
+
name?: string | undefined;
|
|
411
|
+
seq: number;
|
|
412
|
+
stack?: string | undefined;
|
|
413
|
+
time: number;
|
|
414
|
+
truncated?: boolean | undefined;
|
|
415
|
+
}[];
|
|
416
|
+
logs: {
|
|
417
|
+
level: "debug" | "error" | "info" | "log" | "warn";
|
|
418
|
+
message: string;
|
|
419
|
+
seq: number;
|
|
420
|
+
time: number;
|
|
421
|
+
truncated?: boolean | undefined;
|
|
422
|
+
}[];
|
|
423
|
+
sources?: {
|
|
424
|
+
[key: string]: {
|
|
425
|
+
data: unknown;
|
|
426
|
+
seq: number;
|
|
427
|
+
time: number;
|
|
428
|
+
}[];
|
|
429
|
+
} | undefined;
|
|
430
|
+
}>;
|
|
431
|
+
readonly commandInfo: Typed<{
|
|
432
|
+
argsHint?: string | undefined;
|
|
433
|
+
description?: string | undefined;
|
|
434
|
+
name: string;
|
|
435
|
+
}>;
|
|
436
|
+
readonly commandCall: Typed<{
|
|
437
|
+
args?: unknown;
|
|
438
|
+
name: string;
|
|
439
|
+
}>;
|
|
440
|
+
readonly commandResult: Typed<{
|
|
441
|
+
ok: true;
|
|
442
|
+
value: unknown;
|
|
443
|
+
} | {
|
|
444
|
+
error: {
|
|
445
|
+
code: "command_failed" | "command_not_found";
|
|
446
|
+
message: string;
|
|
447
|
+
};
|
|
448
|
+
ok: false;
|
|
449
|
+
}>;
|
|
450
|
+
readonly errorShape: Typed<{
|
|
451
|
+
code: "app_not_frontmost" | "app_reloading" | "axe_missing" | "command_failed" | "command_not_found" | "core_unavailable" | "core_version_mismatch" | "denied_by_user" | "device_not_booted" | "element_not_found" | "invalid_input" | "metro_unreachable" | "no_app_target" | "no_simulator" | "reconnecting" | "rn_unsupported" | "sdk_missing" | "sdk_not_ready" | "timeout" | "tree_unavailable" | "vm_paused";
|
|
452
|
+
hint?: string | undefined;
|
|
453
|
+
message: string;
|
|
454
|
+
}>;
|
|
455
|
+
readonly sourceRow: Typed<[number, number, number, string, string | null, number | null, number | null, boolean, string | null, string | null]>;
|
|
456
|
+
readonly sourceTable: Typed<{
|
|
457
|
+
comps: [string, number, number][];
|
|
458
|
+
els: [number, number, number, string, string | null, number | null, number | null, boolean, string | null, string | null][];
|
|
459
|
+
file: string;
|
|
460
|
+
injected: boolean;
|
|
461
|
+
p: [number, number];
|
|
462
|
+
plugin?: string | undefined;
|
|
463
|
+
root?: string | undefined;
|
|
464
|
+
}>;
|
|
465
|
+
};
|
|
466
|
+
/** The SDK methods and the schema each takes and returns (null: none). */
|
|
467
|
+
export declare const SDK_API: {
|
|
468
|
+
readonly handshake: {
|
|
469
|
+
readonly input: null;
|
|
470
|
+
readonly output: 'handshake';
|
|
471
|
+
readonly async: false;
|
|
472
|
+
};
|
|
473
|
+
readonly drain: {
|
|
474
|
+
readonly input: 'drainRequest';
|
|
475
|
+
readonly output: 'drainResult';
|
|
476
|
+
readonly async: false;
|
|
477
|
+
};
|
|
478
|
+
readonly commands: {
|
|
479
|
+
readonly input: null;
|
|
480
|
+
readonly output: 'commandInfo[]';
|
|
481
|
+
readonly async: false;
|
|
482
|
+
};
|
|
483
|
+
readonly call: {
|
|
484
|
+
readonly input: 'commandCall';
|
|
485
|
+
readonly output: 'commandResult';
|
|
486
|
+
readonly async: true;
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
export declare const parseHandshake: (value: unknown) => Result<Handshake>;
|
|
490
|
+
export declare const parseDrainRequest: (value: unknown) => Result<DrainRequest>;
|
|
491
|
+
export declare const parseDrainResult: (value: unknown) => Result<DrainResult>;
|
|
492
|
+
export declare const parsePushBatch: (value: unknown) => Result<PushBatch>;
|
|
493
|
+
export declare const parseCommandList: (value: unknown) => Result<CommandInfo[]>;
|
|
494
|
+
export declare const parseCommandCall: (value: unknown) => Result<CommandCall>;
|
|
495
|
+
export declare const parseCommandResult: (value: unknown) => Result<CommandResult>;
|
|
496
|
+
export declare const parseSourceTable: (value: unknown) => Result<SourceTable>;
|
|
497
|
+
/** The typed schema for the `data` of a source, by name: `network`, `navigation`, and `state:*` / `query:*`; null for a kind this build has no schema for. */
|
|
498
|
+
export declare function sourceDataType(name: string): Typed<unknown> | null;
|
|
499
|
+
/** Checks one entry's `data` against its source's schema (a source without one passes). */
|
|
500
|
+
export declare const parseSourceData: (name: string, value: unknown) => Result<unknown>;
|
|
501
|
+
export declare const parseErrorShape: (value: unknown) => Result<ErrorShape>;
|
|
502
|
+
/** Parses JSON text first; returns an error result instead of throwing. */
|
|
503
|
+
export declare function parseJson<T>(type: Typed<T>, text: string): Result<T>;
|
|
504
|
+
/** The canonical description of the whole contract; the snapshot test compares it with the committed snapshot. */
|
|
505
|
+
export declare function describeContract(): unknown;
|
|
506
|
+
export declare function contractSnapshotText(): string;
|
|
507
|
+
/**
|
|
508
|
+
* Decides what to do with the committed contract snapshot. A changed contract may only be recorded together with a
|
|
509
|
+
* changed protocol version, so a change cannot slip in without a deliberate version decision (decision 0012).
|
|
510
|
+
*/
|
|
511
|
+
export declare function planContractSnapshotUpdate(existing: string | null, next: string, options?: {
|
|
512
|
+
readonly allowUnchangedVersion?: boolean;
|
|
513
|
+
}): {
|
|
514
|
+
readonly action: 'write' | 'unchanged' | 'refuse';
|
|
515
|
+
readonly reason: string;
|
|
516
|
+
};
|
|
517
|
+
//# sourceMappingURL=contract.d.ts.map
|