| 20 | import { Utils } from "./common/utils"; |
| 21 | |
| 22 | export interface ILocator { |
| 23 | /** |
| 24 | * Returns the width that a column must be to contain all the content of |
| 25 | * its cells without truncating or wrapping. |
| 26 | */ |
| 27 | getWidestVisibleCellInColumn: (columnIndex: number) => number; |
| 28 | |
| 29 | /** |
| 30 | * Returns the height of the tallest cell in a given column -- specifically, |
| 31 | * tallest as in how tall the cell would have to be to display all the content in it |
| 32 | */ |
| 33 | getTallestVisibleCellInColumn: (columnIndex: number) => number; |
| 34 | |
| 35 | /** |
| 36 | * Locates a column's index given the client X coordinate. Returns -1 if |
| 37 | * the coordinate is not over a column. |
| 38 | * If `useMidpoint` is `true`, returns the index of the column whose left |
| 39 | * edge is closest, splitting on the midpoint of each column. |
| 40 | */ |
| 41 | convertPointToColumn: (clientX: number, useMidpoint?: boolean) => number; |
| 42 | |
| 43 | /** |
| 44 | * Locates a row's index given the client Y coordinate. Returns -1 if |
| 45 | * the coordinate is not over a row. |
| 46 | * If `useMidpoint` is `true`, returns the index of the row whose top |
| 47 | * edge is closest, splitting on the midpoint of each row. |
| 48 | */ |
| 49 | convertPointToRow: (clientY: number, useMidpoint?: boolean) => number; |
| 50 | |
| 51 | /** |
| 52 | * Locates a cell's row and column index given the client X |
| 53 | * coordinate. Returns -1 if the coordinate is not over a table cell. |
| 54 | */ |
| 55 | convertPointToCell: (clientX: number, clientY: number) => { col: number; row: number }; |
| 56 | } |
| 57 | |
| 58 | export class Locator implements ILocator { |
| 59 | public static CELL_HORIZONTAL_PADDING = 10; |
nothing calls this directly
no outgoing calls
no test coverage detected