UNPKG

svelte-local-storage-store

Version:

[![npm version](https://img.shields.io/npm/v/svelte-local-storage-store.svg)](https://www.npmjs.com/package/svelte-local-storage-store) [![license](https://img.shields.io/npm/l/svelte-local-storage-store.svg)](LICENSE.md) [![codecov](https://codecov.io/gh

17 lines (14 loc) 546 B
import { Writable } from 'svelte/store'; interface Serializer<T> { parse(text: string): T; stringify(object: T): string; } type StorageType = 'local' | 'session'; interface Options<T> { serializer?: Serializer<T>; storage?: StorageType; } /** @deprecated `writable()` has been renamed to `persisted()` */ declare function writable<T>(key: string, initialValue: T, options?: Options<T>): Writable<T>; declare function persisted<T>(key: string, initialValue: T, options?: Options<T>): Writable<T>; export { persisted, writable };