import { IStorageAdapter } from '../adapters/IStorageAdapter' ; /**
 * User-defined metadata stored with  IKeyEntry .
  export type KeyEntryMeta = { [ key ] : string ; } ; /**
 * Object representing  KeyEntryStorage configuration options.
 * This combines the  IStorageAdapterConfig with the ability to
 * specify the adapter itself. All three properties are mutually exclusive.
  export interface IKeyEntryStorageConfig { /**
     * Node.js only. File system path to the folder where the entries will be
     * persisted. If it's a relative path, it is resolved using
     *  {@link `path.resolve`|https://nodejs.org/dist/latest/docs/api/path.html#path_path_resolve_paths} .
      dir ? : string ; /**
     * Browser only. Name of the IndexedDB database where the entries will be
     * persisted.
     */ name ? : string ; /**
     * Object implementing the `IStorageAdapter` interface.
     */ adapter ? : IStorageAdapter ; } /**
 * Interface of a single entry in  IKeyEntryStorage .
  export interface IKeyEntry { name : string ; value : string ; meta ? : KeyEntryMeta ; creationDate : Date ; modificationDate : Date ; } /**
 * Parameters of  KeyEntryStorage . save method.
  export interface ISaveKeyEntryParams { name : string ; value : string ; meta ? : KeyEntryMeta ; } /**
 * Parameters of  KeyEntryStorage . update method.
 * Although both `value` and `meta` are marked as optional, at least one of
 * them must be provided, or else a `TypeError` will be thrown.
  export interface IUpdateKeyEntryParams { /**
     * Name of the key entry to update.
     * > Note! The name itself cannot be changed.
     */ name : string ; /**
     * New value of the key entry. Optional. If ommited, the original
     * value remains intact.
     */ value ? : string ; /**
     * New metadata of the key entry. Optional. If provided, overwrites
     * the previous metadata completely. If ommited, the original metadata
     * remains intact.
     */ meta ? : KeyEntryMeta ; } /**
 * Interface to be implemented by object capable of persisting
 * private keys data and metadata.
 */ export interface IKeyEntryStorage { param { ISaveKeyEntryParams } params returns { Promise < IKeyEntry > } Promise resolved with stored entry,
     * or rejected with  PrivateKeyExistsError error in case entry
     * with the same name already exists.
      save ( params ) : Promise < IKeyEntry > ; param { string } name returns { Promise < IKeyEntry | null > } load ( name ) : Promise < IKeyEntry | null > ; param { string } name returns { Promise < boolean > } exists ( name ) : Promise < boolean > ; param { string } name returns { Promise < boolean > } remove ( name ) : Promise < boolean > ; returns { Promise < IKeyEntry > } list ( ) : Promise < IKeyEntry [ ] > ; param { IUpdateKeyEntryParams } params update ( params ) : Promise < IKeyEntry > ; returns { Promise < void > } clear ( ) : Promise < void > ; }