@leankylin-sheet/formula-parser 3.1.29 → 3.1.31

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 (69) hide show
  1. package/dist/error.d.ts +10 -0
  2. package/dist/evaluate-by-operator/evaluate-by-operator.d.ts +2 -0
  3. package/dist/evaluate-by-operator/operator/add.d.ts +6 -0
  4. package/dist/evaluate-by-operator/operator/ampersand.d.ts +6 -0
  5. package/dist/evaluate-by-operator/operator/divide.d.ts +6 -0
  6. package/dist/evaluate-by-operator/operator/equal.d.ts +6 -0
  7. package/dist/evaluate-by-operator/operator/formula-function.d.ts +7 -0
  8. package/dist/evaluate-by-operator/operator/greater-than-or-equal.d.ts +6 -0
  9. package/dist/evaluate-by-operator/operator/greater-than.d.ts +6 -0
  10. package/dist/evaluate-by-operator/operator/less-than-or-equal.d.ts +6 -0
  11. package/dist/evaluate-by-operator/operator/less-than.d.ts +6 -0
  12. package/dist/evaluate-by-operator/operator/minus.d.ts +6 -0
  13. package/dist/evaluate-by-operator/operator/multiply.d.ts +6 -0
  14. package/dist/evaluate-by-operator/operator/not-equal.d.ts +6 -0
  15. package/dist/evaluate-by-operator/operator/power.d.ts +6 -0
  16. package/dist/grammar-parser/grammar-parser.d.ts +4 -0
  17. package/dist/helper/cell.d.ts +6 -0
  18. package/dist/helper/number.d.ts +2 -0
  19. package/dist/helper/string.d.ts +1 -0
  20. package/{es/index.js → dist/index.d.ts} +5 -5
  21. package/{lib/grammar-parser/grammar-parser.js → dist/index.esm.js} +856 -46
  22. package/{es/grammar-parser/grammar-parser.js → dist/index.js} +903 -42
  23. package/dist/parser.d.ts +20 -0
  24. package/dist/supported-formulas.d.ts +2 -0
  25. package/package.json +6 -18
  26. package/LICENSE +0 -21
  27. package/es/error.js +0 -45
  28. package/es/evaluate-by-operator/evaluate-by-operator.js +0 -70
  29. package/es/evaluate-by-operator/operator/add.js +0 -16
  30. package/es/evaluate-by-operator/operator/ampersand.js +0 -10
  31. package/es/evaluate-by-operator/operator/divide.js +0 -21
  32. package/es/evaluate-by-operator/operator/equal.js +0 -5
  33. package/es/evaluate-by-operator/operator/formula-function.js +0 -40
  34. package/es/evaluate-by-operator/operator/greater-than-or-equal.js +0 -5
  35. package/es/evaluate-by-operator/operator/greater-than.js +0 -5
  36. package/es/evaluate-by-operator/operator/less-than-or-equal.js +0 -5
  37. package/es/evaluate-by-operator/operator/less-than.js +0 -5
  38. package/es/evaluate-by-operator/operator/minus.js +0 -16
  39. package/es/evaluate-by-operator/operator/multiply.js +0 -16
  40. package/es/evaluate-by-operator/operator/not-equal.js +0 -5
  41. package/es/evaluate-by-operator/operator/power.js +0 -11
  42. package/es/grammar-parser/grammar-parser.jison +0 -230
  43. package/es/helper/cell.js +0 -117
  44. package/es/helper/number.js +0 -25
  45. package/es/helper/string.js +0 -13
  46. package/es/parser.js +0 -306
  47. package/es/supported-formulas.js +0 -3
  48. package/lib/error.js +0 -53
  49. package/lib/evaluate-by-operator/evaluate-by-operator.js +0 -77
  50. package/lib/evaluate-by-operator/operator/add.js +0 -23
  51. package/lib/evaluate-by-operator/operator/ampersand.js +0 -17
  52. package/lib/evaluate-by-operator/operator/divide.js +0 -28
  53. package/lib/evaluate-by-operator/operator/equal.js +0 -12
  54. package/lib/evaluate-by-operator/operator/formula-function.js +0 -51
  55. package/lib/evaluate-by-operator/operator/greater-than-or-equal.js +0 -12
  56. package/lib/evaluate-by-operator/operator/greater-than.js +0 -12
  57. package/lib/evaluate-by-operator/operator/less-than-or-equal.js +0 -12
  58. package/lib/evaluate-by-operator/operator/less-than.js +0 -12
  59. package/lib/evaluate-by-operator/operator/minus.js +0 -23
  60. package/lib/evaluate-by-operator/operator/multiply.js +0 -23
  61. package/lib/evaluate-by-operator/operator/not-equal.js +0 -12
  62. package/lib/evaluate-by-operator/operator/power.js +0 -18
  63. package/lib/grammar-parser/grammar-parser.jison +0 -230
  64. package/lib/helper/cell.js +0 -128
  65. package/lib/helper/number.js +0 -32
  66. package/lib/helper/string.js +0 -19
  67. package/lib/index.js +0 -115
  68. package/lib/parser.js +0 -314
  69. package/lib/supported-formulas.js +0 -12
@@ -0,0 +1,10 @@
1
+ export default function error(type: string): string | null;
2
+ export function isValidStrict(type: any): boolean;
3
+ export const ERROR: "ERROR";
4
+ export const ERROR_DIV_ZERO: "DIV/0";
5
+ export const ERROR_NAME: "NAME";
6
+ export const ERROR_NOT_AVAILABLE: "N/A";
7
+ export const ERROR_NULL: "NULL";
8
+ export const ERROR_NUM: "NUM";
9
+ export const ERROR_REF: "REF";
10
+ export const ERROR_VALUE: "VALUE";
@@ -0,0 +1,2 @@
1
+ export default function evaluateByOperator(operator: string, params?: any[] | undefined): any;
2
+ export function registerOperation(symbol: string | any[], func: Function): void;
@@ -0,0 +1,6 @@
1
+ declare function func(first: any, ...rest: any[]): any;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: "+";
@@ -0,0 +1,6 @@
1
+ declare function func(...params: any[]): any;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: "&";
@@ -0,0 +1,6 @@
1
+ declare function func(first: any, ...rest: any[]): any;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: "/";
@@ -0,0 +1,6 @@
1
+ declare function func(exp1: any, exp2: any): boolean;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: "=";
@@ -0,0 +1,7 @@
1
+ declare function func(symbol: any): (...params: any[]) => any;
2
+ declare namespace func {
3
+ export const isFactory: boolean;
4
+ export { SYMBOL };
5
+ }
6
+ export default func;
7
+ export const SYMBOL: string[];
@@ -0,0 +1,6 @@
1
+ declare function func(exp1: any, exp2: any): boolean;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: ">=";
@@ -0,0 +1,6 @@
1
+ declare function func(exp1: any, exp2: any): boolean;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: ">";
@@ -0,0 +1,6 @@
1
+ declare function func(exp1: any, exp2: any): boolean;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: "<=";
@@ -0,0 +1,6 @@
1
+ declare function func(exp1: any, exp2: any): boolean;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: "<";
@@ -0,0 +1,6 @@
1
+ declare function func(first: any, ...rest: any[]): any;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: "-";
@@ -0,0 +1,6 @@
1
+ declare function func(first: any, ...rest: any[]): any;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: "*";
@@ -0,0 +1,6 @@
1
+ declare function func(exp1: any, exp2: any): boolean;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: "<>";
@@ -0,0 +1,6 @@
1
+ declare function func(exp1: any, exp2: any): number;
2
+ declare namespace func {
3
+ export { SYMBOL };
4
+ }
5
+ export default func;
6
+ export const SYMBOL: "^";
@@ -0,0 +1,4 @@
1
+ export function Parser(): void;
2
+ export class Parser {
3
+ yy: {};
4
+ }
@@ -0,0 +1,6 @@
1
+ export function rowLabelToIndex(label: string): number;
2
+ export function rowIndexToLabel(row: number): string;
3
+ export function columnLabelToIndex(label: string): number;
4
+ export function columnIndexToLabel(column: number): string;
5
+ export function extractLabel(label: string): any[];
6
+ export function toLabel(row: Object, column: Object): string;
@@ -0,0 +1,2 @@
1
+ export function toNumber(number: string | number): any;
2
+ export function invertNumber(number: number): number;
@@ -0,0 +1 @@
1
+ export function trimEdges(string: string, margin?: number | undefined): string;
@@ -1,5 +1,5 @@
1
- import Parser from './parser';
2
- import SUPPORTED_FORMULAS from './supported-formulas';
3
- import error, { ERROR, ERROR_DIV_ZERO, ERROR_NAME, ERROR_NOT_AVAILABLE, ERROR_NULL, ERROR_NUM, ERROR_REF, ERROR_VALUE } from './error';
4
- import { extractLabel, toLabel, columnIndexToLabel, columnLabelToIndex, rowIndexToLabel, rowLabelToIndex } from './helper/cell';
5
- export { SUPPORTED_FORMULAS, ERROR, ERROR_DIV_ZERO, ERROR_NAME, ERROR_NOT_AVAILABLE, ERROR_NULL, ERROR_NUM, ERROR_REF, ERROR_VALUE, Parser, error, extractLabel, toLabel, columnIndexToLabel, columnLabelToIndex, rowIndexToLabel, rowLabelToIndex };
1
+ import Parser from "./parser";
2
+ import SUPPORTED_FORMULAS from "./supported-formulas";
3
+ import error, { ERROR, ERROR_DIV_ZERO, ERROR_NAME, ERROR_NOT_AVAILABLE, ERROR_NULL, ERROR_NUM, ERROR_REF, ERROR_VALUE } from "./error";
4
+ import { extractLabel, toLabel, columnIndexToLabel, columnLabelToIndex, rowIndexToLabel, rowLabelToIndex } from "./helper/cell";
5
+ export { SUPPORTED_FORMULAS, ERROR, ERROR_DIV_ZERO, ERROR_NAME, ERROR_NOT_AVAILABLE, ERROR_NULL, ERROR_NUM, ERROR_REF, ERROR_VALUE, Parser, error, extractLabel, toLabel, columnIndexToLabel, columnLabelToIndex, rowIndexToLabel, rowLabelToIndex, };