@ikonai/sdk-ui 0.0.28 → 0.0.29
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/assets/ui-worker-CYp5-hXb.js +2486 -0
- package/handler-cache.d.ts +54 -0
- package/index.d.ts +1 -0
- package/index.js +2295 -14687
- package/package.json +2 -1
- package/parse-ui-update.d.ts +1 -1
- package/ui-store-ops.d.ts +1 -1
- package/ui-store.d.ts +12 -1
- package/ui-types.d.ts +2 -1
- package/assets/ui-worker-Cpo_HAMl.js +0 -15341
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache for event handlers to avoid creating new closures on every render.
|
|
3
|
+
* Handlers are cached by nodeId and actionId combination.
|
|
4
|
+
*/
|
|
5
|
+
export declare class HandlerCache {
|
|
6
|
+
private readonly cache;
|
|
7
|
+
/**
|
|
8
|
+
* Get a cached void handler (no payload) for a node/action combination.
|
|
9
|
+
* Creates and caches the handler if it doesn't exist.
|
|
10
|
+
*/
|
|
11
|
+
getHandler(nodeId: string, actionId: string, dispatchAction: (actionId: string, payload?: unknown) => void): () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Get a cached handler that accepts a payload.
|
|
14
|
+
* Creates and caches the handler if it doesn't exist.
|
|
15
|
+
*/
|
|
16
|
+
getHandlerWithPayload<T>(nodeId: string, actionId: string, dispatchAction: (actionId: string, payload?: unknown) => void): (payload: T) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Get a cached handler for boolean payloads.
|
|
19
|
+
*/
|
|
20
|
+
getBooleanHandler(nodeId: string, actionId: string, dispatchAction: (actionId: string, payload?: unknown) => void): (value: boolean) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Get a cached handler for string payloads.
|
|
23
|
+
*/
|
|
24
|
+
getStringHandler(nodeId: string, actionId: string, dispatchAction: (actionId: string, payload?: unknown) => void): (value: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Get a cached handler for number payloads.
|
|
27
|
+
*/
|
|
28
|
+
getNumberHandler(nodeId: string, actionId: string, dispatchAction: (actionId: string, payload?: unknown) => void): (value: number) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Get a cached handler for number array payloads.
|
|
31
|
+
*/
|
|
32
|
+
getNumberArrayHandler(nodeId: string, actionId: string, dispatchAction: (actionId: string, payload?: unknown) => void): (value: number[]) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Get a cached handler for nullable boolean payloads.
|
|
35
|
+
*/
|
|
36
|
+
getNullableBooleanHandler(nodeId: string, actionId: string, dispatchAction: (actionId: string, payload?: unknown) => void): (value: boolean | null | undefined) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Invalidate all cached handlers for a specific node.
|
|
39
|
+
* Call this when a node is removed from the tree.
|
|
40
|
+
*/
|
|
41
|
+
invalidateNode(nodeId: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Invalidate a specific handler.
|
|
44
|
+
*/
|
|
45
|
+
invalidateHandler(nodeId: string, actionId: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Clear all cached handlers.
|
|
48
|
+
*/
|
|
49
|
+
clear(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Get the number of cached handlers (for debugging/testing).
|
|
52
|
+
*/
|
|
53
|
+
get size(): number;
|
|
54
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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 { HandlerCache } from './handler-cache';
|
|
4
5
|
export type { UiStreamSnapshotWire, UiStoreOp, UiStoreOpBatch } from './ui-store-ops';
|
|
5
6
|
export type { UiUpdateType, UiNodeProps, UiNode, TextDelta, UiNodeDiff, UiSnapshotMetadata, UiOptimisticPatchMetadata, UiOptimisticReconcileMetadata, UiOptimisticPatchState, UiStoreSnapshot, UiFullSnapshot, UiDiffSnapshot, UiSnapshot, ParsedUiUpdate, } from './ui-types';
|