index.d.ts 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
  2. import { b as MatButtonToggleAppearance } from '../../button-toggle.d-DoMJU5F_.js';
  3. import '@angular/cdk/bidi';
  4. import '@angular/core';
  5. import '@angular/forms';
  6. /** Criteria that can be used to filter a list of `MatButtonToggleHarness` instances. */
  7. interface ButtonToggleHarnessFilters extends BaseHarnessFilters {
  8. /** Only find instances whose text matches the given value. */
  9. text?: string | RegExp;
  10. /** Only find instances whose name matches the given value. */
  11. name?: string | RegExp;
  12. /** Only find instances that are checked. */
  13. checked?: boolean;
  14. /** Only find instances which match the given disabled state. */
  15. disabled?: boolean;
  16. }
  17. /** Harness for interacting with a standard mat-button-toggle in tests. */
  18. declare class MatButtonToggleHarness extends ComponentHarness {
  19. /** The selector for the host element of a `MatButton` instance. */
  20. static hostSelector: string;
  21. private _label;
  22. private _button;
  23. /**
  24. * Gets a `HarnessPredicate` that can be used to search for a `MatButtonToggleHarness` that meets
  25. * certain criteria.
  26. * @param options Options for filtering which button toggle instances are considered a match.
  27. * @return a `HarnessPredicate` configured with the given options.
  28. */
  29. static with(options?: ButtonToggleHarnessFilters): HarnessPredicate<MatButtonToggleHarness>;
  30. /** Gets a boolean promise indicating if the button toggle is checked. */
  31. isChecked(): Promise<boolean>;
  32. /** Gets a boolean promise indicating if the button toggle is disabled. */
  33. isDisabled(): Promise<boolean>;
  34. /** Gets a promise for the button toggle's name. */
  35. getName(): Promise<string | null>;
  36. /** Gets a promise for the button toggle's aria-label. */
  37. getAriaLabel(): Promise<string | null>;
  38. /** Gets a promise for the button toggles's aria-labelledby. */
  39. getAriaLabelledby(): Promise<string | null>;
  40. /** Gets a promise for the button toggle's text. */
  41. getText(): Promise<string>;
  42. /** Gets the appearance that the button toggle is using. */
  43. getAppearance(): Promise<MatButtonToggleAppearance>;
  44. /** Focuses the toggle. */
  45. focus(): Promise<void>;
  46. /** Blurs the toggle. */
  47. blur(): Promise<void>;
  48. /** Whether the toggle is focused. */
  49. isFocused(): Promise<boolean>;
  50. /** Toggle the checked state of the buttons toggle. */
  51. toggle(): Promise<void>;
  52. /**
  53. * Puts the button toggle in a checked state by toggling it if it's
  54. * currently unchecked, or doing nothing if it is already checked.
  55. */
  56. check(): Promise<void>;
  57. /**
  58. * Puts the button toggle in an unchecked state by toggling it if it's
  59. * currently checked, or doing nothing if it's already unchecked.
  60. */
  61. uncheck(): Promise<void>;
  62. }
  63. /** Criteria that can be used to filter a list of `MatButtonToggleGroupHarness` instances. */
  64. interface ButtonToggleGroupHarnessFilters extends BaseHarnessFilters {
  65. /** Only find instances which match the given disabled state. */
  66. disabled?: boolean;
  67. }
  68. /** Harness for interacting with a standard mat-button-toggle in tests. */
  69. declare class MatButtonToggleGroupHarness extends ComponentHarness {
  70. /** The selector for the host element of a `MatButton` instance. */
  71. static hostSelector: string;
  72. /**
  73. * Gets a `HarnessPredicate` that can be used to search for a `MatButtonToggleGroupHarness`
  74. * that meets certain criteria.
  75. * @param options Options for filtering which button toggle instances are considered a match.
  76. * @return a `HarnessPredicate` configured with the given options.
  77. */
  78. static with(options?: ButtonToggleGroupHarnessFilters): HarnessPredicate<MatButtonToggleGroupHarness>;
  79. /**
  80. * Gets the button toggles that are inside the group.
  81. * @param filter Optionally filters which toggles are included.
  82. */
  83. getToggles(filter?: ButtonToggleHarnessFilters): Promise<MatButtonToggleHarness[]>;
  84. /** Gets whether the button toggle group is disabled. */
  85. isDisabled(): Promise<boolean>;
  86. /** Gets whether the button toggle group is laid out vertically. */
  87. isVertical(): Promise<boolean>;
  88. /** Gets the appearance that the group is using. */
  89. getAppearance(): Promise<MatButtonToggleAppearance>;
  90. }
  91. export { MatButtonToggleGroupHarness, MatButtonToggleHarness };
  92. export type { ButtonToggleGroupHarnessFilters, ButtonToggleHarnessFilters };