@ikonai/sdk-ui 0.0.11 → 0.0.12

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/ikon-ui-core.d.ts CHANGED
@@ -3,6 +3,11 @@ import { UiStore } from './ui-store';
3
3
  import { ParsedUiUpdate } from './ui-types';
4
4
  export interface IkonUICoreConfig {
5
5
  client?: IkonClient | null;
6
+ threading?: {
7
+ uiWorker?: 'auto' | 'disabled';
8
+ flushIntervalMs?: number;
9
+ maxLatencyMs?: number;
10
+ };
6
11
  }
7
12
  export type IkonUiUpdateListener = (streamId: string, update: ParsedUiUpdate) => void;
8
13
  export type IkonUiStreamListener = (streamId: string) => void;
@@ -14,23 +19,34 @@ export interface UiStylePayload {
14
19
  }
15
20
  export declare class IkonUICore {
16
21
  private unsubscribeProtocolMessages?;
22
+ private client;
17
23
  readonly uiStore: UiStore;
24
+ private uiWorker;
18
25
  private readonly uiStyles;
19
26
  private readonly uiUpdateListeners;
20
27
  private readonly uiStyleListeners;
21
28
  private readonly uiStreamClearedListeners;
29
+ private readonly useUiWorker;
22
30
  constructor(config?: IkonUICoreConfig);
23
31
  dispose(): void;
24
32
  subscribeToUiUpdates(listener: IkonUiUpdateListener): () => void;
25
33
  subscribeToUiStreamCleared(listener: IkonUiStreamListener): () => void;
26
34
  subscribeToUiStyles(listener: UiStyleListener): () => void;
27
35
  getUiStyles(): readonly UiStylePayload[];
36
+ private initialize;
37
+ private startUiWorker;
38
+ private rehydrateStoresForMainThread;
39
+ private forwardMessageToWorker;
40
+ private handleUiStoreOpBatch;
41
+ private applyUiStoreOp;
28
42
  private handleProtocolMessage;
29
43
  private handleGlobalState;
30
44
  private handleUiUpdate;
31
45
  private handleUiStyles;
46
+ private handleUiStylesBatch;
32
47
  private handleClearStream;
33
48
  private notifyUiUpdate;
34
49
  private notifyUiStyle;
35
50
  private notifyUiStreamCleared;
51
+ private sendUiUpdateAck;
36
52
  }
package/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { IkonUICore, type IkonUICoreConfig, type IkonUiStreamListener, type IkonUiUpdateListener, type UiStyleListener, type UiStylePayload } from './ikon-ui-core';
2
2
  export { UiStore, UiStreamStore, type StreamSnapshot } from './ui-store';
3
3
  export { parseUiUpdate, UiUpdateParseError } from './parse-ui-update';
4
+ export * from './ui-store-ops';
4
5
  export * from './ui-types';