@fluxlay/react 1.0.1 → 1.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/dist/index.d.ts CHANGED
@@ -9,10 +9,16 @@ declare interface AudioInfo {
9
9
  rms: number;
10
10
  /** Peak volume level (0.0 - 1.0). */
11
11
  peak: number;
12
- /** Frequency spectrum split into 32 logarithmically-scaled bands (0.0 - 1.0 each). */
12
+ /** Frequency spectrum split into logarithmically-scaled bands (0.0 - 1.0 each). The number of bands is configurable via `useAudio({ numBands })`. */
13
13
  spectrum: number[];
14
14
  }
15
15
 
16
+ /** Options for the audio stream. */
17
+ export declare interface AudioOptions {
18
+ /** Number of frequency spectrum bands. Default is 32. */
19
+ numBands?: number;
20
+ }
21
+
16
22
  /** Storage information for a single disk/volume. */
17
23
  declare interface DiskInfo {
18
24
  /** Mount point path (e.g. "/", "/home"). */
@@ -47,6 +53,15 @@ declare interface MediaMetadataInfo {
47
53
  isPlaying: boolean;
48
54
  }
49
55
 
56
+ /** Options for the media metadata stream. */
57
+ export declare interface MediaMetadataOptions {
58
+ /** Polling interval in milliseconds. Default is 1000. */
59
+ intervalMs?: number;
60
+ }
61
+
62
+ /** Custom property values set by the end user via the Fluxlay settings UI. */
63
+ declare type PropertyValues = Record<string, number | string | boolean>;
64
+
50
65
  /**
51
66
  * Runs a pre-declared shell command from fluxlay.yaml.
52
67
  *
@@ -135,6 +150,26 @@ declare interface SystemMonitorInfo {
135
150
  kernelVersion: string;
136
151
  }
137
152
 
153
+ /** Polling interval options for each system monitor category (in milliseconds). */
154
+ export declare interface SystemMonitorOptions {
155
+ /** CPU usage polling interval in ms. */
156
+ cpuIntervalMs?: number;
157
+ /** Memory usage polling interval in ms. */
158
+ memoryIntervalMs?: number;
159
+ /** Network throughput polling interval in ms. */
160
+ networkIntervalMs?: number;
161
+ /** Disk I/O polling interval in ms. */
162
+ diskIoIntervalMs?: number;
163
+ /** Disk space polling interval in ms. */
164
+ diskSpaceIntervalMs?: number;
165
+ /** Battery status polling interval in ms. */
166
+ batteryIntervalMs?: number;
167
+ /** Process count polling interval in ms. */
168
+ processIntervalMs?: number;
169
+ /** Load average polling interval in ms. */
170
+ loadAverageIntervalMs?: number;
171
+ }
172
+
138
173
  /** Holds the xterm {@link Terminal} and its associated {@link FitAddon}. */
139
174
  export declare interface TerminalInstance {
140
175
  /** The underlying xterm Terminal instance. */
@@ -223,9 +258,10 @@ export declare const TerminalThemes: {
223
258
  * Returns the current audio state including RMS volume, peak level,
224
259
  * and frequency spectrum data, useful for building audio visualizers.
225
260
  *
261
+ * @param options - Optional audio configuration.
226
262
  * @returns The current audio info as `{ rms, peak, spectrum }`.
227
263
  */
228
- export declare function useAudio(): AudioInfo;
264
+ export declare function useAudio(options?: AudioOptions): AudioInfo;
229
265
 
230
266
  /**
231
267
  * React hook that subscribes to media metadata streamed from the
@@ -236,9 +272,10 @@ export declare function useAudio(): AudioInfo;
236
272
  * album artwork, and playback state — useful for building
237
273
  * music-reactive wallpapers.
238
274
  *
275
+ * @param options - Optional media metadata configuration.
239
276
  * @returns The current media metadata info.
240
277
  */
241
- export declare function useMediaMetadata(): MediaMetadataInfo;
278
+ export declare function useMediaMetadata(options?: MediaMetadataOptions): MediaMetadataInfo;
242
279
 
243
280
  /**
244
281
  * React hook that subscribes to global mouse position events streamed from
@@ -258,6 +295,18 @@ export declare function useMousePosition(): {
258
295
  y: number;
259
296
  };
260
297
 
298
+ /**
299
+ * React hook that provides the current custom property values defined
300
+ * in the wallpaper manifest and customized by the end user.
301
+ *
302
+ * Fetches initial values on mount and subscribes to real-time updates
303
+ * via the properties stream.
304
+ *
305
+ * @typeParam T - Shape of the property values object.
306
+ * @returns The current property values typed as `T`.
307
+ */
308
+ export declare function useProperties<T extends PropertyValues = PropertyValues>(): T;
309
+
261
310
  /**
262
311
  * React hook that executes a pre-declared Fluxlay shell command and
263
312
  * optionally renders its output into an xterm terminal.
@@ -314,9 +363,10 @@ export declare interface UseShellOptions extends ShellOptions {
314
363
  * battery status, and network throughput — useful for building
315
364
  * system-reactive wallpapers (e.g. cyberpunk HUDs, hardware monitors).
316
365
  *
366
+ * @param options - Optional polling interval configuration for each category.
317
367
  * @returns The current system monitor info.
318
368
  */
319
- export declare function useSystemMonitor(): SystemMonitorInfo;
369
+ export declare function useSystemMonitor(options?: SystemMonitorOptions): SystemMonitorInfo;
320
370
 
321
371
  /**
322
372
  * React hook that creates and manages a read-only xterm terminal rendered