@gridsheet/engine 3.3.0

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 (119) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +50 -0
  3. package/dist/constants.d.ts +21 -0
  4. package/dist/constants.d.ts.map +1 -0
  5. package/dist/formula/evaluator.d.ts +135 -0
  6. package/dist/formula/evaluator.d.ts.map +1 -0
  7. package/dist/formula/formula-error.d.ts +10 -0
  8. package/dist/formula/formula-error.d.ts.map +1 -0
  9. package/dist/formula/functions/__async.d.ts +67 -0
  10. package/dist/formula/functions/__async.d.ts.map +1 -0
  11. package/dist/formula/functions/__base.d.ts +120 -0
  12. package/dist/formula/functions/__base.d.ts.map +1 -0
  13. package/dist/formula/functions/__utils.d.ts +30 -0
  14. package/dist/formula/functions/__utils.d.ts.map +1 -0
  15. package/dist/formula/functions/abs.d.ts +9 -0
  16. package/dist/formula/functions/abs.d.ts.map +1 -0
  17. package/dist/formula/functions/add.d.ts +10 -0
  18. package/dist/formula/functions/add.d.ts.map +1 -0
  19. package/dist/formula/functions/and.d.ts +9 -0
  20. package/dist/formula/functions/and.d.ts.map +1 -0
  21. package/dist/formula/functions/arrayformula.d.ts +12 -0
  22. package/dist/formula/functions/arrayformula.d.ts.map +1 -0
  23. package/dist/formula/functions/average.d.ts +9 -0
  24. package/dist/formula/functions/average.d.ts.map +1 -0
  25. package/dist/formula/functions/concat.d.ts +9 -0
  26. package/dist/formula/functions/concat.d.ts.map +1 -0
  27. package/dist/formula/functions/count.d.ts +9 -0
  28. package/dist/formula/functions/count.d.ts.map +1 -0
  29. package/dist/formula/functions/counta.d.ts +9 -0
  30. package/dist/formula/functions/counta.d.ts.map +1 -0
  31. package/dist/formula/functions/divide.d.ts +10 -0
  32. package/dist/formula/functions/divide.d.ts.map +1 -0
  33. package/dist/formula/functions/eq.d.ts +9 -0
  34. package/dist/formula/functions/eq.d.ts.map +1 -0
  35. package/dist/formula/functions/gt.d.ts +9 -0
  36. package/dist/formula/functions/gt.d.ts.map +1 -0
  37. package/dist/formula/functions/gte.d.ts +9 -0
  38. package/dist/formula/functions/gte.d.ts.map +1 -0
  39. package/dist/formula/functions/if.d.ts +9 -0
  40. package/dist/formula/functions/if.d.ts.map +1 -0
  41. package/dist/formula/functions/iferror.d.ts +10 -0
  42. package/dist/formula/functions/iferror.d.ts.map +1 -0
  43. package/dist/formula/functions/len.d.ts +9 -0
  44. package/dist/formula/functions/len.d.ts.map +1 -0
  45. package/dist/formula/functions/lt.d.ts +9 -0
  46. package/dist/formula/functions/lt.d.ts.map +1 -0
  47. package/dist/formula/functions/lte.d.ts +9 -0
  48. package/dist/formula/functions/lte.d.ts.map +1 -0
  49. package/dist/formula/functions/max.d.ts +9 -0
  50. package/dist/formula/functions/max.d.ts.map +1 -0
  51. package/dist/formula/functions/min.d.ts +9 -0
  52. package/dist/formula/functions/min.d.ts.map +1 -0
  53. package/dist/formula/functions/minus.d.ts +10 -0
  54. package/dist/formula/functions/minus.d.ts.map +1 -0
  55. package/dist/formula/functions/multiply.d.ts +9 -0
  56. package/dist/formula/functions/multiply.d.ts.map +1 -0
  57. package/dist/formula/functions/ne.d.ts +9 -0
  58. package/dist/formula/functions/ne.d.ts.map +1 -0
  59. package/dist/formula/functions/not.d.ts +9 -0
  60. package/dist/formula/functions/not.d.ts.map +1 -0
  61. package/dist/formula/functions/now.d.ts +9 -0
  62. package/dist/formula/functions/now.d.ts.map +1 -0
  63. package/dist/formula/functions/or.d.ts +9 -0
  64. package/dist/formula/functions/or.d.ts.map +1 -0
  65. package/dist/formula/functions/power.d.ts +9 -0
  66. package/dist/formula/functions/power.d.ts.map +1 -0
  67. package/dist/formula/functions/sum.d.ts +9 -0
  68. package/dist/formula/functions/sum.d.ts.map +1 -0
  69. package/dist/formula/functions/uminus.d.ts +9 -0
  70. package/dist/formula/functions/uminus.d.ts.map +1 -0
  71. package/dist/formula/mapping.d.ts +11 -0
  72. package/dist/formula/mapping.d.ts.map +1 -0
  73. package/dist/formula/solver.d.ts +39 -0
  74. package/dist/formula/solver.d.ts.map +1 -0
  75. package/dist/index.d.ts +31 -0
  76. package/dist/index.d.ts.map +1 -0
  77. package/dist/index.js +4888 -0
  78. package/dist/index.js.map +1 -0
  79. package/dist/lib/autofill.d.ts +22 -0
  80. package/dist/lib/autofill.d.ts.map +1 -0
  81. package/dist/lib/book.d.ts +141 -0
  82. package/dist/lib/book.d.ts.map +1 -0
  83. package/dist/lib/cell.d.ts +17 -0
  84. package/dist/lib/cell.d.ts.map +1 -0
  85. package/dist/lib/coords.d.ts +22 -0
  86. package/dist/lib/coords.d.ts.map +1 -0
  87. package/dist/lib/date.d.ts +2 -0
  88. package/dist/lib/date.d.ts.map +1 -0
  89. package/dist/lib/filter.d.ts +7 -0
  90. package/dist/lib/filter.d.ts.map +1 -0
  91. package/dist/lib/label.d.ts +4 -0
  92. package/dist/lib/label.d.ts.map +1 -0
  93. package/dist/lib/operation.d.ts +31 -0
  94. package/dist/lib/operation.d.ts.map +1 -0
  95. package/dist/lib/palette.d.ts +2 -0
  96. package/dist/lib/palette.d.ts.map +1 -0
  97. package/dist/lib/reference.d.ts +19 -0
  98. package/dist/lib/reference.d.ts.map +1 -0
  99. package/dist/lib/sheet.d.ts +626 -0
  100. package/dist/lib/sheet.d.ts.map +1 -0
  101. package/dist/lib/sheet_utils.d.ts +52 -0
  102. package/dist/lib/sheet_utils.d.ts.map +1 -0
  103. package/dist/lib/spatial.d.ts +79 -0
  104. package/dist/lib/spatial.d.ts.map +1 -0
  105. package/dist/lib/time.d.ts +29 -0
  106. package/dist/lib/time.d.ts.map +1 -0
  107. package/dist/policy/core.d.ts +161 -0
  108. package/dist/policy/core.d.ts.map +1 -0
  109. package/dist/policy/percentage.d.ts +3 -0
  110. package/dist/policy/percentage.d.ts.map +1 -0
  111. package/dist/policy/thousand_separator.d.ts +4 -0
  112. package/dist/policy/thousand_separator.d.ts.map +1 -0
  113. package/dist/sentinels.d.ts +41 -0
  114. package/dist/sentinels.d.ts.map +1 -0
  115. package/dist/types.d.ts +313 -0
  116. package/dist/types.d.ts.map +1 -0
  117. package/dist/utils.d.ts +2 -0
  118. package/dist/utils.d.ts.map +1 -0
  119. package/package.json +63 -0
@@ -0,0 +1,52 @@
1
+ import { Address, AreaType, CellsByAddressType, CellType, CellFilter, Resolution } from '../types';
2
+ import { UserSheet } from './sheet';
3
+ import { SolveOptions } from '../formula/solver';
4
+ type CellField = keyof CellType;
5
+ type ToProps = {
6
+ resolution?: Resolution;
7
+ raise?: boolean;
8
+ filter?: CellFilter;
9
+ asScalar?: boolean;
10
+ area?: AreaType;
11
+ };
12
+ type ToCellProps = ToProps & {
13
+ ignoreFields?: CellField[];
14
+ };
15
+ /**
16
+ * @internal — used by Sheet._toValueMatrix and solver.ts; keeps resolution for internal wiring.
17
+ */
18
+ export type ToValueMatrixProps = ToProps;
19
+ export type ToCellMatrixProps = ToCellProps;
20
+ export type ToValueObjectProps = ToProps & {
21
+ addresses?: Address[];
22
+ };
23
+ export type ToCellObjectProps = ToCellProps & {
24
+ addresses?: Address[];
25
+ };
26
+ export type ToValueRowsProps = ToProps & {
27
+ rows?: number[];
28
+ };
29
+ export type ToCellRowsProps = ToCellProps & {
30
+ rows?: number[];
31
+ };
32
+ export type ToValueColsProps = ToProps & {
33
+ cols?: (number | string)[];
34
+ };
35
+ export type ToCellColsProps = ToCellProps & {
36
+ cols?: (number | string)[];
37
+ };
38
+ export declare const getCellByAddress: (sheet: UserSheet, address: Address, options?: SolveOptions) => CellType | undefined;
39
+ export declare const toValueMatrix: (sheet: UserSheet, { area, resolution, raise, filter, asScalar }?: ToValueMatrixProps) => any[][];
40
+ export declare const toValueObject: (sheet: UserSheet, { resolution, raise, filter, addresses, area, asScalar, }?: ToValueObjectProps) => {
41
+ [address: Address]: any;
42
+ };
43
+ export declare const toValueRows: (sheet: UserSheet, { resolution, raise, filter, rows, area, asScalar }?: ToValueRowsProps) => CellsByAddressType[];
44
+ export declare const toValueCols: (sheet: UserSheet, { resolution, raise, filter, cols, area, asScalar }?: ToValueColsProps) => CellsByAddressType[];
45
+ export declare const toCellMatrix: (sheet: UserSheet, { area, resolution, raise, filter, ignoreFields }?: ToCellMatrixProps) => (CellType | null)[][];
46
+ export declare const toCellObject: (sheet: UserSheet, { resolution, raise, filter, addresses, area, ignoreFields, }?: ToCellObjectProps) => CellsByAddressType;
47
+ export declare const toCellRows: (sheet: UserSheet, { resolution, raise, filter, rows, area, ignoreFields }?: ToCellRowsProps) => CellsByAddressType[];
48
+ export declare const escapeSheetName: (name: string) => string;
49
+ export declare const toSheetPrefix: (name?: string) => string;
50
+ export declare const toCellCols: (sheet: UserSheet, { resolution, raise, filter, cols, area, ignoreFields }?: ToCellColsProps) => CellsByAddressType[];
51
+ export {};
52
+ //# sourceMappingURL=sheet_utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet_utils.d.ts","sourceRoot":"","sources":["../../src/lib/sheet_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAM,MAAM,UAAU,CAAC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIzC,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,KAAK,SAAS,GAAG,MAAM,QAAQ,CAAC;AAEhC,KAAK,OAAO,GAAG;IACb,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,KAAK,WAAW,GAAG,OAAO,GAAG;IAC3B,YAAY,CAAC,EAAE,SAAS,EAAE,CA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AO,SAAS,EAChB,sDAA6F,gBAAqB,KACjH,kBAAkB,EAsBpB,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,OAAO,SAAS,EAChB,oDAAwF,iBAAsB,KAC7G,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,EAarB,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,OAAO,SAAS,EAChB,gEAOG,iBAAsB,KACxB,kBAqBF,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,OAAO,SAAS,EAChB,0DAA8F,eAAoB,KACjH,kBAAkB,EAepB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,MAG9C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,MAK7C,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,OAAO,SAAS,EAChB,0DAA8F,eAAoB,KACjH,kBAAkB,EAiBpB,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { MatrixType, AreaType, ZoneType, RangeType, PointType, CellsByAddressType, ShapeType, MatricesByAddress, CellType, Address } from '../types';
2
+ export declare const superposeArea: (srcArea: AreaType, dstArea: AreaType) => ShapeType;
3
+ export declare const concatAreas: (area1: AreaType, area2: AreaType) => AreaType;
4
+ export declare const zoneToArea: (zone: ZoneType) => AreaType;
5
+ export declare const areaToZone: (area: AreaType) => ZoneType;
6
+ export declare const areaToRange: (area: AreaType) => string;
7
+ export declare const between: (range: RangeType, index: number) => boolean;
8
+ export declare const among: (area: AreaType, point: PointType) => boolean;
9
+ type ShapeExtension = {
10
+ base?: number;
11
+ };
12
+ export declare const zoneDiff: (zone: ZoneType) => ShapeType;
13
+ export declare const zoneShape: (zone: ZoneType) => ShapeType;
14
+ export declare const areaDiff: (area: AreaType) => ShapeType;
15
+ export declare const areaShape: (area: AreaType) => ShapeType;
16
+ export declare const matrixShape: ({ base, matrix }: {
17
+ matrix: MatrixType;
18
+ } & ShapeExtension) => ShapeType;
19
+ export declare const makeSequence: (start: number, stop: number, step?: number) => number[];
20
+ export declare const oa2aa: (oa: {
21
+ [s: string]: any;
22
+ }[], fields: string[]) => MatrixType;
23
+ export declare const aa2oa: (aa: MatrixType, fields: string[]) => {
24
+ [s: string]: any;
25
+ }[];
26
+ export declare const createMatrix: <T = any>(numRows: number, numCols: number, fill?: T) => T[][];
27
+ export declare const buildInitialCellsFromOrigin: ({ cells, ensured, matrix, flattenAs, origin, }: {
28
+ cells?: CellsByAddressType;
29
+ ensured?: {
30
+ numRows?: number;
31
+ numCols?: number;
32
+ };
33
+ flattenAs?: keyof CellType;
34
+ matrix?: MatrixType;
35
+ origin?: Address;
36
+ }) => CellsByAddressType;
37
+ export declare const buildInitialCells: ({ cells, ensured, matrices, flattenAs, }?: {
38
+ cells?: CellsByAddressType;
39
+ ensured?: {
40
+ numRows?: number;
41
+ numCols?: number;
42
+ };
43
+ flattenAs?: keyof CellType;
44
+ matrices?: MatricesByAddress<any>;
45
+ }) => CellsByAddressType;
46
+ export declare const buildCells: <T>({ cells, matrices, flattenAs, }: {
47
+ cells?: CellsByAddressType;
48
+ flattenAs?: keyof CellType;
49
+ matrices?: MatricesByAddress<T>;
50
+ }) => CellsByAddressType;
51
+ export declare const getMaxSizesFromCells: (cells?: CellsByAddressType, keys?: string[]) => {
52
+ numRows: number;
53
+ numCols: number;
54
+ };
55
+ export declare const range: (start: number, end: number) => number[];
56
+ export declare const complementSelectingArea: (selectingArea: AreaType, choosing: PointType) => AreaType;
57
+ export declare const expandRange: (range: string) => Address[];
58
+ export declare const restrictZone: (zone: ZoneType) => ZoneType;
59
+ export type BinarySearchPredicate = (mid: number) => boolean;
60
+ export declare const binarySearch: (low: number, high: number, predicate: BinarySearchPredicate, lessThan: boolean) => number;
61
+ /**
62
+ * Convert a list of addresses into an array of bounding areas.
63
+ * Adjacent cells (4-connected: up/down/left/right) are grouped into the same area.
64
+ * Each resulting AreaType is the bounding rectangle of one connected group.
65
+ */
66
+ export declare const addressesToAreas: (addresses: Address[]) => AreaType[];
67
+ /**
68
+ * Extract unique column indices (x) from a list of addresses, ignoring row information.
69
+ * @param asc - true: ascending, false: descending, null: insertion order
70
+ */
71
+ export declare const addressesToCols: (addresses: Address[], asc?: boolean | null) => number[];
72
+ /**
73
+ * Extract unique row indices (y) from a list of addresses, ignoring column information.
74
+ * @param asc - true: ascending, false: descending, null: insertion order
75
+ */
76
+ export declare const addressesToRows: (addresses: Address[], asc?: boolean | null) => number[];
77
+ export declare const isZoneNotSelected: (zone: ZoneType) => boolean;
78
+ export {};
79
+ //# sourceMappingURL=spatial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatial.d.ts","sourceRoot":"","sources":["../../src/lib/spatial.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACR,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,aAAa,GAAI,SAAS,QAAQ,EAAE,SAAS,QAAQ,KAAG,SASpE,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAG,QAe9D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,QAAQ,KAAG,QAO3C,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,QAAQ,KAAG,QAO3C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,MAAM,QAAQ,KAAG,MAQ5C,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,SAAS,EAAE,OAAO,MAAM,YAKtD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,MAAM,QAAQ,EAAE,OAAO,SAAS,YAOrD,CAAC;AAEF,KAAK,cAAc,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,eAAO,MAAM,QAAQ,GAAI,MAAM,QAAQ,KAAG,S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AI,WAAW,OAAO,EAAE,EAAE,MAAK,OAAO,GAAG,IAAW,KAAG,MAAM,EAgBxF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,QAAQ,KAAG,OAElD,CAAC"}
@@ -0,0 +1,29 @@
1
+ export declare class Time {
2
+ readonly __gsType: "Time";
3
+ readonly days: number;
4
+ format: string;
5
+ constructor(days: number, format?: string);
6
+ add(date: Date): Date;
7
+ sub(date: Date): Date;
8
+ stringify(format?: string): string;
9
+ toMilliseconds(): number;
10
+ toDate(): Date;
11
+ toJSON(): {
12
+ __gsType: 'Time';
13
+ days: number;
14
+ format: string;
15
+ };
16
+ toString(): string;
17
+ static create(hours?: number, minutes?: number, seconds?: number, milliseconds?: number): Time;
18
+ static fromDate(date: Date): Time;
19
+ static fromDates(date1: Date, date2: Date): Time;
20
+ static fromObject(obj: {
21
+ days: number;
22
+ format?: string;
23
+ }): Time;
24
+ static is(obj: any): boolean;
25
+ static ensure(obj: any): Time;
26
+ static parse(value: string, format?: string, strict?: boolean): Time | undefined;
27
+ }
28
+ export declare const safeQueueMicrotask: typeof queueMicrotask;
29
+ //# sourceMappingURL=time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/lib/time.ts"],"names":[],"mappings":"AAIA,qBAAa,IAAI;IACf,SAAgB,QAAQ,EAAG,MAAM,CAAU;IAC3C,SAAgB,IAAI,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,MAAM,SAAa;IAKtC,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAIrB,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAIrB,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM;IAyBlC,cAAc,IAAI,MAAM;IAIxB,MAAM,IAAI,IAAI;IAId,MAAM,IAAI;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAI5D,QAAQ,IAAI,MAAM;IAIzB,MAAM,CAAC,MAAM,CAAC,KAAK,SAAI,EAAE,OAAO,SAAI,EAAE,OAAO,SAAI,EAAE,YAAY,SAAI,GAAG,IAAI;IAK1E,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAMjC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI;IAIhD,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAI/D,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO;IAU5B,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI;IAU7B,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,UAAQ,GAAG,IAAI,GAAG,SAAS;CAyC/E;AA2BD,eAAO,MAAM,kBAAkB,uBACyE,CAAC"}
@@ -0,0 +1,161 @@
1
+ import { CellPatchType, CellType, OperationType, PointType } from '../types';
2
+ import { Sheet, UserSheet } from '../lib/sheet';
3
+ import { FormulaError } from '../formula/formula-error';
4
+ import { Time } from '../lib/time';
5
+ export type AutocompleteOption = {
6
+ value: any;
7
+ label?: any;
8
+ keywords?: string[];
9
+ tooltip?: any;
10
+ };
11
+ export type SelectProps = {
12
+ sheet: UserSheet;
13
+ point: PointType;
14
+ current?: CellType;
15
+ next?: CellType;
16
+ operation: OperationType;
17
+ };
18
+ export type SerializeForClipboardProps = {
19
+ sheet: UserSheet;
20
+ point: PointType;
21
+ };
22
+ export type SelectFallbackProps = {
23
+ sheet: UserSheet;
24
+ point: PointType;
25
+ value: any;
26
+ };
27
+ export type Scalar = string | number | boolean | null | undefined;
28
+ export type ScalarProps<T = any> = {
29
+ value?: T;
30
+ cell?: CellType<T>;
31
+ sheet: Sheet;
32
+ point: PointType;
33
+ };
34
+ export type RenderProps<T = any> = {
35
+ value: T;
36
+ cell?: CellType<T>;
37
+ sheet: Sheet;
38
+ point: PointType;
39
+ apply?: (sheet: UserSheet) => void;
40
+ };
41
+ export type SerializeProps<T = any> = {
42
+ value: T;
43
+ cell?: CellType<T>;
44
+ sheet: Sheet;
45
+ point: PointType;
46
+ };
47
+ export type PolicyMixinType = {
48
+ datetimeFormat?: string;
49
+ dateFormat?: string;
50
+ timeFormat?: string;
51
+ decimalPrecision?: number;
52
+ render?: (props: RenderProps) => any;
53
+ renderCallback?: (rendered: any, props: RenderProps) => any;
54
+ renderString?: (props: RenderProps<string>) => any;
55
+ renderNumber?: (props: RenderProps<number>) => any;
56
+ renderBool?: (props: RenderProps<boolean>) => any;
57
+ renderDate?: (props: RenderProps<Date>) => any;
58
+ renderTime?: (props: RenderProps<Time>) => any;
59
+ renderArray?: (props: RenderProps<any[]>) => any;
60
+ renderObject?: (props: RenderProps<any>) => any;
61
+ renderNull?: (props: RenderProps<null | undefined>) => any;
62
+ renderSheet?: (props: RenderProps<UserSheet>) => any;
63
+ renderRowHeaderLabel?: (n: number) => string | null;
64
+ renderColHeaderLabel?: (n: number) => string | null;
65
+ serialize?: (props: SerializeProps) => string;
66
+ serializeString?: (props: SerializeProps<string>) => string;
67
+ serializeNumber?: (props: SerializeProps<number>) => string;
68
+ serializeBool?: (props: SerializeProps<boolean>) => string;
69
+ serializeDate?: (props: SerializeProps<Date>) => string;
70
+ serializeTime?: (props: SerializeProps<Time>) => string;
71
+ serializeArray?: (props: SerializeProps<any[]>) => string;
72
+ serializeNull?: (props: SerializeProps<null | undefined>) => string;
73
+ serializeFormulaError?: (props: SerializeProps<FormulaError>) => string;
74
+ serializeError?: (props: SerializeProps<Error>) => string;
75
+ deserialize?: (value: string, cell?: CellType) => CellType;
76
+ deserializeRaw?: (value: any, cell?: CellType) => CellType;
77
+ deserializeCallback?: (parsed: any, cell?: CellType) => CellType;
78
+ deserializeFirst?: (value: string, cell?: CellType) => CellPatchType<any>;
79
+ deserializeNumber?: (value: string, cell?: CellType) => CellPatchType<number | undefined>;
80
+ deserializeBool?: (value: string, cell?: CellType) => CellPatchType<boolean | undefined>;
81
+ deserializeDate?: (value: string, cell?: CellType) => CellPatchType<Date | undefined>;
82
+ deserializeTime?: (value: string, cell?: CellType) => CellPatchType<Time | undefined>;
83
+ deserializeAny?: (value: string, cell?: CellType) => CellPatchType<string | undefined>;
84
+ toScalar?: (props: ScalarProps) => Scalar;
85
+ toScalarString?: (props: ScalarProps<string>) => Scalar;
86
+ toScalarNumber?: (props: ScalarProps<number>) => Scalar;
87
+ toScalarBool?: (props: ScalarProps<boolean>) => Scalar;
88
+ toScalarDate?: (props: ScalarProps<Date>) => Scalar;
89
+ toScalarTime?: (props: ScalarProps<Time>) => Scalar;
90
+ toScalarArray?: (props: ScalarProps<any[]>) => Scalar;
91
+ toScalarNull?: (props: ScalarProps<null | undefined>) => Scalar;
92
+ getSelectOptions?: () => AutocompleteOption[];
93
+ getSelectFallback?: (props: SelectFallbackProps) => CellType | undefined;
94
+ select?: (props: SelectProps) => CellType | undefined;
95
+ serializeForClipboard?: (props: SerializeForClipboardProps) => string;
96
+ };
97
+ type PolicyProps = {
98
+ mixins?: PolicyMixinType[];
99
+ priority?: number;
100
+ };
101
+ export declare class Policy implements PolicyMixinType {
102
+ priority: number;
103
+ datetimeFormat: string;
104
+ dateFormat: string;
105
+ timeFormat: string;
106
+ decimalPrecision: number;
107
+ deserializeFunctions: ((value: string, cell?: CellType) => CellPatchType<any>)[];
108
+ deserializeCallback?: (parsed: any, cell?: CellType) => CellType;
109
+ deserializeFirst?: (value: string, cell?: CellType) => CellPatchType<any>;
110
+ renderCallback?: (rendered: any, props: RenderProps) => any;
111
+ constructor(props?: PolicyProps);
112
+ private registerDeserializeFunctions;
113
+ private applyMixins;
114
+ render(props: RenderProps): any;
115
+ renderString({ value }: RenderProps<string>): any;
116
+ renderBool({ value }: RenderProps<boolean>): any;
117
+ renderNumber({ value }: RenderProps<number>): any;
118
+ renderDate({ value }: RenderProps<Date>): any;
119
+ renderTime({ value }: RenderProps<Time>): any;
120
+ renderArray(props: RenderProps<any[]>): any;
121
+ renderObject({ value }: RenderProps<any>): any;
122
+ renderNull(_props: RenderProps<null | undefined>): any;
123
+ renderSheet({ value: childSheet, ...rest }: RenderProps<UserSheet>): any;
124
+ renderRowHeaderLabel(_n: number): string | null;
125
+ renderColHeaderLabel(_n: number): string | null;
126
+ toScalar(props: ScalarProps): Scalar;
127
+ toScalarString({ value }: ScalarProps<string>): Scalar;
128
+ toScalarNumber({ value }: ScalarProps<number>): Scalar;
129
+ toScalarBool({ value }: ScalarProps<boolean>): Scalar;
130
+ toScalarDate({ value }: ScalarProps<Date>): Scalar;
131
+ toScalarTime({ value }: ScalarProps<Time>): Scalar;
132
+ toScalarArray({ value, cell, sheet, point }: ScalarProps<any[]>): Scalar;
133
+ toScalarNull(_props: ScalarProps<null | undefined>): Scalar;
134
+ serialize({ value, cell, sheet, point }: SerializeProps): string;
135
+ serializeString({ value }: SerializeProps<string>): string;
136
+ serializeBool({ value }: SerializeProps<boolean>): string;
137
+ serializeNumber({ value }: SerializeProps<number>): string;
138
+ serializeDate({ value }: SerializeProps<Date>): string;
139
+ serializeTime({ value }: SerializeProps<Time>): string;
140
+ serializeArray(props: SerializeProps<any[]>): string;
141
+ serializeNull(_props: SerializeProps<null | undefined>): string;
142
+ serializeFormulaError({ value }: SerializeProps<FormulaError>): string;
143
+ serializeError(_props: SerializeProps<Error>): string;
144
+ serializeForClipboard(props: SerializeForClipboardProps): string;
145
+ deserializeValue(value: any, cell: CellType): CellType;
146
+ deserializeRaw(value: any, cell?: CellType): CellType;
147
+ deserialize(value: string, cell?: CellType): CellPatchType<any>;
148
+ deserializeAny(value: string, _cell?: CellType): CellPatchType<string | undefined>;
149
+ deserializeBool(value: string, _cell?: CellType): CellPatchType<boolean | undefined>;
150
+ deserializeNumber(value: string, _cell?: CellType): CellPatchType<number | undefined>;
151
+ deserializeTime(value: string, _cell?: CellType): CellPatchType<Time | undefined>;
152
+ deserializeDate(value: string, _cell?: CellType): CellPatchType<Date | undefined>;
153
+ getSelectFallback(_props: SelectFallbackProps): any;
154
+ getSelectOptions(): AutocompleteOption[];
155
+ select(props: SelectProps): CellType | undefined;
156
+ }
157
+ export type PolicyType = Policy;
158
+ export declare const DEFAULT_POLICY_NAME = "default";
159
+ export declare const nonePolicy: Policy;
160
+ export {};
161
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/policy/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,EAAE,SAAS,CAAC;IACjB,KAA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GAAG,CAAC;IAgB/D,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;IAOlF,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC,OAAO,GAAG,SAAS,CAAC;IAIpF,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;IAQrF,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC,IAAI,GAAG,SAAS,CAAC;IAOjF,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC,IAAI,GAAG,SAAS,CAAC;IAMjF,iBAAiB,CAAC,MAAM,EAAE,mBAAmB,GAAG,GAAG;IAInD,gBAAgB,IAAI,kBAAkB,EAAE;IAIxC,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS;CAYxD;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,UAAU,QAA8B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { PolicyMixinType } from './core';
2
+ export declare const PercentagePolicyMixin: PolicyMixinType;
3
+ //# sourceMappingURL=percentage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"percentage.d.ts","sourceRoot":"","sources":["../../src/policy/percentage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,QAAQ,CAAC;AAE3D,eAAO,MAAM,qBAAqB,EAAE,eAOnC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { PolicyMixinType } from './core';
2
+ export declare const ThousandSeparatorPolicyMixin: PolicyMixinType;
3
+ export declare const ThousandSpaceSeparatorPolicyMixin: PolicyMixinType;
4
+ //# sourceMappingURL=thousand_separator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thousand_separator.d.ts","sourceRoot":"","sources":["../../src/policy/thousand_separator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,QAAQ,CAAC;AAgB3D,eAAO,MAAM,4BAA4B,EAAE,eAAiD,CAAC;AAC7F,eAAO,MAAM,iCAAiC,EAAE,eAAiD,CAAC"}
@@ -0,0 +1,41 @@
1
+ export declare class Sentinel {
2
+ readonly code: string;
3
+ readonly __gsType: "Sentinel";
4
+ constructor(code: string);
5
+ is(obj: any): obj is this;
6
+ static is(obj: any, code?: string): obj is Sentinel;
7
+ }
8
+ export declare const SOLVING: Sentinel;
9
+ export declare const NONE: Sentinel;
10
+ /**
11
+ * Sentinel value representing an in-flight async formula computation.
12
+ * Cells whose solved cache contains a Pending will render a loading indicator.
13
+ * Dependent cells that encounter a Pending value also become pending.
14
+ */
15
+ export declare class Pending<T = unknown> {
16
+ private readonly timestamp;
17
+ readonly promise: Promise<T>;
18
+ readonly __gsType: "Pending";
19
+ constructor(promise: Promise<T>);
20
+ static is(obj: any): obj is Pending;
21
+ toString(): string;
22
+ }
23
+ /**
24
+ * Returned by functions that want to spill a 2D result into adjacent cells.
25
+ *
26
+ * Usage in a function:
27
+ * return new Spilling([[1, 2], [3, 4]]);
28
+ *
29
+ * The solver detects Spilling via `Spilling.is()` and calls
30
+ * `sheet.spill(origin, result.matrix)` to perform obstruction checks
31
+ * and write values into the solvedCaches.
32
+ */
33
+ export declare class Spilling {
34
+ readonly __gsType: "Spilling";
35
+ /** The 2D matrix of resolved values. matrix[row][col] */
36
+ readonly matrix: any[][];
37
+ constructor(matrix: any[] | any[][]);
38
+ private ensure2D;
39
+ static is(obj: any): obj is Spilling;
40
+ }
41
+ //# sourceMappingURL=sentinels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinels.d.ts","sourceRoot":"","sources":["../src/sentinels.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;aAES,IAAI,EAAE,MAAM;IADxC,SAAgB,QAAQ,EAAG,UAAU,CAAU;gBACnB,IAAI,EAAE,MAAM;IAExC,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,IAAI;IAIzB,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,IAAI,QAAQ;CAOpD;AAED,eAAO,MAAM,OAAO,UAA0B,CAAC;AAC/C,eAAO,MAAM,IAAI,UAAuB,CAAC;AAEzC;;;;GAIG;AACH,qBAAa,OAAO,CAAC,CAAC,GAAG,OAAO;IAC9B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,SAAgB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpC,SAAgB,QAAQ,EAAG,SAAS,CAAU;gBAElC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAK/B,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,OAAO;IAInC,QAAQ,IAAI,MAAM;CAGnB;AAED;;;;;;;;;GASG;AACH,qBAAa,QAAQ;IACnB,SAAgB,QAAQ,EAAG,UAAU,CAAU;IAC/C,yDAAyD;IACzD,SAAgB,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;gBAEpB,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,EAAE;IAInC,OAAO,CAAC,QAAQ;IAahB,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,QAAQ;CAGrC"}