@trebco/treb 22.14.2 → 23.1.2
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/package.json +1 -1
- package/treb-bundle.css +2 -2
- package/treb-bundle.mjs +15 -15
- package/treb.d.ts +72 -1
package/treb.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! API
|
|
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
|
|
@@ -91,6 +91,11 @@ export interface SheetScrollOptions {
|
|
|
91
91
|
smooth?: boolean;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* function type used for filtering tables
|
|
96
|
+
*/
|
|
97
|
+
export declare type TableFilterFunction = (value: CellValue, calculated_value: CellValue, style: Style.Properties) => boolean;
|
|
98
|
+
|
|
94
99
|
/**
|
|
95
100
|
* embedded spreadsheet
|
|
96
101
|
*/
|
|
@@ -309,6 +314,32 @@ export declare class EmbeddedSpreadsheet {
|
|
|
309
314
|
*/
|
|
310
315
|
DeleteColumns(start_column?: number, count?: number): void;
|
|
311
316
|
|
|
317
|
+
/**
|
|
318
|
+
* sort a table. the reference can be the table name, or a cell in the table.
|
|
319
|
+
* if the reference is an area (range), we're going to look at the top-left
|
|
320
|
+
* cell.
|
|
321
|
+
*
|
|
322
|
+
* this method uses a function to filter rows based on cell values. leave the
|
|
323
|
+
* function undefined to show all rows. this is a shortcut for "unfilter".
|
|
324
|
+
*
|
|
325
|
+
* @param column - the column to sort on. values from this column will be
|
|
326
|
+
* passed to the filter function.
|
|
327
|
+
*
|
|
328
|
+
* @param filter - a callback function to filter based on cell values. this
|
|
329
|
+
* will be called with the cell value (formula), the calculated value (if any),
|
|
330
|
+
* and the cell style. return false to hide the row, and true to show the row.
|
|
331
|
+
* if the filter parameter is omitted, all values will be shown.
|
|
332
|
+
*
|
|
333
|
+
*/
|
|
334
|
+
FilterTable(reference: RangeReference, column?: number, filter?: TableFilterFunction): void;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* sort a table. the reference can be the table name, or a cell in the table.
|
|
338
|
+
* if the reference is an area (range), we're going to look at the top-left
|
|
339
|
+
* cell.
|
|
340
|
+
*/
|
|
341
|
+
SortTable(reference: RangeReference, options?: Partial<TableSortOptions>): void;
|
|
342
|
+
|
|
312
343
|
/**
|
|
313
344
|
* Merge cells in range.
|
|
314
345
|
*
|
|
@@ -700,6 +731,12 @@ export interface SerializeOptions {
|
|
|
700
731
|
|
|
701
732
|
/** prune unused rows/columns */
|
|
702
733
|
shrink?: boolean;
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* include tables. tables will be serialized in the model, so we can
|
|
737
|
+
* drop them from cells. but you can leave them in if that's useful.
|
|
738
|
+
*/
|
|
739
|
+
tables?: boolean;
|
|
703
740
|
}
|
|
704
741
|
|
|
705
742
|
/**
|
|
@@ -908,6 +945,22 @@ export declare type AddressReference = string | ICellAddress;
|
|
|
908
945
|
* address object, an area (range) object, or a string.
|
|
909
946
|
*/
|
|
910
947
|
export declare type RangeReference = string | ICellAddress | IArea;
|
|
948
|
+
export interface TableSortOptions {
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* when sorting, column is relative to the table (and 0-based). so the
|
|
952
|
+
* first column in the table is 0, regardless of where the table is in
|
|
953
|
+
* the spreadsheet. defaults to 0, if not specified.
|
|
954
|
+
*/
|
|
955
|
+
column: number;
|
|
956
|
+
|
|
957
|
+
/** sort type. defaults to 'text'. */
|
|
958
|
+
type: TableSortType;
|
|
959
|
+
|
|
960
|
+
/** ascending sort. defaults to true. */
|
|
961
|
+
asc: boolean;
|
|
962
|
+
}
|
|
963
|
+
export declare type TableSortType = 'text' | 'numeric';
|
|
911
964
|
|
|
912
965
|
/**
|
|
913
966
|
* options for exporting CSV/TSV
|
|
@@ -1056,6 +1109,24 @@ export interface EmbeddedSpreadsheetOptions {
|
|
|
1056
1109
|
/** target window for hyperlinks (default _blank); set false to disable hyperlinks altogether */
|
|
1057
1110
|
hyperlinks?: string | false;
|
|
1058
1111
|
|
|
1112
|
+
/**
|
|
1113
|
+
* enable handling complex numbers in function calculation. turning this
|
|
1114
|
+
* off doesn't actually disable complex numbers. it means that functions
|
|
1115
|
+
* will not return complex numbers unless one of the arguments is complex.
|
|
1116
|
+
*
|
|
1117
|
+
* for example, if complex numbers are off, `=SQRT(-1)` will return `#VALUE`.
|
|
1118
|
+
* if complex numbers are on, `=SQRT(-1)` will return `i`.
|
|
1119
|
+
*
|
|
1120
|
+
* even if complex numbers are off, however, `=SQRT(-1 + 0i)` will return
|
|
1121
|
+
* `i` because the argument is complex.
|
|
1122
|
+
*
|
|
1123
|
+
* currently this behavior applies to `SQRT`, `POWER` and the exponentiation
|
|
1124
|
+
* operator `^`.
|
|
1125
|
+
*
|
|
1126
|
+
* in version 22, this defaults to `off`.
|
|
1127
|
+
*/
|
|
1128
|
+
complex?: 'on' | 'off';
|
|
1129
|
+
|
|
1059
1130
|
/**
|
|
1060
1131
|
* for rendering the imaginary number. this is intended to support
|
|
1061
1132
|
* switching to a different character for rendering, or adding a leading
|