index.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
  2. import { S as SortDirection } from '../../sort-direction.d-CF7VUsH-.js';
  3. interface SortHarnessFilters extends BaseHarnessFilters {
  4. }
  5. interface SortHeaderHarnessFilters extends BaseHarnessFilters {
  6. label?: string | RegExp;
  7. sortDirection?: SortDirection;
  8. }
  9. /** Harness for interacting with a standard Angular Material sort header in tests. */
  10. declare class MatSortHeaderHarness extends ComponentHarness {
  11. static hostSelector: string;
  12. private _container;
  13. /**
  14. * Gets a `HarnessPredicate` that can be used to
  15. * search for a sort header with specific attributes.
  16. */
  17. static with(options?: SortHeaderHarnessFilters): HarnessPredicate<MatSortHeaderHarness>;
  18. /** Gets the label of the sort header. */
  19. getLabel(): Promise<string>;
  20. /** Gets the sorting direction of the header. */
  21. getSortDirection(): Promise<SortDirection>;
  22. /** Gets whether the sort header is currently being sorted by. */
  23. isActive(): Promise<boolean>;
  24. /** Whether the sort header is disabled. */
  25. isDisabled(): Promise<boolean>;
  26. /** Clicks the header to change its sorting direction. Only works if the header is enabled. */
  27. click(): Promise<void>;
  28. }
  29. /** Harness for interacting with a standard `mat-sort` in tests. */
  30. declare class MatSortHarness extends ComponentHarness {
  31. static hostSelector: string;
  32. /**
  33. * Gets a `HarnessPredicate` that can be used to search for a `mat-sort` with specific attributes.
  34. * @param options Options for narrowing the search.
  35. * @return a `HarnessPredicate` configured with the given options.
  36. */
  37. static with(options?: SortHarnessFilters): HarnessPredicate<MatSortHarness>;
  38. /** Gets all of the sort headers in the `mat-sort`. */
  39. getSortHeaders(filter?: SortHeaderHarnessFilters): Promise<MatSortHeaderHarness[]>;
  40. /** Gets the selected header in the `mat-sort`. */
  41. getActiveHeader(): Promise<MatSortHeaderHarness | null>;
  42. }
  43. export { MatSortHarness, MatSortHeaderHarness };
  44. export type { SortHarnessFilters, SortHeaderHarnessFilters };