web-dc-api 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4014,6 +4014,7 @@ interface IDatabaseOperations {
4014
4014
  * @returns 错误信息或null表示成功
4015
4015
  */
4016
4016
  syncDBToDC(tId: string): Promise<Error | null>;
4017
+ autoExpandDBSpace(threadId: string, expandSpace: number): Promise<boolean>;
4017
4018
  /**
4018
4019
  * 获取数据库信息
4019
4020
  * @param id threaddbID
@@ -27650,6 +27651,25 @@ declare class DBManager {
27650
27651
  getDB(id: ThreadID, opts?: ManagedOptions): Promise<DB>;
27651
27652
  getDBInfo(id: ThreadID, opts?: ManagedOptions): Promise<[IDBInfo | null, Error | null]>;
27652
27653
  deleteDB(id: ThreadID, deleteThreadFlag: boolean, opts?: ManagedOptions): Promise<void>;
27654
+ /**
27655
+ * 为指定的threaddb添加可使用空间
27656
+ * Add usable space to a specified threaddb
27657
+ * @param threadid Thread ID string
27658
+ * @param space Space to add (uint32)
27659
+ * @returns Promise that resolves when space is added
27660
+ */
27661
+ addDBSpace(threadid: string, space: number): Promise<void>;
27662
+ /**
27663
+ * 获取当前threaddb已经使用的存储大小
27664
+ * Get the current storage size info of threaddb
27665
+ * @param threadid Thread ID string
27666
+ * @returns Promise resolving to object with allocatedSize and usedSize
27667
+ */
27668
+ getThreadDBSizeInfo(threadid: string): Promise<{
27669
+ allocatedSize: number;
27670
+ usedSize: number;
27671
+ }>;
27672
+ autoExpandDBSpace(threadId: string, expandSpace?: number): Promise<boolean>;
27653
27673
  private deleteThreadNamespace;
27654
27674
  /**********************数据库数据操作相关**********************/
27655
27675
  /**
@@ -28289,6 +28309,7 @@ declare class DatabaseModule implements DCModule, IDatabaseOperations {
28289
28309
  * @returns 错误信息或null
28290
28310
  */
28291
28311
  syncDBToDC(tId: string): Promise<Error | null>;
28312
+ autoExpandDBSpace(threadId: string, expandSpace?: number): Promise<boolean>;
28292
28313
  /**
28293
28314
  * 升级集合结构
28294
28315
  * @param threadId 线程ID
@@ -28859,6 +28880,7 @@ declare class DC implements DCContext {
28859
28880
  */
28860
28881
  initUserDB(collections: ICollectionConfig[], verno?: number, //版本编码,当版本编码变化时,需要重构表结构
28861
28882
  reset?: boolean): Promise<[IDBInfo | null, Error | null]>;
28883
+ private autoExpandDBSpace;
28862
28884
  private setUserDefaultDB;
28863
28885
  private checkSetUserDefaultDB;
28864
28886
  /**
@@ -29169,7 +29191,7 @@ declare class KeyManager {
29169
29191
  static generateMnemonic(strength?: 128 | 256): string;
29170
29192
  static validateMnemonic(mnemonic: string): boolean;
29171
29193
  static getMasterKeyFromMnemonic(mnemonic: string, password?: string): Promise<HDKey>;
29172
- static deriveKey(mnemonic: string, path?: string, // 以太坊路径
29194
+ static deriveKey(mnemonic: string, path?: string, // 以太坊路径
29173
29195
  password?: string): Promise<{
29174
29196
  privateKey: Uint8Array;
29175
29197
  publicKey: Uint8Array;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-dc-api",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "web相关的dcapi",
5
5
  "type": "module",
6
6
  "browser": "dist/dc.min.js",