@arcote.tech/arc-host 0.1.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/dist/host.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import { type ArcContextAny, type DatabaseAdapter, type DataStorageChanges, type RealTimeCommunicationAdapter } from "@arcote.tech/arc";
2
+ declare class RTCHost implements RealTimeCommunicationAdapter {
3
+ private context;
4
+ private server;
5
+ private dataStore;
6
+ constructor(context: ArcContextAny, dbAdapter: Promise<DatabaseAdapter>);
7
+ commitChanges(changes: DataStorageChanges[]): void;
8
+ sync(progressCallback: ({ store, size, }: {
9
+ store: string;
10
+ size: number;
11
+ }) => void): Promise<void>;
12
+ private verifyToken;
13
+ private handleCommand;
14
+ private handleQuery;
15
+ private setupServer;
16
+ private handleSync;
17
+ private onMessage;
18
+ private publishMessage;
19
+ }
20
+ export declare const rtcHostFactory: (context: ArcContextAny, dbAdapter: Promise<DatabaseAdapter>) => () => RTCHost;
21
+ export {};
22
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../host.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAGvB,KAAK,4BAA4B,EAClC,MAAM,kBAAkB,CAAC;AAI1B,cAAM,OAAQ,YAAW,4BAA4B;IAKjD,OAAO,CAAC,OAAO;IAJjB,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,SAAS,CAAoB;gBAG3B,OAAO,EAAE,aAAa,EAC9B,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC;IAMrC,aAAa,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,IAAI;IAI5C,IAAI,CACR,gBAAgB,EAAE,CAAC,EACjB,KAAK,EACL,IAAI,GACL,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,KAAK,IAAI,GACT,OAAO,CAAC,IAAI,CAAC;YAIF,WAAW;YAcX,aAAa;YAgCb,WAAW;IAgDzB,OAAO,CAAC,WAAW;YA2DL,UAAU;YA+CV,SAAS;IAevB,OAAO,CAAC,cAAc;CAGvB;AAED,eAAO,MAAM,cAAc,YACf,aAAa,aAAa,OAAO,CAAC,eAAe,CAAC,kBAE3D,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type ArcContextAny } from "@arcote.tech/arc";
2
+ export declare function hostLiveModel<C extends ArcContextAny>(context: C, options: {
3
+ db: string;
4
+ version: number;
5
+ }): void;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,EACnD,OAAO,EAAE,CAAC,EACV,OAAO,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,QAIzC"}