xframelib 1.0.2 → 1.0.4
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 +11 -10
- package/dist/assets/{worker-XXTEA-B_zM6owJ.js → worker-XXTEA-BTkdAuVi.js} +1 -1
- package/dist/assets/worker-bigimage-DeV0Ac8X.js +6 -0
- package/dist/assets/worker-webcache-JMcB6mHT.js +6 -0
- package/dist/assets/worker-xmath-BJNVXVMo.js +15 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -3
- package/dist/public/mitm.html +2 -2
- package/dist/utils/WebCacheTool.d.ts +72 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/workers/index.d.ts +13 -1
- package/dist/workers/worker-bigimage.d.ts +17 -0
- package/dist/workers/worker-webcache.d.ts +13 -0
- package/dist/workerservice/frontWorker.d.ts +3 -0
- package/dist/workerservice/index.d.ts +9 -0
- package/package.json +13 -12
- package/dist/assets/worker-xmath-DUFCrWrO.js +0 -15
package/dist/public/mitm.html
CHANGED
|
@@ -161,10 +161,10 @@
|
|
|
161
161
|
return sw.postMessage(data, transferable);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
if (
|
|
164
|
+
if (globalThis.opener) {
|
|
165
165
|
// The opener can't listen to onload event, so we need to help em out!
|
|
166
166
|
// (telling them that we are ready to accept postMessage's)
|
|
167
|
-
|
|
167
|
+
globalThis.opener.postMessage('StreamSaver::loadedPopup', '*');
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
if (navigator.serviceWorker) {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { LRUCache } from 'lru-cache';
|
|
2
|
+
declare class WebCacheTool {
|
|
3
|
+
static defaultOptions: {
|
|
4
|
+
max: number;
|
|
5
|
+
maxAge: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* 当前默认集合对象
|
|
9
|
+
*/
|
|
10
|
+
static readonly cache: LRUCache<{}, {}, unknown>;
|
|
11
|
+
static createCache(options?: any): LRUCache<{}, {}, unknown>;
|
|
12
|
+
/**
|
|
13
|
+
* 加入缓存
|
|
14
|
+
* @param key
|
|
15
|
+
* @param value
|
|
16
|
+
* @param cacheObj
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
static set(key: string, value: any, cacheObj?: any): void;
|
|
20
|
+
/**
|
|
21
|
+
* 获取某个缓存值
|
|
22
|
+
* @param key
|
|
23
|
+
* @param cacheObj
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
static get(key: string, cacheObj?: any): any;
|
|
27
|
+
/**
|
|
28
|
+
* 删除某KEY的缓存
|
|
29
|
+
* @param key
|
|
30
|
+
* @param cacheObj
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
static remove(key: string, cacheObj?: any): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 是否包含某个KEY
|
|
36
|
+
* @param key
|
|
37
|
+
* @param cacheObj
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
static has(key: string, cacheObj?: any): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 获取已经存储的个数
|
|
43
|
+
* @param cacheObj
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
static count(cacheObj?: any): number;
|
|
47
|
+
/**
|
|
48
|
+
* 最大数量
|
|
49
|
+
* @param cacheObj
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
static maxSize(cacheObj?: any): number;
|
|
53
|
+
/**
|
|
54
|
+
* 获取缓存,但不更新时间
|
|
55
|
+
* @param key
|
|
56
|
+
* @param cacheObj
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
static peek(key: string, cacheObj?: any): any;
|
|
60
|
+
/**
|
|
61
|
+
* 返回所有键集合
|
|
62
|
+
* @param cacheObj
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
static keys(cacheObj?: any): Generator<any, void, unknown>;
|
|
66
|
+
/**
|
|
67
|
+
* 清空缓存
|
|
68
|
+
* @param cacheObj
|
|
69
|
+
*/
|
|
70
|
+
static clear(cacheObj?: any): void;
|
|
71
|
+
}
|
|
72
|
+
export default WebCacheTool;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { default as XXTEA } from './XXTEA';
|
|
|
9
9
|
import { default as WaterMark } from './WaterMark';
|
|
10
10
|
import { GetSignalRClient } from './SignalrClient';
|
|
11
11
|
import { default as iconv } from 'iconv-lite';
|
|
12
|
+
import { default as WebCacheTool } from './WebCacheTool';
|
|
12
13
|
export * from './Color';
|
|
13
14
|
export * from './FileDownload';
|
|
14
15
|
export * from './Time';
|
|
@@ -26,4 +27,4 @@ export * from './WidgetsTool';
|
|
|
26
27
|
export * from './CommonTool';
|
|
27
28
|
export * from './FilenameUtils';
|
|
28
29
|
export * from './AutoUpdate';
|
|
29
|
-
export { iconv, GetSignalRClient, WaterMark, XXTEA, H5Tool, StringUtils, StorageHelper as Storage, storage, uuid, newGuid, ZipTool, GzipTool, DayjsTool };
|
|
30
|
+
export { iconv, GetSignalRClient, WaterMark, XXTEA, H5Tool, StringUtils, StorageHelper as Storage, storage, uuid, newGuid, ZipTool, GzipTool, DayjsTool, WebCacheTool };
|
package/dist/workers/index.d.ts
CHANGED
|
@@ -10,4 +10,16 @@ declare const xxteaWorker: {
|
|
|
10
10
|
declare const xmathWorker: {
|
|
11
11
|
readonly [x: number]: Worker;
|
|
12
12
|
} & import('comlink').RemoteObject<typeof import("./worker-xmath")> & import('comlink').ProxyMethods;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* 前端缓存层-webworker
|
|
15
|
+
*/
|
|
16
|
+
declare const webCacheWorker: {
|
|
17
|
+
readonly [x: number]: Worker;
|
|
18
|
+
} & import('comlink').RemoteObject<typeof import("./worker-webcache")> & import('comlink').ProxyMethods;
|
|
19
|
+
/**
|
|
20
|
+
* 前端大图片,瓦片化加载-webworker
|
|
21
|
+
*/
|
|
22
|
+
declare const bigImageWorker: {
|
|
23
|
+
readonly [x: number]: Worker;
|
|
24
|
+
} & import('comlink').RemoteObject<typeof import("./worker-bigimage")> & import('comlink').ProxyMethods;
|
|
25
|
+
export { xmathWorker, xxteaWorker, webCacheWorker, bigImageWorker };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 以前端切片方式加载大图片,只支持图片格式 jpg\png 不支持tif
|
|
3
|
+
* @param imageID
|
|
4
|
+
* @param imageUrl
|
|
5
|
+
* @param imageGeoBounds
|
|
6
|
+
* @param maxUnitSize
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadBigImage(imageID: string, imageUrl: string, imageGeoBounds: number[], maxUnitSize?: number): Promise<{
|
|
10
|
+
id: string;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
maxUnitSize: number;
|
|
14
|
+
colNum: number;
|
|
15
|
+
rowNum: number;
|
|
16
|
+
items: any[];
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LRUCache } from 'lru-cache';
|
|
2
|
+
declare function createCache(cacheKey: string, options?: any): Promise<LRUCache<{}, {}, unknown>>;
|
|
3
|
+
declare function getCacheObject(cacheObjKey?: string): Promise<LRUCache<any, any, unknown> | undefined>;
|
|
4
|
+
declare function set(key: string, value: any, cacheObjKey?: string): Promise<boolean>;
|
|
5
|
+
declare function get(key: string, cacheObjKey?: string): Promise<any>;
|
|
6
|
+
declare function remove(key: string, cacheObjKey?: string): Promise<boolean | undefined>;
|
|
7
|
+
declare function has(key: string, cacheObjKey?: string): Promise<boolean>;
|
|
8
|
+
declare function count(cacheObjKey?: string): Promise<number>;
|
|
9
|
+
declare function maxSize(cacheObjKey?: string): Promise<number>;
|
|
10
|
+
declare function peek(key: string, cacheObjKey?: string): Promise<any>;
|
|
11
|
+
declare function clear(cacheObjKey?: string): Promise<boolean>;
|
|
12
|
+
declare function keys(cacheObjKey?: string): Promise<Generator<any, void, unknown> | undefined>;
|
|
13
|
+
export { clear, count, maxSize, createCache, get, getCacheObject, has, keys, peek, remove, set, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { initWorker } from './frontWorker';
|
|
2
|
+
/**
|
|
3
|
+
* 注册 webworker的相关方法
|
|
4
|
+
* @param components Webworker Service的相关方法
|
|
5
|
+
* @param worker
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
declare function registerWorkerSerivces(components: Record<string, unknown>, worker: Worker): any;
|
|
9
|
+
export { initWorker, registerWorkerSerivces };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xframelib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "积累的前端开发基础库,来源于项目,服务于项目。",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"common": "dist/index.cjs",
|
|
@@ -32,12 +32,13 @@
|
|
|
32
32
|
"@hprose/rpc-html5": "^3.0.10",
|
|
33
33
|
"@iconify-icons/ant-design": "^1.2.7",
|
|
34
34
|
"@iconify/vue": "^5.0.0",
|
|
35
|
-
"@microsoft/signalr": "^
|
|
36
|
-
"axios": "^1.
|
|
35
|
+
"@microsoft/signalr": "^9.0.6",
|
|
36
|
+
"axios": "^1.11.0",
|
|
37
37
|
"fflate": "^0.8.2",
|
|
38
|
-
"iconv-lite": "^0.
|
|
38
|
+
"iconv-lite": "^0.7.0",
|
|
39
39
|
"localforage": "^1.10.0",
|
|
40
40
|
"loglevel": "^1.9.2",
|
|
41
|
+
"lru-cache": "^11.1.0",
|
|
41
42
|
"qs": "^6.14.0",
|
|
42
43
|
"spark-md5": "^3.0.2",
|
|
43
44
|
"xhr": "^2.6.0"
|
|
@@ -49,22 +50,22 @@
|
|
|
49
50
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
50
51
|
"@rollup/plugin-terser": "^0.4.4",
|
|
51
52
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
52
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
53
|
-
"esbuild": "^0.25.
|
|
53
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
54
|
+
"esbuild": "^0.25.9",
|
|
54
55
|
"rollup-plugin-copy": "^3.5.0",
|
|
55
56
|
"rollup-plugin-esbuild": "^6.2.1",
|
|
56
57
|
"rollup-plugin-scss": "^4.0.1",
|
|
57
58
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
58
59
|
"rollup-plugin-vue": "^6.0.0",
|
|
59
|
-
"sass": "^1.
|
|
60
|
-
"typescript": "^5.
|
|
61
|
-
"vite": "^7.
|
|
62
|
-
"vite-plugin-comlink": "^5.
|
|
60
|
+
"sass": "^1.90.0",
|
|
61
|
+
"typescript": "^5.9.2",
|
|
62
|
+
"vite": "^7.1.3",
|
|
63
|
+
"vite-plugin-comlink": "^5.3.0",
|
|
63
64
|
"vite-plugin-commonjs": "^0.10.4",
|
|
64
65
|
"vite-plugin-dts": "^4.5.4",
|
|
65
66
|
"vite-plugin-node-polyfills": "^0.24.0",
|
|
66
|
-
"vite-plugin-static-copy": "^3.1.
|
|
67
|
-
"vue": "^3.5.
|
|
67
|
+
"vite-plugin-static-copy": "^3.1.2",
|
|
68
|
+
"vue": "^3.5.19",
|
|
68
69
|
"vue-router": "^4.5.1"
|
|
69
70
|
}
|
|
70
71
|
}
|