@ricsam/formula-engine 0.0.11 → 0.0.13

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.
@@ -121,9 +121,9 @@ export declare class FormulaEngine {
121
121
  */
122
122
  removeConditionalStyle(workbookName: string, index: number): boolean;
123
123
  /**
124
- * Get all conditional styles for a range
124
+ * Get all conditional styles intersecting with a range
125
125
  */
126
- getConditionalStyles(range: RangeAddress): ConditionalStyle[];
126
+ getConditionalStylesIntersectingWithRange(range: RangeAddress): ConditionalStyle[];
127
127
  /**
128
128
  * Get the computed style for a specific cell
129
129
  */
@@ -137,9 +137,15 @@ export declare class FormulaEngine {
137
137
  */
138
138
  removeCellStyle(workbookName: string, index: number): boolean;
139
139
  /**
140
- * Get all direct cell styles for a range
140
+ * Get all direct cell styles intersecting with a range
141
141
  */
142
- getCellStyles(range: RangeAddress): DirectCellStyle[];
142
+ getStylesIntersectingWithRange(range: RangeAddress): DirectCellStyle[];
143
+ /**
144
+ * Get the style for a range if all cells in the range have the same style
145
+ * Returns the DirectCellStyle if the range is completely contained within a single style's area
146
+ * Returns undefined if multiple styles, partial coverage, or no styles apply
147
+ */
148
+ getStyleForRange(range: RangeAddress): DirectCellStyle | undefined;
143
149
  /**
144
150
  * Clear all cell styles and conditional styles for a given range
145
151
  * Adjusts existing style ranges rather than deleting them entirely
@@ -17,9 +17,9 @@ export declare class StyleManager {
17
17
  */
18
18
  removeConditionalStyle(workbookName: string, index: number): boolean;
19
19
  /**
20
- * Get all conditional styles for a range
20
+ * Get all conditional styles intersecting with a range
21
21
  */
22
- getConditionalStyles(range: RangeAddress): ConditionalStyle[];
22
+ getConditionalStylesIntersectingWithRange(range: RangeAddress): ConditionalStyle[];
23
23
  /**
24
24
  * Add a direct cell style rule
25
25
  */
@@ -29,9 +29,15 @@ export declare class StyleManager {
29
29
  */
30
30
  removeCellStyle(workbookName: string, index: number): boolean;
31
31
  /**
32
- * Get all direct cell styles for a workbook
32
+ * Get all direct cell styles intersecting with a range
33
33
  */
34
- getCellStyles(range: RangeAddress): DirectCellStyle[];
34
+ getStylesIntersectingWithRange(range: RangeAddress): DirectCellStyle[];
35
+ /**
36
+ * Get the style for a range if all cells in the range have the same style
37
+ * Returns the DirectCellStyle if the range is completely contained within a single style's area
38
+ * Returns undefined if multiple styles, partial coverage, or no styles apply
39
+ */
40
+ getStyleForRange(range: RangeAddress): DirectCellStyle | undefined;
35
41
  /**
36
42
  * Get all conditional styles across all workbooks (for serialization)
37
43
  */
@@ -318,6 +318,18 @@ export interface CellStyle {
318
318
  }
319
319
  export interface CopyCellsOptions {
320
320
  cut: boolean;
321
+ /**
322
+ * all: Copy everything from the source to the target
323
+ * content: Copy only the content from the source to the target
324
+ * style: Copy only the style from the source to the target
325
+ */
326
+ target: 'all' | 'content' | 'style';
327
+ /**
328
+ * The type of the content to copy
329
+ * value: Copy the value from the source to the target,
330
+ * e.g. if the cell has the formula =123 + 123 then the value is 246
331
+ * formula: Copy the formula from the source to the target,
332
+ * e.g. if the cell has the formula =123 + 123 then the formula is =123 + 123 is copied
333
+ */
321
334
  type: "value" | "formula";
322
- formatting: boolean;
323
335
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/formula-engine",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "module": "./dist/mjs/lib.mjs",
5
5
  "scripts": {
6
6
  "test": "bun test",