iRangeController.d.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import { Column } from "../entities/column";
  2. import { CellPosition } from "../entities/cellPosition";
  3. import { GridPanel } from "../gridPanel/gridPanel";
  4. import { RowPosition } from "../entities/rowPosition";
  5. import { CellComp } from "../rendering/cellComp";
  6. export interface IRangeController {
  7. isEmpty(): boolean;
  8. removeAllCellRanges(): void;
  9. getCellRangeCount(cell: CellPosition): number;
  10. isCellInAnyRange(cell: CellPosition): boolean;
  11. isCellInSpecificRange(cell: CellPosition, range: CellRange): boolean;
  12. isBottomRightCell(cellRange: CellRange, cell: CellPosition): boolean;
  13. isContiguousRange(cellRange: CellRange): boolean;
  14. isMoreThanOneCell(): boolean;
  15. onDragStart(mouseEvent: MouseEvent): void;
  16. onDragStop(): void;
  17. onDragging(mouseEvent: MouseEvent): void;
  18. getCellRanges(): CellRange[];
  19. setRangeToCell(cell: CellPosition, appendRange?: boolean): void;
  20. setCellRange(params: CellRangeParams): void;
  21. addCellRange(params: CellRangeParams): void;
  22. extendLatestRangeInDirection(key: number): CellPosition | undefined;
  23. extendLatestRangeToCell(cell: CellPosition): void;
  24. updateRangeEnd(cellRange: CellRange, cellPosition: CellPosition, silent?: boolean): void;
  25. registerGridComp(gridPanel: GridPanel): void;
  26. getRangeStartRow(cellRange: CellRange): RowPosition;
  27. getRangeEndRow(cellRange: CellRange): RowPosition;
  28. createCellRangeFromCellRangeParams(params: CellRangeParams): CellRange | undefined;
  29. setCellRanges(cellRanges: CellRange[]): void;
  30. }
  31. export interface ISelectionHandle {
  32. getGui(): HTMLElement;
  33. getType(): SelectionHandleType;
  34. refresh(cellComp: CellComp): void;
  35. }
  36. export interface ISelectionHandleFactory {
  37. createSelectionHandle(type: SelectionHandleType): ISelectionHandle;
  38. }
  39. export declare enum SelectionHandleType {
  40. FILL = 0,
  41. RANGE = 1
  42. }
  43. export declare enum CellRangeType {
  44. VALUE = 0,
  45. DIMENSION = 1
  46. }
  47. export interface CellRange {
  48. id?: string;
  49. type?: CellRangeType;
  50. startRow?: RowPosition;
  51. endRow?: RowPosition;
  52. columns: Column[];
  53. startColumn: Column;
  54. }
  55. export interface CellRangeParams {
  56. rowStartIndex?: number;
  57. rowStartPinned?: string;
  58. rowEndIndex?: number;
  59. rowEndPinned?: string;
  60. columnStart?: string | Column;
  61. columnEnd?: string | Column;
  62. columns?: (string | Column)[];
  63. }
  64. /** @deprecated */
  65. export interface RangeSelection {
  66. start: CellPosition;
  67. end: CellPosition;
  68. columns: Column[] | null;
  69. }
  70. /** @deprecated */
  71. export interface AddRangeSelectionParams {
  72. rowStart: number;
  73. floatingStart: string;
  74. rowEnd: number;
  75. floatingEnd: string;
  76. columnStart: string | Column;
  77. columnEnd: string | Column;
  78. }