index.d.ts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import * as _angular_cdk_testing from '@angular/cdk/testing';
  2. import { BaseHarnessFilters, ComponentHarness, ComponentHarnessConstructor, HarnessPredicate } from '@angular/cdk/testing';
  3. import { MatSelectHarness } from '../../select/testing/index.js';
  4. import '../../option-harness.d-IqsW95GR.js';
  5. import '../../core/testing/index.js';
  6. import '../../form-field/testing/control/index.js';
  7. /** A set of criteria that can be used to filter a list of `MatPaginatorHarness` instances. */
  8. interface PaginatorHarnessFilters extends BaseHarnessFilters {
  9. }
  10. /** Harness for interacting with a mat-paginator in tests. */
  11. declare class MatPaginatorHarness extends ComponentHarness {
  12. /** Selector used to find paginator instances. */
  13. static hostSelector: string;
  14. private _nextButton;
  15. private _previousButton;
  16. private _firstPageButton;
  17. private _lastPageButton;
  18. _select: () => Promise<MatSelectHarness | null>;
  19. private _pageSizeFallback;
  20. _rangeLabel: () => Promise<_angular_cdk_testing.TestElement>;
  21. /**
  22. * Gets a `HarnessPredicate` that can be used to search for a paginator with specific attributes.
  23. * @param options Options for filtering which paginator instances are considered a match.
  24. * @return a `HarnessPredicate` configured with the given options.
  25. */
  26. static with<T extends MatPaginatorHarness>(this: ComponentHarnessConstructor<T>, options?: PaginatorHarnessFilters): HarnessPredicate<T>;
  27. /** Goes to the next page in the paginator. */
  28. goToNextPage(): Promise<void>;
  29. /** Returns whether or not the next page button is disabled. */
  30. isNextPageDisabled(): Promise<boolean>;
  31. isPreviousPageDisabled(): Promise<boolean>;
  32. /** Goes to the previous page in the paginator. */
  33. goToPreviousPage(): Promise<void>;
  34. /** Goes to the first page in the paginator. */
  35. goToFirstPage(): Promise<void>;
  36. /** Goes to the last page in the paginator. */
  37. goToLastPage(): Promise<void>;
  38. /**
  39. * Sets the page size of the paginator.
  40. * @param size Page size that should be select.
  41. */
  42. setPageSize(size: number): Promise<void>;
  43. /** Gets the page size of the paginator. */
  44. getPageSize(): Promise<number>;
  45. /** Gets the text of the range label of the paginator. */
  46. getRangeLabel(): Promise<string>;
  47. }
  48. export { MatPaginatorHarness };
  49. export type { PaginatorHarnessFilters };