@fcannizzaro/streamdeck-react 0.1.11 → 0.1.13
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/README.md +11 -8
- package/dist/action.js +0 -1
- package/dist/adapter/index.d.ts +2 -0
- package/dist/adapter/physical-device.d.ts +2 -0
- package/dist/adapter/physical-device.js +153 -0
- package/dist/adapter/types.d.ts +127 -0
- package/dist/bundler-shared.d.ts +10 -0
- package/dist/bundler-shared.js +28 -1
- package/dist/devtools/bridge.d.ts +2 -2
- package/dist/devtools/bridge.js +7 -8
- package/dist/devtools/highlight.d.ts +1 -2
- package/dist/devtools/highlight.js +4 -3
- package/dist/devtools/types.d.ts +5 -5
- package/dist/font-inline.js +1 -1
- package/dist/google-font.d.ts +61 -0
- package/dist/google-font.js +124 -0
- package/dist/hooks/animation.d.ts +1 -1
- package/dist/hooks/animation.js +2 -2
- package/dist/hooks/events.js +1 -1
- package/dist/hooks/sdk.js +11 -11
- package/dist/hooks/utility.js +3 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3 -1
- package/dist/plugin.js +102 -124
- package/dist/reconciler/vnode.d.ts +0 -2
- package/dist/reconciler/vnode.js +0 -1
- package/dist/render/cache.d.ts +5 -17
- package/dist/render/cache.js +7 -29
- package/dist/render/image-cache.d.ts +8 -7
- package/dist/render/image-cache.js +33 -17
- package/dist/render/metrics.d.ts +9 -10
- package/dist/render/metrics.js +36 -39
- package/dist/render/pipeline.d.ts +4 -14
- package/dist/render/pipeline.js +47 -111
- package/dist/render/png.d.ts +0 -9
- package/dist/render/png.js +5 -8
- package/dist/render/render-pool.d.ts +0 -2
- package/dist/render/render-pool.js +1 -12
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.js +3 -1
- package/dist/roots/registry.d.ts +5 -9
- package/dist/roots/registry.js +30 -47
- package/dist/roots/root.d.ts +7 -34
- package/dist/roots/root.js +23 -90
- package/dist/roots/touchstrip-root.d.ts +6 -32
- package/dist/roots/touchstrip-root.js +61 -181
- package/dist/types.d.ts +38 -20
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +3 -1
- package/package.json +14 -8
- package/dist/node_modules/.bun/xxhash-wasm@1.1.0/node_modules/xxhash-wasm/esm/xxhash-wasm.js +0 -3157
- package/dist/roots/flush-coordinator.d.ts +0 -18
- package/dist/roots/flush-coordinator.js +0 -38
package/dist/render/cache.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { e } from "../node_modules/.bun/xxhash-wasm@1.1.0/node_modules/xxhash-wasm/esm/xxhash-wasm.js";
|
|
2
1
|
//#region src/render/cache.ts
|
|
3
2
|
var FNV_OFFSET_BASIS = 2166136261;
|
|
4
3
|
var FNV_PRIME = 16777619;
|
|
@@ -9,36 +8,16 @@ var SENTINEL_TRUE = 1414681925;
|
|
|
9
8
|
var SENTINEL_FALSE = 1178684499;
|
|
10
9
|
var SENTINEL_ARRAY = 1095914073;
|
|
11
10
|
var SENTINEL_OBJECT = 1329744468;
|
|
12
|
-
/** @internal WASM-accelerated buffer hash function, null before init. */
|
|
13
|
-
var bufferHashFn = null;
|
|
14
|
-
var xxHashInitPromise = null;
|
|
15
|
-
/**
|
|
16
|
-
* Initialize the xxHash-wasm module. Call is idempotent — subsequent
|
|
17
|
-
* calls return the same promise. Resolves once `fnv1a()` will use the
|
|
18
|
-
* WASM fast path for large buffers.
|
|
19
|
-
*/
|
|
20
|
-
function initBufferHasher() {
|
|
21
|
-
if (xxHashInitPromise != null) return xxHashInitPromise;
|
|
22
|
-
xxHashInitPromise = e().then((api) => {
|
|
23
|
-
bufferHashFn = api.h32Raw;
|
|
24
|
-
}).catch(() => {});
|
|
25
|
-
return xxHashInitPromise;
|
|
26
|
-
}
|
|
27
|
-
initBufferHasher();
|
|
28
11
|
var STRIDE_THRESHOLD = 4096;
|
|
29
12
|
var STRIDE = 16;
|
|
30
13
|
/**
|
|
31
14
|
* Hash a raw byte buffer (Uint8Array or Buffer) or string.
|
|
32
15
|
*
|
|
33
|
-
* For buffers larger than {@link STRIDE_THRESHOLD} bytes
|
|
34
|
-
* -
|
|
35
|
-
*
|
|
36
|
-
* 320 KB touchstrip frames, with superior hash distribution.
|
|
37
|
-
* - **Fallback path**: FNV-1a with strided sampling (every 16th byte)
|
|
38
|
-
* when WASM hasn't compiled yet (startup) or is unavailable.
|
|
16
|
+
* For buffers larger than {@link STRIDE_THRESHOLD} bytes, uses strided
|
|
17
|
+
* FNV-1a sampling (every 16th byte) — at 30fps this adds <1ms even
|
|
18
|
+
* for 320KB TouchStrip buffers.
|
|
39
19
|
*
|
|
40
|
-
* Strings and small buffers always use
|
|
41
|
-
* sizes, and avoids the overhead of calling into WASM for tiny inputs).
|
|
20
|
+
* Strings and small buffers always use full byte-by-byte FNV-1a.
|
|
42
21
|
*/
|
|
43
22
|
function fnv1a(input) {
|
|
44
23
|
let hash = FNV_OFFSET_BASIS;
|
|
@@ -47,7 +26,6 @@ function fnv1a(input) {
|
|
|
47
26
|
hash = Math.imul(hash, FNV_PRIME);
|
|
48
27
|
}
|
|
49
28
|
else if (input.length > STRIDE_THRESHOLD) {
|
|
50
|
-
if (bufferHashFn != null) return bufferHashFn(input);
|
|
51
29
|
hash = fnv1aU32(input.length, hash);
|
|
52
30
|
for (let i = 0; i < input.length; i += STRIDE) {
|
|
53
31
|
const end = Math.min(i + 4, input.length);
|
|
@@ -159,11 +137,11 @@ function computeCacheKey(treeHash, width, height, dpr, format) {
|
|
|
159
137
|
key = fnv1aString(format, key);
|
|
160
138
|
return key >>> 0;
|
|
161
139
|
}
|
|
162
|
-
function
|
|
163
|
-
let key = computeCacheKey(treeHash, width, height, dpr,
|
|
140
|
+
function computeTouchStripSegmentCacheKey(treeHash, width, height, dpr, columns) {
|
|
141
|
+
let key = computeCacheKey(treeHash, width, height, dpr, "png");
|
|
164
142
|
key = fnv1aU32(columns.length, key);
|
|
165
143
|
for (const col of columns) key = fnv1aU32(col, key);
|
|
166
144
|
return key >>> 0;
|
|
167
145
|
}
|
|
168
146
|
//#endregion
|
|
169
|
-
export { computeCacheKey,
|
|
147
|
+
export { computeCacheKey, computeTouchStripSegmentCacheKey, computeTreeHash, fnv1a };
|
|
@@ -15,7 +15,7 @@ export interface CacheStats {
|
|
|
15
15
|
* total byte size exceeds `maxBytes`.
|
|
16
16
|
*
|
|
17
17
|
* Generic over value type: use `string` for data URI caching (keys/dials),
|
|
18
|
-
* `Buffer` for raw RGBA caching (
|
|
18
|
+
* `Buffer` for raw RGBA caching (TouchStrip).
|
|
19
19
|
*/
|
|
20
20
|
export declare class ImageCache<V = string> {
|
|
21
21
|
private maxBytes;
|
|
@@ -40,14 +40,15 @@ export declare class ImageCache<V = string> {
|
|
|
40
40
|
}
|
|
41
41
|
/** Get or create the shared image cache for data URIs. */
|
|
42
42
|
export declare function getImageCache(maxBytes?: number): ImageCache<string>;
|
|
43
|
-
/** Get or create the shared
|
|
44
|
-
export declare function
|
|
43
|
+
/** Get or create the shared TouchStrip raw buffer cache. */
|
|
44
|
+
export declare function getTouchStripCache(maxBytes?: number): ImageCache<Buffer>;
|
|
45
45
|
/**
|
|
46
|
-
* Get or create the shared
|
|
46
|
+
* Get or create the shared TouchStrip segment URI cache.
|
|
47
47
|
* Stores sorted `[column, dataUri]` tuples per tree hash + column config.
|
|
48
|
-
* Uses the same default budget as the raw touchstrip cache since only one
|
|
49
|
-
* touchstrip rendering path is active at a time.
|
|
50
48
|
*/
|
|
51
|
-
export declare function
|
|
49
|
+
export declare function getTouchStripSegmentCache(maxBytes?: number): ImageCache<Array<[number, string]>>;
|
|
50
|
+
export declare function getImageCacheStats(): CacheStats;
|
|
51
|
+
export declare function getTouchStripCacheStats(): CacheStats;
|
|
52
|
+
export declare function getTouchStripSegmentCacheStats(): CacheStats;
|
|
52
53
|
/** Reset all caches (for testing or config changes). */
|
|
53
54
|
export declare function resetCaches(): void;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* total byte size exceeds `maxBytes`.
|
|
5
5
|
*
|
|
6
6
|
* Generic over value type: use `string` for data URI caching (keys/dials),
|
|
7
|
-
* `Buffer` for raw RGBA caching (
|
|
7
|
+
* `Buffer` for raw RGBA caching (TouchStrip).
|
|
8
8
|
*/
|
|
9
9
|
var ImageCache = class {
|
|
10
10
|
map = /* @__PURE__ */ new Map();
|
|
@@ -97,32 +97,48 @@ var ImageCache = class {
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
var DEFAULT_IMAGE_CACHE_MAX_BYTES = 16 * 1024 * 1024;
|
|
100
|
-
var
|
|
100
|
+
var DEFAULT_TOUCH_STRIP_CACHE_MAX_BYTES = 8 * 1024 * 1024;
|
|
101
101
|
/** Shared image cache for key/dial data URIs. */
|
|
102
102
|
var imageCache = null;
|
|
103
|
-
/** Shared raw buffer cache for
|
|
104
|
-
var
|
|
105
|
-
/** Shared segment URI cache for
|
|
106
|
-
var
|
|
103
|
+
/** Shared raw buffer cache for TouchStrip RGBA data. */
|
|
104
|
+
var touchStripCache = null;
|
|
105
|
+
/** Shared segment URI cache for TouchStrip shared-strip renders. */
|
|
106
|
+
var touchStripSegmentCache = null;
|
|
107
107
|
/** Get or create the shared image cache for data URIs. */
|
|
108
108
|
function getImageCache(maxBytes) {
|
|
109
109
|
if (imageCache == null) imageCache = new ImageCache(maxBytes ?? DEFAULT_IMAGE_CACHE_MAX_BYTES);
|
|
110
110
|
return imageCache;
|
|
111
111
|
}
|
|
112
|
-
/** Get or create the shared
|
|
113
|
-
function
|
|
114
|
-
if (
|
|
115
|
-
return
|
|
112
|
+
/** Get or create the shared TouchStrip raw buffer cache. */
|
|
113
|
+
function getTouchStripCache(maxBytes) {
|
|
114
|
+
if (touchStripCache == null) touchStripCache = new ImageCache(maxBytes ?? DEFAULT_TOUCH_STRIP_CACHE_MAX_BYTES);
|
|
115
|
+
return touchStripCache;
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
|
-
* Get or create the shared
|
|
118
|
+
* Get or create the shared TouchStrip segment URI cache.
|
|
119
119
|
* Stores sorted `[column, dataUri]` tuples per tree hash + column config.
|
|
120
|
-
* Uses the same default budget as the raw touchstrip cache since only one
|
|
121
|
-
* touchstrip rendering path is active at a time.
|
|
122
120
|
*/
|
|
123
|
-
function
|
|
124
|
-
if (
|
|
125
|
-
return
|
|
121
|
+
function getTouchStripSegmentCache(maxBytes) {
|
|
122
|
+
if (touchStripSegmentCache == null) touchStripSegmentCache = new ImageCache(maxBytes ?? DEFAULT_TOUCH_STRIP_CACHE_MAX_BYTES);
|
|
123
|
+
return touchStripSegmentCache;
|
|
124
|
+
}
|
|
125
|
+
function createEmptyStats(maxBytes) {
|
|
126
|
+
return {
|
|
127
|
+
entries: 0,
|
|
128
|
+
bytes: 0,
|
|
129
|
+
maxBytes,
|
|
130
|
+
hits: 0,
|
|
131
|
+
misses: 0
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function getImageCacheStats() {
|
|
135
|
+
return imageCache?.stats ?? createEmptyStats(DEFAULT_IMAGE_CACHE_MAX_BYTES);
|
|
136
|
+
}
|
|
137
|
+
function getTouchStripCacheStats() {
|
|
138
|
+
return touchStripCache?.stats ?? createEmptyStats(DEFAULT_TOUCH_STRIP_CACHE_MAX_BYTES);
|
|
139
|
+
}
|
|
140
|
+
function getTouchStripSegmentCacheStats() {
|
|
141
|
+
return touchStripSegmentCache?.stats ?? createEmptyStats(DEFAULT_TOUCH_STRIP_CACHE_MAX_BYTES);
|
|
126
142
|
}
|
|
127
143
|
//#endregion
|
|
128
|
-
export { getImageCache,
|
|
144
|
+
export { getImageCache, getImageCacheStats, getTouchStripCache, getTouchStripCacheStats, getTouchStripSegmentCache, getTouchStripSegmentCacheStats };
|
package/dist/render/metrics.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface RenderMetrics {
|
|
|
16
16
|
/** Image cache memory usage in bytes. */
|
|
17
17
|
imageCacheBytes: number;
|
|
18
18
|
/** TouchStrip cache memory usage in bytes. */
|
|
19
|
-
|
|
19
|
+
touchStripCacheBytes: number;
|
|
20
20
|
}
|
|
21
21
|
declare class MetricsCollector {
|
|
22
22
|
private _flushCount;
|
|
@@ -26,13 +26,12 @@ declare class MetricsCollector {
|
|
|
26
26
|
private _hashDedupCount;
|
|
27
27
|
private _totalRenderMs;
|
|
28
28
|
private _peakRenderMs;
|
|
29
|
-
private
|
|
30
|
-
private
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
private _cumPeakRenderMs;
|
|
29
|
+
private _lastFlush;
|
|
30
|
+
private _lastRender;
|
|
31
|
+
private _lastCacheHit;
|
|
32
|
+
private _lastDirtySkip;
|
|
33
|
+
private _lastHashDedup;
|
|
34
|
+
private _lastTotalRenderMs;
|
|
36
35
|
private _reportTimer;
|
|
37
36
|
private _enabled;
|
|
38
37
|
/** Enable periodic reporting. Call once during plugin init in debug mode. */
|
|
@@ -49,9 +48,9 @@ declare class MetricsCollector {
|
|
|
49
48
|
recordHashDedup(): void;
|
|
50
49
|
/** Record a completed render with its duration in milliseconds. */
|
|
51
50
|
recordRender(renderMs: number): void;
|
|
52
|
-
/** Get current snapshot of all metrics (cumulative
|
|
51
|
+
/** Get current snapshot of all metrics (cumulative). */
|
|
53
52
|
snapshot(): RenderMetrics;
|
|
54
|
-
/** Log a summary to console (called periodically). */
|
|
53
|
+
/** Log a summary to console (called periodically). Computes deltas since last report. */
|
|
55
54
|
private report;
|
|
56
55
|
}
|
|
57
56
|
export declare const metrics: MetricsCollector;
|
package/dist/render/metrics.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getImageCacheStats, getTouchStripCacheStats, getTouchStripSegmentCacheStats } from "./image-cache.js";
|
|
2
2
|
//#region src/render/metrics.ts
|
|
3
3
|
var REPORT_INTERVAL_MS = 1e4;
|
|
4
4
|
var MetricsCollector = class {
|
|
@@ -9,13 +9,12 @@ var MetricsCollector = class {
|
|
|
9
9
|
_hashDedupCount = 0;
|
|
10
10
|
_totalRenderMs = 0;
|
|
11
11
|
_peakRenderMs = 0;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
_cumPeakRenderMs = 0;
|
|
12
|
+
_lastFlush = 0;
|
|
13
|
+
_lastRender = 0;
|
|
14
|
+
_lastCacheHit = 0;
|
|
15
|
+
_lastDirtySkip = 0;
|
|
16
|
+
_lastHashDedup = 0;
|
|
17
|
+
_lastTotalRenderMs = 0;
|
|
19
18
|
_reportTimer = null;
|
|
20
19
|
_enabled = false;
|
|
21
20
|
/** Enable periodic reporting. Call once during plugin init in debug mode. */
|
|
@@ -38,62 +37,60 @@ var MetricsCollector = class {
|
|
|
38
37
|
/** Record a flush attempt (before any skip checks). */
|
|
39
38
|
recordFlush() {
|
|
40
39
|
this._flushCount++;
|
|
41
|
-
this._cumFlushCount++;
|
|
42
40
|
}
|
|
43
41
|
/** Record a dirty-skip (container was clean). */
|
|
44
42
|
recordDirtySkip() {
|
|
45
43
|
this._dirtySkipCount++;
|
|
46
|
-
this._cumDirtySkipCount++;
|
|
47
44
|
}
|
|
48
45
|
/** Record an image cache hit. */
|
|
49
46
|
recordCacheHit() {
|
|
50
47
|
this._cacheHitCount++;
|
|
51
|
-
this._cumCacheHitCount++;
|
|
52
48
|
}
|
|
53
49
|
/** Record a post-render hash dedup (identical output). */
|
|
54
50
|
recordHashDedup() {
|
|
55
51
|
this._hashDedupCount++;
|
|
56
|
-
this._cumHashDedupCount++;
|
|
57
52
|
}
|
|
58
53
|
/** Record a completed render with its duration in milliseconds. */
|
|
59
54
|
recordRender(renderMs) {
|
|
60
55
|
this._renderCount++;
|
|
61
|
-
this._cumRenderCount++;
|
|
62
56
|
this._totalRenderMs += renderMs;
|
|
63
|
-
this._cumTotalRenderMs += renderMs;
|
|
64
57
|
if (renderMs > this._peakRenderMs) this._peakRenderMs = renderMs;
|
|
65
|
-
if (renderMs > this._cumPeakRenderMs) this._cumPeakRenderMs = renderMs;
|
|
66
58
|
}
|
|
67
|
-
/** Get current snapshot of all metrics (cumulative
|
|
59
|
+
/** Get current snapshot of all metrics (cumulative). */
|
|
68
60
|
snapshot() {
|
|
69
|
-
const imageStats =
|
|
70
|
-
const
|
|
71
|
-
const
|
|
61
|
+
const imageStats = getImageCacheStats();
|
|
62
|
+
const touchStripStats = getTouchStripCacheStats();
|
|
63
|
+
const segmentStats = getTouchStripSegmentCacheStats();
|
|
72
64
|
return {
|
|
73
|
-
flushCount: this.
|
|
74
|
-
renderCount: this.
|
|
75
|
-
cacheHitCount: this.
|
|
76
|
-
dirtySkipCount: this.
|
|
77
|
-
hashDedupCount: this.
|
|
78
|
-
avgRenderMs: this.
|
|
79
|
-
peakRenderMs: this.
|
|
65
|
+
flushCount: this._flushCount,
|
|
66
|
+
renderCount: this._renderCount,
|
|
67
|
+
cacheHitCount: this._cacheHitCount,
|
|
68
|
+
dirtySkipCount: this._dirtySkipCount,
|
|
69
|
+
hashDedupCount: this._hashDedupCount,
|
|
70
|
+
avgRenderMs: this._renderCount > 0 ? this._totalRenderMs / this._renderCount : 0,
|
|
71
|
+
peakRenderMs: this._peakRenderMs,
|
|
80
72
|
imageCacheBytes: imageStats.bytes,
|
|
81
|
-
|
|
73
|
+
touchStripCacheBytes: touchStripStats.bytes + segmentStats.bytes
|
|
82
74
|
};
|
|
83
75
|
}
|
|
84
|
-
/** Log a summary to console (called periodically). */
|
|
76
|
+
/** Log a summary to console (called periodically). Computes deltas since last report. */
|
|
85
77
|
report() {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
this.
|
|
91
|
-
this.
|
|
92
|
-
this.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
78
|
+
const dFlush = this._flushCount - this._lastFlush;
|
|
79
|
+
if (dFlush === 0) return;
|
|
80
|
+
const dRender = this._renderCount - this._lastRender;
|
|
81
|
+
const dCacheHit = this._cacheHitCount - this._lastCacheHit;
|
|
82
|
+
const dDirtySkip = this._dirtySkipCount - this._lastDirtySkip;
|
|
83
|
+
const dHashDedup = this._hashDedupCount - this._lastHashDedup;
|
|
84
|
+
const dTotalMs = this._totalRenderMs - this._lastTotalRenderMs;
|
|
85
|
+
const skipRate = dFlush > 0 ? ((dDirtySkip + dCacheHit + dHashDedup) / dFlush * 100).toFixed(1) : "0";
|
|
86
|
+
const avgMs = dRender > 0 ? (dTotalMs / dRender).toFixed(1) : "0.0";
|
|
87
|
+
console.log(`[@fcannizzaro/streamdeck-react] Metrics (${REPORT_INTERVAL_MS / 1e3}s): flushes=${dFlush} renders=${dRender} cacheHits=${dCacheHit} dirtySkips=${dDirtySkip} hashDedups=${dHashDedup} skipRate=${skipRate}% avgRender=${avgMs}ms peak=${this._peakRenderMs.toFixed(1)}ms imgCache=${(getImageCacheStats().bytes / 1024).toFixed(0)}KB tbCache=${((getTouchStripCacheStats().bytes + getTouchStripSegmentCacheStats().bytes) / 1024).toFixed(0)}KB`);
|
|
88
|
+
this._lastFlush = this._flushCount;
|
|
89
|
+
this._lastRender = this._renderCount;
|
|
90
|
+
this._lastCacheHit = this._cacheHitCount;
|
|
91
|
+
this._lastDirtySkip = this._dirtySkipCount;
|
|
92
|
+
this._lastHashDedup = this._hashDedupCount;
|
|
93
|
+
this._lastTotalRenderMs = this._totalRenderMs;
|
|
97
94
|
}
|
|
98
95
|
};
|
|
99
96
|
var metrics = new MetricsCollector();
|
|
@@ -5,8 +5,8 @@ import { CacheStats } from './image-cache';
|
|
|
5
5
|
import { RenderPool } from './render-pool';
|
|
6
6
|
/** Per-render timing and diagnostic data exposed via `RenderConfig.onProfile`. */
|
|
7
7
|
export interface RenderProfile {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/** Time to convert VNode tree to Takumi node tree (ms). */
|
|
9
|
+
vnodeConversionMs: number;
|
|
10
10
|
takumiRenderMs: number;
|
|
11
11
|
hashMs: number;
|
|
12
12
|
base64Ms: number;
|
|
@@ -28,12 +28,10 @@ export interface RenderConfig {
|
|
|
28
28
|
debug: boolean;
|
|
29
29
|
/** Maximum image cache size in bytes. Set to 0 to disable. @default 16777216 (16 MB) */
|
|
30
30
|
imageCacheMaxBytes: number;
|
|
31
|
-
/** Maximum
|
|
32
|
-
|
|
31
|
+
/** Maximum TouchStrip cache size in bytes. Set to 0 to disable. @default 8388608 (8 MB) */
|
|
32
|
+
touchStripCacheMaxBytes: number;
|
|
33
33
|
/** Worker thread pool for offloading Takumi renders. null = main-thread rendering. */
|
|
34
34
|
renderPool: RenderPool | null;
|
|
35
|
-
/** Image format for touchstrip segment encoding. @default "webp" */
|
|
36
|
-
touchstripImageFormat: OutputFormat;
|
|
37
35
|
/** DevTools callback. Called after a non-null render with the container and data URI. */
|
|
38
36
|
onRender?: (container: VContainer, dataUri: string) => void;
|
|
39
37
|
/** Profiling callback. Called after every renderToDataUri / renderToRaw attempt. */
|
|
@@ -41,12 +39,6 @@ export interface RenderConfig {
|
|
|
41
39
|
}
|
|
42
40
|
/** Build the root Takumi container wrapping the VNode children. */
|
|
43
41
|
export declare function buildTakumiRoot(container: VContainer): TakumiNode;
|
|
44
|
-
/**
|
|
45
|
-
* Convert a container's VNode children to Takumi nodes.
|
|
46
|
-
* Used by the touchstrip native-format path to build the Takumi node tree
|
|
47
|
-
* once and share it across all N segment renders in a single flush.
|
|
48
|
-
*/
|
|
49
|
-
export declare function buildTakumiChildren(container: VContainer): TakumiNode[];
|
|
50
42
|
export declare function measureTree(nodes: VNode[]): {
|
|
51
43
|
depth: number;
|
|
52
44
|
count: number;
|
|
@@ -61,5 +53,3 @@ export interface RawRenderResult {
|
|
|
61
53
|
export declare function renderToRaw(container: VContainer, width: number, height: number, config: RenderConfig): Promise<RawRenderResult | null>;
|
|
62
54
|
export declare function cropSlice(raw: Buffer, fullWidth: number, column: number, segmentWidth: number, segmentHeight: number): Buffer;
|
|
63
55
|
export declare function sliceToDataUri(raw: Buffer, fullWidth: number, fullHeight: number, column: number, segmentWidth: number, segmentHeight: number): string;
|
|
64
|
-
export declare function sliceToDataUriAsync(raw: Buffer, fullWidth: number, fullHeight: number, column: number, segmentWidth: number, segmentHeight: number): Promise<string>;
|
|
65
|
-
export declare function renderSegmentToDataUri(container: VContainer, fullWidth: number, segmentHeight: number, column: number, segmentWidth: number, format: OutputFormat, config: RenderConfig, prebuiltTakumiChildren?: TakumiNode[]): Promise<string | null>;
|