import * as _atomic_testing_core0 from "@atomic-testing/core"; import { ComponentDriver, ComponentDriverCtor, IComponentDriverOption, Interactor, PartLocator } from "@atomic-testing/core"; import { HTMLElementDriver } from "@atomic-testing/component-driver-html"; //#region src/components/datagrid/DataGridCellQuery.d.ts interface CellQueryByColumnIndex { rowIndex: number; columnIndex: number; } interface CellQueryByColumnField { rowIndex: number; columnField: string; } type DataGridCellQuery = CellQueryByColumnIndex | CellQueryByColumnField; //#endregion //#region src/components/datagrid/DataGridRowDriverBase.d.ts /** * Base class for data grid row */ declare abstract class DataGridRowDriverBase extends ComponentDriver { protected getCellCount(): Promise; /** * Get the text of each visible cell in the row. * Caveat: Because of virtualization, the text of the cell may not be available until the cell is visible. * @returns A promise array of text of each visible cell in the row */ getRowText(): Promise; /** * Get the cell driver at the specified index or data field. * Caveat: Because of virtualization, the cell may not be available until the cell is visible. * @param cellIndexOrField number: column index, string: column field * @param driverClass The driver class of the cell. Default is HTMLElementDriver * @returns A promise of the cell driver, or null if the cell is not found */ getCell(cellIndexOrField: number | string, // number: column index, string: column field driverClass?: ComponentDriverCtor): Promise; protected abstract getCellLocator(): PartLocator; } //#endregion //#region src/components/datagrid/DataGridDataRowDriver.d.ts declare class DataGridDataRowDriver extends DataGridRowDriverBase { private readonly _dataCellLocator; constructor(locator: PartLocator, interactor: Interactor, option?: Partial); protected getCellLocator(): PartLocator; get driverName(): string; } //#endregion //#region src/components/datagrid/DataGridHeaderRowDriver.d.ts declare class DataGridHeaderRowDriver extends DataGridRowDriverBase { private readonly _headerCellLocator; constructor(locator: PartLocator, interactor: Interactor, option?: Partial); getColumnCount(): Promise; protected getCellLocator(): PartLocator; get driverName(): string; } //#endregion //#region src/components/datagrid/DataGridProDriver.d.ts declare const parts: { headerRow: { locator: PartLocator; driver: typeof DataGridHeaderRowDriver; }; loading: { locator: _atomic_testing_core0.CssLocator; driver: typeof HTMLElementDriver; }; }; /** * Driver for Material UI v6 DataGridPro component. * @see https://mui.com/x/react-data-grid/ */ declare class DataGridProDriver extends ComponentDriver { constructor(locator: PartLocator, interactor: Interactor, option?: Partial); /** * Checks if the data grid is currently loading. * @returns A promise that resolves to a boolean indicating if the data grid is loading. */ isLoading(): Promise; /** * Waits for the data grid to exit the loading state. * @param timeoutMs The maximum time to wait for the load to complete, in milliseconds. */ waitForLoad(timeoutMs?: number): Promise; /** * The number of columns currently displayed in the data grid, note that data grid pro * uses virtualize rendering, therefore the column count heavily depends on the viewport size * @returns The number of columns currently displayed in the data grid */ getColumnCount(): Promise; /** * The array text of the header row, note that columns not shown in the viewport may not be included because of virtualize rendering * @returns The array of text of the header row */ getHeaderText(): Promise; /** * The number of rows currently displayed in the data grid, note that data grid pro * uses virtualize rendering, therefore the row count heavily depends on the viewport size * @returns The number of columns currently displayed in the data grid */ getRowCount(): Promise; /** * Return the row driver for the row at the specified index, if the row does not exist, return null * @param rowIndex * @returns */ getRow(rowIndex: number): Promise; /** * The array text of the specified row, note that columns not shown in the viewport may not be included because of virtualize rendering * @param rowIndex The index of the row * @returns The array of text of the specified row */ getRowText(rowIndex: number): Promise; /** * Get the cell driver for the cell, if the cell does not exist, return null * The cell driver is default to HTMLElementDriver, you can specify a different driver class * @param query The query to locate the cell * @param driverClass Optional, the driver class to use for the cell, default to HTMLElementDriver * @returns */ getCell(query: DataGridCellQuery, driverClass?: ComponentDriverCtor): Promise; /** * Get the text content of the cell, if the cell does not exist, throw an error * @param query The query to locate the cell * @returns */ getCellText(query: DataGridCellQuery): Promise; get driverName(): string; } //#endregion export { CellQueryByColumnField, CellQueryByColumnIndex, DataGridCellQuery, DataGridDataRowDriver, DataGridHeaderRowDriver, DataGridProDriver }; //# sourceMappingURL=index.d.mts.map