@domicile-desktop/sdk 0.0.0-alpha-02742dc00a6c → 0.0.0-alpha-251128fa4649
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/dist/connect-to-host.js
CHANGED
|
@@ -87,9 +87,9 @@ const absentHost = () => ({
|
|
|
87
87
|
pointerButton: () => undefined,
|
|
88
88
|
pointerLeave: () => undefined,
|
|
89
89
|
pointerMotion: () => undefined,
|
|
90
|
-
previewFile: () => undefined,
|
|
91
|
-
searchApps: () => undefined,
|
|
92
|
-
searchFiles: () => undefined,
|
|
90
|
+
previewFile: () => new Promise(() => undefined),
|
|
91
|
+
searchApps: () => new Promise(() => undefined),
|
|
92
|
+
searchFiles: () => new Promise(() => undefined),
|
|
93
93
|
setAudioMuted: () => undefined,
|
|
94
94
|
setAudioPort: () => undefined,
|
|
95
95
|
setAudioProfile: () => undefined,
|
package/dist/domicile-client.js
CHANGED
|
@@ -397,7 +397,8 @@ export class DomicileClient {
|
|
|
397
397
|
searchFiles(query) {
|
|
398
398
|
return new Promise((settle) => {
|
|
399
399
|
this.#searches.set(query, [...(this.#searches.get(query) ?? []), settle]);
|
|
400
|
-
|
|
400
|
+
// Settled by the event; a superseded ask's rejection is not news.
|
|
401
|
+
this.#host.searchFiles(query).catch(() => undefined);
|
|
401
402
|
});
|
|
402
403
|
}
|
|
403
404
|
/**
|
|
@@ -409,7 +410,8 @@ export class DomicileClient {
|
|
|
409
410
|
previewFile(path) {
|
|
410
411
|
return new Promise((settle) => {
|
|
411
412
|
this.#previews.set(path, [...(this.#previews.get(path) ?? []), settle]);
|
|
412
|
-
|
|
413
|
+
// Settled by the event; a superseded ask's rejection is not news.
|
|
414
|
+
this.#host.previewFile(path).catch(() => undefined);
|
|
413
415
|
});
|
|
414
416
|
}
|
|
415
417
|
/**
|
|
@@ -422,7 +424,8 @@ export class DomicileClient {
|
|
|
422
424
|
...(this.#appSearches.get(query) ?? []),
|
|
423
425
|
settle,
|
|
424
426
|
]);
|
|
425
|
-
|
|
427
|
+
// Settled by the event; a superseded ask's rejection is not news.
|
|
428
|
+
this.#host.searchApps(query).catch(() => undefined);
|
|
426
429
|
});
|
|
427
430
|
}
|
|
428
431
|
/**
|
package/dist/domicile-host.d.ts
CHANGED
|
@@ -222,6 +222,12 @@ export type DomicileAppsEvent = Event & {
|
|
|
222
222
|
/** See {@link DomicileModifiersEvent.arrival}. */
|
|
223
223
|
readonly arrival: DOMHighResTimeStamp;
|
|
224
224
|
};
|
|
225
|
+
/** What {@link DomicileHost.searchFiles} resolves with; see {@link DomicileFilesEvent}. */
|
|
226
|
+
export type DomicileFileSearch = Pick<DomicileFilesEvent, "files" | "matched" | "indexing">;
|
|
227
|
+
/** What {@link DomicileHost.previewFile} resolves with; see {@link DomicileFilePreviewEvent}. */
|
|
228
|
+
export type DomicileFilePreview = Pick<DomicileFilePreviewEvent, "kind" | "text" | "entries" | "title" | "artist" | "album" | "duration" | "cover">;
|
|
229
|
+
/** What {@link DomicileHost.searchApps} resolves with; see {@link DomicileAppsEvent}. */
|
|
230
|
+
export type DomicileAppSearch = Pick<DomicileAppsEvent, "apps" | "bookmarks">;
|
|
225
231
|
/**
|
|
226
232
|
* The answer to {@link DomicileHost.searchFiles}.
|
|
227
233
|
*
|
|
@@ -667,25 +673,30 @@ export type DomicileHost = {
|
|
|
667
673
|
*/
|
|
668
674
|
spawn(command: readonly string[]): void;
|
|
669
675
|
/**
|
|
670
|
-
* Search the home directory for `query`.
|
|
676
|
+
* Search the home directory for `query`. Resolves with the result, which
|
|
677
|
+
* also arrives as a `files` event. A newer call rejects this one with an
|
|
678
|
+
* `AbortError`.
|
|
671
679
|
*
|
|
672
680
|
* It takes no path on purpose, so pages cannot browse the filesystem. The
|
|
673
681
|
* compositor matches against its index and sends only the matches. See
|
|
674
682
|
* `domicile_host::file_search`.
|
|
675
683
|
*/
|
|
676
|
-
searchFiles(query: string):
|
|
684
|
+
searchFiles(query: string): Promise<DomicileFileSearch>;
|
|
677
685
|
/**
|
|
678
|
-
* Preview `path`.
|
|
686
|
+
* Preview `path`. Resolves with the result, which also arrives as a
|
|
687
|
+
* `filepreview` event. A newer call rejects this one, as with
|
|
688
|
+
* {@link searchFiles}.
|
|
679
689
|
*
|
|
680
690
|
* Paths outside the compositor's home index are `unreadable`, so a page can
|
|
681
691
|
* only read what a search could return. See `domicile_host::file_preview`.
|
|
682
692
|
*/
|
|
683
|
-
previewFile(path: string):
|
|
693
|
+
previewFile(path: string): Promise<DomicileFilePreview>;
|
|
684
694
|
/**
|
|
685
|
-
* Search installed applications and bookmarks for `query`.
|
|
686
|
-
* `apps` event.
|
|
695
|
+
* Search installed applications and bookmarks for `query`. Resolves with
|
|
696
|
+
* the result, which also arrives as an `apps` event. A newer call rejects
|
|
697
|
+
* this one, as with {@link searchFiles}. See `domicile_host::desktop_entries`.
|
|
687
698
|
*/
|
|
688
|
-
searchApps(query: string):
|
|
699
|
+
searchApps(query: string): Promise<DomicileAppSearch>;
|
|
689
700
|
/**
|
|
690
701
|
* Put a clipboard history entry back on the clipboard.
|
|
691
702
|
*
|
package/package.json
CHANGED