@decentralized-identity/ion-cli
Version:
A Command Line Interface (CLI) to make working with the ION network and using ION DIDs easy peasy lemon squeezy.
50 lines (49 loc) • 1.57 kB
TypeScript
import InitialState from './InitialState';
/**
* Class describing a storage item for saving and loading
* DID metadata and keys.
*/
export default class StorageItem {
readonly name: string;
readonly initialState: InitialState;
readonly keys: any[];
/**
* Storage item version.
*/
readonly version: string;
/**
* Date indicating the date and time
* the storage was created.
*/
readonly created: Date;
/**
* Flag indicating whether the DID has been
* published to the network.
*/
published: boolean;
/**
* Constructs a new instance on the @see StorageItem class.
* @param name of the DID.
* @param initialState of the DID.
* @param keys associated with the DID.
*/
constructor(name: string, initialState: InitialState, keys: any[]);
/**
* Checks if the specified storage item exists.
* @param directory from which to load the storage item.
* @param name of the storage item to load.
*/
static exists(directory: string, name: string): boolean;
/**
* Loads the DID with @param name from the specified directory.
* @param directory from which to load the DID.
* @param name of the DID to load.
*/
static load(directory: string, name: string): Promise<StorageItem>;
/**
* Saves the instance of the DID to specified directory
* as a json file.
* @param directory to save the DID to.
*/
save(directory: string): Promise<void>;
}