halo-fe 1.0.25 → 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 +3482 -3071
- package/dist/style.css +1 -1
- 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 +8 -0
- package/esm/coms/@types/TableEmit.d.ts +10 -0
- package/esm/coms/@types/TableProps.d.ts +14 -2
- package/esm/coms/@types/index.d.ts +4 -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 +15 -25
- package/esm/coms/layouts/Row.vue.d.ts +2 -1
- package/esm/coms/pagers/Index.vue.d.ts +8 -1
- package/esm/coms/pagers/index.d.ts +2 -2
- package/esm/coms/progresses/Circle.vue.d.ts +2 -0
- package/esm/coms/progresses/Index.vue.d.ts +6 -3
- package/esm/coms/progresses/Spinner.vue.d.ts +20 -0
- package/esm/coms/progresses/index.d.ts +2 -1
- package/esm/coms/tables/Index.vue.d.ts +22 -3
- 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 +1 -1
- package/esm/drivers/cdns/CdnFactory.d.ts +1 -1
- package/esm/drivers/cdns/ICdn.d.ts +2 -6
- package/esm/drivers/encoders/Encoder.d.ts +1 -1
- package/esm/drivers/encoders/EncoderFactory.d.ts +2 -2
- package/esm/drivers/encoders/IEncoder.d.ts +2 -5
- package/esm/drivers/encoders/implement/Base64Encoder.d.ts +1 -1
- 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 +10 -6
- package/esm/drivers/https/HttpFactory.d.ts +2 -7
- package/esm/drivers/https/IHttp.d.ts +12 -12
- 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 +1 -1
- package/esm/drivers/https/implements/MkHttp.d.ts +1 -1
- 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 +50 -0
- 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 +7 -3
- package/esm/drivers/sockets/Socket.d.ts +10 -1
- package/esm/drivers/sockets/SocketFactory.d.ts +1 -1
- 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 +0 -2
- package/esm/drivers/sockets/index.d.ts +3 -1
- 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 +7 -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/UtilFactory.d.ts +1 -1
- package/esm/drivers/util/implements/ArrayUtil.d.ts +5 -5
- package/esm/drivers/util/implements/EventUtil.d.ts +6 -6
- package/esm/drivers/util/implements/JsonUtil.d.ts +5 -0
- package/esm/drivers/util/implements/SignUtil.d.ts +1 -1
- package/esm/drivers/util/implements/StringUtil.d.ts +1 -1
- 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/Factory.d.ts +3 -3
- package/esm/factorying/IFactory.d.ts +1 -1
- 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 +9 -9
- package/esm/svcs/implement/DriverSvc.d.ts +1 -35
- package/esm/svcs/index.d.ts +6 -15
- package/package.json +9 -9
@@ -20,19 +20,23 @@ declare abstract class Http implements IHttp {
|
|
20
20
|
* 编码器
|
21
21
|
*/
|
22
22
|
encoder: IEncoder;
|
23
|
-
|
23
|
+
/**
|
24
|
+
* 原型方法,保证子类可以通过super调用
|
25
|
+
* VIP:箭头函数定义的是实例方法,不在原型链上,子类无法通过super调用
|
26
|
+
*/
|
27
|
+
openAsync(conn: string): Promise<void>;
|
24
28
|
get onRequest(): (request: HttpRequest) => Promise<void>;
|
25
29
|
set onRequest(value: (request: HttpRequest) => Promise<void>);
|
26
30
|
get onResponse(): (response: HttpResponse) => Promise<void>;
|
27
31
|
set onResponse(value: (response: HttpResponse) => Promise<void>);
|
28
32
|
prepareAsync(request: HttpRequest, variables: string[]): Promise<void>;
|
29
33
|
get: (path: string, params?: any) => Promise<any>;
|
30
|
-
|
34
|
+
getAsync: (path: string, params?: any) => Promise<HttpResponse>;
|
31
35
|
post: (path: string, body: any) => Promise<any>;
|
32
|
-
|
33
|
-
patch: (path: string) => Promise<any>;
|
34
|
-
|
35
|
-
|
36
|
+
postAsync: (path: string, body?: any) => Promise<HttpResponse>;
|
37
|
+
patch: (path: string, body?: any) => Promise<any>;
|
38
|
+
patchAsync: (path: string, body?: any) => Promise<HttpResponse>;
|
39
|
+
sendAsync: (request: HttpRequest) => Promise<HttpResponse>;
|
36
40
|
/**
|
37
41
|
* 获取请求消息
|
38
42
|
*/
|
@@ -1,15 +1,10 @@
|
|
1
1
|
import IHttp from "./IHttp";
|
2
|
-
import Factory from "../../
|
3
|
-
import { Ref } from "../../plugins";
|
2
|
+
import Factory from "../../factory/Factory";
|
4
3
|
/**
|
5
4
|
* 请求器工厂类
|
6
5
|
*/
|
7
6
|
declare class HttpFactory extends Factory<IHttp> {
|
8
|
-
|
9
|
-
/**
|
10
|
-
* 创建并开启
|
11
|
-
*/
|
12
|
-
createById(id: number, driverRef?: Ref<any>): Promise<IHttp>;
|
7
|
+
open(): void;
|
13
8
|
/**
|
14
9
|
* 获取默认请求器
|
15
10
|
*/
|
@@ -18,32 +18,32 @@ interface IHttp extends IDriver, IOpen {
|
|
18
18
|
*/
|
19
19
|
prepareAsync(request: HttpRequest, variables: string[]): Promise<void>;
|
20
20
|
/**
|
21
|
-
* 发送GET
|
21
|
+
* 发送GET请求,得到响应体
|
22
22
|
*/
|
23
23
|
get(path: string, params?: any): Promise<any>;
|
24
24
|
/**
|
25
|
-
* 发送GET
|
25
|
+
* 发送GET请求,得到响应
|
26
26
|
*/
|
27
|
-
|
27
|
+
getAsync(path: string, params?: any): Promise<HttpResponse>;
|
28
28
|
/**
|
29
|
-
* 发送Post
|
29
|
+
* 发送Post请求,得到响应体
|
30
30
|
*/
|
31
31
|
post(path: string, body?: any): Promise<any>;
|
32
32
|
/**
|
33
|
-
* 发送Post
|
33
|
+
* 发送Post请求,得到响应
|
34
34
|
*/
|
35
|
-
|
35
|
+
postAsync(path: string, body?: any): Promise<HttpResponse>;
|
36
36
|
/**
|
37
|
-
* 发送Patch
|
37
|
+
* 发送Patch请求,得到响应体
|
38
38
|
*/
|
39
|
-
patch(path: string,
|
39
|
+
patch(path: string, body: any): Promise<any>;
|
40
40
|
/**
|
41
|
-
* 发送Patch
|
41
|
+
* 发送Patch请求,得到响应
|
42
42
|
*/
|
43
|
-
|
43
|
+
patchAsync(path: string, body: any): Promise<HttpResponse>;
|
44
44
|
/**
|
45
|
-
*
|
45
|
+
* 发送请求,得到响应
|
46
46
|
*/
|
47
|
-
|
47
|
+
sendAsync(request: HttpRequest): Promise<HttpResponse>;
|
48
48
|
}
|
49
49
|
export default IHttp;
|
@@ -7,7 +7,7 @@ declare class HttpResponse extends HttpMessage {
|
|
7
7
|
/**
|
8
8
|
* 是否成功
|
9
9
|
*/
|
10
|
-
|
10
|
+
ok: boolean;
|
11
11
|
/**
|
12
12
|
* 错误消息
|
13
13
|
*/
|
@@ -16,6 +16,10 @@ declare class HttpResponse extends HttpMessage {
|
|
16
16
|
* 请求耗时(ms)
|
17
17
|
*/
|
18
18
|
elapsed: number;
|
19
|
+
/**
|
20
|
+
* 内容长度
|
21
|
+
*/
|
22
|
+
length: number;
|
19
23
|
/**
|
20
24
|
* 响应状态码
|
21
25
|
*/
|
@@ -14,7 +14,7 @@ declare class DefaultHttp extends Http {
|
|
14
14
|
set onRequest(value: (request: HttpRequest) => Promise<void>);
|
15
15
|
get onResponse(): (response: HttpResponse) => Promise<void>;
|
16
16
|
set onResponse(value: (response: HttpResponse) => Promise<void>);
|
17
|
-
|
17
|
+
sendAsync: (request: HttpRequest) => Promise<HttpResponse>;
|
18
18
|
/**
|
19
19
|
* 使用Fetch发送请求,谷歌插件场景专用
|
20
20
|
*/
|
@@ -35,7 +35,7 @@ declare class HaloHttp extends Http {
|
|
35
35
|
* 单点登录配置
|
36
36
|
*/
|
37
37
|
signer: ISigner;
|
38
|
-
|
38
|
+
openAsync: (conn: string) => Promise<void>;
|
39
39
|
prepareAsync: (request: HttpRequest, variables: string[]) => Promise<void>;
|
40
40
|
/**
|
41
41
|
* 处理网络错误和响应错误场景
|
@@ -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";
|
@@ -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
|
*/
|
@@ -16,11 +16,15 @@ interface ISocket extends IDriver, IOpen {
|
|
16
16
|
*/
|
17
17
|
connect(): Promise<void>;
|
18
18
|
/**
|
19
|
-
*
|
19
|
+
* 订阅多个消息类型,并缓存到订阅池
|
20
20
|
*/
|
21
|
-
subscribe(win: string, kind: string, type: string): Promise<any>;
|
21
|
+
subscribe(win: string, kind: string, type: string | string[]): Promise<any>;
|
22
22
|
/**
|
23
|
-
*
|
23
|
+
* 重连时,重新订阅
|
24
|
+
*/
|
25
|
+
resubscribe(): Promise<void>;
|
26
|
+
/**
|
27
|
+
* 取消订阅该窗口 所有Socket事件处理程序,防止内存泄漏
|
24
28
|
*/
|
25
29
|
unsubscribe(win: string): Promise<any>;
|
26
30
|
/**
|
@@ -1,8 +1,17 @@
|
|
1
1
|
import ISocket from "./ISocket";
|
2
|
+
import { SubscribedWindow } from "./@types";
|
2
3
|
/**
|
3
4
|
* Socket基类
|
4
5
|
*/
|
5
6
|
declare class Socket implements ISocket {
|
6
|
-
|
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;
|
7
16
|
}
|
8
17
|
export default Socket;
|
@@ -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;
|