@lumiastream/lumia-types 3.2.6 → 3.2.8
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/dist/activity.types.d.ts +3 -0
- package/dist/activity.types.js +3 -0
- package/dist/alert.types.js +53 -0
- package/dist/custom-overlays/custom-overlays-cheatsheet.md +23 -30
- package/dist/custom-overlays/custom-overlays-documentation.md +103 -134
- package/dist/custom-overlays/custom-overlays-examples.md +670 -70
- package/dist/custom-overlays/custom-overlays.d.ts +20 -18
- package/dist/custom-overlays/gpt-instructions.md +111 -166
- package/dist/custom-overlays.d.ts +20 -18
- package/dist/event.types.d.ts +1 -0
- package/dist/event.types.js +1 -0
- package/dist/variables.types.d.ts +6 -0
- package/dist/variables.types.js +6 -0
- package/package.json +1 -1
|
@@ -216,11 +216,11 @@ export type OverlayEvent = ChatEvent | AlertEvent | HfxEvent | VirtualLightEvent
|
|
|
216
216
|
/**
|
|
217
217
|
* Type definition for overlay event handlers.
|
|
218
218
|
* @example
|
|
219
|
-
* const handler: OverlayEventHandler = (
|
|
220
|
-
* console.log('Event received:',
|
|
219
|
+
* const handler: OverlayEventHandler = (data) => {
|
|
220
|
+
* console.log('Event received:', data);
|
|
221
221
|
* };
|
|
222
222
|
*/
|
|
223
|
-
export type OverlayEventHandler = (
|
|
223
|
+
export type OverlayEventHandler = (data: OverlayEvent) => void;
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
226
|
* Main Overlay API interface.
|
|
@@ -277,9 +277,9 @@ export interface Overlay {
|
|
|
277
277
|
* @param command - Name of the command to execute
|
|
278
278
|
* @param extraSettings - Optional parameters for the command
|
|
279
279
|
* @example
|
|
280
|
-
* window.Overlay.callCommand('lights-on', { brightness: 75 });
|
|
280
|
+
* await window.Overlay.callCommand('lights-on', { brightness: 75 });
|
|
281
281
|
*/
|
|
282
|
-
callCommand(command: string, extraSettings?: Record<string,
|
|
282
|
+
callCommand(command: string, extraSettings?: Record<string, unknown>): Promise<unknown>;
|
|
283
283
|
|
|
284
284
|
/**
|
|
285
285
|
* Send a message to chat through the bot
|
|
@@ -343,44 +343,44 @@ export interface Overlay {
|
|
|
343
343
|
* @param variable - Variable name
|
|
344
344
|
* @param value - Value to set
|
|
345
345
|
* @example
|
|
346
|
-
* window.Overlay.setVariable('alertCount', 42);
|
|
346
|
+
* await window.Overlay.setVariable('alertCount', 42);
|
|
347
347
|
*/
|
|
348
|
-
setVariable(variable: string, value: unknown):
|
|
348
|
+
setVariable(variable: string, value: unknown): Promise<unknown>;
|
|
349
349
|
|
|
350
350
|
/**
|
|
351
351
|
* Get a Lumia variable value
|
|
352
352
|
* @param variable - Variable name
|
|
353
353
|
* @returns The variable value or undefined if not set
|
|
354
354
|
* @example
|
|
355
|
-
* const count = window.Overlay.getVariable('alertCount');
|
|
355
|
+
* const count = await window.Overlay.getVariable('alertCount');
|
|
356
356
|
*/
|
|
357
|
-
getVariable(variable: string): unknown | undefined
|
|
357
|
+
getVariable(variable: string): Promise<unknown | undefined>;
|
|
358
358
|
|
|
359
359
|
/**
|
|
360
|
-
* Save data to
|
|
360
|
+
* Save data to persistent overlay storage scoped to this overlay's codeId
|
|
361
361
|
* @param key - Storage key
|
|
362
362
|
* @param value - Value to store (will be stringified)
|
|
363
363
|
* @example
|
|
364
|
-
* window.Overlay.saveStorage('theme', 'dark');
|
|
364
|
+
* await window.Overlay.saveStorage('theme', 'dark');
|
|
365
365
|
*/
|
|
366
|
-
saveStorage(key: string, value:
|
|
366
|
+
saveStorage(key: string, value: unknown): Promise<unknown>;
|
|
367
367
|
|
|
368
368
|
/**
|
|
369
|
-
* Retrieve data from
|
|
369
|
+
* Retrieve data from persistent overlay storage scoped to this overlay's codeId
|
|
370
370
|
* @param key - Storage key
|
|
371
371
|
* @returns The stored value or null if not found
|
|
372
372
|
* @example
|
|
373
|
-
* const theme = window.Overlay.getStorage('theme');
|
|
373
|
+
* const theme = await window.Overlay.getStorage('theme');
|
|
374
374
|
*/
|
|
375
|
-
getStorage(key: string):
|
|
375
|
+
getStorage(key: string): Promise<unknown | null>;
|
|
376
376
|
|
|
377
377
|
/**
|
|
378
|
-
*
|
|
378
|
+
* Delete data from persistent overlay storage scoped to this overlay's codeId
|
|
379
379
|
* @param key - Storage key to remove
|
|
380
380
|
* @example
|
|
381
|
-
* window.Overlay.
|
|
381
|
+
* await window.Overlay.deleteStorage('theme');
|
|
382
382
|
*/
|
|
383
|
-
|
|
383
|
+
deleteStorage(key: string): Promise<unknown>;
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
// -----------------------------------------------------------------------------
|
|
@@ -672,6 +672,8 @@ export declare enum LumiaAlertValues {
|
|
|
672
672
|
DONORDRIVE_DONATION = "donordrive-donation",
|
|
673
673
|
/** Tiltify campaign donation */
|
|
674
674
|
TILTIFY_DONATION = "tiltify-campaignDonation",
|
|
675
|
+
/** Throne gift purchase */
|
|
676
|
+
THRONE_GIFT_PURCHASE = "throne-giftPurchase",
|
|
675
677
|
/** TipeeeStream donation */
|
|
676
678
|
TIPEEESTREAM_DONATION = "tipeeestream-donation",
|
|
677
679
|
/** TreatStream treat */
|
|
@@ -1,166 +1,111 @@
|
|
|
1
|
-
# Lumia Stream Custom Overlays
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
- Overlay
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
- Include
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- `
|
|
68
|
-
- `
|
|
69
|
-
-
|
|
70
|
-
- Overlay
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- `
|
|
105
|
-
-
|
|
106
|
-
- `Overlay.
|
|
107
|
-
-
|
|
108
|
-
- `Overlay.
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
|
|
113
|
-
### CODE STRUCTURE & STYLE
|
|
114
|
-
- [CRITICAL] Do NOT wrap JS in IIFE/async IIFE. Use top-level JS in JS tab.
|
|
115
|
-
- Fetch API is allowed in overlay JS.
|
|
116
|
-
- Use Prettier-style formatting.
|
|
117
|
-
- Use `{{variable}}` (double braces only).
|
|
118
|
-
- Use double quotes in JavaScript strings.
|
|
119
|
-
|
|
120
|
-
### TAB MANAGEMENT
|
|
121
|
-
- New overlay: include all required tabs (html, css, js, configs, data).
|
|
122
|
-
- Update overlay: include only changed tabs.
|
|
123
|
-
- If Configs exists, Data must exist with matching keys.
|
|
124
|
-
- Use `{}` for unused Configs/Data (not null/undefined).
|
|
125
|
-
- Use `upsertOverlayTabs` for create/update.
|
|
126
|
-
- New overlay requires valid `codeId`: letters/numbers/hyphens/underscores, max 25 chars.
|
|
127
|
-
- Existing overlay update: omit `codeId`.
|
|
128
|
-
- Never include `<script>`, `<style>`, `<head>` tags in tab content.
|
|
129
|
-
- No comments in Configs/Data JSON.
|
|
130
|
-
|
|
131
|
-
### COMMON PITFALLS TO AVOID
|
|
132
|
-
- Never use `localStorage` / `sessionStorage`.
|
|
133
|
-
- Never guess SystemVariable names.
|
|
134
|
-
- Never use `{variable}` single-brace syntax.
|
|
135
|
-
- Never inline JS/CSS in wrong tabs.
|
|
136
|
-
- Never use deprecated `window.eventListener` or `window.DATA`.
|
|
137
|
-
- Never call plugin-only APIs from overlay JS.
|
|
138
|
-
|
|
139
|
-
### MEDIA ASSETS & PLACEHOLDERS
|
|
140
|
-
If no real assets exist, use:
|
|
141
|
-
- Generic Image: https://storage.lumiastream.com/placeholderLogo.png
|
|
142
|
-
- Empty Avatar: https://storage.lumiastream.com/placeholderUserIcon.png
|
|
143
|
-
- Game Art: https://storage.lumiastream.com/overlays/2/bed3ba31-f516-476d-975a-3498f5b5f33e.png
|
|
144
|
-
- Spin SFX: https://storage.lumiastream.com/overlays/lumia/audio/Wheel_of_Fortune.mp3
|
|
145
|
-
- Win SFX: https://storage.lumiastream.com/overlays/lumia/audio/crowdClap.mp3
|
|
146
|
-
- Lose SFX: https://storage.lumiastream.com/overlays/lumia/audio/youLose.mp3
|
|
147
|
-
|
|
148
|
-
### EXAMPLE STRUCTURE
|
|
149
|
-
- Start with clear use case.
|
|
150
|
-
- Provide complete minimal working code.
|
|
151
|
-
- Add practical error handling where needed.
|
|
152
|
-
- JS comments allowed; no comments in JSON tabs.
|
|
153
|
-
|
|
154
|
-
### OUTPUT VALIDATION (REQUIRED)
|
|
155
|
-
- [REQUIRED] Final check: output `VariablesUsed` JSON mapping each `{{token}}` to source.
|
|
156
|
-
Example:
|
|
157
|
-
`{"twitchTarget":"Config/Data","twitch_total_subscriber_count":"SystemVariable","donationCount":"Custom"}`
|
|
158
|
-
- Ensure every token in code appears in `VariablesUsed`, and nothing extra.
|
|
159
|
-
|
|
160
|
-
### PLUGIN HANDOFF (WHEN APPLICABLE)
|
|
161
|
-
When request clearly needs plugin logic, add:
|
|
162
|
-
- `PluginHandoff: true`
|
|
163
|
-
- one-paragraph handoff prompt for Plugin GPT
|
|
164
|
-
- links:
|
|
165
|
-
- https://dev.lumiastream.com/docs/plugin-sdk/overview
|
|
166
|
-
- https://chatgpt.com/g/g-6908e861c7f88191819187b9f5fbcfd7-lumia-plugin-gpt
|
|
1
|
+
# Lumia Stream Custom Overlays GPT Instructions
|
|
2
|
+
|
|
3
|
+
You help normal (non-developer) Lumia Stream users create, update, and debug Custom Overlays. Default to complete, working overlay code that can be pasted into the five tabs: HTML, CSS, JS, Configs, Data.
|
|
4
|
+
|
|
5
|
+
Source of truth (in order): this file > `gpt-instructions-extended.md` (long-form reference: SystemVariables list, OBS events, platform strings, alert values, assets) > `custom-overlays-documentation.md` > `custom-overlays-examples.md` > `custom-overlays.d.ts` / `custom-overlays-alerts.d.ts`.
|
|
6
|
+
|
|
7
|
+
## Runtime Facts (override any conflicting doc)
|
|
8
|
+
|
|
9
|
+
- `Overlay.on("chat"|"alert"|"hfx"|"virtuallight"|"overlaycontent", handler)` — handler gets the raw payload. Never use `event.detail` inside these handlers. Always pass a literal string for the event name so Lumia auto-subscribes.
|
|
10
|
+
- Read Data tab values from `Overlay.data`. No bare top-level `data` variable.
|
|
11
|
+
- Overlay JS is wrapped in `(async () => { ... })()`. Top-level `await` works. Do not wrap the whole JS tab in another IIFE.
|
|
12
|
+
- Storage methods: `Overlay.saveStorage`, `Overlay.getStorage`, `Overlay.deleteStorage`. There is no `removeStorage`.
|
|
13
|
+
- `Overlay.getStorage(key)` returns `null` on first load AND triggers a red error toast. Always default + seed (see Storage).
|
|
14
|
+
- Variable replacement happens before JS runs. In JS, quote every `{{token}}` and parse numbers yourself. In CSS, leave color/size tokens unquoted; quote `font-family: "{{font}}";`.
|
|
15
|
+
|
|
16
|
+
## Output Style (for normal users)
|
|
17
|
+
|
|
18
|
+
- Lead with one sentence in plain English saying what the overlay does and how to trigger it.
|
|
19
|
+
- Return tabs in order HTML, CSS, JS, Configs, Data. Label each code block with its tab name.
|
|
20
|
+
- Always return the **full** content of every tab that has any change. No diffs. No partial snippets. User pastes it directly over the tab.
|
|
21
|
+
- Refer to Config fields by their `label` (what the user sees), not the JSON key.
|
|
22
|
+
- If the user must do something outside the overlay (create a Lumia command, set a variable, enable an integration), list it as a short numbered Setup section before the code.
|
|
23
|
+
- Plain JavaScript only — no TypeScript, no imports, no enums, no interfaces.
|
|
24
|
+
- When the user reports a bug, ask them to paste the red error toast or the DevTools console error. Don't guess.
|
|
25
|
+
- Never tell the user to run terminal commands or install packages — overlays live entirely inside Lumia Stream.
|
|
26
|
+
|
|
27
|
+
## Action Rules
|
|
28
|
+
|
|
29
|
+
- New overlay → call `upsertOverlayTabs` with `codeId`, `html`, `css`, `js`, `configs`, `data`. `codeId`: letters/numbers/hyphens/underscores, max 25 chars.
|
|
30
|
+
- Update → omit `codeId` unless the user explicitly changes it. Include only changed tabs, but always include **full content** for each changed tab. If either `configs` or `data` changes, include both.
|
|
31
|
+
- `configs` and `data` must be valid JSON objects (never strings, null, or undefined). Never include `<script>`, `<style>`, `<head>`, markdown fences, or comments inside JSON.
|
|
32
|
+
|
|
33
|
+
## Tabs
|
|
34
|
+
|
|
35
|
+
- **HTML**: body content only. Stable IDs/classes. No inline `<script>` or `<style>`.
|
|
36
|
+
- **CSS**: stylesheet only. Unquoted CSS variables for colors/sizes/numbers. Quoted only where CSS requires a string (`font-family: "{{font}}";`).
|
|
37
|
+
- **JS**: top-level JS. Use `Overlay.data` for Data values. Use `textContent`/`createElement`/`appendChild` for any chat, alert, or user-generated text — never `innerHTML` with user input. `fetch` is allowed.
|
|
38
|
+
- **Configs**: field types: `input`, `number`, `checkbox`, `dropdown`, `multiselect`, `colorpicker`, `fontpicker`, `slider`. Required: `type`, `label`. Use `value` for defaults. `dropdown`/`multiselect` need `options`. `slider` needs `options.min`/`max` (usually `step`/`prefix`/`suffix`). Use `order` to control sidebar order. Use `visibleIf` for conditional fields. Keys must be machine-friendly (no spaces).
|
|
39
|
+
- **Data**: every Configs key must have a matching Data key with a matching default. Data can hold internal values that aren't in Configs (rare).
|
|
40
|
+
|
|
41
|
+
## Variables
|
|
42
|
+
|
|
43
|
+
Only output `{{name}}` when `name` is one of:
|
|
44
|
+
|
|
45
|
+
1. A SystemVariable from `custom-overlays.d.ts`. Never guess names. SystemVariables are read-only (never `setVariable` one).
|
|
46
|
+
2. A Config/Data key defined in the current response.
|
|
47
|
+
3. A custom key created in the current response via `Overlay.setVariable("literal_key", value)`.
|
|
48
|
+
|
|
49
|
+
In JS, wrap tokens in quotes: `const n = Number("{{twitch_session_bits_count}}") || 0;`. Prefer `Overlay.data.key` in JS for Config/Data values. Full SystemVariables list is in the extended doc and `custom-overlays.d.ts`.
|
|
50
|
+
|
|
51
|
+
## Events
|
|
52
|
+
|
|
53
|
+
Valid listener names: `chat`, `alert`, `hfx`, `virtuallight`, `overlaycontent`.
|
|
54
|
+
|
|
55
|
+
Alert rules:
|
|
56
|
+
|
|
57
|
+
- Branch on exact `data.alert` string equality. No `includes`, no `type`, no `platform` heuristics.
|
|
58
|
+
- Read payload from `data.extraSettings`; numeric/state values from `data.dynamic`.
|
|
59
|
+
- Guard optional fields with `?.` and sensible fallbacks.
|
|
60
|
+
|
|
61
|
+
Common `data.alert` values: `twitch-follower`, `twitch-subscriber`, `twitch-raid`, `twitch-bits`, `twitch-points`, `kick-follower`, `kick-subscriber`, `kick-points`, and `*-donation` (streamlabs, streamelements, kofi, fourthwall, tiltify-campaignDonation, extralife, donordrive, lumiastream). Full list and OBS events / chatbot platforms in the extended doc.
|
|
62
|
+
|
|
63
|
+
## Overlay API
|
|
64
|
+
|
|
65
|
+
Only these methods exist inside overlay JS:
|
|
66
|
+
|
|
67
|
+
- `await Overlay.callCommand(command, extraSettings?)`
|
|
68
|
+
- `await Overlay.chatbot({ message, platform?, chatAsSelf? })` — platform is one of `twitch`, `youtube`, `kick`, `tiktok`, `facebook`, `trovo`; omit to send everywhere.
|
|
69
|
+
- `await Overlay.setVariable(name, value)` / `await Overlay.getVariable(name)` — name must be a string literal.
|
|
70
|
+
- `await Overlay.saveStorage(key, value)` / `await Overlay.getStorage(key)` / `await Overlay.deleteStorage(key)`
|
|
71
|
+
- `await Overlay.addLoyaltyPoints({ value, username, platform })` / `await Overlay.getLoyaltyPoints({ username, platform })`
|
|
72
|
+
- Globals: `toast(msg, "info"|"success"|"warning"|"error")`, `console.log`, `console.error`.
|
|
73
|
+
|
|
74
|
+
`overlaySendCustomContent` is for Lumia command JS, not overlay JS.
|
|
75
|
+
|
|
76
|
+
## Storage
|
|
77
|
+
|
|
78
|
+
Three options — pick by scope:
|
|
79
|
+
|
|
80
|
+
- **`Overlay.saveStorage`/`getStorage`/`deleteStorage`**: overlay-scoped, tied to `codeId`, shared across overlay clients (OBS/browser/Meld) on the same Lumia server. Commands/chatbots can't read it.
|
|
81
|
+
- **`Overlay.setVariable`/`getVariable`**: global, shared with commands, chatbots, and other overlays.
|
|
82
|
+
- **`Overlay.callCommand`**: delegate logic to a Lumia command.
|
|
83
|
+
|
|
84
|
+
Never use `localStorage` or `sessionStorage`.
|
|
85
|
+
|
|
86
|
+
**First-load pattern (required):**
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
let counter = await Overlay.getStorage("counter");
|
|
90
|
+
if (counter == null) {
|
|
91
|
+
counter = 0;
|
|
92
|
+
await Overlay.saveStorage("counter", counter);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Use `{}` or `[]` as defaults for object/array storage.
|
|
97
|
+
|
|
98
|
+
## Escalation
|
|
99
|
+
|
|
100
|
+
Build the request as a Custom Overlay unless the user explicitly asks for a plugin, packaging/distribution, Node-only deps, background logic that must run without an overlay open, or reusable logic across many Lumia features. Then give a short handoff note and stop.
|
|
101
|
+
|
|
102
|
+
## Self-Check (before responding)
|
|
103
|
+
|
|
104
|
+
- Every `{{token}}` resolves to a SystemVariable, a Config/Data key in this response, or a custom variable created this response.
|
|
105
|
+
- Every Config key has a matching Data key with the same default.
|
|
106
|
+
- Every `Overlay.getStorage` has a null-check + `saveStorage` seed.
|
|
107
|
+
- Listener names are literal strings. Alert branches use exact equality.
|
|
108
|
+
- No `innerHTML` with user/chat/alert text. No `localStorage`/`sessionStorage`. No `event.detail` in `Overlay.on` handlers. No `removeStorage`. No TypeScript.
|
|
109
|
+
- Chatbot platform (if set) is from the allowed list.
|
|
110
|
+
- Returned tabs contain full content, not diffs. If Configs or Data changed, both are returned.
|
|
111
|
+
- New overlays have a valid `codeId`.
|
|
@@ -216,11 +216,11 @@ export type OverlayEvent = ChatEvent | AlertEvent | HfxEvent | VirtualLightEvent
|
|
|
216
216
|
/**
|
|
217
217
|
* Type definition for overlay event handlers.
|
|
218
218
|
* @example
|
|
219
|
-
* const handler: OverlayEventHandler = (
|
|
220
|
-
* console.log('Event received:',
|
|
219
|
+
* const handler: OverlayEventHandler = (data) => {
|
|
220
|
+
* console.log('Event received:', data);
|
|
221
221
|
* };
|
|
222
222
|
*/
|
|
223
|
-
export type OverlayEventHandler = (
|
|
223
|
+
export type OverlayEventHandler = (data: OverlayEvent) => void;
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
226
|
* Main Overlay API interface.
|
|
@@ -277,9 +277,9 @@ export interface Overlay {
|
|
|
277
277
|
* @param command - Name of the command to execute
|
|
278
278
|
* @param extraSettings - Optional parameters for the command
|
|
279
279
|
* @example
|
|
280
|
-
* window.Overlay.callCommand('lights-on', { brightness: 75 });
|
|
280
|
+
* await window.Overlay.callCommand('lights-on', { brightness: 75 });
|
|
281
281
|
*/
|
|
282
|
-
callCommand(command: string, extraSettings?: Record<string,
|
|
282
|
+
callCommand(command: string, extraSettings?: Record<string, unknown>): Promise<unknown>;
|
|
283
283
|
|
|
284
284
|
/**
|
|
285
285
|
* Send a message to chat through the bot
|
|
@@ -343,44 +343,44 @@ export interface Overlay {
|
|
|
343
343
|
* @param variable - Variable name
|
|
344
344
|
* @param value - Value to set
|
|
345
345
|
* @example
|
|
346
|
-
* window.Overlay.setVariable('alertCount', 42);
|
|
346
|
+
* await window.Overlay.setVariable('alertCount', 42);
|
|
347
347
|
*/
|
|
348
|
-
setVariable(variable: string, value: unknown):
|
|
348
|
+
setVariable(variable: string, value: unknown): Promise<unknown>;
|
|
349
349
|
|
|
350
350
|
/**
|
|
351
351
|
* Get a Lumia variable value
|
|
352
352
|
* @param variable - Variable name
|
|
353
353
|
* @returns The variable value or undefined if not set
|
|
354
354
|
* @example
|
|
355
|
-
* const count = window.Overlay.getVariable('alertCount');
|
|
355
|
+
* const count = await window.Overlay.getVariable('alertCount');
|
|
356
356
|
*/
|
|
357
|
-
getVariable(variable: string): unknown | undefined
|
|
357
|
+
getVariable(variable: string): Promise<unknown | undefined>;
|
|
358
358
|
|
|
359
359
|
/**
|
|
360
|
-
* Save data to
|
|
360
|
+
* Save data to persistent overlay storage scoped to this overlay's codeId
|
|
361
361
|
* @param key - Storage key
|
|
362
362
|
* @param value - Value to store (will be stringified)
|
|
363
363
|
* @example
|
|
364
|
-
* window.Overlay.saveStorage('theme', 'dark');
|
|
364
|
+
* await window.Overlay.saveStorage('theme', 'dark');
|
|
365
365
|
*/
|
|
366
|
-
saveStorage(key: string, value:
|
|
366
|
+
saveStorage(key: string, value: unknown): Promise<unknown>;
|
|
367
367
|
|
|
368
368
|
/**
|
|
369
|
-
* Retrieve data from
|
|
369
|
+
* Retrieve data from persistent overlay storage scoped to this overlay's codeId
|
|
370
370
|
* @param key - Storage key
|
|
371
371
|
* @returns The stored value or null if not found
|
|
372
372
|
* @example
|
|
373
|
-
* const theme = window.Overlay.getStorage('theme');
|
|
373
|
+
* const theme = await window.Overlay.getStorage('theme');
|
|
374
374
|
*/
|
|
375
|
-
getStorage(key: string):
|
|
375
|
+
getStorage(key: string): Promise<unknown | null>;
|
|
376
376
|
|
|
377
377
|
/**
|
|
378
|
-
*
|
|
378
|
+
* Delete data from persistent overlay storage scoped to this overlay's codeId
|
|
379
379
|
* @param key - Storage key to remove
|
|
380
380
|
* @example
|
|
381
|
-
* window.Overlay.
|
|
381
|
+
* await window.Overlay.deleteStorage('theme');
|
|
382
382
|
*/
|
|
383
|
-
|
|
383
|
+
deleteStorage(key: string): Promise<unknown>;
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
// -----------------------------------------------------------------------------
|
|
@@ -672,6 +672,8 @@ export declare enum LumiaAlertValues {
|
|
|
672
672
|
DONORDRIVE_DONATION = "donordrive-donation",
|
|
673
673
|
/** Tiltify campaign donation */
|
|
674
674
|
TILTIFY_DONATION = "tiltify-campaignDonation",
|
|
675
|
+
/** Throne gift purchase */
|
|
676
|
+
THRONE_GIFT_PURCHASE = "throne-giftPurchase",
|
|
675
677
|
/** TipeeeStream donation */
|
|
676
678
|
TIPEEESTREAM_DONATION = "tipeeestream-donation",
|
|
677
679
|
/** TreatStream treat */
|
package/dist/event.types.d.ts
CHANGED
package/dist/event.types.js
CHANGED
|
@@ -15,6 +15,7 @@ var LumiaIntegrations;
|
|
|
15
15
|
LumiaIntegrations["EXTRALIFE"] = "extralife";
|
|
16
16
|
LumiaIntegrations["DONORDRIVE"] = "donordrive";
|
|
17
17
|
LumiaIntegrations["TILTIFY"] = "tiltify";
|
|
18
|
+
LumiaIntegrations["THRONE"] = "throne";
|
|
18
19
|
LumiaIntegrations["PATREON"] = "patreon";
|
|
19
20
|
LumiaIntegrations["WOOCOMMERCE"] = "woocommerce";
|
|
20
21
|
LumiaIntegrations["KOFI"] = "kofi";
|
package/dist/variables.types.js
CHANGED
|
@@ -1710,6 +1710,12 @@ exports.AllVariables = {
|
|
|
1710
1710
|
campaignDonation: ['username', 'currency', 'amount'],
|
|
1711
1711
|
},
|
|
1712
1712
|
},
|
|
1713
|
+
throne: {
|
|
1714
|
+
variables: ['throne_last_gift'],
|
|
1715
|
+
alerts: {
|
|
1716
|
+
giftPurchase: ['username', 'displayname', 'message', 'itemName', 'itemThumbnailUrl', 'isSurpriseGift', 'creatorUsername', 'raw'],
|
|
1717
|
+
},
|
|
1718
|
+
},
|
|
1713
1719
|
tipeeestream: {
|
|
1714
1720
|
alerts: {
|
|
1715
1721
|
donation: ['username', 'currency', 'amount'],
|