@ikonai/sdk-ui 1.0.67 → 1.0.68

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
@@ -1,7 +1,7 @@
1
1
  import { IkonClient } from '../../sdk/src/index.ts';
2
2
  import { UiStore } from './ui-store';
3
3
  import { ParsedUiUpdate } from './ui-types';
4
- import { LastSnapshotCacheConfig } from './last-snapshot-cache';
4
+ import { LiveSnapshotConfig } from './live-snapshot';
5
5
  /**
6
6
  * Starts fetching the build-time boot snapshot as early as possible, independent of the
7
7
  * auth/connect flow. The snapshot is a static CDN asset that needs nothing from the backend, so
@@ -17,12 +17,17 @@ export interface IkonUiCoreConfig {
17
17
  maxLatencyMs?: number;
18
18
  };
19
19
  /**
20
- * When enabled, the last rendered UI is persisted to `localStorage` and re-seeded on the next
21
- * load so the cached tree paints before the WebSocket connects. Opt-in.
20
+ * Live snapshot: when enabled, the last rendered UI is persisted to `localStorage` and re-seeded
21
+ * on the next load so the cached tree paints before the WebSocket connects. Opt-in.
22
22
  */
23
- cache?: {
23
+ liveSnapshot?: {
24
24
  enabled: boolean;
25
- } & LastSnapshotCacheConfig;
25
+ } & LiveSnapshotConfig;
26
+ /**
27
+ * Boot snapshot: seed the build-time `boot-snapshot.json` (when the build was bundled with
28
+ * `--snapshot`) before the WebSocket connects. Default: true. Set false to skip it.
29
+ */
30
+ bootSnapshot?: boolean;
26
31
  }
27
32
  export type IkonUiUpdateListener = (streamId: string, update: ParsedUiUpdate) => void;
28
33
  export type IkonUiStreamListener = (streamId: string) => void;
@@ -46,8 +51,8 @@ export declare class IkonUiCore {
46
51
  private readonly uiStyleDeleteListeners;
47
52
  private readonly uiStreamClearedListeners;
48
53
  private readonly useUiWorker;
49
- private cache;
50
- private unsubscribeCacheCapture?;
54
+ private liveSnapshot;
55
+ private unsubscribeLiveSnapshotCapture?;
51
56
  constructor(config?: IkonUiCoreConfig);
52
57
  dispose(): void;
53
58
  private clearAllState;
@@ -58,10 +63,10 @@ export declare class IkonUiCore {
58
63
  subscribeToUiStyleDeletes(listener: UiStyleDeleteListener): () => void;
59
64
  getUiStyles(): readonly UiStylePayload[];
60
65
  private initialize;
61
- private seedFromCache;
66
+ private seedFromLiveSnapshot;
62
67
  private seedFromBootSnapshot;
63
68
  private loadBootSnapshotAsync;
64
- private subscribeCacheCapture;
69
+ private subscribeLiveSnapshotCapture;
65
70
  private startUiWorker;
66
71
  private rehydrateStoresForMainThread;
67
72
  private forwardMessageToWorker;
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { IkonUiCore, prefetchBootSnapshot, type IkonUiCoreConfig, type IkonUiStreamListener, type IkonUiUpdateListener, type UiStyleListener, type UiStyleDeleteListener, type UiStylePayload } from './ikon-ui-core';
2
2
  export { UiStore, UiStreamStore, type StreamSnapshot } from './ui-store';
3
- export { LastSnapshotCache, type LastSnapshotCacheConfig, type CachedUiState } from './last-snapshot-cache';
3
+ export { LiveSnapshotCache, type LiveSnapshotConfig, type LiveSnapshotState } from './live-snapshot';
4
4
  export { parseUiUpdate, UiUpdateParseError } from './parse-ui-update';
5
5
  export { HandlerCache } from './handler-cache';
6
6
  export type { UiStreamSnapshotWire, UiStoreOp, UiStoreOpBatch } from './ui-store-ops';