/** * Builds a storage namespace bound to `prefix`. Every signal the * returned factory creates persists under `prefix + key` in the * default storage area: `localStorage`, falling back to * `sessionStorage`, then to an in-memory shim. * * ```js * const store = storage('my-app:') * const dark = store('dark', false) * dark.read() * dark.write(true) * dark.update(v => !v) * ``` * * Each call returns a regular pota `signal()` object — `.read()`, * `.write(value)`, `.update(prev => next)`. The initial value comes * from storage when present, falling back to `initial`. Signals for * the same key stay in sync within the same document, and * browser-backed stores also react to `storage` events from other * tabs. Storage writes are wrapped in try/catch so quota and * private-mode failures are silently ignored — the signal still * behaves correctly in-memory. * * @param {string} prefix Prefix prepended to every key (caller picks * the separator, e.g. `'my-app:'` or `'my-app/'`). * @url https://pota.quack.uy/use/storage */ export function storage(prefix: string): (key: string, initial?: T) => Signal; //# sourceMappingURL=storage.d.ts.map