@nuwa-ai/identity-kit-web
Version:
Web extensions for Nuwa Identity Kit
27 lines (26 loc) • 714 B
TypeScript
import { KeyStore, StoredKey } from '@nuwa-ai/identity-kit';
/**
* Browser LocalStorage implementation of KeyStore
*/
export declare class LocalStorageKeyStore implements KeyStore {
private readonly prefix;
constructor(options?: {
prefix?: string;
});
/**
* List all key IDs stored in this KeyStore
*/
listKeyIds(): Promise<string[]>;
/**
* Load a key by ID, or all keys if no ID is provided
*/
load(keyId?: string): Promise<StoredKey | null>;
/**
* Save a key to storage
*/
save(key: StoredKey): Promise<void>;
/**
* Clear a key from storage, or all keys if no ID is provided
*/
clear(keyId?: string): Promise<void>;
}