@domicile-desktop/sdk 0.0.0-alpha-89a0e9c17f7a → 0.0.0-alpha-e89d4b4fa606

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.
@@ -113,6 +113,12 @@ export type DomicileBrowserWindow = {
113
113
  * private window's new windows are private too.
114
114
  */
115
115
  readonly isPrivate: boolean;
116
+ /**
117
+ * Whether this is an app window, opened by `domicile open-app`. Draw it as
118
+ * an application: no address bar. Its page's new windows are browser
119
+ * windows. See docs/architecture/WEB-APPS.md.
120
+ */
121
+ readonly isApp: boolean;
116
122
  };
117
123
  /**
118
124
  * One thing that was copied, as a row of the clipboard's history.
@@ -1,4 +1,4 @@
1
- import type { DomicileHost, DomicileHostEventMap, DomicileWindow } from "./domicile-host";
1
+ import type { DomicileBrowserWindow, DomicileHost, DomicileHostEventMap, DomicileWindow } from "./domicile-host";
2
2
  /** The attributes of the desktop a test sets. */
3
3
  export type DomicileState = {
4
4
  -readonly [K in keyof DomicileHost as DomicileHost[K] extends (...args: never[]) => unknown ? never : K]: DomicileHost[K];
@@ -22,11 +22,12 @@ export declare class FakeDomicileHost {
22
22
  close(appId: string): void;
23
23
  /**
24
24
  * The engine opened a browser window at `url`, as for `domicile open-url`,
25
- * `target="_blank"`, or with `popupWindow` an extension's popup window.
26
- * `openBrowserWindow` calls this too, and `openPrivateBrowserWindow` with
27
- * `isPrivate`. Ids count up from `"1"`; the asked-for size is 0.
25
+ * `target="_blank"`, with `popupWindow` an extension's popup window, or with
26
+ * `isApp` `domicile open-app`. `openBrowserWindow` calls this too, and
27
+ * `openPrivateBrowserWindow` with `isPrivate`. Ids count up from `"1"`; the
28
+ * asked-for size is 0.
28
29
  */
29
- openBrowser(url: string, popupWindow?: number | null, isPrivate?: boolean): void;
30
+ openBrowser(url: string, { isApp, isPrivate, popupWindow, }?: Partial<Pick<DomicileBrowserWindow, "isApp" | "isPrivate" | "popupWindow">>): void;
30
31
  /** The engine closed browser window `id`. `closeBrowserWindow` calls this too. */
31
32
  closeBrowser(id: string): void;
32
33
  /** Dispatch a moment, such as `shortcut` or `focusrequested`, with its fields. */
package/dist/fake-host.js CHANGED
@@ -101,7 +101,7 @@ export class FakeDomicileHost {
101
101
  else if (name === "openPrivateBrowserWindow") {
102
102
  return (url) => {
103
103
  calls.push([name, url]);
104
- this.openBrowser(url, null, true);
104
+ this.openBrowser(url, { isPrivate: true });
105
105
  };
106
106
  }
107
107
  else if (name === "closeBrowserWindow") {
@@ -155,11 +155,12 @@ export class FakeDomicileHost {
155
155
  }
156
156
  /**
157
157
  * The engine opened a browser window at `url`, as for `domicile open-url`,
158
- * `target="_blank"`, or with `popupWindow` an extension's popup window.
159
- * `openBrowserWindow` calls this too, and `openPrivateBrowserWindow` with
160
- * `isPrivate`. Ids count up from `"1"`; the asked-for size is 0.
158
+ * `target="_blank"`, with `popupWindow` an extension's popup window, or with
159
+ * `isApp` `domicile open-app`. `openBrowserWindow` calls this too, and
160
+ * `openPrivateBrowserWindow` with `isPrivate`. Ids count up from `"1"`; the
161
+ * asked-for size is 0.
161
162
  */
162
- openBrowser(url, popupWindow = null, isPrivate = false) {
163
+ openBrowser(url, { isApp = false, isPrivate = false, popupWindow = null, } = {}) {
163
164
  this.#browsersOpened += 1;
164
165
  this.set({
165
166
  browserWindows: [
@@ -167,6 +168,7 @@ export class FakeDomicileHost {
167
168
  {
168
169
  height: 0,
169
170
  id: this.#browsersOpened.toString(),
171
+ isApp,
170
172
  isPrivate,
171
173
  popupWindow,
172
174
  title: "",
package/package.json CHANGED
@@ -120,7 +120,7 @@
120
120
  "test:unit": "bun test"
121
121
  },
122
122
  "type": "module",
123
- "version": "0.0.0-alpha-89a0e9c17f7a",
123
+ "version": "0.0.0-alpha-e89d4b4fa606",
124
124
  "repository": {
125
125
  "type": "git",
126
126
  "url": "git+https://github.com/cprussin/domicile.git",