wallpaper-engine 1.0.2 → 1.0.3
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 +21 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# wallpaper-engine
|
|
2
4
|
|
|
3
5
|
TypeScript type definitions, a Vite plugin, and runtime helpers for building [Wallpaper Engine](https://www.wallpaperengine.io/) web wallpapers.
|
|
4
6
|
|
|
7
|
+
[](https://www.npmjs.com/package/wallpaper-engine)
|
|
8
|
+
[](https://github.com/ShadowNineX/wallpaper-engine/actions)
|
|
9
|
+
[](https://codecov.io/gh/ShadowNineX/wallpaper-engine)
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
|
|
12
|
+
[:package: Installation](#installation) · [:electric_plug: Vite Plugin](#vite-plugin) · [:muscle: Strong Typing](#strong-property-typing) · [:wrench: Helpers](#helpers) · [:window: Window Augmentation](#window-augmentation) · [:books: Type Reference](#full-type-reference)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
5
16
|
- **Full type coverage** for the entire Wallpaper Engine Web API — property listeners, media integration, audio, iCUE/LED plugins, and `window` augmentation
|
|
6
17
|
- **Vite plugin** that auto-generates `project.json` at build time with full IntelliSense on your property definitions
|
|
7
18
|
- **Strong inference** — define your properties once and TypeScript automatically types every key in `applyUserProperties`
|
|
@@ -9,7 +20,7 @@ TypeScript type definitions, a Vite plugin, and runtime helpers for building [Wa
|
|
|
9
20
|
|
|
10
21
|
---
|
|
11
22
|
|
|
12
|
-
## Installation
|
|
23
|
+
## <a id="installation"></a>:package: Installation
|
|
13
24
|
|
|
14
25
|
```bash
|
|
15
26
|
bun add wallpaper-engine
|
|
@@ -27,7 +38,7 @@ bun add -d vite
|
|
|
27
38
|
|
|
28
39
|
---
|
|
29
40
|
|
|
30
|
-
## Package Exports
|
|
41
|
+
## <a id="package-exports"></a>:inbox_tray: Package Exports
|
|
31
42
|
|
|
32
43
|
| Import path | Contents |
|
|
33
44
|
|---|---|
|
|
@@ -37,7 +48,7 @@ bun add -d vite
|
|
|
37
48
|
|
|
38
49
|
---
|
|
39
50
|
|
|
40
|
-
## Vite Plugin
|
|
51
|
+
## <a id="vite-plugin"></a>:electric_plug: Vite Plugin
|
|
41
52
|
|
|
42
53
|
The plugin emits a `project.json` asset alongside your build so Wallpaper Engine can load the wallpaper without any manual file maintenance.
|
|
43
54
|
|
|
@@ -112,7 +123,7 @@ wallpaperEnginePlugin({
|
|
|
112
123
|
|
|
113
124
|
---
|
|
114
125
|
|
|
115
|
-
## Strong Property Typing
|
|
126
|
+
## <a id="strong-property-typing"></a>:muscle: Strong Property Typing
|
|
116
127
|
|
|
117
128
|
Define your properties in a dedicated file, then import it in both `vite.config.ts` and your wallpaper source. `WallpaperUserPropertiesOf<T>` maps each definition to its exact runtime value type automatically.
|
|
118
129
|
|
|
@@ -157,7 +168,7 @@ window.wallpaperPropertyListener = {
|
|
|
157
168
|
|
|
158
169
|
---
|
|
159
170
|
|
|
160
|
-
## Helpers
|
|
171
|
+
## <a id="helpers"></a>:wrench: Helpers
|
|
161
172
|
|
|
162
173
|
All helpers are side-effect-free and individually tree-shakeable.
|
|
163
174
|
|
|
@@ -206,7 +217,8 @@ window.wallpaperRegisterAudioListener((raw) => {
|
|
|
206
217
|
});
|
|
207
218
|
```
|
|
208
219
|
|
|
209
|
-
>
|
|
220
|
+
> [!IMPORTANT]
|
|
221
|
+
> **Always use `window.wallpaperRegisterAudioListener`, not `globalThis.`.**
|
|
210
222
|
> Wallpaper Engine scans your compiled JS for this exact call to detect that the wallpaper uses audio and automatically sets `"supportsaudioprocessing": true` in its internal `project.json`. Without that flag, WE will **not** send audio data in live desktop mode (the editor preview always sends audio regardless, which can mask the problem).
|
|
211
223
|
>
|
|
212
224
|
> If audio works in the WE editor but not as a live wallpaper, open the wallpaper in the WE editor and click **Edit → Save** to force WE to write the updated `project.json`. After saving, re-apply the wallpaper as your desktop background.
|
|
@@ -238,7 +250,7 @@ window.onload = () => loop.start();
|
|
|
238
250
|
|
|
239
251
|
---
|
|
240
252
|
|
|
241
|
-
## Window Augmentation
|
|
253
|
+
## <a id="window-augmentation"></a>:window: Window Augmentation
|
|
242
254
|
|
|
243
255
|
If you're not using Vite or don't need the plugin, the main `wallpaper-engine` entry is all you need. A single side-effect import augments the global `Window` interface so every WE API is fully typed — no manual `declare` blocks, no runtime cost.
|
|
244
256
|
|
|
@@ -279,7 +291,7 @@ Two alternatives that also work without an `import` in your source:
|
|
|
279
291
|
|
|
280
292
|
---
|
|
281
293
|
|
|
282
|
-
## Full Type Reference
|
|
294
|
+
## <a id="full-type-reference"></a>:books: Full Type Reference
|
|
283
295
|
|
|
284
296
|
All types are exported from `wallpaper-engine` (main entry).
|
|
285
297
|
|
|
@@ -305,7 +317,7 @@ All types are exported from `wallpaper-engine` (main entry).
|
|
|
305
317
|
|
|
306
318
|
---
|
|
307
319
|
|
|
308
|
-
## Building
|
|
320
|
+
## <a id="building"></a>:building_construction: Building
|
|
309
321
|
|
|
310
322
|
```bash
|
|
311
323
|
bun run build # production build (ESM + CJS + .d.ts)
|