halo-fe 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. package/dist/main.js +1282 -804
  2. package/dist/style.css +1 -0
  3. package/esm/coms/Code.vue.d.ts +41 -0
  4. package/esm/coms/Col.vue.d.ts +11 -0
  5. package/esm/coms/Compare.vue.d.ts +40 -0
  6. package/esm/coms/Container.vue.d.ts +23 -0
  7. package/esm/coms/Empty.vue.d.ts +26 -0
  8. package/esm/coms/Progress.vue.d.ts +8 -0
  9. package/esm/coms/Row.vue.d.ts +21 -0
  10. package/esm/coms/index.d.ts +8 -0
  11. package/esm/coms/types/CodeEmit.d.ts +23 -0
  12. package/esm/coms/types/CodeProps.d.ts +18 -0
  13. package/esm/coms/types/RowProps.d.ts +14 -0
  14. package/esm/coms/types/index.d.ts +4 -0
  15. package/esm/drivers/cdns/CdnFactory.d.ts +1 -1
  16. package/esm/drivers/cdns/index.d.ts +2 -0
  17. package/esm/drivers/encoders/EncoderFactory.d.ts +2 -2
  18. package/esm/drivers/encoders/index.d.ts +2 -0
  19. package/esm/drivers/excels/ExcelFactory.d.ts +1 -1
  20. package/esm/drivers/excels/index.d.ts +2 -1
  21. package/esm/drivers/explainers/index.d.ts +2 -0
  22. package/esm/drivers/factories/DriverFactory.d.ts +12 -12
  23. package/esm/drivers/factories/Factory.d.ts +1 -1
  24. package/esm/drivers/factories/IFactory.d.ts +1 -1
  25. package/esm/drivers/factories/index.d.ts +13 -1
  26. package/esm/drivers/features/FeatureFactory.d.ts +1 -1
  27. package/esm/drivers/features/index.d.ts +2 -1
  28. package/esm/drivers/hashers/HasherFactory.d.ts +2 -2
  29. package/esm/drivers/hashers/index.d.ts +2 -1
  30. package/esm/drivers/https/Http.d.ts +24 -0
  31. package/esm/drivers/https/HttpFactory.d.ts +20 -0
  32. package/esm/drivers/https/IHttp.d.ts +49 -0
  33. package/esm/drivers/https/entities/HttpMessage.d.ts +32 -0
  34. package/esm/drivers/https/entities/HttpRequest.d.ts +19 -0
  35. package/esm/drivers/{requesters → https}/entities/HttpResponse.d.ts +2 -5
  36. package/esm/drivers/{requesters/implements/DefaultRequester.d.ts → https/implements/DefaultHttp.d.ts} +4 -4
  37. package/esm/drivers/https/implements/HaloHttp.d.ts +37 -0
  38. package/esm/drivers/{requesters/implements/MkRequester.d.ts → https/implements/MkHttp.d.ts} +7 -7
  39. package/esm/drivers/https/index.d.ts +6 -0
  40. package/esm/drivers/index.d.ts +8 -8
  41. package/esm/drivers/providers/ProviderFactory.d.ts +3 -3
  42. package/esm/drivers/providers/index.d.ts +2 -1
  43. package/esm/drivers/signers/ISigner.d.ts +2 -2
  44. package/esm/drivers/signers/Signer.d.ts +13 -0
  45. package/esm/drivers/signers/SignerFactory.d.ts +1 -1
  46. package/esm/drivers/signers/implements/DefaultSigner.d.ts +4 -4
  47. package/esm/drivers/signers/index.d.ts +2 -1
  48. package/esm/drivers/ssos/ISso.d.ts +1 -1
  49. package/esm/drivers/ssos/SsoFactory.d.ts +1 -1
  50. package/esm/drivers/ssos/implements/AnonymousSso.d.ts +1 -1
  51. package/esm/drivers/ssos/implements/BearerSso.d.ts +1 -3
  52. package/esm/drivers/ssos/implements/NioSso.d.ts +1 -1
  53. package/esm/drivers/ssos/implements/SecretSso.d.ts +3 -3
  54. package/esm/drivers/ssos/implements/WeiXinSso.d.ts +1 -1
  55. package/esm/drivers/ssos/index.d.ts +2 -1
  56. package/esm/helpers/json-helper.d.ts +12 -4
  57. package/esm/helpers/object-helper.d.ts +4 -0
  58. package/esm/helpers/types/index.d.ts +0 -0
  59. package/esm/helpers/url-helper.d.ts +2 -2
  60. package/esm/main.d.ts +14 -3
  61. package/esm/services/index.d.ts +6 -12
  62. package/esm/services/types/IMessage.d.ts +14 -0
  63. package/esm/services/types/IMessager.d.ts +14 -0
  64. package/esm/services/types/index.d.ts +2 -0
  65. package/esm/stores/config.d.ts +10 -6
  66. package/esm/stores/driver.d.ts +2 -6
  67. package/esm/stores/index.d.ts +3 -2
  68. package/esm/stores/setting.d.ts +0 -4
  69. package/esm/stores/user.d.ts +3 -7
  70. package/esm/utilities/AffixUtility.d.ts +10 -0
  71. package/esm/utilities/EventUtility.d.ts +30 -0
  72. package/esm/utilities/KeyboardUtility.d.ts +73 -0
  73. package/esm/utilities/MouseUtility.d.ts +24 -0
  74. package/esm/utilities/index.d.ts +4 -0
  75. package/package.json +7 -7
  76. package/dist/vendor-axios-ud9O0vdJ.js +0 -1670
  77. package/esm/drivers/driver-helper.d.ts +0 -46
  78. package/esm/drivers/requesters/IRequester.d.ts +0 -25
  79. package/esm/drivers/requesters/Requester.d.ts +0 -13
  80. package/esm/drivers/requesters/RequesterFactory.d.ts +0 -21
  81. package/esm/drivers/requesters/entities/HttpRequest.d.ts +0 -34
  82. package/esm/drivers/requesters/implements/LocalRequester.d.ts +0 -43
  83. package/esm/drivers/requesters/index.d.ts +0 -5
  84. /package/esm/{thirds → plugins}/index.d.ts +0 -0
@@ -1,12 +1,12 @@
1
- import Requester from "../Requester";
1
+ import Http from "../Http";
2
2
  import HttpRequest from "../entities/HttpRequest";
3
3
  import HttpResponse from "../entities/HttpResponse";
4
- import IRequester from "../IRequester";
5
- import IHasher from "../../hashers/IHasher";
4
+ import IHttp from "../IHttp";
5
+ import { IHasher } from "../../hashers";
6
6
  /**
7
7
  * MK请求器
8
8
  */
9
- declare class MkRequester extends Requester {
9
+ declare class MkHttp extends Http {
10
10
  type: string;
11
11
  /**
12
12
  * 基准地址
@@ -23,7 +23,7 @@ declare class MkRequester extends Requester {
23
23
  /**
24
24
  * 默认请求器
25
25
  */
26
- requester: IRequester;
26
+ requester: IHttp;
27
27
  /**
28
28
  * Hash计算器
29
29
  */
@@ -31,10 +31,10 @@ declare class MkRequester extends Requester {
31
31
  /**
32
32
  * 危险操作,会暴露敏感信息
33
33
  */
34
- open(conn: string): void;
34
+ open(conn: string): Promise<void>;
35
35
  /**
36
36
  * 危险操作,会暴露敏感信息
37
37
  */
38
38
  send(request: HttpRequest): Promise<HttpResponse>;
39
39
  }
40
- export default MkRequester;
40
+ export default MkHttp;
@@ -0,0 +1,6 @@
1
+ import HttpFactory from "./HttpFactory";
2
+ import type IHttp from "./IHttp";
3
+ import HttpRequest from "./entities/HttpRequest";
4
+ import HttpResponse from "./entities/HttpResponse";
5
+ import HaloHttp from "./implements/HaloHttp";
6
+ export { HttpFactory, IHttp, HttpRequest, HttpResponse, HaloHttp };
@@ -1,8 +1,8 @@
1
- export * from "./excels/index";
2
- export * from "./factories/index";
3
- export * from "./features/index";
4
- export * from "./hashers/index";
5
- export * from "./providers/index";
6
- export * from "./requesters/index";
7
- export * from "./signers/index";
8
- export * from "./ssos/index";
1
+ export * from "./excels";
2
+ export * from "./factories";
3
+ export * from "./features";
4
+ export * from "./hashers";
5
+ export * from "./providers";
6
+ export * from "./https";
7
+ export * from "./signers";
8
+ export * from "./ssos";
@@ -8,11 +8,11 @@ declare class ProviderFactory extends Factory<IProvider> {
8
8
  /**
9
9
  * 获取指定类型的提供程序
10
10
  */
11
- create(type: string, conn?: string): IProvider;
11
+ create(type: string, conn?: string): Promise<IProvider>;
12
12
  private _default;
13
13
  /**
14
- * 获取并开启 指定类型的驱动程序
14
+ * 获取并开启默认驱动程序
15
15
  */
16
- getDefault(type: string, store?: string): Promise<IProvider>;
16
+ getDefault(store: string): Promise<IProvider>;
17
17
  }
18
18
  export default ProviderFactory;
@@ -1,2 +1,3 @@
1
1
  import type IProvider from "./IProvider";
2
- export { IProvider, };
2
+ import ProviderFactory from "./ProviderFactory";
3
+ export { IProvider, ProviderFactory };
@@ -12,7 +12,7 @@ interface ISigner {
12
12
  open(auth: {
13
13
  url: string;
14
14
  app_id: string;
15
- }): void;
15
+ }): Promise<void>;
16
16
  /**
17
17
  * 根据回调地址获取登录地址
18
18
  */
@@ -24,7 +24,7 @@ interface ISigner {
24
24
  /**
25
25
  * 获取签名
26
26
  */
27
- getSign(userId: string, url: string, body: any, timestamp: number, secret: string): Promise<string>;
27
+ getSign(userId: string, url: string, body: string, timestamp: number, secret: string): Promise<string>;
28
28
  /**
29
29
  * 释放资源
30
30
  */
@@ -0,0 +1,13 @@
1
+ import ISigner from "./ISigner";
2
+ declare abstract class Signer implements ISigner {
3
+ type: string;
4
+ abstract open(auth: {
5
+ url: string;
6
+ app_id: string;
7
+ }): Promise<void>;
8
+ abstract callback(token: string): void;
9
+ abstract getSign(userId: string, url: string, body: string, timestamp: number, secret: string): Promise<string>;
10
+ abstract loginUrl(callback: string): string;
11
+ abstract dispose(): any;
12
+ }
13
+ export default Signer;
@@ -8,6 +8,6 @@ declare class SignerFactory extends Factory<ISigner> {
8
8
  /**
9
9
  * 获取指定签名实例
10
10
  */
11
- create(type: string, conn?: string): ISigner;
11
+ create(type: string, conn?: string): Promise<ISigner>;
12
12
  }
13
13
  export default SignerFactory;
@@ -1,17 +1,17 @@
1
- import ISigner from "../ISigner";
2
1
  import IHasher from "../../hashers/IHasher";
2
+ import Signer from "../Signer";
3
3
  /**
4
4
  * 默认签名器
5
5
  */
6
- declare class DefaultSigner implements ISigner {
6
+ declare class DefaultSigner extends Signer {
7
7
  type: string;
8
8
  hasher: IHasher;
9
9
  open(auth: {
10
10
  url: string;
11
11
  app_id: string;
12
- }): void;
12
+ }): Promise<void>;
13
13
  callback(token: string): void;
14
- getSign(userId: string, url: string, body: object, timestamp: number, secret: string): Promise<string>;
14
+ getSign(userId: string, url: string, body: string, timestamp: number, secret: string): Promise<string>;
15
15
  loginUrl(callback: string): string;
16
16
  dispose(): void;
17
17
  }
@@ -1,2 +1,3 @@
1
1
  import type ISigner from "./ISigner";
2
- export { ISigner, };
2
+ import SignerFactory from "./SignerFactory";
3
+ export { SignerFactory, ISigner, };
@@ -29,7 +29,7 @@ interface ISso extends IDriver {
29
29
  /**
30
30
  * 获取授权头,不能泄露域账号等用户标识
31
31
  */
32
- getAuthorization(token: string, timestamp: number, sign: string, env: string): string;
32
+ getAuth(token: string, timestamp: number, sign: string, env: string): string;
33
33
  /**
34
34
  * 退出
35
35
  */
@@ -12,6 +12,6 @@ declare class SsoFactory extends Factory<ISso> {
12
12
  /**
13
13
  * 获取指定SSO实例
14
14
  */
15
- create(type: string, conn?: string): ISso;
15
+ create(type: string, conn?: string): Promise<ISso>;
16
16
  }
17
17
  export default SsoFactory;
@@ -12,7 +12,7 @@ declare class AnonymousSso implements ISso {
12
12
  token: string;
13
13
  secret: string;
14
14
  };
15
- getAuthorization(token: string, timestamp: number, signature: string, env: string): string;
15
+ getAuth(token: string, timestamp: number, signature: string, env: string): string;
16
16
  logout(): void;
17
17
  }
18
18
  export default AnonymousSso;
@@ -1,12 +1,10 @@
1
1
  import ISso from "../ISso";
2
- import { IRequester } from "../../requesters";
3
2
  /**
4
3
  * 默认登录授权
5
4
  */
6
5
  declare class BearerSso implements ISso {
7
6
  type: string;
8
7
  static loginKey: string;
9
- requester: IRequester;
10
8
  open(auth: {
11
9
  url: string;
12
10
  app_id: string;
@@ -18,7 +16,7 @@ declare class BearerSso implements ISso {
18
16
  token: string;
19
17
  secret: string;
20
18
  };
21
- getAuthorization(token: string, timestamp: number, signature: string, env?: string): string;
19
+ getAuth(token: string, timestamp: number, signature: string, env?: string): string;
22
20
  logout(): void;
23
21
  }
24
22
  export default BearerSso;
@@ -17,7 +17,7 @@ declare class NioSso implements ISso {
17
17
  token: string;
18
18
  secret: string;
19
19
  };
20
- getAuthorization(token: string, timestamp: number, signature: string, env: string): string;
20
+ getAuth(token: string, timestamp: number, signature: string, env: string): string;
21
21
  logout(): void;
22
22
  }
23
23
  export default NioSso;
@@ -1,8 +1,8 @@
1
1
  import ISso from "../ISso";
2
- import { IRequester } from "../../requesters";
2
+ import { IHttp } from "../../https";
3
3
  declare class SecretSso implements ISso {
4
4
  type: string;
5
- requester: IRequester;
5
+ http: IHttp;
6
6
  open(auth: {
7
7
  url: string;
8
8
  app_id: string;
@@ -14,7 +14,7 @@ declare class SecretSso implements ISso {
14
14
  token: string;
15
15
  secret: string;
16
16
  };
17
- getAuthorization(token: string, timestamp: number, signature: string, env: string): string;
17
+ getAuth(token: string, timestamp: number, signature: string, env: string): string;
18
18
  logout(): void;
19
19
  }
20
20
  export default SecretSso;
@@ -14,7 +14,7 @@ declare class WeiXinSso implements ISso {
14
14
  token: string;
15
15
  secret: string;
16
16
  };
17
- getAuthorization(token: string, timestamp: number, signature: string, env: string): string;
17
+ getAuth(token: string, timestamp: number, signature: string, env: string): string;
18
18
  logout(): void;
19
19
  }
20
20
  export default WeiXinSso;
@@ -1,2 +1,3 @@
1
1
  import type ISso from "./ISso";
2
- export { ISso, };
2
+ import SsoFactory from "./SsoFactory";
3
+ export { ISso, SsoFactory };
@@ -8,17 +8,21 @@ declare type Prop = {
8
8
  */
9
9
  declare class JsonHelper {
10
10
  /**
11
- * 从树集合构建出Json对象
11
+ * 把字符串格式化为Json字符串
12
12
  */
13
- static buildObject(tree: any[], childProp: string, fun: (node: any) => Prop): string;
13
+ static stringify(value: any): string;
14
14
  /**
15
- * 把字符串格式化为Json字符串
15
+ * 对非字符串进行序列化
16
16
  */
17
- static stringify(value: string): string;
17
+ static stringifyWithString(value: any): string;
18
18
  /**
19
19
  * 把字符串格式化为Json字符串
20
20
  */
21
21
  static stringifyString(value: string): string;
22
+ /**
23
+ * 反序列化成json对象
24
+ */
25
+ static parse(value: string): any;
22
26
  /**
23
27
  * 根据props中的.自动分割得到属性值
24
28
  */
@@ -27,5 +31,9 @@ declare class JsonHelper {
27
31
  * 把json字符串合并到目标对象上
28
32
  */
29
33
  static mergeTo(target: any, from: string): void;
34
+ /**
35
+ * 从树集合构建出Json对象
36
+ */
37
+ static buildObject(tree: any[], childProp: string, fun: (node: any) => Prop): string;
30
38
  }
31
39
  export default JsonHelper;
@@ -30,5 +30,9 @@ declare class ObjectHelper {
30
30
  * 给对象添加属性集合,并赋值
31
31
  */
32
32
  static addProperties: (obj: object, keys: string[], value: string) => void;
33
+ /**
34
+ * 获取对象不区分大小写的key
35
+ */
36
+ static getKey(value: object, key: string): string;
33
37
  }
34
38
  export default ObjectHelper;
File without changes
@@ -83,11 +83,11 @@ declare class UrlHelper {
83
83
  /**
84
84
  * 把指定对象转换成base64字符串
85
85
  */
86
- static base64(obj: object): string;
86
+ static base64(obj: object): Promise<string>;
87
87
  /**
88
88
  * 把指定base64字符串解析为原对象
89
89
  */
90
- static base64Decode(val: string): any;
90
+ static base64Decode(val: string): Promise<any>;
91
91
  /**
92
92
  * 是否是http或https开头的地址
93
93
  */
package/esm/main.d.ts CHANGED
@@ -1,3 +1,14 @@
1
- export * from "./drivers/index";
2
- export * from "./helpers/index";
3
- export * from "./services/index";
1
+ import { IMessager } from "./services";
2
+ import "./styles/index.scss";
3
+ export * from "./coms";
4
+ export * from "./drivers";
5
+ export * from "./helpers";
6
+ export * from "./plugins";
7
+ export * from "./services";
8
+ export * from "./stores";
9
+ export * from "./utilities";
10
+ /**
11
+ * 初始化框架
12
+ */
13
+ declare let createHalo: (messager: IMessager) => Promise<void>;
14
+ export { createHalo };
@@ -1,15 +1,9 @@
1
1
  import SettingService from "./SettingService";
2
+ import { IMessager } from "./types";
3
+ export * from "./types";
4
+ declare let messager: IMessager;
2
5
  /**
3
- * 消息提示接口,下游自己定义
6
+ * 重新设置消息对象
4
7
  */
5
- interface IMessageService {
6
- /**
7
- * 成功消息提示
8
- */
9
- success(message: string): void;
10
- /**
11
- * 错误消息提示
12
- */
13
- error(message: string): void;
14
- }
15
- export { IMessageService, SettingService };
8
+ declare let setMessager: (msgr: IMessager) => void;
9
+ export { SettingService, messager, setMessager };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 消息提示接口,下游自己定义
3
+ */
4
+ interface IMessage {
5
+ /**
6
+ * 成功消息提示
7
+ */
8
+ success(message: string): void;
9
+ /**
10
+ * 错误消息提示
11
+ */
12
+ error(message: string): void;
13
+ }
14
+ export default IMessage;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 消息提示接口,下游自己定义
3
+ */
4
+ interface IMessager {
5
+ /**
6
+ * 成功消息提示
7
+ */
8
+ success(message: string): void;
9
+ /**
10
+ * 错误消息提示
11
+ */
12
+ error(message: string): void;
13
+ }
14
+ export default IMessager;
@@ -0,0 +1,2 @@
1
+ import type IMessager from "./IMessager";
2
+ export { IMessager };
@@ -26,15 +26,19 @@ declare let useConfigStore: import("pinia").StoreDefinition<"config", {
26
26
  * 文件布局方式
27
27
  */
28
28
  fileLayout: any;
29
- /**
30
- * 请求器
31
- */
32
- requester: import("../drivers").IRequester;
29
+ editor: {
30
+ schemas: any[];
31
+ completions: {};
32
+ };
33
33
  }, {}, {
34
34
  /**
35
35
  * 初始化配置值(不一定跟登录用户相关,这也是单独分离的好处)
36
36
  */
37
37
  init(configs: any[]): void;
38
+ /**
39
+ * 尝试添加架构
40
+ */
41
+ tryAddSchema(uri: string, fileMatch: string, schema: object): void;
38
42
  /**
39
43
  * 获取本地配置
40
44
  */
@@ -50,10 +54,10 @@ declare let useConfigStore: import("pinia").StoreDefinition<"config", {
50
54
  /**
51
55
  * 全量保存用户配置
52
56
  */
53
- saveConfig(type: string, data: any, cached?: boolean): Promise<any>;
57
+ saveConfig(type: string, data: any, cached?: boolean): Promise<boolean>;
54
58
  /**
55
59
  * 部分保存用户配置
56
60
  */
57
- patchConfig(type: string, pairs: any): Promise<any>;
61
+ patchConfig(type: string, pairs: any): Promise<boolean>;
58
62
  }>;
59
63
  export default useConfigStore;
@@ -24,18 +24,14 @@ declare let useDriverStore: import("pinia").StoreDefinition<"driver", {
24
24
  * 环境集合,存储到Store中,防止每一个Driver实例重复加载
25
25
  */
26
26
  envs: any[];
27
- /**
28
- * 请求器
29
- */
30
- requester: import("../drivers").IRequester;
31
27
  }, {}, {
32
28
  /**
33
29
  * 加载应用选项
34
30
  */
35
- loadApps(reload?: boolean): Promise<any>;
31
+ loadApps(reload?: boolean): Promise<void>;
36
32
  /**
37
33
  * 加载环境选项
38
34
  */
39
- loadEnvs(reload?: boolean): Promise<any>;
35
+ loadEnvs(reload?: boolean): Promise<void>;
40
36
  }>;
41
37
  export default useDriverStore;
@@ -1,7 +1,8 @@
1
1
  import useConfigStore from "./config";
2
+ import useDriverStore from "./driver";
3
+ import useEnvStore from "./env";
2
4
  import useSettingStore from "./setting";
3
5
  import useLogStore from "./log";
4
6
  import useUserStore from "./user";
5
7
  import useSocketStore from "./socket";
6
- import useDriverStore from "./driver";
7
- export { useConfigStore, useSettingStore, useLogStore, useUserStore, useSocketStore, useDriverStore };
8
+ export { useConfigStore, useSettingStore, useLogStore, useUserStore, useSocketStore, useDriverStore, useEnvStore };
@@ -30,10 +30,6 @@ declare let useSettingStore: import("pinia").StoreDefinition<"setting", {
30
30
  business: any;
31
31
  upload: any;
32
32
  version: any;
33
- /**
34
- * 请求器
35
- */
36
- requester: import("../drivers").IRequester;
37
33
  }, {}, {
38
34
  /**
39
35
  * 系统初始化
@@ -7,15 +7,11 @@ declare const useUserStore: import("pinia").StoreDefinition<"user", {
7
7
  menusFlat: any;
8
8
  debugger: any;
9
9
  env: any;
10
- /**
11
- * 请求器
12
- */
13
- requester: import("../drivers").IRequester;
14
10
  }, {}, {
15
11
  /**
16
12
  * 获取本地缓存中的用户信息;好处:即使手动更改storage数据,也可以里面获取到
17
13
  */
18
- getSso(): any;
14
+ getSso(): Promise<any>;
19
15
  /**
20
16
  * 登录后,获取用户信息
21
17
  */
@@ -23,7 +19,7 @@ declare const useUserStore: import("pinia").StoreDefinition<"user", {
23
19
  /**
24
20
  * 通过完整url和请求体,获取授权头
25
21
  */
26
- getAuthorization(url: string, data?: any): Promise<string>;
22
+ getAuth(url: string, body?: string): Promise<string>;
27
23
  /**
28
24
  * 未登录,获取匿名登录信息
29
25
  */
@@ -39,6 +35,6 @@ declare const useUserStore: import("pinia").StoreDefinition<"user", {
39
35
  /**
40
36
  * 退出登录
41
37
  */
42
- logout(): Promise<any>;
38
+ logout(): Promise<void>;
43
39
  }>;
44
40
  export default useUserStore;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 固定元素位置
3
+ */
4
+ declare class AffixUtility {
5
+ /**
6
+ * 初始化
7
+ */
8
+ constructor(ele: Element, parent: Element);
9
+ }
10
+ export default AffixUtility;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 事件工具类
3
+ */
4
+ declare class EventUtility {
5
+ resizeObserver: ResizeObserver;
6
+ resizeHandler: any;
7
+ /**
8
+ * 大小改变事件,已防抖
9
+ */
10
+ resize: (element: Element, handler: Function, debounceMs?: number) => void;
11
+ /**
12
+ * 移除大小改变事件
13
+ */
14
+ unresize: (element: Element) => void;
15
+ lastDebounceTime: number;
16
+ lastDebounceTimeout: any;
17
+ /**
18
+ * 事件防抖: time ms没重复触发才执行指定操作
19
+ */
20
+ debounce: (func: Function, time: number, args?: any) => void;
21
+ /**
22
+ * 清空防抖
23
+ */
24
+ clearDebounce: () => void;
25
+ /**
26
+ * 事件节流: 指定时间段内只第一次操作被触发
27
+ */
28
+ throttle: () => void;
29
+ }
30
+ export default EventUtility;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * 键盘帮助类
3
+ */
4
+ declare class KeyboardUtility {
5
+ events: Object;
6
+ /**
7
+ * 注册事件
8
+ */
9
+ add: (element: any, cb: Function, condition: Function, key: string, prevent: boolean, type: string) => void;
10
+ /**
11
+ * 移除事件
12
+ */
13
+ remove: (element: any, key: string, type: string) => void;
14
+ /**
15
+ * 监听键盘按下事件
16
+ */
17
+ keydown: (element: any, cb: Function, condition: Function, key: string, prevent?: boolean) => void;
18
+ /**
19
+ * 移除键盘按下事件
20
+ */
21
+ removeKeydown: (element: any, key: string) => void;
22
+ /**
23
+ * 当触发保存时执行
24
+ * 想在div上绑定ctrlS事件,需要div处于focus状态,才可以触发已绑定的ctrlS事件
25
+ * div设置tabindex=-1,才可以手动触发焦点
26
+ */
27
+ ctrlS: (element: any, cb: Function) => void;
28
+ /**
29
+ * 移除保存事件
30
+ */
31
+ removeCtrlS: (element: any) => void;
32
+ /**
33
+ * 触发Ctrl回车事件
34
+ */
35
+ ctrlEnter: (element: any, cb: Function) => void;
36
+ /**
37
+ * 移除Ctrl回车事件
38
+ */
39
+ removeCtrlEnter: (element: any) => void;
40
+ lastKeyTime: number;
41
+ isKeyLastUp: boolean;
42
+ /**
43
+ * 双击事件
44
+ */
45
+ doubleKey: (element: any, cb: Function, key: string, prevent?: boolean) => void;
46
+ /**
47
+ * 移除双击事件
48
+ */
49
+ removeDoubleKey: (element: any, key: string) => void;
50
+ /**
51
+ * 监听键盘抬起事件
52
+ */
53
+ keyup: (element: any, cb: Function, condition: Function, key: string, prevent?: boolean) => void;
54
+ /**
55
+ * 移除键盘抬起事件
56
+ */
57
+ removeKeyup: (element: any, key: string) => void;
58
+ /**
59
+ * 监控是否按下Ctrl
60
+ */
61
+ isCtrl: boolean;
62
+ ctrl: (document: any) => void;
63
+ /**
64
+ * 删除Ctrl事件
65
+ */
66
+ removeCtrl: (document: any) => void;
67
+ timer: number;
68
+ touchStart: Function;
69
+ touchEnd(): void;
70
+ touch: (element: any, cb: Function) => void;
71
+ removeTouch: (element: any) => void;
72
+ }
73
+ export default KeyboardUtility;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * 鼠标工具类
3
+ */
4
+ declare class MouseUtility {
5
+ container: HTMLElement;
6
+ closeTriggers: HTMLElement[];
7
+ /**
8
+ * 初始化,并绑定自动关闭上下文菜单事件
9
+ */
10
+ constructor(container: HTMLElement, closeTriggers?: any[]);
11
+ /**
12
+ * 手动关闭右键上下文菜单
13
+ */
14
+ close: () => void;
15
+ /**
16
+ * 根据鼠标事件,显示右键上下文弹窗
17
+ */
18
+ show: (event: MouseEvent) => void;
19
+ /**
20
+ * 资源释放,防止内存泄漏
21
+ */
22
+ dispose: () => void;
23
+ }
24
+ export default MouseUtility;