@ikonai/sdk-ui 0.0.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.
@@ -0,0 +1,36 @@
1
+ import { IkonClient } from '../../sdk/src/index.ts';
2
+ import { UiStore } from './ui-store';
3
+ import { ParsedUiUpdate } from './ui-types';
4
+ export interface IkonUICoreConfig {
5
+ client?: IkonClient | null;
6
+ }
7
+ export type IkonUiUpdateListener = (streamId: string, update: ParsedUiUpdate) => void;
8
+ export type IkonUiStreamListener = (streamId: string) => void;
9
+ export type UiStyleListener = (style: UiStylePayload) => void;
10
+ export interface UiStylePayload {
11
+ styleId: string;
12
+ css?: string;
13
+ common?: string;
14
+ }
15
+ export declare class IkonUICore {
16
+ private unsubscribeProtocolMessages?;
17
+ readonly uiStore: UiStore;
18
+ private readonly uiStyles;
19
+ private readonly uiUpdateListeners;
20
+ private readonly uiStyleListeners;
21
+ private readonly uiStreamClearedListeners;
22
+ constructor(config?: IkonUICoreConfig);
23
+ dispose(): void;
24
+ subscribeToUiUpdates(listener: IkonUiUpdateListener): () => void;
25
+ subscribeToUiStreamCleared(listener: IkonUiStreamListener): () => void;
26
+ subscribeToUiStyles(listener: UiStyleListener): () => void;
27
+ getUiStyles(): readonly UiStylePayload[];
28
+ private handleProtocolMessage;
29
+ private handleGlobalState;
30
+ private handleUiUpdate;
31
+ private handleUiStyles;
32
+ private handleClearStream;
33
+ private notifyUiUpdate;
34
+ private notifyUiStyle;
35
+ private notifyUiStreamCleared;
36
+ }
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { IkonUICore, type IkonUICoreConfig, type IkonUiStreamListener, type IkonUiUpdateListener, type UiStyleListener, type UiStylePayload } from './ikon-ui-core';
2
+ export { UiStore, UiStreamStore, type StreamSnapshot } from './ui-store';
3
+ export { parseUiUpdate, UiUpdateParseError } from './parse-ui-update';
4
+ export * from './ui-types';