@odoo/o-spreadsheet 16.4.0-alpha.3 → 16.4.0-alpha.5

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.
@@ -40,7 +40,7 @@ interface EnrichedToken extends Token {
40
40
  functionContext?: FunctionContext;
41
41
  }
42
42
 
43
- declare type TokenType = "OPERATOR" | "NUMBER" | "STRING" | "BOOLEAN" | "FUNCTION" | "SYMBOL" | "SPACE" | "DEBUGGER" | "COMMA" | "LEFT_PAREN" | "RIGHT_PAREN" | "REFERENCE" | "INVALID_REFERENCE" | "UNKNOWN";
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 ASTEmpty extends ASTBase {
87
87
  type: "EMPTY";
88
88
  value: "";
89
89
  }
90
- declare type AST = ASTOperation | ASTUnaryOperation | ASTFuncall | ASTNumber | ASTBoolean | ASTString | ASTReference | ASTEmpty;
90
+ type AST = ASTOperation | ASTUnaryOperation | ASTFuncall | ASTNumber | ASTBoolean | ASTString | ASTReference | ASTEmpty;
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
- declare type Callback = (...args: any[]) => void;
157
+ type Callback = (...args: any[]) => void;
158
158
  interface Subscription {
159
159
  owner: any;
160
160
  callback: Callback;
@@ -241,7 +241,7 @@ declare class SelectiveHistory<T = unknown> {
241
241
  private fastForward;
242
242
  }
243
243
 
244
- declare type ClientId = string;
244
+ type ClientId = string;
245
245
  interface Client {
246
246
  id: ClientId;
247
247
  name: string;
@@ -287,9 +287,9 @@ interface RevisionsDroppedEvent {
287
287
  interface SnapshotEvent {
288
288
  type: "snapshot";
289
289
  }
290
- declare type CollaborativeEvent = NewLocalStateUpdateEvent | UnexpectedRevisionIdEvent | RemoteRevisionReceivedEvent | RevisionAcknowledgedEvent | RevisionUndone | RevisionRedone | RevisionsDroppedEvent | SnapshotEvent | CollaborativeEventReceived;
290
+ type CollaborativeEvent = NewLocalStateUpdateEvent | UnexpectedRevisionIdEvent | RemoteRevisionReceivedEvent | RevisionAcknowledgedEvent | RevisionUndone | RevisionRedone | RevisionsDroppedEvent | SnapshotEvent | CollaborativeEventReceived;
291
291
 
292
- declare type XLSXExportFile = XLSXExportImageFile | XLSXExportXMLFile;
292
+ type XLSXExportFile = XLSXExportImageFile | XLSXExportXMLFile;
293
293
  interface XLSXExportXMLFile {
294
294
  path: string;
295
295
  content: string;
@@ -308,10 +308,10 @@ interface XLSXExport {
308
308
  * Note that the alpha channel goes first! AARRGGBB
309
309
  * e.g. "1E5010" or "331E5010"
310
310
  */
311
- declare type XlsxHexColor = string & Alias;
311
+ type XlsxHexColor = string & Alias;
312
312
 
313
- declare type VerticalAxisPosition = "left" | "right";
314
- declare type LegendPosition = "top" | "bottom" | "left" | "right" | "none";
313
+ type VerticalAxisPosition = "left" | "right";
314
+ type LegendPosition = "top" | "bottom" | "left" | "right" | "none";
315
315
 
316
316
  interface BarChartDefinition {
317
317
  readonly type: "bar";
@@ -325,7 +325,7 @@ interface BarChartDefinition {
325
325
  readonly stacked: boolean;
326
326
  readonly aggregated?: boolean;
327
327
  }
328
- declare type BarChartRuntime = {
328
+ type BarChartRuntime = {
329
329
  chartJsConfig: ChartConfiguration;
330
330
  background: Color;
331
331
  };
@@ -406,7 +406,7 @@ interface LineChartDefinition {
406
406
  readonly stacked: boolean;
407
407
  readonly aggregated?: boolean;
408
408
  }
409
- declare type LineChartRuntime = {
409
+ type LineChartRuntime = {
410
410
  chartJsConfig: ChartConfiguration;
411
411
  background: Color;
412
412
  };
@@ -421,7 +421,7 @@ interface PieChartDefinition {
421
421
  readonly legendPosition: LegendPosition;
422
422
  readonly aggregated?: boolean;
423
423
  }
424
- declare type PieChartRuntime = {
424
+ type PieChartRuntime = {
425
425
  chartJsConfig: ChartConfiguration;
426
426
  background: Color;
427
427
  };
@@ -437,8 +437,8 @@ interface ScorecardChartDefinition {
437
437
  readonly baselineColorUp: Color;
438
438
  readonly baselineColorDown: Color;
439
439
  }
440
- declare type BaselineMode = "text" | "difference" | "percentage";
441
- declare type BaselineArrowDirection = "neutral" | "up" | "down";
440
+ type BaselineMode = "text" | "difference" | "percentage";
441
+ type BaselineArrowDirection = "neutral" | "up" | "down";
442
442
  interface ScorecardChartRuntime {
443
443
  readonly title: string;
444
444
  readonly keyValue: string;
@@ -452,15 +452,15 @@ interface ScorecardChartRuntime {
452
452
  readonly baselineStyle?: Style;
453
453
  }
454
454
 
455
- declare type ChartType = "line" | "bar" | "pie" | "scorecard" | "gauge";
456
- declare type ChartDefinition = LineChartDefinition | PieChartDefinition | BarChartDefinition | ScorecardChartDefinition | GaugeChartDefinition;
457
- declare type ChartJSRuntime = LineChartRuntime | PieChartRuntime | BarChartRuntime | GaugeChartRuntime;
458
- declare type ChartRuntime = ChartJSRuntime | ScorecardChartRuntime;
455
+ type ChartType = "line" | "bar" | "pie" | "scorecard" | "gauge";
456
+ type ChartDefinition = LineChartDefinition | PieChartDefinition | BarChartDefinition | ScorecardChartDefinition | GaugeChartDefinition;
457
+ type ChartJSRuntime = LineChartRuntime | PieChartRuntime | BarChartRuntime | GaugeChartRuntime;
458
+ type ChartRuntime = ChartJSRuntime | ScorecardChartRuntime;
459
459
  interface ExcelChartDataset {
460
460
  readonly label?: string;
461
461
  readonly range: string;
462
462
  }
463
- declare type ExcelChartType = "line" | "bar" | "pie";
463
+ type ExcelChartType = "line" | "bar" | "pie";
464
464
  interface ExcelChartDefinition {
465
465
  readonly title?: string;
466
466
  readonly type: ExcelChartType;
@@ -512,8 +512,8 @@ interface ConditionalFormat {
512
512
  interface ConditionalFormatInternal extends Omit<ConditionalFormat, "ranges"> {
513
513
  ranges: Range[];
514
514
  }
515
- declare type ConditionalFormatRule = SingleColorRules | ColorScaleRule | IconSetRule;
516
- declare type SingleColorRules = CellIsRule;
515
+ type ConditionalFormatRule = SingleColorRules | ColorScaleRule | IconSetRule;
516
+ type SingleColorRules = CellIsRule;
517
517
  interface SingleColorRule {
518
518
  style: Style;
519
519
  }
@@ -522,18 +522,18 @@ interface CellIsRule extends SingleColorRule {
522
522
  operator: ConditionalFormattingOperatorValues;
523
523
  values: string[];
524
524
  }
525
- declare type ThresholdType = "value" | "number" | "percentage" | "percentile" | "formula";
526
- declare type ColorScaleThreshold = {
525
+ type ThresholdType = "value" | "number" | "percentage" | "percentile" | "formula";
526
+ type ColorScaleThreshold = {
527
527
  color: number;
528
528
  type: ThresholdType;
529
529
  value?: string;
530
530
  };
531
- declare type ColorScaleMidPointThreshold = {
531
+ type ColorScaleMidPointThreshold = {
532
532
  color: number;
533
533
  type: Exclude<ThresholdType, "value">;
534
534
  value: string;
535
535
  };
536
- declare type IconThreshold = {
536
+ type IconThreshold = {
537
537
  type: Exclude<ThresholdType, "value">;
538
538
  operator: "gt" | "ge";
539
539
  value: string;
@@ -555,8 +555,8 @@ interface IconSetRule {
555
555
  upperInflectionPoint: IconThreshold;
556
556
  lowerInflectionPoint: IconThreshold;
557
557
  }
558
- declare type ConditionalFormattingOperatorValues = "BeginsWith" | "Between" | "ContainsText" | "IsEmpty" | "IsNotEmpty" | "EndsWith" | "Equal" | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual" | "NotBetween" | "NotContains" | "NotEqual";
559
- declare type UpDown = "up" | "down";
558
+ type ConditionalFormattingOperatorValues = "BeginsWith" | "Between" | "ContainsText" | "IsEmpty" | "IsNotEmpty" | "EndsWith" | "Equal" | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual" | "NotBetween" | "NotContains" | "NotEqual";
559
+ type UpDown = "up" | "down";
560
560
 
561
561
  interface Figure {
562
562
  id: UID;
@@ -570,7 +570,7 @@ interface FigureSize {
570
570
  width: Pixel;
571
571
  height: Pixel;
572
572
  }
573
- declare type ResizeDirection = -1 | 0 | 1;
573
+ type ResizeDirection = -1 | 0 | 1;
574
574
 
575
575
  interface Image {
576
576
  path: string;
@@ -664,7 +664,8 @@ interface ExcelFilterTableData {
664
664
  }
665
665
  interface ExcelFilterData {
666
666
  colId: number;
667
- filteredValues: string[];
667
+ displayedValues: string[];
668
+ displayBlanks?: boolean;
668
669
  }
669
670
 
670
671
  interface AbstractMessage {
@@ -720,11 +721,11 @@ interface SnapshotCreatedMessage extends AbstractMessage {
720
721
  serverRevisionId: UID;
721
722
  nextRevisionId: UID;
722
723
  }
723
- declare type CollaborationMessage = RevisionUndoneMessage | RevisionRedoneMessage | RemoteRevisionMessage | SnapshotMessage | SnapshotCreatedMessage | ClientMovedMessage | ClientJoinedMessage | ClientLeftMessage;
724
- declare type StateUpdateMessage = Extract<CollaborationMessage, {
724
+ type CollaborationMessage = RevisionUndoneMessage | RevisionRedoneMessage | RemoteRevisionMessage | SnapshotMessage | SnapshotCreatedMessage | ClientMovedMessage | ClientJoinedMessage | ClientLeftMessage;
725
+ type StateUpdateMessage = Extract<CollaborationMessage, {
725
726
  nextRevisionId: UID;
726
727
  }>;
727
- declare type NewMessageCallback<T = any> = (message: T) => void;
728
+ type NewMessageCallback<T = any> = (message: T) => void;
728
729
  /**
729
730
  * The transport service allows to communicate between multiple clients.
730
731
  * A client can send any message to others.
@@ -1007,21 +1008,16 @@ declare function positionToZone(position: Position$1): {
1007
1008
  bottom: HeaderIndex;
1008
1009
  };
1009
1010
 
1010
- interface SelectionEventPayload {
1011
+ type SelectionEventOptions = {
1012
+ scrollIntoView?: boolean;
1013
+ unbounded?: boolean;
1014
+ };
1015
+ interface SelectionEvent {
1011
1016
  anchor: AnchorZone;
1012
1017
  previousAnchor: AnchorZone;
1013
1018
  mode: "newAnchor" | "overrideSelection" | "updateAnchor";
1019
+ options: SelectionEventOptions;
1014
1020
  }
1015
- interface ZonesSelected extends SelectionEventPayload {
1016
- type: "ZonesSelected";
1017
- }
1018
- interface HeadersSelected extends SelectionEventPayload {
1019
- type: "HeadersSelected";
1020
- }
1021
- interface AlterZone extends SelectionEventPayload {
1022
- type: "AlterZone";
1023
- }
1024
- declare type SelectionEvent = Readonly<ZonesSelected | HeadersSelected | AlterZone>;
1025
1021
 
1026
1022
  interface StreamCallbacks<Event> {
1027
1023
  handleEvent: (event: Event) => void;
@@ -1030,7 +1026,7 @@ interface StreamCallbacks<Event> {
1030
1026
  release?: () => void;
1031
1027
  }
1032
1028
 
1033
- declare type StatefulStream<Event, State> = {
1029
+ type StatefulStream<Event, State> = {
1034
1030
  capture(owner: unknown, state: State, callbacks: StreamCallbacks<Event>): void;
1035
1031
  registerAsDefault: (owner: unknown, state: State, callbacks: StreamCallbacks<Event>) => void;
1036
1032
  resetDefaultAnchor: (owner: unknown, state: State) => void;
@@ -1043,7 +1039,7 @@ declare type StatefulStream<Event, State> = {
1043
1039
  * Allows to select cells in the grid and update the selection
1044
1040
  */
1045
1041
  interface SelectionProcessor {
1046
- selectZone(anchor: AnchorZone): DispatchResult;
1042
+ selectZone(anchor: AnchorZone, options?: SelectionEventOptions): DispatchResult;
1047
1043
  selectCell(col: number, row: number): DispatchResult;
1048
1044
  moveAnchorCell(direction: SelectionDirection, step: SelectionStep): DispatchResult;
1049
1045
  setAnchorCorner(col: number, row: number): DispatchResult;
@@ -1055,9 +1051,9 @@ interface SelectionProcessor {
1055
1051
  loopSelection(): DispatchResult;
1056
1052
  selectTableAroundSelection(): DispatchResult;
1057
1053
  }
1058
- declare type SelectionStreamProcessor = SelectionProcessor & StatefulStream<SelectionEvent, AnchorZone>;
1054
+ type SelectionStreamProcessor = SelectionProcessor & StatefulStream<SelectionEvent, AnchorZone>;
1059
1055
 
1060
- declare type FilePath = string;
1056
+ type FilePath = string;
1061
1057
  /**
1062
1058
  * FileStore manage the transfer of file with the server.
1063
1059
  */
@@ -1110,7 +1106,7 @@ interface NotifyUIEvent {
1110
1106
  * Note that the Model can be used in a standalone way to manipulate
1111
1107
  * programmatically a spreadsheet.
1112
1108
  */
1113
- declare type Mode = "normal" | "readonly" | "dashboard";
1109
+ type Mode = "normal" | "readonly" | "dashboard";
1114
1110
  interface ModelConfig {
1115
1111
  readonly mode: Mode;
1116
1112
  /**
@@ -1357,7 +1353,7 @@ declare class BasePlugin<State = any, C = any> implements CommandHandler<C>, Val
1357
1353
  checkValidations<T>(command: T, ...validations: Validation<T>[]): CommandResult | CommandResult[];
1358
1354
  }
1359
1355
 
1360
- declare type UIActions = Pick<ModelConfig, "notifyUI">;
1356
+ type UIActions = Pick<ModelConfig, "notifyUI">;
1361
1357
  interface UIPluginConfig {
1362
1358
  readonly getters: Getters;
1363
1359
  readonly stateObserver: StateObserver;
@@ -1457,7 +1453,7 @@ declare class FindAndReplacePlugin extends UIPlugin {
1457
1453
  drawGrid(renderingContext: GridRenderingContext): void;
1458
1454
  }
1459
1455
 
1460
- declare type EditionMode = "editing" | "selecting" | "inactive";
1456
+ type EditionMode = "editing" | "selecting" | "inactive";
1461
1457
  interface ComposerSelection {
1462
1458
  start: number;
1463
1459
  end: number;
@@ -1570,12 +1566,12 @@ interface DOMDimension {
1570
1566
  width: Pixel;
1571
1567
  height: Pixel;
1572
1568
  }
1573
- declare type Rect = DOMCoordinates & DOMDimension;
1569
+ type Rect = DOMCoordinates & DOMDimension;
1574
1570
  /**
1575
1571
  * The viewport is the visible area of a sheet.
1576
1572
  * Column and row headers are not included in the viewport.
1577
1573
  */
1578
- declare type Viewport = Zone & Alias;
1574
+ type Viewport = Zone & Alias;
1579
1575
  interface SheetScrollInfo {
1580
1576
  /**
1581
1577
  * The offset in the X coordinate between the viewport left side and
@@ -1620,16 +1616,16 @@ interface EdgeScrollInfo {
1620
1616
  direction: ScrollDirection$1;
1621
1617
  delay: number;
1622
1618
  }
1623
- declare type ScrollDirection$1 = 1 | 0 | -1 | "reset";
1619
+ type ScrollDirection$1 = 1 | 0 | -1 | "reset";
1624
1620
 
1625
1621
  declare enum ClipboardMIMEType {
1626
1622
  PlainText = "text/plain",
1627
1623
  Html = "text/html"
1628
1624
  }
1629
- declare type ClipboardContent = {
1625
+ type ClipboardContent = {
1630
1626
  [type in ClipboardMIMEType]?: string;
1631
1627
  };
1632
- declare type ClipboardPasteOptions = "onlyFormat" | "onlyValue";
1628
+ type ClipboardPasteOptions = "onlyFormat" | "onlyValue";
1633
1629
 
1634
1630
  /**
1635
1631
  * There are two kinds of commands: CoreCommands and LocalCommands
@@ -1671,10 +1667,10 @@ interface PositionDependentCommand {
1671
1667
  col: number;
1672
1668
  row: number;
1673
1669
  }
1674
- 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_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_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" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "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" | "SPLIT_TEXT_INTO_COLUMNS">;
1675
- declare const invalidateDependenciesCommands: 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_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_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" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "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" | "SPLIT_TEXT_INTO_COLUMNS">;
1676
- declare const invalidateCFEvaluationCommands: 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_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_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" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "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" | "SPLIT_TEXT_INTO_COLUMNS">;
1677
- 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_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_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" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "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" | "SPLIT_TEXT_INTO_COLUMNS">;
1670
+ 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_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "UNDO" | "REDO" | "EVALUATE_CELLS">;
1671
+ declare const invalidateDependenciesCommands: 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_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_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" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "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" | "SPLIT_TEXT_INTO_COLUMNS">;
1672
+ declare const invalidateCFEvaluationCommands: 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_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "UNDO" | "REDO" | "EVALUATE_CELLS">;
1673
+ 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_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "ADD_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_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" | "REFRESH_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "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" | "SPLIT_TEXT_INTO_COLUMNS">;
1678
1674
  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_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE">;
1679
1675
  interface UpdateCellCommand extends PositionDependentCommand {
1680
1676
  type: "UPDATE_CELL";
@@ -1916,6 +1912,7 @@ interface PasteFromOSClipboardCommand {
1916
1912
  type: "PASTE_FROM_OS_CLIPBOARD";
1917
1913
  target: Zone[];
1918
1914
  text: string;
1915
+ pasteOption?: ClipboardPasteOptions;
1919
1916
  }
1920
1917
  interface AutoresizeColumnsCommand {
1921
1918
  type: "AUTORESIZE_COLUMNS";
@@ -2161,7 +2158,7 @@ interface SortCommand {
2161
2158
  sortDirection: SortDirection;
2162
2159
  sortOptions?: SortOptions;
2163
2160
  }
2164
- declare type SortDirection = "ascending" | "descending";
2161
+ type SortDirection = "ascending" | "descending";
2165
2162
  interface ResizeViewportCommand {
2166
2163
  type: "RESIZE_SHEETVIEW";
2167
2164
  width: Pixel;
@@ -2203,12 +2200,6 @@ interface InsertCellCommand {
2203
2200
  shiftDimension: Dimension;
2204
2201
  zone: Zone;
2205
2202
  }
2206
- interface PasteCFCommand {
2207
- type: "PASTE_CONDITIONAL_FORMAT";
2208
- originPosition: CellPosition;
2209
- targetPosition: CellPosition;
2210
- operation: "CUT" | "COPY";
2211
- }
2212
2203
  interface ActivateNextSheetCommand {
2213
2204
  type: "ACTIVATE_NEXT_SHEET";
2214
2205
  }
@@ -2230,7 +2221,7 @@ interface SplitTextIntoColumnsCommand {
2230
2221
  addNewColumns: boolean;
2231
2222
  force?: boolean;
2232
2223
  }
2233
- declare type CoreCommand =
2224
+ type CoreCommand =
2234
2225
  /** CELLS */
2235
2226
  UpdateCellCommand | UpdateCellPositionCommand | ClearCellCommand | DeleteContentCommand
2236
2227
  /** GRID SHAPE */
@@ -2253,8 +2244,8 @@ UpdateCellCommand | UpdateCellPositionCommand | ClearCellCommand | DeleteContent
2253
2244
  | CreateImageOverCommand
2254
2245
  /** FILTERS */
2255
2246
  | CreateFilterTableCommand | RemoveFilterTableCommand;
2256
- declare type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | AddRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | RepeatPasteCommand | 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 | RefreshSearchCommand | ClearSearchCommand | SelectSearchPreviousCommand | SelectSearchNextCommand | ReplaceSearchCommand | ReplaceAllSearchCommand | SortCommand | SetDecimalCommand | ResizeViewportCommand | SumSelectionCommand | DeleteCellCommand | InsertCellCommand | SetViewportOffsetCommand | MoveViewportDownCommand | MoveViewportUpCommand | OpenCellPopoverCommand | CloseCellPopoverCommand | ActivateNextSheetCommand | ActivatePreviousSheetCommand | UpdateFilterCommand | SplitTextIntoColumnsCommand;
2257
- declare type Command = CoreCommand | LocalCommand;
2247
+ type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | AddRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | RepeatPasteCommand | CleanClipBoardHighlightCommand | AutoFillCellCommand | PasteFromOSClipboardCommand | ActivatePaintFormatCommand | AutoresizeColumnsCommand | AutoresizeRowsCommand | MoveColumnsRowsCommand | ActivateSheetCommand | PrepareExpansionCommand | StopSelectionCommand | EvaluateCellsCommand | ChangeHighlightCommand | StartChangeHighlightCommand | SetColorCommand | StopComposerSelectionCommand | StartEditionCommand | StopEditionCommand | SetCurrentContentCommand | ChangeComposerSelectionCommand | ReplaceComposerSelectionCommand | CycleEditionReferencesCommand | StartCommand | AutofillCommand | AutofillSelectCommand | ShowFormulaCommand | AutofillAutoCommand | SelectFigureCommand | UpdateSearchCommand | RefreshSearchCommand | ClearSearchCommand | SelectSearchPreviousCommand | SelectSearchNextCommand | ReplaceSearchCommand | ReplaceAllSearchCommand | SortCommand | SetDecimalCommand | ResizeViewportCommand | SumSelectionCommand | DeleteCellCommand | InsertCellCommand | SetViewportOffsetCommand | MoveViewportDownCommand | MoveViewportUpCommand | OpenCellPopoverCommand | CloseCellPopoverCommand | ActivateNextSheetCommand | ActivatePreviousSheetCommand | UpdateFilterCommand | SplitTextIntoColumnsCommand;
2248
+ type Command = CoreCommand | LocalCommand;
2258
2249
  /**
2259
2250
  * Holds the result of a command dispatch.
2260
2251
  * The command may have been successfully dispatched or cancelled
@@ -2274,7 +2265,7 @@ declare class DispatchResult {
2274
2265
  */
2275
2266
  isCancelledBecause(reason: CancelledReason): boolean;
2276
2267
  }
2277
- declare type CancelledReason = Exclude<CommandResult, CommandResult.Success>;
2268
+ type CancelledReason = Exclude<CommandResult, CommandResult.Success>;
2278
2269
  declare const enum CommandResult {
2279
2270
  Success = 0,
2280
2271
  CancelledForUnknownReason = 1,
@@ -2287,88 +2278,89 @@ declare const enum CommandResult {
2287
2278
  NotEnoughElements = 8,
2288
2279
  NotEnoughSheets = 9,
2289
2280
  MissingSheetName = 10,
2290
- DuplicatedSheetName = 11,
2291
- DuplicatedSheetId = 12,
2292
- ForbiddenCharactersInSheetName = 13,
2293
- WrongSheetMove = 14,
2294
- WrongSheetPosition = 15,
2295
- InvalidAnchorZone = 16,
2296
- SelectionOutOfBound = 17,
2297
- TargetOutOfSheet = 18,
2298
- WrongCutSelection = 19,
2299
- WrongPasteSelection = 20,
2300
- WrongPasteOption = 21,
2301
- WrongFigurePasteOption = 22,
2302
- EmptyClipboard = 23,
2303
- EmptyRange = 24,
2304
- InvalidRange = 25,
2305
- InvalidZones = 26,
2306
- InvalidSheetId = 27,
2307
- InvalidFigureId = 28,
2308
- InputAlreadyFocused = 29,
2309
- MaximumRangesReached = 30,
2310
- InvalidChartDefinition = 31,
2311
- InvalidDataSet = 32,
2312
- InvalidLabelRange = 33,
2313
- InvalidScorecardKeyValue = 34,
2314
- InvalidScorecardBaseline = 35,
2315
- InvalidGaugeDataRange = 36,
2316
- EmptyGaugeRangeMin = 37,
2317
- GaugeRangeMinNaN = 38,
2318
- EmptyGaugeRangeMax = 39,
2319
- GaugeRangeMaxNaN = 40,
2320
- GaugeRangeMinBiggerThanRangeMax = 41,
2321
- GaugeLowerInflectionPointNaN = 42,
2322
- GaugeUpperInflectionPointNaN = 43,
2323
- GaugeLowerBiggerThanUpper = 44,
2324
- InvalidAutofillSelection = 45,
2325
- WrongComposerSelection = 46,
2326
- MinBiggerThanMax = 47,
2327
- LowerBiggerThanUpper = 48,
2328
- MidBiggerThanMax = 49,
2329
- MinBiggerThanMid = 50,
2330
- FirstArgMissing = 51,
2331
- SecondArgMissing = 52,
2332
- MinNaN = 53,
2333
- MidNaN = 54,
2334
- MaxNaN = 55,
2335
- ValueUpperInflectionNaN = 56,
2336
- ValueLowerInflectionNaN = 57,
2337
- MinInvalidFormula = 58,
2338
- MidInvalidFormula = 59,
2339
- MaxInvalidFormula = 60,
2340
- ValueUpperInvalidFormula = 61,
2341
- ValueLowerInvalidFormula = 62,
2342
- InvalidSortZone = 63,
2343
- WaitingSessionConfirmation = 64,
2344
- MergeOverlap = 65,
2345
- TooManyHiddenElements = 66,
2346
- Readonly = 67,
2347
- InvalidViewportSize = 68,
2348
- InvalidScrollingDirection = 69,
2349
- FigureDoesNotExist = 70,
2350
- InvalidConditionalFormatId = 71,
2351
- InvalidCellPopover = 72,
2352
- EmptyTarget = 73,
2353
- InvalidFreezeQuantity = 74,
2354
- FrozenPaneOverlap = 75,
2355
- ValuesNotChanged = 76,
2356
- InvalidFilterZone = 77,
2357
- FilterOverlap = 78,
2358
- FilterNotFound = 79,
2359
- MergeInFilter = 80,
2360
- NonContinuousTargets = 81,
2361
- DuplicatedFigureId = 82,
2362
- InvalidSelectionStep = 83,
2363
- DuplicatedChartId = 84,
2364
- ChartDoesNotExist = 85,
2365
- InvalidHeaderIndex = 86,
2366
- InvalidQuantity = 87,
2367
- MoreThanOneColumnSelected = 88,
2368
- EmptySplitSeparator = 89,
2369
- SplitWillOverwriteContent = 90,
2370
- NoSplitSeparatorInSelection = 91,
2371
- NoActiveSheet = 92
2281
+ UnchangedSheetName = 11,
2282
+ DuplicatedSheetName = 12,
2283
+ DuplicatedSheetId = 13,
2284
+ ForbiddenCharactersInSheetName = 14,
2285
+ WrongSheetMove = 15,
2286
+ WrongSheetPosition = 16,
2287
+ InvalidAnchorZone = 17,
2288
+ SelectionOutOfBound = 18,
2289
+ TargetOutOfSheet = 19,
2290
+ WrongCutSelection = 20,
2291
+ WrongPasteSelection = 21,
2292
+ WrongPasteOption = 22,
2293
+ WrongFigurePasteOption = 23,
2294
+ EmptyClipboard = 24,
2295
+ EmptyRange = 25,
2296
+ InvalidRange = 26,
2297
+ InvalidZones = 27,
2298
+ InvalidSheetId = 28,
2299
+ InvalidFigureId = 29,
2300
+ InputAlreadyFocused = 30,
2301
+ MaximumRangesReached = 31,
2302
+ InvalidChartDefinition = 32,
2303
+ InvalidDataSet = 33,
2304
+ InvalidLabelRange = 34,
2305
+ InvalidScorecardKeyValue = 35,
2306
+ InvalidScorecardBaseline = 36,
2307
+ InvalidGaugeDataRange = 37,
2308
+ EmptyGaugeRangeMin = 38,
2309
+ GaugeRangeMinNaN = 39,
2310
+ EmptyGaugeRangeMax = 40,
2311
+ GaugeRangeMaxNaN = 41,
2312
+ GaugeRangeMinBiggerThanRangeMax = 42,
2313
+ GaugeLowerInflectionPointNaN = 43,
2314
+ GaugeUpperInflectionPointNaN = 44,
2315
+ GaugeLowerBiggerThanUpper = 45,
2316
+ InvalidAutofillSelection = 46,
2317
+ WrongComposerSelection = 47,
2318
+ MinBiggerThanMax = 48,
2319
+ LowerBiggerThanUpper = 49,
2320
+ MidBiggerThanMax = 50,
2321
+ MinBiggerThanMid = 51,
2322
+ FirstArgMissing = 52,
2323
+ SecondArgMissing = 53,
2324
+ MinNaN = 54,
2325
+ MidNaN = 55,
2326
+ MaxNaN = 56,
2327
+ ValueUpperInflectionNaN = 57,
2328
+ ValueLowerInflectionNaN = 58,
2329
+ MinInvalidFormula = 59,
2330
+ MidInvalidFormula = 60,
2331
+ MaxInvalidFormula = 61,
2332
+ ValueUpperInvalidFormula = 62,
2333
+ ValueLowerInvalidFormula = 63,
2334
+ InvalidSortZone = 64,
2335
+ WaitingSessionConfirmation = 65,
2336
+ MergeOverlap = 66,
2337
+ TooManyHiddenElements = 67,
2338
+ Readonly = 68,
2339
+ InvalidViewportSize = 69,
2340
+ InvalidScrollingDirection = 70,
2341
+ FigureDoesNotExist = 71,
2342
+ InvalidConditionalFormatId = 72,
2343
+ InvalidCellPopover = 73,
2344
+ EmptyTarget = 74,
2345
+ InvalidFreezeQuantity = 75,
2346
+ FrozenPaneOverlap = 76,
2347
+ ValuesNotChanged = 77,
2348
+ InvalidFilterZone = 78,
2349
+ FilterOverlap = 79,
2350
+ FilterNotFound = 80,
2351
+ MergeInFilter = 81,
2352
+ NonContinuousTargets = 82,
2353
+ DuplicatedFigureId = 83,
2354
+ InvalidSelectionStep = 84,
2355
+ DuplicatedChartId = 85,
2356
+ ChartDoesNotExist = 86,
2357
+ InvalidHeaderIndex = 87,
2358
+ InvalidQuantity = 88,
2359
+ MoreThanOneColumnSelected = 89,
2360
+ EmptySplitSeparator = 90,
2361
+ SplitWillOverwriteContent = 91,
2362
+ NoSplitSeparatorInSelection = 92,
2363
+ NoActiveSheet = 93
2372
2364
  }
2373
2365
  interface CommandHandler<T> {
2374
2366
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -2398,26 +2390,27 @@ interface CoreCommandDispatcher {
2398
2390
  type: T;
2399
2391
  }>>(type: T, r: Omit<C, "type">): DispatchResult;
2400
2392
  }
2401
- declare type CommandTypes = Command["type"];
2402
- declare type CoreCommandTypes = CoreCommand["type"];
2393
+ type CommandTypes = Command["type"];
2394
+ type CoreCommandTypes = CoreCommand["type"];
2395
+ type CoreViewCommand = CoreCommand | EvaluateCellsCommand | UndoCommand | RedoCommand;
2403
2396
 
2404
2397
  /**
2405
2398
  * The following type is meant to be used in union with other aliases to prevent
2406
2399
  * Intellisense from resolving it.
2407
2400
  * See https://github.com/microsoft/TypeScript/issues/31940#issuecomment-841712377
2408
2401
  */
2409
- declare type Alias = {} & {};
2410
- declare type HeaderIndex = number & Alias;
2411
- declare type Pixel = number & Alias;
2412
- declare type UID = string & Alias;
2413
- declare type SetDecimalStep = 1 | -1;
2414
- declare type FilterId = UID & Alias;
2415
- declare type FilterTableId = UID & Alias;
2402
+ type Alias = {} & {};
2403
+ type HeaderIndex = number & Alias;
2404
+ type Pixel = number & Alias;
2405
+ type UID = string & Alias;
2406
+ type SetDecimalStep = 1 | -1;
2407
+ type FilterId = UID & Alias;
2408
+ type FilterTableId = UID & Alias;
2416
2409
  /**
2417
2410
  * CSS style color string
2418
2411
  * e.g. "#ABC", "#AAAFFF", "rgb(30, 80, 16)"
2419
2412
  */
2420
- declare type Color = string & Alias;
2413
+ type Color = string & Alias;
2421
2414
  interface RGBA {
2422
2415
  a: number;
2423
2416
  r: number;
@@ -2459,9 +2452,9 @@ interface ZoneDimension {
2459
2452
  numberOfRows: HeaderIndex;
2460
2453
  numberOfCols: HeaderIndex;
2461
2454
  }
2462
- declare type Align = "left" | "right" | "center" | undefined;
2463
- declare type VerticalAlign = "top" | "middle" | "bottom" | undefined;
2464
- declare type Wrapping = "overflow" | "wrap" | "clip" | undefined;
2455
+ type Align = "left" | "right" | "center" | undefined;
2456
+ type VerticalAlign = "top" | "middle" | "bottom" | undefined;
2457
+ type Wrapping = "overflow" | "wrap" | "clip" | undefined;
2465
2458
  interface Style {
2466
2459
  bold?: boolean;
2467
2460
  italic?: boolean;
@@ -2495,15 +2488,15 @@ interface CellPosition {
2495
2488
  sheetId: UID;
2496
2489
  }
2497
2490
  declare const borderStyles: readonly ["thin", "medium", "thick", "dashed", "dotted"];
2498
- declare type BorderStyle = typeof borderStyles[number];
2499
- declare type BorderDescr = {
2491
+ type BorderStyle = typeof borderStyles[number];
2492
+ type BorderDescr = {
2500
2493
  style: BorderStyle;
2501
2494
  color: Color;
2502
2495
  };
2503
2496
  /**
2504
2497
  * A complete border(s) data is a set of position-color-style information
2505
2498
  */
2506
- declare type BorderData = {
2499
+ type BorderData = {
2507
2500
  position: BorderPosition;
2508
2501
  color?: Color;
2509
2502
  style?: BorderStyle;
@@ -2514,42 +2507,42 @@ interface Border$1 {
2514
2507
  bottom?: BorderDescr;
2515
2508
  right?: BorderDescr;
2516
2509
  }
2517
- declare type ReferenceDenormalizer = (range: Range, isMeta: boolean, functionName: string, paramNumber: number) => any | any[][];
2518
- declare type EnsureRange = (range: Range) => MatrixArg;
2519
- declare type _CompiledFormula = (deps: Range[], refFn: ReferenceDenormalizer, range: EnsureRange, ctx: {}) => FormulaReturn;
2510
+ type ReferenceDenormalizer = (range: Range, isMeta: boolean, functionName: string, paramNumber: number) => any | any[][];
2511
+ type EnsureRange = (range: Range) => MatrixArg;
2512
+ type _CompiledFormula = (deps: Range[], refFn: ReferenceDenormalizer, range: EnsureRange, ctx: {}) => FormulaReturn;
2520
2513
  interface CompiledFormula {
2521
2514
  execute: _CompiledFormula;
2522
2515
  tokens: Token[];
2523
2516
  dependencies: string[];
2524
2517
  }
2525
- declare type Matrix<T = unknown> = T[][];
2526
- declare type Arg = MatrixArg | PrimitiveArg;
2527
- declare type MatrixArg = {
2518
+ type Matrix<T = unknown> = T[][];
2519
+ type Arg = MatrixArg | PrimitiveArg;
2520
+ type MatrixArg = {
2528
2521
  value: MatrixArgValue;
2529
2522
  format?: MatrixArgFormat;
2530
2523
  };
2531
- declare type PrimitiveArg = {
2524
+ type PrimitiveArg = {
2532
2525
  value: PrimitiveArgValue;
2533
2526
  format?: PrimitiveFormat;
2534
2527
  };
2535
- declare type ArgValue = PrimitiveArgValue | MatrixArgValue;
2536
- declare type MatrixArgValue = Matrix<CellValue | undefined>;
2537
- declare type PrimitiveArgValue = CellValue | null;
2538
- declare type MatrixArgFormat = Matrix<PrimitiveFormat>;
2539
- declare type PrimitiveFormat = Format | undefined;
2540
- declare type FunctionReturn = MatrixFunctionReturn | PrimitiveFunctionReturn;
2541
- declare type FunctionReturnValue = CellValue | Matrix<CellValue>;
2542
- declare type FunctionReturnFormat = PrimitiveFormat | MatrixArgFormat;
2543
- declare type MatrixFunctionReturn = {
2528
+ type ArgValue = PrimitiveArgValue | MatrixArgValue;
2529
+ type MatrixArgValue = Matrix<CellValue | undefined>;
2530
+ type PrimitiveArgValue = CellValue | null;
2531
+ type MatrixArgFormat = Matrix<PrimitiveFormat>;
2532
+ type PrimitiveFormat = Format | undefined;
2533
+ type FunctionReturn = MatrixFunctionReturn | PrimitiveFunctionReturn;
2534
+ type FunctionReturnValue = CellValue | Matrix<CellValue>;
2535
+ type FunctionReturnFormat = PrimitiveFormat | MatrixArgFormat;
2536
+ type MatrixFunctionReturn = {
2544
2537
  value: Matrix<CellValue>;
2545
2538
  format?: FunctionReturnFormat;
2546
2539
  };
2547
- declare type PrimitiveFunctionReturn = {
2540
+ type PrimitiveFunctionReturn = {
2548
2541
  value: CellValue;
2549
2542
  format?: PrimitiveFormat;
2550
2543
  };
2551
- declare type FormulaReturn = MatrixFunctionReturn | PrimitiveFormulaReturn;
2552
- declare type PrimitiveFormulaReturn = {
2544
+ type FormulaReturn = MatrixFunctionReturn | PrimitiveFormulaReturn;
2545
+ type PrimitiveFormulaReturn = {
2553
2546
  value: CellValue | null;
2554
2547
  format?: PrimitiveFormat;
2555
2548
  };
@@ -2584,8 +2577,8 @@ interface PaneDivision {
2584
2577
  /** Represents the number of frozen rows */
2585
2578
  ySplit: number;
2586
2579
  }
2587
- declare type BorderPosition = "all" | "hv" | "h" | "v" | "external" | "left" | "top" | "right" | "bottom" | "clear";
2588
- declare type BorderDescription = {
2580
+ type BorderPosition = "all" | "hv" | "h" | "v" | "external" | "left" | "top" | "right" | "bottom" | "clear";
2581
+ type BorderDescription = {
2589
2582
  vertical?: BorderDescr;
2590
2583
  horizontal?: BorderDescr;
2591
2584
  } | undefined;
@@ -2595,24 +2588,24 @@ declare const enum DIRECTION {
2595
2588
  LEFT = "left",
2596
2589
  RIGHT = "right"
2597
2590
  }
2598
- declare type ChangeType = "REMOVE" | "RESIZE" | "MOVE" | "CHANGE" | "NONE";
2599
- declare type ApplyRangeChangeResult = {
2591
+ type ChangeType = "REMOVE" | "RESIZE" | "MOVE" | "CHANGE" | "NONE";
2592
+ type ApplyRangeChangeResult = {
2600
2593
  changeType: Exclude<ChangeType, "NONE">;
2601
2594
  range: Range;
2602
2595
  } | {
2603
2596
  changeType: "NONE";
2604
2597
  };
2605
- declare type ApplyRangeChange = (range: Range) => ApplyRangeChangeResult;
2606
- declare type Dimension = "COL" | "ROW";
2607
- declare type ConsecutiveIndexes = HeaderIndex[];
2598
+ type ApplyRangeChange = (range: Range) => ApplyRangeChangeResult;
2599
+ type Dimension = "COL" | "ROW";
2600
+ type ConsecutiveIndexes = HeaderIndex[];
2608
2601
  interface RangeProvider {
2609
2602
  adaptRanges: (applyChange: ApplyRangeChange, sheetId?: UID) => void;
2610
2603
  }
2611
- declare type Validation<T> = (toValidate: T) => CommandResult | CommandResult[];
2604
+ type Validation<T> = (toValidate: T) => CommandResult | CommandResult[];
2612
2605
  /**
2613
2606
  * Return the prop's type of a component
2614
2607
  */
2615
- declare type PropsOf<C> = C extends ComponentConstructor<infer Props> ? Props : never;
2608
+ type PropsOf<C> = C extends ComponentConstructor<infer Props> ? Props : never;
2616
2609
  /**
2617
2610
  * Container for a lazy computed value
2618
2611
  */
@@ -2638,7 +2631,7 @@ interface Lazy<T> {
2638
2631
  interface Cloneable<T> {
2639
2632
  clone: (args?: Partial<T>) => T;
2640
2633
  }
2641
- declare type CSSProperties<P extends string = string> = Record<P, string | undefined>;
2634
+ type CSSProperties<P extends string = string> = Record<P, string | undefined>;
2642
2635
  interface SortOptions {
2643
2636
  /** If true sort the headers of the range along with the rest */
2644
2637
  sortHeaders?: boolean;
@@ -2648,9 +2641,17 @@ interface SortOptions {
2648
2641
  interface MenuMouseEvent extends MouseEvent {
2649
2642
  closedMenuId?: UID;
2650
2643
  }
2644
+ type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : ImmutableObject<T>;
2645
+ type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
2646
+ type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
2647
+ type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
2648
+ type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
2649
+ type ImmutableObject<T> = {
2650
+ readonly [K in keyof T]: Immutable<T[K]>;
2651
+ };
2651
2652
 
2652
- declare type Format = string & Alias;
2653
- declare type FormattedValue = string & Alias;
2653
+ type Format = string & Alias;
2654
+ type FormattedValue = string & Alias;
2654
2655
 
2655
2656
  interface CellAttributes {
2656
2657
  readonly id: UID;
@@ -2669,7 +2670,7 @@ interface FormulaCell extends CellAttributes {
2669
2670
  readonly compiledFormula: CompiledFormula;
2670
2671
  readonly dependencies: Range[];
2671
2672
  }
2672
- declare type Cell = LiteralCell | FormulaCell;
2673
+ type Cell = LiteralCell | FormulaCell;
2673
2674
  interface EvaluatedCellProperties {
2674
2675
  readonly format?: Format;
2675
2676
  /**
@@ -2683,8 +2684,8 @@ interface EvaluatedCellProperties {
2683
2684
  readonly isAutoSummable: boolean;
2684
2685
  readonly link?: Link;
2685
2686
  }
2686
- declare type CellValue = string | number | boolean;
2687
- declare type EvaluatedCell = NumberCell | TextCell | BooleanCell | EmptyCell | ErrorCell;
2687
+ type CellValue = string | number | boolean;
2688
+ type EvaluatedCell = NumberCell | TextCell | BooleanCell | EmptyCell | ErrorCell;
2688
2689
  interface NumberCell extends EvaluatedCellProperties {
2689
2690
  readonly type: CellValueType.number;
2690
2691
  readonly value: number;
@@ -2744,7 +2745,7 @@ interface FormulaModifier {
2744
2745
  increment: number;
2745
2746
  current: number;
2746
2747
  }
2747
- declare type AutofillModifier = IncrementModifier | AlphanumericIncrementModifier | CopyModifier | FormulaModifier;
2748
+ type AutofillModifier = IncrementModifier | AlphanumericIncrementModifier | CopyModifier | FormulaModifier;
2748
2749
  interface Tooltip {
2749
2750
  props: any;
2750
2751
  component?: any;
@@ -2785,7 +2786,7 @@ interface Currency {
2785
2786
  position: "before" | "after";
2786
2787
  }
2787
2788
 
2788
- declare type ClipboardReadResult = {
2789
+ type ClipboardReadResult = {
2789
2790
  status: "ok";
2790
2791
  content: string;
2791
2792
  } | {
@@ -2797,7 +2798,7 @@ interface ClipboardInterface {
2797
2798
  readText(): Promise<ClipboardReadResult>;
2798
2799
  }
2799
2800
 
2800
- declare type TranslationFunction = (string: string, ...values: string[] | [{
2801
+ type TranslationFunction = (string: string, ...values: string[] | [{
2801
2802
  [key: string]: string;
2802
2803
  }]) => string;
2803
2804
  /***
@@ -2832,7 +2833,7 @@ interface SpreadsheetChildEnv extends SpreadsheetEnv {
2832
2833
  loadCurrencies?: () => Promise<Currency[]>;
2833
2834
  }
2834
2835
 
2835
- declare type ArgType = "ANY" | "BOOLEAN" | "NUMBER" | "STRING" | "DATE" | "RANGE" | "RANGE<BOOLEAN>" | "RANGE<NUMBER>" | "RANGE<DATE>" | "RANGE<STRING>" | "META";
2836
+ type ArgType = "ANY" | "BOOLEAN" | "NUMBER" | "STRING" | "DATE" | "RANGE" | "RANGE<BOOLEAN>" | "RANGE<NUMBER>" | "RANGE<DATE>" | "RANGE<STRING>" | "RANGE<ANY>" | "META";
2836
2837
  interface ArgDefinition {
2837
2838
  repeating?: boolean;
2838
2839
  optional?: boolean;
@@ -2843,8 +2844,8 @@ interface ArgDefinition {
2843
2844
  default?: boolean;
2844
2845
  defaultValue?: any;
2845
2846
  }
2846
- declare type ComputeFunctionArg<T> = T | (() => T) | undefined;
2847
- declare type ComputeFunction<T, R> = (this: EvalContext, ...args: ComputeFunctionArg<T>[]) => R;
2847
+ type ComputeFunctionArg<T> = T | (() => T) | undefined;
2848
+ type ComputeFunction<T, R> = (this: EvalContext, ...args: ComputeFunctionArg<T>[]) => R;
2848
2849
  interface AddFunctionDescription {
2849
2850
  description: string;
2850
2851
  compute: ComputeFunction<ArgValue, FunctionReturnValue>;
@@ -2861,7 +2862,7 @@ interface FunctionDescription extends AddFunctionDescription {
2861
2862
  nbrArgRepeating: number;
2862
2863
  getArgToFocus: (argPosition: number) => number;
2863
2864
  }
2864
- declare type EvalContext = {
2865
+ type EvalContext = {
2865
2866
  __lastFnCalled?: string;
2866
2867
  __originCellXC?: () => string;
2867
2868
  [key: string]: any;
@@ -3271,7 +3272,7 @@ interface ConditionalFormatState {
3271
3272
  };
3272
3273
  }
3273
3274
  declare class ConditionalFormatPlugin extends CorePlugin<ConditionalFormatState> implements ConditionalFormatState {
3274
- static getters: readonly ["getConditionalFormats", "getRulesSelection", "getRulesByCell"];
3275
+ static getters: readonly ["getConditionalFormats", "getRulesSelection", "getRulesByCell", "getAdaptedCfRanges"];
3275
3276
  readonly cfRules: {
3276
3277
  [sheet: string]: ConditionalFormatInternal[];
3277
3278
  };
@@ -3289,6 +3290,10 @@ declare class ConditionalFormatPlugin extends CorePlugin<ConditionalFormatState>
3289
3290
  getRulesSelection(sheetId: UID, selection: Zone[]): UID[];
3290
3291
  getRulesByZone(sheetId: UID, zone: Zone): Set<UID>;
3291
3292
  getRulesByCell(sheetId: UID, cellCol: number, cellRow: number): Set<ConditionalFormat>;
3293
+ /**
3294
+ * Add or remove cells to a given conditional formatting rule and return the adapted CF's XCs.
3295
+ */
3296
+ getAdaptedCfRanges(sheetId: UID, cf: ConditionalFormat, toAdd: string[], toRemove: string[]): string[] | undefined;
3292
3297
  private mapToConditionalFormat;
3293
3298
  private mapToConditionalFormatInternal;
3294
3299
  /**
@@ -3363,7 +3368,7 @@ interface FiltersState {
3363
3368
  tables: Record<UID, Record<FilterTableId, FilterTable | undefined>>;
3364
3369
  }
3365
3370
  declare class FiltersPlugin extends CorePlugin<FiltersState> implements FiltersState {
3366
- static getters: readonly ["doesZonesContainFilter", "getFilter", "getFilters", "getFilterTable", "getFilterTables", "getFilterTablesInZone", "getFilterId"];
3371
+ static getters: readonly ["doesZonesContainFilter", "getFilter", "getFilters", "getFilterTable", "getFilterTables", "getFilterTablesInZone", "getFilterId", "getFilterHeaders", "isFilterHeader"];
3367
3372
  readonly tables: Record<UID, Record<FilterTableId, FilterTable | undefined>>;
3368
3373
  allowDispatch(cmd: CoreCommand): CommandResult | CommandResult[];
3369
3374
  handle(cmd: CoreCommand): void;
@@ -3375,6 +3380,8 @@ declare class FiltersPlugin extends CorePlugin<FiltersState> implements FiltersS
3375
3380
  /** Get the filter tables that are fully inside the given zone */
3376
3381
  getFilterTablesInZone(sheetId: UID, zone: Zone): FilterTable[];
3377
3382
  doesZonesContainFilter(sheetId: UID, zones: Zone[]): boolean;
3383
+ getFilterHeaders(sheetId: UID): Position$1[];
3384
+ isFilterHeader({ sheetId, col, row }: CellPosition): boolean;
3378
3385
  private onAddColumnsRows;
3379
3386
  private onDeleteColumnsRows;
3380
3387
  private createFilterTable;
@@ -3481,7 +3488,7 @@ declare class ImagePlugin extends CorePlugin<ImageState> implements ImageState {
3481
3488
  private getAllImages;
3482
3489
  }
3483
3490
 
3484
- declare type SheetMergeCellMap = Record<number, Record<number, number | undefined> | undefined>;
3491
+ type SheetMergeCellMap = Record<number, Record<number, number | undefined> | undefined>;
3485
3492
  interface MergeState {
3486
3493
  readonly merges: Record<UID, Record<number, Range | undefined> | undefined>;
3487
3494
  readonly mergeCellMap: Record<UID, SheetMergeCellMap | undefined>;
@@ -3725,9 +3732,9 @@ declare class EvaluationPlugin extends UIPlugin {
3725
3732
  private positionsToUpdate;
3726
3733
  constructor(config: UIPluginConfig);
3727
3734
  beforeHandle(cmd: Command): void;
3728
- handle(cmd: Command): void;
3735
+ handle(cmd: CoreViewCommand): void;
3729
3736
  finalize(): void;
3730
- evaluateFormula(formulaString: string, sheetId?: UID): any;
3737
+ evaluateFormula(sheetId: UID, formulaString: string): any;
3731
3738
  /**
3732
3739
  * Return the value of each cell in the range as they are displayed in the grid.
3733
3740
  */
@@ -3752,16 +3759,20 @@ declare class EvaluationPlugin extends UIPlugin {
3752
3759
  private getCorrespondingFormulaCell;
3753
3760
  }
3754
3761
 
3762
+ interface CustomColorState {
3763
+ readonly customColors: Immutable<Record<Color, true>>;
3764
+ readonly shouldUpdateColors: boolean;
3765
+ }
3755
3766
  /**
3756
3767
  * CustomColors plugin
3757
3768
  * This plugins aims to compute and keep to custom colors used in the
3758
3769
  * current spreadsheet
3759
3770
  */
3760
- declare class CustomColorsPlugin extends UIPlugin {
3761
- private customColors;
3762
- private shouldUpdateColors;
3771
+ declare class CustomColorsPlugin extends UIPlugin<CustomColorState> {
3772
+ private readonly customColors;
3773
+ private readonly shouldUpdateColors;
3763
3774
  static getters: readonly ["getCustomColors"];
3764
- handle(cmd: Command): void;
3775
+ handle(cmd: CoreViewCommand): void;
3765
3776
  finalize(): void;
3766
3777
  getCustomColors(): Color[];
3767
3778
  private getColorsFromCells;
@@ -3770,11 +3781,14 @@ declare class CustomColorsPlugin extends UIPlugin {
3770
3781
  private tryToAddColor;
3771
3782
  }
3772
3783
 
3773
- declare class EvaluationChartPlugin extends UIPlugin {
3784
+ interface EvaluationChartState {
3785
+ readonly charts: Immutable<Record<UID, ChartRuntime | undefined>>;
3786
+ }
3787
+ declare class EvaluationChartPlugin extends UIPlugin<EvaluationChartState> {
3774
3788
  static getters: readonly ["getChartRuntime", "getBackgroundOfSingleCellChart"];
3775
- readonly charts: Record<UID, ChartRuntime | undefined>;
3789
+ readonly charts: Immutable<Record<UID, ChartRuntime | undefined>>;
3776
3790
  private createRuntimeChart;
3777
- handle(cmd: Command): void;
3791
+ handle(cmd: CoreViewCommand): void;
3778
3792
  getChartRuntime(figureId: UID): ChartRuntime;
3779
3793
  /**
3780
3794
  * Get the background color of a chart based on the color of the first cell of the main range
@@ -3793,10 +3807,10 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
3793
3807
  private isStale;
3794
3808
  private computedStyles;
3795
3809
  private computedIcons;
3796
- handle(cmd: Command): void;
3810
+ handle(cmd: CoreViewCommand): void;
3797
3811
  finalize(): void;
3798
3812
  getCellComputedStyle(position: CellPosition): Style;
3799
- getConditionalIcon({ col, row }: Position$1): string | undefined;
3813
+ getConditionalIcon({ sheetId, col, row }: CellPosition): string | undefined;
3800
3814
  /**
3801
3815
  * Compute the styles according to the conditional formatting.
3802
3816
  * This computation must happen after the cell values are computed if they change
@@ -3807,10 +3821,13 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
3807
3821
  * the resulting style will have the combination of all those values.
3808
3822
  * If multiple conditional formatting use the same style value, they will be applied in order so that the last applied wins
3809
3823
  */
3810
- private computeStyles;
3824
+ private getComputedStyles;
3825
+ private getComputedIcons;
3811
3826
  private parsePoint;
3827
+ /** Compute the CF icons for the given range and CF rule, and apply in in the given computedIcons object */
3812
3828
  private applyIcon;
3813
3829
  private computeIcon;
3830
+ /** Compute the color scale for the given range and CF rule, and apply in in the given computedStyle object */
3814
3831
  private applyColorScale;
3815
3832
  private computeColorDiffUnits;
3816
3833
  private colorCell;
@@ -3818,370 +3835,104 @@ declare class EvaluationConditionalFormatPlugin extends UIPlugin {
3818
3835
  * Execute the predicate to know if a conditional formatting rule should be applied to a cell
3819
3836
  */
3820
3837
  private rulePredicate;
3821
- /**
3822
- * Add or remove cells to a given conditional formatting rule.
3823
- */
3824
- private adaptRules;
3825
- private pasteCf;
3826
3838
  }
3827
3839
 
3828
- declare class FilterEvaluationPlugin extends UIPlugin {
3829
- static getters: readonly ["getCellBorderWithFilterBorder", "getFilterHeaders", "getFilterValues", "isFilterHeader", "isRowFiltered", "isFilterActive"];
3830
- private filterValues;
3831
- hiddenRows: Set<number>;
3832
- isEvaluationDirty: boolean;
3840
+ /**
3841
+ * Autofill Plugin
3842
+ *
3843
+ */
3844
+ declare class AutofillPlugin extends UIPlugin {
3845
+ static layers: LAYERS[];
3846
+ static getters: readonly ["getAutofillTooltip"];
3847
+ private autofillZone;
3848
+ private steps;
3849
+ private lastCellSelected;
3850
+ private direction;
3851
+ private tooltip;
3833
3852
  allowDispatch(cmd: LocalCommand): CommandResult;
3834
3853
  handle(cmd: Command): void;
3835
- finalize(): void;
3836
- isRowFiltered(sheetId: UID, row: number): boolean;
3837
- getCellBorderWithFilterBorder(position: CellPosition): Border$1 | null;
3838
- getFilterHeaders(sheetId: UID): Position$1[];
3839
- getFilterValues(position: CellPosition): string[];
3840
- isFilterHeader({ sheetId, col, row }: CellPosition): boolean;
3841
- isFilterActive(position: CellPosition): boolean;
3842
- private intersectZoneWithViewport;
3843
- private updateFilter;
3844
- private updateHiddenRows;
3845
- private getCellValueAsString;
3846
- exportForExcel(data: ExcelWorkbookData): void;
3854
+ getAutofillTooltip(): Tooltip | undefined;
3847
3855
  /**
3848
- * Get an unique column name for the column at colIndex. If the column name is already in the array of used column names,
3849
- * concatenate a number to the name until we find a new unique name (eg. "ColName" => "ColName1" => "ColName2" ...)
3850
- */
3851
- private getUniqueColNameForExcel;
3852
- }
3853
-
3854
- declare class InternalViewport {
3855
- private getters;
3856
- private sheetId;
3857
- private boundaries;
3858
- top: HeaderIndex;
3859
- bottom: HeaderIndex;
3860
- left: HeaderIndex;
3861
- right: HeaderIndex;
3862
- offsetX: Pixel;
3863
- offsetY: Pixel;
3864
- offsetScrollbarX: Pixel;
3865
- offsetScrollbarY: Pixel;
3866
- canScrollVertically: boolean;
3867
- canScrollHorizontally: boolean;
3868
- viewportWidth: Pixel;
3869
- viewportHeight: Pixel;
3870
- offsetCorrectionX: Pixel;
3871
- offsetCorrectionY: Pixel;
3872
- constructor(getters: Getters, sheetId: UID, boundaries: Zone, sizeInGrid: {
3873
- width: Pixel;
3874
- height: Pixel;
3875
- }, options: {
3876
- canScrollVertically: boolean;
3877
- canScrollHorizontally: boolean;
3878
- }, offsets: {
3879
- x: Pixel;
3880
- y: Pixel;
3881
- });
3882
- /** Returns the maximum size (in Pixels) of the viewport relative to its allocated client size
3883
- * When the viewport grid size is smaller than its client width (resp. height), it will return
3884
- * the client width (resp. height).
3856
+ * Autofill the autofillZone from the current selection
3857
+ * @param apply Flag set to true to apply the autofill in the model. It's
3858
+ * useful to set it to false when we need to fill the tooltip
3885
3859
  */
3886
- getMaxSize(): DOMDimension;
3860
+ private autofill;
3887
3861
  /**
3888
- * Return the index of a column given an offset x, based on the pane left
3889
- * visible cell.
3890
- * It returns -1 if no column is found.
3862
+ * Select a cell which becomes the last cell of the autofillZone
3891
3863
  */
3892
- getColIndex(x: Pixel, absolute?: boolean): HeaderIndex;
3864
+ private select;
3893
3865
  /**
3894
- * Return the index of a row given an offset y, based on the pane top
3895
- * visible cell.
3896
- * It returns -1 if no row is found.
3866
+ * Computes the autofillZone to autofill when the user double click on the
3867
+ * autofiller
3897
3868
  */
3898
- getRowIndex(y: Pixel, absolute?: boolean): HeaderIndex;
3869
+ private autofillAuto;
3899
3870
  /**
3900
- * This function will make sure that the provided cell position (or current selected position) is part of
3901
- * the pane that is actually displayed on the client. We therefore adjust the offset of the pane
3902
- * until it contains the cell completely.
3871
+ * Generate the next cell
3903
3872
  */
3904
- adjustPosition(position?: Position$1): void;
3905
- adjustPositionX(targetCol: HeaderIndex): void;
3906
- adjustPositionY(targetRow: HeaderIndex): void;
3907
- setViewportOffset(offsetX: Pixel, offsetY: Pixel): void;
3908
- adjustViewportZone(): void;
3873
+ private computeNewCell;
3909
3874
  /**
3910
- *
3911
- * @param zone
3912
- * @returns Computes the absolute coordinate of a given zone inside the viewport
3875
+ * Get the rule associated to the current cell
3913
3876
  */
3914
- getRect(zone: Zone): Rect | undefined;
3915
- isVisible(col: HeaderIndex, row: HeaderIndex): boolean;
3916
- private searchHeaderIndex;
3917
- private get zone();
3918
- private setViewportOffsetX;
3919
- private setViewportOffsetY;
3920
- /** Corrects the viewport's horizontal offset based on the current structure
3921
- * To make sure that at least on column is visible inside the viewport.
3877
+ private getRule;
3878
+ /**
3879
+ * Create the generator to be able to autofill the next cells.
3922
3880
  */
3923
- private adjustViewportOffsetX;
3924
- /** Corrects the viewport's vertical offset based on the current structure
3925
- * To make sure that at least on row is visible inside the viewport.
3881
+ private createGenerator;
3882
+ private saveZone;
3883
+ /**
3884
+ * Compute the direction of the autofill from the last selected zone and
3885
+ * a given cell (col, row)
3926
3886
  */
3927
- private adjustViewportOffsetY;
3928
- /** Updates the pane zone and snapped offset based on its horizontal
3929
- * offset (will find Left) and its width (will find Right) */
3930
- private adjustViewportZoneX;
3931
- /** Updates the pane zone and snapped offset based on its vertical
3932
- * offset (will find Top) and its width (will find Bottom) */
3933
- private adjustViewportZoneY;
3887
+ private getDirection;
3888
+ private autoFillMerge;
3889
+ private autofillCF;
3890
+ drawGrid(renderingContext: GridRenderingContext): void;
3934
3891
  }
3935
3892
 
3936
- declare type SheetViewports = {
3937
- topLeft: InternalViewport | undefined;
3938
- bottomLeft: InternalViewport | undefined;
3939
- topRight: InternalViewport | undefined;
3940
- bottomRight: InternalViewport;
3941
- };
3942
- /**
3943
- * EdgeScrollCases Schema
3944
- *
3945
- * The dots/double dots represent a freeze (= a split of viewports)
3946
- * In this example, we froze vertically between columns D and E
3947
- * and horizontally between rows 4 and 5.
3948
- *
3949
- * One can see that we scrolled horizontally from column E to G and
3950
- * vertically from row 5 to 7.
3951
- *
3952
- * A B C D G H I J K L M N O P Q R S T
3953
- * _______________________________________________________
3954
- * 1 | : |
3955
- * 2 | : |
3956
- * 3 | : B ↑ 6 |
3957
- * 4 | : | | | |
3958
- * ····················+···+·················+············|
3959
- * 7 | : | | | |
3960
- * 8 | : ↓ 2 | |
3961
- * 9 | : | |
3962
- * 10 | A --+--→ | |
3963
- * 11 | : | |
3964
- * 12 | : | |
3965
- * 13 | ←--+-- 1 | |
3966
- * 14 | : | 3 --+--→
3967
- * 15 | : | |
3968
- * 16 | : | |
3969
- * 17 | 5 --+-------------------------------------------+--→
3970
- * 18 | : | |
3971
- * 19 | : 4 | |
3972
- * 20 | : | | |
3973
- * ______________________________+___________| ____________
3974
- * | |
3975
- * ↓ ↓
3976
- */
3977
- /**
3978
- * Viewport plugin.
3979
- *
3980
- * This plugin manages all things related to all viewport states.
3981
- *
3982
- */
3983
- declare class SheetViewPlugin extends UIPlugin {
3984
- static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible"];
3985
- readonly viewports: Record<UID, SheetViewports | undefined>;
3986
- /**
3987
- * The viewport dimensions are usually set by one of the components
3988
- * (i.e. when grid component is mounted) to properly reflect its state in the DOM.
3989
- * In the absence of a component (standalone model), is it mandatory to set reasonable default values
3990
- * to ensure the correct operation of this plugin.
3991
- */
3992
- private sheetViewWidth;
3993
- private sheetViewHeight;
3994
- private gridOffsetX;
3995
- private gridOffsetY;
3996
- private sheetsWithDirtyViewports;
3997
- allowDispatch(cmd: LocalCommand): CommandResult | CommandResult[];
3998
- private handleEvent;
3893
+ interface AutomaticSum {
3894
+ position: Position$1;
3895
+ zone: Zone;
3896
+ }
3897
+ declare class AutomaticSumPlugin extends UIPlugin {
3898
+ static getters: readonly ["getAutomaticSums"];
3999
3899
  handle(cmd: Command): void;
4000
- finalize(): void;
4001
- private setViewports;
3900
+ getAutomaticSums(sheetId: UID, zone: Zone, anchor: Position$1): AutomaticSum[];
3901
+ private sumData;
3902
+ private sumAdjacentData;
4002
3903
  /**
4003
- * Return the index of a column given an offset x, based on the viewport left
4004
- * visible cell.
4005
- * It returns -1 if no column is found.
3904
+ * Find a zone to automatically sum a column or row of numbers.
3905
+ *
3906
+ * We first decide which direction will be summed (column or row).
3907
+ * Here is the strategy:
3908
+ * 1. If the left cell is a number and the top cell is not: choose horizontal
3909
+ * 2. Try to find a valid vertical zone. If it's valid: choose vertical
3910
+ * 3. Try to find a valid horizontal zone. If it's valid: choose horizontal
3911
+ * 4. Otherwise, no zone is returned
3912
+ *
3913
+ * Now, how to find a valid zone?
3914
+ * The zone starts directly above or on the left of the starting point
3915
+ * (depending on the direction).
3916
+ * The zone ends where the first continuous sequence of numbers ends.
3917
+ * Empty or text cells can be part of the zone while no number has been found.
3918
+ * Other kind of cells (boolean, dates, etc.) are not valid in the zone and the
3919
+ * search stops immediately if one is found.
3920
+ *
3921
+ * ------- -------
3922
+ * | 1 | | 1 |
3923
+ * ------- -------
3924
+ * | | | |
3925
+ * ------- <= end of the sequence, stop here -------
3926
+ * | 2 | | 2 |
3927
+ * ------- -------
3928
+ * | 3 | <= start of the number sequence | 3 |
3929
+ * ------- -------
3930
+ * | | <= ignored | FALSE | <= invalid, no zone is found
3931
+ * ------- -------
3932
+ * | A | <= ignored | A | <= ignored
3933
+ * ------- -------
4006
3934
  */
4007
- getColIndex(x: Pixel): HeaderIndex;
4008
- /**
4009
- * Return the index of a row given an offset y, based on the viewport top
4010
- * visible cell.
4011
- * It returns -1 if no row is found.
4012
- */
4013
- getRowIndex(y: Pixel): HeaderIndex;
4014
- getSheetViewDimensionWithHeaders(): DOMDimension;
4015
- getSheetViewDimension(): DOMDimension;
4016
- /** type as pane, not viewport but basically pane extends viewport */
4017
- getActiveMainViewport(): Viewport;
4018
- /**
4019
- * Return the scroll info of the active sheet, ie. the offset between the viewport left/top side and
4020
- * the grid left/top side, snapped to the columns/rows.
4021
- */
4022
- getActiveSheetScrollInfo(): SheetScrollInfo;
4023
- /**
4024
- * Return the DOM scroll info of the active sheet, ie. the offset between the viewport left/top side and
4025
- * the grid left/top side, corresponding to the scroll of the scrollbars and not snapped to the grid.
4026
- */
4027
- getActiveSheetDOMScrollInfo(): SheetDOMScrollInfo;
4028
- getSheetViewVisibleCols(): HeaderIndex[];
4029
- getSheetViewVisibleRows(): HeaderIndex[];
4030
- /**
4031
- * Return the main viewport maximum size relative to the client size.
4032
- */
4033
- getMainViewportRect(): Rect;
4034
- private getMaximumSheetOffset;
4035
- getColRowOffsetInViewport(dimension: Dimension, referenceIndex: HeaderIndex, index: HeaderIndex): Pixel;
4036
- /**
4037
- * Check if a given position is visible in the viewport.
4038
- */
4039
- isVisibleInViewport({ sheetId, col, row }: CellPosition): boolean;
4040
- getEdgeScrollCol(x: number, previousX: number, startingX: number): EdgeScrollInfo;
4041
- getEdgeScrollRow(y: number, previousY: number, tartingY: number): EdgeScrollInfo;
4042
- /**
4043
- * Computes the coordinates and size to draw the zone on the canvas
4044
- */
4045
- getVisibleRect(zone: Zone): Rect;
4046
- /**
4047
- * Returns the position of the MainViewport relatively to the start of the grid (without headers)
4048
- * It corresponds to the summed dimensions of the visible cols/rows (in x/y respectively)
4049
- * situated before the pane divisions.
4050
- */
4051
- getMainViewportCoordinates(): DOMCoordinates;
4052
- private ensureMainViewportExist;
4053
- private getSubViewports;
4054
- private checkPositiveDimension;
4055
- private checkValuesAreDifferent;
4056
- private checkScrollingDirection;
4057
- private getMainViewport;
4058
- private getMainInternalViewport;
4059
- /** gets rid of deprecated sheetIds */
4060
- private cleanViewports;
4061
- private resetSheetViews;
4062
- private resizeSheetView;
4063
- private recomputeViewports;
4064
- private setSheetViewOffset;
4065
- /**
4066
- * Clip the vertical offset within the allowed range.
4067
- * Not above the sheet, nor below the sheet.
4068
- */
4069
- private clipOffsetY;
4070
- private getViewportOffset;
4071
- private resetViewports;
4072
- /**
4073
- * Adjust the viewport such that the anchor position is visible
4074
- */
4075
- private refreshViewport;
4076
- /**
4077
- * Shift the viewport vertically and move the selection anchor
4078
- * such that it remains at the same place relative to the
4079
- * viewport top.
4080
- */
4081
- private shiftVertically;
4082
- getVisibleFigures(): Figure[];
4083
- isPositionVisible(position: PixelPosition): boolean;
4084
- getFrozenSheetViewRatio(sheetId: UID): {
4085
- xRatio: number;
4086
- yRatio: number;
4087
- };
4088
- }
4089
-
4090
- /**
4091
- * Autofill Plugin
4092
- *
4093
- */
4094
- declare class AutofillPlugin extends UIPlugin {
4095
- static layers: LAYERS[];
4096
- static getters: readonly ["getAutofillTooltip"];
4097
- private autofillZone;
4098
- private steps;
4099
- private lastCellSelected;
4100
- private direction;
4101
- private tooltip;
4102
- allowDispatch(cmd: LocalCommand): CommandResult;
4103
- handle(cmd: Command): void;
4104
- getAutofillTooltip(): Tooltip | undefined;
4105
- /**
4106
- * Autofill the autofillZone from the current selection
4107
- * @param apply Flag set to true to apply the autofill in the model. It's
4108
- * useful to set it to false when we need to fill the tooltip
4109
- */
4110
- private autofill;
4111
- /**
4112
- * Select a cell which becomes the last cell of the autofillZone
4113
- */
4114
- private select;
4115
- /**
4116
- * Computes the autofillZone to autofill when the user double click on the
4117
- * autofiller
4118
- */
4119
- private autofillAuto;
4120
- /**
4121
- * Generate the next cell
4122
- */
4123
- private computeNewCell;
4124
- /**
4125
- * Get the rule associated to the current cell
4126
- */
4127
- private getRule;
4128
- /**
4129
- * Create the generator to be able to autofill the next cells.
4130
- */
4131
- private createGenerator;
4132
- private saveZone;
4133
- /**
4134
- * Compute the direction of the autofill from the last selected zone and
4135
- * a given cell (col, row)
4136
- */
4137
- private getDirection;
4138
- private autoFillMerge;
4139
- drawGrid(renderingContext: GridRenderingContext): void;
4140
- }
4141
-
4142
- interface AutomaticSum {
4143
- position: Position$1;
4144
- zone: Zone;
4145
- }
4146
- declare class AutomaticSumPlugin extends UIPlugin {
4147
- static getters: readonly ["getAutomaticSums"];
4148
- handle(cmd: Command): void;
4149
- getAutomaticSums(sheetId: UID, zone: Zone, anchor: Position$1): AutomaticSum[];
4150
- private sumData;
4151
- private sumAdjacentData;
4152
- /**
4153
- * Find a zone to automatically sum a column or row of numbers.
4154
- *
4155
- * We first decide which direction will be summed (column or row).
4156
- * Here is the strategy:
4157
- * 1. If the left cell is a number and the top cell is not: choose horizontal
4158
- * 2. Try to find a valid vertical zone. If it's valid: choose vertical
4159
- * 3. Try to find a valid horizontal zone. If it's valid: choose horizontal
4160
- * 4. Otherwise, no zone is returned
4161
- *
4162
- * Now, how to find a valid zone?
4163
- * The zone starts directly above or on the left of the starting point
4164
- * (depending on the direction).
4165
- * The zone ends where the first continuous sequence of numbers ends.
4166
- * Empty or text cells can be part of the zone while no number has been found.
4167
- * Other kind of cells (boolean, dates, etc.) are not valid in the zone and the
4168
- * search stops immediately if one is found.
4169
- *
4170
- * ------- -------
4171
- * | 1 | | 1 |
4172
- * ------- -------
4173
- * | | | |
4174
- * ------- <= end of the sequence, stop here -------
4175
- * | 2 | | 2 |
4176
- * ------- -------
4177
- * | 3 | <= start of the number sequence | 3 |
4178
- * ------- -------
4179
- * | | <= ignored | FALSE | <= invalid, no zone is found
4180
- * ------- -------
4181
- * | A | <= ignored | A | <= ignored
4182
- * ------- -------
4183
- */
4184
- private findAdjacentData;
3935
+ private findAdjacentData;
4185
3936
  /**
4186
3937
  * Return the zone to sum if a valid one is found.
4187
3938
  * @see getAutomaticSumZone
@@ -4639,6 +4390,7 @@ declare class ClipboardPlugin extends UIPlugin {
4639
4390
  private state?;
4640
4391
  private lastPasteState?;
4641
4392
  private _isPaintingFormat;
4393
+ private originSheetId?;
4642
4394
  allowDispatch(cmd: LocalCommand): CommandResult;
4643
4395
  handle(cmd: Command): void;
4644
4396
  /**
@@ -4666,6 +4418,30 @@ declare class ClipboardPlugin extends UIPlugin {
4666
4418
  drawGrid(renderingContext: GridRenderingContext): void;
4667
4419
  }
4668
4420
 
4421
+ declare class FilterEvaluationPlugin extends UIPlugin {
4422
+ static getters: readonly ["getCellBorderWithFilterBorder", "getFilterValues", "isRowFiltered", "isFilterActive"];
4423
+ private filterValues;
4424
+ hiddenRows: Set<number>;
4425
+ isEvaluationDirty: boolean;
4426
+ allowDispatch(cmd: LocalCommand): CommandResult;
4427
+ handle(cmd: Command): void;
4428
+ finalize(): void;
4429
+ isRowFiltered(sheetId: UID, row: number): boolean;
4430
+ getCellBorderWithFilterBorder(position: CellPosition): Border$1 | null;
4431
+ getFilterValues(position: CellPosition): string[];
4432
+ isFilterActive(position: CellPosition): boolean;
4433
+ private intersectZoneWithViewport;
4434
+ private updateFilter;
4435
+ private updateHiddenRows;
4436
+ private getCellValueAsString;
4437
+ exportForExcel(data: ExcelWorkbookData): void;
4438
+ /**
4439
+ * Get an unique column name for the column at colIndex. If the column name is already in the array of used column names,
4440
+ * concatenate a number to the name until we find a new unique name (eg. "ColName" => "ColName1" => "ColName2" ...)
4441
+ */
4442
+ private getUniqueColNameForExcel;
4443
+ }
4444
+
4669
4445
  /**
4670
4446
  * SelectionPlugin
4671
4447
  */
@@ -4739,6 +4515,242 @@ declare class GridSelectionPlugin extends UIPlugin {
4739
4515
  drawGrid(renderingContext: GridRenderingContext): void;
4740
4516
  }
4741
4517
 
4518
+ declare class InternalViewport {
4519
+ private getters;
4520
+ private sheetId;
4521
+ private boundaries;
4522
+ top: HeaderIndex;
4523
+ bottom: HeaderIndex;
4524
+ left: HeaderIndex;
4525
+ right: HeaderIndex;
4526
+ offsetX: Pixel;
4527
+ offsetY: Pixel;
4528
+ offsetScrollbarX: Pixel;
4529
+ offsetScrollbarY: Pixel;
4530
+ canScrollVertically: boolean;
4531
+ canScrollHorizontally: boolean;
4532
+ viewportWidth: Pixel;
4533
+ viewportHeight: Pixel;
4534
+ offsetCorrectionX: Pixel;
4535
+ offsetCorrectionY: Pixel;
4536
+ constructor(getters: Getters, sheetId: UID, boundaries: Zone, sizeInGrid: {
4537
+ width: Pixel;
4538
+ height: Pixel;
4539
+ }, options: {
4540
+ canScrollVertically: boolean;
4541
+ canScrollHorizontally: boolean;
4542
+ }, offsets: {
4543
+ x: Pixel;
4544
+ y: Pixel;
4545
+ });
4546
+ /** Returns the maximum size (in Pixels) of the viewport relative to its allocated client size
4547
+ * When the viewport grid size is smaller than its client width (resp. height), it will return
4548
+ * the client width (resp. height).
4549
+ */
4550
+ getMaxSize(): DOMDimension;
4551
+ /**
4552
+ * Return the index of a column given an offset x, based on the pane left
4553
+ * visible cell.
4554
+ * It returns -1 if no column is found.
4555
+ */
4556
+ getColIndex(x: Pixel, absolute?: boolean): HeaderIndex;
4557
+ /**
4558
+ * Return the index of a row given an offset y, based on the pane top
4559
+ * visible cell.
4560
+ * It returns -1 if no row is found.
4561
+ */
4562
+ getRowIndex(y: Pixel, absolute?: boolean): HeaderIndex;
4563
+ /**
4564
+ * This function will make sure that the provided cell position (or current selected position) is part of
4565
+ * the pane that is actually displayed on the client. We therefore adjust the offset of the pane
4566
+ * until it contains the cell completely.
4567
+ */
4568
+ adjustPosition(position?: Position$1): void;
4569
+ adjustPositionX(targetCol: HeaderIndex): void;
4570
+ adjustPositionY(targetRow: HeaderIndex): void;
4571
+ setViewportOffset(offsetX: Pixel, offsetY: Pixel): void;
4572
+ adjustViewportZone(): void;
4573
+ /**
4574
+ *
4575
+ * @param zone
4576
+ * @returns Computes the absolute coordinate of a given zone inside the viewport
4577
+ */
4578
+ getRect(zone: Zone): Rect | undefined;
4579
+ isVisible(col: HeaderIndex, row: HeaderIndex): boolean;
4580
+ private searchHeaderIndex;
4581
+ private get zone();
4582
+ private setViewportOffsetX;
4583
+ private setViewportOffsetY;
4584
+ /** Corrects the viewport's horizontal offset based on the current structure
4585
+ * To make sure that at least on column is visible inside the viewport.
4586
+ */
4587
+ private adjustViewportOffsetX;
4588
+ /** Corrects the viewport's vertical offset based on the current structure
4589
+ * To make sure that at least on row is visible inside the viewport.
4590
+ */
4591
+ private adjustViewportOffsetY;
4592
+ /** Updates the pane zone and snapped offset based on its horizontal
4593
+ * offset (will find Left) and its width (will find Right) */
4594
+ private adjustViewportZoneX;
4595
+ /** Updates the pane zone and snapped offset based on its vertical
4596
+ * offset (will find Top) and its width (will find Bottom) */
4597
+ private adjustViewportZoneY;
4598
+ }
4599
+
4600
+ type SheetViewports = {
4601
+ topLeft: InternalViewport | undefined;
4602
+ bottomLeft: InternalViewport | undefined;
4603
+ topRight: InternalViewport | undefined;
4604
+ bottomRight: InternalViewport;
4605
+ };
4606
+ /**
4607
+ * EdgeScrollCases Schema
4608
+ *
4609
+ * The dots/double dots represent a freeze (= a split of viewports)
4610
+ * In this example, we froze vertically between columns D and E
4611
+ * and horizontally between rows 4 and 5.
4612
+ *
4613
+ * One can see that we scrolled horizontally from column E to G and
4614
+ * vertically from row 5 to 7.
4615
+ *
4616
+ * A B C D G H I J K L M N O P Q R S T
4617
+ * _______________________________________________________
4618
+ * 1 | : |
4619
+ * 2 | : |
4620
+ * 3 | : B ↑ 6 |
4621
+ * 4 | : | | | |
4622
+ * ····················+···+·················+············|
4623
+ * 7 | : | | | |
4624
+ * 8 | : ↓ 2 | |
4625
+ * 9 | : | |
4626
+ * 10 | A --+--→ | |
4627
+ * 11 | : | |
4628
+ * 12 | : | |
4629
+ * 13 | ←--+-- 1 | |
4630
+ * 14 | : | 3 --+--→
4631
+ * 15 | : | |
4632
+ * 16 | : | |
4633
+ * 17 | 5 --+-------------------------------------------+--→
4634
+ * 18 | : | |
4635
+ * 19 | : 4 | |
4636
+ * 20 | : | | |
4637
+ * ______________________________+___________| ____________
4638
+ * | |
4639
+ * ↓ ↓
4640
+ */
4641
+ /**
4642
+ * Viewport plugin.
4643
+ *
4644
+ * This plugin manages all things related to all viewport states.
4645
+ *
4646
+ */
4647
+ declare class SheetViewPlugin extends UIPlugin {
4648
+ static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible"];
4649
+ readonly viewports: Record<UID, SheetViewports | undefined>;
4650
+ /**
4651
+ * The viewport dimensions are usually set by one of the components
4652
+ * (i.e. when grid component is mounted) to properly reflect its state in the DOM.
4653
+ * In the absence of a component (standalone model), is it mandatory to set reasonable default values
4654
+ * to ensure the correct operation of this plugin.
4655
+ */
4656
+ private sheetViewWidth;
4657
+ private sheetViewHeight;
4658
+ private gridOffsetX;
4659
+ private gridOffsetY;
4660
+ private sheetsWithDirtyViewports;
4661
+ allowDispatch(cmd: LocalCommand): CommandResult | CommandResult[];
4662
+ private handleEvent;
4663
+ handle(cmd: Command): void;
4664
+ finalize(): void;
4665
+ private setViewports;
4666
+ /**
4667
+ * Return the index of a column given an offset x, based on the viewport left
4668
+ * visible cell.
4669
+ * It returns -1 if no column is found.
4670
+ */
4671
+ getColIndex(x: Pixel): HeaderIndex;
4672
+ /**
4673
+ * Return the index of a row given an offset y, based on the viewport top
4674
+ * visible cell.
4675
+ * It returns -1 if no row is found.
4676
+ */
4677
+ getRowIndex(y: Pixel): HeaderIndex;
4678
+ getSheetViewDimensionWithHeaders(): DOMDimension;
4679
+ getSheetViewDimension(): DOMDimension;
4680
+ /** type as pane, not viewport but basically pane extends viewport */
4681
+ getActiveMainViewport(): Viewport;
4682
+ /**
4683
+ * Return the scroll info of the active sheet, ie. the offset between the viewport left/top side and
4684
+ * the grid left/top side, snapped to the columns/rows.
4685
+ */
4686
+ getActiveSheetScrollInfo(): SheetScrollInfo;
4687
+ /**
4688
+ * Return the DOM scroll info of the active sheet, ie. the offset between the viewport left/top side and
4689
+ * the grid left/top side, corresponding to the scroll of the scrollbars and not snapped to the grid.
4690
+ */
4691
+ getActiveSheetDOMScrollInfo(): SheetDOMScrollInfo;
4692
+ getSheetViewVisibleCols(): HeaderIndex[];
4693
+ getSheetViewVisibleRows(): HeaderIndex[];
4694
+ /**
4695
+ * Return the main viewport maximum size relative to the client size.
4696
+ */
4697
+ getMainViewportRect(): Rect;
4698
+ private getMaximumSheetOffset;
4699
+ getColRowOffsetInViewport(dimension: Dimension, referenceIndex: HeaderIndex, index: HeaderIndex): Pixel;
4700
+ /**
4701
+ * Check if a given position is visible in the viewport.
4702
+ */
4703
+ isVisibleInViewport({ sheetId, col, row }: CellPosition): boolean;
4704
+ getEdgeScrollCol(x: number, previousX: number, startingX: number): EdgeScrollInfo;
4705
+ getEdgeScrollRow(y: number, previousY: number, tartingY: number): EdgeScrollInfo;
4706
+ /**
4707
+ * Computes the coordinates and size to draw the zone on the canvas
4708
+ */
4709
+ getVisibleRect(zone: Zone): Rect;
4710
+ /**
4711
+ * Returns the position of the MainViewport relatively to the start of the grid (without headers)
4712
+ * It corresponds to the summed dimensions of the visible cols/rows (in x/y respectively)
4713
+ * situated before the pane divisions.
4714
+ */
4715
+ getMainViewportCoordinates(): DOMCoordinates;
4716
+ private ensureMainViewportExist;
4717
+ private getSubViewports;
4718
+ private checkPositiveDimension;
4719
+ private checkValuesAreDifferent;
4720
+ private checkScrollingDirection;
4721
+ private getMainViewport;
4722
+ private getMainInternalViewport;
4723
+ /** gets rid of deprecated sheetIds */
4724
+ private cleanViewports;
4725
+ private resetSheetViews;
4726
+ private resizeSheetView;
4727
+ private recomputeViewports;
4728
+ private setSheetViewOffset;
4729
+ /**
4730
+ * Clip the vertical offset within the allowed range.
4731
+ * Not above the sheet, nor below the sheet.
4732
+ */
4733
+ private clipOffsetY;
4734
+ private getViewportOffset;
4735
+ private resetViewports;
4736
+ /**
4737
+ * Adjust the viewport such that the anchor position is visible
4738
+ */
4739
+ private refreshViewport;
4740
+ /**
4741
+ * Shift the viewport vertically and move the selection anchor
4742
+ * such that it remains at the same place relative to the
4743
+ * viewport top.
4744
+ */
4745
+ private shiftVertically;
4746
+ getVisibleFigures(): Figure[];
4747
+ isPositionVisible(position: PixelPosition): boolean;
4748
+ getFrozenSheetViewRatio(sheetId: UID): {
4749
+ xRatio: number;
4750
+ yRatio: number;
4751
+ };
4752
+ }
4753
+
4742
4754
  /**
4743
4755
  * Union of all getter names of a plugin.
4744
4756
  *
@@ -4767,46 +4779,46 @@ declare class GridSelectionPlugin extends UIPlugin {
4767
4779
  * This can be generalized because the union of all indices `0 | 1 | 2 | 3 | ...`
4768
4780
  * is actually the type `number`.
4769
4781
  */
4770
- declare type GetterNames<Plugin extends {
4782
+ type GetterNames<Plugin extends {
4771
4783
  getters: readonly string[];
4772
4784
  }> = Plugin["getters"][number];
4773
- declare type SheetGetters = Pick<SheetPlugin, GetterNames<typeof SheetPlugin>>;
4774
- declare type HeaderSizeGetters = Pick<HeaderSizePlugin, GetterNames<typeof HeaderSizePlugin>>;
4775
- declare type HeaderVisibilityGetters = Pick<HeaderVisibilityPlugin, GetterNames<typeof HeaderVisibilityPlugin>>;
4776
- declare type CellGetters = Pick<CellPlugin, GetterNames<typeof CellPlugin>>;
4777
- declare type MergeGetters = Pick<MergePlugin, GetterNames<typeof MergePlugin>>;
4778
- declare type BordersGetters = Pick<BordersPlugin, GetterNames<typeof BordersPlugin>>;
4779
- declare type ChartGetters = Pick<ChartPlugin, GetterNames<typeof ChartPlugin>>;
4780
- declare type ImageGetters = Pick<ImagePlugin, GetterNames<typeof ImagePlugin>>;
4781
- declare type FigureGetters = Pick<FigurePlugin, GetterNames<typeof FigurePlugin>>;
4782
- declare type RangeAdapterGetters = Pick<RangeAdapter, GetterNames<typeof RangeAdapter>>;
4783
- declare type ConditionalFormatGetters = Pick<ConditionalFormatPlugin, GetterNames<typeof ConditionalFormatPlugin>>;
4784
- declare type LocalHistoryGetters = Pick<HistoryPlugin, GetterNames<typeof HistoryPlugin>>;
4785
- declare type FiltersGetters = Pick<FiltersPlugin, GetterNames<typeof FiltersPlugin>>;
4786
- declare type CoreGetters = SheetGetters & HeaderSizeGetters & HeaderVisibilityGetters & CellGetters & MergeGetters & BordersGetters & ChartGetters & ImageGetters & ConditionalFormatGetters & FigureGetters & RangeAdapterGetters & FiltersGetters;
4787
- declare type AutofillGetters = Pick<AutofillPlugin, GetterNames<typeof AutofillPlugin>>;
4788
- declare type AutomaticSumGetters = Pick<AutomaticSumPlugin, GetterNames<typeof AutomaticSumPlugin>>;
4789
- declare type ClipboardGetters = Pick<ClipboardPlugin, GetterNames<typeof ClipboardPlugin>>;
4790
- declare type EditionGetters = Pick<EditionPlugin, GetterNames<typeof EditionPlugin>>;
4791
- declare type EvaluationGetters = Pick<EvaluationPlugin, GetterNames<typeof EvaluationPlugin>>;
4792
- declare type EvaluationChartGetters = Pick<EvaluationChartPlugin, GetterNames<typeof EvaluationChartPlugin>>;
4793
- declare type EvaluationConditionalFormatGetters = Pick<EvaluationConditionalFormatPlugin, GetterNames<typeof EvaluationConditionalFormatPlugin>>;
4794
- declare type FindAndReplaceGetters = Pick<FindAndReplacePlugin, GetterNames<typeof FindAndReplacePlugin>>;
4795
- declare type HeaderVisibilityIUIGetters = Pick<HeaderVisibilityUIPlugin, GetterNames<typeof HeaderVisibilityUIPlugin>>;
4796
- declare type HighlightGetters = Pick<HighlightPlugin, GetterNames<typeof HighlightPlugin>>;
4797
- declare type CustomColorsGetters = Pick<CustomColorsPlugin, GetterNames<typeof CustomColorsPlugin>>;
4798
- declare type RendererGetters = Pick<RendererPlugin, GetterNames<typeof RendererPlugin>>;
4799
- declare type SelectionGetters = Pick<GridSelectionPlugin, GetterNames<typeof GridSelectionPlugin>>;
4800
- declare type SelectionInputGetters = Pick<SelectionInputsManagerPlugin, GetterNames<typeof SelectionInputsManagerPlugin>>;
4801
- declare type CollaborativeGetters = Pick<CollaborativePlugin, GetterNames<typeof CollaborativePlugin>>;
4802
- declare type SortGetters = Pick<SortPlugin, GetterNames<typeof SortPlugin>>;
4803
- declare type UIOptionsGetters = Pick<UIOptionsPlugin, GetterNames<typeof UIOptionsPlugin>>;
4804
- declare type SheetUIGetters = Pick<SheetUIPlugin, GetterNames<typeof SheetUIPlugin>>;
4805
- declare type ViewportGetters = Pick<SheetViewPlugin, GetterNames<typeof SheetViewPlugin>>;
4806
- declare type CellPopoverPluginGetters = Pick<CellPopoverPlugin, GetterNames<typeof CellPopoverPlugin>>;
4807
- declare type FilterEvaluationGetters = Pick<FilterEvaluationPlugin, GetterNames<typeof FilterEvaluationPlugin>>;
4808
- declare type SplitToColumnsGetters = Pick<SplitToColumnsPlugin, GetterNames<typeof SplitToColumnsPlugin>>;
4809
- declare type Getters = {
4785
+ type SheetGetters = Pick<SheetPlugin, GetterNames<typeof SheetPlugin>>;
4786
+ type HeaderSizeGetters = Pick<HeaderSizePlugin, GetterNames<typeof HeaderSizePlugin>>;
4787
+ type HeaderVisibilityGetters = Pick<HeaderVisibilityPlugin, GetterNames<typeof HeaderVisibilityPlugin>>;
4788
+ type CellGetters = Pick<CellPlugin, GetterNames<typeof CellPlugin>>;
4789
+ type MergeGetters = Pick<MergePlugin, GetterNames<typeof MergePlugin>>;
4790
+ type BordersGetters = Pick<BordersPlugin, GetterNames<typeof BordersPlugin>>;
4791
+ type ChartGetters = Pick<ChartPlugin, GetterNames<typeof ChartPlugin>>;
4792
+ type ImageGetters = Pick<ImagePlugin, GetterNames<typeof ImagePlugin>>;
4793
+ type FigureGetters = Pick<FigurePlugin, GetterNames<typeof FigurePlugin>>;
4794
+ type RangeAdapterGetters = Pick<RangeAdapter, GetterNames<typeof RangeAdapter>>;
4795
+ type ConditionalFormatGetters = Pick<ConditionalFormatPlugin, GetterNames<typeof ConditionalFormatPlugin>>;
4796
+ type LocalHistoryGetters = Pick<HistoryPlugin, GetterNames<typeof HistoryPlugin>>;
4797
+ type FiltersGetters = Pick<FiltersPlugin, GetterNames<typeof FiltersPlugin>>;
4798
+ type CoreGetters = SheetGetters & HeaderSizeGetters & HeaderVisibilityGetters & CellGetters & MergeGetters & BordersGetters & ChartGetters & ImageGetters & ConditionalFormatGetters & FigureGetters & RangeAdapterGetters & FiltersGetters;
4799
+ type AutofillGetters = Pick<AutofillPlugin, GetterNames<typeof AutofillPlugin>>;
4800
+ type AutomaticSumGetters = Pick<AutomaticSumPlugin, GetterNames<typeof AutomaticSumPlugin>>;
4801
+ type ClipboardGetters = Pick<ClipboardPlugin, GetterNames<typeof ClipboardPlugin>>;
4802
+ type EditionGetters = Pick<EditionPlugin, GetterNames<typeof EditionPlugin>>;
4803
+ type EvaluationGetters = Pick<EvaluationPlugin, GetterNames<typeof EvaluationPlugin>>;
4804
+ type EvaluationChartGetters = Pick<EvaluationChartPlugin, GetterNames<typeof EvaluationChartPlugin>>;
4805
+ type EvaluationConditionalFormatGetters = Pick<EvaluationConditionalFormatPlugin, GetterNames<typeof EvaluationConditionalFormatPlugin>>;
4806
+ type FindAndReplaceGetters = Pick<FindAndReplacePlugin, GetterNames<typeof FindAndReplacePlugin>>;
4807
+ type HeaderVisibilityIUIGetters = Pick<HeaderVisibilityUIPlugin, GetterNames<typeof HeaderVisibilityUIPlugin>>;
4808
+ type HighlightGetters = Pick<HighlightPlugin, GetterNames<typeof HighlightPlugin>>;
4809
+ type CustomColorsGetters = Pick<CustomColorsPlugin, GetterNames<typeof CustomColorsPlugin>>;
4810
+ type RendererGetters = Pick<RendererPlugin, GetterNames<typeof RendererPlugin>>;
4811
+ type SelectionGetters = Pick<GridSelectionPlugin, GetterNames<typeof GridSelectionPlugin>>;
4812
+ type SelectionInputGetters = Pick<SelectionInputsManagerPlugin, GetterNames<typeof SelectionInputsManagerPlugin>>;
4813
+ type CollaborativeGetters = Pick<CollaborativePlugin, GetterNames<typeof CollaborativePlugin>>;
4814
+ type SortGetters = Pick<SortPlugin, GetterNames<typeof SortPlugin>>;
4815
+ type UIOptionsGetters = Pick<UIOptionsPlugin, GetterNames<typeof UIOptionsPlugin>>;
4816
+ type SheetUIGetters = Pick<SheetUIPlugin, GetterNames<typeof SheetUIPlugin>>;
4817
+ type ViewportGetters = Pick<SheetViewPlugin, GetterNames<typeof SheetViewPlugin>>;
4818
+ type CellPopoverPluginGetters = Pick<CellPopoverPlugin, GetterNames<typeof CellPopoverPlugin>>;
4819
+ type FilterEvaluationGetters = Pick<FilterEvaluationPlugin, GetterNames<typeof FilterEvaluationPlugin>>;
4820
+ type SplitToColumnsGetters = Pick<SplitToColumnsPlugin, GetterNames<typeof SplitToColumnsPlugin>>;
4821
+ type Getters = {
4810
4822
  isReadonly: () => boolean;
4811
4823
  isDashboard: () => boolean;
4812
4824
  } & LocalHistoryGetters & CoreGetters & AutofillGetters & AutomaticSumGetters & ClipboardGetters & EditionGetters & EvaluationGetters & EvaluationChartGetters & EvaluationConditionalFormatGetters & FindAndReplaceGetters & HighlightGetters & CustomColorsGetters & RendererGetters & SelectionGetters & SelectionInputGetters & CollaborativeGetters & SortGetters & UIOptionsGetters & SheetUIGetters & ViewportGetters & CellPopoverPluginGetters & FilterEvaluationGetters & HeaderVisibilityIUIGetters & SplitToColumnsGetters;
@@ -4825,7 +4837,7 @@ interface WorkbookHistory<Plugin> {
4825
4837
  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;
4826
4838
  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;
4827
4839
  }
4828
- declare type Transformation<T = unknown> = (dataToTransform: T) => T;
4840
+ type Transformation<T = unknown> = (dataToTransform: T) => T;
4829
4841
  interface TransformationFactory<T = unknown> {
4830
4842
  /**
4831
4843
  * Build a transformation function to transform any operation as if the execution of
@@ -4839,12 +4851,12 @@ interface TransformationFactory<T = unknown> {
4839
4851
  with: (operation: T) => Transformation<T>;
4840
4852
  }
4841
4853
 
4842
- declare type SelectionDirection = "up" | "down" | "left" | "right";
4843
- declare type SelectionStep = number | "end";
4854
+ type SelectionDirection = "up" | "down" | "left" | "right";
4855
+ type SelectionStep = number | "end";
4844
4856
 
4845
- declare type CellPopoverType = "ErrorToolTip" | "LinkDisplay" | "FilterMenu" | "LinkEditor";
4846
- declare type PopoverPropsPosition = "TopRight" | "BottomLeft";
4847
- declare type MaxSizedComponentConstructor = ComponentConstructor & {
4857
+ type CellPopoverType = "ErrorToolTip" | "LinkDisplay" | "FilterMenu" | "LinkEditor";
4858
+ type PopoverPropsPosition = "TopRight" | "BottomLeft";
4859
+ type MaxSizedComponentConstructor = ComponentConstructor & {
4848
4860
  maxSize?: {
4849
4861
  maxWidth?: number;
4850
4862
  maxHeight?: number;
@@ -4854,7 +4866,7 @@ declare type MaxSizedComponentConstructor = ComponentConstructor & {
4854
4866
  * If the cell at the given position have an associated component (linkDisplay, errorTooltip, ...),
4855
4867
  * returns the parameters to display the component
4856
4868
  */
4857
- declare type CellPopoverBuilder = (position: CellPosition, getters: Getters) => CellPopoverComponent<MaxSizedComponentConstructor>;
4869
+ type CellPopoverBuilder = (position: CellPosition, getters: Getters) => CellPopoverComponent<MaxSizedComponentConstructor>;
4858
4870
  interface PopoverBuilders {
4859
4871
  onOpen?: CellPopoverBuilder;
4860
4872
  onHover?: CellPopoverBuilder;
@@ -4867,14 +4879,14 @@ interface ClosedCellPopover {
4867
4879
  * i.e. which component class, which props and where to
4868
4880
  * display it relative to the cell
4869
4881
  */
4870
- declare type OpenCellPopover<C extends ComponentConstructor> = {
4882
+ type OpenCellPopover<C extends ComponentConstructor> = {
4871
4883
  isOpen: true;
4872
4884
  Component: C;
4873
4885
  props: PropsOf<C>;
4874
4886
  cellCorner: PopoverPropsPosition;
4875
4887
  };
4876
- declare type CellPopoverComponent<C extends MaxSizedComponentConstructor = MaxSizedComponentConstructor> = ClosedCellPopover | OpenCellPopover<C>;
4877
- declare type PositionedCellPopover<C extends MaxSizedComponentConstructor = MaxSizedComponentConstructor> = {
4888
+ type CellPopoverComponent<C extends MaxSizedComponentConstructor = MaxSizedComponentConstructor> = ClosedCellPopover | OpenCellPopover<C>;
4889
+ type PositionedCellPopover<C extends MaxSizedComponentConstructor = MaxSizedComponentConstructor> = {
4878
4890
  isOpen: true;
4879
4891
  Component: C;
4880
4892
  props: PropsOf<C>;
@@ -4943,7 +4955,7 @@ interface LinkSpec {
4943
4955
  declare function urlRepresentation(link: Link, getters: Getters): string;
4944
4956
  declare function openLink(link: Link, env: SpreadsheetChildEnv): void;
4945
4957
 
4946
- declare type TransformationFunction<U extends CoreCommandTypes, V extends CoreCommandTypes> = (toTransform: Extract<CoreCommand, {
4958
+ type TransformationFunction<U extends CoreCommandTypes, V extends CoreCommandTypes> = (toTransform: Extract<CoreCommand, {
4947
4959
  type: U;
4948
4960
  }>, executed: Extract<CoreCommand, {
4949
4961
  type: V;
@@ -4991,7 +5003,7 @@ interface ChartBuilder {
4991
5003
  sequence: number;
4992
5004
  }
4993
5005
 
4994
- interface Props$D {
5006
+ interface Props$E {
4995
5007
  ranges: () => string[];
4996
5008
  hasSingleRange?: boolean;
4997
5009
  required?: boolean;
@@ -5013,7 +5025,7 @@ interface SelectionRange extends Omit<RangeInputValue, "color"> {
5013
5025
  * onSelectionChanged is called every time the input value
5014
5026
  * changes.
5015
5027
  */
5016
- declare class SelectionInput extends Component<Props$D, SpreadsheetChildEnv> {
5028
+ declare class SelectionInput extends Component<Props$E, SpreadsheetChildEnv> {
5017
5029
  static template: string;
5018
5030
  private id;
5019
5031
  private previousRanges;
@@ -5042,15 +5054,26 @@ declare class SelectionInput extends Component<Props$D, SpreadsheetChildEnv> {
5042
5054
  confirm(): void;
5043
5055
  }
5044
5056
 
5057
+ interface Props$D {
5058
+ messages: string[];
5059
+ msgType: "warning" | "error";
5060
+ }
5061
+ declare class SidePanelErrors extends Component<Props$D, SpreadsheetChildEnv> {
5062
+ static template: string;
5063
+ get divClasses(): "o-sidepanel-warning text-warning" | "o-sidepanel-error text-danger";
5064
+ }
5065
+
5045
5066
  interface Props$C {
5046
5067
  figureId: UID;
5047
5068
  definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
5069
+ canUpdateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5048
5070
  updateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5049
5071
  }
5050
5072
  declare class LineBarPieConfigPanel extends Component<Props$C, SpreadsheetChildEnv> {
5051
5073
  static template: string;
5052
5074
  static components: {
5053
5075
  SelectionInput: typeof SelectionInput;
5076
+ SidePanelErrors: typeof SidePanelErrors;
5054
5077
  };
5055
5078
  private state;
5056
5079
  private dataSeriesRanges;
@@ -5155,16 +5178,22 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
5155
5178
  private state;
5156
5179
  get colorPickerStyle(): string;
5157
5180
  get popoverProps(): PopoverProps;
5181
+ get gradientHueStyle(): string;
5182
+ get sliderStyle(): string;
5183
+ get pointerStyle(): string;
5184
+ get colorPreviewStyle(): string;
5185
+ get checkmarkColor(): Color;
5186
+ get isHexColorInputValid(): boolean;
5187
+ private setCustomGradient;
5188
+ private setCustomHue;
5189
+ private updateColor;
5158
5190
  onColorClick(color: Color): void;
5159
- getCheckMarkColor(): Color;
5160
5191
  resetColor(): void;
5161
- setCustomColor(ev: Event): void;
5162
5192
  toggleColorPicker(): void;
5163
- computeCustomColor(ev: MouseEvent): void;
5164
- hideMagnifier(_ev: MouseEvent): void;
5165
- showMagnifier(_ev: MouseEvent): void;
5166
- moveMagnifier(ev: MouseEvent): void;
5167
- get magnifyingGlassStyle(): string;
5193
+ dragGradientPointer(ev: MouseEvent): void;
5194
+ dragHuePointer(ev: MouseEvent): void;
5195
+ setHexColor(ev: InputEvent): void;
5196
+ addCustomColor(ev: Event): void;
5168
5197
  isSameColor(color1: Color, color2: Color): boolean;
5169
5198
  }
5170
5199
 
@@ -5194,7 +5223,8 @@ declare class ColorPickerWidget extends Component<Props$B, SpreadsheetChildEnv>
5194
5223
  interface Props$A {
5195
5224
  figureId: UID;
5196
5225
  definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
5197
- updateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => CommandResult | CommandResult[];
5226
+ canUpdateChart: (definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5227
+ updateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5198
5228
  }
5199
5229
  declare class LineBarPieDesignPanel extends Component<Props$A, SpreadsheetChildEnv> {
5200
5230
  static template: string;
@@ -5206,19 +5236,21 @@ declare class LineBarPieDesignPanel extends Component<Props$A, SpreadsheetChildE
5206
5236
  setup(): void;
5207
5237
  toggleColorPicker(): void;
5208
5238
  updateBackgroundColor(color: Color): void;
5209
- updateTitle(ev: any): void;
5239
+ updateTitle(): void;
5210
5240
  updateSelect(attr: string, ev: any): void;
5211
5241
  }
5212
5242
 
5213
5243
  interface Props$z {
5214
5244
  figureId: UID;
5215
5245
  definition: GaugeChartDefinition;
5246
+ canUpdateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5216
5247
  updateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5217
5248
  }
5218
5249
  declare class GaugeChartConfigPanel extends Component<Props$z, SpreadsheetChildEnv> {
5219
5250
  static template: string;
5220
5251
  static components: {
5221
5252
  SelectionInput: typeof SelectionInput;
5253
+ SidePanelErrors: typeof SidePanelErrors;
5222
5254
  };
5223
5255
  private state;
5224
5256
  private dataRange;
@@ -5229,33 +5261,32 @@ declare class GaugeChartConfigPanel extends Component<Props$z, SpreadsheetChildE
5229
5261
  getDataRange(): string;
5230
5262
  }
5231
5263
 
5232
- declare type GaugeMenu = "backgroundColor" | "sectionColor-lowerColor" | "sectionColor-middleColor" | "sectionColor-upperColor";
5264
+ type GaugeMenu = "backgroundColor" | "sectionColor-lowerColor" | "sectionColor-middleColor" | "sectionColor-upperColor";
5233
5265
  interface Props$y {
5234
5266
  figureId: UID;
5235
5267
  definition: GaugeChartDefinition;
5268
+ canUpdateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5236
5269
  updateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5237
5270
  }
5238
5271
  declare class GaugeChartDesignPanel extends Component<Props$y, SpreadsheetChildEnv> {
5239
5272
  static template: string;
5240
5273
  static components: {
5241
5274
  ColorPickerWidget: typeof ColorPickerWidget;
5275
+ SidePanelErrors: typeof SidePanelErrors;
5242
5276
  };
5243
5277
  private state;
5244
5278
  setup(): void;
5245
5279
  get designErrorMessages(): string[];
5246
5280
  updateBackgroundColor(color: Color): void;
5247
- updateTitle(ev: any): void;
5281
+ updateTitle(): void;
5248
5282
  isRangeMinInvalid(): boolean;
5249
5283
  isRangeMaxInvalid(): boolean;
5250
5284
  get isLowerInflectionPointInvalid(): boolean;
5251
5285
  get isUpperInflectionPointInvalid(): boolean;
5252
- updateInflectionPointValue(attr: string, ev: any): void;
5253
- updateInflectionPointType(attr: string, ev: any): void;
5254
5286
  updateSectionColor(target: string, color: Color): void;
5255
- updateRangeMin(ev: any): void;
5256
- updateRangeMax(ev: any): void;
5257
5287
  toggleMenu(menu: GaugeMenu): void;
5258
- private updateSectionRule;
5288
+ updateSectionRule(sectionRule: SectionRule): void;
5289
+ canUpdateSectionRule(sectionRule: SectionRule): void;
5259
5290
  private closeMenus;
5260
5291
  }
5261
5292
 
@@ -5270,12 +5301,14 @@ declare class LineConfigPanel extends LineBarPieConfigPanel {
5270
5301
  interface Props$x {
5271
5302
  figureId: UID;
5272
5303
  definition: ScorecardChartDefinition;
5304
+ canUpdateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5273
5305
  updateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5274
5306
  }
5275
5307
  declare class ScorecardChartConfigPanel extends Component<Props$x, SpreadsheetChildEnv> {
5276
5308
  static template: string;
5277
5309
  static components: {
5278
5310
  SelectionInput: typeof SelectionInput;
5311
+ SidePanelErrors: typeof SidePanelErrors;
5279
5312
  };
5280
5313
  private state;
5281
5314
  private keyValue;
@@ -5292,10 +5325,11 @@ declare class ScorecardChartConfigPanel extends Component<Props$x, SpreadsheetCh
5292
5325
  updateBaselineMode(ev: any): void;
5293
5326
  }
5294
5327
 
5295
- declare type ColorPickerId = undefined | "backgroundColor" | "baselineColorUp" | "baselineColorDown";
5328
+ type ColorPickerId = undefined | "backgroundColor" | "baselineColorUp" | "baselineColorDown";
5296
5329
  interface Props$w {
5297
5330
  figureId: UID;
5298
5331
  definition: ScorecardChartDefinition;
5332
+ canUpdateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5299
5333
  updateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5300
5334
  }
5301
5335
  declare class ScorecardChartDesignPanel extends Component<Props$w, SpreadsheetChildEnv> {
@@ -5305,7 +5339,7 @@ declare class ScorecardChartDesignPanel extends Component<Props$w, SpreadsheetCh
5305
5339
  };
5306
5340
  private state;
5307
5341
  setup(): void;
5308
- updateTitle(ev: any): void;
5342
+ updateTitle(): void;
5309
5343
  updateBaselineDescr(ev: any): void;
5310
5344
  toggleColorPicker(colorPickerId: ColorPickerId): void;
5311
5345
  setColor(color: Color, colorPickerId: ColorPickerId): void;
@@ -5384,8 +5418,8 @@ interface Action {
5384
5418
  separator: boolean;
5385
5419
  textColor?: Color;
5386
5420
  }
5387
- declare type ActionBuilder = (env: SpreadsheetChildEnv) => ActionSpec[];
5388
- declare type ActionChildren = (ActionSpec | ActionBuilder)[];
5421
+ type ActionBuilder = (env: SpreadsheetChildEnv) => ActionSpec[];
5422
+ type ActionChildren = (ActionSpec | ActionBuilder)[];
5389
5423
 
5390
5424
  /**
5391
5425
  * This registry is intended to map a type of figure (tag) to a class of
@@ -5488,7 +5522,7 @@ declare class ScorecardChart extends Component<Props$u, SpreadsheetChildEnv> {
5488
5522
  private getWidestElement;
5489
5523
  }
5490
5524
 
5491
- declare type MenuItemOrSeparator = Action | "separator";
5525
+ type MenuItemOrSeparator = Action | "separator";
5492
5526
  interface Props$t {
5493
5527
  position: DOMCoordinates;
5494
5528
  menuItems: Action[];
@@ -5542,7 +5576,7 @@ declare class Menu extends Component<Props$t, SpreadsheetChildEnv> {
5542
5576
  onMouseOver(menu: Action, position: Pixel, ev: MouseEvent): void;
5543
5577
  }
5544
5578
 
5545
- declare type ResizeAnchor = "top left" | "top" | "top right" | "right" | "bottom right" | "bottom" | "bottom left" | "left";
5579
+ type ResizeAnchor = "top left" | "top" | "top right" | "right" | "bottom right" | "bottom" | "bottom left" | "left";
5546
5580
  interface Props$s {
5547
5581
  figure: Figure;
5548
5582
  style: string;
@@ -5827,8 +5861,8 @@ declare class FilterIconsOverlay extends Component<Props$l, SpreadsheetChildEnv>
5827
5861
  private isPositionVisible;
5828
5862
  }
5829
5863
 
5830
- declare type HFigureAxisType = "top" | "bottom" | "vCenter";
5831
- declare type VFigureAxisType = "right" | "left" | "hCenter";
5864
+ type HFigureAxisType = "top" | "bottom" | "vCenter";
5865
+ type VFigureAxisType = "right" | "left" | "hCenter";
5832
5866
  interface SnapLine<T extends HFigureAxisType | VFigureAxisType> {
5833
5867
  matchedFigIds: UID[];
5834
5868
  snapOffset: number;
@@ -5836,7 +5870,7 @@ interface SnapLine<T extends HFigureAxisType | VFigureAxisType> {
5836
5870
  position: Pixel;
5837
5871
  }
5838
5872
 
5839
- declare type ContainerType = "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "dnd";
5873
+ type ContainerType = "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "dnd";
5840
5874
  interface Props$k {
5841
5875
  onFigureDeleted: () => void;
5842
5876
  }
@@ -5998,7 +6032,7 @@ declare class GridPopover extends Component<Props$i, SpreadsheetChildEnv> {
5998
6032
  get cellPopover(): PositionedCellPopover | ClosedCellPopover;
5999
6033
  }
6000
6034
 
6001
- declare type ScrollDirection = "horizontal" | "vertical";
6035
+ type ScrollDirection = "horizontal" | "vertical";
6002
6036
 
6003
6037
  interface Props$h {
6004
6038
  width: Pixel;
@@ -6390,7 +6424,7 @@ declare class ActionButton extends Component<Props$c, SpreadsheetChildEnv> {
6390
6424
  get buttonStyle(): string;
6391
6425
  }
6392
6426
 
6393
- declare type Tool = "borderColorTool" | "borderTypeTool";
6427
+ type Tool = "borderColorTool" | "borderTypeTool";
6394
6428
  interface State$3 {
6395
6429
  activeTool: Tool | undefined;
6396
6430
  }
@@ -6490,6 +6524,10 @@ declare class ContentEditableHelper {
6490
6524
  */
6491
6525
  setText(contents: HtmlContent[][]): void;
6492
6526
  scrollSelectionIntoView(): void;
6527
+ /**
6528
+ * remove the current selection of the user
6529
+ * */
6530
+ removeSelection(): void;
6493
6531
  private removeAll;
6494
6532
  /**
6495
6533
  * finds the indexes of the current selection.
@@ -6537,7 +6575,7 @@ declare class FunctionDescriptionProvider extends Component<Props$9> {
6537
6575
  onMouseMove(): void;
6538
6576
  }
6539
6577
 
6540
- declare type HtmlContent = {
6578
+ type HtmlContent = {
6541
6579
  value: string;
6542
6580
  color?: Color;
6543
6581
  class?: string;
@@ -6606,7 +6644,17 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6606
6644
  onInput(ev: InputEvent): void;
6607
6645
  onKeyup(): void;
6608
6646
  showAutocomplete(searchTerm: string): void;
6647
+ /**
6648
+ * This is required to ensure the content helper selection is
6649
+ * properly updated on "onclick" events. Depending on the browser,
6650
+ * the callback onClick from the composer will be executed before
6651
+ * the selection was updated in the dom, which means we capture an
6652
+ * wrong selection which is then forced upon the content helper on
6653
+ * patchContent.
6654
+ */
6655
+ onMousedown(ev: MouseEvent): void;
6609
6656
  onClick(): void;
6657
+ onDblClick(): void;
6610
6658
  private processContent;
6611
6659
  /**
6612
6660
  * Get the HTML content corresponding to the current composer token, divided by lines.
@@ -6648,6 +6696,7 @@ interface State$1 {
6648
6696
  interface Props$7 {
6649
6697
  onToggle: () => void;
6650
6698
  dropdownStyle: string;
6699
+ class: string;
6651
6700
  }
6652
6701
  declare class FontSizeEditor extends Component<Props$7, SpreadsheetChildEnv> {
6653
6702
  static template: string;
@@ -6716,7 +6765,7 @@ declare class TopBar extends Component<Props$6, SpreadsheetChildEnv> {
6716
6765
  setColor(target: string, color: Color): void;
6717
6766
  }
6718
6767
 
6719
- declare type ComposerFocusType = "inactive" | "cellFocus" | "contentFocus";
6768
+ type ComposerFocusType = "inactive" | "cellFocus" | "contentFocus";
6720
6769
  interface SpreadsheetProps {
6721
6770
  model: Model;
6722
6771
  }
@@ -6907,7 +6956,7 @@ declare class HeadersOverlay extends Component<any, SpreadsheetChildEnv> {
6907
6956
  selectAll(): void;
6908
6957
  }
6909
6958
 
6910
- declare type Orientation$1 = "n" | "s" | "w" | "e";
6959
+ type Orientation$1 = "n" | "s" | "w" | "e";
6911
6960
  interface Props$4 {
6912
6961
  zone: Zone;
6913
6962
  orientation: Orientation$1;
@@ -6920,7 +6969,7 @@ declare class Border extends Component<Props$4, SpreadsheetChildEnv> {
6920
6969
  onMouseDown(ev: MouseEvent): void;
6921
6970
  }
6922
6971
 
6923
- declare type Orientation = "nw" | "ne" | "sw" | "se";
6972
+ type Orientation = "nw" | "ne" | "sw" | "se";
6924
6973
  interface Props$3 {
6925
6974
  zone: Zone;
6926
6975
  color: Color;
@@ -6964,7 +7013,7 @@ declare class Highlight extends Component<Props$2, SpreadsheetChildEnv> {
6964
7013
  * - a horizontal resizer (to resize columns)
6965
7014
  * - a vertical resizer (same, for rows)
6966
7015
  */
6967
- declare type ContextMenuType = "ROW" | "COL" | "CELL" | "FILTER";
7016
+ type ContextMenuType = "ROW" | "COL" | "CELL" | "FILTER";
6968
7017
  interface Props$1 {
6969
7018
  sidePanelIsOpen: boolean;
6970
7019
  exposeFocus: (focus: () => void) => void;
@@ -7029,7 +7078,7 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
7029
7078
  onCellRightClicked(col: HeaderIndex, row: HeaderIndex, { x, y }: DOMCoordinates): void;
7030
7079
  toggleContextMenu(type: ContextMenuType, x: Pixel, y: Pixel): void;
7031
7080
  copy(cut: boolean, ev: ClipboardEvent): void;
7032
- paste(ev: ClipboardEvent): void;
7081
+ paste(ev: ClipboardEvent): Promise<void>;
7033
7082
  private displayWarningCopyPasteNotSupported;
7034
7083
  private clearFormatting;
7035
7084
  private setHorizontalAlign;
@@ -7045,6 +7094,7 @@ declare class ChartPanel extends Component<Props, SpreadsheetChildEnv> {
7045
7094
  get figureId(): UID;
7046
7095
  setup(): void;
7047
7096
  updateChart<T extends ChartDefinition>(figureId: UID, updateDefinition: Partial<T>): DispatchResult | undefined;
7097
+ canUpdateChart<T extends ChartDefinition>(figureId: UID, updateDefinition: Partial<T>): DispatchResult | undefined;
7048
7098
  onTypeChange(type: ChartType): void;
7049
7099
  get chartPanel(): ChartSidePanel;
7050
7100
  private getChartDefinition;