@odoo/o-spreadsheet 16.1.14 → 16.1.16
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/dist/o-spreadsheet.cjs.js +90 -53
- package/dist/o-spreadsheet.d.ts +165 -165
- package/dist/o-spreadsheet.esm.js +90 -53
- package/dist/o-spreadsheet.iife.js +90 -53
- package/dist/o-spreadsheet.iife.min.js +288 -283
- package/package.json +4 -4
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ interface EnrichedToken extends Token {
|
|
|
40
40
|
functionContext?: FunctionContext;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
type TokenType = "OPERATOR" | "NUMBER" | "STRING" | "BOOLEAN" | "FUNCTION" | "SYMBOL" | "SPACE" | "DEBUGGER" | "COMMA" | "LEFT_PAREN" | "RIGHT_PAREN" | "REFERENCE" | "INVALID_REFERENCE" | "UNKNOWN";
|
|
44
44
|
interface Token {
|
|
45
45
|
type: TokenType;
|
|
46
46
|
value: string;
|
|
@@ -87,7 +87,7 @@ interface ASTUnknown extends ASTBase {
|
|
|
87
87
|
type: "UNKNOWN";
|
|
88
88
|
value: string;
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
type AST = ASTOperation | ASTUnaryOperation | ASTFuncall | ASTNumber | ASTBoolean | ASTString | ASTReference | ASTUnknown;
|
|
91
91
|
/**
|
|
92
92
|
* Parse an expression (as a string) into an AST.
|
|
93
93
|
*/
|
|
@@ -154,7 +154,7 @@ declare class EventBus<Event extends {
|
|
|
154
154
|
*/
|
|
155
155
|
clear(): void;
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
type Callback = (...args: any[]) => void;
|
|
158
158
|
interface Subscription {
|
|
159
159
|
owner: any;
|
|
160
160
|
callback: Callback;
|
|
@@ -310,14 +310,14 @@ interface HeadersSelected extends SelectionEventPayload {
|
|
|
310
310
|
interface AlterZoneCorner extends SelectionEventPayload {
|
|
311
311
|
type: "AlterZoneCorner";
|
|
312
312
|
}
|
|
313
|
-
|
|
313
|
+
type SelectionEvent = Readonly<ZonesSelected | HeadersSelected | AlterZoneCorner>;
|
|
314
314
|
|
|
315
315
|
interface StreamCallbacks<Event> {
|
|
316
316
|
handleEvent: (event: Event) => void;
|
|
317
317
|
release?: () => void;
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
|
|
320
|
+
type StatefulStream<Event, State> = {
|
|
321
321
|
capture(owner: unknown, state: State, callbacks: StreamCallbacks<Event>): void;
|
|
322
322
|
registerAsDefault: (owner: unknown, state: State, callbacks: StreamCallbacks<Event>) => void;
|
|
323
323
|
resetDefaultAnchor: (owner: unknown, state: State) => void;
|
|
@@ -484,10 +484,10 @@ interface XLSXExport {
|
|
|
484
484
|
* Note that the alpha channel goes first! AARRGGBB
|
|
485
485
|
* e.g. "1E5010" or "331E5010"
|
|
486
486
|
*/
|
|
487
|
-
|
|
487
|
+
type XlsxHexColor = string & Alias;
|
|
488
488
|
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
type VerticalAxisPosition = "left" | "right";
|
|
490
|
+
type LegendPosition = "top" | "bottom" | "left" | "right" | "none";
|
|
491
491
|
|
|
492
492
|
interface BarChartDefinition {
|
|
493
493
|
readonly type: "bar";
|
|
@@ -501,7 +501,7 @@ interface BarChartDefinition {
|
|
|
501
501
|
readonly stacked: boolean;
|
|
502
502
|
readonly aggregated?: boolean;
|
|
503
503
|
}
|
|
504
|
-
|
|
504
|
+
type BarChartRuntime = {
|
|
505
505
|
chartJsConfig: ChartConfiguration;
|
|
506
506
|
background: Color;
|
|
507
507
|
};
|
|
@@ -582,7 +582,7 @@ interface LineChartDefinition {
|
|
|
582
582
|
readonly stacked: boolean;
|
|
583
583
|
readonly aggregated?: boolean;
|
|
584
584
|
}
|
|
585
|
-
|
|
585
|
+
type LineChartRuntime = {
|
|
586
586
|
chartJsConfig: ChartConfiguration;
|
|
587
587
|
background: Color;
|
|
588
588
|
};
|
|
@@ -597,7 +597,7 @@ interface PieChartDefinition {
|
|
|
597
597
|
readonly legendPosition: LegendPosition;
|
|
598
598
|
readonly aggregated?: boolean;
|
|
599
599
|
}
|
|
600
|
-
|
|
600
|
+
type PieChartRuntime = {
|
|
601
601
|
chartJsConfig: ChartConfiguration;
|
|
602
602
|
background: Color;
|
|
603
603
|
};
|
|
@@ -613,8 +613,8 @@ interface ScorecardChartDefinition {
|
|
|
613
613
|
readonly baselineColorUp: Color;
|
|
614
614
|
readonly baselineColorDown: Color;
|
|
615
615
|
}
|
|
616
|
-
|
|
617
|
-
|
|
616
|
+
type BaselineMode = "text" | "difference" | "percentage";
|
|
617
|
+
type BaselineArrowDirection = "neutral" | "up" | "down";
|
|
618
618
|
interface ScorecardChartRuntime {
|
|
619
619
|
readonly title: string;
|
|
620
620
|
readonly keyValue: string;
|
|
@@ -628,15 +628,15 @@ interface ScorecardChartRuntime {
|
|
|
628
628
|
readonly baselineStyle?: Style;
|
|
629
629
|
}
|
|
630
630
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
631
|
+
type ChartType = "line" | "bar" | "pie" | "scorecard" | "gauge";
|
|
632
|
+
type ChartDefinition = LineChartDefinition | PieChartDefinition | BarChartDefinition | ScorecardChartDefinition | GaugeChartDefinition;
|
|
633
|
+
type ChartJSRuntime = LineChartRuntime | PieChartRuntime | BarChartRuntime | GaugeChartRuntime;
|
|
634
|
+
type ChartRuntime = ChartJSRuntime | ScorecardChartRuntime;
|
|
635
635
|
interface ExcelChartDataset {
|
|
636
636
|
readonly label?: string;
|
|
637
637
|
readonly range: string;
|
|
638
638
|
}
|
|
639
|
-
|
|
639
|
+
type ExcelChartType = "line" | "bar" | "pie";
|
|
640
640
|
interface ExcelChartDefinition {
|
|
641
641
|
readonly title?: string;
|
|
642
642
|
readonly type: ExcelChartType;
|
|
@@ -687,8 +687,8 @@ interface ConditionalFormat {
|
|
|
687
687
|
interface ConditionalFormatInternal extends Omit<ConditionalFormat, "ranges"> {
|
|
688
688
|
ranges: Range[];
|
|
689
689
|
}
|
|
690
|
-
|
|
691
|
-
|
|
690
|
+
type ConditionalFormatRule = SingleColorRules | ColorScaleRule | IconSetRule;
|
|
691
|
+
type SingleColorRules = CellIsRule;
|
|
692
692
|
interface SingleColorRule {
|
|
693
693
|
style: Style;
|
|
694
694
|
}
|
|
@@ -697,18 +697,18 @@ interface CellIsRule extends SingleColorRule {
|
|
|
697
697
|
operator: ConditionalFormattingOperatorValues;
|
|
698
698
|
values: string[];
|
|
699
699
|
}
|
|
700
|
-
|
|
701
|
-
|
|
700
|
+
type ThresholdType = "value" | "number" | "percentage" | "percentile" | "formula";
|
|
701
|
+
type ColorScaleThreshold = {
|
|
702
702
|
color: number;
|
|
703
703
|
type: ThresholdType;
|
|
704
704
|
value?: string;
|
|
705
705
|
};
|
|
706
|
-
|
|
706
|
+
type ColorScaleMidPointThreshold = {
|
|
707
707
|
color: number;
|
|
708
708
|
type: Exclude<ThresholdType, "value">;
|
|
709
709
|
value: string;
|
|
710
710
|
};
|
|
711
|
-
|
|
711
|
+
type IconThreshold = {
|
|
712
712
|
type: Exclude<ThresholdType, "value">;
|
|
713
713
|
operator: "gt" | "ge";
|
|
714
714
|
value: string;
|
|
@@ -730,8 +730,8 @@ interface IconSetRule {
|
|
|
730
730
|
upperInflectionPoint: IconThreshold;
|
|
731
731
|
lowerInflectionPoint: IconThreshold;
|
|
732
732
|
}
|
|
733
|
-
|
|
734
|
-
|
|
733
|
+
type ConditionalFormattingOperatorValues = "BeginsWith" | "Between" | "ContainsText" | "IsEmpty" | "IsNotEmpty" | "EndsWith" | "Equal" | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual" | "NotBetween" | "NotContains" | "NotEqual";
|
|
734
|
+
type UpDown = "up" | "down";
|
|
735
735
|
|
|
736
736
|
interface CellData {
|
|
737
737
|
content?: string;
|
|
@@ -818,10 +818,11 @@ interface ExcelFilterTableData {
|
|
|
818
818
|
}
|
|
819
819
|
interface ExcelFilterData {
|
|
820
820
|
colId: number;
|
|
821
|
-
|
|
821
|
+
displayedValues: string[];
|
|
822
|
+
displayBlanks?: boolean;
|
|
822
823
|
}
|
|
823
824
|
|
|
824
|
-
|
|
825
|
+
type ClientId = string;
|
|
825
826
|
interface Client {
|
|
826
827
|
id: ClientId;
|
|
827
828
|
name: string;
|
|
@@ -867,7 +868,7 @@ interface RevisionsDroppedEvent {
|
|
|
867
868
|
interface SnapshotEvent {
|
|
868
869
|
type: "snapshot";
|
|
869
870
|
}
|
|
870
|
-
|
|
871
|
+
type CollaborativeEvent = NewLocalStateUpdateEvent | UnexpectedRevisionIdEvent | RemoteRevisionReceivedEvent | RevisionAcknowledgedEvent | RevisionUndone | RevisionRedone | RevisionsDroppedEvent | SnapshotEvent | CollaborativeEventReceived;
|
|
871
872
|
|
|
872
873
|
interface AbstractMessage {
|
|
873
874
|
version: number;
|
|
@@ -921,11 +922,11 @@ interface SnapshotCreatedMessage extends AbstractMessage {
|
|
|
921
922
|
serverRevisionId: UID;
|
|
922
923
|
nextRevisionId: UID;
|
|
923
924
|
}
|
|
924
|
-
|
|
925
|
-
|
|
925
|
+
type CollaborationMessage = RevisionUndoneMessage | RevisionRedoneMessage | RemoteRevisionMessage | SnapshotMessage | SnapshotCreatedMessage | ClientMovedMessage | ClientJoinedMessage | ClientLeftMessage;
|
|
926
|
+
type StateUpdateMessage = Extract<CollaborationMessage, {
|
|
926
927
|
nextRevisionId: UID;
|
|
927
928
|
}>;
|
|
928
|
-
|
|
929
|
+
type NewMessageCallback<T = any> = (message: T) => void;
|
|
929
930
|
/**
|
|
930
931
|
* The transport service allows to communicate between multiple clients.
|
|
931
932
|
* A client can send any message to others.
|
|
@@ -967,14 +968,14 @@ interface FigureSize {
|
|
|
967
968
|
width: Pixel;
|
|
968
969
|
height: Pixel;
|
|
969
970
|
}
|
|
970
|
-
|
|
971
|
+
type ResizeDirection = -1 | 0 | 1;
|
|
971
972
|
|
|
972
973
|
interface Image {
|
|
973
974
|
path: string;
|
|
974
975
|
size: FigureSize;
|
|
975
976
|
}
|
|
976
977
|
|
|
977
|
-
|
|
978
|
+
type FilePath = string;
|
|
978
979
|
/**
|
|
979
980
|
* FileStore manage the transfer of file with the server.
|
|
980
981
|
*/
|
|
@@ -1027,7 +1028,7 @@ interface NotifyUIEvent {
|
|
|
1027
1028
|
* Note that the Model can be used in a standalone way to manipulate
|
|
1028
1029
|
* programmatically a spreadsheet.
|
|
1029
1030
|
*/
|
|
1030
|
-
|
|
1031
|
+
type Mode = "normal" | "readonly" | "dashboard";
|
|
1031
1032
|
interface ModelConfig {
|
|
1032
1033
|
readonly mode: Mode;
|
|
1033
1034
|
/**
|
|
@@ -1268,7 +1269,7 @@ declare class BasePlugin<State = any, C = any> implements CommandHandler<C>, Val
|
|
|
1268
1269
|
checkValidations<T>(command: T, ...validations: Validation<T>[]): CommandResult | CommandResult[];
|
|
1269
1270
|
}
|
|
1270
1271
|
|
|
1271
|
-
|
|
1272
|
+
type UIActions = Pick<ModelConfig, "notifyUI">;
|
|
1272
1273
|
interface UIPluginConfig {
|
|
1273
1274
|
readonly getters: Getters;
|
|
1274
1275
|
readonly stateObserver: StateObserver;
|
|
@@ -1324,7 +1325,9 @@ declare class FindAndReplacePlugin extends UIPlugin {
|
|
|
1324
1325
|
private currentSearchRegex;
|
|
1325
1326
|
private searchOptions;
|
|
1326
1327
|
private toSearch;
|
|
1328
|
+
private isSearchDirty;
|
|
1327
1329
|
handle(cmd: Command): void;
|
|
1330
|
+
finalize(): void;
|
|
1328
1331
|
getSearchMatches(): SearchMatch[];
|
|
1329
1332
|
getCurrentSelectedMatchIndex(): number | null;
|
|
1330
1333
|
/**
|
|
@@ -1368,7 +1371,7 @@ declare class FindAndReplacePlugin extends UIPlugin {
|
|
|
1368
1371
|
drawGrid(renderingContext: GridRenderingContext): void;
|
|
1369
1372
|
}
|
|
1370
1373
|
|
|
1371
|
-
|
|
1374
|
+
type EditionMode = "editing" | "selecting" | "inactive";
|
|
1372
1375
|
interface ComposerSelection {
|
|
1373
1376
|
start: number;
|
|
1374
1377
|
end: number;
|
|
@@ -1471,7 +1474,7 @@ declare class EditionPlugin extends UIPlugin {
|
|
|
1471
1474
|
private getTokensInSelection;
|
|
1472
1475
|
}
|
|
1473
1476
|
|
|
1474
|
-
|
|
1477
|
+
type Rect = {
|
|
1475
1478
|
x: Pixel;
|
|
1476
1479
|
y: Pixel;
|
|
1477
1480
|
width: Pixel;
|
|
@@ -1492,7 +1495,7 @@ interface DOMDimension {
|
|
|
1492
1495
|
* The viewport is the visible area of a sheet.
|
|
1493
1496
|
* Column and row headers are not included in the viewport.
|
|
1494
1497
|
*/
|
|
1495
|
-
|
|
1498
|
+
type Viewport = Zone & Alias;
|
|
1496
1499
|
interface SheetScrollInfo {
|
|
1497
1500
|
/**
|
|
1498
1501
|
* The offset in the X coordinate between the viewport left side and
|
|
@@ -1537,16 +1540,16 @@ interface EdgeScrollInfo {
|
|
|
1537
1540
|
direction: ScrollDirection$1;
|
|
1538
1541
|
delay: number;
|
|
1539
1542
|
}
|
|
1540
|
-
|
|
1543
|
+
type ScrollDirection$1 = 1 | 0 | -1 | "reset";
|
|
1541
1544
|
|
|
1542
1545
|
declare enum ClipboardMIMEType {
|
|
1543
1546
|
PlainText = "text/plain",
|
|
1544
1547
|
Html = "text/html"
|
|
1545
1548
|
}
|
|
1546
|
-
|
|
1549
|
+
type ClipboardContent = {
|
|
1547
1550
|
[type in ClipboardMIMEType]?: string;
|
|
1548
1551
|
};
|
|
1549
|
-
|
|
1552
|
+
type ClipboardPasteOptions = "onlyFormat" | "onlyValue";
|
|
1550
1553
|
|
|
1551
1554
|
/**
|
|
1552
1555
|
* There are two kinds of commands: CoreCommands and LocalCommands
|
|
@@ -1588,8 +1591,8 @@ interface PositionDependentCommand {
|
|
|
1588
1591
|
col: number;
|
|
1589
1592
|
row: number;
|
|
1590
1593
|
}
|
|
1591
|
-
declare const invalidateEvaluationCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "
|
|
1592
|
-
declare const readonlyAllowedCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "
|
|
1594
|
+
declare const invalidateEvaluationCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "SORT_CELLS" | "SET_DECIMAL" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER">;
|
|
1595
|
+
declare const readonlyAllowedCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "SORT_CELLS" | "SET_DECIMAL" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER">;
|
|
1593
1596
|
declare const coreTypes: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE">;
|
|
1594
1597
|
interface UpdateCellCommand extends PositionDependentCommand {
|
|
1595
1598
|
type: "UPDATE_CELL";
|
|
@@ -2034,9 +2037,6 @@ interface UpdateSearchCommand {
|
|
|
2034
2037
|
interface ClearSearchCommand {
|
|
2035
2038
|
type: "CLEAR_SEARCH";
|
|
2036
2039
|
}
|
|
2037
|
-
interface RefreshSearchCommand {
|
|
2038
|
-
type: "REFRESH_SEARCH";
|
|
2039
|
-
}
|
|
2040
2040
|
interface SelectSearchPreviousCommand {
|
|
2041
2041
|
type: "SELECT_SEARCH_PREVIOUS_MATCH";
|
|
2042
2042
|
}
|
|
@@ -2060,7 +2060,7 @@ interface SortCommand {
|
|
|
2060
2060
|
sortDirection: SortDirection;
|
|
2061
2061
|
sortOptions?: SortOptions;
|
|
2062
2062
|
}
|
|
2063
|
-
|
|
2063
|
+
type SortDirection = "ascending" | "descending";
|
|
2064
2064
|
interface ResizeViewportCommand {
|
|
2065
2065
|
type: "RESIZE_SHEETVIEW";
|
|
2066
2066
|
width: Pixel;
|
|
@@ -2123,7 +2123,7 @@ interface OpenCellPopoverCommand {
|
|
|
2123
2123
|
interface CloseCellPopoverCommand {
|
|
2124
2124
|
type: "CLOSE_CELL_POPOVER";
|
|
2125
2125
|
}
|
|
2126
|
-
|
|
2126
|
+
type CoreCommand =
|
|
2127
2127
|
/** CELLS */
|
|
2128
2128
|
UpdateCellCommand | UpdateCellPositionCommand | ClearCellCommand | DeleteContentCommand
|
|
2129
2129
|
/** GRID SHAPE */
|
|
@@ -2146,8 +2146,8 @@ UpdateCellCommand | UpdateCellPositionCommand | ClearCellCommand | DeleteContent
|
|
|
2146
2146
|
| CreateImageOverCommand
|
|
2147
2147
|
/** FILTERS */
|
|
2148
2148
|
| CreateFilterTableCommand | RemoveFilterTableCommand;
|
|
2149
|
-
|
|
2150
|
-
|
|
2149
|
+
type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | CleanClipBoardHighlightCommand | AutoFillCellCommand | PasteFromOSClipboardCommand | ActivatePaintFormatCommand | PasteCFCommand | AutoresizeColumnsCommand | AutoresizeRowsCommand | MoveColumnsRowsCommand | ActivateSheetCommand | PrepareExpansionCommand | StopSelectionCommand | EvaluateCellsCommand | ChangeHighlightCommand | StartChangeHighlightCommand | SetColorCommand | StopComposerSelectionCommand | StartEditionCommand | StopEditionCommand | SetCurrentContentCommand | ChangeComposerSelectionCommand | ReplaceComposerSelectionCommand | CycleEditionReferencesCommand | StartCommand | AutofillCommand | AutofillSelectCommand | ShowFormulaCommand | AutofillAutoCommand | SelectFigureCommand | UpdateSearchCommand | ClearSearchCommand | SelectSearchPreviousCommand | SelectSearchNextCommand | ReplaceSearchCommand | ReplaceAllSearchCommand | SortCommand | SetDecimalCommand | ResizeViewportCommand | SumSelectionCommand | DeleteCellCommand | InsertCellCommand | SetViewportOffsetCommand | MoveViewportDownCommand | MoveViewportUpCommand | OpenCellPopoverCommand | CloseCellPopoverCommand | ActivateNextSheetCommand | ActivatePreviousSheetCommand | UpdateFilterCommand;
|
|
2150
|
+
type Command = CoreCommand | LocalCommand;
|
|
2151
2151
|
/**
|
|
2152
2152
|
* Holds the result of a command dispatch.
|
|
2153
2153
|
* The command may have been successfully dispatched or cancelled
|
|
@@ -2167,7 +2167,7 @@ declare class DispatchResult {
|
|
|
2167
2167
|
*/
|
|
2168
2168
|
isCancelledBecause(reason: CancelledReason): boolean;
|
|
2169
2169
|
}
|
|
2170
|
-
|
|
2170
|
+
type CancelledReason = Exclude<CommandResult, CommandResult.Success>;
|
|
2171
2171
|
declare const enum CommandResult {
|
|
2172
2172
|
Success = 0,
|
|
2173
2173
|
CancelledForUnknownReason = 1,
|
|
@@ -2280,26 +2280,26 @@ interface CoreCommandDispatcher {
|
|
|
2280
2280
|
type: T;
|
|
2281
2281
|
}>>(type: T, r: Omit<C, "type">): DispatchResult;
|
|
2282
2282
|
}
|
|
2283
|
-
|
|
2284
|
-
|
|
2283
|
+
type CommandTypes = Command["type"];
|
|
2284
|
+
type CoreCommandTypes = CoreCommand["type"];
|
|
2285
2285
|
|
|
2286
2286
|
/**
|
|
2287
2287
|
* The following type is meant to be used in union with other aliases to prevent
|
|
2288
2288
|
* Intellisense from resolving it.
|
|
2289
2289
|
* See https://github.com/microsoft/TypeScript/issues/31940#issuecomment-841712377
|
|
2290
2290
|
*/
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2291
|
+
type Alias = {} & {};
|
|
2292
|
+
type HeaderIndex = number & Alias;
|
|
2293
|
+
type Pixel = number & Alias;
|
|
2294
|
+
type UID = string & Alias;
|
|
2295
|
+
type SetDecimalStep = 1 | -1;
|
|
2296
|
+
type FilterId = UID & Alias;
|
|
2297
|
+
type FilterTableId = UID & Alias;
|
|
2298
2298
|
/**
|
|
2299
2299
|
* CSS style color string
|
|
2300
2300
|
* e.g. "#ABC", "#AAAFFF", "rgb(30, 80, 16)"
|
|
2301
2301
|
*/
|
|
2302
|
-
|
|
2302
|
+
type Color = string & Alias;
|
|
2303
2303
|
interface RGBA {
|
|
2304
2304
|
a: number;
|
|
2305
2305
|
r: number;
|
|
@@ -2341,9 +2341,9 @@ interface ZoneDimension {
|
|
|
2341
2341
|
height: HeaderIndex;
|
|
2342
2342
|
width: HeaderIndex;
|
|
2343
2343
|
}
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2344
|
+
type Align = "left" | "right" | "center" | undefined;
|
|
2345
|
+
type VerticalAlign = "top" | "middle" | "bottom" | undefined;
|
|
2346
|
+
type Wrapping = "overflow" | "wrap" | "clip" | undefined;
|
|
2347
2347
|
interface Style {
|
|
2348
2348
|
bold?: boolean;
|
|
2349
2349
|
italic?: boolean;
|
|
@@ -2376,35 +2376,35 @@ interface CellPosition {
|
|
|
2376
2376
|
row: HeaderIndex;
|
|
2377
2377
|
sheetId: UID;
|
|
2378
2378
|
}
|
|
2379
|
-
|
|
2380
|
-
|
|
2379
|
+
type BorderStyle = "thin" | "medium" | "thick" | "dashed" | "dotted" | "double";
|
|
2380
|
+
type BorderDescr = [BorderStyle, Color];
|
|
2381
2381
|
interface Border$1 {
|
|
2382
2382
|
top?: BorderDescr;
|
|
2383
2383
|
left?: BorderDescr;
|
|
2384
2384
|
bottom?: BorderDescr;
|
|
2385
2385
|
right?: BorderDescr;
|
|
2386
2386
|
}
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2387
|
+
type ReferenceDenormalizer = (range: Range, isMeta: boolean, functionName: string, paramNumber: number) => any | any[][];
|
|
2388
|
+
type EnsureRange = (range: Range) => any[][];
|
|
2389
|
+
type _CompiledFormula = (deps: Range[], refFn: ReferenceDenormalizer, range: EnsureRange, ctx: {}) => FormulaReturn;
|
|
2390
2390
|
interface CompiledFormula {
|
|
2391
2391
|
execute: _CompiledFormula;
|
|
2392
2392
|
tokens: Token[];
|
|
2393
2393
|
dependencies: string[];
|
|
2394
2394
|
}
|
|
2395
|
-
|
|
2396
|
-
|
|
2395
|
+
type Arg = MatrixArg | PrimitiveArg;
|
|
2396
|
+
type MatrixArg = ({
|
|
2397
2397
|
value: CellValue;
|
|
2398
2398
|
format?: Format;
|
|
2399
2399
|
} | undefined)[][];
|
|
2400
|
-
|
|
2400
|
+
type PrimitiveArg = {
|
|
2401
2401
|
value: PrimitiveArgValue;
|
|
2402
2402
|
format?: Format;
|
|
2403
2403
|
};
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2404
|
+
type ArgValue = PrimitiveArgValue | MatrixArgValue;
|
|
2405
|
+
type MatrixArgValue = (CellValue | undefined)[][];
|
|
2406
|
+
type PrimitiveArgValue = string | number | boolean | null;
|
|
2407
|
+
type FunctionReturn = {
|
|
2408
2408
|
value: FunctionReturnValue;
|
|
2409
2409
|
format?: Format;
|
|
2410
2410
|
};
|
|
@@ -2412,7 +2412,7 @@ interface FormulaReturn extends Omit<FunctionReturn, "value"> {
|
|
|
2412
2412
|
value: FunctionReturnValue | null;
|
|
2413
2413
|
format?: Format;
|
|
2414
2414
|
}
|
|
2415
|
-
|
|
2415
|
+
type FunctionReturnValue = string | number | boolean;
|
|
2416
2416
|
interface HeaderDimensions {
|
|
2417
2417
|
start: Pixel;
|
|
2418
2418
|
size: Pixel;
|
|
@@ -2440,8 +2440,8 @@ interface PaneDivision {
|
|
|
2440
2440
|
/** Represents the number of frozen rows */
|
|
2441
2441
|
ySplit: number;
|
|
2442
2442
|
}
|
|
2443
|
-
|
|
2444
|
-
|
|
2443
|
+
type BorderCommand = "all" | "hv" | "h" | "v" | "external" | "left" | "top" | "right" | "bottom" | "clear";
|
|
2444
|
+
type BorderDescription = {
|
|
2445
2445
|
vertical?: BorderDescr;
|
|
2446
2446
|
horizontal?: BorderDescr;
|
|
2447
2447
|
} | undefined;
|
|
@@ -2451,24 +2451,24 @@ declare const enum DIRECTION {
|
|
|
2451
2451
|
LEFT = "left",
|
|
2452
2452
|
RIGHT = "right"
|
|
2453
2453
|
}
|
|
2454
|
-
|
|
2455
|
-
|
|
2454
|
+
type ChangeType = "REMOVE" | "RESIZE" | "MOVE" | "CHANGE" | "NONE";
|
|
2455
|
+
type ApplyRangeChangeResult = {
|
|
2456
2456
|
changeType: Exclude<ChangeType, "NONE">;
|
|
2457
2457
|
range: Range;
|
|
2458
2458
|
} | {
|
|
2459
2459
|
changeType: "NONE";
|
|
2460
2460
|
};
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2461
|
+
type ApplyRangeChange = (range: Range) => ApplyRangeChangeResult;
|
|
2462
|
+
type Dimension = "COL" | "ROW";
|
|
2463
|
+
type ConsecutiveIndexes = HeaderIndex[];
|
|
2464
2464
|
interface RangeProvider {
|
|
2465
2465
|
adaptRanges: (applyChange: ApplyRangeChange, sheetId?: UID) => void;
|
|
2466
2466
|
}
|
|
2467
|
-
|
|
2467
|
+
type Validation<T> = (toValidate: T) => CommandResult | CommandResult[];
|
|
2468
2468
|
/**
|
|
2469
2469
|
* Return the prop's type of a component
|
|
2470
2470
|
*/
|
|
2471
|
-
|
|
2471
|
+
type PropsOf<C> = C extends ComponentConstructor<infer Props> ? Props : never;
|
|
2472
2472
|
/**
|
|
2473
2473
|
* Container for a lazy computed value
|
|
2474
2474
|
*/
|
|
@@ -2494,7 +2494,7 @@ interface Lazy<T> {
|
|
|
2494
2494
|
interface Cloneable<T> {
|
|
2495
2495
|
clone: (args?: Partial<T>) => T;
|
|
2496
2496
|
}
|
|
2497
|
-
|
|
2497
|
+
type CSSProperties<P extends string = string> = Record<P, string>;
|
|
2498
2498
|
interface SortOptions {
|
|
2499
2499
|
/** If true sort the headers of the range along with the rest */
|
|
2500
2500
|
sortHeaders?: boolean;
|
|
@@ -2505,8 +2505,8 @@ interface MenuMouseEvent extends MouseEvent {
|
|
|
2505
2505
|
closedMenuId?: UID;
|
|
2506
2506
|
}
|
|
2507
2507
|
|
|
2508
|
-
|
|
2509
|
-
|
|
2508
|
+
type Format = string & Alias;
|
|
2509
|
+
type FormattedValue = string & Alias;
|
|
2510
2510
|
|
|
2511
2511
|
interface CellAttributes {
|
|
2512
2512
|
readonly id: UID;
|
|
@@ -2525,7 +2525,7 @@ interface FormulaCell extends CellAttributes {
|
|
|
2525
2525
|
readonly compiledFormula: CompiledFormula;
|
|
2526
2526
|
readonly dependencies: Range[];
|
|
2527
2527
|
}
|
|
2528
|
-
|
|
2528
|
+
type Cell = LiteralCell | FormulaCell;
|
|
2529
2529
|
interface EvaluatedCellProperties {
|
|
2530
2530
|
readonly format?: Format;
|
|
2531
2531
|
/**
|
|
@@ -2539,8 +2539,8 @@ interface EvaluatedCellProperties {
|
|
|
2539
2539
|
readonly isAutoSummable: boolean;
|
|
2540
2540
|
readonly link?: Link;
|
|
2541
2541
|
}
|
|
2542
|
-
|
|
2543
|
-
|
|
2542
|
+
type CellValue = string | number | boolean;
|
|
2543
|
+
type EvaluatedCell = NumberCell | TextCell | BooleanCell | EmptyCell | ErrorCell;
|
|
2544
2544
|
interface NumberCell extends EvaluatedCellProperties {
|
|
2545
2545
|
readonly type: CellValueType.number;
|
|
2546
2546
|
readonly value: number;
|
|
@@ -2593,7 +2593,7 @@ interface FormulaModifier {
|
|
|
2593
2593
|
increment: number;
|
|
2594
2594
|
current: number;
|
|
2595
2595
|
}
|
|
2596
|
-
|
|
2596
|
+
type AutofillModifier = IncrementModifier | CopyModifier | FormulaModifier;
|
|
2597
2597
|
interface Tooltip {
|
|
2598
2598
|
props: any;
|
|
2599
2599
|
component?: any;
|
|
@@ -2634,7 +2634,7 @@ interface Currency {
|
|
|
2634
2634
|
position: "before" | "after";
|
|
2635
2635
|
}
|
|
2636
2636
|
|
|
2637
|
-
|
|
2637
|
+
type ClipboardReadResult = {
|
|
2638
2638
|
status: "ok";
|
|
2639
2639
|
content: string;
|
|
2640
2640
|
} | {
|
|
@@ -2646,7 +2646,7 @@ interface ClipboardInterface {
|
|
|
2646
2646
|
readText(): Promise<ClipboardReadResult>;
|
|
2647
2647
|
}
|
|
2648
2648
|
|
|
2649
|
-
|
|
2649
|
+
type TranslationFunction = (string: string, ...values: string[] | [{
|
|
2650
2650
|
[key: string]: string;
|
|
2651
2651
|
}]) => string;
|
|
2652
2652
|
/***
|
|
@@ -2680,7 +2680,7 @@ interface SpreadsheetChildEnv extends SpreadsheetEnv {
|
|
|
2680
2680
|
loadCurrencies?: () => Promise<Currency[]>;
|
|
2681
2681
|
}
|
|
2682
2682
|
|
|
2683
|
-
|
|
2683
|
+
type ArgType = "ANY" | "BOOLEAN" | "NUMBER" | "STRING" | "DATE" | "RANGE" | "RANGE<BOOLEAN>" | "RANGE<NUMBER>" | "RANGE<DATE>" | "RANGE<STRING>" | "META";
|
|
2684
2684
|
interface ArgDefinition {
|
|
2685
2685
|
repeating?: boolean;
|
|
2686
2686
|
optional?: boolean;
|
|
@@ -2691,8 +2691,8 @@ interface ArgDefinition {
|
|
|
2691
2691
|
default?: boolean;
|
|
2692
2692
|
defaultValue?: any;
|
|
2693
2693
|
}
|
|
2694
|
-
|
|
2695
|
-
|
|
2694
|
+
type ComputeFunctionArg<T> = T | (() => T) | undefined;
|
|
2695
|
+
type ComputeFunction<T, R> = (this: EvalContext, ...args: ComputeFunctionArg<T>[]) => R;
|
|
2696
2696
|
interface AddFunctionDescription {
|
|
2697
2697
|
description: string;
|
|
2698
2698
|
compute: ComputeFunction<ArgValue, FunctionReturnValue>;
|
|
@@ -2708,7 +2708,7 @@ interface FunctionDescription extends AddFunctionDescription {
|
|
|
2708
2708
|
nbrArgRepeating: number;
|
|
2709
2709
|
getArgToFocus: (argPosition: number) => number;
|
|
2710
2710
|
}
|
|
2711
|
-
|
|
2711
|
+
type EvalContext = {
|
|
2712
2712
|
__lastFnCalled?: string;
|
|
2713
2713
|
__originCellXC?: () => string;
|
|
2714
2714
|
[key: string]: any;
|
|
@@ -3540,7 +3540,7 @@ declare class ImagePlugin extends CorePlugin<ImageState> implements ImageState {
|
|
|
3540
3540
|
private getAllImages;
|
|
3541
3541
|
}
|
|
3542
3542
|
|
|
3543
|
-
|
|
3543
|
+
type SheetMergeCellMap = Record<number, Record<number, number | undefined> | undefined>;
|
|
3544
3544
|
interface MergeState {
|
|
3545
3545
|
readonly merges: Record<UID, Record<number, Range | undefined> | undefined>;
|
|
3546
3546
|
readonly mergeCellMap: Record<UID, SheetMergeCellMap | undefined>;
|
|
@@ -3989,7 +3989,7 @@ declare class InternalViewport {
|
|
|
3989
3989
|
private adjustViewportZoneY;
|
|
3990
3990
|
}
|
|
3991
3991
|
|
|
3992
|
-
|
|
3992
|
+
type SheetViewports = {
|
|
3993
3993
|
topLeft: InternalViewport | undefined;
|
|
3994
3994
|
bottomLeft: InternalViewport | undefined;
|
|
3995
3995
|
topRight: InternalViewport | undefined;
|
|
@@ -4745,53 +4745,53 @@ declare class GridSelectionPlugin extends UIPlugin {
|
|
|
4745
4745
|
* This can be generalized because the union of all indices `0 | 1 | 2 | 3 | ...`
|
|
4746
4746
|
* is actually the type `number`.
|
|
4747
4747
|
*/
|
|
4748
|
-
|
|
4748
|
+
type GetterNames<Plugin extends {
|
|
4749
4749
|
getters: readonly string[];
|
|
4750
4750
|
}> = Plugin["getters"][number];
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4751
|
+
type SheetGetters = Pick<SheetPlugin, GetterNames<typeof SheetPlugin>>;
|
|
4752
|
+
type HeaderSizeGetters = Pick<HeaderSizePlugin, GetterNames<typeof HeaderSizePlugin>>;
|
|
4753
|
+
type HeaderVisibilityGetters = Pick<HeaderVisibilityPlugin, GetterNames<typeof HeaderVisibilityPlugin>>;
|
|
4754
|
+
type CellGetters = Pick<CellPlugin, GetterNames<typeof CellPlugin>>;
|
|
4755
|
+
type MergeGetters = Pick<MergePlugin, GetterNames<typeof MergePlugin>>;
|
|
4756
|
+
type BordersGetters = Pick<BordersPlugin, GetterNames<typeof BordersPlugin>>;
|
|
4757
|
+
type ChartGetters = Pick<ChartPlugin, GetterNames<typeof ChartPlugin>>;
|
|
4758
|
+
type ImageGetters = Pick<ImagePlugin, GetterNames<typeof ImagePlugin>>;
|
|
4759
|
+
type FigureGetters = Pick<FigurePlugin, GetterNames<typeof FigurePlugin>>;
|
|
4760
|
+
type RangeAdapterGetters = Pick<RangeAdapter, GetterNames<typeof RangeAdapter>>;
|
|
4761
|
+
type ConditionalFormatGetters = Pick<ConditionalFormatPlugin, GetterNames<typeof ConditionalFormatPlugin>>;
|
|
4762
|
+
type LocalHistoryGetters = {
|
|
4763
4763
|
canUndo: LocalHistory["canUndo"];
|
|
4764
4764
|
canRedo: LocalHistory["canRedo"];
|
|
4765
4765
|
};
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4766
|
+
type FiltersGetters = Pick<FiltersPlugin, GetterNames<typeof FiltersPlugin>>;
|
|
4767
|
+
type CoreGetters = SheetGetters & HeaderSizeGetters & HeaderVisibilityGetters & CellGetters & MergeGetters & BordersGetters & ChartGetters & ImageGetters & ConditionalFormatGetters & FigureGetters & RangeAdapterGetters & FiltersGetters;
|
|
4768
|
+
type AutofillGetters = Pick<AutofillPlugin, GetterNames<typeof AutofillPlugin>>;
|
|
4769
|
+
type AutomaticSumGetters = Pick<AutomaticSumPlugin, GetterNames<typeof AutomaticSumPlugin>>;
|
|
4770
|
+
type ClipboardGetters = Pick<ClipboardPlugin, GetterNames<typeof ClipboardPlugin>>;
|
|
4771
|
+
type EditionGetters = Pick<EditionPlugin, GetterNames<typeof EditionPlugin>>;
|
|
4772
|
+
type EvaluationGetters = Pick<EvaluationPlugin, GetterNames<typeof EvaluationPlugin>>;
|
|
4773
|
+
type EvaluationChartGetters = Pick<EvaluationChartPlugin, GetterNames<typeof EvaluationChartPlugin>>;
|
|
4774
|
+
type EvaluationConditionalFormatGetters = Pick<EvaluationConditionalFormatPlugin, GetterNames<typeof EvaluationConditionalFormatPlugin>>;
|
|
4775
|
+
type FindAndReplaceGetters = Pick<FindAndReplacePlugin, GetterNames<typeof FindAndReplacePlugin>>;
|
|
4776
|
+
type HeaderVisibilityIUIGetters = Pick<HeaderVisibilityUIPlugin, GetterNames<typeof HeaderVisibilityUIPlugin>>;
|
|
4777
|
+
type HighlightGetters = Pick<HighlightPlugin, GetterNames<typeof HighlightPlugin>>;
|
|
4778
|
+
type CustomColorsGetters = Pick<CustomColorsPlugin, GetterNames<typeof CustomColorsPlugin>>;
|
|
4779
|
+
type RendererGetters = Pick<RendererPlugin, GetterNames<typeof RendererPlugin>>;
|
|
4780
|
+
type SelectionGetters = Pick<GridSelectionPlugin, GetterNames<typeof GridSelectionPlugin>>;
|
|
4781
|
+
type SelectionInputGetters = Pick<SelectionInputsManagerPlugin, GetterNames<typeof SelectionInputsManagerPlugin>>;
|
|
4782
|
+
type SelectionMultiUserGetters = Pick<SelectionMultiUserPlugin, GetterNames<typeof SelectionMultiUserPlugin>>;
|
|
4783
|
+
type SortGetters = Pick<SortPlugin, GetterNames<typeof SortPlugin>>;
|
|
4784
|
+
type UIOptionsGetters = Pick<UIOptionsPlugin, GetterNames<typeof UIOptionsPlugin>>;
|
|
4785
|
+
type SheetUIGetters = Pick<SheetUIPlugin, GetterNames<typeof SheetUIPlugin>>;
|
|
4786
|
+
type ViewportGetters = Pick<SheetViewPlugin, GetterNames<typeof SheetViewPlugin>>;
|
|
4787
|
+
type SessionGetters = {
|
|
4788
4788
|
getClient: Session["getClient"];
|
|
4789
4789
|
getConnectedClients: Session["getConnectedClients"];
|
|
4790
4790
|
isFullySynchronized: Session["isFullySynchronized"];
|
|
4791
4791
|
};
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4792
|
+
type CellPopoverPluginGetters = Pick<CellPopoverPlugin, GetterNames<typeof CellPopoverPlugin>>;
|
|
4793
|
+
type FilterEvaluationGetters = Pick<FilterEvaluationPlugin, GetterNames<typeof FilterEvaluationPlugin>>;
|
|
4794
|
+
type Getters = {
|
|
4795
4795
|
isReadonly: () => boolean;
|
|
4796
4796
|
isDashboard: () => boolean;
|
|
4797
4797
|
} & LocalHistoryGetters & CoreGetters & SessionGetters & AutofillGetters & AutomaticSumGetters & ClipboardGetters & EditionGetters & EvaluationGetters & EvaluationChartGetters & EvaluationConditionalFormatGetters & FindAndReplaceGetters & HighlightGetters & CustomColorsGetters & RendererGetters & SelectionGetters & SelectionInputGetters & SelectionMultiUserGetters & SortGetters & UIOptionsGetters & SheetUIGetters & ViewportGetters & CellPopoverPluginGetters & FilterEvaluationGetters & HeaderVisibilityIUIGetters;
|
|
@@ -4810,7 +4810,7 @@ interface WorkbookHistory<Plugin> {
|
|
|
4810
4810
|
update<T extends keyof Plugin, U extends keyof NonNullable<Plugin[T]>, K extends keyof NonNullable<NonNullable<Plugin[T]>[U]>, V extends keyof NonNullable<NonNullable<NonNullable<Plugin[T]>[U]>[K]>, W extends keyof NonNullable<NonNullable<NonNullable<NonNullable<Plugin[T]>[U]>[K]>[V]>>(key1: T, key2: U, key3: K, key4: V, key5: W, val: NonNullable<NonNullable<NonNullable<NonNullable<Plugin[T]>[U]>[K]>[V]>[W]): void;
|
|
4811
4811
|
update<T extends keyof Plugin, U extends keyof NonNullable<Plugin[T]>, K extends keyof NonNullable<NonNullable<Plugin[T]>[U]>, V extends keyof NonNullable<NonNullable<NonNullable<Plugin[T]>[U]>[K]>, W extends keyof NonNullable<NonNullable<NonNullable<NonNullable<Plugin[T]>[U]>[K]>[V]>, Y extends keyof NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<Plugin[T]>[U]>[K]>[V]>[W]>>(key1: T, key2: U, key3: K, key4: V, key5: W, key6: Y, val: NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<Plugin[T]>[U]>[K]>[V]>[W]>[Y]): void;
|
|
4812
4812
|
}
|
|
4813
|
-
|
|
4813
|
+
type Transformation<T = unknown> = (dataToTransform: T) => T;
|
|
4814
4814
|
interface TransformationFactory<T = unknown> {
|
|
4815
4815
|
/**
|
|
4816
4816
|
* Build a transformation function to transform any operation as if the execution of
|
|
@@ -4824,12 +4824,12 @@ interface TransformationFactory<T = unknown> {
|
|
|
4824
4824
|
with: (operation: T) => Transformation<T>;
|
|
4825
4825
|
}
|
|
4826
4826
|
|
|
4827
|
-
|
|
4828
|
-
|
|
4827
|
+
type SelectionDirection = "up" | "down" | "left" | "right";
|
|
4828
|
+
type SelectionStep = number | "end";
|
|
4829
4829
|
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4830
|
+
type CellPopoverType = "ErrorToolTip" | "LinkDisplay" | "FilterMenu" | "LinkEditor";
|
|
4831
|
+
type PopoverPropsPosition = "TopRight" | "BottomLeft";
|
|
4832
|
+
type MaxSizedComponentConstructor = ComponentConstructor & {
|
|
4833
4833
|
maxSize?: {
|
|
4834
4834
|
maxWidth?: number;
|
|
4835
4835
|
maxHeight?: number;
|
|
@@ -4839,7 +4839,7 @@ declare type MaxSizedComponentConstructor = ComponentConstructor & {
|
|
|
4839
4839
|
* If the cell at the given position have an associated component (linkDisplay, errorTooltip, ...),
|
|
4840
4840
|
* returns the parameters to display the component
|
|
4841
4841
|
*/
|
|
4842
|
-
|
|
4842
|
+
type CellPopoverBuilder = (position: CellPosition, getters: Getters) => CellPopoverComponent<MaxSizedComponentConstructor>;
|
|
4843
4843
|
interface PopoverBuilders {
|
|
4844
4844
|
onOpen?: CellPopoverBuilder;
|
|
4845
4845
|
onHover?: CellPopoverBuilder;
|
|
@@ -4852,14 +4852,14 @@ interface ClosedCellPopover {
|
|
|
4852
4852
|
* i.e. which component class, which props and where to
|
|
4853
4853
|
* display it relative to the cell
|
|
4854
4854
|
*/
|
|
4855
|
-
|
|
4855
|
+
type OpenCellPopover<C extends ComponentConstructor> = {
|
|
4856
4856
|
isOpen: true;
|
|
4857
4857
|
Component: C;
|
|
4858
4858
|
props: PropsOf<C>;
|
|
4859
4859
|
cellCorner: PopoverPropsPosition;
|
|
4860
4860
|
};
|
|
4861
|
-
|
|
4862
|
-
|
|
4861
|
+
type CellPopoverComponent<C extends MaxSizedComponentConstructor = MaxSizedComponentConstructor> = ClosedCellPopover | OpenCellPopover<C>;
|
|
4862
|
+
type PositionedCellPopover<C extends MaxSizedComponentConstructor = MaxSizedComponentConstructor> = {
|
|
4863
4863
|
isOpen: true;
|
|
4864
4864
|
Component: C;
|
|
4865
4865
|
props: PropsOf<C>;
|
|
@@ -4928,7 +4928,7 @@ interface LinkSpec {
|
|
|
4928
4928
|
declare function urlRepresentation(link: Link, getters: Getters): string;
|
|
4929
4929
|
declare function openLink(link: Link, env: SpreadsheetChildEnv): void;
|
|
4930
4930
|
|
|
4931
|
-
|
|
4931
|
+
type TransformationFunction<U extends CoreCommandTypes, V extends CoreCommandTypes> = (toTransform: Extract<CoreCommand, {
|
|
4932
4932
|
type: U;
|
|
4933
4933
|
}>, executed: Extract<CoreCommand, {
|
|
4934
4934
|
type: V;
|
|
@@ -5125,7 +5125,7 @@ declare class GaugeChartConfigPanel extends Component<Props$u, SpreadsheetChildE
|
|
|
5125
5125
|
updateDataRange(): void;
|
|
5126
5126
|
}
|
|
5127
5127
|
|
|
5128
|
-
|
|
5128
|
+
type GaugeMenu = "backgroundColor" | "sectionColor-lowerColor" | "sectionColor-middleColor" | "sectionColor-upperColor";
|
|
5129
5129
|
interface Props$t {
|
|
5130
5130
|
figureId: UID;
|
|
5131
5131
|
definition: GaugeChartDefinition;
|
|
@@ -5187,7 +5187,7 @@ declare class ScorecardChartConfigPanel extends Component<Props$s, SpreadsheetCh
|
|
|
5187
5187
|
updateBaselineMode(ev: any): void;
|
|
5188
5188
|
}
|
|
5189
5189
|
|
|
5190
|
-
|
|
5190
|
+
type ColorPickerId = undefined | "backgroundColor" | "baselineColorUp" | "baselineColorDown";
|
|
5191
5191
|
interface Props$r {
|
|
5192
5192
|
figureId: UID;
|
|
5193
5193
|
definition: ScorecardChartDefinition;
|
|
@@ -5265,9 +5265,9 @@ interface MenuItem {
|
|
|
5265
5265
|
icon?: string;
|
|
5266
5266
|
textColor?: Color;
|
|
5267
5267
|
}
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5268
|
+
type FullMenuItem = Required<MenuItem>;
|
|
5269
|
+
type MenuItemsBuilder = (env: SpreadsheetChildEnv) => FullMenuItem[];
|
|
5270
|
+
type menuChildren = (FullMenuItem | MenuItemsBuilder)[];
|
|
5271
5271
|
declare function createFullMenuItem(key: string, value: MenuItem): FullMenuItem;
|
|
5272
5272
|
/**
|
|
5273
5273
|
* The class Registry is extended in order to add the function addChild
|
|
@@ -5602,7 +5602,7 @@ declare class FunctionDescriptionProvider extends Component<Props$k> {
|
|
|
5602
5602
|
onMouseMove(): void;
|
|
5603
5603
|
}
|
|
5604
5604
|
|
|
5605
|
-
|
|
5605
|
+
type HtmlContent = {
|
|
5606
5606
|
value: string;
|
|
5607
5607
|
color?: Color;
|
|
5608
5608
|
class?: string;
|
|
@@ -5744,7 +5744,7 @@ declare class FilterIconsOverlay extends Component<Props$g, SpreadsheetChildEnv>
|
|
|
5744
5744
|
private isPositionVisible;
|
|
5745
5745
|
}
|
|
5746
5746
|
|
|
5747
|
-
|
|
5747
|
+
type ResizeAnchor = "top left" | "top" | "top right" | "right" | "bottom right" | "bottom" | "bottom left" | "left";
|
|
5748
5748
|
interface Props$f {
|
|
5749
5749
|
figure: Figure;
|
|
5750
5750
|
style: string;
|
|
@@ -5774,7 +5774,7 @@ declare class FigureComponent extends Component<Props$f, SpreadsheetChildEnv> {
|
|
|
5774
5774
|
onKeyDown(ev: KeyboardEvent): void;
|
|
5775
5775
|
}
|
|
5776
5776
|
|
|
5777
|
-
|
|
5777
|
+
type ContainerType = "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "dnd";
|
|
5778
5778
|
interface DndState {
|
|
5779
5779
|
figId: string | undefined;
|
|
5780
5780
|
x: Pixel;
|
|
@@ -6032,7 +6032,7 @@ declare class HeadersOverlay extends Component<any, SpreadsheetChildEnv> {
|
|
|
6032
6032
|
selectAll(): void;
|
|
6033
6033
|
}
|
|
6034
6034
|
|
|
6035
|
-
|
|
6035
|
+
type Orientation$1 = "n" | "s" | "w" | "e";
|
|
6036
6036
|
interface Props$b {
|
|
6037
6037
|
zone: Zone;
|
|
6038
6038
|
orientation: Orientation$1;
|
|
@@ -6045,7 +6045,7 @@ declare class Border extends Component<Props$b, SpreadsheetChildEnv> {
|
|
|
6045
6045
|
onMouseDown(ev: MouseEvent): void;
|
|
6046
6046
|
}
|
|
6047
6047
|
|
|
6048
|
-
|
|
6048
|
+
type Orientation = "nw" | "ne" | "sw" | "se";
|
|
6049
6049
|
interface Props$a {
|
|
6050
6050
|
zone: Zone;
|
|
6051
6051
|
color: Color;
|
|
@@ -6079,7 +6079,7 @@ declare class Highlight extends Component<Props$9, SpreadsheetChildEnv> {
|
|
|
6079
6079
|
onMoveHighlight(clientX: Pixel, clientY: Pixel): void;
|
|
6080
6080
|
}
|
|
6081
6081
|
|
|
6082
|
-
|
|
6082
|
+
type ScrollDirection = "horizontal" | "vertical";
|
|
6083
6083
|
|
|
6084
6084
|
interface Props$8 {
|
|
6085
6085
|
width: Pixel;
|
|
@@ -6242,7 +6242,7 @@ interface FontSize {
|
|
|
6242
6242
|
px: number;
|
|
6243
6243
|
}
|
|
6244
6244
|
|
|
6245
|
-
|
|
6245
|
+
type Tool = "" | "formatTool" | "alignTool" | "textColorTool" | "fillColorTool" | "borderTool" | "fontSizeTool";
|
|
6246
6246
|
interface State {
|
|
6247
6247
|
menuState: MenuState;
|
|
6248
6248
|
activeTool: Tool;
|
|
@@ -6325,7 +6325,7 @@ declare class TopBar extends Component<Props$2, SpreadsheetChildEnv> {
|
|
|
6325
6325
|
removeFilter(): void;
|
|
6326
6326
|
}
|
|
6327
6327
|
|
|
6328
|
-
|
|
6328
|
+
type ComposerFocusType = "inactive" | "cellFocus" | "contentFocus";
|
|
6329
6329
|
interface SpreadsheetProps {
|
|
6330
6330
|
model: Model;
|
|
6331
6331
|
}
|
|
@@ -6387,7 +6387,7 @@ declare class Spreadsheet extends Component<SpreadsheetProps, SpreadsheetChildEn
|
|
|
6387
6387
|
* - a horizontal resizer (to resize columns)
|
|
6388
6388
|
* - a vertical resizer (same, for rows)
|
|
6389
6389
|
*/
|
|
6390
|
-
|
|
6390
|
+
type ContextMenuType = "ROW" | "COL" | "CELL" | "FILTER";
|
|
6391
6391
|
interface Props$1 {
|
|
6392
6392
|
sidePanelIsOpen: boolean;
|
|
6393
6393
|
exposeFocus: (focus: () => void) => void;
|