@native-sdk/cli 0.8.4 → 0.9.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/build/app.zig +1178 -74
- package/build.zig +715 -17
- package/build.zig.zon +1 -0
- package/native-sdk.d.ts +10 -0
- package/package.json +12 -11
- package/packages/core/compile-surface/core.ts +435 -3
- package/packages/core/package-lock.json +11 -11
- package/packages/core/package.json +2 -2
- package/packages/core/scripts/compiler_typecheck.mjs +116 -15
- package/packages/core/scripts/gen_service_surface.mjs +268 -0
- package/packages/core/scripts/merge_static_archives.mjs +78 -0
- package/packages/core/scripts/npm_static_spike.mjs +64 -0
- package/packages/core/scripts/run_external_core_compiler.mjs +122 -6
- package/packages/core/scripts/run_external_service_compiler.mjs +280 -0
- package/packages/core/scripts/stage_external_core.mjs +9 -1
- package/packages/core/scripts/stage_external_services.mjs +172 -0
- package/packages/core/scripts/surface_manifest_diff.mjs +253 -0
- package/packages/core/scripts/vendor_service_packages.mjs +189 -0
- package/packages/core/sdk/core.d.ts +224 -0
- package/packages/core/sdk/core.ts +694 -22
- package/packages/core/sdk/events.d.ts +89 -0
- package/packages/core/sdk/events.ts +128 -0
- package/packages/core/src/checker.ts +936 -15
- package/packages/core/src/cli.ts +156 -3
- package/packages/core/src/contract.ts +28 -5
- package/packages/core/src/devhost.ts +1876 -16
- package/packages/core/src/devhost_journal.mjs +183 -0
- package/packages/core/src/devhost_resolver.mjs +17 -1
- package/packages/core/src/devhost_service_worker.mjs +90 -0
- package/packages/core/src/diagnostics.ts +179 -22
- package/packages/core/src/frontend.ts +210 -34
- package/packages/core/src/infer.ts +24 -0
- package/packages/core/src/modules.ts +129 -80
- package/packages/core/src/service_contract.ts +597 -0
- package/packages/core/src/sqlite_cli.ts +93 -0
- package/packages/core/src/sqlite_codegen.ts +806 -0
- package/packages/core/src/sqlite_runtime_policy.ts +364 -0
- package/packages/core/src/typed_ast.ts +36 -8
- package/skill-data/automation/SKILL.md +1 -1
- package/skill-data/core/references/project-anatomy.md +1 -1
- package/skill-data/native-ui/SKILL.md +58 -5
- package/skill-data/ts-core/SKILL.md +123 -41
- package/skill-data/ts-services/SKILL.md +126 -0
- package/skill-data/ts-services/references/service-surface.md +604 -0
- package/skill-data/zig/SKILL.md +1 -1
- package/skills/native-sdk/SKILL.md +1 -1
- package/src/app_runner/no_migrations.zig +3 -0
- package/src/app_runner/no_services.zig +20 -0
- package/src/app_runner/root.zig +133 -4
- package/src/app_runner/ts_core_main.zig +254 -8
- package/src/app_runner/ts_core_mobile.zig +241 -0
- package/src/automation/protocol.zig +5 -1
- package/src/automation/snapshot.zig +31 -11
- package/src/embed/app_exports.zig +12 -1
- package/src/embed/c_api.zig +48 -2
- package/src/embed/conversions.zig +4 -5
- package/src/embed/host.zig +109 -1
- package/src/embed/root.zig +8 -0
- package/src/embed/tests.zig +241 -0
- package/src/embed/types.zig +51 -0
- package/src/embed/ui_host.zig +185 -5
- package/src/platform/android/NativeSdkActivity.java +131 -0
- package/src/platform/android/android_host.c +182 -1
- package/src/platform/android/native_sdk_app.h +17 -0
- package/src/platform/ios/native_sdk_app.h +17 -0
- package/src/platform/ios/uikit_host.m +115 -0
- package/src/platform/linux/cef_host.cpp +8 -2
- package/src/platform/linux/gtk_host.c +289 -22
- package/src/platform/linux/gtk_host.h +5 -1
- package/src/platform/linux/root.zig +109 -22
- package/src/platform/macos/appkit_host.h +24 -7
- package/src/platform/macos/appkit_host.m +686 -64
- package/src/platform/macos/cef_host.mm +400 -66
- package/src/platform/macos/root.zig +304 -47
- package/src/platform/null_platform.zig +435 -48
- package/src/platform/null_platform_tests.zig +113 -0
- package/src/platform/root.zig +19 -0
- package/src/platform/types.zig +281 -28
- package/src/platform/windows/root.zig +207 -27
- package/src/platform/windows/webview2_host.cpp +334 -51
- package/src/primitives/app_manifest/comptime_scene.zig +2 -0
- package/src/primitives/app_manifest/root.zig +4 -0
- package/src/primitives/app_manifest/tests.zig +3 -0
- package/src/primitives/app_manifest/types.zig +32 -0
- package/src/primitives/app_manifest/validation.zig +19 -1
- package/src/root.zig +53 -0
- package/src/runtime/api.zig +19 -0
- package/src/runtime/automation_commands.zig +35 -2
- package/src/runtime/automation_snapshot.zig +32 -20
- package/src/runtime/bridge_permission_tests.zig +58 -3
- package/src/runtime/bridge_responses.zig +4 -2
- package/src/runtime/builtin_bridge.zig +11 -1
- package/src/runtime/canvas_frame.zig +18 -11
- package/src/runtime/canvas_frame_animation_tests.zig +4 -0
- package/src/runtime/clock.zig +13 -1
- package/src/runtime/core.zig +145 -7
- package/src/runtime/credentials_store.zig +115 -0
- package/src/runtime/effects.zig +3701 -231
- package/src/runtime/effects_credentials_tests.zig +332 -0
- package/src/runtime/effects_file_tests.zig +587 -0
- package/src/runtime/effects_host_tests.zig +208 -1
- package/src/runtime/effects_notification_tests.zig +11 -0
- package/src/runtime/effects_relational_tests.zig +314 -0
- package/src/runtime/effects_store_tests.zig +211 -0
- package/src/runtime/file_access.zig +400 -0
- package/src/runtime/file_effect_crash_helper.zig +28 -0
- package/src/runtime/file_effect_crash_tests.zig +37 -0
- package/src/runtime/flow.zig +35 -10
- package/src/runtime/gpu_surface_events.zig +6 -1
- package/src/runtime/native_command_event_tests.zig +86 -2
- package/src/runtime/persist_store.zig +666 -0
- package/src/runtime/pty.zig +5 -2
- package/src/runtime/record_store.zig +788 -0
- package/src/runtime/relational_store.zig +854 -0
- package/src/runtime/root.zig +54 -0
- package/src/runtime/runtime_event_tests.zig +70 -0
- package/src/runtime/service_host.zig +711 -0
- package/src/runtime/service_pool.zig +1314 -0
- package/src/runtime/session_blobs.zig +4 -1
- package/src/runtime/session_journal.zig +158 -5
- package/src/runtime/session_record.zig +215 -0
- package/src/runtime/session_replay.zig +206 -11
- package/src/runtime/session_tests.zig +81 -0
- package/src/runtime/shell_layout.zig +1 -0
- package/src/runtime/shell_layout_tests.zig +120 -0
- package/src/runtime/sqlite_engine.zig +474 -0
- package/src/runtime/state.zig +16 -0
- package/src/runtime/system_services.zig +170 -38
- package/src/runtime/tests.zig +4 -0
- package/src/runtime/ts_core_host.zig +1067 -95
- package/src/runtime/ts_core_host_tests.zig +325 -11
- package/src/runtime/ts_ui_app.zig +953 -2
- package/src/runtime/ui_app.zig +434 -96
- package/src/runtime/ui_app_tests.zig +287 -11
- package/src/runtime/ui_app_window_tests.zig +61 -7
- package/src/runtime/validation.zig +42 -0
- package/src/runtime/view.zig +9 -0
- package/src/runtime/window_storage.zig +1 -0
- package/src/runtime/window_view_runtime.zig +2 -3
- package/src/runtime/window_views.zig +19 -0
- package/src/tooling/android.zig +21 -16
- package/src/tooling/db.zig +160 -0
- package/src/tooling/ios.zig +7 -1
- package/src/tooling/manifest.zig +214 -2
- package/src/tooling/package.zig +116 -0
- package/src/tooling/raw_manifest.zig +30 -0
- package/src/tooling/root.zig +1 -0
- package/src/tooling/templates.zig +189 -4
- package/src/tooling/ts_core.zig +366 -17
- package/src/tooling/verbs.zig +7 -0
- package/third_party/sqlite/README.md +13 -0
- package/third_party/sqlite/sqlite3.c +269649 -0
- package/third_party/sqlite/sqlite3.h +14349 -0
- package/tools/corewire/core_abi.zig +14 -2
- package/tools/corewire/emit.zig +98 -29
- package/tools/corewire/emit_facade.zig +442 -27
- package/tools/corewire/emit_profile.zig +6 -2
- package/tools/corewire/emit_service.zig +924 -0
- package/tools/corewire/main.zig +122 -0
- package/tools/corewire/service_contract.zig +250 -0
- package/tools/corewire/sidecar.zig +26 -15
|
@@ -1,13 +1,35 @@
|
|
|
1
1
|
export declare function asciiBytes(s: string): Uint8Array;
|
|
2
|
+
export declare function utf8Bytes(s: string): Uint8Array;
|
|
2
3
|
export type Msgish = {
|
|
3
4
|
readonly kind: string;
|
|
4
5
|
};
|
|
6
|
+
import { type WindowDescriptor, type WindowDescriptorSpec } from "./events.js";
|
|
7
|
+
export declare function windowDescriptor(spec: WindowDescriptorSpec): WindowDescriptor;
|
|
8
|
+
/** Cooperative cancellation capability supplied by generated service hosts. */
|
|
9
|
+
export interface ServiceCancellation {
|
|
10
|
+
/** True after Cmd.cancel or the operation deadline requests cancellation. */
|
|
11
|
+
readonly cancelled: () => boolean;
|
|
12
|
+
/** Throw a boundary-tagged cancellation error when cancellation was requested. */
|
|
13
|
+
readonly throwIfCancelled: () => void;
|
|
14
|
+
}
|
|
5
15
|
export type TimestampKind<M extends Msgish> = M extends Msgish ? {
|
|
6
16
|
[K in Exclude<keyof M, "kind">]-?: M[K] extends number ? [Exclude<keyof M, "kind">] extends [K] ? M["kind"] : never : never;
|
|
7
17
|
}[Exclude<keyof M, "kind">] : never;
|
|
8
18
|
export type BytesKind<M extends Msgish> = M extends Msgish ? {
|
|
9
19
|
[K in Exclude<keyof M, "kind">]-?: M[K] extends Uint8Array ? [Exclude<keyof M, "kind">] extends [K] ? M["kind"] : never : never;
|
|
10
20
|
}[Exclude<keyof M, "kind">] : never;
|
|
21
|
+
export type ServiceKind<M extends Msgish, P> = M extends Msgish ? {
|
|
22
|
+
[K in Exclude<keyof M, "kind">]-?: M[K] extends P ? P extends M[K] ? [Exclude<keyof M, "kind">] extends [K] ? M["kind"] : never : never : never;
|
|
23
|
+
}[Exclude<keyof M, "kind">] : never;
|
|
24
|
+
export interface ServiceRoute<M extends Msgish, P> {
|
|
25
|
+
readonly key?: string;
|
|
26
|
+
readonly ok: ServiceKind<M, P>;
|
|
27
|
+
readonly err: BytesKind<M>;
|
|
28
|
+
}
|
|
29
|
+
export interface ServiceStreamRoute<M extends Msgish, P> extends ServiceRoute<M, P> {
|
|
30
|
+
readonly channelKey: number;
|
|
31
|
+
readonly event: ChannelEventKind<M>;
|
|
32
|
+
}
|
|
11
33
|
export type EmptyKind<M extends Msgish> = M extends Msgish ? [Exclude<keyof M, "kind">] extends [never] ? M["kind"] : never : never;
|
|
12
34
|
export type FetchedKind<M extends Msgish> = M extends Msgish ? {
|
|
13
35
|
[K in Exclude<keyof M, "kind">]-?: M[K] extends Uint8Array ? Exclude<keyof M, "kind" | K> extends infer O ? O extends keyof M ? M[O] extends number ? [Exclude<keyof M, "kind" | K | O>] extends [never] ? M["kind"] : never : never : never : never : never;
|
|
@@ -116,6 +138,48 @@ export interface WriteRoute<M extends Msgish> {
|
|
|
116
138
|
readonly ok: EmptyKind<M>;
|
|
117
139
|
readonly err: BytesKind<M>;
|
|
118
140
|
}
|
|
141
|
+
export interface FileReadStreamRoute<M extends Msgish> {
|
|
142
|
+
readonly key?: string;
|
|
143
|
+
readonly chunk: BytesKind<M>;
|
|
144
|
+
readonly done: TimestampKind<M>;
|
|
145
|
+
readonly err: BytesKind<M>;
|
|
146
|
+
}
|
|
147
|
+
export interface FileStatArm {
|
|
148
|
+
readonly exists: boolean;
|
|
149
|
+
readonly size: number;
|
|
150
|
+
readonly mtimeMs: number;
|
|
151
|
+
}
|
|
152
|
+
export type FileStatKind<M extends Msgish> = M extends Msgish ? [Exclude<keyof M, "kind">] extends [keyof FileStatArm] ? [keyof FileStatArm] extends [Exclude<keyof M, "kind">] ? M extends Msgish & FileStatArm ? M["kind"] : never : never : never : never;
|
|
153
|
+
export interface FileStatRoute<M extends Msgish> {
|
|
154
|
+
readonly key?: string;
|
|
155
|
+
readonly ok: FileStatKind<M>;
|
|
156
|
+
readonly err: BytesKind<M>;
|
|
157
|
+
}
|
|
158
|
+
export interface StoreScanOptions {
|
|
159
|
+
readonly limit?: number;
|
|
160
|
+
readonly after?: string | Uint8Array;
|
|
161
|
+
}
|
|
162
|
+
export interface DbText {
|
|
163
|
+
readonly __dbText: true;
|
|
164
|
+
readonly bytes: ReadonlyArray<number>;
|
|
165
|
+
}
|
|
166
|
+
export declare function dbText(bytes: Uint8Array): DbText;
|
|
167
|
+
export type DbValue = null | number | string | Uint8Array | boolean | DbText;
|
|
168
|
+
export type DbStatement = readonly [sql: string, params: ReadonlyArray<DbValue>];
|
|
169
|
+
export interface DbRowsRoute<M extends Msgish> {
|
|
170
|
+
readonly key?: string;
|
|
171
|
+
readonly page: BytesKind<M>;
|
|
172
|
+
readonly done: EmptyKind<M>;
|
|
173
|
+
readonly err: BytesKind<M>;
|
|
174
|
+
}
|
|
175
|
+
export interface TypedRowsRoute<Row, M extends Msgish> extends DbRowsRoute<M> {
|
|
176
|
+
readonly __row?: Row;
|
|
177
|
+
}
|
|
178
|
+
export interface TypedDbStatement {
|
|
179
|
+
readonly sql: string;
|
|
180
|
+
readonly params: ReadonlyArray<DbValue>;
|
|
181
|
+
readonly __typedDbStatement: true;
|
|
182
|
+
}
|
|
119
183
|
export interface FetchRoute<M extends Msgish> {
|
|
120
184
|
readonly key?: string;
|
|
121
185
|
readonly ok: FetchedKind<M>;
|
|
@@ -184,10 +248,14 @@ export interface FetchStreamSpec extends FetchSpec {
|
|
|
184
248
|
readonly maxLineBytes?: number;
|
|
185
249
|
}
|
|
186
250
|
export interface NotificationSpec {
|
|
251
|
+
readonly id?: Uint8Array;
|
|
187
252
|
readonly title: Uint8Array;
|
|
188
253
|
readonly subtitle?: Uint8Array;
|
|
189
254
|
readonly body?: Uint8Array;
|
|
255
|
+
readonly actionLabel?: Uint8Array;
|
|
256
|
+
readonly actionCommand?: Uint8Array;
|
|
190
257
|
}
|
|
258
|
+
export type LocalTimeStyle = "date" | "time" | "datetime";
|
|
191
259
|
export type Cmd<M extends Msgish> = {
|
|
192
260
|
readonly op: "none";
|
|
193
261
|
} | {
|
|
@@ -209,6 +277,18 @@ export type Cmd<M extends Msgish> = {
|
|
|
209
277
|
readonly key: string;
|
|
210
278
|
readonly okKind: string;
|
|
211
279
|
readonly errKind: string;
|
|
280
|
+
readonly typedService: boolean;
|
|
281
|
+
readonly payload: Uint8Array;
|
|
282
|
+
} | {
|
|
283
|
+
readonly op: "service_stream_request";
|
|
284
|
+
readonly name: string;
|
|
285
|
+
readonly key: string;
|
|
286
|
+
readonly okKind: string;
|
|
287
|
+
readonly errKind: string;
|
|
288
|
+
readonly typedService: true;
|
|
289
|
+
readonly channelKey: number;
|
|
290
|
+
readonly eventKind: string;
|
|
291
|
+
readonly maxPending: number;
|
|
212
292
|
readonly payload: Uint8Array;
|
|
213
293
|
} | {
|
|
214
294
|
readonly op: "cancel";
|
|
@@ -226,6 +306,90 @@ export type Cmd<M extends Msgish> = {
|
|
|
226
306
|
readonly errKind: string;
|
|
227
307
|
readonly path: Uint8Array;
|
|
228
308
|
readonly bytes: Uint8Array;
|
|
309
|
+
} | {
|
|
310
|
+
readonly op: "append_file";
|
|
311
|
+
readonly key: string;
|
|
312
|
+
readonly okKind: string;
|
|
313
|
+
readonly errKind: string;
|
|
314
|
+
readonly path: Uint8Array;
|
|
315
|
+
readonly bytes: Uint8Array;
|
|
316
|
+
} | {
|
|
317
|
+
readonly op: "stat_file";
|
|
318
|
+
readonly key: string;
|
|
319
|
+
readonly okKind: string;
|
|
320
|
+
readonly errKind: string;
|
|
321
|
+
readonly path: Uint8Array;
|
|
322
|
+
} | {
|
|
323
|
+
readonly op: "delete_file";
|
|
324
|
+
readonly key: string;
|
|
325
|
+
readonly okKind: string;
|
|
326
|
+
readonly errKind: string;
|
|
327
|
+
readonly path: Uint8Array;
|
|
328
|
+
} | {
|
|
329
|
+
readonly op: "read_file_stream";
|
|
330
|
+
readonly key: string;
|
|
331
|
+
readonly chunkKind: string;
|
|
332
|
+
readonly doneKind: string;
|
|
333
|
+
readonly errKind: string;
|
|
334
|
+
readonly path: Uint8Array;
|
|
335
|
+
} | {
|
|
336
|
+
readonly op: "write_file_stream";
|
|
337
|
+
readonly key: string;
|
|
338
|
+
readonly okKind: string;
|
|
339
|
+
readonly errKind: string;
|
|
340
|
+
readonly path: Uint8Array;
|
|
341
|
+
} | {
|
|
342
|
+
readonly op: "write_file_chunk";
|
|
343
|
+
readonly key: string;
|
|
344
|
+
readonly okKind: string;
|
|
345
|
+
readonly errKind: string;
|
|
346
|
+
readonly bytes: Uint8Array;
|
|
347
|
+
} | {
|
|
348
|
+
readonly op: "write_file_close";
|
|
349
|
+
readonly key: string;
|
|
350
|
+
readonly okKind: string;
|
|
351
|
+
readonly errKind: string;
|
|
352
|
+
} | {
|
|
353
|
+
readonly op: "store_set";
|
|
354
|
+
readonly key: string;
|
|
355
|
+
readonly okKind: string;
|
|
356
|
+
readonly errKind: string;
|
|
357
|
+
readonly storeKey: string;
|
|
358
|
+
readonly bytes: Uint8Array;
|
|
359
|
+
} | {
|
|
360
|
+
readonly op: "store_get" | "store_delete";
|
|
361
|
+
readonly key: string;
|
|
362
|
+
readonly okKind: string;
|
|
363
|
+
readonly errKind: string;
|
|
364
|
+
readonly storeKey: string;
|
|
365
|
+
} | {
|
|
366
|
+
readonly op: "store_scan";
|
|
367
|
+
readonly key: string;
|
|
368
|
+
readonly okKind: string;
|
|
369
|
+
readonly errKind: string;
|
|
370
|
+
readonly prefix: string;
|
|
371
|
+
readonly limit: number;
|
|
372
|
+
readonly after: string | Uint8Array;
|
|
373
|
+
} | {
|
|
374
|
+
readonly op: "store_set_many";
|
|
375
|
+
readonly key: string;
|
|
376
|
+
readonly okKind: string;
|
|
377
|
+
readonly errKind: string;
|
|
378
|
+
readonly entries: ReadonlyArray<readonly [string, Uint8Array]>;
|
|
379
|
+
} | {
|
|
380
|
+
readonly op: "db_query";
|
|
381
|
+
readonly key: string;
|
|
382
|
+
readonly pageKind: string;
|
|
383
|
+
readonly doneKind: string;
|
|
384
|
+
readonly errKind: string;
|
|
385
|
+
readonly sql: string;
|
|
386
|
+
readonly params: ReadonlyArray<DbValue>;
|
|
387
|
+
} | {
|
|
388
|
+
readonly op: "db_exec";
|
|
389
|
+
readonly key: string;
|
|
390
|
+
readonly okKind: string;
|
|
391
|
+
readonly errKind: string;
|
|
392
|
+
readonly statements: ReadonlyArray<DbStatement>;
|
|
229
393
|
} | {
|
|
230
394
|
readonly op: "fetch";
|
|
231
395
|
readonly key: string;
|
|
@@ -264,9 +428,12 @@ export type Cmd<M extends Msgish> = {
|
|
|
264
428
|
readonly errKind: string;
|
|
265
429
|
} | {
|
|
266
430
|
readonly op: "show_notification";
|
|
431
|
+
readonly id: Uint8Array;
|
|
267
432
|
readonly title: Uint8Array;
|
|
268
433
|
readonly subtitle: Uint8Array;
|
|
269
434
|
readonly body: Uint8Array;
|
|
435
|
+
readonly actionLabel: Uint8Array;
|
|
436
|
+
readonly actionCommand: Uint8Array;
|
|
270
437
|
} | {
|
|
271
438
|
readonly op: "delay";
|
|
272
439
|
readonly key: string;
|
|
@@ -312,6 +479,12 @@ export type Cmd<M extends Msgish> = {
|
|
|
312
479
|
} | {
|
|
313
480
|
readonly op: "window_show";
|
|
314
481
|
readonly label: string;
|
|
482
|
+
} | {
|
|
483
|
+
readonly op: "window_hide";
|
|
484
|
+
readonly label: string;
|
|
485
|
+
} | {
|
|
486
|
+
readonly op: "dock_presence";
|
|
487
|
+
readonly visible: boolean;
|
|
315
488
|
} | {
|
|
316
489
|
readonly op: "quit_app";
|
|
317
490
|
} | {
|
|
@@ -332,6 +505,7 @@ export type Cmd<M extends Msgish> = {
|
|
|
332
505
|
readonly op: "channel_open";
|
|
333
506
|
readonly key: number;
|
|
334
507
|
readonly eventKind: string;
|
|
508
|
+
readonly maxPending: number;
|
|
335
509
|
} | {
|
|
336
510
|
readonly op: "channel_close";
|
|
337
511
|
readonly key: number;
|
|
@@ -370,6 +544,15 @@ export type Cmd<M extends Msgish> = {
|
|
|
370
544
|
readonly cmds: readonly Cmd<M>[];
|
|
371
545
|
};
|
|
372
546
|
export declare function hostRecordBytes(payload: HostRecord): Uint8Array;
|
|
547
|
+
export declare function serviceConcat(parts: readonly Uint8Array[]): Uint8Array;
|
|
548
|
+
export declare function serviceBoolBytes(value: boolean): Uint8Array;
|
|
549
|
+
export declare function serviceF64Bytes(value: number): Uint8Array;
|
|
550
|
+
export declare function serviceI64Bytes(value: number): Uint8Array;
|
|
551
|
+
export declare function serviceBytes(value: Uint8Array): Uint8Array;
|
|
552
|
+
export declare function serviceEnumBytes(index: number): Uint8Array;
|
|
553
|
+
export declare function serviceUnionBytes(index: number): Uint8Array;
|
|
554
|
+
export declare function serviceOptionalBytes(value: Uint8Array | null): Uint8Array;
|
|
555
|
+
export declare function serviceSliceBytes(values: readonly Uint8Array[]): Uint8Array;
|
|
373
556
|
declare function hostCmd(name: string, payload: Uint8Array | HostRecord): Cmd<never>;
|
|
374
557
|
declare function hostCmd(name: string, ...args: readonly number[]): Cmd<never>;
|
|
375
558
|
declare function fetchCmd<M extends Msgish>(spec: FetchSpec, route: FetchRoute<M>): Cmd<M>;
|
|
@@ -380,13 +563,41 @@ export declare const Cmd: {
|
|
|
380
563
|
now<M extends Msgish>(msgKind: TimestampKind<M>): Cmd<M>;
|
|
381
564
|
host: typeof hostCmd;
|
|
382
565
|
request<M extends Msgish>(name: string, payload: Uint8Array | HostRecord, route: RequestRoute<M>): Cmd<M>;
|
|
566
|
+
serviceRequest<M extends Msgish, P>(name: string, payload: Uint8Array, route: ServiceRoute<M, P>): Cmd<M>;
|
|
567
|
+
serviceStreamRequest<M extends Msgish, P>(name: string, channelKey: number, payload: Uint8Array, route: ServiceStreamRoute<M, P>, maxPending: number): Cmd<M>;
|
|
383
568
|
cancel(key: string): Cmd<never>;
|
|
384
569
|
readFile<M extends Msgish>(path: Uint8Array, route: RequestRoute<M>): Cmd<M>;
|
|
385
570
|
writeFile<M extends Msgish>(path: Uint8Array, bytes: Uint8Array, route: WriteRoute<M>): Cmd<M>;
|
|
571
|
+
appendFile<M extends Msgish>(path: Uint8Array, bytes: Uint8Array, route: WriteRoute<M>): Cmd<M>;
|
|
572
|
+
statFile<M extends Msgish>(path: Uint8Array, route: FileStatRoute<M>): Cmd<M>;
|
|
573
|
+
deleteFile<M extends Msgish>(path: Uint8Array, route: WriteRoute<M>): Cmd<M>;
|
|
574
|
+
readFileStream<M extends Msgish>(path: Uint8Array, route: FileReadStreamRoute<M>): Cmd<M>;
|
|
575
|
+
writeFileStream<M extends Msgish>(key: string, path: Uint8Array, route: WriteRoute<M>): Cmd<M>;
|
|
576
|
+
writeFileChunk<M extends Msgish>(key: string, bytes: Uint8Array, route: WriteRoute<M>): Cmd<M>;
|
|
577
|
+
writeFileClose<M extends Msgish>(key: string, route: WriteRoute<M>): Cmd<M>;
|
|
578
|
+
store: {
|
|
579
|
+
set<M extends Msgish>(storeKey: string, bytes: Uint8Array, route: WriteRoute<M>): Cmd<M>;
|
|
580
|
+
get<M extends Msgish>(storeKey: string, route: RequestRoute<M>): Cmd<M>;
|
|
581
|
+
delete<M extends Msgish>(storeKey: string, route: WriteRoute<M>): Cmd<M>;
|
|
582
|
+
scan<M extends Msgish>(prefix: string, options: StoreScanOptions, route: RequestRoute<M>): Cmd<M>;
|
|
583
|
+
setMany<M extends Msgish>(entries: ReadonlyArray<readonly [string, Uint8Array]>, route: WriteRoute<M>): Cmd<M>;
|
|
584
|
+
};
|
|
585
|
+
credentials: {
|
|
586
|
+
set<M extends Msgish>(credentialKey: string, secret: Uint8Array, route: WriteRoute<M>): Cmd<M>;
|
|
587
|
+
get<M extends Msgish>(credentialKey: string, route: RequestRoute<M>): Cmd<M>;
|
|
588
|
+
delete<M extends Msgish>(credentialKey: string, route: WriteRoute<M>): Cmd<M>;
|
|
589
|
+
};
|
|
590
|
+
db: {
|
|
591
|
+
query<M extends Msgish>(sql: string, params: ReadonlyArray<DbValue>, route: DbRowsRoute<M>): Cmd<M>;
|
|
592
|
+
exec<M extends Msgish>(statements: ReadonlyArray<DbStatement>, route: WriteRoute<M>): Cmd<M>;
|
|
593
|
+
};
|
|
386
594
|
fetch: typeof fetchCmd;
|
|
387
595
|
clipboardWrite(bytes: Uint8Array): Cmd<never>;
|
|
388
596
|
clipboardRead<M extends Msgish>(route: RequestRoute<M>): Cmd<M>;
|
|
389
597
|
showNotification(spec: NotificationSpec): Cmd<never>;
|
|
598
|
+
openExternalUrl(url: Uint8Array): Cmd<never>;
|
|
599
|
+
revealPath(path: Uint8Array): Cmd<never>;
|
|
600
|
+
formatLocalTime<M extends Msgish>(timestampMs: number, style: LocalTimeStyle, route: RequestRoute<M>): Cmd<M>;
|
|
390
601
|
delay<M extends Msgish>(key: string, ms: number, msgKind: TimestampKind<M>): Cmd<M>;
|
|
391
602
|
spawn<M extends Msgish>(argv: readonly Uint8Array[], route: SpawnRoute<M> | SpawnCollectRoute<M>): Cmd<M>;
|
|
392
603
|
audioPlay<M extends Msgish>(key: string, source: AudioSource, route: AudioRoute<M>): Cmd<M>;
|
|
@@ -404,6 +615,10 @@ export declare const Cmd: {
|
|
|
404
615
|
videoSetMuted(key: string, muted: boolean): Cmd<never>;
|
|
405
616
|
videoSetLoop(key: string, loop: boolean): Cmd<never>;
|
|
406
617
|
showWindow(label: string): Cmd<never>;
|
|
618
|
+
hideWindow(label: string): Cmd<never>;
|
|
619
|
+
setDockPresence(visible: boolean): Cmd<never>;
|
|
620
|
+
launchAtLoginStatus<M extends Msgish>(route: RequestRoute<M>): Cmd<M>;
|
|
621
|
+
setLaunchAtLogin<M extends Msgish>(enabled: boolean, route: RequestRoute<M>): Cmd<M>;
|
|
407
622
|
quitApp(): Cmd<never>;
|
|
408
623
|
imageLoad<M extends Msgish>(id: number, source: ImageSource, route: ImageRoute<M>): Cmd<M>;
|
|
409
624
|
imageCancel(id: number): Cmd<never>;
|
|
@@ -425,6 +640,15 @@ export type Sub<M extends Msgish> = {
|
|
|
425
640
|
readonly key: string;
|
|
426
641
|
readonly everyMs: number;
|
|
427
642
|
readonly msgKind: string;
|
|
643
|
+
} | {
|
|
644
|
+
readonly op: "db_live";
|
|
645
|
+
readonly key: string;
|
|
646
|
+
readonly pageKind: string;
|
|
647
|
+
readonly doneKind: string;
|
|
648
|
+
readonly errKind: string;
|
|
649
|
+
readonly sql: string;
|
|
650
|
+
readonly params: ReadonlyArray<DbValue>;
|
|
651
|
+
readonly tables: readonly string[];
|
|
428
652
|
} | {
|
|
429
653
|
readonly op: "batch";
|
|
430
654
|
readonly subs: readonly Sub<M>[];
|