halo-fe 1.0.28 → 1.0.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,2 @@
1
- import HaPager from "Index.vue";
1
+ import HaPager from "./Index.vue";
2
2
  export { HaPager };
@@ -16,7 +16,7 @@ interface IHttp extends IDriver, IOpen {
16
16
  /**
17
17
  * 请求准备
18
18
  */
19
- prepareAsync(request: HttpRequest, variables: string[]): Promise<void>;
19
+ prepareAsync(request: HttpRequest, variables?: string[]): Promise<void>;
20
20
  /**
21
21
  * 发送GET请求,得到响应体
22
22
  */
@@ -4,7 +4,8 @@ import Provider from "../Provider";
4
4
  */
5
5
  declare class CookieProvider extends Provider {
6
6
  type: string;
7
- openAsync(conn: string): Promise<number>;
7
+ openAsync(conn: string): Promise<void>;
8
+ getKeysAsync(table: string): Promise<any[]>;
8
9
  createAsync(kind: string): Promise<any>;
9
10
  deleteAsync(kind: string, key: any): Promise<any>;
10
11
  getAsync(kind: string, key: any): Promise<any>;
@@ -19,7 +19,7 @@ declare class IndexedDbProvider extends Provider {
19
19
  /**
20
20
  * 进行数据库初始化 或 从现有数据库中得到最新版本号(数据库首次初始化和open是版本号升级时,会触发升级事件)
21
21
  */
22
- openAsync(conn: string): Promise<number>;
22
+ openAsync(conn: string): Promise<void>;
23
23
  /**
24
24
  * 保证创建存储Store
25
25
  */
@@ -31,7 +31,7 @@ declare class IndexedDbProvider extends Provider {
31
31
  /**
32
32
  * 开启事务
33
33
  */
34
- openTransAsync(table: string, mode: string, db: IDBDatabase): Promise<IDBTransaction>;
34
+ openTransAsync(table: string, mode: IDBTransactionMode, db: IDBDatabase): Promise<IDBTransaction>;
35
35
  getEntity<T>(table: string, id: any): Promise<T>;
36
36
  /**
37
37
  * 查询数据
@@ -4,8 +4,9 @@ import Provider from "../Provider";
4
4
  */
5
5
  declare class StorageProvider extends Provider {
6
6
  type: string;
7
- openAsync(conn: string): Promise<number>;
7
+ openAsync(conn: string): Promise<void>;
8
8
  createAsync(kind: string): Promise<any>;
9
+ getKeysAsync(table: string): Promise<any[]>;
9
10
  getAsync(kind: string, key: any): Promise<any>;
10
11
  getEntity<T>(kind: string, key: string): Promise<T>;
11
12
  insertAsync(kind: string, key: any, entity: any): Promise<any>;
@@ -3,15 +3,29 @@ import { SubscribedWindow } from "./@types";
3
3
  /**
4
4
  * Socket基类
5
5
  */
6
- declare class Socket implements ISocket {
6
+ declare abstract class Socket implements ISocket {
7
+ /**
8
+ * 类型
9
+ */
10
+ type: string;
11
+ /**
12
+ * 是否已连接(空表示不需连接)
13
+ */
14
+ connected: boolean;
15
+ /**
16
+ * Socket消息处理程序
17
+ */
18
+ handler: (event: MessageEvent) => void;
7
19
  /**
8
20
  * 已订阅的消息类型列表
9
21
  */
10
22
  subscribed: SubscribedWindow;
11
23
  openAsync(conn?: string): Promise<void>;
24
+ abstract connect(): Promise<void>;
12
25
  subscribe(win: string, kind: string, type: string | string[]): Promise<any>;
13
26
  resubscribe(): Promise<void>;
14
27
  unsubscribe(win: string): Promise<any>;
15
28
  abstract send(data: any): void;
29
+ dispose(): void;
16
30
  }
17
31
  export default Socket;
@@ -19,9 +19,17 @@ declare class JsonUtil extends Util {
19
19
  */
20
20
  autoDeserialize(value: string): any;
21
21
  /**
22
- * 反序列化成json对象
22
+ * 反序列化为json对象,异常返回null
23
23
  */
24
24
  deserialize(value: string): any;
25
+ /**
26
+ * 尝试反序列化成json对象
27
+ * 异常时,结果返回异常消息对象
28
+ */
29
+ tryDeserialize(value: string, result: any | {
30
+ message: string;
31
+ stack: string;
32
+ }): boolean;
25
33
  /**
26
34
  * 判断指定值,是否包含key
27
35
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "halo-fe",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Halo front end sdk",
5
5
  "scripts": {
6
6
  "halo-fe:tsc": "vue-tsc",