@fcannizzaro/streamdeck-react 0.1.9 → 0.1.11
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/LICENSE +190 -21
- package/README.md +3 -1
- package/dist/action.d.ts +2 -2
- package/dist/action.js +2 -2
- package/dist/bundler-shared.d.ts +11 -0
- package/dist/bundler-shared.js +11 -0
- package/dist/context/event-bus.d.ts +1 -1
- package/dist/context/event-bus.js +1 -1
- package/dist/context/touchstrip-context.d.ts +2 -0
- package/dist/context/touchstrip-context.js +5 -0
- package/dist/devtools/bridge.d.ts +35 -7
- package/dist/devtools/bridge.js +153 -46
- package/dist/devtools/highlight.d.ts +6 -0
- package/dist/devtools/highlight.js +106 -57
- package/dist/devtools/index.js +6 -0
- package/dist/devtools/observers/lifecycle.d.ts +4 -4
- package/dist/devtools/server.d.ts +6 -1
- package/dist/devtools/server.js +6 -1
- package/dist/devtools/types.d.ts +50 -6
- package/dist/font-inline.d.ts +5 -1
- package/dist/font-inline.js +8 -3
- package/dist/hooks/animation.d.ts +154 -0
- package/dist/hooks/animation.js +381 -0
- package/dist/hooks/events.js +1 -5
- package/dist/hooks/touchstrip.d.ts +6 -0
- package/dist/hooks/touchstrip.js +37 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +3 -2
- package/dist/manifest-codegen.d.ts +38 -0
- package/dist/manifest-codegen.js +110 -0
- package/dist/node_modules/.bun/xxhash-wasm@1.1.0/node_modules/xxhash-wasm/esm/xxhash-wasm.js +3157 -0
- package/dist/plugin.js +20 -9
- package/dist/reconciler/host-config.js +19 -1
- package/dist/reconciler/vnode.d.ts +26 -0
- package/dist/reconciler/vnode.js +41 -10
- package/dist/render/buffer-pool.d.ts +19 -0
- package/dist/render/buffer-pool.js +51 -0
- package/dist/render/cache.d.ts +41 -0
- package/dist/render/cache.js +159 -5
- package/dist/render/image-cache.d.ts +53 -0
- package/dist/render/image-cache.js +128 -0
- package/dist/render/metrics.d.ts +58 -0
- package/dist/render/metrics.js +101 -0
- package/dist/render/pipeline.d.ts +46 -1
- package/dist/render/pipeline.js +370 -36
- package/dist/render/png.d.ts +10 -1
- package/dist/render/png.js +31 -13
- package/dist/render/render-pool.d.ts +26 -0
- package/dist/render/render-pool.js +141 -0
- package/dist/render/svg.d.ts +7 -0
- package/dist/render/svg.js +139 -0
- package/dist/render/worker.d.ts +1 -0
- package/dist/rollup.d.ts +23 -9
- package/dist/rollup.js +24 -9
- package/dist/roots/flush-coordinator.d.ts +18 -0
- package/dist/roots/flush-coordinator.js +38 -0
- package/dist/roots/registry.d.ts +6 -4
- package/dist/roots/registry.js +47 -33
- package/dist/roots/root.d.ts +32 -2
- package/dist/roots/root.js +104 -14
- package/dist/roots/settings-equality.d.ts +5 -0
- package/dist/roots/settings-equality.js +24 -0
- package/dist/roots/touchstrip-root.d.ts +93 -0
- package/dist/roots/touchstrip-root.js +383 -0
- package/dist/types.d.ts +62 -16
- package/dist/vite.d.ts +22 -8
- package/dist/vite.js +24 -8
- package/package.json +5 -4
- package/dist/context/touchbar-context.d.ts +0 -2
- package/dist/context/touchbar-context.js +0 -5
- package/dist/hooks/touchbar.d.ts +0 -6
- package/dist/hooks/touchbar.js +0 -37
- package/dist/roots/touchbar-root.d.ts +0 -45
- package/dist/roots/touchbar-root.js +0 -175
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
//#region src/render/image-cache.ts
|
|
2
|
+
/**
|
|
3
|
+
* Byte-bounded LRU cache. Evicts least-recently-used entries when the
|
|
4
|
+
* total byte size exceeds `maxBytes`.
|
|
5
|
+
*
|
|
6
|
+
* Generic over value type: use `string` for data URI caching (keys/dials),
|
|
7
|
+
* `Buffer` for raw RGBA caching (touchstrip).
|
|
8
|
+
*/
|
|
9
|
+
var ImageCache = class {
|
|
10
|
+
map = /* @__PURE__ */ new Map();
|
|
11
|
+
head = null;
|
|
12
|
+
tail = null;
|
|
13
|
+
currentBytes = 0;
|
|
14
|
+
_hits = 0;
|
|
15
|
+
_misses = 0;
|
|
16
|
+
constructor(maxBytes) {
|
|
17
|
+
this.maxBytes = maxBytes;
|
|
18
|
+
}
|
|
19
|
+
/** Retrieve a cached value. Returns `undefined` on miss. Promotes to MRU on hit. */
|
|
20
|
+
get(key) {
|
|
21
|
+
const entry = this.map.get(key);
|
|
22
|
+
if (entry == null) {
|
|
23
|
+
this._misses++;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
this._hits++;
|
|
27
|
+
this.moveToHead(entry);
|
|
28
|
+
return entry.value;
|
|
29
|
+
}
|
|
30
|
+
/** Insert or update a cache entry. Evicts LRU entries if over budget. */
|
|
31
|
+
set(key, value, byteSize) {
|
|
32
|
+
const existing = this.map.get(key);
|
|
33
|
+
if (existing != null) {
|
|
34
|
+
this.currentBytes -= existing.byteSize;
|
|
35
|
+
existing.value = value;
|
|
36
|
+
existing.byteSize = byteSize;
|
|
37
|
+
this.currentBytes += byteSize;
|
|
38
|
+
this.moveToHead(existing);
|
|
39
|
+
this.evictUntilUnderBudget();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
while (this.currentBytes + byteSize > this.maxBytes && this.tail != null) this.evictTail();
|
|
43
|
+
if (byteSize > this.maxBytes) return;
|
|
44
|
+
const entry = {
|
|
45
|
+
key,
|
|
46
|
+
value,
|
|
47
|
+
byteSize,
|
|
48
|
+
prev: null,
|
|
49
|
+
next: this.head
|
|
50
|
+
};
|
|
51
|
+
if (this.head != null) this.head.prev = entry;
|
|
52
|
+
this.head = entry;
|
|
53
|
+
if (this.tail == null) this.tail = entry;
|
|
54
|
+
this.map.set(key, entry);
|
|
55
|
+
this.currentBytes += byteSize;
|
|
56
|
+
}
|
|
57
|
+
/** Clear all entries and reset stats. */
|
|
58
|
+
clear() {
|
|
59
|
+
this.map.clear();
|
|
60
|
+
this.head = null;
|
|
61
|
+
this.tail = null;
|
|
62
|
+
this.currentBytes = 0;
|
|
63
|
+
this._hits = 0;
|
|
64
|
+
this._misses = 0;
|
|
65
|
+
}
|
|
66
|
+
/** Current cache statistics. */
|
|
67
|
+
get stats() {
|
|
68
|
+
return {
|
|
69
|
+
entries: this.map.size,
|
|
70
|
+
bytes: this.currentBytes,
|
|
71
|
+
maxBytes: this.maxBytes,
|
|
72
|
+
hits: this._hits,
|
|
73
|
+
misses: this._misses
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
moveToHead(entry) {
|
|
77
|
+
if (entry === this.head) return;
|
|
78
|
+
if (entry.prev != null) entry.prev.next = entry.next;
|
|
79
|
+
if (entry.next != null) entry.next.prev = entry.prev;
|
|
80
|
+
if (entry === this.tail) this.tail = entry.prev;
|
|
81
|
+
entry.prev = null;
|
|
82
|
+
entry.next = this.head;
|
|
83
|
+
if (this.head != null) this.head.prev = entry;
|
|
84
|
+
this.head = entry;
|
|
85
|
+
}
|
|
86
|
+
evictTail() {
|
|
87
|
+
if (this.tail == null) return;
|
|
88
|
+
const evicted = this.tail;
|
|
89
|
+
this.tail = evicted.prev;
|
|
90
|
+
if (this.tail != null) this.tail.next = null;
|
|
91
|
+
else this.head = null;
|
|
92
|
+
this.currentBytes -= evicted.byteSize;
|
|
93
|
+
this.map.delete(evicted.key);
|
|
94
|
+
}
|
|
95
|
+
evictUntilUnderBudget() {
|
|
96
|
+
while (this.currentBytes > this.maxBytes && this.tail != null) this.evictTail();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var DEFAULT_IMAGE_CACHE_MAX_BYTES = 16 * 1024 * 1024;
|
|
100
|
+
var DEFAULT_TOUCHSTRIP_CACHE_MAX_BYTES = 8 * 1024 * 1024;
|
|
101
|
+
/** Shared image cache for key/dial data URIs. */
|
|
102
|
+
var imageCache = null;
|
|
103
|
+
/** Shared raw buffer cache for touchstrip RGBA data. */
|
|
104
|
+
var touchstripCache = null;
|
|
105
|
+
/** Shared segment URI cache for touchstrip native-format (WebP/PNG) renders. */
|
|
106
|
+
var touchstripNativeCache = null;
|
|
107
|
+
/** Get or create the shared image cache for data URIs. */
|
|
108
|
+
function getImageCache(maxBytes) {
|
|
109
|
+
if (imageCache == null) imageCache = new ImageCache(maxBytes ?? DEFAULT_IMAGE_CACHE_MAX_BYTES);
|
|
110
|
+
return imageCache;
|
|
111
|
+
}
|
|
112
|
+
/** Get or create the shared touchstrip raw buffer cache. */
|
|
113
|
+
function getTouchstripCache(maxBytes) {
|
|
114
|
+
if (touchstripCache == null) touchstripCache = new ImageCache(maxBytes ?? DEFAULT_TOUCHSTRIP_CACHE_MAX_BYTES);
|
|
115
|
+
return touchstripCache;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Get or create the shared touchstrip native-format segment cache.
|
|
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
|
+
*/
|
|
123
|
+
function getTouchstripNativeCache(maxBytes) {
|
|
124
|
+
if (touchstripNativeCache == null) touchstripNativeCache = new ImageCache(maxBytes ?? DEFAULT_TOUCHSTRIP_CACHE_MAX_BYTES);
|
|
125
|
+
return touchstripNativeCache;
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
export { getImageCache, getTouchstripCache, getTouchstripNativeCache };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface RenderMetrics {
|
|
2
|
+
/** Total flush() calls (render attempts). */
|
|
3
|
+
flushCount: number;
|
|
4
|
+
/** Flushes that reached the Takumi renderer. */
|
|
5
|
+
renderCount: number;
|
|
6
|
+
/** Tree hash cache hits (Phase 3). */
|
|
7
|
+
cacheHitCount: number;
|
|
8
|
+
/** Skipped due to clean tree — dirty flag check (Phase 2). */
|
|
9
|
+
dirtySkipCount: number;
|
|
10
|
+
/** Skipped due to identical output — post-render FNV-1a dedup. */
|
|
11
|
+
hashDedupCount: number;
|
|
12
|
+
/** Average Takumi render time in milliseconds. */
|
|
13
|
+
avgRenderMs: number;
|
|
14
|
+
/** Peak (worst-case) render time in milliseconds. */
|
|
15
|
+
peakRenderMs: number;
|
|
16
|
+
/** Image cache memory usage in bytes. */
|
|
17
|
+
imageCacheBytes: number;
|
|
18
|
+
/** TouchStrip cache memory usage in bytes. */
|
|
19
|
+
touchstripCacheBytes: number;
|
|
20
|
+
}
|
|
21
|
+
declare class MetricsCollector {
|
|
22
|
+
private _flushCount;
|
|
23
|
+
private _renderCount;
|
|
24
|
+
private _cacheHitCount;
|
|
25
|
+
private _dirtySkipCount;
|
|
26
|
+
private _hashDedupCount;
|
|
27
|
+
private _totalRenderMs;
|
|
28
|
+
private _peakRenderMs;
|
|
29
|
+
private _cumFlushCount;
|
|
30
|
+
private _cumRenderCount;
|
|
31
|
+
private _cumCacheHitCount;
|
|
32
|
+
private _cumDirtySkipCount;
|
|
33
|
+
private _cumHashDedupCount;
|
|
34
|
+
private _cumTotalRenderMs;
|
|
35
|
+
private _cumPeakRenderMs;
|
|
36
|
+
private _reportTimer;
|
|
37
|
+
private _enabled;
|
|
38
|
+
/** Enable periodic reporting. Call once during plugin init in debug mode. */
|
|
39
|
+
enable(): void;
|
|
40
|
+
/** Disable periodic reporting and clear the timer. */
|
|
41
|
+
disable(): void;
|
|
42
|
+
/** Record a flush attempt (before any skip checks). */
|
|
43
|
+
recordFlush(): void;
|
|
44
|
+
/** Record a dirty-skip (container was clean). */
|
|
45
|
+
recordDirtySkip(): void;
|
|
46
|
+
/** Record an image cache hit. */
|
|
47
|
+
recordCacheHit(): void;
|
|
48
|
+
/** Record a post-render hash dedup (identical output). */
|
|
49
|
+
recordHashDedup(): void;
|
|
50
|
+
/** Record a completed render with its duration in milliseconds. */
|
|
51
|
+
recordRender(renderMs: number): void;
|
|
52
|
+
/** Get current snapshot of all metrics (cumulative, never reset). */
|
|
53
|
+
snapshot(): RenderMetrics;
|
|
54
|
+
/** Log a summary to console (called periodically). */
|
|
55
|
+
private report;
|
|
56
|
+
}
|
|
57
|
+
export declare const metrics: MetricsCollector;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { getImageCache, getTouchstripCache, getTouchstripNativeCache } from "./image-cache.js";
|
|
2
|
+
//#region src/render/metrics.ts
|
|
3
|
+
var REPORT_INTERVAL_MS = 1e4;
|
|
4
|
+
var MetricsCollector = class {
|
|
5
|
+
_flushCount = 0;
|
|
6
|
+
_renderCount = 0;
|
|
7
|
+
_cacheHitCount = 0;
|
|
8
|
+
_dirtySkipCount = 0;
|
|
9
|
+
_hashDedupCount = 0;
|
|
10
|
+
_totalRenderMs = 0;
|
|
11
|
+
_peakRenderMs = 0;
|
|
12
|
+
_cumFlushCount = 0;
|
|
13
|
+
_cumRenderCount = 0;
|
|
14
|
+
_cumCacheHitCount = 0;
|
|
15
|
+
_cumDirtySkipCount = 0;
|
|
16
|
+
_cumHashDedupCount = 0;
|
|
17
|
+
_cumTotalRenderMs = 0;
|
|
18
|
+
_cumPeakRenderMs = 0;
|
|
19
|
+
_reportTimer = null;
|
|
20
|
+
_enabled = false;
|
|
21
|
+
/** Enable periodic reporting. Call once during plugin init in debug mode. */
|
|
22
|
+
enable() {
|
|
23
|
+
if (this._enabled) return;
|
|
24
|
+
this._enabled = true;
|
|
25
|
+
this._reportTimer = setInterval(() => {
|
|
26
|
+
this.report();
|
|
27
|
+
}, REPORT_INTERVAL_MS);
|
|
28
|
+
if (typeof this._reportTimer === "object" && "unref" in this._reportTimer) this._reportTimer.unref();
|
|
29
|
+
}
|
|
30
|
+
/** Disable periodic reporting and clear the timer. */
|
|
31
|
+
disable() {
|
|
32
|
+
if (this._reportTimer != null) {
|
|
33
|
+
clearInterval(this._reportTimer);
|
|
34
|
+
this._reportTimer = null;
|
|
35
|
+
}
|
|
36
|
+
this._enabled = false;
|
|
37
|
+
}
|
|
38
|
+
/** Record a flush attempt (before any skip checks). */
|
|
39
|
+
recordFlush() {
|
|
40
|
+
this._flushCount++;
|
|
41
|
+
this._cumFlushCount++;
|
|
42
|
+
}
|
|
43
|
+
/** Record a dirty-skip (container was clean). */
|
|
44
|
+
recordDirtySkip() {
|
|
45
|
+
this._dirtySkipCount++;
|
|
46
|
+
this._cumDirtySkipCount++;
|
|
47
|
+
}
|
|
48
|
+
/** Record an image cache hit. */
|
|
49
|
+
recordCacheHit() {
|
|
50
|
+
this._cacheHitCount++;
|
|
51
|
+
this._cumCacheHitCount++;
|
|
52
|
+
}
|
|
53
|
+
/** Record a post-render hash dedup (identical output). */
|
|
54
|
+
recordHashDedup() {
|
|
55
|
+
this._hashDedupCount++;
|
|
56
|
+
this._cumHashDedupCount++;
|
|
57
|
+
}
|
|
58
|
+
/** Record a completed render with its duration in milliseconds. */
|
|
59
|
+
recordRender(renderMs) {
|
|
60
|
+
this._renderCount++;
|
|
61
|
+
this._cumRenderCount++;
|
|
62
|
+
this._totalRenderMs += renderMs;
|
|
63
|
+
this._cumTotalRenderMs += renderMs;
|
|
64
|
+
if (renderMs > this._peakRenderMs) this._peakRenderMs = renderMs;
|
|
65
|
+
if (renderMs > this._cumPeakRenderMs) this._cumPeakRenderMs = renderMs;
|
|
66
|
+
}
|
|
67
|
+
/** Get current snapshot of all metrics (cumulative, never reset). */
|
|
68
|
+
snapshot() {
|
|
69
|
+
const imageStats = getImageCache().stats;
|
|
70
|
+
const touchstripStats = getTouchstripCache().stats;
|
|
71
|
+
const nativeStats = getTouchstripNativeCache().stats;
|
|
72
|
+
return {
|
|
73
|
+
flushCount: this._cumFlushCount,
|
|
74
|
+
renderCount: this._cumRenderCount,
|
|
75
|
+
cacheHitCount: this._cumCacheHitCount,
|
|
76
|
+
dirtySkipCount: this._cumDirtySkipCount,
|
|
77
|
+
hashDedupCount: this._cumHashDedupCount,
|
|
78
|
+
avgRenderMs: this._cumRenderCount > 0 ? this._cumTotalRenderMs / this._cumRenderCount : 0,
|
|
79
|
+
peakRenderMs: this._cumPeakRenderMs,
|
|
80
|
+
imageCacheBytes: imageStats.bytes,
|
|
81
|
+
touchstripCacheBytes: touchstripStats.bytes + nativeStats.bytes
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/** Log a summary to console (called periodically). */
|
|
85
|
+
report() {
|
|
86
|
+
if (this._flushCount === 0) return;
|
|
87
|
+
const m = this.snapshot();
|
|
88
|
+
const skipRate = m.flushCount > 0 ? ((m.dirtySkipCount + m.cacheHitCount + m.hashDedupCount) / m.flushCount * 100).toFixed(1) : "0";
|
|
89
|
+
console.log(`[@fcannizzaro/streamdeck-react] Metrics (${REPORT_INTERVAL_MS / 1e3}s): flushes=${m.flushCount} renders=${m.renderCount} cacheHits=${m.cacheHitCount} dirtySkips=${m.dirtySkipCount} hashDedups=${m.hashDedupCount} skipRate=${skipRate}% avgRender=${m.avgRenderMs.toFixed(1)}ms peak=${m.peakRenderMs.toFixed(1)}ms imgCache=${(m.imageCacheBytes / 1024).toFixed(0)}KB tbCache=${(m.touchstripCacheBytes / 1024).toFixed(0)}KB`);
|
|
90
|
+
this._flushCount = 0;
|
|
91
|
+
this._renderCount = 0;
|
|
92
|
+
this._cacheHitCount = 0;
|
|
93
|
+
this._dirtySkipCount = 0;
|
|
94
|
+
this._hashDedupCount = 0;
|
|
95
|
+
this._totalRenderMs = 0;
|
|
96
|
+
this._peakRenderMs = 0;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var metrics = new MetricsCollector();
|
|
100
|
+
//#endregion
|
|
101
|
+
export { metrics };
|
|
@@ -1,13 +1,56 @@
|
|
|
1
1
|
import { Renderer, OutputFormat } from '@takumi-rs/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Node as TakumiNode } from '@takumi-rs/helpers';
|
|
3
|
+
import { VContainer, VNode } from '../reconciler/vnode';
|
|
4
|
+
import { CacheStats } from './image-cache';
|
|
5
|
+
import { RenderPool } from './render-pool';
|
|
6
|
+
/** Per-render timing and diagnostic data exposed via `RenderConfig.onProfile`. */
|
|
7
|
+
export interface RenderProfile {
|
|
8
|
+
vnodeToElementMs: number;
|
|
9
|
+
fromJsxMs: number;
|
|
10
|
+
takumiRenderMs: number;
|
|
11
|
+
hashMs: number;
|
|
12
|
+
base64Ms: number;
|
|
13
|
+
totalMs: number;
|
|
14
|
+
skipped: boolean;
|
|
15
|
+
/** Whether this render was served from the image cache. */
|
|
16
|
+
cacheHit: boolean;
|
|
17
|
+
treeDepth: number;
|
|
18
|
+
nodeCount: number;
|
|
19
|
+
/** Image cache statistics at the time of this render. */
|
|
20
|
+
cacheStats: CacheStats | null;
|
|
21
|
+
}
|
|
3
22
|
export interface RenderConfig {
|
|
4
23
|
renderer: Renderer;
|
|
5
24
|
imageFormat: OutputFormat;
|
|
6
25
|
caching: boolean;
|
|
7
26
|
devicePixelRatio: number;
|
|
27
|
+
/** Enable performance diagnostics (duplicate detection, depth warnings). */
|
|
28
|
+
debug: boolean;
|
|
29
|
+
/** Maximum image cache size in bytes. Set to 0 to disable. @default 16777216 (16 MB) */
|
|
30
|
+
imageCacheMaxBytes: number;
|
|
31
|
+
/** Maximum touchstrip cache size in bytes. Set to 0 to disable. @default 8388608 (8 MB) */
|
|
32
|
+
touchstripCacheMaxBytes: number;
|
|
33
|
+
/** Worker thread pool for offloading Takumi renders. null = main-thread rendering. */
|
|
34
|
+
renderPool: RenderPool | null;
|
|
35
|
+
/** Image format for touchstrip segment encoding. @default "webp" */
|
|
36
|
+
touchstripImageFormat: OutputFormat;
|
|
8
37
|
/** DevTools callback. Called after a non-null render with the container and data URI. */
|
|
9
38
|
onRender?: (container: VContainer, dataUri: string) => void;
|
|
39
|
+
/** Profiling callback. Called after every renderToDataUri / renderToRaw attempt. */
|
|
40
|
+
onProfile?: (profile: RenderProfile) => void;
|
|
10
41
|
}
|
|
42
|
+
/** Build the root Takumi container wrapping the VNode children. */
|
|
43
|
+
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
|
+
export declare function measureTree(nodes: VNode[]): {
|
|
51
|
+
depth: number;
|
|
52
|
+
count: number;
|
|
53
|
+
};
|
|
11
54
|
export declare function bufferToDataUri(buffer: Buffer | Uint8Array, format: string): string;
|
|
12
55
|
export declare function renderToDataUri(container: VContainer, width: number, height: number, config: RenderConfig): Promise<string | null>;
|
|
13
56
|
export interface RawRenderResult {
|
|
@@ -18,3 +61,5 @@ export interface RawRenderResult {
|
|
|
18
61
|
export declare function renderToRaw(container: VContainer, width: number, height: number, config: RenderConfig): Promise<RawRenderResult | null>;
|
|
19
62
|
export declare function cropSlice(raw: Buffer, fullWidth: number, column: number, segmentWidth: number, segmentHeight: number): Buffer;
|
|
20
63
|
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>;
|