@jetprint/editor-sdk 1.2.1 → 1.2.3
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/dist/editor-sdk.es.js +133464 -35076
- package/dist/style.css +1 -1
- package/dist/utils/fileToken.d.ts +4 -2
- package/dist/utils/inlineWorkers.d.ts +13 -0
- package/dist/utils/protection/encryptedModules.generated.d.ts +1 -1
- package/dist/utils/workerBase.d.ts +1 -1
- package/dist/wasm/perspectiveLoader.worker.d.ts +5 -4
- package/dist/wasm/wasmInline.generated.d.ts +2 -0
- package/package.json +3 -2
- package/dist/assets/perspective.wasm +0 -0
- package/dist/assets/wasm_exec.js +0 -553
- package/dist/copyDiecuts.worker.js +0 -77
- package/dist/deform.worker.js +0 -760
- package/dist/favicon copy.ico +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/headless.global.js +0 -504
- package/dist/maskWorker.js +0 -51
- package/dist/prefetch.worker.js +0 -16
- package/dist/render.worker.js +0 -27266
- package/dist/renderWorker.js +0 -40389
- package/dist/sdk-workers/copyDiecuts.worker.js +0 -77
- package/dist/sdk-workers/deform.worker.js +0 -760
- package/dist/sdk-workers/maskWorker.js +0 -51
- package/dist/sdk-workers/prefetch.worker.js +0 -16
- package/dist/sdk-workers/render.worker.js +0 -27266
- package/dist/sdk-workers/renderWorker.js +0 -40380
- package/dist/sdk-workers/zoneScreenshotWorker.js +0 -82
- package/dist/vite.svg +0 -1
- package/dist/zoneScreenshotWorker.js +0 -82
|
@@ -6,7 +6,7 @@ type FileTokenFetchers = {
|
|
|
6
6
|
fetchFileTokenRefresh?: () => Promise<any>;
|
|
7
7
|
};
|
|
8
8
|
export declare function setFileTokenFetchers(fetchers: FileTokenFetchers | null): void;
|
|
9
|
-
export declare function setExternalFileToken(token: string | null): void;
|
|
9
|
+
export declare function setExternalFileToken(token: string | null, refresher?: (() => Promise<string | null>) | null): void;
|
|
10
10
|
export declare function getExternalFileToken(): string | null;
|
|
11
11
|
export declare function getFileTokenFetchers(): FileTokenFetchers | null;
|
|
12
12
|
export declare function ensureFileToken(): Promise<string | null>;
|
|
@@ -14,5 +14,7 @@ export declare function appendFileTokenToUrl(url: string, token?: string | null)
|
|
|
14
14
|
export declare function appendFileTokenIfPresent(url: string): string;
|
|
15
15
|
export declare function stripFileTokenParam(url: string): string;
|
|
16
16
|
export declare function withFileToken(url: string): Promise<string>;
|
|
17
|
-
export declare function fetchWithFileToken(url: string, options?: RequestInit
|
|
17
|
+
export declare function fetchWithFileToken(url: string, options?: RequestInit, opts?: {
|
|
18
|
+
forceToken?: boolean;
|
|
19
|
+
}): Promise<Response>;
|
|
18
20
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import LiveRenderWorker from '../components/Editor/liveRender/render.worker.ts?worker&inline';
|
|
2
|
+
import PrefetchWorker from '../components/Editor/liveRender/prefetch.worker.ts?worker&inline';
|
|
3
|
+
type WorkerCtor = new () => Worker;
|
|
4
|
+
/**
|
|
5
|
+
* key = worker 文件名(去掉 .ts/.js 扩展名)。
|
|
6
|
+
* createWorker 按调用路径的 basename 解析到对应构造器。
|
|
7
|
+
*/
|
|
8
|
+
export declare const INLINE_WORKER_REGISTRY: Record<string, WorkerCtor>;
|
|
9
|
+
/** 从任意 worker 路径取注册表 key(basename 去 .ts/.js)。 */
|
|
10
|
+
export declare function workerKeyFromPath(workerPath: string): string;
|
|
11
|
+
/** 解析 worker 路径到内联构造器;未注册返回 null(调用方回退到外部文件机制)。 */
|
|
12
|
+
export declare function resolveInlineWorker(workerPath: string): WorkerCtor | null;
|
|
13
|
+
export { LiveRenderWorker, PrefetchWorker };
|
|
@@ -18,7 +18,7 @@ export declare class WorkerManager<TRequest = any, TResponse = any> {
|
|
|
18
18
|
/**
|
|
19
19
|
* 创建 Worker
|
|
20
20
|
*/
|
|
21
|
-
protected createWorker(workerPath: string,
|
|
21
|
+
protected createWorker(workerPath: string, _isDev: boolean): Worker;
|
|
22
22
|
/**
|
|
23
23
|
* 设置 Worker 消息处理
|
|
24
24
|
*/
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 透视变换 WASM 模块加载器 (Worker 版本)
|
|
3
|
-
* 用于在 Web Worker 环境中加载和调用 TinyGo 编译的 WASM 模块
|
|
4
|
-
*/
|
|
5
1
|
export interface PerspectivePoint {
|
|
6
2
|
x: number;
|
|
7
3
|
y: number;
|
|
@@ -33,6 +29,11 @@ export declare class PerspectiveWasmWorker {
|
|
|
33
29
|
* @param wasmExecUrl wasm_exec.js 路径
|
|
34
30
|
*/
|
|
35
31
|
load(wasmUrl?: string, wasmExecUrl?: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* 内联执行 wasm_exec.js(默认方式,无需外部 fetch)
|
|
34
|
+
* 把打包进 bundle 的 Go 运行时源码在 Worker 全局上执行,注册 self.Go。
|
|
35
|
+
*/
|
|
36
|
+
private evalInlineWasmExec;
|
|
36
37
|
/**
|
|
37
38
|
* 在 Worker 中加载 wasm_exec.js
|
|
38
39
|
* Module Worker 不支持 importScripts(),仅 Classic Worker 可尝试 importScripts,否则用 fetch + eval
|