@trebco/treb 22.14.0 → 23.1.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.
package/treb.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! API v22.14. Copyright 2018-2022 trebco, llc. All rights reserved. LGPL: https://treb.app/license */
1
+ /*! API v23.1. Copyright 2018-2022 trebco, llc. All rights reserved. LGPL: https://treb.app/license */
2
2
 
3
3
  /**
4
4
  * Global instance. In the base script, this object will be created as an
@@ -309,6 +309,13 @@ export declare class EmbeddedSpreadsheet {
309
309
  */
310
310
  DeleteColumns(start_column?: number, count?: number): void;
311
311
 
312
+ /**
313
+ * sort a table. the cell reference can be anywhere in the table.
314
+ * if the reference is an area (range), we're going to look at the
315
+ * top-left cell.
316
+ */
317
+ SortTable(reference: RangeReference, options?: Partial<TableSortOptions>): void;
318
+
312
319
  /**
313
320
  * Merge cells in range.
314
321
  *
@@ -700,6 +707,12 @@ export interface SerializeOptions {
700
707
 
701
708
  /** prune unused rows/columns */
702
709
  shrink?: boolean;
710
+
711
+ /**
712
+ * include tables. tables will be serialized in the model, so we can
713
+ * drop them from cells. but you can leave them in if that's useful.
714
+ */
715
+ tables?: boolean;
703
716
  }
704
717
 
705
718
  /**
@@ -908,6 +921,22 @@ export declare type AddressReference = string | ICellAddress;
908
921
  * address object, an area (range) object, or a string.
909
922
  */
910
923
  export declare type RangeReference = string | ICellAddress | IArea;
924
+ export interface TableSortOptions {
925
+
926
+ /**
927
+ * when sorting, column is relative to the table (and 0-based). so the
928
+ * first column in the table is 0, regardless of where the table is in
929
+ * the spreadsheet. defaults to 0, if not specified.
930
+ */
931
+ column: number;
932
+
933
+ /** sort type. defaults to 'text'. */
934
+ type: TableSortType;
935
+
936
+ /** ascending sort. defaults to true. */
937
+ asc: boolean;
938
+ }
939
+ export declare type TableSortType = 'text' | 'numeric';
911
940
 
912
941
  /**
913
942
  * options for exporting CSV/TSV
@@ -1056,6 +1085,24 @@ export interface EmbeddedSpreadsheetOptions {
1056
1085
  /** target window for hyperlinks (default _blank); set false to disable hyperlinks altogether */
1057
1086
  hyperlinks?: string | false;
1058
1087
 
1088
+ /**
1089
+ * enable handling complex numbers in function calculation. turning this
1090
+ * off doesn't actually disable complex numbers. it means that functions
1091
+ * will not return complex numbers unless one of the arguments is complex.
1092
+ *
1093
+ * for example, if complex numbers are off, `=SQRT(-1)` will return `#VALUE`.
1094
+ * if complex numbers are on, `=SQRT(-1)` will return `i`.
1095
+ *
1096
+ * even if complex numbers are off, however, `=SQRT(-1 + 0i)` will return
1097
+ * `i` because the argument is complex.
1098
+ *
1099
+ * currently this behavior applies to `SQRT`, `POWER` and the exponentiation
1100
+ * operator `^`.
1101
+ *
1102
+ * in version 22, this defaults to `off`.
1103
+ */
1104
+ complex?: 'on' | 'off';
1105
+
1059
1106
  /**
1060
1107
  * for rendering the imaginary number. this is intended to support
1061
1108
  * switching to a different character for rendering, or adding a leading