oolong-engine 0.0.2-t.1 → 0.0.2-t.2

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.
@@ -53,15 +53,15 @@ export declare class OolongApp {
53
53
  * 异步加载文档数据,等待所有资源(包括图片和SVG)完全加载完成后返回
54
54
  * 适用于缩略图渲染等需要确保所有节点完全渲染的场景
55
55
  * @param documentInfo 文档信息
56
- * @param resourceMap 可选的资源映射,key 是图片节点的原始 url,value 是预处理好的 blobUrl
56
+ * @param resourceMap 可选的资源映射,key 是图片/SVG节点的原始 url,value 是预处理好的 ImageBitmap
57
57
  * @returns Promise<number> 返回文档序列号
58
58
  */
59
- asyncLoad(documentInfo: DocumentInfo, resourceMap?: Map<string, string>): Promise<number>;
59
+ asyncLoad(documentInfo: DocumentInfo, resourceMap?: Map<string, ImageBitmap>): number;
60
60
  /**
61
61
  * 异步加载文档信息,等待所有资源完全加载
62
- * @param resourceMap 可选的资源映射,key 是图片节点的原始 url,value 是预处理好的 blobUrl
62
+ * @param resourceMap 可选的资源映射,key 是图片/SVG节点的原始 url,value 是预处理好的 ImageBitmap
63
63
  */
64
- asyncLoadDocumentInfo(documentInfo: DocumentInfo, resourceMap?: Map<string, string>): Promise<number>;
64
+ asyncLoadDocumentInfo(documentInfo: DocumentInfo, resourceMap?: Map<string, ImageBitmap>): number;
65
65
  loadDocumentInfo(documentInfo: DocumentInfo): number;
66
66
  initData(data: DocumentInfo): GraphicNode[];
67
67
  initNode(nodeInfo: NodeInfo, parent: GraphicNode, glCtx: CanvasRenderingContext2D, graphics: GraphicNode[]): GraphicNode;
@@ -70,18 +70,7 @@ export declare class OolongApp {
70
70
  * 异步初始化后处理,支持从 resourceMap 直接加载图片资源
71
71
  * 所有资源都在此方法中同步等待完成,不再添加到异步渲染队列
72
72
  * @param graphics 图形节点列表
73
- * @param resourceMap 可选的资源映射,key 是图片节点的原始 url,value 是预处理好的 blobUrl
73
+ * @param resourceMap 可选的资源映射,key 是图片/SVG节点的原始 url,value 是预处理好的 ImageBitmap
74
74
  */
75
- asyncAfterInit(graphics: GraphicNode[], resourceMap?: Map<string, string>): Promise<void>;
76
- /**
77
- * 生成 SVG 节点的 ImageBitmap
78
- * @param svgNode SVG 节点
79
- * @param svgCode SVG 代码
80
- */
81
- private genSvgBitmap;
82
- /**
83
- * 从 URL 加载 ImageBitmap
84
- * @param url 图片 URL(可以是 blobUrl 或普通 URL)
85
- */
86
- private loadImageBitmapFromUrl;
75
+ asyncAfterInit(graphics: GraphicNode[], resourceMap?: Map<string, ImageBitmap>): void;
87
76
  }