import { baseUniDriverFactory } from '../../unidriver';
import { CollectionToolbarUniDriver } from '../CollectionToolbar/CollectionToolbar.uni.driver';
import TableFoldersUniDriver from '../TableFolders/TableFolders.uni.driver';
import GridFoldersUniDriver from '../Grid/GridFolders.uni.driver';
import { SummaryBarUniDriver } from '../SummaryBar/SummaryBar.uni.driver';
export function TableGridSwitchFoldersUniDriver(base, body) {
    const getToolbar = () => CollectionToolbarUniDriver(base.$('[data-hook="collection-toolbar"]'), body);
    const getTable = () => TableFoldersUniDriver(base, body);
    const getGrid = () => GridFoldersUniDriver(base, body);
    const getSummaryBar = () => SummaryBarUniDriver(base, body);
    return {
        ...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 [TableFoldersUniDriver](./?path=/story/base-components-collections-tablefolders-tablefolders--tablefolders) driver */
        getTable,
        /** Get [GridFoldersUniDriver](./?path=/story/base-components-collections-gridfolders-gridfolders--gridfolders) driver */
        getGrid,
        /** Indicates grid is currently shown */
        isShowingGrid: () => base.$(`[data-hook="toolbar-collection-content"]`).exists(),
        /** Indicates table is currently shown */
        isShowingTable: async () => !(await base.$(`[data-hook="toolbar-collection-content"]`).exists()),
        /**
         * Gets collection summary bar
         */
        getSummaryBar,
        // Casting to 'any' to avoid overly complex inferred type error (TS7056).
        // The return type is too large for TypeScript to serialize, so we simplify it here.
        // This cast does not affect runtime behavior.
    };
}
export default TableGridSwitchFoldersUniDriver;
//# sourceMappingURL=TableGridSwitchFolders.uni.driver.js.map