/** * Napplet NAP storage shim entrypoint. * * @module */ interface NappletStorageApi { getItem(key: string): Promise; setItem(key: string, value: string): Promise; removeItem(key: string): Promise; keys(): Promise; instance: { getItem(key: string): Promise; setItem(key: string, value: string): Promise; removeItem(key: string): Promise; keys(): Promise; }; } /** * Async localStorage-like state API for sandboxed napplets. * * Routes all state operations through the shell's state proxy via postMessage. * Each napplet's state is namespaced by its identity -- napplets cannot read each other's data. * A per-napplet 512 KB quota is enforced by the shell. * * Top-level methods use the default `"shared"` scope and emit no `scope` field * on the wire. The `instance` sub-object is sugar that sets `scope: "instance"` * for per-instance storage (NAP-STORAGE). */ declare const nappletStorage: NappletStorageApi; /** * Install the storage response listener. * Called by @napplet/shim during initialization. * * @returns cleanup function that removes the listener */ declare function installStorageShim(): () => void; export { installStorageShim, nappletStorage };