@urun-sh/core 0.1.30 → 0.1.33

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/index.d.mts CHANGED
@@ -1,22 +1,48 @@
1
- import { a as AppOptions, A as App$1, i as SessionDocument, C as ChannelEndpoint, h as Session$1, T as TransportSession, k as SessionStream$1, m as StoreOptions, l as Store, c as ChannelMultiplexer } from './internal-BJQ7-qED.mjs';
2
- export { L as Layer, e as LayoutConfig, f as LayoutContext, S as SceneContext, g as SceneGraph, o as TransportState } from './internal-BJQ7-qED.mjs';
1
+ import { a as AppOptions, A as App$1, i as SessionDocument, h as Session$1, C as ChannelEndpoint, T as TransportSession, k as SessionStream$1, m as StoreOptions, l as Store, c as ChannelMultiplexer } from './internal-dmugzBC7.mjs';
2
+ export { L as Layer, e as LayoutConfig, f as LayoutContext, S as SceneContext, g as SceneGraph, o as TransportState } from './internal-dmugzBC7.mjs';
3
3
 
4
4
  declare function App(appId: string, options: AppOptions): App$1;
5
5
 
6
+ interface SessionDocTransport {
7
+
8
+ sendDocSync(payload: Uint8Array): void;
9
+
10
+ onDocSync(handler: (payload: Uint8Array) => void): () => void;
11
+
12
+ onDocSyncReady(handler: () => void): () => void;
13
+
14
+ readonly isOpen: boolean;
15
+ }
16
+
6
17
  declare class SessionDocumentImpl implements SessionDocument {
7
- private _state;
18
+ private _doc;
19
+ private _root;
8
20
  private _listeners;
9
21
  private _key;
10
22
  private _sessionId;
11
- private _multiplexer;
12
- private _unsubscribe;
13
- constructor(key: string, sessionId: string, multiplexer: ChannelEndpoint);
23
+ private _transport;
24
+ private _transportUnsubs;
25
+
26
+ private _synced;
27
+
28
+ private _pendingPatches;
29
+ private _observer;
30
+ private _updateHandler;
31
+ constructor(key: string, sessionId: string, transport?: SessionDocTransport | null);
32
+
14
33
  setSessionId(sessionId: string): void;
15
- private subscribe;
16
- private get _channel();
34
+
17
35
  set(patch: Record<string, unknown>): void;
18
36
  get(path?: string, defaultValue?: unknown): unknown;
19
37
  on(event: 'change', handler: (snap: Record<string, unknown>) => void): () => void;
38
+ dispose(): void;
39
+
40
+ private sendHello;
41
+ private applyRemote;
42
+
43
+ private applyPatch;
44
+ private snapshot;
45
+ private notify;
20
46
  }
21
47
 
22
48
  declare class SessionStream implements SessionStream$1 {
package/dist/index.d.ts CHANGED
@@ -1,22 +1,48 @@
1
- import { a as AppOptions, A as App$1, i as SessionDocument, C as ChannelEndpoint, h as Session$1, T as TransportSession, k as SessionStream$1, m as StoreOptions, l as Store, c as ChannelMultiplexer } from './internal-BJQ7-qED.js';
2
- export { L as Layer, e as LayoutConfig, f as LayoutContext, S as SceneContext, g as SceneGraph, o as TransportState } from './internal-BJQ7-qED.js';
1
+ import { a as AppOptions, A as App$1, i as SessionDocument, h as Session$1, C as ChannelEndpoint, T as TransportSession, k as SessionStream$1, m as StoreOptions, l as Store, c as ChannelMultiplexer } from './internal-dmugzBC7.js';
2
+ export { L as Layer, e as LayoutConfig, f as LayoutContext, S as SceneContext, g as SceneGraph, o as TransportState } from './internal-dmugzBC7.js';
3
3
 
4
4
  declare function App(appId: string, options: AppOptions): App$1;
5
5
 
6
+ interface SessionDocTransport {
7
+
8
+ sendDocSync(payload: Uint8Array): void;
9
+
10
+ onDocSync(handler: (payload: Uint8Array) => void): () => void;
11
+
12
+ onDocSyncReady(handler: () => void): () => void;
13
+
14
+ readonly isOpen: boolean;
15
+ }
16
+
6
17
  declare class SessionDocumentImpl implements SessionDocument {
7
- private _state;
18
+ private _doc;
19
+ private _root;
8
20
  private _listeners;
9
21
  private _key;
10
22
  private _sessionId;
11
- private _multiplexer;
12
- private _unsubscribe;
13
- constructor(key: string, sessionId: string, multiplexer: ChannelEndpoint);
23
+ private _transport;
24
+ private _transportUnsubs;
25
+
26
+ private _synced;
27
+
28
+ private _pendingPatches;
29
+ private _observer;
30
+ private _updateHandler;
31
+ constructor(key: string, sessionId: string, transport?: SessionDocTransport | null);
32
+
14
33
  setSessionId(sessionId: string): void;
15
- private subscribe;
16
- private get _channel();
34
+
17
35
  set(patch: Record<string, unknown>): void;
18
36
  get(path?: string, defaultValue?: unknown): unknown;
19
37
  on(event: 'change', handler: (snap: Record<string, unknown>) => void): () => void;
38
+ dispose(): void;
39
+
40
+ private sendHello;
41
+ private applyRemote;
42
+
43
+ private applyPatch;
44
+ private snapshot;
45
+ private notify;
20
46
  }
21
47
 
22
48
  declare class SessionStream implements SessionStream$1 {