浏览代码

Update interface.

Afshin Darian 8 年之前
父节点
当前提交
5e3c6ba2a2
共有 1 个文件被更改,包括 17 次插入2 次删除
  1. 17 2
      src/statedb/index.ts

+ 17 - 2
src/statedb/index.ts

@@ -51,6 +51,21 @@ interface ISaveBundle {
  */
 export
 interface IStateDB {
-  fetch(): Promise<ISaveBundle>;
-  save(): Promise<void>;
+  /**
+   * Retrieve a saved bundle from the database.
+   *
+   * #### Notes
+   * If a namespace is not provided, the default value will be `'statedb'`.
+   */
+  fetch(id: string, namespace?: string): Promise<ISaveBundle>;
+
+  /**
+   * Retrieve all the saved bundles for a namespace.
+   */
+  fetchNamespace(namespace: string): Promise<ISaveBundle[]>;
+
+  /**
+   * Save a bundle in the database.
+   */
+  save(bundle: ISaveBundle): Promise<void>;
 }