rapid-spreadjs 1.0.26 → 1.0.28

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.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 注册字体实体
3
+ */
4
+ export type RegisterFontModel = {
5
+ /** 字体名称,如:宋体 */
6
+ name: string;
7
+ /** 字体类型,如:normal 、bold 、italic 、bolditalic */
8
+ type: string;
9
+ /** 字体文件地址 */
10
+ url: string;
11
+ };
@@ -1,3 +1,4 @@
1
+ import { RegisterFontModel } from '../types/wookbook';
1
2
  /**
2
3
  * SpreadJS工作簿工具函数属性
3
4
  */
@@ -10,6 +11,21 @@ export declare const WorkbookUtils: {
10
11
  * @param errorFunc 文件打开失败后的回调函数,返回的第一个参数为错误信息
11
12
  */
12
13
  loadSjsFile: (spread: any, fileUrl: string, succFunc?: (spreadObj: any) => Promise<void>, errorFunc?: (error: any) => Promise<void>) => Promise<void>;
14
+ /**
15
+ * 获取工作簿的Blob对象
16
+ * @param spread 工作簿实例
17
+ * @returns 返回异步的Promise对象(Blob对象)
18
+ * @example
19
+ * const saveSpread = async (spread: any) => {
20
+ * try {
21
+ * const blob = await WorkbookUtils.getWookbookBlob(spread);
22
+ * console.log('获取成功:', blob);
23
+ * } catch (error) {
24
+ * console.error('获取失败:', error);
25
+ * }
26
+ * };
27
+ */
28
+ getWookbookBlob: (spread: any) => Promise<Blob>;
13
29
  /**
14
30
  * 打印所有工作表
15
31
  * @param GC GC对象
@@ -24,4 +40,18 @@ export declare const WorkbookUtils: {
24
40
  * @param fileName 导出的文件名称,不传则为第一个工作表的名称
25
41
  */
26
42
  exportToExcel: (GC: any, spread: any, fileName?: string) => void;
43
+ /**
44
+ * 合并多个工作簿并导出Excel(同时返回合并后的工作簿实例)
45
+ * @param GC Spread的GC对象
46
+ * @param spreads 工作簿实例集合
47
+ * @param exportName 导出的文件名称,不传则为第一个Sheet的名称
48
+ * @returns 合并后的工作簿实例
49
+ */
50
+ mergeWorkbooksToExcel: (GC: any, spreads: any[], exportName?: string) => Promise<any>;
51
+ /**
52
+ * 注册字体(主要为导出PDF使用)
53
+ * @param GC Spread的GC对象
54
+ * @param regFonts 字体配置集合
55
+ */
56
+ registerFont: (GC: any, regFonts: RegisterFontModel[]) => Promise<unknown>;
27
57
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapid-spreadjs",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "description": "SpreadJS常用公用处理函数,包括设计器、工作簿和工作表的相关处理函数。",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",