@edenapp/client 0.0.0-stage → 0.15.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/LICENSE +21 -0
- package/README.md +115 -2
- package/dist/commands.generated.d.ts +447 -0
- package/dist/commands.generated.d.ts.map +1 -0
- package/dist/commands.generated.js +407 -0
- package/dist/commands.generated.js.map +1 -0
- package/dist/index.cjs +470 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.cts +447 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/invoke.d.ts +3 -0
- package/dist/invoke.d.ts.map +1 -0
- package/dist/invoke.js +5 -0
- package/dist/invoke.js.map +1 -0
- package/dist/runtime.d.ts +4 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +10 -0
- package/dist/runtime.js.map +1 -0
- package/dist/streams.d.ts +5 -0
- package/dist/streams.d.ts.map +1 -0
- package/dist/streams.js +22 -0
- package/dist/streams.js.map +1 -0
- package/dist/subscriptions.d.ts +4 -0
- package/dist/subscriptions.d.ts.map +1 -0
- package/dist/subscriptions.js +8 -0
- package/dist/subscriptions.js.map +1 -0
- package/package.json +43 -3
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* Typed app client generated from command and event declarations
|
|
5
|
+
* Generated by scripts/codegen
|
|
6
|
+
* Run 'pnpm run codegen' to regenerate.
|
|
7
|
+
*/
|
|
8
|
+
import type { CommandArgs, CommandResult, CommandStream, EventData, OperationSubmission } from "@edenapp/types";
|
|
9
|
+
declare const appbusCommands: {
|
|
10
|
+
/**
|
|
11
|
+
* Connect to another app's service
|
|
12
|
+
* Creates MessageChannel and transfers ports directly to both apps
|
|
13
|
+
* Requires "appbus/connect" permission
|
|
14
|
+
*/
|
|
15
|
+
connect: (targetAppId: CommandArgs<"appbus/connect">["targetAppId"], serviceName: CommandArgs<"appbus/connect">["serviceName"]) => Promise<CommandResult<"appbus/connect">>;
|
|
16
|
+
/**
|
|
17
|
+
* List all available services
|
|
18
|
+
* No permission required
|
|
19
|
+
*/
|
|
20
|
+
list: () => Promise<CommandResult<"appbus/list">>;
|
|
21
|
+
/**
|
|
22
|
+
* List services by app ID
|
|
23
|
+
* No permission required
|
|
24
|
+
*/
|
|
25
|
+
listByApp: (appId: CommandArgs<"appbus/list-by-app">["appId"]) => Promise<CommandResult<"appbus/list-by-app">>;
|
|
26
|
+
/**
|
|
27
|
+
* Register a service that this app exposes
|
|
28
|
+
* Requires "appbus/expose" permission
|
|
29
|
+
*/
|
|
30
|
+
register: (serviceName: CommandArgs<"appbus/register">["serviceName"], options?: Pick<CommandArgs<"appbus/register">, "description" | "allowedClients">) => Promise<CommandResult<"appbus/register">>;
|
|
31
|
+
/**
|
|
32
|
+
* Unregister a service
|
|
33
|
+
* Requires "appbus/expose" permission
|
|
34
|
+
*/
|
|
35
|
+
unregister: (serviceName: CommandArgs<"appbus/unregister">["serviceName"]) => Promise<CommandResult<"appbus/unregister">>;
|
|
36
|
+
};
|
|
37
|
+
export { appbusCommands as appbus };
|
|
38
|
+
declare const appearanceCommands: {
|
|
39
|
+
getPresets: () => Promise<CommandResult<"appearance/get-presets">>;
|
|
40
|
+
getWallpaper: () => Promise<CommandResult<"appearance/get-wallpaper">>;
|
|
41
|
+
setWallpaper: (wallpaper: CommandArgs<"appearance/set-wallpaper">["wallpaper"]) => Promise<CommandResult<"appearance/set-wallpaper">>;
|
|
42
|
+
subscribe: <E extends "wallpaper-changed">(event: E, callback: (data: EventData<`appearance/${E}`>) => void) => Promise<void>;
|
|
43
|
+
unsubscribe: <E extends "wallpaper-changed">(event: E, callback: (data: EventData<`appearance/${E}`>) => void) => void;
|
|
44
|
+
};
|
|
45
|
+
export { appearanceCommands as appearance };
|
|
46
|
+
declare const associationsCommands: {
|
|
47
|
+
get: (key: CommandArgs<"associations/get">["key"]) => Promise<CommandResult<"associations/get">>;
|
|
48
|
+
list: (options?: Pick<CommandArgs<"associations/list">, "kindPrefix">) => Promise<CommandResult<"associations/list">>;
|
|
49
|
+
remove: (key: CommandArgs<"associations/remove">["key"]) => Promise<CommandResult<"associations/remove">>;
|
|
50
|
+
set: (key: CommandArgs<"associations/set">["key"], appId: CommandArgs<"associations/set">["appId"], kind: CommandArgs<"associations/set">["kind"], options?: Pick<CommandArgs<"associations/set">, "label">) => Promise<CommandResult<"associations/set">>;
|
|
51
|
+
};
|
|
52
|
+
export { associationsCommands as associations };
|
|
53
|
+
declare const contextMenuCommands: {
|
|
54
|
+
close: (options?: Pick<CommandArgs<"context-menu/close">, "requestId">) => Promise<CommandResult<"context-menu/close">>;
|
|
55
|
+
open: (position: CommandArgs<"context-menu/open">["position"], items: CommandArgs<"context-menu/open">["items"], options?: Pick<CommandArgs<"context-menu/open">, "title">) => Promise<CommandResult<"context-menu/open">>;
|
|
56
|
+
registerDisplay: () => Promise<CommandResult<"context-menu/register-display">>;
|
|
57
|
+
resolve: (requestId: CommandArgs<"context-menu/resolve">["requestId"], reason: CommandArgs<"context-menu/resolve">["reason"], options?: Pick<CommandArgs<"context-menu/resolve">, "itemId">) => Promise<CommandResult<"context-menu/resolve">>;
|
|
58
|
+
subscribe: <E extends "closed" | "opened">(event: E, callback: (data: EventData<`context-menu/${E}`>) => void) => Promise<void>;
|
|
59
|
+
unsubscribe: <E extends "closed" | "opened">(event: E, callback: (data: EventData<`context-menu/${E}`>) => void) => void;
|
|
60
|
+
};
|
|
61
|
+
export { contextMenuCommands as contextMenu };
|
|
62
|
+
declare const daemonCommands: {
|
|
63
|
+
disable: (appId: CommandArgs<"daemon/disable">["appId"]) => Promise<CommandResult<"daemon/disable">>;
|
|
64
|
+
enable: (appId: CommandArgs<"daemon/enable">["appId"]) => Promise<CommandResult<"daemon/enable">>;
|
|
65
|
+
list: () => Promise<CommandResult<"daemon/list">>;
|
|
66
|
+
restart: (appId: CommandArgs<"daemon/restart">["appId"], options?: {
|
|
67
|
+
submission?: OperationSubmission;
|
|
68
|
+
}) => Promise<CommandResult<"daemon/restart">>;
|
|
69
|
+
start: (appId: CommandArgs<"daemon/start">["appId"], options?: {
|
|
70
|
+
submission?: OperationSubmission;
|
|
71
|
+
}) => Promise<CommandResult<"daemon/start">>;
|
|
72
|
+
stop: (appId: CommandArgs<"daemon/stop">["appId"], options?: {
|
|
73
|
+
submission?: OperationSubmission;
|
|
74
|
+
}) => Promise<CommandResult<"daemon/stop">>;
|
|
75
|
+
updateDefinition: (definition: CommandArgs<"daemon/update-definition">["definition"]) => Promise<CommandResult<"daemon/update-definition">>;
|
|
76
|
+
subscribe: <E extends "changed">(event: E, callback: (data: EventData<`daemon/${E}`>) => void) => Promise<void>;
|
|
77
|
+
unsubscribe: <E extends "changed">(event: E, callback: (data: EventData<`daemon/${E}`>) => void) => void;
|
|
78
|
+
};
|
|
79
|
+
export { daemonCommands as daemon };
|
|
80
|
+
declare const dbCommands: {
|
|
81
|
+
/**
|
|
82
|
+
* Clear all keys (scoped to caller's app)
|
|
83
|
+
*/
|
|
84
|
+
clear: () => Promise<CommandResult<"db/clear">>;
|
|
85
|
+
/**
|
|
86
|
+
* Clear all keys in any app's namespace (superuser only)
|
|
87
|
+
*/
|
|
88
|
+
clearSu: (appId: CommandArgs<"db/clear/su">["appId"]) => Promise<CommandResult<"db/clear/su">>;
|
|
89
|
+
/**
|
|
90
|
+
* Delete a key from database (scoped to caller's app)
|
|
91
|
+
*/
|
|
92
|
+
delete: (key: CommandArgs<"db/delete">["key"]) => Promise<CommandResult<"db/delete">>;
|
|
93
|
+
/**
|
|
94
|
+
* Delete a key from any app's namespace (superuser only)
|
|
95
|
+
*/
|
|
96
|
+
deleteSu: (appId: CommandArgs<"db/delete/su">["appId"], key: CommandArgs<"db/delete/su">["key"]) => Promise<CommandResult<"db/delete/su">>;
|
|
97
|
+
/**
|
|
98
|
+
* Get a value from database (scoped to caller's app)
|
|
99
|
+
*/
|
|
100
|
+
get: (key: CommandArgs<"db/get">["key"]) => Promise<CommandResult<"db/get">>;
|
|
101
|
+
/**
|
|
102
|
+
* Get a value from any app's namespace (superuser only)
|
|
103
|
+
*/
|
|
104
|
+
getSu: (appId: CommandArgs<"db/get/su">["appId"], key: CommandArgs<"db/get/su">["key"]) => Promise<CommandResult<"db/get/su">>;
|
|
105
|
+
/**
|
|
106
|
+
* Check if a key exists (scoped to caller's app)
|
|
107
|
+
*/
|
|
108
|
+
has: (key: CommandArgs<"db/has">["key"]) => Promise<CommandResult<"db/has">>;
|
|
109
|
+
/**
|
|
110
|
+
* Check if a key exists in any app's namespace (superuser only)
|
|
111
|
+
*/
|
|
112
|
+
hasSu: (appId: CommandArgs<"db/has/su">["appId"], key: CommandArgs<"db/has/su">["key"]) => Promise<CommandResult<"db/has/su">>;
|
|
113
|
+
/**
|
|
114
|
+
* List all keys (scoped to caller's app)
|
|
115
|
+
*/
|
|
116
|
+
list: () => Promise<CommandResult<"db/list">>;
|
|
117
|
+
/**
|
|
118
|
+
* List all keys in any app's namespace (superuser only)
|
|
119
|
+
*/
|
|
120
|
+
listSu: (appId: CommandArgs<"db/list/su">["appId"]) => Promise<CommandResult<"db/list/su">>;
|
|
121
|
+
/**
|
|
122
|
+
* Set a value in database (scoped to caller's app)
|
|
123
|
+
*/
|
|
124
|
+
set: (key: CommandArgs<"db/set">["key"], value: CommandArgs<"db/set">["value"]) => Promise<CommandResult<"db/set">>;
|
|
125
|
+
/**
|
|
126
|
+
* Set a value in any app's namespace (superuser only)
|
|
127
|
+
*/
|
|
128
|
+
setSu: (appId: CommandArgs<"db/set/su">["appId"], key: CommandArgs<"db/set/su">["key"], value: CommandArgs<"db/set/su">["value"]) => Promise<CommandResult<"db/set/su">>;
|
|
129
|
+
};
|
|
130
|
+
export { dbCommands as db };
|
|
131
|
+
declare const eventCommands: {
|
|
132
|
+
exists: (eventName: CommandArgs<"event/exists">["eventName"]) => Promise<CommandResult<"event/exists">>;
|
|
133
|
+
subscribe: (eventName: CommandArgs<"event/subscribe">["eventName"], options?: Pick<CommandArgs<"event/subscribe">, "operation">) => Promise<CommandResult<"event/subscribe">>;
|
|
134
|
+
unsubscribe: (eventName: CommandArgs<"event/unsubscribe">["eventName"], options?: Pick<CommandArgs<"event/unsubscribe">, "operation">) => Promise<CommandResult<"event/unsubscribe">>;
|
|
135
|
+
};
|
|
136
|
+
export { eventCommands as event };
|
|
137
|
+
declare const fileCommands: {
|
|
138
|
+
/**
|
|
139
|
+
* Get all file type associations
|
|
140
|
+
*/
|
|
141
|
+
getAssociations: () => Promise<CommandResult<"file/get-associations">>;
|
|
142
|
+
/**
|
|
143
|
+
* Get the default handler app for a file path
|
|
144
|
+
*/
|
|
145
|
+
getHandler: (location: CommandArgs<"file/get-handler">["location"]) => Promise<CommandResult<"file/get-handler">>;
|
|
146
|
+
/**
|
|
147
|
+
* Get all apps that can handle a specific file path
|
|
148
|
+
*/
|
|
149
|
+
getSupportedHandlers: (location: CommandArgs<"file/get-supported-handlers">["location"]) => Promise<CommandResult<"file/get-supported-handlers">>;
|
|
150
|
+
/**
|
|
151
|
+
* Open a file with its default handler
|
|
152
|
+
*/
|
|
153
|
+
open: (location: CommandArgs<"file/open">["location"], options?: {
|
|
154
|
+
submission?: OperationSubmission;
|
|
155
|
+
}) => Promise<CommandResult<"file/open">>;
|
|
156
|
+
/**
|
|
157
|
+
* Open a file with a specific app
|
|
158
|
+
*/
|
|
159
|
+
openWith: (location: CommandArgs<"file/open-with">["location"], appId: CommandArgs<"file/open-with">["appId"], options?: {
|
|
160
|
+
submission?: OperationSubmission;
|
|
161
|
+
}) => Promise<CommandResult<"file/open-with">>;
|
|
162
|
+
/**
|
|
163
|
+
* Remove user preference for a file path (revert to default)
|
|
164
|
+
*/
|
|
165
|
+
removeDefaultHandler: (location: CommandArgs<"file/remove-default-handler">["location"]) => Promise<CommandResult<"file/remove-default-handler">>;
|
|
166
|
+
/**
|
|
167
|
+
* Set user preference for a file path's default handler
|
|
168
|
+
*/
|
|
169
|
+
setDefaultHandler: (location: CommandArgs<"file/set-default-handler">["location"], appId: CommandArgs<"file/set-default-handler">["appId"]) => Promise<CommandResult<"file/set-default-handler">>;
|
|
170
|
+
subscribe: <E extends "opened">(event: E, callback: (data: EventData<`file/${E}`>) => void) => Promise<void>;
|
|
171
|
+
unsubscribe: <E extends "opened">(event: E, callback: (data: EventData<`file/${E}`>) => void) => void;
|
|
172
|
+
};
|
|
173
|
+
export { fileCommands as file };
|
|
174
|
+
declare const filePickerCommands: {
|
|
175
|
+
close: (options?: Pick<CommandArgs<"file-picker/close">, "requestId">) => Promise<CommandResult<"file-picker/close">>;
|
|
176
|
+
open: (mode: CommandArgs<"file-picker/open">["mode"], options?: Pick<CommandArgs<"file-picker/open">, "selection" | "multiple" | "title" | "initialLocation" | "allowedVolumes" | "suggestedName" | "filters" | "confirmLabel" | "canCreateDirectories" | "overwritePrompt">) => Promise<CommandResult<"file-picker/open">>;
|
|
177
|
+
registerDisplay: () => Promise<CommandResult<"file-picker/register-display">>;
|
|
178
|
+
resolve: (requestId: CommandArgs<"file-picker/resolve">["requestId"], reason: CommandArgs<"file-picker/resolve">["reason"], options?: Pick<CommandArgs<"file-picker/resolve">, "locations">) => Promise<CommandResult<"file-picker/resolve">>;
|
|
179
|
+
subscribe: <E extends "closed" | "opened">(event: E, callback: (data: EventData<`file-picker/${E}`>) => void) => Promise<void>;
|
|
180
|
+
unsubscribe: <E extends "closed" | "opened">(event: E, callback: (data: EventData<`file-picker/${E}`>) => void) => void;
|
|
181
|
+
};
|
|
182
|
+
export { filePickerCommands as filePicker };
|
|
183
|
+
declare const fsCommands: {
|
|
184
|
+
accessScope: (volume: CommandArgs<"fs/access-scope">["volume"]) => Promise<CommandResult<"fs/access-scope">>;
|
|
185
|
+
close: (handle: CommandArgs<"fs/close">["handle"]) => Promise<CommandResult<"fs/close">>;
|
|
186
|
+
cp: (from: CommandArgs<"fs/cp">["from"], to: CommandArgs<"fs/cp">["to"], options?: Pick<CommandArgs<"fs/cp">, "overwrite"> & {
|
|
187
|
+
submission?: OperationSubmission;
|
|
188
|
+
}) => Promise<CommandResult<"fs/cp">>;
|
|
189
|
+
delete: (location: CommandArgs<"fs/delete">["location"], options?: {
|
|
190
|
+
submission?: OperationSubmission;
|
|
191
|
+
}) => Promise<CommandResult<"fs/delete">>;
|
|
192
|
+
exists: (location: CommandArgs<"fs/exists">["location"]) => Promise<CommandResult<"fs/exists">>;
|
|
193
|
+
lstat: (location: CommandArgs<"fs/lstat">["location"]) => Promise<CommandResult<"fs/lstat">>;
|
|
194
|
+
mkdir: (location: CommandArgs<"fs/mkdir">["location"]) => Promise<CommandResult<"fs/mkdir">>;
|
|
195
|
+
mv: (from: CommandArgs<"fs/mv">["from"], to: CommandArgs<"fs/mv">["to"], options?: Pick<CommandArgs<"fs/mv">, "overwrite"> & {
|
|
196
|
+
submission?: OperationSubmission;
|
|
197
|
+
}) => Promise<CommandResult<"fs/mv">>;
|
|
198
|
+
open: (location: CommandArgs<"fs/open">["location"], options?: Pick<CommandArgs<"fs/open">, "mode">) => Promise<CommandResult<"fs/open">>;
|
|
199
|
+
read: (location: CommandArgs<"fs/read">["location"], options?: Pick<CommandArgs<"fs/read">, "encoding">) => Promise<CommandResult<"fs/read">>;
|
|
200
|
+
readBinary: (location: CommandArgs<"fs/read-binary">["location"]) => Promise<CommandResult<"fs/read-binary">>;
|
|
201
|
+
readdir: (location: CommandArgs<"fs/readdir">["location"]) => Promise<CommandResult<"fs/readdir">>;
|
|
202
|
+
resolve: (location: CommandArgs<"fs/resolve">["location"]) => Promise<CommandResult<"fs/resolve">>;
|
|
203
|
+
search: (location: CommandArgs<"fs/search">["location"], pattern: CommandArgs<"fs/search">["pattern"], options?: Pick<CommandArgs<"fs/search">, "limit">) => Promise<CommandStream<"fs/search">>;
|
|
204
|
+
stat: (location: CommandArgs<"fs/stat">["location"]) => Promise<CommandResult<"fs/stat">>;
|
|
205
|
+
/**
|
|
206
|
+
* Move a Home item to Trash.
|
|
207
|
+
*/
|
|
208
|
+
trash: (location: CommandArgs<"fs/trash">["location"], options?: {
|
|
209
|
+
submission?: OperationSubmission;
|
|
210
|
+
}) => Promise<CommandResult<"fs/trash">>;
|
|
211
|
+
/**
|
|
212
|
+
* Permanently delete one Trash item.
|
|
213
|
+
*/
|
|
214
|
+
trashDelete: (id: CommandArgs<"fs/trash-delete">["id"], options?: {
|
|
215
|
+
submission?: OperationSubmission;
|
|
216
|
+
}) => Promise<CommandResult<"fs/trash-delete">>;
|
|
217
|
+
/**
|
|
218
|
+
* Permanently delete every Trash item visible to the caller.
|
|
219
|
+
*/
|
|
220
|
+
trashEmpty: (options?: {
|
|
221
|
+
submission?: OperationSubmission;
|
|
222
|
+
}) => Promise<CommandResult<"fs/trash-empty">>;
|
|
223
|
+
/**
|
|
224
|
+
* List Trash items from folders the caller can access, newest first.
|
|
225
|
+
*/
|
|
226
|
+
trashEntries: () => Promise<CommandResult<"fs/trash-entries">>;
|
|
227
|
+
/**
|
|
228
|
+
* Restore a Trash item to its original location or another destination.
|
|
229
|
+
*/
|
|
230
|
+
trashRestore: (id: CommandArgs<"fs/trash-restore">["id"], options?: Pick<CommandArgs<"fs/trash-restore">, "location"> & {
|
|
231
|
+
submission?: OperationSubmission;
|
|
232
|
+
}) => Promise<CommandResult<"fs/trash-restore">>;
|
|
233
|
+
unwatch: (watchId: CommandArgs<"fs/unwatch">["watchId"]) => Promise<CommandResult<"fs/unwatch">>;
|
|
234
|
+
watch: (location: CommandArgs<"fs/watch">["location"]) => Promise<CommandResult<"fs/watch">>;
|
|
235
|
+
write: (location: CommandArgs<"fs/write">["location"], content: CommandArgs<"fs/write">["content"], options?: Pick<CommandArgs<"fs/write">, "encoding">) => Promise<CommandResult<"fs/write">>;
|
|
236
|
+
writeBinary: (location: CommandArgs<"fs/write-binary">["location"], content: CommandArgs<"fs/write-binary">["content"]) => Promise<CommandResult<"fs/write-binary">>;
|
|
237
|
+
subscribe: <E extends "changed" | "trash-changed">(event: E, callback: (data: EventData<`fs/${E}`>) => void) => Promise<void>;
|
|
238
|
+
unsubscribe: <E extends "changed" | "trash-changed">(event: E, callback: (data: EventData<`fs/${E}`>) => void) => void;
|
|
239
|
+
};
|
|
240
|
+
export { fsCommands as fs };
|
|
241
|
+
declare const i18nCommands: {
|
|
242
|
+
getCommon: (locale: CommandArgs<"i18n/get-common">["locale"]) => Promise<CommandResult<"i18n/get-common">>;
|
|
243
|
+
getLocale: () => Promise<CommandResult<"i18n/get-locale">>;
|
|
244
|
+
subscribe: <E extends "locale-changed">(event: E, callback: (data: EventData<`i18n/${E}`>) => void) => Promise<void>;
|
|
245
|
+
unsubscribe: <E extends "locale-changed">(event: E, callback: (data: EventData<`i18n/${E}`>) => void) => void;
|
|
246
|
+
};
|
|
247
|
+
export { i18nCommands as i18n };
|
|
248
|
+
declare const notificationCommands: {
|
|
249
|
+
/**
|
|
250
|
+
* Report a notification action click from the toaster.
|
|
251
|
+
*/
|
|
252
|
+
actionClicked: (notificationId: CommandArgs<"notification/action-clicked">["notificationId"], actionId: CommandArgs<"notification/action-clicked">["actionId"]) => Promise<CommandResult<"notification/action-clicked">>;
|
|
253
|
+
/**
|
|
254
|
+
* Report a notification dismissal from the toaster.
|
|
255
|
+
*/
|
|
256
|
+
dismissed: (notificationId: CommandArgs<"notification/dismissed">["notificationId"]) => Promise<CommandResult<"notification/dismissed">>;
|
|
257
|
+
/**
|
|
258
|
+
* Push a new notification to subscribers.
|
|
259
|
+
*/
|
|
260
|
+
push: (title: CommandArgs<"notification/push">["title"], message: CommandArgs<"notification/push">["message"], options?: Pick<CommandArgs<"notification/push">, "timeout" | "type" | "actions">) => Promise<CommandResult<"notification/push">>;
|
|
261
|
+
/**
|
|
262
|
+
* Register the notification display provider.
|
|
263
|
+
*/
|
|
264
|
+
registerDisplay: () => Promise<CommandResult<"notification/register-display">>;
|
|
265
|
+
subscribe: <E extends "action-clicked" | "added" | "removed">(event: E, callback: (data: EventData<`notification/${E}`>) => void) => Promise<void>;
|
|
266
|
+
unsubscribe: <E extends "action-clicked" | "added" | "removed">(event: E, callback: (data: EventData<`notification/${E}`>) => void) => void;
|
|
267
|
+
};
|
|
268
|
+
export { notificationCommands as notification };
|
|
269
|
+
declare const operationCommands: {
|
|
270
|
+
cancel: (handle: CommandArgs<"operation/cancel">["handle"]) => Promise<CommandResult<"operation/cancel">>;
|
|
271
|
+
get: (handle: CommandArgs<"operation/get">["handle"]) => Promise<CommandResult<"operation/get">>;
|
|
272
|
+
list: () => Promise<CommandResult<"operation/list">>;
|
|
273
|
+
subscribe: <E extends "changed">(event: E, callback: (data: EventData<`operation/${E}`>) => void) => Promise<void>;
|
|
274
|
+
unsubscribe: <E extends "changed">(event: E, callback: (data: EventData<`operation/${E}`>) => void) => void;
|
|
275
|
+
};
|
|
276
|
+
export { operationCommands as operation };
|
|
277
|
+
declare const packageCommands: {
|
|
278
|
+
get: (packageId: CommandArgs<"package/get">["packageId"]) => Promise<CommandResult<"package/get">>;
|
|
279
|
+
getIcon: (packageId: CommandArgs<"package/get-icon">["packageId"]) => Promise<CommandResult<"package/get-icon">>;
|
|
280
|
+
getInfo: (location: CommandArgs<"package/get-info">["location"]) => Promise<CommandResult<"package/get-info">>;
|
|
281
|
+
getSize: (packageId: CommandArgs<"package/get-size">["packageId"]) => Promise<CommandResult<"package/get-size">>;
|
|
282
|
+
install: (source: CommandArgs<"package/install">["source"], options?: Pick<CommandArgs<"package/install">, "replace"> & {
|
|
283
|
+
submission?: OperationSubmission;
|
|
284
|
+
}) => Promise<CommandResult<"package/install">>;
|
|
285
|
+
isHotReloadEnabled: (packageId: CommandArgs<"package/is-hot-reload-enabled">["packageId"]) => Promise<CommandResult<"package/is-hot-reload-enabled">>;
|
|
286
|
+
list: (options?: Pick<CommandArgs<"package/list">, "showHidden" | "showRestricted">) => Promise<CommandResult<"package/list">>;
|
|
287
|
+
self: () => Promise<CommandResult<"package/self">>;
|
|
288
|
+
toggleHotReload: (packageId: CommandArgs<"package/toggle-hot-reload">["packageId"]) => Promise<CommandResult<"package/toggle-hot-reload">>;
|
|
289
|
+
uninstall: (packageId: CommandArgs<"package/uninstall">["packageId"], options?: {
|
|
290
|
+
submission?: OperationSubmission;
|
|
291
|
+
}) => Promise<CommandResult<"package/uninstall">>;
|
|
292
|
+
subscribe: <E extends "installed" | "uninstalled">(event: E, callback: (data: EventData<`package/${E}`>) => void) => Promise<void>;
|
|
293
|
+
unsubscribe: <E extends "installed" | "uninstalled">(event: E, callback: (data: EventData<`package/${E}`>) => void) => void;
|
|
294
|
+
};
|
|
295
|
+
export { packageCommands as package };
|
|
296
|
+
declare const processCommands: {
|
|
297
|
+
exit: (options?: {
|
|
298
|
+
submission?: OperationSubmission;
|
|
299
|
+
}) => Promise<CommandResult<"process/exit">>;
|
|
300
|
+
launch: (appId: CommandArgs<"process/launch">["appId"], options?: Pick<CommandArgs<"process/launch">, "bounds"> & {
|
|
301
|
+
submission?: OperationSubmission;
|
|
302
|
+
}) => Promise<CommandResult<"process/launch">>;
|
|
303
|
+
list: (options?: Pick<CommandArgs<"process/list">, "showHidden">) => Promise<CommandResult<"process/list">>;
|
|
304
|
+
metrics: (options?: Pick<CommandArgs<"process/metrics">, "showHidden" | "pollingTimeoutMs" | "waitForAccurateCpu">) => Promise<CommandResult<"process/metrics">>;
|
|
305
|
+
stop: (appId: CommandArgs<"process/stop">["appId"], options?: {
|
|
306
|
+
submission?: OperationSubmission;
|
|
307
|
+
}) => Promise<CommandResult<"process/stop">>;
|
|
308
|
+
subscribe: <E extends "error" | "exited" | "launched" | "reloading" | "stopped">(event: E, callback: (data: EventData<`process/${E}`>) => void) => Promise<void>;
|
|
309
|
+
unsubscribe: <E extends "error" | "exited" | "launched" | "reloading" | "stopped">(event: E, callback: (data: EventData<`process/${E}`>) => void) => void;
|
|
310
|
+
};
|
|
311
|
+
export { processCommands as process };
|
|
312
|
+
declare const sessionCommands: {
|
|
313
|
+
getCurrent: () => Promise<CommandResult<"session/get-current">>;
|
|
314
|
+
login: (username: CommandArgs<"session/login">["username"], password: CommandArgs<"session/login">["password"], options?: {
|
|
315
|
+
submission?: OperationSubmission;
|
|
316
|
+
}) => Promise<CommandResult<"session/login">>;
|
|
317
|
+
logout: (options?: {
|
|
318
|
+
submission?: OperationSubmission;
|
|
319
|
+
}) => Promise<CommandResult<"session/logout">>;
|
|
320
|
+
subscribe: <E extends "changed">(event: E, callback: (data: EventData<`session/${E}`>) => void) => Promise<void>;
|
|
321
|
+
unsubscribe: <E extends "changed">(event: E, callback: (data: EventData<`session/${E}`>) => void) => void;
|
|
322
|
+
};
|
|
323
|
+
export { sessionCommands as session };
|
|
324
|
+
declare const settingsCommands: {
|
|
325
|
+
action: (panelId: CommandArgs<"settings/action">["panelId"], actionId: CommandArgs<"settings/action">["actionId"], options?: Pick<CommandArgs<"settings/action">, "invocation">) => Promise<CommandResult<"settings/action">>;
|
|
326
|
+
/**
|
|
327
|
+
* Get a setting value (scoped to caller's app)
|
|
328
|
+
*/
|
|
329
|
+
get: (key: CommandArgs<"settings/get">["key"], options?: Pick<CommandArgs<"settings/get">, "appId">) => Promise<CommandResult<"settings/get">>;
|
|
330
|
+
/**
|
|
331
|
+
* Get all settings with values (scoped to caller's app)
|
|
332
|
+
*/
|
|
333
|
+
getAll: () => Promise<CommandResult<"settings/get-all">>;
|
|
334
|
+
/**
|
|
335
|
+
* Get all settings with values for any app (superuser only)
|
|
336
|
+
* @param showRestricted - If true, includes settings the current user cannot access (hidden by default)
|
|
337
|
+
*/
|
|
338
|
+
getAllSu: (appId: CommandArgs<"settings/get-all/su">["appId"], options?: Pick<CommandArgs<"settings/get-all/su">, "showRestricted">) => Promise<CommandResult<"settings/get-all/su">>;
|
|
339
|
+
/**
|
|
340
|
+
* Get a setting from any app's namespace (superuser only)
|
|
341
|
+
*/
|
|
342
|
+
getSu: (appId: CommandArgs<"settings/get/su">["appId"], key: CommandArgs<"settings/get/su">["key"]) => Promise<CommandResult<"settings/get/su">>;
|
|
343
|
+
/**
|
|
344
|
+
* List all settings keys (scoped to caller's app)
|
|
345
|
+
*/
|
|
346
|
+
list: () => Promise<CommandResult<"settings/list">>;
|
|
347
|
+
/**
|
|
348
|
+
* List all settings in any app's namespace (superuser only)
|
|
349
|
+
* @param showRestricted - If true, includes settings the current user cannot access (hidden by default)
|
|
350
|
+
*/
|
|
351
|
+
listSu: (appId: CommandArgs<"settings/list/su">["appId"], options?: Pick<CommandArgs<"settings/list/su">, "showRestricted">) => Promise<CommandResult<"settings/list/su">>;
|
|
352
|
+
panel: (panelId: CommandArgs<"settings/panel">["panelId"]) => Promise<CommandResult<"settings/panel">>;
|
|
353
|
+
panels: () => Promise<CommandResult<"settings/panels">>;
|
|
354
|
+
/**
|
|
355
|
+
* Reset a setting to default (scoped to caller's app)
|
|
356
|
+
*/
|
|
357
|
+
reset: (key: CommandArgs<"settings/reset">["key"], options?: Pick<CommandArgs<"settings/reset">, "schema">) => Promise<CommandResult<"settings/reset">>;
|
|
358
|
+
/**
|
|
359
|
+
* Reset a setting for any app (superuser only)
|
|
360
|
+
*/
|
|
361
|
+
resetSu: (appId: CommandArgs<"settings/reset/su">["appId"], key: CommandArgs<"settings/reset/su">["key"], options?: Pick<CommandArgs<"settings/reset/su">, "schema">) => Promise<CommandResult<"settings/reset/su">>;
|
|
362
|
+
/**
|
|
363
|
+
* Set a setting value (scoped to caller's app)
|
|
364
|
+
*/
|
|
365
|
+
set: (key: CommandArgs<"settings/set">["key"], value: CommandArgs<"settings/set">["value"]) => Promise<CommandResult<"settings/set">>;
|
|
366
|
+
/**
|
|
367
|
+
* Set a setting in any app's namespace (superuser only)
|
|
368
|
+
*/
|
|
369
|
+
setSu: (appId: CommandArgs<"settings/set/su">["appId"], key: CommandArgs<"settings/set/su">["key"], value: CommandArgs<"settings/set/su">["value"]) => Promise<CommandResult<"settings/set/su">>;
|
|
370
|
+
subscribe: <E extends "changed" | "panels-changed">(event: E, callback: (data: EventData<`settings/${E}`>) => void) => Promise<void>;
|
|
371
|
+
unsubscribe: <E extends "changed" | "panels-changed">(event: E, callback: (data: EventData<`settings/${E}`>) => void) => void;
|
|
372
|
+
};
|
|
373
|
+
export { settingsCommands as settings };
|
|
374
|
+
declare const streamCommands: {
|
|
375
|
+
/**
|
|
376
|
+
* Return credit for chunks that the caller consumed from its stream.
|
|
377
|
+
* Stream readers send this automatically.
|
|
378
|
+
*/
|
|
379
|
+
ack: (handle: CommandArgs<"stream/ack">["handle"], count: CommandArgs<"stream/ack">["count"]) => Promise<CommandResult<"stream/ack">>;
|
|
380
|
+
/**
|
|
381
|
+
* Stop a stream that the caller opened.
|
|
382
|
+
*/
|
|
383
|
+
cancel: (handle: CommandArgs<"stream/cancel">["handle"]) => Promise<CommandResult<"stream/cancel">>;
|
|
384
|
+
};
|
|
385
|
+
export { streamCommands as stream };
|
|
386
|
+
declare const systemCommands: {
|
|
387
|
+
/**
|
|
388
|
+
* Get consumer-controlled product branding for SDK-owned interfaces.
|
|
389
|
+
*/
|
|
390
|
+
branding: () => Promise<CommandResult<"system/branding">>;
|
|
391
|
+
info: () => Promise<CommandResult<"system/info">>;
|
|
392
|
+
power: (action: CommandArgs<"system/power">["action"], options?: {
|
|
393
|
+
submission?: OperationSubmission;
|
|
394
|
+
}) => Promise<CommandResult<"system/power">>;
|
|
395
|
+
powerCapabilities: () => Promise<CommandResult<"system/power-capabilities">>;
|
|
396
|
+
};
|
|
397
|
+
export { systemCommands as system };
|
|
398
|
+
declare const userCommands: {
|
|
399
|
+
changePassword: (currentPassword: CommandArgs<"user/change-password">["currentPassword"], newPassword: CommandArgs<"user/change-password">["newPassword"]) => Promise<CommandResult<"user/change-password">>;
|
|
400
|
+
create: (name: CommandArgs<"user/create">["name"], password: CommandArgs<"user/create">["password"], options?: Pick<CommandArgs<"user/create">, "username" | "role" | "grants" | "directoryRestriction">) => Promise<CommandResult<"user/create">>;
|
|
401
|
+
delete: (username: CommandArgs<"user/delete">["username"]) => Promise<CommandResult<"user/delete">>;
|
|
402
|
+
getDefault: () => Promise<CommandResult<"user/get-default">>;
|
|
403
|
+
grantOptions: () => Promise<CommandResult<"user/grant-options">>;
|
|
404
|
+
hasGrant: (grant: CommandArgs<"user/has-grant">["grant"]) => Promise<CommandResult<"user/has-grant">>;
|
|
405
|
+
list: () => Promise<CommandResult<"user/list">>;
|
|
406
|
+
setDefault: (username: CommandArgs<"user/set-default">["username"]) => Promise<CommandResult<"user/set-default">>;
|
|
407
|
+
setPassword: (username: CommandArgs<"user/set-password">["username"], password: CommandArgs<"user/set-password">["password"]) => Promise<CommandResult<"user/set-password">>;
|
|
408
|
+
update: (username: CommandArgs<"user/update">["username"], options?: Pick<CommandArgs<"user/update">, "name" | "role" | "grants" | "directoryRestriction">) => Promise<CommandResult<"user/update">>;
|
|
409
|
+
subscribe: <E extends "grant-options-changed">(event: E, callback: (data: EventData<`user/${E}`>) => void) => Promise<void>;
|
|
410
|
+
unsubscribe: <E extends "grant-options-changed">(event: E, callback: (data: EventData<`user/${E}`>) => void) => void;
|
|
411
|
+
};
|
|
412
|
+
export { userCommands as user };
|
|
413
|
+
declare const viewCommands: {
|
|
414
|
+
endDrag: () => Promise<CommandResult<"view/end-drag">>;
|
|
415
|
+
endResize: () => Promise<CommandResult<"view/end-resize">>;
|
|
416
|
+
expandTile: (direction: CommandArgs<"view/expand-tile">["direction"]) => Promise<CommandResult<"view/expand-tile">>;
|
|
417
|
+
focus: () => Promise<CommandResult<"view/focus">>;
|
|
418
|
+
focusView: (appId: CommandArgs<"view/focus-view">["appId"]) => Promise<CommandResult<"view/focus-view">>;
|
|
419
|
+
getInterfaceScale: () => Promise<CommandResult<"view/get-interface-scale">>;
|
|
420
|
+
globalMouseup: () => Promise<CommandResult<"view/global-mouseup">>;
|
|
421
|
+
setInterfaceScale: (scale: CommandArgs<"view/set-interface-scale">["scale"]) => Promise<CommandResult<"view/set-interface-scale">>;
|
|
422
|
+
setViewVisibility: (appId: CommandArgs<"view/set-view-visibility">["appId"], visible: CommandArgs<"view/set-view-visibility">["visible"]) => Promise<CommandResult<"view/set-view-visibility">>;
|
|
423
|
+
setVisibility: (visible: CommandArgs<"view/set-visibility">["visible"]) => Promise<CommandResult<"view/set-visibility">>;
|
|
424
|
+
startDrag: (startX: CommandArgs<"view/start-drag">["startX"], startY: CommandArgs<"view/start-drag">["startY"]) => Promise<CommandResult<"view/start-drag">>;
|
|
425
|
+
startResize: (startX: CommandArgs<"view/start-resize">["startX"], startY: CommandArgs<"view/start-resize">["startY"], options?: Pick<CommandArgs<"view/start-resize">, "direction">) => Promise<CommandResult<"view/start-resize">>;
|
|
426
|
+
swapTile: (direction: CommandArgs<"view/swap-tile">["direction"]) => Promise<CommandResult<"view/swap-tile">>;
|
|
427
|
+
tileLayoutState: () => Promise<CommandResult<"view/tile-layout-state">>;
|
|
428
|
+
toggleMode: (options?: Pick<CommandArgs<"view/toggle-mode">, "mode">) => Promise<CommandResult<"view/toggle-mode">>;
|
|
429
|
+
toggleViewMode: (appId: CommandArgs<"view/toggle-view-mode">["appId"], options?: Pick<CommandArgs<"view/toggle-view-mode">, "mode">) => Promise<CommandResult<"view/toggle-view-mode">>;
|
|
430
|
+
updateBounds: (bounds: CommandArgs<"view/update-bounds">["bounds"]) => Promise<CommandResult<"view/update-bounds">>;
|
|
431
|
+
updateGlobalBounds: (bounds: CommandArgs<"view/update-global-bounds">["bounds"], windowSize: CommandArgs<"view/update-global-bounds">["windowSize"]) => Promise<CommandResult<"view/update-global-bounds">>;
|
|
432
|
+
updateViewBounds: (appId: CommandArgs<"view/update-view-bounds">["appId"], bounds: CommandArgs<"view/update-view-bounds">["bounds"]) => Promise<CommandResult<"view/update-view-bounds">>;
|
|
433
|
+
windowSize: () => Promise<CommandResult<"view/window-size">>;
|
|
434
|
+
subscribe: <E extends "bounds-updated" | "global-bounds-changed" | "interface-scale-changed" | "mode-changed" | "view-load-failed" | "view-loaded" | "view-removed">(event: E, callback: (data: EventData<`view/${E}`>) => void) => Promise<void>;
|
|
435
|
+
unsubscribe: <E extends "bounds-updated" | "global-bounds-changed" | "interface-scale-changed" | "mode-changed" | "view-load-failed" | "view-loaded" | "view-removed">(event: E, callback: (data: EventData<`view/${E}`>) => void) => void;
|
|
436
|
+
};
|
|
437
|
+
export { viewCommands as view };
|
|
438
|
+
declare const volumeCommands: {
|
|
439
|
+
eject: (volume: CommandArgs<"volume/eject">["volume"], options?: {
|
|
440
|
+
submission?: OperationSubmission;
|
|
441
|
+
}) => Promise<CommandResult<"volume/eject">>;
|
|
442
|
+
list: () => Promise<CommandResult<"volume/list">>;
|
|
443
|
+
subscribe: <E extends "changed">(event: E, callback: (data: EventData<`volume/${E}`>) => void) => Promise<void>;
|
|
444
|
+
unsubscribe: <E extends "changed">(event: E, callback: (data: EventData<`volume/${E}`>) => void) => void;
|
|
445
|
+
};
|
|
446
|
+
export { volumeCommands as volume };
|
|
447
|
+
//# sourceMappingURL=commands.generated.d.ts.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/invoke.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CommandArgs, CommandName, CommandResult, OperationSubmission } from "@edenapp/types";
|
|
2
|
+
export declare function invoke<C extends CommandName>(command: C, args: CommandArgs<C>, submission?: OperationSubmission): Promise<CommandResult<C>>;
|
|
3
|
+
//# sourceMappingURL=invoke.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../src/invoke.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AAGxB,wBAAsB,MAAM,CAAC,CAAC,SAAS,WAAW,EAChD,OAAO,EAAE,CAAC,EACV,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EACpB,UAAU,CAAC,EAAE,mBAAmB,GAC/B,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAE3B"}
|
package/dist/invoke.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoke.js","sourceRoot":"","sources":["../src/invoke.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,OAAU,EACV,IAAoB,EACpB,UAAgC;IAEhC,OAAO,UAAU,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,qFAAqF;AACrF,wBAAgB,UAAU,IAAI,OAAO,CAYpC"}
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Resolve at call time so importing the client does not require an Eden runtime. */
|
|
2
|
+
export function getEdenAPI() {
|
|
3
|
+
const runtime = globalThis;
|
|
4
|
+
const api = runtime.window?.edenAPI ?? runtime.worker?.edenAPI;
|
|
5
|
+
if (!api) {
|
|
6
|
+
throw new Error("@edenapp/client requires an Eden frontend or backend runtime");
|
|
7
|
+
}
|
|
8
|
+
return api;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAEA,qFAAqF;AACrF,MAAM,UAAU,UAAU;IACxB,MAAM,OAAO,GAAG,UAGf,CAAC;IACF,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/D,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,8DAA8D,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CommandArgs, CommandName, CommandStream, StreamReader } from "@edenapp/types";
|
|
2
|
+
/** Context bridges drop symbol keys, so iteration is attached on the app side. */
|
|
3
|
+
export declare function toCommandStream<C extends string>(reader: StreamReader<C>): CommandStream<C>;
|
|
4
|
+
export declare function openStream<C extends CommandName>(command: C, args: CommandArgs<C>): Promise<CommandStream<C>>;
|
|
5
|
+
//# sourceMappingURL=streams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,YAAY,EACb,MAAM,gBAAgB,CAAC;AAGxB,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAC9C,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GACtB,aAAa,CAAC,CAAC,CAAC,CAelB;AAED,wBAAsB,UAAU,CAAC,CAAC,SAAS,WAAW,EACpD,OAAO,EAAE,CAAC,EACV,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAE3B"}
|
package/dist/streams.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { invoke } from "./invoke.js";
|
|
2
|
+
/** Context bridges drop symbol keys, so iteration is attached on the app side. */
|
|
3
|
+
export function toCommandStream(reader) {
|
|
4
|
+
const next = () => reader.next();
|
|
5
|
+
const cancel = () => reader.cancel();
|
|
6
|
+
return {
|
|
7
|
+
handle: reader.handle,
|
|
8
|
+
next,
|
|
9
|
+
cancel,
|
|
10
|
+
[Symbol.asyncIterator]: () => ({
|
|
11
|
+
next,
|
|
12
|
+
return: async () => {
|
|
13
|
+
await cancel();
|
|
14
|
+
return { done: true, value: undefined };
|
|
15
|
+
},
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export async function openStream(command, args) {
|
|
20
|
+
return toCommandStream((await invoke(command, args)));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=streams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streams.js","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAC7B,MAAuB;IAEvB,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACjC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACrC,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,IAAI;QACJ,MAAM;QACN,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;YAC7B,IAAI;YACJ,MAAM,EAAE,KAAK,IAAI,EAAE;gBACjB,MAAM,MAAM,EAAE,CAAC;gBACf,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;YAC1C,CAAC;SACF,CAAC;KACH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAAU,EACV,IAAoB;IAEpB,OAAO,eAAe,CAAC,CAAC,MAAM,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAoB,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EventData, EventName } from "@edenapp/types";
|
|
2
|
+
export declare function subscribe<E extends EventName>(event: E, callback: (data: EventData<E>) => void): Promise<void>;
|
|
3
|
+
export declare function unsubscribe<E extends EventName>(event: E, callback: (data: EventData<E>) => void): void;
|
|
4
|
+
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../src/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3D,wBAAsB,SAAS,CAAC,CAAC,SAAS,SAAS,EACjD,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,GACrC,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAC7C,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,GACrC,IAAI,CAEN"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getEdenAPI } from "./runtime.js";
|
|
2
|
+
export async function subscribe(event, callback) {
|
|
3
|
+
return getEdenAPI().subscribe(event, callback);
|
|
4
|
+
}
|
|
5
|
+
export function unsubscribe(event, callback) {
|
|
6
|
+
getEdenAPI().unsubscribe(event, callback);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../src/subscriptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,KAAQ,EACR,QAAsC;IAEtC,OAAO,UAAU,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,KAAQ,EACR,QAAsC;IAEtC,UAAU,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC"}
|