@inkandswitch/patchwork-bootloader 0.3.0 → 0.3.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/src/types.ts CHANGED
@@ -6,6 +6,13 @@
6
6
  */
7
7
  export const HANDOFF_CHANNEL = "@patchwork/handoff";
8
8
 
9
+ /**
10
+ * BroadcastChannel on which the automerge shared worker announces remote
11
+ * heads it learns about from the sync server. Any tab can listen to stay
12
+ * informed of sync progress without repo-to-repo gossiping.
13
+ */
14
+ export const SYNCSTATE_CHANNEL = "@patchwork/syncstate";
15
+
9
16
  /**
10
17
  * The special URL to resolve, plus enough of the {@link Request} the service
11
18
  * worker is holding that the automerge worker can construct one that
@@ -105,6 +112,8 @@ export type ServiceWorkerRepoChannelListener = (
105
112
  ) => void | Promise<void>;
106
113
 
107
114
  export type SetupServiceWorkerResult = {
115
+ shared?: SharedWorker;
116
+ kill?: () => void;
108
117
  /** Open a classic Automerge sync WebSocket from the automerge worker. */
109
118
  connectClassicSync: (server?: string) => Promise<void>;
110
119
  subscribeToRepoChannel: (
@@ -14,6 +14,10 @@ const workers = [
14
14
  specifier: "@inkandswitch/patchwork-bootloader/automerge-worker",
15
15
  fileName: "automerge-worker.js",
16
16
  },
17
+ {
18
+ specifier: "@inkandswitch/patchwork-bootloader/module-loader-worker",
19
+ fileName: "module-loader-worker.js",
20
+ },
17
21
  ];
18
22
 
19
23
  export function serviceworker(): Plugin {