xframelib 0.8.3 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/core/IModel.d.ts +1 -1
- package/dist/core/MsgHelper.d.ts +1 -1
- package/dist/core/SysEvents.d.ts +7 -0
- package/dist/index.cjs +6 -6
- package/dist/index.css +43 -43
- package/dist/index.js +7 -7
- package/dist/mitt/index.d.ts +15 -15
- package/dist/utils/FileDownload.d.ts +1 -12
- package/dist/utils/H5Tool.d.ts +6 -0
- package/dist/utils/LockHelper.d.ts +13 -1
- package/dist/utils/XXTEA.d.ts +1 -1
- package/package.json +68 -68
package/dist/mitt/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export type EventType = string | symbol;
|
|
2
|
-
export type Handler<T =
|
|
3
|
-
export type WildcardHandler = (type:
|
|
4
|
-
export type EventHandlerList = Array<Handler
|
|
5
|
-
export type WildCardEventHandlerList = Array<WildcardHandler
|
|
6
|
-
export type EventHandlerMap = Map<
|
|
7
|
-
export interface Emitter {
|
|
8
|
-
all: EventHandlerMap
|
|
9
|
-
on<
|
|
10
|
-
on(type: '*', handler: WildcardHandler): void;
|
|
11
|
-
off<
|
|
12
|
-
off(type: '*', handler: WildcardHandler): void;
|
|
13
|
-
emit<
|
|
14
|
-
emit(type:
|
|
2
|
+
export type Handler<T = unknown> = (event: T) => void;
|
|
3
|
+
export type WildcardHandler<T = Record<string, unknown>> = (type: keyof T, event: T[keyof T]) => void;
|
|
4
|
+
export type EventHandlerList<T = unknown> = Array<Handler<T>>;
|
|
5
|
+
export type WildCardEventHandlerList<T = Record<string, unknown>> = Array<WildcardHandler<T>>;
|
|
6
|
+
export type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | '*', EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>>;
|
|
7
|
+
export interface Emitter<Events extends Record<EventType, unknown>> {
|
|
8
|
+
all: EventHandlerMap<Events>;
|
|
9
|
+
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
|
|
10
|
+
on(type: '*', handler: WildcardHandler<Events>): void;
|
|
11
|
+
off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
|
|
12
|
+
off(type: '*', handler: WildcardHandler<Events>): void;
|
|
13
|
+
emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
|
|
14
|
+
emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Mitt: Tiny (~200b) functional event emitter / pubsub.
|
|
18
18
|
* @name mitt
|
|
19
19
|
* @returns {Mitt}
|
|
20
20
|
*/
|
|
21
|
-
export default function mitt(all?: EventHandlerMap): Emitter
|
|
21
|
+
export default function mitt<Events extends Record<EventType, unknown>>(all?: EventHandlerMap<Events>): Emitter<Events>;
|
|
22
22
|
/**
|
|
23
23
|
* 默认全局总线对象
|
|
24
24
|
*/
|
|
25
|
-
export declare const GlobalMitt: Emitter
|
|
25
|
+
export declare const GlobalMitt: Emitter<Record<EventType, unknown>>;
|
|
@@ -23,15 +23,4 @@ declare const JsonDownload: (jsonObject: object, jsonID: string) => void;
|
|
|
23
23
|
* @param fileName 文件名
|
|
24
24
|
*/
|
|
25
25
|
declare const HttpDownload: (axios: any, requestUrl: string, fileName: string) => void;
|
|
26
|
-
|
|
27
|
-
* 只能下图片(无法解决跨域,建议:少用)
|
|
28
|
-
* (网站内部或外部图片地址)
|
|
29
|
-
* @param {*} sUrl
|
|
30
|
-
* @deprecated 不建议使用,只能下图片
|
|
31
|
-
*/
|
|
32
|
-
declare function DownloadByUrl({ url, target, fileName }: {
|
|
33
|
-
url: string;
|
|
34
|
-
target?: '_self' | '_blank';
|
|
35
|
-
fileName?: string;
|
|
36
|
-
}): Promise<boolean>;
|
|
37
|
-
export { Download, SaveAs, JsonDownload, HttpDownload, DownloadByUrl };
|
|
26
|
+
export { Download, SaveAs, JsonDownload, HttpDownload };
|
package/dist/utils/H5Tool.d.ts
CHANGED
|
@@ -305,4 +305,10 @@ export default class H5Tool {
|
|
|
305
305
|
* @returns {HTMLElement}
|
|
306
306
|
*/
|
|
307
307
|
static createVideoHTML(url: string, className: string, container?: HTMLElement): HTMLElement;
|
|
308
|
+
/**
|
|
309
|
+
* 读取前端文件,为bytes二进制数组(base64编码的)
|
|
310
|
+
* @param file
|
|
311
|
+
* @returns
|
|
312
|
+
*/
|
|
313
|
+
static readFileBytes(file: File | Blob): Promise<any>;
|
|
308
314
|
}
|
|
@@ -2,11 +2,23 @@ export interface ILockState {
|
|
|
2
2
|
isLock: boolean;
|
|
3
3
|
lockTime: number;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* 锁定状态
|
|
7
|
+
*/
|
|
8
|
+
export declare const LockState: {
|
|
9
|
+
isLock: boolean;
|
|
10
|
+
lockTime: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* 进行锁屏相关操作
|
|
14
|
+
* @param islock 是否锁屏
|
|
15
|
+
*/
|
|
16
|
+
export declare function doSetLock(islock: boolean): void;
|
|
5
17
|
/**
|
|
6
18
|
* 获取当前Lock状态
|
|
7
19
|
* @returns 是否Locked
|
|
8
20
|
*/
|
|
9
|
-
export declare function getLockState():
|
|
21
|
+
export declare function getLockState(): boolean;
|
|
10
22
|
/**
|
|
11
23
|
* 全局监听Lock
|
|
12
24
|
*/
|
package/dist/utils/XXTEA.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare function toBytes(str: any): Uint8Array
|
|
1
|
+
declare function toBytes(str: any): Uint8Array<ArrayBuffer>;
|
|
2
2
|
declare function toString(bytes: any): string;
|
|
3
3
|
declare function encrypt(data: any, key: any): any;
|
|
4
4
|
declare function encryptToString(data: any, key: any): string;
|
package/package.json
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "xframelib",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "积累的前端开发基础库",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"common": "dist/index.cjs",
|
|
7
|
-
"typings": "dist/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"dev": "vite --port 8099",
|
|
10
|
-
"build": "vite build",
|
|
11
|
-
"lib": "rollup -c ",
|
|
12
|
-
"serve": "vite preview",
|
|
13
|
-
"clean": "rimraf dist && rimraf package-lock.json && rimraf node_modules/.cache && rimraf node_modules/.vite"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [
|
|
16
|
-
"hprose",
|
|
17
|
-
"rpc",
|
|
18
|
-
"typescript"
|
|
19
|
-
],
|
|
20
|
-
"author": {
|
|
21
|
-
"name": "zorrowm",
|
|
22
|
-
"email": "zorrowm@126.com"
|
|
23
|
-
},
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "https://github.com/zorrowm/vue-widget-template.git"
|
|
27
|
-
},
|
|
28
|
-
"homepage": "https://zorrowm.github.io",
|
|
29
|
-
"license": "MIT",
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@hprose/io": "^3.0.10",
|
|
32
|
-
"@hprose/rpc-core": "^3.0.10",
|
|
33
|
-
"@hprose/rpc-html5": "^3.0.10",
|
|
34
|
-
"@iconify/vue": "^4.
|
|
35
|
-
"@microsoft/signalr": "^8.0.7",
|
|
36
|
-
"axios": "^1.7.
|
|
37
|
-
"localforage": "^1.10.0",
|
|
38
|
-
"loglevel": "^1.9.2",
|
|
39
|
-
"qs": "^6.13.
|
|
40
|
-
"spark-md5": "^3.0.2",
|
|
41
|
-
"streamsaver": "^2.0.6",
|
|
42
|
-
"xhr": "^2.6.0"
|
|
43
|
-
},
|
|
44
|
-
"devDependencies": {
|
|
45
|
-
"@rollup/plugin-alias": "^5.1.1",
|
|
46
|
-
"@rollup/plugin-commonjs": "^28.0.1",
|
|
47
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
48
|
-
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
49
|
-
"@rollup/plugin-typescript": "^12.1.1",
|
|
50
|
-
"@types/streamsaver": "^2.0.5",
|
|
51
|
-
"@vitejs/plugin-vue": "^5.1
|
|
52
|
-
"@vue/compiler-sfc": "^3.5.
|
|
53
|
-
"esbuild": "^0.24.0",
|
|
54
|
-
"rimraf": "^6.0.1",
|
|
55
|
-
"rollup-plugin-copy": "^3.5.0",
|
|
56
|
-
"rollup-plugin-esbuild": "^6.1.1",
|
|
57
|
-
"rollup-plugin-scss": "^4.0.0",
|
|
58
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
59
|
-
"rollup-plugin-typescript2": "^0.36.0",
|
|
60
|
-
"rollup-plugin-vue": "^6.0.0",
|
|
61
|
-
"sass": "^1.
|
|
62
|
-
"typescript": "^5.
|
|
63
|
-
"vite": "^
|
|
64
|
-
"vue": "^3.5.
|
|
65
|
-
"vue-router": "^4.
|
|
66
|
-
"vue-tsc": "^2.1.10"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "xframelib",
|
|
3
|
+
"version": "0.8.5",
|
|
4
|
+
"description": "积累的前端开发基础库",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"common": "dist/index.cjs",
|
|
7
|
+
"typings": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "vite --port 8099",
|
|
10
|
+
"build": "vite build",
|
|
11
|
+
"lib": "rollup -c ",
|
|
12
|
+
"serve": "vite preview",
|
|
13
|
+
"clean": "rimraf dist && rimraf package-lock.json && rimraf node_modules/.cache && rimraf node_modules/.vite"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"hprose",
|
|
17
|
+
"rpc",
|
|
18
|
+
"typescript"
|
|
19
|
+
],
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "zorrowm",
|
|
22
|
+
"email": "zorrowm@126.com"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/zorrowm/vue-widget-template.git"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://zorrowm.github.io/doc/template.html",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@hprose/io": "^3.0.10",
|
|
32
|
+
"@hprose/rpc-core": "^3.0.10",
|
|
33
|
+
"@hprose/rpc-html5": "^3.0.10",
|
|
34
|
+
"@iconify/vue": "^4.2.0",
|
|
35
|
+
"@microsoft/signalr": "^8.0.7",
|
|
36
|
+
"axios": "^1.7.9",
|
|
37
|
+
"localforage": "^1.10.0",
|
|
38
|
+
"loglevel": "^1.9.2",
|
|
39
|
+
"qs": "^6.13.1",
|
|
40
|
+
"spark-md5": "^3.0.2",
|
|
41
|
+
"streamsaver": "^2.0.6",
|
|
42
|
+
"xhr": "^2.6.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
46
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
|
47
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
48
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
49
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
|
50
|
+
"@types/streamsaver": "^2.0.5",
|
|
51
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
52
|
+
"@vue/compiler-sfc": "^3.5.13",
|
|
53
|
+
"esbuild": "^0.24.0",
|
|
54
|
+
"rimraf": "^6.0.1",
|
|
55
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
56
|
+
"rollup-plugin-esbuild": "^6.1.1",
|
|
57
|
+
"rollup-plugin-scss": "^4.0.0",
|
|
58
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
59
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
60
|
+
"rollup-plugin-vue": "^6.0.0",
|
|
61
|
+
"sass": "^1.82.0",
|
|
62
|
+
"typescript": "^5.7.2",
|
|
63
|
+
"vite": "^6.0.3",
|
|
64
|
+
"vue": "^3.5.13",
|
|
65
|
+
"vue-router": "^4.5.0",
|
|
66
|
+
"vue-tsc": "^2.1.10"
|
|
67
|
+
}
|
|
68
|
+
}
|