@stacksjs/stx-vscode 0.2.929 → 0.2.931

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stacksjs/stx-typescript-plugin",
3
- "version": "0.2.929",
3
+ "version": "0.2.931",
4
4
  "private": true,
5
5
  "main": "index.js"
6
6
  }
@@ -520,8 +520,17 @@ declare function useAsync<T>(_fn: () => Promise<T>): {
520
520
  // Storage
521
521
  // ============================================================================
522
522
 
523
- declare function useLocalStorage<T>(_key: string, _defaultValue: T): StxSignal<T>
524
- declare function useSessionStorage<T>(_key: string, _defaultValue: T): StxSignal<T>
523
+ /** The module composable's options: a format of its own, merged object defaults, and other tabs' writes. */
524
+ interface StxStorageOptions<T> {
525
+ /** How the value is stored. Default: JSON. */
526
+ serializer?: { read: (_value: string) => T, write: (_value: T) => string }
527
+ /** Spread a stored object over an object default. */
528
+ mergeDefaults?: boolean
529
+ /** Follow writes from other tabs. Default true. */
530
+ listenToStorageChanges?: boolean
531
+ }
532
+ declare function useLocalStorage<T>(_key: string, _defaultValue: T, _options?: StxStorageOptions<T>): StxSignal<T>
533
+ declare function useSessionStorage<T>(_key: string, _defaultValue: T, _options?: StxStorageOptions<T>): StxSignal<T>
525
534
  /** A value kept between visits (a phone app between launches) in a scope such as the signed-in account; a scope of false keeps nothing. */
526
535
  declare function keptState<T>(_name: string, _initialValue: T, _options?: { scope?: string | number | false | null }): StxSignal<T>
527
536
  /** Remove a scope's kept values, or every kept value. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx-vscode",
3
3
  "type": "module",
4
- "version": "0.2.929",
4
+ "version": "0.2.931",
5
5
  "description": "stx language support for VS Code extensions to embed: the hovers, completions, diagnostics, grammar, snippets, language configuration and TypeScript server plugin behind the stx extension.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",