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.
- package/README.md +3 -1
- package/dist/assets/{liquidjs-B8dqQyVv.js → liquidjs-C2HVw1Ra.js} +82 -81
- package/dist/main.js +4888 -4397
- package/dist/style.css +1 -1
- package/esm/@types/CreateFeOptions.d.ts +4 -0
- package/esm/coms/@types/PagerEmit.d.ts +11 -0
- package/esm/coms/@types/PagerProps.d.ts +18 -0
- package/esm/coms/@types/SocketProgressProps.d.ts +31 -0
- package/esm/coms/@types/TabProps.d.ts +11 -0
- package/esm/coms/@types/TableEmit.d.ts +10 -0
- package/esm/coms/@types/TableProps.d.ts +34 -0
- package/esm/coms/@types/index.d.ts +7 -1
- package/esm/coms/Empty.vue.d.ts +12 -10
- package/esm/coms/Fill.vue.d.ts +8 -10
- package/esm/coms/Scroller.vue.d.ts +11 -13
- package/esm/coms/Timer.vue.d.ts +7 -9
- package/esm/coms/cards/Index.vue.d.ts +16 -0
- package/esm/coms/cards/index.d.ts +2 -0
- package/esm/coms/conditions/Condition.vue.d.ts +1 -1
- package/esm/coms/conditions/Index.vue.d.ts +1 -1
- package/esm/coms/controls/@types/CodeIntelli.d.ts +6 -0
- package/esm/coms/controls/@types/CodeProps.d.ts +31 -2
- package/esm/coms/controls/@types/Range.d.ts +1 -1
- package/esm/coms/controls/Code.vue.d.ts +16 -28
- package/esm/coms/controls/Compare.vue.d.ts +16 -8
- package/esm/coms/controls/Input.vue.d.ts +2 -0
- package/esm/coms/controls/Option.vue.d.ts +1 -1
- package/esm/coms/controls/RichText.vue.d.ts +2 -4
- package/esm/coms/controls/Select.vue.d.ts +1 -1
- package/esm/coms/controls/index.d.ts +2 -1
- package/esm/coms/index.d.ts +1 -0
- package/esm/coms/layouts/Col.vue.d.ts +6 -8
- package/esm/coms/layouts/Container.vue.d.ts +12 -11
- package/esm/coms/layouts/Desc.vue.d.ts +2 -0
- package/esm/coms/layouts/Row.vue.d.ts +7 -8
- package/esm/coms/pagers/Index.vue.d.ts +9 -0
- package/esm/coms/pagers/index.d.ts +2 -0
- package/esm/coms/progresses/Circle.vue.d.ts +2 -0
- package/esm/coms/progresses/Index.vue.d.ts +9 -0
- package/esm/coms/progresses/SocketProgress.vue.d.ts +7 -9
- package/esm/coms/progresses/Spinner.vue.d.ts +20 -0
- package/esm/coms/progresses/index.d.ts +3 -2
- package/esm/coms/tables/Index.vue.d.ts +33 -0
- package/esm/coms/tabs/Tab.vue.d.ts +2 -2
- package/esm/coms/tabs/TabPane.vue.d.ts +1 -1
- package/esm/drivers/@types/IOpen.d.ts +1 -1
- package/esm/drivers/builders/BuilderFactory.d.ts +1 -1
- package/esm/drivers/cdns/Cdn.d.ts +7 -9
- package/esm/drivers/cdns/CdnFactory.d.ts +1 -1
- package/esm/drivers/cdns/ICdn.d.ts +2 -11
- package/esm/drivers/encoders/Encoder.d.ts +1 -1
- package/esm/drivers/encoders/EncoderFactory.d.ts +3 -2
- package/esm/drivers/encoders/IEncoder.d.ts +2 -5
- package/esm/drivers/encoders/implement/Base64Encoder.d.ts +1 -1
- package/esm/drivers/encoders/implement/UrlEncoder.d.ts +7 -0
- package/esm/drivers/excels/Excel.d.ts +1 -1
- package/esm/drivers/excels/ExcelFactory.d.ts +1 -1
- package/esm/drivers/excels/implements/XlsxExcel.d.ts +1 -1
- package/esm/drivers/explainers/ExplainerFactory.d.ts +2 -2
- package/esm/drivers/features/FeatureFactory.d.ts +2 -2
- package/esm/drivers/features/IFeature.d.ts +2 -6
- package/esm/drivers/features/implements/ExpressionFeature.d.ts +1 -1
- package/esm/drivers/features/implements/I18NFeature.d.ts +1 -1
- package/esm/drivers/features/implements/SortFeature.d.ts +1 -1
- package/esm/drivers/hashers/Hasher.d.ts +1 -1
- package/esm/drivers/hashers/HasherFactory.d.ts +2 -2
- package/esm/drivers/hashers/IHasher.d.ts +2 -5
- package/esm/drivers/hashers/implement/Md5Hasher.d.ts +1 -1
- package/esm/drivers/hashers/implement/Sha256Hasher.d.ts +1 -1
- package/esm/drivers/https/Http.d.ts +22 -7
- package/esm/drivers/https/HttpFactory.d.ts +2 -7
- package/esm/drivers/https/IHttp.d.ts +16 -12
- package/esm/drivers/https/entities/HttpModel.d.ts +12 -0
- package/esm/drivers/https/entities/HttpResponse.d.ts +5 -1
- package/esm/drivers/https/implements/DefaultHttp.d.ts +1 -1
- package/esm/drivers/https/implements/HaloHttp.d.ts +2 -10
- package/esm/drivers/https/implements/MkHttp.d.ts +2 -3
- package/esm/drivers/i18ns/I18n.d.ts +1 -1
- package/esm/drivers/i18ns/I18nFactory.d.ts +1 -1
- package/esm/drivers/i18ns/implements/DefaultI18n.d.ts +1 -1
- package/esm/drivers/index.d.ts +52 -1
- package/esm/drivers/messengers/MessengerFactory.d.ts +2 -2
- package/esm/drivers/providers/IProvider.d.ts +19 -15
- package/esm/drivers/providers/Provider.d.ts +11 -9
- package/esm/drivers/providers/ProviderFactory.d.ts +5 -9
- package/esm/drivers/providers/implements/CookieProvider.d.ts +8 -8
- package/esm/drivers/providers/implements/IndexedDbProvider.d.ts +20 -10
- package/esm/drivers/providers/implements/StorageProvider.d.ts +8 -8
- package/esm/drivers/signers/ISigner.d.ts +1 -1
- package/esm/drivers/signers/Signer.d.ts +1 -1
- package/esm/drivers/signers/SignerFactory.d.ts +2 -2
- package/esm/drivers/signers/implements/DefaultSigner.d.ts +1 -1
- package/esm/drivers/sockets/@types/SubscribedWindow.d.ts +16 -0
- package/esm/drivers/sockets/@types/index.d.ts +2 -0
- package/esm/drivers/sockets/ISocket.d.ts +39 -0
- package/esm/drivers/sockets/Socket.d.ts +17 -0
- package/esm/drivers/sockets/SocketFactory.d.ts +13 -0
- package/esm/drivers/sockets/entities/SocketProgress.d.ts +34 -0
- package/esm/drivers/sockets/entities/SocketResponse.d.ts +26 -0
- package/esm/drivers/sockets/entities/index.d.ts +3 -0
- package/esm/drivers/sockets/implement/DefaultSocket.d.ts +37 -0
- package/esm/drivers/sockets/index.d.ts +4 -0
- package/esm/drivers/ssos/ISso.d.ts +1 -1
- package/esm/drivers/ssos/Sso.d.ts +1 -1
- package/esm/drivers/ssos/SsoFactory.d.ts +2 -2
- package/esm/drivers/ssos/implements/AnonymousSso.d.ts +1 -1
- package/esm/drivers/ssos/implements/BearerSso.d.ts +1 -1
- package/esm/drivers/ssos/implements/NioSso.d.ts +1 -1
- package/esm/drivers/ssos/implements/SecretSso.d.ts +1 -1
- package/esm/drivers/ssos/implements/WeiXinSso.d.ts +1 -1
- package/esm/drivers/tasks/ITask.d.ts +10 -3
- package/esm/drivers/tasks/Task.d.ts +2 -1
- package/esm/drivers/tasks/TaskFactory.d.ts +2 -2
- package/esm/drivers/tasks/implement/MemoryTask.d.ts +5 -3
- package/esm/drivers/templates/TemplateFactory.d.ts +2 -2
- package/esm/drivers/util/@types/JsonConfig.d.ts +10 -0
- package/esm/drivers/util/@types/TreeNodeProp.d.ts +9 -0
- package/esm/drivers/util/@types/index.d.ts +3 -0
- package/esm/drivers/util/IUtil.d.ts +8 -0
- package/esm/drivers/util/Util.d.ts +8 -0
- package/esm/drivers/util/UtilFactory.d.ts +32 -0
- package/esm/drivers/util/implements/ArrayUtil.d.ts +123 -0
- package/esm/drivers/util/implements/BrowserUtil.d.ts +12 -0
- package/esm/drivers/util/implements/ComponentUtil.d.ts +20 -0
- package/esm/drivers/util/implements/DictionaryUtil.d.ts +40 -0
- package/esm/drivers/util/implements/DomUtil.d.ts +118 -0
- package/esm/drivers/util/implements/EventUtil.d.ts +32 -0
- package/esm/drivers/util/implements/FileUtil.d.ts +24 -0
- package/esm/drivers/util/implements/HtmlUtil.d.ts +16 -0
- package/esm/drivers/util/implements/ImageUtil.d.ts +12 -0
- package/esm/drivers/util/implements/JsonUtil.d.ts +58 -0
- package/esm/drivers/util/implements/MathUtil.d.ts +52 -0
- package/esm/drivers/util/implements/MicroUtil.d.ts +12 -0
- package/esm/drivers/util/implements/MountUtil.d.ts +16 -0
- package/esm/drivers/util/implements/ObjectUtil.d.ts +44 -0
- package/esm/drivers/util/implements/ScrollUtil.d.ts +16 -0
- package/esm/drivers/util/implements/SignUtil.d.ts +16 -0
- package/esm/drivers/util/implements/StringUtil.d.ts +104 -0
- package/esm/drivers/util/implements/TaskUtil.d.ts +28 -0
- package/esm/drivers/util/implements/TimeUtil.d.ts +72 -0
- package/esm/drivers/util/implements/TreeUtil.d.ts +56 -0
- package/esm/drivers/util/implements/TypeUtil.d.ts +28 -0
- package/esm/drivers/util/implements/UrlUtil.d.ts +90 -0
- package/esm/drivers/util/index.d.ts +24 -0
- package/esm/drivers/utilities/IUtility.d.ts +3 -0
- package/esm/drivers/utilities/Utility.d.ts +3 -0
- package/esm/drivers/utilities/UtilityFactory.d.ts +6 -6
- package/esm/drivers/utilities/implement/EventUtility.d.ts +3 -6
- package/esm/drivers/utilities/implement/SaveUtility.d.ts +48 -3
- package/esm/drivers/videos/VideoFactory.d.ts +2 -2
- package/esm/drivers/voices/VoiceFactory.d.ts +2 -2
- package/esm/factory/Factories.d.ts +99 -0
- package/esm/factory/Factory.d.ts +41 -0
- package/esm/factory/IFactory.d.ts +40 -0
- package/esm/factory/Utils.d.ts +29 -0
- package/esm/factory/index.d.ts +4 -0
- package/esm/factorying/Factories.d.ts +9 -5
- package/esm/factorying/Factory.d.ts +7 -10
- package/esm/factorying/IFactory.d.ts +7 -3
- package/esm/factorying/Utils.d.ts +24 -9
- package/esm/factorying/index.d.ts +7 -2
- package/esm/main.d.ts +1 -2
- package/esm/repos/Repo.d.ts +5 -0
- package/esm/repos/RepoFactory.d.ts +20 -1
- package/esm/repos/implements/PageRepo.d.ts +30 -0
- package/esm/repos/implements/QueryRepo.d.ts +64 -0
- package/esm/repos/implements/SettingRepo.d.ts +1 -0
- package/esm/repos/index.d.ts +10 -1
- package/esm/svcs/SvcFactory.d.ts +1 -1
- package/esm/svcs/implement/ConfigSvc.d.ts +8 -8
- package/esm/svcs/implement/DriverSvc.d.ts +1 -35
- package/esm/svcs/index.d.ts +6 -17
- 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
|
-
|
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
|
-
|
28
|
+
openAsync: (conn: string) => Promise<void>;
|
30
29
|
/**
|
31
30
|
* 危险操作,会暴露敏感信息
|
32
31
|
*/
|
33
|
-
|
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
|
-
|
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;
|
@@ -5,7 +5,7 @@ import I18n from "../I18n";
|
|
5
5
|
*/
|
6
6
|
declare class DefaultI18n extends I18n {
|
7
7
|
type: string;
|
8
|
-
|
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>;
|
package/esm/drivers/index.d.ts
CHANGED
@@ -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 "../../
|
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
|
-
|
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
|
-
|
13
|
+
createAsync(table: string): Promise<any>;
|
14
14
|
/**
|
15
|
-
*
|
15
|
+
* 查询强类型数据
|
16
16
|
*/
|
17
|
-
|
17
|
+
getEntity<T>(table: string, key: any): Promise<T>;
|
18
18
|
/**
|
19
19
|
* 查询数据
|
20
20
|
*/
|
21
|
-
getAsync(
|
21
|
+
getAsync(table: string, key: any): Promise<any>;
|
22
22
|
/**
|
23
|
-
*
|
23
|
+
* 获取所有key
|
24
24
|
*/
|
25
|
-
|
25
|
+
getKeysAsync(table: string): Promise<any[]>;
|
26
26
|
/**
|
27
27
|
* 添加数据
|
28
28
|
*/
|
29
|
-
insertAsync(
|
29
|
+
insertAsync(table: string, key: any, entity: any): Promise<any>;
|
30
30
|
/**
|
31
31
|
* 修改数据
|
32
32
|
*/
|
33
|
-
updateAsync(
|
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(
|
41
|
+
saveAsync(table: string, key: any, entity: any): Promise<any>;
|
38
42
|
/**
|
39
|
-
*
|
43
|
+
* 替换指定key的数据,到新key上,并返回替换后的数据
|
40
44
|
*/
|
41
|
-
|
45
|
+
replaceEntityAsync(table: string, key: any, newKey: any): Promise<void>;
|
42
46
|
/**
|
43
47
|
* 删除数据
|
44
48
|
*/
|
45
|
-
deleteAsync(
|
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
|
-
|
8
|
-
abstract
|
9
|
-
abstract
|
10
|
-
abstract getEntity<T>(
|
11
|
-
abstract
|
12
|
-
abstract
|
13
|
-
abstract
|
14
|
-
abstract
|
15
|
-
abstract
|
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 "../../
|
2
|
+
import Factory from "../../factory/Factory";
|
3
3
|
/**
|
4
4
|
* 数据库提供程序工厂类
|
5
5
|
*/
|
6
6
|
declare class ProviderFactory extends Factory<IProvider> {
|
7
|
-
|
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
|
-
|
12
|
+
getDefaultAsync(table: string): Promise<IProvider>;
|
17
13
|
/**
|
18
14
|
* 获取默认Storage提供程序
|
19
15
|
*/
|
20
|
-
|
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(
|
9
|
-
deleteAsync(
|
10
|
-
getAsync(
|
11
|
-
getEntity<T>(
|
12
|
-
|
13
|
-
|
14
|
-
saveAsync(
|
15
|
-
updateAsync(
|
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(
|
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(
|
30
|
-
|
39
|
+
getAsync(table: string, key: any): Promise<any>;
|
40
|
+
getKeysAsync(table: string): Promise<any[]>;
|
31
41
|
/**
|
32
42
|
* 添加数据
|
33
43
|
*/
|
34
|
-
insertAsync(
|
44
|
+
insertAsync(table: string, key: any, entity: any): Promise<any>;
|
35
45
|
/**
|
36
46
|
* 修改数据
|
37
47
|
*/
|
38
|
-
updateAsync(
|
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(
|
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(
|
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(
|
9
|
-
getAsync(
|
10
|
-
getEntity<T>(key: string): Promise<T>;
|
11
|
-
insertAsync(
|
12
|
-
|
13
|
-
|
14
|
-
updateAsync(
|
15
|
-
deleteAsync(
|
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
|
/**
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import ISigner from "./ISigner";
|
2
|
-
import Factory from "../../
|
2
|
+
import Factory from "../../factory/Factory";
|
3
3
|
/**
|
4
4
|
* 签名工厂类
|
5
5
|
*/
|
6
6
|
declare class SignerFactory extends Factory<ISigner> {
|
7
|
-
|
7
|
+
open(): void;
|
8
8
|
/**
|
9
9
|
* 获取指定签名实例
|
10
10
|
*/
|
@@ -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,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;
|