@corbe30/fortune-excel 1.0.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.
Files changed (44) hide show
  1. package/.github/workflows/main.yml +30 -0
  2. package/.github/workflows/publish.yml +30 -0
  3. package/.storybook/main.ts +18 -0
  4. package/.storybook/preview.ts +15 -0
  5. package/LICENSE +21 -0
  6. package/README.md +59 -0
  7. package/dist/HandleZip.d.ts +8 -0
  8. package/dist/HandleZip.js +37 -0
  9. package/dist/ICommon.d.ts +34 -0
  10. package/dist/ICommon.js +1 -0
  11. package/dist/ToExcel/ExcelBorder.d.ts +3 -0
  12. package/dist/ToExcel/ExcelBorder.js +1412 -0
  13. package/dist/ToExcel/ExcelConvert.d.ts +16 -0
  14. package/dist/ToExcel/ExcelConvert.js +92 -0
  15. package/dist/ToExcel/ExcelFile.d.ts +1 -0
  16. package/dist/ToExcel/ExcelFile.js +30 -0
  17. package/dist/ToExcel/ExcelImage.d.ts +2 -0
  18. package/dist/ToExcel/ExcelImage.js +64 -0
  19. package/dist/ToExcel/ExcelStyle.d.ts +3 -0
  20. package/dist/ToExcel/ExcelStyle.js +53 -0
  21. package/dist/ToFortuneSheet/FortuneBase.d.ts +133 -0
  22. package/dist/ToFortuneSheet/FortuneBase.js +28 -0
  23. package/dist/ToFortuneSheet/FortuneCell.d.ts +25 -0
  24. package/dist/ToFortuneSheet/FortuneCell.js +782 -0
  25. package/dist/ToFortuneSheet/FortuneFile.d.ts +50 -0
  26. package/dist/ToFortuneSheet/FortuneFile.js +432 -0
  27. package/dist/ToFortuneSheet/FortuneImage.d.ts +20 -0
  28. package/dist/ToFortuneSheet/FortuneImage.js +51 -0
  29. package/dist/ToFortuneSheet/FortuneSheet.d.ts +36 -0
  30. package/dist/ToFortuneSheet/FortuneSheet.js +581 -0
  31. package/dist/ToFortuneSheet/IFortune.d.ts +301 -0
  32. package/dist/ToFortuneSheet/IFortune.js +1 -0
  33. package/dist/ToFortuneSheet/ReadXml.d.ts +61 -0
  34. package/dist/ToFortuneSheet/ReadXml.js +337 -0
  35. package/dist/common/constant.d.ts +25 -0
  36. package/dist/common/constant.js +277 -0
  37. package/dist/common/emf.d.ts +3 -0
  38. package/dist/common/emf.js +1294 -0
  39. package/dist/common/method.d.ts +132 -0
  40. package/dist/common/method.js +1075 -0
  41. package/dist/main.d.ts +2 -0
  42. package/dist/main.js +24 -0
  43. package/package.json +47 -0
  44. package/tsconfig.json +13 -0
@@ -0,0 +1,132 @@
1
+ import { IfortuneSheetSelection } from "../ToFortuneSheet/IFortune.js";
2
+ import { IattributeList, stringToNum } from "../ICommon.js";
3
+ import ExcelJS from "exceljs";
4
+ export declare function getRangetxt(range: IfortuneSheetSelection, sheettxt: string): string;
5
+ export declare function getcellrange(txt: string, sheets?: IattributeList, sheetId?: string): {
6
+ row: number[];
7
+ column: number[];
8
+ sheetIndex: number;
9
+ };
10
+ /**
11
+ * @return ratio, default 0.75 1in = 2.54cm = 25.4mm = 72pt = 6pc, pt = 1/72 In, px = 1/dpi In
12
+ */
13
+ export declare function getptToPxRatioByDPI(): number;
14
+ /**
15
+ * @emus EMUs, Excel drawing unit
16
+ * @return pixel
17
+ */
18
+ export declare function getPxByEMUs(emus: number): number;
19
+ /**
20
+ * @dom xml attribute object
21
+ * @attr attribute name
22
+ * @d if attribute is null, return default value
23
+ * @return attribute value
24
+ */
25
+ export declare function getXmlAttibute(dom: IattributeList, attr: string, d: string): string;
26
+ /**
27
+ * @columnWidth Excel column width
28
+ * @return pixel column width
29
+ */
30
+ export declare function getColumnWidthPixel(columnWidth: number): number;
31
+ /**
32
+ * @rowHeight Excel row height
33
+ * @return pixel row height
34
+ */
35
+ export declare function getRowHeightPixel(rowHeight: number): number;
36
+ export declare function LightenDarkenColor(sixColor: string, tint: number): string;
37
+ export declare function generateRandomIndex(prefix: string): string;
38
+ export declare function escapeCharacter(str: string): string;
39
+ export declare class fromulaRef {
40
+ static operator: string;
41
+ static error: {
42
+ v: string;
43
+ n: string;
44
+ na: string;
45
+ r: string;
46
+ d: string;
47
+ nm: string;
48
+ nl: string;
49
+ sp: string;
50
+ };
51
+ static operatorjson: stringToNum;
52
+ static trim(str: string): string;
53
+ static functionCopy(txt: string, mode: string, step: number): string;
54
+ static downparam(txt: string, step: number): string;
55
+ static upparam(txt: string, step: number): string;
56
+ static leftparam(txt: string, step: number): string;
57
+ static rightparam(txt: string, step: number): string;
58
+ static updateparam(orient: string, txt: string, step: number): string;
59
+ static iscelldata(txt: string): boolean;
60
+ static isfreezonFuc(txt: string): boolean[];
61
+ }
62
+ export declare function isChinese(temp: string): boolean;
63
+ export declare function isJapanese(temp: string): boolean;
64
+ export declare function isKoera(chr: any): boolean;
65
+ export declare function isContainMultiType(str: string): boolean;
66
+ /**
67
+ * multi sequence conversion
68
+ * example:
69
+ * 1、E14 -> 13_4
70
+ * 2、E14 J14 O14 T14 Y14 AD14 AI14 AN14 AS14 AX14 ->
71
+ * ['13_4', '13_9','13_14', '13_19', '13_24', '13_3', '13_8', '13_13', '13_18', '13_23']
72
+ * 3、E46:E47 -> ['45_4', '46_4']
73
+ *
74
+ * @param {string} sqref - before sequence
75
+ * @returns {string[]}
76
+ */
77
+ export declare function getMultiSequenceToNum(sqref: string): string[];
78
+ /**
79
+ * get region sequence
80
+ * example:
81
+ * 1、[A1:C2'] -> ['A1', 'A2', 'B1', 'B2', 'C1', 'C2']
82
+ *
83
+ * @param {string[]} arr - formats arr
84
+ * @returns {string[]} - after arr
85
+ */
86
+ export declare function getRegionSequence(arr: string[]): string[];
87
+ /**
88
+ * unified processing of conversion formats
89
+ * example:
90
+ * 1、['E38', 'A1:C2'] -> ['E38', 'A1', 'A2', 'B1', 'B2', 'C1', 'C2']
91
+ *
92
+ * @param {string[]} arr - formats arr
93
+ * @returns {string[]} - after arr
94
+ */
95
+ export declare function getSqrefRawArrFormat(arr: string[]): string[];
96
+ /**
97
+ * single sequence to number
98
+ * example:
99
+ * 1、A1 -> 0_0
100
+ * 2、ES14 -> 13_4
101
+ *
102
+ * @param {string} sqref - before sequence
103
+ * @returns {string} - after sequence
104
+ */
105
+ export declare function getSingleSequenceToNum(sqref: string): string;
106
+ /**
107
+ * R1C1 to Sequence
108
+ * example: sheet2!R1C1 => sheet!A1
109
+ *
110
+ * @param {string} value - R1C1 value
111
+ * @returns
112
+ */
113
+ export declare function getTransR1C1ToSequence(value: string): string;
114
+ /**
115
+ * strip x14 format data
116
+ *
117
+ * @param {string} value
118
+ * @returns {Object} - { formula, sqref }
119
+ */
120
+ export declare function getPeelOffX14(value: string): {
121
+ [key: string]: any;
122
+ };
123
+ /**
124
+ * get the value in the formula
125
+ *
126
+ * @param {string} value - extracted value
127
+ * @returns {string[]}
128
+ */
129
+ export declare function getMultiFormulaValue(value: string): string[];
130
+ export declare var setMerge: (luckyMerge: {}, worksheet: ExcelJS.Worksheet) => void;
131
+ export declare var getObjType: (obj: Object) => string;
132
+ export declare var rgb2hex: (rgb: string) => string;