"use strict";

exports.__esModule = true;
exports.TableGridSwitchUniDriver = TableGridSwitchUniDriver;
exports.default = void 0;
var _TableUni = require("../Table/Table.uni.driver");
var _GridUni = require("../Grid/Grid.uni.driver");
var _CollectionToolbarUni = require("../CollectionToolbar/CollectionToolbar.uni.driver");
var _unidriver = require("../../unidriver");
var _SummaryBarUni = require("../SummaryBar/SummaryBar.uni.driver");
function TableGridSwitchUniDriver(base, body) {
  const getToolbar = () => (0, _CollectionToolbarUni.CollectionToolbarUniDriver)(base.$('[data-hook="collection-toolbar"]'), body);
  const getTable = () => (0, _TableUni.TableUniDriver)(base, body);
  const getGrid = () => (0, _GridUni.GridUniDriver)(base, body);
  const getSummaryBar = () => (0, _SummaryBarUni.SummaryBarUniDriver)(base, body);
  return {
    ...(0, _unidriver.baseUniDriverFactory)(base),
    /**
     * Wait until root element to exist
     * @param timeout - time to wait until bailing
     */
    wait: timeout => base.wait(timeout),
    /** Get layout switch button */
    getSwitchButton: () => getToolbar().getSwitchButton(),
    /** Get layout switch button divider */
    getSwitchButtonDivider: () => getToolbar().getSwitchButtonDivider(),
    /** Get Table driver */
    getTable,
    /** Get Grid driver */
    getGrid,
    isShowingGrid: () => base.$(`[data-hook="toolbar-collection-content"]`).exists(),
    isShowingTable: async () => !(await base.$(`[data-hook="toolbar-collection-content"]`).exists()),
    /**
     * Gets collection summary bar
     */
    getSummaryBar
  };
}
var _default = exports.default = TableGridSwitchUniDriver;
//# sourceMappingURL=TableGridSwitch.uni.driver.js.map