halo-fe 1.0.3 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Android/IOS 操作系统通信桥
3
+ */
4
+ interface IBridge {
5
+ }
@@ -1,14 +1,33 @@
1
1
  import DriverFactory from "./DriverFactory";
2
2
  import { HttpFactory, IHttp } from "../https";
3
3
  import { EncoderFactory } from "../encoders";
4
+ import { CdnFactory } from "../cdns";
5
+ import { ExplainerFactory } from "../explainers";
6
+ import { ExcelFactory } from "../excels";
7
+ import { FeatureFactory } from "../features";
8
+ import { HasherFactory } from "../hashers";
9
+ import { ProviderFactory } from "../providers";
10
+ import { SignerFactory } from "../signers";
11
+ import { SsoFactory } from "../ssos";
4
12
  /**
5
13
  * 默认Http请求对象
6
14
  */
7
- declare let httpFactory: HttpFactory;
15
+ declare let cdnFactory: CdnFactory;
8
16
  declare let encoderFactory: EncoderFactory;
17
+ declare let excelFactory: ExcelFactory;
18
+ declare let explainerFactory: ExplainerFactory;
19
+ declare let featureFactory: FeatureFactory;
20
+ declare let hasherFactory: HasherFactory;
21
+ declare let httpFactory: HttpFactory;
22
+ declare let providerFactory: ProviderFactory;
23
+ declare let signerFactory: SignerFactory;
24
+ declare let ssoFactory: SsoFactory;
25
+ /**
26
+ * 默认http请求对象
27
+ */
9
28
  declare let http: IHttp;
10
29
  /**
11
30
  * 设置Http请求对象
12
31
  */
13
32
  declare let setHttp: () => Promise<void>;
14
- export { DriverFactory, httpFactory, encoderFactory, http, setHttp };
33
+ export { cdnFactory, encoderFactory, excelFactory, explainerFactory, featureFactory, hasherFactory, httpFactory, providerFactory, signerFactory, ssoFactory, DriverFactory, http, setHttp };
@@ -29,7 +29,7 @@ interface ISso extends IDriver {
29
29
  /**
30
30
  * 获取授权头,不能泄露域账号等用户标识
31
31
  */
32
- getAuth(token: string, timestamp: number, sign: string, env: string): string;
32
+ getAuth(token: string, timestamp: number, sign: string, platform: string, env: string): string;
33
33
  /**
34
34
  * 退出
35
35
  */
@@ -16,7 +16,7 @@ declare class BearerSso implements ISso {
16
16
  token: string;
17
17
  secret: string;
18
18
  };
19
- getAuth(token: string, timestamp: number, signature: string, env?: string): string;
19
+ getAuth(token: string, timestamp: number, signature: string, platform?: string, env?: string): string;
20
20
  logout(): void;
21
21
  }
22
22
  export default BearerSso;
File without changes
@@ -0,0 +1,14 @@
1
+ export interface IVoice {
2
+ /**
3
+ * 开始录音
4
+ */
5
+ startRecord(): string;
6
+ /**
7
+ * 结束录音
8
+ */
9
+ endRecord(): string;
10
+ /**
11
+ * 下载录音
12
+ */
13
+ download(): any;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { IVoice } from "../IVoice";
2
+ export declare class DefaultVoice implements IVoice {
3
+ download(): void;
4
+ endRecord(): string;
5
+ startRecord(): string;
6
+ }
@@ -0,0 +1,9 @@
1
+ import { IVoice } from "../IVoice";
2
+ /**
3
+ * 文档:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#23
4
+ */
5
+ export declare class TencentVoice implements IVoice {
6
+ download(): void;
7
+ endRecord(): string;
8
+ startRecord(): string;
9
+ }
@@ -45,11 +45,15 @@ declare class TimeHelper {
45
45
  /**
46
46
  * 添加天数
47
47
  */
48
- static addDays: (value: any, days: number) => string;
48
+ static addDays: (value: any, days: number) => Date;
49
49
  /**
50
50
  * 添加月份
51
51
  */
52
- static addMonths: (value: any, months: number) => string;
52
+ static addMonths: (value: any, months: number) => Date;
53
+ /**
54
+ * 添加小时
55
+ */
56
+ static addHours: (value: any, hours: number) => Date;
53
57
  /**
54
58
  * 判断指定时间是否是周末
55
59
  */
@@ -57,6 +61,6 @@ declare class TimeHelper {
57
61
  /**
58
62
  * 把中国时间,转换为当地时间
59
63
  */
60
- static localeTime: (time: any) => string;
64
+ static localeTime: (time: any) => Date;
61
65
  }
62
66
  export default TimeHelper;
package/esm/main.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IMessager } from "./services";
1
+ import { IMessager } from "./plugins";
2
2
  import "./styles/index.scss";
3
3
  export * from "./coms";
4
4
  export * from "./drivers";
@@ -8,7 +8,7 @@ export * from "./services";
8
8
  export * from "./stores";
9
9
  export * from "./utilities";
10
10
  /**
11
- * 初始化框架
11
+ * 初始化前端基础框架
12
12
  */
13
- declare let createHalo: (messager: IMessager) => Promise<void>;
14
- export { createHalo };
13
+ declare let createFe: (messager: IMessager) => Promise<void>;
14
+ export { createFe };
@@ -5,4 +5,5 @@ import moment from "moment";
5
5
  * 异步加载echarts
6
6
  */
7
7
  export declare function loadEcharts(): Promise<unknown>;
8
+ export * from "./types";
8
9
  export { loader, Monaco, moment };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * 消息提示接口,下游自己定义
3
+ */
4
+ interface IMessager {
5
+ /**
6
+ * 显示全局成功消息
7
+ */
8
+ success(message: string): void;
9
+ /**
10
+ * 显示全局警告消息
11
+ */
12
+ warning(message: string): void;
13
+ /**
14
+ * 显示全局信息消息
15
+ */
16
+ info(message: string): void;
17
+ /**
18
+ * 显示全局错误消息
19
+ */
20
+ error(message: string): void;
21
+ /**
22
+ * 显示全局错误消息
23
+ */
24
+ confirm(title: string, message: string, options?: any): Promise<any>;
25
+ /**
26
+ * 显示警告框
27
+ */
28
+ alert(title: string, message: string, options?: any): void;
29
+ /**
30
+ * 通知
31
+ */
32
+ notify(title: string, message: string, type: string): void;
33
+ }
34
+ export default IMessager;
@@ -0,0 +1,7 @@
1
+ import type IMessager from "./IMessager";
2
+ declare let messager: IMessager;
3
+ /**
4
+ * 重新设置消息对象
5
+ */
6
+ declare let setMessager: (msgr: IMessager) => void;
7
+ export { IMessager, messager, setMessager };
@@ -1,9 +1,2 @@
1
1
  import SettingService from "./SettingService";
2
- import { IMessager } from "./types";
3
- export * from "./types";
4
- declare let messager: IMessager;
5
- /**
6
- * 重新设置消息对象
7
- */
8
- declare let setMessager: (msgr: IMessager) => void;
9
- export { SettingService, messager, setMessager };
2
+ export { SettingService, };
@@ -3,12 +3,32 @@
3
3
  */
4
4
  interface IMessager {
5
5
  /**
6
- * 成功消息提示
6
+ * 显示全局成功消息
7
7
  */
8
8
  success(message: string): void;
9
9
  /**
10
- * 错误消息提示
10
+ * 显示全局警告消息
11
+ */
12
+ warning(message: string): void;
13
+ /**
14
+ * 显示全局信息消息
15
+ */
16
+ info(message: string): void;
17
+ /**
18
+ * 显示全局错误消息
11
19
  */
12
20
  error(message: string): void;
21
+ /**
22
+ * 显示全局错误消息
23
+ */
24
+ confirm(title: string, message: string, options?: any): void;
25
+ /**
26
+ * 显示警告框
27
+ */
28
+ alert(title: string, message: string, options?: any): void;
29
+ /**
30
+ * 通知
31
+ */
32
+ notify(title: string, message: string, type: string): void;
13
33
  }
14
34
  export default IMessager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "halo-fe",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Halo front end sdk",
5
5
  "scripts": {
6
6
  "halo-fe:tsc": "vue-tsc",
@@ -11,7 +11,7 @@
11
11
  "halo-fe:publish": "npm publish"
12
12
  },
13
13
  "type": "module",
14
- "main": "./main.js",
14
+ "main": "./dist/main.js",
15
15
  "types": "./esm/main.d.ts",
16
16
  "files": [
17
17
  "dist",