@zaflun/lumio-sdk 0.1.0
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.md +21 -0
- package/README.md +120 -0
- package/dist/index.d.ts +489 -0
- package/dist/index.js +876 -0
- package/dist/lumio-runtime.global.js +28607 -0
- package/dist/server.d.ts +138 -0
- package/dist/server.js +131 -0
- package/package.json +72 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zaflun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# @zaflun/lumio-sdk
|
|
2
|
+
|
|
3
|
+
The official SDK for building [Lumio](https://lumio.vision) extensions — widgets, overlays, bot modules, integrations, and themes for live streamers.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @zaflun/lumio-sdk react react-dom
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Lumio, CompactView, Text, Toggle, useExtensionStorage } from "@zaflun/lumio-sdk";
|
|
15
|
+
|
|
16
|
+
function MyWidget() {
|
|
17
|
+
const [storage, setStorage] = useExtensionStorage("settings", { visible: true });
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<CompactView title="My Widget">
|
|
21
|
+
<Toggle
|
|
22
|
+
label="Visible"
|
|
23
|
+
checked={storage.visible}
|
|
24
|
+
onChange={(checked) => setStorage({ ...storage, visible: checked })}
|
|
25
|
+
/>
|
|
26
|
+
<Text content={storage.visible ? "Hello World!" : ""} />
|
|
27
|
+
</CompactView>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
Lumio.render(<MyWidget />, { target: "editor" });
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## What's included
|
|
35
|
+
|
|
36
|
+
### 14 UI Components
|
|
37
|
+
|
|
38
|
+
**Layout:** `Box`, `VStack`, `HStack`, `CompactView`, `List`
|
|
39
|
+
**Display:** `Text`, `Image`
|
|
40
|
+
**Input:** `Button`, `Toggle`, `TextField`, `TextArea`, `NumberField`, `Dropdown`, `Slider`
|
|
41
|
+
**Animation:** `Animated` (with 22 built-in presets)
|
|
42
|
+
|
|
43
|
+
### 10 Hooks
|
|
44
|
+
|
|
45
|
+
| Hook | Purpose |
|
|
46
|
+
|------|---------|
|
|
47
|
+
| `useExtensionStorage()` | Persistent key-value storage synced across surfaces |
|
|
48
|
+
| `useVisionState()` | Per-key state with real-time sync |
|
|
49
|
+
| `useExtensionContext()` | Extension metadata (ID, target, overlay) |
|
|
50
|
+
| `useLumioEvent()` | Subscribe to platform events (49 event types) |
|
|
51
|
+
| `useLumioConfig()` | Read/write extension config |
|
|
52
|
+
| `useLumioTheme()` | Active overlay/widget theme (colors, fonts) |
|
|
53
|
+
| `useLumioIdentity()` | Current user/account context |
|
|
54
|
+
| `useLumioAction()` | Trigger platform actions (21 action types) |
|
|
55
|
+
| `useQuery()` | Call server query functions |
|
|
56
|
+
| `useMutation()` | Call server mutation functions |
|
|
57
|
+
|
|
58
|
+
### Server Functions (`@zaflun/lumio-sdk/server`)
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { defineSchema, defineTable, v, queryRows, insertRow } from "@zaflun/lumio-sdk/server";
|
|
62
|
+
|
|
63
|
+
export default defineSchema({
|
|
64
|
+
scores: defineTable({
|
|
65
|
+
player: v.string(),
|
|
66
|
+
points: v.number(),
|
|
67
|
+
}).storage("instance"),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const getScores = queryRows("scores");
|
|
71
|
+
export const addScore = insertRow("scores", { player: arg("player"), points: 0 });
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Animation
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import { Animated, useAnimation, defineKeyframes } from "@zaflun/lumio-sdk";
|
|
78
|
+
|
|
79
|
+
// Built-in presets: fadeIn, slideUp, zoomIn, bounce, pulse, ...
|
|
80
|
+
<Animated in="fadeIn" duration={500}>
|
|
81
|
+
<Text content="Hello!" />
|
|
82
|
+
</Animated>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Custom Fonts
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
import { localFont } from "@zaflun/lumio-sdk";
|
|
89
|
+
|
|
90
|
+
const scoreFont = localFont({
|
|
91
|
+
src: "./fonts/Orbitron-Bold.woff2",
|
|
92
|
+
family: "Orbitron",
|
|
93
|
+
fallback: ["sans-serif"],
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Three Surfaces
|
|
98
|
+
|
|
99
|
+
| Surface | File | Where it renders |
|
|
100
|
+
|---------|------|-----------------|
|
|
101
|
+
| `editor` | `src/editor.tsx` | Dashboard sidebar panel |
|
|
102
|
+
| `layer` | `src/layer.tsx` | OBS overlay (transparent) |
|
|
103
|
+
| `interactive` | `src/interactive.tsx` | Audience page |
|
|
104
|
+
|
|
105
|
+
All surfaces share storage — changes in the editor propagate to the overlay in real time.
|
|
106
|
+
|
|
107
|
+
## Security
|
|
108
|
+
|
|
109
|
+
Extensions run in a sandboxed Web Worker with zero DOM access. A custom React reconciler serializes the component tree to JSON, which the host renders. Extension code cannot access cookies, JWT tokens, localStorage, or any host resources.
|
|
110
|
+
|
|
111
|
+
## Documentation
|
|
112
|
+
|
|
113
|
+
- [Getting Started](https://developers.lumio.vision/getting-started/quickstart)
|
|
114
|
+
- [Component Reference](https://developers.lumio.vision/sdk/hooks)
|
|
115
|
+
- [Server Functions](https://developers.lumio.vision/server-functions/overview)
|
|
116
|
+
- [Full Docs](https://developers.lumio.vision)
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
MIT © [zaflun](https://withzaflun.com)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import { LumioEventType, LumioActionType } from '@zaflun/lumio-protocol';
|
|
3
|
+
|
|
4
|
+
interface RenderOptions {
|
|
5
|
+
target: "editor" | "layer" | "interactive";
|
|
6
|
+
}
|
|
7
|
+
declare const Lumio: {
|
|
8
|
+
render(element: React.ReactElement, options: RenderOptions): void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type NotificationHandler = (params: unknown) => void;
|
|
12
|
+
type RequestHandler = (params: unknown) => Promise<unknown>;
|
|
13
|
+
interface WorkerBridgeOptions {
|
|
14
|
+
requestTimeout?: number;
|
|
15
|
+
}
|
|
16
|
+
declare class WorkerBridge {
|
|
17
|
+
private notificationHandlers;
|
|
18
|
+
private requestHandlers;
|
|
19
|
+
private pendingRequests;
|
|
20
|
+
private requestCounter;
|
|
21
|
+
private requestTimeout;
|
|
22
|
+
private messageListener;
|
|
23
|
+
private destroyed;
|
|
24
|
+
constructor(options?: WorkerBridgeOptions);
|
|
25
|
+
notify(method: string, params?: unknown): void;
|
|
26
|
+
request(method: string, params?: unknown): Promise<unknown>;
|
|
27
|
+
onNotification(method: string, handler: NotificationHandler): () => void;
|
|
28
|
+
onRequest(method: string, handler: RequestHandler): void;
|
|
29
|
+
destroy(): void;
|
|
30
|
+
private handleMessage;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type VisionStyle = Pick<CSSProperties, "display" | "flexDirection" | "alignItems" | "justifyContent" | "gap" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "width" | "height" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "overflow" | "overflowX" | "overflowY" | "position" | "top" | "right" | "bottom" | "left" | "zIndex" | "backgroundColor" | "color" | "opacity" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderRadius" | "borderWidth" | "borderStyle" | "borderColor" | "fontSize" | "fontWeight" | "fontFamily" | "lineHeight" | "textAlign" | "textTransform" | "letterSpacing" | "transform" | "transition" | "animation" | "animationName" | "animationDuration" | "animationTimingFunction" | "animationDelay" | "animationIterationCount" | "animationFillMode" | "animationDirection" | "animationPlayState" | "cursor" | "pointerEvents" | "objectFit" | "grid" | "gridTemplate" | "gridTemplateColumns" | "gridTemplateRows" | "gridArea" | "gridColumn" | "gridRow" | "gridGap" | "flex" | "flexGrow" | "flexShrink" | "flexBasis" | "flexWrap">;
|
|
34
|
+
|
|
35
|
+
interface BoxProps {
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
style?: VisionStyle;
|
|
38
|
+
}
|
|
39
|
+
declare function Box({ children, style }: BoxProps): React.ReactElement;
|
|
40
|
+
|
|
41
|
+
interface VStackProps {
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
gap?: number;
|
|
44
|
+
style?: VisionStyle;
|
|
45
|
+
}
|
|
46
|
+
declare function VStack({ children, gap, style }: VStackProps): React.ReactElement;
|
|
47
|
+
|
|
48
|
+
interface HStackProps {
|
|
49
|
+
children?: React.ReactNode;
|
|
50
|
+
gap?: number;
|
|
51
|
+
style?: VisionStyle;
|
|
52
|
+
}
|
|
53
|
+
declare function HStack({ children, gap, style }: HStackProps): React.ReactElement;
|
|
54
|
+
|
|
55
|
+
interface CompactViewProps {
|
|
56
|
+
title: string;
|
|
57
|
+
children?: React.ReactNode;
|
|
58
|
+
}
|
|
59
|
+
declare function CompactView({ title, children }: CompactViewProps): React.ReactElement;
|
|
60
|
+
|
|
61
|
+
interface ListProps<T> {
|
|
62
|
+
items: T[];
|
|
63
|
+
renderItem: (item: T, index: number) => React.ReactNode;
|
|
64
|
+
emptyText?: string;
|
|
65
|
+
}
|
|
66
|
+
declare function List<T>({ items, renderItem, emptyText }: ListProps<T>): React.ReactElement;
|
|
67
|
+
|
|
68
|
+
interface TextProps {
|
|
69
|
+
content: string;
|
|
70
|
+
variant?: "default" | "heading" | "muted";
|
|
71
|
+
}
|
|
72
|
+
declare function Text({ content, variant }: TextProps): React.ReactElement;
|
|
73
|
+
|
|
74
|
+
interface ImageProps {
|
|
75
|
+
src: string;
|
|
76
|
+
alt: string;
|
|
77
|
+
objectFit?: React.CSSProperties["objectFit"];
|
|
78
|
+
}
|
|
79
|
+
declare function Image({ src, alt, objectFit }: ImageProps): React.ReactElement;
|
|
80
|
+
|
|
81
|
+
interface ButtonProps {
|
|
82
|
+
label: string;
|
|
83
|
+
onClick: () => void;
|
|
84
|
+
variant?: "default" | "destructive";
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
}
|
|
87
|
+
declare function Button({ label, onClick, variant, disabled }: ButtonProps): React.ReactElement;
|
|
88
|
+
|
|
89
|
+
interface ToggleProps {
|
|
90
|
+
label: string;
|
|
91
|
+
checked: boolean;
|
|
92
|
+
onChange: (value: boolean) => void;
|
|
93
|
+
}
|
|
94
|
+
declare function Toggle({ label, checked, onChange }: ToggleProps): React.ReactElement;
|
|
95
|
+
|
|
96
|
+
interface TextFieldProps {
|
|
97
|
+
label: string;
|
|
98
|
+
value: string;
|
|
99
|
+
onChange: (value: string) => void;
|
|
100
|
+
placeholder?: string;
|
|
101
|
+
}
|
|
102
|
+
declare function TextField({ label, value, onChange, placeholder }: TextFieldProps): React.ReactElement;
|
|
103
|
+
|
|
104
|
+
interface TextAreaProps {
|
|
105
|
+
label: string;
|
|
106
|
+
value: string;
|
|
107
|
+
onChange: (value: string) => void;
|
|
108
|
+
placeholder?: string;
|
|
109
|
+
rows?: number;
|
|
110
|
+
}
|
|
111
|
+
declare function TextArea({ label, value, onChange, placeholder, rows }: TextAreaProps): React.ReactElement;
|
|
112
|
+
|
|
113
|
+
interface NumberFieldProps {
|
|
114
|
+
label: string;
|
|
115
|
+
value: number;
|
|
116
|
+
onChange: (value: number) => void;
|
|
117
|
+
min?: number;
|
|
118
|
+
max?: number;
|
|
119
|
+
step?: number;
|
|
120
|
+
}
|
|
121
|
+
declare function NumberField({ label, value, onChange, min, max, step }: NumberFieldProps): React.ReactElement;
|
|
122
|
+
|
|
123
|
+
interface DropdownOption {
|
|
124
|
+
value: string;
|
|
125
|
+
label: string;
|
|
126
|
+
}
|
|
127
|
+
interface DropdownProps {
|
|
128
|
+
label: string;
|
|
129
|
+
value: string;
|
|
130
|
+
options: DropdownOption[];
|
|
131
|
+
onChange: (value: string) => void;
|
|
132
|
+
}
|
|
133
|
+
declare function Dropdown({ label, value, options, onChange }: DropdownProps): React.ReactElement;
|
|
134
|
+
|
|
135
|
+
interface SliderProps {
|
|
136
|
+
label: string;
|
|
137
|
+
value: number;
|
|
138
|
+
onChange: (value: number) => void;
|
|
139
|
+
min: number;
|
|
140
|
+
max: number;
|
|
141
|
+
step?: number;
|
|
142
|
+
}
|
|
143
|
+
declare function Slider({ label, value, onChange, min, max, step }: SliderProps): React.ReactElement;
|
|
144
|
+
|
|
145
|
+
declare function useExtensionStorage<T = Record<string, unknown>>(key: string, initialValue: T): [T, (value: T) => void];
|
|
146
|
+
|
|
147
|
+
declare function useVisionState<T>(key: string, defaultValue: T): [T, (value: T) => void];
|
|
148
|
+
|
|
149
|
+
interface ExtensionContext {
|
|
150
|
+
extensionId: string | null;
|
|
151
|
+
target: "editor" | "layer" | "interactive" | null;
|
|
152
|
+
overlayId: string | null;
|
|
153
|
+
interactiveUrl: string | null;
|
|
154
|
+
}
|
|
155
|
+
declare function useExtensionContext(): ExtensionContext;
|
|
156
|
+
|
|
157
|
+
declare function useLumioEvent(eventType: LumioEventType): unknown | null;
|
|
158
|
+
|
|
159
|
+
interface LumioConfig {
|
|
160
|
+
extension_id?: string;
|
|
161
|
+
install_id?: string;
|
|
162
|
+
account_id?: string;
|
|
163
|
+
target?: "editor" | "layer" | "interactive";
|
|
164
|
+
permissions?: string[];
|
|
165
|
+
settings?: Record<string, unknown>;
|
|
166
|
+
}
|
|
167
|
+
declare function useLumioConfig(): [LumioConfig, (config: LumioConfig) => void];
|
|
168
|
+
|
|
169
|
+
interface OverlayTheme {
|
|
170
|
+
colors: {
|
|
171
|
+
primary: string;
|
|
172
|
+
secondary: string;
|
|
173
|
+
accent: string;
|
|
174
|
+
background: string;
|
|
175
|
+
surface: string;
|
|
176
|
+
text: string;
|
|
177
|
+
muted: string;
|
|
178
|
+
border: string;
|
|
179
|
+
};
|
|
180
|
+
fonts: {
|
|
181
|
+
heading: string;
|
|
182
|
+
body: string;
|
|
183
|
+
};
|
|
184
|
+
borderRadius: {
|
|
185
|
+
sm: string;
|
|
186
|
+
md: string;
|
|
187
|
+
lg: string;
|
|
188
|
+
};
|
|
189
|
+
spacing: number;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Returns the active overlay/widget theme variables.
|
|
193
|
+
*
|
|
194
|
+
* Extensions use this to style themselves consistently with the
|
|
195
|
+
* overlay or widget they're rendered in. Only relevant for `layer`
|
|
196
|
+
* and `interactive` targets (OBS overlay, widget pages).
|
|
197
|
+
*
|
|
198
|
+
* Theme is provided via lifecycle.init and updated via theme.change when
|
|
199
|
+
* the user switches the overlay/widget theme.
|
|
200
|
+
*/
|
|
201
|
+
declare function useLumioTheme(): OverlayTheme;
|
|
202
|
+
|
|
203
|
+
interface LumioIdentity {
|
|
204
|
+
userId: string | null;
|
|
205
|
+
accountId: string | null;
|
|
206
|
+
role: string | null;
|
|
207
|
+
}
|
|
208
|
+
declare function useLumioIdentity(): LumioIdentity;
|
|
209
|
+
|
|
210
|
+
interface UseLumioActionResult {
|
|
211
|
+
execute: (params?: Record<string, unknown>) => void;
|
|
212
|
+
data: unknown | null;
|
|
213
|
+
isLoading: boolean;
|
|
214
|
+
error: string | null;
|
|
215
|
+
}
|
|
216
|
+
declare function useLumioAction(action: LumioActionType): UseLumioActionResult;
|
|
217
|
+
|
|
218
|
+
interface UseQueryResult {
|
|
219
|
+
data: unknown | null;
|
|
220
|
+
isLoading: boolean;
|
|
221
|
+
error: string | null;
|
|
222
|
+
refetch: () => void;
|
|
223
|
+
}
|
|
224
|
+
declare function useQuery(functionName: string, params?: Record<string, unknown>): UseQueryResult;
|
|
225
|
+
|
|
226
|
+
interface UseMutationResult {
|
|
227
|
+
mutate: (params?: Record<string, unknown>) => void;
|
|
228
|
+
mutateAsync: (params?: Record<string, unknown>) => Promise<unknown>;
|
|
229
|
+
data: unknown | null;
|
|
230
|
+
isLoading: boolean;
|
|
231
|
+
error: string | null;
|
|
232
|
+
}
|
|
233
|
+
declare function useMutation(functionName: string): UseMutationResult;
|
|
234
|
+
|
|
235
|
+
type KeyframeBlock = Record<string, string>;
|
|
236
|
+
type KeyframeDefinition = Record<string, KeyframeBlock>;
|
|
237
|
+
declare function defineKeyframes(definition: KeyframeDefinition): string;
|
|
238
|
+
declare function flushKeyframes(): void;
|
|
239
|
+
|
|
240
|
+
declare const ANIMATION_PRESETS: {
|
|
241
|
+
readonly fadeIn: {
|
|
242
|
+
readonly from: {
|
|
243
|
+
readonly opacity: "0";
|
|
244
|
+
};
|
|
245
|
+
readonly to: {
|
|
246
|
+
readonly opacity: "1";
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
readonly fadeOut: {
|
|
250
|
+
readonly from: {
|
|
251
|
+
readonly opacity: "1";
|
|
252
|
+
};
|
|
253
|
+
readonly to: {
|
|
254
|
+
readonly opacity: "0";
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
readonly zoomIn: {
|
|
258
|
+
readonly from: {
|
|
259
|
+
readonly opacity: "0";
|
|
260
|
+
readonly transform: "scale(0.5)";
|
|
261
|
+
};
|
|
262
|
+
readonly to: {
|
|
263
|
+
readonly opacity: "1";
|
|
264
|
+
readonly transform: "scale(1)";
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
readonly zoomOut: {
|
|
268
|
+
readonly from: {
|
|
269
|
+
readonly opacity: "1";
|
|
270
|
+
readonly transform: "scale(1)";
|
|
271
|
+
};
|
|
272
|
+
readonly to: {
|
|
273
|
+
readonly opacity: "0";
|
|
274
|
+
readonly transform: "scale(0.5)";
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
readonly slideLeftIn: {
|
|
278
|
+
readonly from: {
|
|
279
|
+
readonly opacity: "0";
|
|
280
|
+
readonly transform: "translateX(-100%)";
|
|
281
|
+
};
|
|
282
|
+
readonly to: {
|
|
283
|
+
readonly opacity: "1";
|
|
284
|
+
readonly transform: "translateX(0)";
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
readonly slideLeftOut: {
|
|
288
|
+
readonly from: {
|
|
289
|
+
readonly opacity: "1";
|
|
290
|
+
readonly transform: "translateX(0)";
|
|
291
|
+
};
|
|
292
|
+
readonly to: {
|
|
293
|
+
readonly opacity: "0";
|
|
294
|
+
readonly transform: "translateX(-100%)";
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
readonly slideRightIn: {
|
|
298
|
+
readonly from: {
|
|
299
|
+
readonly opacity: "0";
|
|
300
|
+
readonly transform: "translateX(100%)";
|
|
301
|
+
};
|
|
302
|
+
readonly to: {
|
|
303
|
+
readonly opacity: "1";
|
|
304
|
+
readonly transform: "translateX(0)";
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
readonly slideRightOut: {
|
|
308
|
+
readonly from: {
|
|
309
|
+
readonly opacity: "1";
|
|
310
|
+
readonly transform: "translateX(0)";
|
|
311
|
+
};
|
|
312
|
+
readonly to: {
|
|
313
|
+
readonly opacity: "0";
|
|
314
|
+
readonly transform: "translateX(100%)";
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
readonly slideUpIn: {
|
|
318
|
+
readonly from: {
|
|
319
|
+
readonly opacity: "0";
|
|
320
|
+
readonly transform: "translateY(-100%)";
|
|
321
|
+
};
|
|
322
|
+
readonly to: {
|
|
323
|
+
readonly opacity: "1";
|
|
324
|
+
readonly transform: "translateY(0)";
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
readonly slideUpOut: {
|
|
328
|
+
readonly from: {
|
|
329
|
+
readonly opacity: "1";
|
|
330
|
+
readonly transform: "translateY(0)";
|
|
331
|
+
};
|
|
332
|
+
readonly to: {
|
|
333
|
+
readonly opacity: "0";
|
|
334
|
+
readonly transform: "translateY(-100%)";
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
readonly slideDownIn: {
|
|
338
|
+
readonly from: {
|
|
339
|
+
readonly opacity: "0";
|
|
340
|
+
readonly transform: "translateY(100%)";
|
|
341
|
+
};
|
|
342
|
+
readonly to: {
|
|
343
|
+
readonly opacity: "1";
|
|
344
|
+
readonly transform: "translateY(0)";
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
readonly slideDownOut: {
|
|
348
|
+
readonly from: {
|
|
349
|
+
readonly opacity: "1";
|
|
350
|
+
readonly transform: "translateY(0)";
|
|
351
|
+
};
|
|
352
|
+
readonly to: {
|
|
353
|
+
readonly opacity: "0";
|
|
354
|
+
readonly transform: "translateY(100%)";
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
readonly pushLeftIn: {
|
|
358
|
+
readonly from: {
|
|
359
|
+
readonly transform: "translateX(100%)";
|
|
360
|
+
};
|
|
361
|
+
readonly to: {
|
|
362
|
+
readonly transform: "translateX(0)";
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
readonly pushLeftOut: {
|
|
366
|
+
readonly from: {
|
|
367
|
+
readonly transform: "translateX(0)";
|
|
368
|
+
};
|
|
369
|
+
readonly to: {
|
|
370
|
+
readonly transform: "translateX(-100%)";
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
readonly pushRightIn: {
|
|
374
|
+
readonly from: {
|
|
375
|
+
readonly transform: "translateX(-100%)";
|
|
376
|
+
};
|
|
377
|
+
readonly to: {
|
|
378
|
+
readonly transform: "translateX(0)";
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
readonly pushRightOut: {
|
|
382
|
+
readonly from: {
|
|
383
|
+
readonly transform: "translateX(0)";
|
|
384
|
+
};
|
|
385
|
+
readonly to: {
|
|
386
|
+
readonly transform: "translateX(100%)";
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
readonly pushUpIn: {
|
|
390
|
+
readonly from: {
|
|
391
|
+
readonly transform: "translateY(100%)";
|
|
392
|
+
};
|
|
393
|
+
readonly to: {
|
|
394
|
+
readonly transform: "translateY(0)";
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
readonly pushUpOut: {
|
|
398
|
+
readonly from: {
|
|
399
|
+
readonly transform: "translateY(0)";
|
|
400
|
+
};
|
|
401
|
+
readonly to: {
|
|
402
|
+
readonly transform: "translateY(-100%)";
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
readonly pushDownIn: {
|
|
406
|
+
readonly from: {
|
|
407
|
+
readonly transform: "translateY(-100%)";
|
|
408
|
+
};
|
|
409
|
+
readonly to: {
|
|
410
|
+
readonly transform: "translateY(0)";
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
readonly pushDownOut: {
|
|
414
|
+
readonly from: {
|
|
415
|
+
readonly transform: "translateY(0)";
|
|
416
|
+
};
|
|
417
|
+
readonly to: {
|
|
418
|
+
readonly transform: "translateY(100%)";
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
readonly pulse: {
|
|
422
|
+
readonly "0%": {
|
|
423
|
+
readonly transform: "scale(1)";
|
|
424
|
+
};
|
|
425
|
+
readonly "50%": {
|
|
426
|
+
readonly transform: "scale(1.05)";
|
|
427
|
+
};
|
|
428
|
+
readonly "100%": {
|
|
429
|
+
readonly transform: "scale(1)";
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
readonly bounce: {
|
|
433
|
+
readonly "0%": {
|
|
434
|
+
readonly transform: "translateY(0)";
|
|
435
|
+
};
|
|
436
|
+
readonly "50%": {
|
|
437
|
+
readonly transform: "translateY(-10px)";
|
|
438
|
+
};
|
|
439
|
+
readonly "100%": {
|
|
440
|
+
readonly transform: "translateY(0)";
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
type AnimationPresetName = keyof typeof ANIMATION_PRESETS;
|
|
445
|
+
declare function getPreset(name: AnimationPresetName): string;
|
|
446
|
+
|
|
447
|
+
interface AnimatedProps {
|
|
448
|
+
children: React.ReactNode;
|
|
449
|
+
in?: AnimationPresetName | string;
|
|
450
|
+
out?: AnimationPresetName | string;
|
|
451
|
+
loop?: AnimationPresetName | string;
|
|
452
|
+
duration?: number;
|
|
453
|
+
loopDuration?: number;
|
|
454
|
+
easing?: string;
|
|
455
|
+
delay?: number;
|
|
456
|
+
visible?: boolean;
|
|
457
|
+
onAnimationEnd?: () => void;
|
|
458
|
+
}
|
|
459
|
+
declare function Animated({ children, in: inProp, out: outProp, loop: loopProp, duration, loopDuration, easing, delay, visible, onAnimationEnd, }: AnimatedProps): React.ReactElement;
|
|
460
|
+
|
|
461
|
+
interface UseAnimationResult {
|
|
462
|
+
trigger: (preset: AnimationPresetName | string, duration?: number) => string;
|
|
463
|
+
reset: () => void;
|
|
464
|
+
isAnimating: boolean;
|
|
465
|
+
currentAnimation: string | null;
|
|
466
|
+
style: Record<string, string | number>;
|
|
467
|
+
}
|
|
468
|
+
declare function useAnimation(): UseAnimationResult;
|
|
469
|
+
|
|
470
|
+
type FontDisplay = "auto" | "block" | "swap" | "fallback" | "optional";
|
|
471
|
+
interface FontSource {
|
|
472
|
+
path: string;
|
|
473
|
+
weight?: string;
|
|
474
|
+
style?: string;
|
|
475
|
+
}
|
|
476
|
+
interface LocalFontOptions {
|
|
477
|
+
src: string | FontSource[];
|
|
478
|
+
family: string;
|
|
479
|
+
weight?: string;
|
|
480
|
+
style?: string;
|
|
481
|
+
display?: FontDisplay;
|
|
482
|
+
fallback?: string[];
|
|
483
|
+
}
|
|
484
|
+
interface LocalFontDefinition {
|
|
485
|
+
fontFamily: string;
|
|
486
|
+
}
|
|
487
|
+
declare function localFont(options: LocalFontOptions): LocalFontDefinition;
|
|
488
|
+
|
|
489
|
+
export { ANIMATION_PRESETS, Animated, type AnimatedProps, type AnimationPresetName, Box, type BoxProps, Button, type ButtonProps, CompactView, type CompactViewProps, Dropdown, type DropdownOption, type DropdownProps, type ExtensionContext, type FontDisplay, type FontSource, HStack, type HStackProps, Image, type ImageProps, type KeyframeBlock, type KeyframeDefinition, List, type ListProps, type LocalFontDefinition, type LocalFontOptions, Lumio, type LumioConfig, type LumioIdentity, NumberField, type NumberFieldProps, type OverlayTheme, type RenderOptions, Slider, type SliderProps, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, Toggle, type ToggleProps, type UseAnimationResult, type UseLumioActionResult, type UseMutationResult, type UseQueryResult, VStack, type VStackProps, type VisionStyle, WorkerBridge, defineKeyframes, flushKeyframes, getPreset, localFont, useAnimation, useExtensionContext, useExtensionStorage, useLumioAction, useLumioConfig, useLumioEvent, useLumioIdentity, useLumioTheme, useMutation, useQuery, useVisionState };
|