@libraz/formulon 0.9.3 → 0.9.4

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.
@@ -555,6 +555,14 @@ export interface CommentEntry {
555
555
  text: string;
556
556
  }
557
557
 
558
+ /** Sheet-wide comment entry returned by `getComments(sheet)`. Extends
559
+ * `CommentEntry` with the anchor cell so comments on otherwise-empty
560
+ * cells can be discovered without already knowing their `(row, col)`. */
561
+ export interface SheetCommentEntry extends CommentEntry {
562
+ row: number;
563
+ col: number;
564
+ }
565
+
558
566
  /** One cell-range entry inside a `DataValidationEntry.ranges`. Identical
559
567
  * shape to `MergeRange`; declared separately so the data-validation
560
568
  * surface can evolve independently of the merge surface. */
@@ -584,6 +592,9 @@ export interface DataValidationEntry {
584
592
  readonly allowBlank: boolean;
585
593
  readonly showInputMessage: boolean;
586
594
  readonly showErrorMessage: boolean;
595
+ /** Whether the in-cell dropdown arrow is shown (`list` type only).
596
+ * Defaults to `true`, matching Excel's default. */
597
+ readonly showDropDown: boolean;
587
598
  readonly formula1: string;
588
599
  readonly formula2: string;
589
600
  readonly errorTitle: string;
@@ -605,6 +616,9 @@ export interface DataValidationInput {
605
616
  allowBlank?: boolean;
606
617
  showInputMessage?: boolean;
607
618
  showErrorMessage?: boolean;
619
+ /** Whether the in-cell dropdown arrow is shown (`list` type only).
620
+ * Defaults to `true`, matching Excel's default. */
621
+ showDropDown?: boolean;
608
622
  formula1?: string;
609
623
  formula2?: string;
610
624
  errorTitle?: string;
@@ -1017,6 +1031,30 @@ export interface Workbook {
1017
1031
 
1018
1032
  getValue(sheet: number, row: number, col: number): CellResult;
1019
1033
 
1034
+ /** Evaluates `formula` as if entered at `(sheet, row, col)` and returns a
1035
+ * single scalar result, without mutating the workbook. Local and
1036
+ * cross-sheet references, defined names, and `ROW()` / `COLUMN()` resolve
1037
+ * relative to the anchor. An array / spill result is reduced to its
1038
+ * top-left element (a pragmatic API shape, not Excel implicit
1039
+ * intersection or spilling; multi-cell results are a Phase 2 follow-up).
1040
+ * Note: a self-reference reads the target cell's cached value rather than
1041
+ * raising `#REF!`, since the ad-hoc formula never joins the dep graph. */
1042
+ evaluateFormulaText(sheet: number, row: number, col: number, formula: string): EvalResult;
1043
+
1044
+ /** Evaluates `formula` as a conditional-formatting predicate anchored at
1045
+ * `(sheet, row, col)`, with relative references written relative to
1046
+ * `(anchorRow, anchorCol)` (the CF-applied range's top-left). The result
1047
+ * is coerced with Excel's CF rules: error / blank / text / numeric-zero
1048
+ * yield `false`, any non-zero number yields `true`. Read-only. */
1049
+ evaluateConditionalFormula(
1050
+ sheet: number,
1051
+ row: number,
1052
+ col: number,
1053
+ anchorRow: number,
1054
+ anchorCol: number,
1055
+ formula: string,
1056
+ ): EvalResult;
1057
+
1020
1058
  /** Renders the lambda value stored at `(sheet, row, col)` as Excel
1021
1059
  * formula text. Returns `kInvalidArgument` when the cell is absent
1022
1060
  * or its cached value is not a lambda. */
@@ -1397,6 +1435,9 @@ export interface Workbook {
1397
1435
 
1398
1436
  /** Returns the cell comment at `(sheet, row, col)`, or `null` when absent. */
1399
1437
  getComment(sheet: number, row: number, col: number): CommentEntry | null;
1438
+ /** Returns every comment on `sheet`, including comments anchored on
1439
+ * cells that carry no value. */
1440
+ getComments(sheet: number): ReadonlyArray<SheetCommentEntry>;
1400
1441
  /** Sets / replaces the cell comment. Pass an empty `text` to remove. */
1401
1442
  setComment(sheet: number, row: number, col: number, author: string, text: string): Status;
1402
1443
 
@@ -1432,8 +1473,12 @@ export interface Workbook {
1432
1473
  * them as immutable view objects. */
1433
1474
  getConditionalFormats(sheet: number): ReadonlyArray<ConditionalFormatEntry>;
1434
1475
  /** Appends a new single-rule `<conditionalFormatting>` block to
1435
- * `sheet`, including visual rules when their payload object is supplied. */
1436
- addConditionalFormat(sheet: number, rule: ConditionalFormatInput): Status;
1476
+ * `sheet`, including visual rules when their payload object is supplied.
1477
+ * `index` is the new rule's position in the sheet's flattened CF rule
1478
+ * sequence (the same indexing `getConditionalFormats` and
1479
+ * `removeConditionalFormatAt` use); it stays valid until a subsequent
1480
+ * add/remove/clear mutation on the same sheet renumbers the sequence. */
1481
+ addConditionalFormat(sheet: number, rule: ConditionalFormatInput): AddStyleResult;
1437
1482
  /** Removes the CF rule at `index` (flattened order). When the
1438
1483
  * containing block becomes empty it is removed too. */
1439
1484
  removeConditionalFormatAt(sheet: number, index: number): Status;
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libraz/formulon",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "Excel 365 calculation engine -- WASM binding",
5
5
  "license": "Apache-2.0",
6
6
  "author": "libraz",