@fcannizzaro/streamdeck-react 0.1.10 → 0.1.12
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 +2 -0
- package/dist/action.d.ts +2 -2
- package/dist/action.js +1 -2
- 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 +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 +152 -46
- package/dist/devtools/highlight.d.ts +5 -0
- package/dist/devtools/highlight.js +107 -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 +2 -6
- package/dist/hooks/sdk.js +11 -11
- package/dist/hooks/touchstrip.d.ts +6 -0
- package/dist/hooks/touchstrip.js +37 -0
- package/dist/hooks/utility.js +3 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +4 -2
- package/dist/manifest-codegen.d.ts +38 -0
- package/dist/manifest-codegen.js +110 -0
- package/dist/plugin.js +86 -106
- package/dist/reconciler/host-config.js +19 -1
- package/dist/reconciler/vnode.d.ts +26 -2
- package/dist/reconciler/vnode.js +40 -10
- package/dist/render/buffer-pool.d.ts +19 -0
- package/dist/render/buffer-pool.js +51 -0
- package/dist/render/cache.d.ts +29 -0
- package/dist/render/cache.js +137 -5
- package/dist/render/image-cache.d.ts +54 -0
- package/dist/render/image-cache.js +144 -0
- package/dist/render/metrics.d.ts +57 -0
- package/dist/render/metrics.js +98 -0
- package/dist/render/pipeline.d.ts +36 -1
- package/dist/render/pipeline.js +304 -34
- package/dist/render/png.d.ts +1 -1
- package/dist/render/png.js +26 -11
- package/dist/render/render-pool.d.ts +24 -0
- package/dist/render/render-pool.js +130 -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/registry.d.ts +9 -11
- package/dist/roots/registry.js +39 -42
- package/dist/roots/root.d.ts +9 -6
- package/dist/roots/root.js +52 -29
- package/dist/roots/settings-equality.d.ts +5 -0
- package/dist/roots/settings-equality.js +24 -0
- package/dist/roots/{touchbar-root.d.ts → touchstrip-root.d.ts} +30 -8
- package/dist/roots/touchstrip-root.js +263 -0
- package/dist/types.d.ts +73 -23
- package/dist/vite.d.ts +22 -8
- package/dist/vite.js +24 -8
- package/package.json +7 -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.js +0 -175
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactRoot } from '../../roots/root';
|
|
2
|
-
import {
|
|
2
|
+
import { TouchStripRoot } from '../../roots/touchstrip-root';
|
|
3
3
|
import { CanvasInfo, DeviceInfo } from '../../types';
|
|
4
4
|
export interface RegistryObserver {
|
|
5
5
|
onRootCreated(actionId: string, root: ReactRoot, meta: {
|
|
@@ -13,8 +13,8 @@ export interface RegistryObserver {
|
|
|
13
13
|
};
|
|
14
14
|
}): void;
|
|
15
15
|
onRootDestroyed(actionId: string): void;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
onTouchStripCreated(deviceId: string, root: TouchStripRoot, deviceInfo: DeviceInfo): void;
|
|
17
|
+
onTouchStripColumnChanged(deviceId: string, columns: number[], actionMap: Map<number, string>): void;
|
|
18
|
+
onTouchStripDestroyed(deviceId: string): void;
|
|
19
19
|
onDispatch(actionId: string, event: string, payload: unknown): void;
|
|
20
20
|
}
|
|
@@ -35,7 +35,12 @@ export declare class DevtoolsServer {
|
|
|
35
35
|
/**
|
|
36
36
|
* GET /message?d=<json> — fire-and-forget client→server messages.
|
|
37
37
|
* Used via `new Image().src` to bypass CORS/PNA preflight entirely.
|
|
38
|
-
* Returns a 1x1 transparent GIF.
|
|
38
|
+
* Returns a 1x1 transparent GIF (smallest valid image response).
|
|
39
|
+
*
|
|
40
|
+
* Why: browsers enforce Private Network Access (PNA) restrictions
|
|
41
|
+
* on fetch/XHR to localhost from public origins. Image loading
|
|
42
|
+
* is exempt from PNA preflight, so `new Image().src = url` works
|
|
43
|
+
* without triggering CORS errors.
|
|
39
44
|
*/
|
|
40
45
|
private handleGetMessage;
|
|
41
46
|
/** POST /message — client→server messages (JSON body). Fallback for programmatic use. */
|
package/dist/devtools/server.js
CHANGED
|
@@ -153,7 +153,12 @@ var DevtoolsServer = class {
|
|
|
153
153
|
/**
|
|
154
154
|
* GET /message?d=<json> — fire-and-forget client→server messages.
|
|
155
155
|
* Used via `new Image().src` to bypass CORS/PNA preflight entirely.
|
|
156
|
-
* Returns a 1x1 transparent GIF.
|
|
156
|
+
* Returns a 1x1 transparent GIF (smallest valid image response).
|
|
157
|
+
*
|
|
158
|
+
* Why: browsers enforce Private Network Access (PNA) restrictions
|
|
159
|
+
* on fetch/XHR to localhost from public origins. Image loading
|
|
160
|
+
* is exempt from PNA preflight, so `new Image().src = url` works
|
|
161
|
+
* without triggering CORS errors.
|
|
157
162
|
*/
|
|
158
163
|
handleGetMessage(req, res) {
|
|
159
164
|
const qs = (req.url ?? "").split("?")[1] ?? "";
|
package/dist/devtools/types.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export interface SnapshotAction {
|
|
|
81
81
|
tree: SerializedVNode | null;
|
|
82
82
|
dataUri: string | null;
|
|
83
83
|
}
|
|
84
|
-
export interface
|
|
84
|
+
export interface SnapshotTouchStrip {
|
|
85
85
|
deviceId: string;
|
|
86
86
|
deviceName: string;
|
|
87
87
|
canvas: {
|
|
@@ -98,10 +98,11 @@ export interface SnapshotTouchBar {
|
|
|
98
98
|
export interface SnapshotMessage extends BaseMessage {
|
|
99
99
|
type: "snapshot";
|
|
100
100
|
actions: SnapshotAction[];
|
|
101
|
-
|
|
101
|
+
touchStrips: SnapshotTouchStrip[];
|
|
102
102
|
recentConsole: ConsoleMessage[];
|
|
103
103
|
recentNetwork: (NetworkRequestMessage | NetworkResponseMessage | NetworkErrorMessage)[];
|
|
104
104
|
recentEvents: EventBusMessage[];
|
|
105
|
+
metrics?: MetricsData;
|
|
105
106
|
}
|
|
106
107
|
export interface ConsoleMessage extends BaseMessage {
|
|
107
108
|
type: "console";
|
|
@@ -145,9 +146,11 @@ export interface RenderMessage extends BaseMessage {
|
|
|
145
146
|
tree: SerializedVNode;
|
|
146
147
|
dataUri: string;
|
|
147
148
|
renderMs: number;
|
|
149
|
+
/** Per-render pipeline timing profile, when available. */
|
|
150
|
+
profile?: ProfileData;
|
|
148
151
|
}
|
|
149
|
-
export interface
|
|
150
|
-
type: "render:
|
|
152
|
+
export interface TouchStripRenderMessage extends BaseMessage {
|
|
153
|
+
type: "render:touchStrip";
|
|
151
154
|
deviceId: string;
|
|
152
155
|
canvas: {
|
|
153
156
|
width: number;
|
|
@@ -160,6 +163,8 @@ export interface TouchBarRenderMessage extends BaseMessage {
|
|
|
160
163
|
dataUri: string;
|
|
161
164
|
}>;
|
|
162
165
|
renderMs: number;
|
|
166
|
+
/** Per-render pipeline timing profile, when available. */
|
|
167
|
+
profile?: ProfileData;
|
|
163
168
|
}
|
|
164
169
|
export interface EventBusMessage extends BaseMessage {
|
|
165
170
|
type: "event";
|
|
@@ -174,7 +179,7 @@ export interface LifecycleMessage extends BaseMessage {
|
|
|
174
179
|
event: "appear" | "disappear";
|
|
175
180
|
actionId: string;
|
|
176
181
|
actionUuid: string;
|
|
177
|
-
surface: "key" | "dial" | "touch" | "
|
|
182
|
+
surface: "key" | "dial" | "touch" | "touchStrip";
|
|
178
183
|
device: {
|
|
179
184
|
id: string;
|
|
180
185
|
type: number;
|
|
@@ -196,6 +201,45 @@ export interface HighlightRenderMessage extends BaseMessage {
|
|
|
196
201
|
/** Data URI of the rendered image with highlight overlay, or null to clear. */
|
|
197
202
|
dataUri: string | null;
|
|
198
203
|
}
|
|
204
|
+
/** Per-render pipeline timing data, embedded in RenderMessage. */
|
|
205
|
+
export interface ProfileData {
|
|
206
|
+
/** Time to convert VNode tree to Takumi node tree (ms). */
|
|
207
|
+
vnodeConversionMs: number;
|
|
208
|
+
takumiRenderMs: number;
|
|
209
|
+
hashMs: number;
|
|
210
|
+
base64Ms: number;
|
|
211
|
+
totalMs: number;
|
|
212
|
+
skipped: boolean;
|
|
213
|
+
/** Whether this render was served from the image cache. */
|
|
214
|
+
cacheHit: boolean;
|
|
215
|
+
treeDepth: number;
|
|
216
|
+
nodeCount: number;
|
|
217
|
+
}
|
|
218
|
+
/** Aggregate render metrics snapshot. */
|
|
219
|
+
export interface MetricsData {
|
|
220
|
+
/** Total flush() calls (render attempts). */
|
|
221
|
+
flushCount: number;
|
|
222
|
+
/** Flushes that reached the Takumi renderer. */
|
|
223
|
+
renderCount: number;
|
|
224
|
+
/** Tree hash cache hits. */
|
|
225
|
+
cacheHitCount: number;
|
|
226
|
+
/** Skipped due to clean tree (dirty flag check). */
|
|
227
|
+
dirtySkipCount: number;
|
|
228
|
+
/** Skipped due to identical output (post-render FNV-1a dedup). */
|
|
229
|
+
hashDedupCount: number;
|
|
230
|
+
/** Average Takumi render time in milliseconds. */
|
|
231
|
+
avgRenderMs: number;
|
|
232
|
+
/** Peak (worst-case) render time in milliseconds. */
|
|
233
|
+
peakRenderMs: number;
|
|
234
|
+
/** Image cache memory usage in bytes. */
|
|
235
|
+
imageCacheBytes: number;
|
|
236
|
+
/** TouchStrip cache memory usage in bytes. */
|
|
237
|
+
touchStripCacheBytes: number;
|
|
238
|
+
}
|
|
239
|
+
export interface MetricsMessage extends BaseMessage {
|
|
240
|
+
type: "metrics";
|
|
241
|
+
metrics: MetricsData;
|
|
242
|
+
}
|
|
199
243
|
export interface RequestSnapshotMessage extends BaseMessage {
|
|
200
244
|
type: "request:snapshot";
|
|
201
245
|
}
|
|
@@ -207,6 +251,6 @@ export interface HighlightActionMessage extends BaseMessage {
|
|
|
207
251
|
nodeId: number | null;
|
|
208
252
|
}
|
|
209
253
|
/** Messages the plugin server sends to browser clients (via SSE). */
|
|
210
|
-
export type ServerMessage = ServerInfoMessage | SnapshotMessage | ConsoleMessage | NetworkRequestMessage | NetworkResponseMessage | NetworkErrorMessage | RenderMessage |
|
|
254
|
+
export type ServerMessage = ServerInfoMessage | SnapshotMessage | ConsoleMessage | NetworkRequestMessage | NetworkResponseMessage | NetworkErrorMessage | RenderMessage | TouchStripRenderMessage | EventBusMessage | LifecycleMessage | HighlightRenderMessage | MetricsMessage;
|
|
211
255
|
/** Messages browser clients send to the plugin server (via POST /message). */
|
|
212
256
|
export type ClientMessage = RequestSnapshotMessage | HighlightActionMessage;
|
package/dist/font-inline.d.ts
CHANGED
|
@@ -18,5 +18,9 @@ export declare function resolveFontId(source: string, importer: string | undefin
|
|
|
18
18
|
*
|
|
19
19
|
* Follows symlinks before reading so that bun's internal
|
|
20
20
|
* `node_modules/.bun/` layout resolves to the real file.
|
|
21
|
+
*
|
|
22
|
+
* Async: uses `fs.promises.readFile()` to avoid blocking the bundler
|
|
23
|
+
* event loop for large fonts (1-2 MB). Both Vite and Rollup `load`
|
|
24
|
+
* hooks support async return values.
|
|
21
25
|
*/
|
|
22
|
-
export declare function loadFont(id: string): string | null
|
|
26
|
+
export declare function loadFont(id: string): Promise<string | null>;
|
package/dist/font-inline.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { dirname, resolve } from "node:path";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
import {
|
|
3
|
+
import { realpathSync } from "node:fs";
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
4
5
|
//#region src/font-inline.ts
|
|
5
6
|
var FONT_RE = /\.(ttf|otf|woff2?)$/;
|
|
6
7
|
/**
|
|
@@ -33,10 +34,14 @@ function resolveFontId(source, importer) {
|
|
|
33
34
|
*
|
|
34
35
|
* Follows symlinks before reading so that bun's internal
|
|
35
36
|
* `node_modules/.bun/` layout resolves to the real file.
|
|
37
|
+
*
|
|
38
|
+
* Async: uses `fs.promises.readFile()` to avoid blocking the bundler
|
|
39
|
+
* event loop for large fonts (1-2 MB). Both Vite and Rollup `load`
|
|
40
|
+
* hooks support async return values.
|
|
36
41
|
*/
|
|
37
|
-
function loadFont(id) {
|
|
42
|
+
async function loadFont(id) {
|
|
38
43
|
if (!isFontFile(id)) return null;
|
|
39
|
-
return `export default Buffer.from("${
|
|
44
|
+
return `export default Buffer.from("${(await readFile(safeRealpath(id) ?? id)).toString("base64")}", "base64");`;
|
|
40
45
|
}
|
|
41
46
|
function safeRealpath(p) {
|
|
42
47
|
try {
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/** A single number or a flat object of named numbers. */
|
|
2
|
+
export type AnimationTarget = number | Record<string, number>;
|
|
3
|
+
/** Maps an AnimationTarget shape to its animated output shape. */
|
|
4
|
+
export type AnimatedValue<T extends AnimationTarget> = T extends number ? number : {
|
|
5
|
+
[K in keyof T]: number;
|
|
6
|
+
};
|
|
7
|
+
export interface SpringConfig {
|
|
8
|
+
/** Stiffness coefficient (force per unit displacement). @default 170 */
|
|
9
|
+
tension: number;
|
|
10
|
+
/** Damping coefficient (force per unit velocity). @default 26 */
|
|
11
|
+
friction: number;
|
|
12
|
+
/** Mass of the simulated object. @default 1 */
|
|
13
|
+
mass: number;
|
|
14
|
+
/** Absolute velocity threshold below which the spring settles. @default 0.01 */
|
|
15
|
+
velocityThreshold: number;
|
|
16
|
+
/** Absolute displacement threshold below which the spring settles. @default 0.005 */
|
|
17
|
+
displacementThreshold: number;
|
|
18
|
+
/** Clamp output to target (no overshoot). @default false */
|
|
19
|
+
clamp: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface SpringResult<T extends AnimationTarget> {
|
|
22
|
+
/** Current interpolated value(s). */
|
|
23
|
+
value: AnimatedValue<T>;
|
|
24
|
+
/** Whether the spring is still in motion. */
|
|
25
|
+
isAnimating: boolean;
|
|
26
|
+
/** Imperatively update the target. */
|
|
27
|
+
set: (target: T) => void;
|
|
28
|
+
/** Jump immediately to a value (no animation). */
|
|
29
|
+
jump: (target: T) => void;
|
|
30
|
+
}
|
|
31
|
+
export type EasingName = "linear" | "easeIn" | "easeOut" | "easeInOut" | "easeInCubic" | "easeOutCubic" | "easeInOutCubic" | "easeInBack" | "easeOutBack" | "easeOutBounce";
|
|
32
|
+
export type EasingFn = (t: number) => number;
|
|
33
|
+
export interface TweenConfig {
|
|
34
|
+
/** Duration in milliseconds. @default 300 */
|
|
35
|
+
duration: number;
|
|
36
|
+
/** Easing function name or custom (t: number) => number. @default "easeOut" */
|
|
37
|
+
easing: EasingName | EasingFn;
|
|
38
|
+
/** Target FPS for the animation tick loop. @default 30 */
|
|
39
|
+
fps: number;
|
|
40
|
+
}
|
|
41
|
+
export interface TweenResult<T extends AnimationTarget> {
|
|
42
|
+
/** Current interpolated value(s). */
|
|
43
|
+
value: AnimatedValue<T>;
|
|
44
|
+
/** 0..1 normalized progress of the current transition. */
|
|
45
|
+
progress: number;
|
|
46
|
+
/** Whether the tween is still running. */
|
|
47
|
+
isAnimating: boolean;
|
|
48
|
+
/** Imperatively update the target (starts a new tween from current value). */
|
|
49
|
+
set: (target: T) => void;
|
|
50
|
+
/** Jump immediately to a value (no animation). */
|
|
51
|
+
jump: (target: T) => void;
|
|
52
|
+
}
|
|
53
|
+
interface SpringState {
|
|
54
|
+
position: number;
|
|
55
|
+
velocity: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Semi-implicit Euler step for a damped harmonic oscillator.
|
|
59
|
+
* Updates velocity first, then position — stable at low frame rates.
|
|
60
|
+
*/
|
|
61
|
+
export declare function stepSpring(state: SpringState, target: number, config: SpringConfig, dtSeconds: number): SpringState;
|
|
62
|
+
/** Check if a spring channel has come to rest. */
|
|
63
|
+
export declare function isSettled(state: SpringState, target: number, config: SpringConfig): boolean;
|
|
64
|
+
export declare const SpringPresets: {
|
|
65
|
+
/** Default balanced spring. */
|
|
66
|
+
readonly default: {
|
|
67
|
+
readonly tension: 170;
|
|
68
|
+
readonly friction: 26;
|
|
69
|
+
readonly mass: 1;
|
|
70
|
+
};
|
|
71
|
+
/** Quick and responsive with slight overshoot. Good for press feedback. */
|
|
72
|
+
readonly stiff: {
|
|
73
|
+
readonly tension: 400;
|
|
74
|
+
readonly friction: 28;
|
|
75
|
+
readonly mass: 1;
|
|
76
|
+
};
|
|
77
|
+
/** Bouncy with visible oscillation. Good for playful UIs. */
|
|
78
|
+
readonly wobbly: {
|
|
79
|
+
readonly tension: 180;
|
|
80
|
+
readonly friction: 12;
|
|
81
|
+
readonly mass: 1;
|
|
82
|
+
};
|
|
83
|
+
/** Slow and smooth. Good for background transitions. */
|
|
84
|
+
readonly gentle: {
|
|
85
|
+
readonly tension: 120;
|
|
86
|
+
readonly friction: 14;
|
|
87
|
+
readonly mass: 1;
|
|
88
|
+
};
|
|
89
|
+
/** Very slow, molasses-like. Good for ambient drift. */
|
|
90
|
+
readonly molasses: {
|
|
91
|
+
readonly tension: 80;
|
|
92
|
+
readonly friction: 30;
|
|
93
|
+
readonly mass: 1;
|
|
94
|
+
};
|
|
95
|
+
/** Snappy with no overshoot. Good for precise UI elements. */
|
|
96
|
+
readonly snap: {
|
|
97
|
+
readonly tension: 300;
|
|
98
|
+
readonly friction: 36;
|
|
99
|
+
readonly mass: 1;
|
|
100
|
+
readonly clamp: true;
|
|
101
|
+
};
|
|
102
|
+
/** Heavy object feel. */
|
|
103
|
+
readonly heavy: {
|
|
104
|
+
readonly tension: 200;
|
|
105
|
+
readonly friction: 20;
|
|
106
|
+
readonly mass: 3;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
export declare const Easings: Record<EasingName, EasingFn>;
|
|
110
|
+
/**
|
|
111
|
+
* Spring physics-based animation hook.
|
|
112
|
+
*
|
|
113
|
+
* Returns animated value(s) that follow the target with natural spring dynamics
|
|
114
|
+
* (damped harmonic oscillator). Supports single numbers and objects of numbers.
|
|
115
|
+
*
|
|
116
|
+
* Automatically starts/stops the tick loop when the spring is in motion or settled.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```tsx
|
|
120
|
+
* const { value: scale } = useSpring(pressed ? 0.85 : 1, SpringPresets.wobbly);
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* const { value } = useSpring({ x: targetX, opacity: show ? 1 : 0 }, SpringPresets.gentle);
|
|
126
|
+
* // value.x and value.opacity are plain numbers
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
export declare function useSpring<T extends AnimationTarget>(target: T, config?: Partial<SpringConfig> & {
|
|
130
|
+
fps?: number;
|
|
131
|
+
}): SpringResult<T>;
|
|
132
|
+
/**
|
|
133
|
+
* Duration + easing-based animation hook.
|
|
134
|
+
*
|
|
135
|
+
* Returns animated value(s) that smoothly transition to the target over the
|
|
136
|
+
* specified duration using an easing curve. Supports single numbers and objects
|
|
137
|
+
* of numbers.
|
|
138
|
+
*
|
|
139
|
+
* When the target changes mid-tween, a new tween starts from the current
|
|
140
|
+
* interpolated position (no discontinuity).
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```tsx
|
|
144
|
+
* const { value: opacity } = useTween(visible ? 1 : 0, { duration: 500, easing: "easeInOut" });
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```tsx
|
|
149
|
+
* const { value } = useTween({ y: expanded ? 0 : -50, opacity: expanded ? 1 : 0 });
|
|
150
|
+
* // value.y and value.opacity are plain numbers
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
export declare function useTween<T extends AnimationTarget>(target: T, config?: Partial<TweenConfig>): TweenResult<T>;
|
|
154
|
+
export {};
|