xl-public-utils 1.0.8 → 1.0.9

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.
Files changed (2) hide show
  1. package/index.d.ts +37 -10
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import vtkPolyData from "@kitware/vtk.js/Common/DataModel/PolyData";
1
2
  declare module "xl-public-utils" {
2
3
  export interface QrCodeOptions {
3
4
  /** 二维码类型,具体支持请查看文档 */
@@ -262,12 +263,22 @@ declare module "xl-public-utils" {
262
263
  export function createStlBlob(mesh: vtkPolyData): Blob;
263
264
  /**
264
265
  * 将网格压缩为drc文件,导出drc需要先加载draco_encode.js,并调用initDrcCoder初始化
265
- * @param {vtkPolyData | Mesh} mesh 网格文件
266
+ * @param {vtkPolyData} mesh 网格文件
267
+ * @param {number} byteLength=14 压缩率
268
+ * @returns {Blob} drc文件
269
+ */
270
+ export function createDrcBlob(
271
+ mesh: vtkPolyData,
272
+ byteLength?: number
273
+ ): Blob;
274
+ /**
275
+ * 将网格压缩为drc文件,导出drc需要先加载draco_encode.js,并调用initDrcCoder初始化
276
+ * @param {Mesh} mesh 网格文件
266
277
  * @param {number} byteLength=14 压缩率
267
278
  * @returns {Blob} drc文件
268
279
  */
269
280
  export function createDrcBlob(
270
- mesh: vtkPolyData | Mesh,
281
+ mesh: Mesh,
271
282
  byteLength?: number
272
283
  ): Blob;
273
284
  /**
@@ -360,16 +371,20 @@ declare module "xl-public-utils" {
360
371
  ): mat3;
361
372
  /**
362
373
  * 将polyData转换为Base64string
363
- * @param {vtkPolyData | Mesh} mesh 网格数据
374
+ * @param {vtkPolyData} mesh 网格数据
364
375
  * @param {mat4} [matrix] 变换矩阵
365
376
  * @param {number} byteLength=14 压缩率
366
377
  * @returns {string} drc压缩之后的网格base64
367
378
  */
368
- export function enCodeMeshToBase64(
369
- mesh: vtkPolyData | Mesh,
370
- matrix?: mat4,
371
- byteLength?: number
372
- ): string;
379
+ export function enCodeMeshToBase64(mesh: vtkPolyData,matrix?: mat4,byteLength?: number): string;
380
+ /**
381
+ * 将polyData转换为Base64string
382
+ * @param {Mesh} mesh 网格数据
383
+ * @param {mat4} [matrix] 变换矩阵
384
+ * @param {number} byteLength=14 压缩率
385
+ * @returns {string} drc压缩之后的网格base64
386
+ */
387
+ export function enCodeMeshToBase64(mesh: Mesh,matrix?: mat4,byteLength?: number): string;
373
388
  /**
374
389
  * 将一圈有序点按指定size进行平滑
375
390
  * @param {vec3[]} points 一圈有序点
@@ -650,13 +665,25 @@ declare module "xl-public-utils" {
650
665
  */
651
666
  /**
652
667
  * 使用drc压缩网格信息
653
- * @param {Mesh | vtkPolyData} mesh
668
+ * @param {vtkPolyData} mesh
669
+ * @param {number} byteLength=14 压缩率
670
+ * @param {AttrOption} [attr] 其他需要压缩的属性
671
+ * @returns {Int8Array} 压缩之后的DRC数据
672
+ */
673
+ export function enCodeMesh(
674
+ mesh: vtkPolyData,
675
+ byteLength?: number,
676
+ attr?: AttrOption
677
+ ): Int8Array;
678
+ /**
679
+ * 使用drc压缩网格信息
680
+ * @param {Mesh} mesh
654
681
  * @param {number} byteLength=14 压缩率
655
682
  * @param {AttrOption} [attr] 其他需要压缩的属性
656
683
  * @returns {Int8Array} 压缩之后的DRC数据
657
684
  */
658
685
  export function enCodeMesh(
659
- mesh: Mesh | vtkPolyData,
686
+ mesh: Mesh,
660
687
  byteLength?: number,
661
688
  attr?: AttrOption
662
689
  ): Int8Array;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xl-public-utils",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "index.js",