wix-style-react
Version:
wix-style-react
47 lines • 2.36 kB
TypeScript
import { Simulate } from 'react-dom/test-utils';
export type NavButtonName = 'first' | 'previous' | 'next' | 'last';
export declare const paginationCoreDriverFactory: ({ element, eventTrigger, }: {
element: Element | undefined;
eventTrigger: typeof Simulate;
}) => {
/** Returns the root element*/
root: Element | undefined;
/** Returns whether the element exists */
exists: () => boolean;
/** Simulates events */
simulate: typeof Simulate;
/** Returns the container of page elements */
getPageStrip: () => Element | null | undefined;
/** Returns displayed page elements */
getPages: () => Element[];
/** Returns the text content of the displayed pages in "pages" mode */
getPageLabels: () => string[];
/** Returns the page element given its index in the page strip */
getPageByIndex: (idx?: number) => Element | null;
/** Returns the page element given page number */
getPageByNumber: (n: number) => Element | null | undefined;
/** Returns the page element currently selected */
getCurrentPage: () => Element | null | undefined;
/** Returns the element for the navigation button - acceptable values are 'first', 'last', 'previous' or 'next' */
getNavButton: (name: NavButtonName) => Element | null | undefined;
/** Returns the page input element in "input" mode */
getPageInput: HTMLInputElement;
/** Returns the total amount of pages displayed in "input" mode */
getTotalPagesField: () => Element | null | undefined;
/** Simulates clicking a nav button */
clickNavButton: (name: NavButtonName) => void;
/** Simulates clicking a page in "pages" mode */
clickPage: (page: number) => void;
click: () => void | undefined;
/** Simulates changing the value of the input field in "input" mode */
changeInput: (newValue: string) => void;
/** Simulates committing the input field value in "input" mode */
commitInput: () => void;
/** Simulates blur in the input field in "input" mode */
blurInput: () => void;
getElement: (dataHook: string) => Element | null | undefined;
getPage: (pageNumber: number) => Element | null | undefined;
focusInput: () => void;
getElementAttribute: (dataHook: string, attributeName: string) => string | null | undefined;
};
//# sourceMappingURL=PaginationCore.driver.d.ts.map