halo-fe 1.0.24 → 1.0.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. package/README.md +3 -1
  2. package/dist/assets/{liquidjs-B8dqQyVv.js → liquidjs-C2HVw1Ra.js} +82 -81
  3. package/dist/main.js +4888 -4397
  4. package/dist/style.css +1 -1
  5. package/esm/@types/CreateFeOptions.d.ts +4 -0
  6. package/esm/coms/@types/PagerEmit.d.ts +11 -0
  7. package/esm/coms/@types/PagerProps.d.ts +18 -0
  8. package/esm/coms/@types/SocketProgressProps.d.ts +31 -0
  9. package/esm/coms/@types/TabProps.d.ts +11 -0
  10. package/esm/coms/@types/TableEmit.d.ts +10 -0
  11. package/esm/coms/@types/TableProps.d.ts +34 -0
  12. package/esm/coms/@types/index.d.ts +7 -1
  13. package/esm/coms/Empty.vue.d.ts +12 -10
  14. package/esm/coms/Fill.vue.d.ts +8 -10
  15. package/esm/coms/Scroller.vue.d.ts +11 -13
  16. package/esm/coms/Timer.vue.d.ts +7 -9
  17. package/esm/coms/cards/Index.vue.d.ts +16 -0
  18. package/esm/coms/cards/index.d.ts +2 -0
  19. package/esm/coms/conditions/Condition.vue.d.ts +1 -1
  20. package/esm/coms/conditions/Index.vue.d.ts +1 -1
  21. package/esm/coms/controls/@types/CodeIntelli.d.ts +6 -0
  22. package/esm/coms/controls/@types/CodeProps.d.ts +31 -2
  23. package/esm/coms/controls/@types/Range.d.ts +1 -1
  24. package/esm/coms/controls/Code.vue.d.ts +16 -28
  25. package/esm/coms/controls/Compare.vue.d.ts +16 -8
  26. package/esm/coms/controls/Input.vue.d.ts +2 -0
  27. package/esm/coms/controls/Option.vue.d.ts +1 -1
  28. package/esm/coms/controls/RichText.vue.d.ts +2 -4
  29. package/esm/coms/controls/Select.vue.d.ts +1 -1
  30. package/esm/coms/controls/index.d.ts +2 -1
  31. package/esm/coms/index.d.ts +1 -0
  32. package/esm/coms/layouts/Col.vue.d.ts +6 -8
  33. package/esm/coms/layouts/Container.vue.d.ts +12 -11
  34. package/esm/coms/layouts/Desc.vue.d.ts +2 -0
  35. package/esm/coms/layouts/Row.vue.d.ts +7 -8
  36. package/esm/coms/pagers/Index.vue.d.ts +9 -0
  37. package/esm/coms/pagers/index.d.ts +2 -0
  38. package/esm/coms/progresses/Circle.vue.d.ts +2 -0
  39. package/esm/coms/progresses/Index.vue.d.ts +9 -0
  40. package/esm/coms/progresses/SocketProgress.vue.d.ts +7 -9
  41. package/esm/coms/progresses/Spinner.vue.d.ts +20 -0
  42. package/esm/coms/progresses/index.d.ts +3 -2
  43. package/esm/coms/tables/Index.vue.d.ts +33 -0
  44. package/esm/coms/tabs/Tab.vue.d.ts +2 -2
  45. package/esm/coms/tabs/TabPane.vue.d.ts +1 -1
  46. package/esm/drivers/@types/IOpen.d.ts +1 -1
  47. package/esm/drivers/builders/BuilderFactory.d.ts +1 -1
  48. package/esm/drivers/cdns/Cdn.d.ts +7 -9
  49. package/esm/drivers/cdns/CdnFactory.d.ts +1 -1
  50. package/esm/drivers/cdns/ICdn.d.ts +2 -11
  51. package/esm/drivers/encoders/Encoder.d.ts +1 -1
  52. package/esm/drivers/encoders/EncoderFactory.d.ts +3 -2
  53. package/esm/drivers/encoders/IEncoder.d.ts +2 -5
  54. package/esm/drivers/encoders/implement/Base64Encoder.d.ts +1 -1
  55. package/esm/drivers/encoders/implement/UrlEncoder.d.ts +7 -0
  56. package/esm/drivers/excels/Excel.d.ts +1 -1
  57. package/esm/drivers/excels/ExcelFactory.d.ts +1 -1
  58. package/esm/drivers/excels/implements/XlsxExcel.d.ts +1 -1
  59. package/esm/drivers/explainers/ExplainerFactory.d.ts +2 -2
  60. package/esm/drivers/features/FeatureFactory.d.ts +2 -2
  61. package/esm/drivers/features/IFeature.d.ts +2 -6
  62. package/esm/drivers/features/implements/ExpressionFeature.d.ts +1 -1
  63. package/esm/drivers/features/implements/I18NFeature.d.ts +1 -1
  64. package/esm/drivers/features/implements/SortFeature.d.ts +1 -1
  65. package/esm/drivers/hashers/Hasher.d.ts +1 -1
  66. package/esm/drivers/hashers/HasherFactory.d.ts +2 -2
  67. package/esm/drivers/hashers/IHasher.d.ts +2 -5
  68. package/esm/drivers/hashers/implement/Md5Hasher.d.ts +1 -1
  69. package/esm/drivers/hashers/implement/Sha256Hasher.d.ts +1 -1
  70. package/esm/drivers/https/Http.d.ts +22 -7
  71. package/esm/drivers/https/HttpFactory.d.ts +2 -7
  72. package/esm/drivers/https/IHttp.d.ts +16 -12
  73. package/esm/drivers/https/entities/HttpModel.d.ts +12 -0
  74. package/esm/drivers/https/entities/HttpResponse.d.ts +5 -1
  75. package/esm/drivers/https/implements/DefaultHttp.d.ts +1 -1
  76. package/esm/drivers/https/implements/HaloHttp.d.ts +2 -10
  77. package/esm/drivers/https/implements/MkHttp.d.ts +2 -3
  78. package/esm/drivers/i18ns/I18n.d.ts +1 -1
  79. package/esm/drivers/i18ns/I18nFactory.d.ts +1 -1
  80. package/esm/drivers/i18ns/implements/DefaultI18n.d.ts +1 -1
  81. package/esm/drivers/index.d.ts +52 -1
  82. package/esm/drivers/messengers/MessengerFactory.d.ts +2 -2
  83. package/esm/drivers/providers/IProvider.d.ts +19 -15
  84. package/esm/drivers/providers/Provider.d.ts +11 -9
  85. package/esm/drivers/providers/ProviderFactory.d.ts +5 -9
  86. package/esm/drivers/providers/implements/CookieProvider.d.ts +8 -8
  87. package/esm/drivers/providers/implements/IndexedDbProvider.d.ts +20 -10
  88. package/esm/drivers/providers/implements/StorageProvider.d.ts +8 -8
  89. package/esm/drivers/signers/ISigner.d.ts +1 -1
  90. package/esm/drivers/signers/Signer.d.ts +1 -1
  91. package/esm/drivers/signers/SignerFactory.d.ts +2 -2
  92. package/esm/drivers/signers/implements/DefaultSigner.d.ts +1 -1
  93. package/esm/drivers/sockets/@types/SubscribedWindow.d.ts +16 -0
  94. package/esm/drivers/sockets/@types/index.d.ts +2 -0
  95. package/esm/drivers/sockets/ISocket.d.ts +39 -0
  96. package/esm/drivers/sockets/Socket.d.ts +17 -0
  97. package/esm/drivers/sockets/SocketFactory.d.ts +13 -0
  98. package/esm/drivers/sockets/entities/SocketProgress.d.ts +34 -0
  99. package/esm/drivers/sockets/entities/SocketResponse.d.ts +26 -0
  100. package/esm/drivers/sockets/entities/index.d.ts +3 -0
  101. package/esm/drivers/sockets/implement/DefaultSocket.d.ts +37 -0
  102. package/esm/drivers/sockets/index.d.ts +4 -0
  103. package/esm/drivers/ssos/ISso.d.ts +1 -1
  104. package/esm/drivers/ssos/Sso.d.ts +1 -1
  105. package/esm/drivers/ssos/SsoFactory.d.ts +2 -2
  106. package/esm/drivers/ssos/implements/AnonymousSso.d.ts +1 -1
  107. package/esm/drivers/ssos/implements/BearerSso.d.ts +1 -1
  108. package/esm/drivers/ssos/implements/NioSso.d.ts +1 -1
  109. package/esm/drivers/ssos/implements/SecretSso.d.ts +1 -1
  110. package/esm/drivers/ssos/implements/WeiXinSso.d.ts +1 -1
  111. package/esm/drivers/tasks/ITask.d.ts +10 -3
  112. package/esm/drivers/tasks/Task.d.ts +2 -1
  113. package/esm/drivers/tasks/TaskFactory.d.ts +2 -2
  114. package/esm/drivers/tasks/implement/MemoryTask.d.ts +5 -3
  115. package/esm/drivers/templates/TemplateFactory.d.ts +2 -2
  116. package/esm/drivers/util/@types/JsonConfig.d.ts +10 -0
  117. package/esm/drivers/util/@types/TreeNodeProp.d.ts +9 -0
  118. package/esm/drivers/util/@types/index.d.ts +3 -0
  119. package/esm/drivers/util/IUtil.d.ts +8 -0
  120. package/esm/drivers/util/Util.d.ts +8 -0
  121. package/esm/drivers/util/UtilFactory.d.ts +32 -0
  122. package/esm/drivers/util/implements/ArrayUtil.d.ts +123 -0
  123. package/esm/drivers/util/implements/BrowserUtil.d.ts +12 -0
  124. package/esm/drivers/util/implements/ComponentUtil.d.ts +20 -0
  125. package/esm/drivers/util/implements/DictionaryUtil.d.ts +40 -0
  126. package/esm/drivers/util/implements/DomUtil.d.ts +118 -0
  127. package/esm/drivers/util/implements/EventUtil.d.ts +32 -0
  128. package/esm/drivers/util/implements/FileUtil.d.ts +24 -0
  129. package/esm/drivers/util/implements/HtmlUtil.d.ts +16 -0
  130. package/esm/drivers/util/implements/ImageUtil.d.ts +12 -0
  131. package/esm/drivers/util/implements/JsonUtil.d.ts +58 -0
  132. package/esm/drivers/util/implements/MathUtil.d.ts +52 -0
  133. package/esm/drivers/util/implements/MicroUtil.d.ts +12 -0
  134. package/esm/drivers/util/implements/MountUtil.d.ts +16 -0
  135. package/esm/drivers/util/implements/ObjectUtil.d.ts +44 -0
  136. package/esm/drivers/util/implements/ScrollUtil.d.ts +16 -0
  137. package/esm/drivers/util/implements/SignUtil.d.ts +16 -0
  138. package/esm/drivers/util/implements/StringUtil.d.ts +104 -0
  139. package/esm/drivers/util/implements/TaskUtil.d.ts +28 -0
  140. package/esm/drivers/util/implements/TimeUtil.d.ts +72 -0
  141. package/esm/drivers/util/implements/TreeUtil.d.ts +56 -0
  142. package/esm/drivers/util/implements/TypeUtil.d.ts +28 -0
  143. package/esm/drivers/util/implements/UrlUtil.d.ts +90 -0
  144. package/esm/drivers/util/index.d.ts +24 -0
  145. package/esm/drivers/utilities/IUtility.d.ts +3 -0
  146. package/esm/drivers/utilities/Utility.d.ts +3 -0
  147. package/esm/drivers/utilities/UtilityFactory.d.ts +6 -6
  148. package/esm/drivers/utilities/implement/EventUtility.d.ts +3 -6
  149. package/esm/drivers/utilities/implement/SaveUtility.d.ts +48 -3
  150. package/esm/drivers/videos/VideoFactory.d.ts +2 -2
  151. package/esm/drivers/voices/VoiceFactory.d.ts +2 -2
  152. package/esm/factory/Factories.d.ts +99 -0
  153. package/esm/factory/Factory.d.ts +41 -0
  154. package/esm/factory/IFactory.d.ts +40 -0
  155. package/esm/factory/Utils.d.ts +29 -0
  156. package/esm/factory/index.d.ts +4 -0
  157. package/esm/factorying/Factories.d.ts +9 -5
  158. package/esm/factorying/Factory.d.ts +7 -10
  159. package/esm/factorying/IFactory.d.ts +7 -3
  160. package/esm/factorying/Utils.d.ts +24 -9
  161. package/esm/factorying/index.d.ts +7 -2
  162. package/esm/main.d.ts +1 -2
  163. package/esm/repos/Repo.d.ts +5 -0
  164. package/esm/repos/RepoFactory.d.ts +20 -1
  165. package/esm/repos/implements/PageRepo.d.ts +30 -0
  166. package/esm/repos/implements/QueryRepo.d.ts +64 -0
  167. package/esm/repos/implements/SettingRepo.d.ts +1 -0
  168. package/esm/repos/index.d.ts +10 -1
  169. package/esm/svcs/SvcFactory.d.ts +1 -1
  170. package/esm/svcs/implement/ConfigSvc.d.ts +8 -8
  171. package/esm/svcs/implement/DriverSvc.d.ts +1 -35
  172. package/esm/svcs/index.d.ts +6 -17
  173. package/package.json +10 -10
@@ -1,6 +1,5 @@
1
1
  import Http from "../Http";
2
2
  import HttpRequest from "../entities/HttpRequest";
3
- import HttpResponse from "../entities/HttpResponse";
4
3
  import { ISso, SsoUser } from "../../ssos";
5
4
  import { ISigner } from "../../signers";
6
5
  /**
@@ -36,15 +35,8 @@ declare class HaloHttp extends Http {
36
35
  * 单点登录配置
37
36
  */
38
37
  signer: ISigner;
39
- open: (conn: string) => Promise<void>;
40
- /**
41
- * 发送请求
42
- */
43
- send: (request: HttpRequest) => Promise<HttpResponse>;
44
- /**
45
- * 请求预处理
46
- */
47
- beforeRequest: (request: HttpRequest) => Promise<void>;
38
+ openAsync: (conn: string) => Promise<void>;
39
+ prepareAsync: (request: HttpRequest, variables: string[]) => Promise<void>;
48
40
  /**
49
41
  * 处理网络错误和响应错误场景
50
42
  */
@@ -1,6 +1,5 @@
1
1
  import Http from "../Http";
2
2
  import HttpRequest from "../entities/HttpRequest";
3
- import HttpResponse from "../entities/HttpResponse";
4
3
  import { IHasher } from "../../hashers";
5
4
  /**
6
5
  * MK请求器
@@ -26,10 +25,10 @@ declare class MkHttp extends Http {
26
25
  /**
27
26
  * 危险操作,会暴露敏感信息
28
27
  */
29
- open: (conn: string) => Promise<void>;
28
+ openAsync: (conn: string) => Promise<void>;
30
29
  /**
31
30
  * 危险操作,会暴露敏感信息
32
31
  */
33
- send: (request: HttpRequest) => Promise<HttpResponse>;
32
+ prepareAsync: (request: HttpRequest, variables: string[]) => Promise<void>;
34
33
  }
35
34
  export default MkHttp;
@@ -12,7 +12,7 @@ declare abstract class I18n implements II18n {
12
12
  * 已加载的语言集合
13
13
  */
14
14
  loaded: string[];
15
- open(conn?: string): Promise<void>;
15
+ openAsync(conn?: string): Promise<void>;
16
16
  t: (key: string, params?: any) => string;
17
17
  abstract translate(key: string, params: any): string;
18
18
  abstract t_exists(key: string): boolean;
@@ -1,4 +1,4 @@
1
- import Factory from "../../factorying/Factory";
1
+ import Factory from "../../factory/Factory";
2
2
  import II18n from "./II18n";
3
3
  /**
4
4
  * 多语言工厂
@@ -5,7 +5,7 @@ import I18n from "../I18n";
5
5
  */
6
6
  declare class DefaultI18n extends I18n {
7
7
  type: string;
8
- open(conn?: string): Promise<void>;
8
+ openAsync(conn?: string): Promise<void>;
9
9
  translate: (key: string, params?: any) => string;
10
10
  t_exists: (key: string) => boolean;
11
11
  load: (lang: string) => Promise<void>;
@@ -1,3 +1,53 @@
1
+ import { IEncoder } from "./encoders";
2
+ import { ICdn } from "./cdns";
3
+ import { IHttp } from "./https";
4
+ import { II18n } from "./i18ns";
5
+ import { IHasher } from "./hashers";
6
+ import { ISocket } from "./sockets";
7
+ import { ITemplate } from "./templates";
8
+ import { IMessenger } from "./messengers";
9
+ import { CreateFeOptions } from "../@types";
10
+ /**
11
+ * 默认base64编码
12
+ */
13
+ declare let base64: IEncoder;
14
+ /**
15
+ * CDN加载器
16
+ */
17
+ declare let cdn: ICdn;
18
+ /**
19
+ * 默认Http请求对象
20
+ */
21
+ declare let http: IHttp;
22
+ /**
23
+ * 多语言翻译对象
24
+ */
25
+ declare let i18n: II18n;
26
+ /**
27
+ * MD5 hash计算
28
+ */
29
+ declare let md5: IHasher;
30
+ /**
31
+ * Socket通信
32
+ */
33
+ declare let socket: ISocket;
34
+ /**
35
+ * 默认模板引擎
36
+ */
37
+ declare let template: ITemplate;
38
+ /**
39
+ * 初始化消息对象,保证后续更新能够被同步更新
40
+ */
41
+ declare let messenger: IMessenger;
42
+ /**
43
+ * 初始化默认驱动实例
44
+ */
45
+ declare let initDriverAsync: (options: CreateFeOptions) => Promise<void>;
46
+ /**
47
+ * 提取可导出的翻译方法,当i18n实例变化后,导出的方案会跟着变化?
48
+ */
49
+ declare let t: typeof i18n.t, t_exists: typeof i18n.t_exists, t_sys: typeof i18n.t_sys, t_enum: typeof i18n.t_enum, t_field: typeof i18n.t_field, t_field_choose_placeholder: typeof i18n.t_field_choose_placeholder, t_field_placeholder: typeof i18n.t_field_placeholder, t_table: typeof i18n.t_table, t_module: typeof i18n.t_module, t_menu: typeof i18n.t_menu;
50
+ export { base64, cdn, http, i18n, md5, socket, template, messenger, initDriverAsync, t, t_exists, t_sys, t_enum, t_field, t_field_choose_placeholder, t_field_placeholder, t_table, t_module, t_menu };
1
51
  export * from "./@types";
2
52
  export * from "./bridges";
3
53
  export * from "./builders";
@@ -7,15 +57,16 @@ export * from "./excels";
7
57
  export * from "./explainers";
8
58
  export * from "./features";
9
59
  export * from "./hashers";
10
- export * from "./helpers";
11
60
  export * from "./https";
12
61
  export * from "./i18ns";
13
62
  export * from "./messengers";
14
63
  export * from "./providers";
15
64
  export * from "./signers";
65
+ export * from "./sockets";
16
66
  export * from "./ssos";
17
67
  export * from "./tasks";
18
68
  export * from "./templates";
69
+ export * from "./util";
19
70
  export * from "./utilities";
20
71
  export * from "./videos";
21
72
  export * from "./voices";
@@ -1,10 +1,10 @@
1
- import Factory from "../../factorying/Factory";
1
+ import Factory from "../../factory/Factory";
2
2
  import IMessenger from "./IMessenger";
3
3
  /**
4
4
  * 消息工厂
5
5
  */
6
6
  declare class MessengerFactory extends Factory<IMessenger> {
7
- get instances(): IMessenger[];
7
+ open(): void;
8
8
  /**
9
9
  * 获取控制台消息提示类型
10
10
  */
@@ -1,48 +1,52 @@
1
- import { IDriver } from "../@types";
1
+ import { IDriver, IOpen } from "../@types";
2
2
  /**
3
3
  * 数据库提供程序接口
4
4
  */
5
- interface IProvider extends IDriver {
5
+ interface IProvider extends IDriver, IOpen {
6
6
  /**
7
7
  * 类型
8
8
  */
9
9
  type: string;
10
10
  /**
11
- * 开启数据库驱动
11
+ * 创建指定仓储,不指定行内key路径
12
12
  */
13
- openAsync(conn: string): Promise<number>;
13
+ createAsync(table: string): Promise<any>;
14
14
  /**
15
- * 创建指定仓储,不指定行内key路径
15
+ * 查询强类型数据
16
16
  */
17
- createAsync(store: string): Promise<any>;
17
+ getEntity<T>(table: string, key: any): Promise<T>;
18
18
  /**
19
19
  * 查询数据
20
20
  */
21
- getAsync(id: any): Promise<any>;
21
+ getAsync(table: string, key: any): Promise<any>;
22
22
  /**
23
- * 查询强类型数据
23
+ * 获取所有key
24
24
  */
25
- getEntity<T>(id: any): Promise<T>;
25
+ getKeysAsync(table: string): Promise<any[]>;
26
26
  /**
27
27
  * 添加数据
28
28
  */
29
- insertAsync(id: any, entity: any): Promise<any>;
29
+ insertAsync(table: string, key: any, entity: any): Promise<any>;
30
30
  /**
31
31
  * 修改数据
32
32
  */
33
- updateAsync(id: any, entity: any): Promise<any>;
33
+ updateAsync(table: string, key: any, entity: any): Promise<any>;
34
+ /**
35
+ * 保存强类型
36
+ */
37
+ saveEntity<T>(table: string, key: any, entity: T): Promise<any>;
34
38
  /**
35
39
  * 保存数据,entity中的id会被自动赋值成id,所以entity的id属性将不再能使用
36
40
  */
37
- saveAsync(id: any, entity: any): Promise<any>;
41
+ saveAsync(table: string, key: any, entity: any): Promise<any>;
38
42
  /**
39
- * 保存强类型
43
+ * 替换指定key的数据,到新key上,并返回替换后的数据
40
44
  */
41
- saveEntity<T>(id: any, entity: T): Promise<any>;
45
+ replaceEntityAsync(table: string, key: any, newKey: any): Promise<void>;
42
46
  /**
43
47
  * 删除数据
44
48
  */
45
- deleteAsync(id: any): Promise<any>;
49
+ deleteAsync(table: string, key: any): Promise<any>;
46
50
  /**
47
51
  * 提交事务
48
52
  */
@@ -4,15 +4,17 @@ import IProvider from "./IProvider";
4
4
  */
5
5
  declare abstract class Provider implements IProvider {
6
6
  type: string;
7
- abstract createAsync(store: string): Promise<any>;
8
- abstract deleteAsync(id: any): Promise<any>;
9
- abstract getAsync(id: any): Promise<any>;
10
- abstract getEntity<T>(id: any): Promise<T>;
11
- abstract insertAsync(id: any, entity: any): Promise<any>;
12
- abstract openAsync(conn: string): Promise<number>;
13
- abstract saveAsync(id: any, entity: any): Promise<any>;
14
- abstract saveEntity<T>(id: any, entity: T): Promise<any>;
15
- abstract updateAsync(id: any, entity: any): Promise<any>;
7
+ openAsync(conn: string): Promise<void>;
8
+ abstract createAsync(kind: string): Promise<any>;
9
+ abstract deleteAsync(kind: string, key: any): Promise<any>;
10
+ abstract getEntity<T>(kind: string, key: any): Promise<T>;
11
+ abstract getAsync(kind: string, key: any): Promise<any>;
12
+ abstract getKeysAsync(table: string): Promise<any[]>;
13
+ abstract insertAsync(kind: string, key: any, entity: any): Promise<any>;
14
+ abstract updateAsync(kind: string, key: any, entity: any): Promise<any>;
15
+ abstract saveEntity<T>(kind: string, key: any, entity: T): Promise<any>;
16
+ abstract saveAsync(kind: string, key: any, entity: any): Promise<any>;
17
+ replaceEntityAsync(table: string, key: any, newKey: any): Promise<void>;
16
18
  abstract commit(): void;
17
19
  abstract dispose(): void;
18
20
  }
@@ -1,22 +1,18 @@
1
1
  import IProvider from "./IProvider";
2
- import Factory from "../../factorying/Factory";
2
+ import Factory from "../../factory/Factory";
3
3
  /**
4
4
  * 数据库提供程序工厂类
5
5
  */
6
6
  declare class ProviderFactory extends Factory<IProvider> {
7
- get instances(): IProvider[];
8
- /**
9
- * 获取指定类型的提供程序
10
- */
11
- createAsync(type: string, conn?: string): Promise<IProvider>;
7
+ open(): void;
12
8
  private _default;
13
9
  /**
14
- * 获取并开启默认驱动程序
10
+ * 获取默认驱动程序,并自动决定创建指定名称的仓储
15
11
  */
16
- getDefault(store: string): Promise<IProvider>;
12
+ getDefaultAsync(table: string): Promise<IProvider>;
17
13
  /**
18
14
  * 获取默认Storage提供程序
19
15
  */
20
- getStorage(): Promise<IProvider>;
16
+ get storage(): IProvider;
21
17
  }
22
18
  export default ProviderFactory;
@@ -5,14 +5,14 @@ import Provider from "../Provider";
5
5
  declare class CookieProvider extends Provider {
6
6
  type: string;
7
7
  openAsync(conn: string): Promise<number>;
8
- createAsync(store: string): Promise<any>;
9
- deleteAsync(id: any): Promise<any>;
10
- getAsync(id: any): Promise<any>;
11
- getEntity<T>(id: any): Promise<T>;
12
- saveEntity<T>(id: any, entity: T): Promise<any>;
13
- insertAsync(id: any, entity: any): Promise<any>;
14
- saveAsync(id: any, entity: any): Promise<any>;
15
- updateAsync(id: any, entity: any): Promise<any>;
8
+ createAsync(kind: string): Promise<any>;
9
+ deleteAsync(kind: string, key: any): Promise<any>;
10
+ getAsync(kind: string, key: any): Promise<any>;
11
+ getEntity<T>(kind: string, key: any): Promise<T>;
12
+ insertAsync(kind: string, key: any, entity: any): Promise<any>;
13
+ saveEntity<T>(kind: string, key: any, entity: T): Promise<any>;
14
+ saveAsync(kind: string, key: any, entity: any): Promise<any>;
15
+ updateAsync(kind: string, key: any, entity: any): Promise<any>;
16
16
  commit(): void;
17
17
  dispose(): void;
18
18
  }
@@ -4,12 +4,17 @@ import Provider from "../Provider";
4
4
  */
5
5
  declare class IndexedDbProvider extends Provider {
6
6
  type: string;
7
- database: string;
8
- store: string;
9
7
  /**
10
8
  * 静态版本,保证所有数据库实例拿到最新版本信息
11
9
  */
12
10
  static version: number;
11
+ /**
12
+ * 当前数据库名
13
+ */
14
+ database: string;
15
+ /**
16
+ * 当前存在的仓储名集合
17
+ */
13
18
  objectStoreNames: DOMStringList;
14
19
  /**
15
20
  * 进行数据库初始化 或 从现有数据库中得到最新版本号(数据库首次初始化和open是版本号升级时,会触发升级事件)
@@ -18,33 +23,38 @@ declare class IndexedDbProvider extends Provider {
18
23
  /**
19
24
  * 保证创建存储Store
20
25
  */
21
- createAsync(store: string): Promise<any>;
26
+ createAsync(table: string): Promise<any>;
22
27
  /**
23
28
  * 打开数据库(不升级,用于执行命令)
24
29
  */
25
30
  openDbAsync(): Promise<IDBDatabase>;
31
+ /**
32
+ * 开启事务
33
+ */
34
+ openTransAsync(table: string, mode: string, db: IDBDatabase): Promise<IDBTransaction>;
35
+ getEntity<T>(table: string, id: any): Promise<T>;
26
36
  /**
27
37
  * 查询数据
28
38
  */
29
- getAsync(id: any): Promise<any>;
30
- getEntity<T>(id: any): Promise<T>;
39
+ getAsync(table: string, key: any): Promise<any>;
40
+ getKeysAsync(table: string): Promise<any[]>;
31
41
  /**
32
42
  * 添加数据
33
43
  */
34
- insertAsync(id: any, entity: any): Promise<any>;
44
+ insertAsync(table: string, key: any, entity: any): Promise<any>;
35
45
  /**
36
46
  * 修改数据
37
47
  */
38
- updateAsync(id: any, entity: any): Promise<any>;
48
+ updateAsync(table: string, key: any, entity: any): Promise<any>;
49
+ saveEntity<T>(table: string, key: any, entity: T): Promise<any>;
39
50
  /**
40
51
  * 保存数据,支持代理对象保存
41
52
  */
42
- saveAsync(id: any, entity: any): Promise<any>;
43
- saveEntity<T>(id: any, entity: T): Promise<any>;
53
+ saveAsync(table: string, key: any, entity: any): Promise<any>;
44
54
  /**
45
55
  * 删除数据
46
56
  */
47
- deleteAsync(id: any): Promise<any>;
57
+ deleteAsync: (table: string, key: any) => Promise<any>;
48
58
  /**
49
59
  * 提交事务
50
60
  */
@@ -5,14 +5,14 @@ import Provider from "../Provider";
5
5
  declare class StorageProvider extends Provider {
6
6
  type: string;
7
7
  openAsync(conn: string): Promise<number>;
8
- createAsync(store: string): Promise<any>;
9
- getAsync(id: any): Promise<any>;
10
- getEntity<T>(key: string): Promise<T>;
11
- insertAsync(id: any, entity: any): Promise<any>;
12
- saveAsync(id: any, entity: any): Promise<any>;
13
- saveEntity<T>(id: any, entity: T): Promise<any>;
14
- updateAsync(id: any, entity: any): Promise<any>;
15
- deleteAsync(id: any): Promise<any>;
8
+ createAsync(kind: string): Promise<any>;
9
+ getAsync(kind: string, key: any): Promise<any>;
10
+ getEntity<T>(kind: string, key: string): Promise<T>;
11
+ insertAsync(kind: string, key: any, entity: any): Promise<any>;
12
+ saveEntity<T>(kind: string, key: any, entity: T): Promise<any>;
13
+ saveAsync(kind: string, key: any, entity: any): Promise<any>;
14
+ updateAsync(kind: string, key: any, entity: any): Promise<any>;
15
+ deleteAsync(kind: string, key: any): Promise<any>;
16
16
  commit(): void;
17
17
  dispose(): void;
18
18
  /**
@@ -9,7 +9,7 @@ interface ISigner {
9
9
  /**
10
10
  * 开启连接
11
11
  */
12
- open(auth: {
12
+ openAsync(auth: {
13
13
  url: string;
14
14
  app_id: string;
15
15
  }): Promise<void>;
@@ -4,7 +4,7 @@ import ISigner from "./ISigner";
4
4
  */
5
5
  declare abstract class Signer implements ISigner {
6
6
  type: string;
7
- abstract open(auth: {
7
+ abstract openAsync(auth: {
8
8
  url: string;
9
9
  app_id: string;
10
10
  }): Promise<void>;
@@ -1,10 +1,10 @@
1
1
  import ISigner from "./ISigner";
2
- import Factory from "../../factorying/Factory";
2
+ import Factory from "../../factory/Factory";
3
3
  /**
4
4
  * 签名工厂类
5
5
  */
6
6
  declare class SignerFactory extends Factory<ISigner> {
7
- get instances(): ISigner[];
7
+ open(): void;
8
8
  /**
9
9
  * 获取指定签名实例
10
10
  */
@@ -4,7 +4,7 @@ import Signer from "../Signer";
4
4
  */
5
5
  declare class DefaultSigner extends Signer {
6
6
  type: string;
7
- open(auth: {
7
+ openAsync(auth: {
8
8
  url: string;
9
9
  app_id: string;
10
10
  }): Promise<void>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 订阅的窗口消息类型
3
+ */
4
+ interface SubscribedWindow {
5
+ /**
6
+ * 窗口ID
7
+ */
8
+ [win: string]: {
9
+ /**
10
+ * 键:消息类别
11
+ * 值:消息类型集合,一次可订阅多个
12
+ */
13
+ [kind: string]: string[];
14
+ };
15
+ }
16
+ export default SubscribedWindow;
@@ -0,0 +1,2 @@
1
+ import SubscribedWindow from "./SubscribedWindow";
2
+ export { type SubscribedWindow };
@@ -0,0 +1,39 @@
1
+ import { IDriver, IOpen } from "../@types";
2
+ /**
3
+ * Socket接口
4
+ */
5
+ interface ISocket extends IDriver, IOpen {
6
+ /**
7
+ * 是否已连接(空表示不需连接)
8
+ */
9
+ connected: boolean;
10
+ /**
11
+ * Socket消息处理程序
12
+ */
13
+ handler: (event: MessageEvent) => void;
14
+ /**
15
+ * 登录后,开启Socket连接
16
+ */
17
+ connect(): Promise<void>;
18
+ /**
19
+ * 订阅多个消息类型,并缓存到订阅池
20
+ */
21
+ subscribe(win: string, kind: string, type: string | string[]): Promise<any>;
22
+ /**
23
+ * 重连时,重新订阅
24
+ */
25
+ resubscribe(): Promise<void>;
26
+ /**
27
+ * 取消订阅该窗口 所有Socket事件处理程序,防止内存泄漏
28
+ */
29
+ unsubscribe(win: string): Promise<any>;
30
+ /**
31
+ * 发送消息
32
+ */
33
+ send(data: any): void;
34
+ /**
35
+ * 释放连接
36
+ */
37
+ dispose(): void;
38
+ }
39
+ export default ISocket;
@@ -0,0 +1,17 @@
1
+ import ISocket from "./ISocket";
2
+ import { SubscribedWindow } from "./@types";
3
+ /**
4
+ * Socket基类
5
+ */
6
+ declare class Socket implements ISocket {
7
+ /**
8
+ * 已订阅的消息类型列表
9
+ */
10
+ subscribed: SubscribedWindow;
11
+ openAsync(conn?: string): Promise<void>;
12
+ subscribe(win: string, kind: string, type: string | string[]): Promise<any>;
13
+ resubscribe(): Promise<void>;
14
+ unsubscribe(win: string): Promise<any>;
15
+ abstract send(data: any): void;
16
+ }
17
+ export default Socket;
@@ -0,0 +1,13 @@
1
+ import Factory from "../../factory/Factory";
2
+ import ISocket from "./ISocket";
3
+ /**
4
+ * Socket工厂
5
+ */
6
+ declare class SocketFactory extends Factory<ISocket> {
7
+ open(): void;
8
+ /**
9
+ * 默认通信对象
10
+ */
11
+ get default(): ISocket;
12
+ }
13
+ export default SocketFactory;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Socket进度消息
3
+ */
4
+ declare class SocketProgress<T> {
5
+ /**
6
+ * 成功数量
7
+ */
8
+ succeed: number;
9
+ /**
10
+ * 异常数量
11
+ */
12
+ errored: number;
13
+ /**
14
+ * 已处理数量
15
+ */
16
+ handled: number;
17
+ /**
18
+ * 总数量
19
+ */
20
+ total: number;
21
+ /**
22
+ * 当前消息体
23
+ */
24
+ current: T;
25
+ /**
26
+ * 增加成功进度
27
+ */
28
+ success(current: T): void;
29
+ /**
30
+ * 增加异常进度
31
+ */
32
+ error(current: T, message: string): void;
33
+ }
34
+ export default SocketProgress;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Socket响应消息
3
+ */
4
+ interface SocketResponse<T> {
5
+ /**
6
+ * 是否执行成功
7
+ */
8
+ ok: boolean;
9
+ /**
10
+ * 异常消息
11
+ */
12
+ message: string;
13
+ /**
14
+ * 消息类别
15
+ */
16
+ king: string;
17
+ /**
18
+ * 消息类型
19
+ */
20
+ type: string;
21
+ /**
22
+ * 数据体
23
+ */
24
+ data: T;
25
+ }
26
+ export default SocketResponse;
@@ -0,0 +1,3 @@
1
+ import SocketProgress from "./SocketProgress";
2
+ import SocketResponse from "./SocketResponse";
3
+ export { SocketProgress, type SocketResponse, };
@@ -0,0 +1,37 @@
1
+ import Socket from "../Socket";
2
+ /**
3
+ * 默认Socket通信工具
4
+ */
5
+ declare class DefaultSocket extends Socket {
6
+ type: string;
7
+ /**
8
+ * 通信地址
9
+ */
10
+ url: string;
11
+ /**
12
+ * socket连接对象
13
+ */
14
+ socket: WebSocket;
15
+ /**
16
+ * 是否已连接(空表示不需连接)
17
+ */
18
+ connected: boolean;
19
+ /**
20
+ * 是否需要自动重新连接
21
+ */
22
+ reconnect: boolean;
23
+ /**
24
+ * Socket消息处理程序
25
+ */
26
+ handler: (event: MessageEvent) => void;
27
+ connect(): Promise<void>;
28
+ /**
29
+ * 发送消息
30
+ */
31
+ send(data: any): void;
32
+ /**
33
+ * 退出时断开连接
34
+ */
35
+ dispose(): void;
36
+ }
37
+ export default DefaultSocket;
@@ -0,0 +1,4 @@
1
+ import ISocket from "./ISocket";
2
+ import SocketFactory from "./SocketFactory";
3
+ export * from "./entities";
4
+ export { type ISocket, SocketFactory };
@@ -7,7 +7,7 @@ interface ISso extends IDriver {
7
7
  /**
8
8
  * 开启连接
9
9
  */
10
- open(auth: {
10
+ openAsync(auth: {
11
11
  url: string;
12
12
  app_id: string;
13
13
  }): Promise<void>;