import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing'; import { MatFormFieldControlHarness } from './form-field/testing/control/index.js'; /** A set of criteria that can be used to filter a list of datepicker input instances. */ interface DatepickerInputHarnessFilters extends BaseHarnessFilters { /** Filters based on the value of the input. */ value?: string | RegExp; /** Filters based on the placeholder text of the input. */ placeholder?: string | RegExp; } /** A set of criteria that can be used to filter a list of datepicker toggle instances. */ interface DatepickerToggleHarnessFilters extends BaseHarnessFilters { } /** A set of criteria that can be used to filter a list of calendar instances. */ interface CalendarHarnessFilters extends BaseHarnessFilters { } /** A set of criteria that can be used to filter a list of calendar cell instances. */ interface CalendarCellHarnessFilters extends BaseHarnessFilters { /** Filters based on the text of the cell. */ text?: string | RegExp; /** Filters based on whether the cell is selected. */ selected?: boolean; /** Filters based on whether the cell is activated using keyboard navigation */ active?: boolean; /** Filters based on whether the cell is disabled. */ disabled?: boolean; /** Filters based on whether the cell represents today's date. */ today?: boolean; /** Filters based on whether the cell is inside of the main range. */ inRange?: boolean; /** Filters based on whether the cell is inside of the comparison range. */ inComparisonRange?: boolean; /** Filters based on whether the cell is inside of the preview range. */ inPreviewRange?: boolean; } /** A set of criteria that can be used to filter a list of date range input instances. */ interface DateRangeInputHarnessFilters extends BaseHarnessFilters { /** Filters based on the value of the input. */ value?: string | RegExp; } /** Base class for datepicker input harnesses. */ declare abstract class MatDatepickerInputHarnessBase extends MatFormFieldControlHarness { /** Whether the input is disabled. */ isDisabled(): Promise; /** Whether the input is required. */ isRequired(): Promise; /** Gets the value of the input. */ getValue(): Promise; /** * Sets the value of the input. The value will be set by simulating * keypresses that correspond to the given value. */ setValue(newValue: string): Promise; /** Gets the placeholder of the input. */ getPlaceholder(): Promise; /** * Focuses the input and returns a promise that indicates when the * action is complete. */ focus(): Promise; /** * Blurs the input and returns a promise that indicates when the * action is complete. */ blur(): Promise; /** Whether the input is focused. */ isFocused(): Promise; /** Gets the formatted minimum date for the input's value. */ getMin(): Promise; /** Gets the formatted maximum date for the input's value. */ getMax(): Promise; } /** Harness for interacting with a standard Material calendar cell in tests. */ declare class MatCalendarCellHarness extends ComponentHarness { static hostSelector: string; /** Reference to the inner content element inside the cell. */ private _content; /** * Gets a `HarnessPredicate` that can be used to search for a `MatCalendarCellHarness` * that meets certain criteria. * @param options Options for filtering which cell instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options?: CalendarCellHarnessFilters): HarnessPredicate; /** Gets the text of the calendar cell. */ getText(): Promise; /** Gets the aria-label of the calendar cell. */ getAriaLabel(): Promise; /** Whether the cell is selected. */ isSelected(): Promise; /** Whether the cell is disabled. */ isDisabled(): Promise; /** Whether the cell is currently activated using keyboard navigation. */ isActive(): Promise; /** Whether the cell represents today's date. */ isToday(): Promise; /** Selects the calendar cell. Won't do anything if the cell is disabled. */ select(): Promise; /** Hovers over the calendar cell. */ hover(): Promise; /** Moves the mouse away from the calendar cell. */ mouseAway(): Promise; /** Focuses the calendar cell. */ focus(): Promise; /** Removes focus from the calendar cell. */ blur(): Promise; /** Whether the cell is the start of the main range. */ isRangeStart(): Promise; /** Whether the cell is the end of the main range. */ isRangeEnd(): Promise; /** Whether the cell is part of the main range. */ isInRange(): Promise; /** Whether the cell is the start of the comparison range. */ isComparisonRangeStart(): Promise; /** Whether the cell is the end of the comparison range. */ isComparisonRangeEnd(): Promise; /** Whether the cell is inside of the comparison range. */ isInComparisonRange(): Promise; /** Whether the cell is the start of the preview range. */ isPreviewRangeStart(): Promise; /** Whether the cell is the end of the preview range. */ isPreviewRangeEnd(): Promise; /** Whether the cell is inside of the preview range. */ isInPreviewRange(): Promise; /** Returns whether the cell has a particular CSS class-based state. */ private _hasState; } /** Possible views of a `MatCalendarHarness`. */ declare enum CalendarView { MONTH = 0, YEAR = 1, MULTI_YEAR = 2 } /** Harness for interacting with a standard Material calendar in tests. */ declare class MatCalendarHarness extends ComponentHarness { static hostSelector: string; /** Queries for the calendar's period toggle button. */ private _periodButton; /** * Gets a `HarnessPredicate` that can be used to search for a `MatCalendarHarness` * that meets certain criteria. * @param options Options for filtering which calendar instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options?: CalendarHarnessFilters): HarnessPredicate; /** * Gets a list of cells inside the calendar. * @param filter Optionally filters which cells are included. */ getCells(filter?: CalendarCellHarnessFilters): Promise; /** Gets the current view that is being shown inside the calendar. */ getCurrentView(): Promise; /** Gets the label of the current calendar view. */ getCurrentViewLabel(): Promise; /** Changes the calendar view by clicking on the view toggle button. */ changeView(): Promise; /** Goes to the next page of the current view (e.g. next month when inside the month view). */ next(): Promise; /** * Goes to the previous page of the current view * (e.g. previous month when inside the month view). */ previous(): Promise; /** * Selects a cell in the current calendar view. * @param filter An optional filter to apply to the cells. The first cell matching the filter * will be selected. */ selectCell(filter?: CalendarCellHarnessFilters): Promise; } /** Interface for a test harness that can open and close a calendar. */ interface DatepickerTrigger { isCalendarOpen(): Promise; openCalendar(): Promise; closeCalendar(): Promise; hasCalendar(): Promise; getCalendar(filter?: CalendarHarnessFilters): Promise; } /** Base class for harnesses that can trigger a calendar. */ declare abstract class DatepickerTriggerHarnessBase extends ComponentHarness implements DatepickerTrigger { /** Whether the trigger is disabled. */ abstract isDisabled(): Promise; /** Whether the calendar associated with the trigger is open. */ abstract isCalendarOpen(): Promise; /** Opens the calendar associated with the trigger. */ protected abstract _openCalendar(): Promise; /** Opens the calendar if the trigger is enabled and it has a calendar. */ openCalendar(): Promise; /** Closes the calendar if it is open. */ closeCalendar(): Promise; /** Gets whether there is a calendar associated with the trigger. */ hasCalendar(): Promise; /** * Gets the `MatCalendarHarness` that is associated with the trigger. * @param filter Optionally filters which calendar is included. */ getCalendar(filter?: CalendarHarnessFilters): Promise; } /** Harness for interacting with a standard Material datepicker inputs in tests. */ declare class MatDatepickerInputHarness extends MatDatepickerInputHarnessBase implements DatepickerTrigger { static hostSelector: string; /** * Gets a `HarnessPredicate` that can be used to search for a `MatDatepickerInputHarness` * that meets certain criteria. * @param options Options for filtering which input instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options?: DatepickerInputHarnessFilters): HarnessPredicate; /** Gets whether the calendar associated with the input is open. */ isCalendarOpen(): Promise; /** Opens the calendar associated with the input. */ openCalendar(): Promise; /** Closes the calendar associated with the input. */ closeCalendar(): Promise; /** Whether a calendar is associated with the input. */ hasCalendar(): Promise; /** * Gets the `MatCalendarHarness` that is associated with the trigger. * @param filter Optionally filters which calendar is included. */ getCalendar(filter?: CalendarHarnessFilters): Promise; } /** Harness for interacting with a standard Material date range start input in tests. */ declare class MatStartDateHarness extends MatDatepickerInputHarnessBase { static hostSelector: string; /** * Gets a `HarnessPredicate` that can be used to search for a `MatStartDateHarness` * that meets certain criteria. * @param options Options for filtering which input instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options?: DatepickerInputHarnessFilters): HarnessPredicate; } /** Harness for interacting with a standard Material date range end input in tests. */ declare class MatEndDateHarness extends MatDatepickerInputHarnessBase { static hostSelector: string; /** * Gets a `HarnessPredicate` that can be used to search for a `MatEndDateHarness` * that meets certain criteria. * @param options Options for filtering which input instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options?: DatepickerInputHarnessFilters): HarnessPredicate; } /** Harness for interacting with a standard Material date range input in tests. */ declare class MatDateRangeInputHarness extends DatepickerTriggerHarnessBase { static hostSelector: string; /** * Gets a `HarnessPredicate` that can be used to search for a `MatDateRangeInputHarness` * that meets certain criteria. * @param options Options for filtering which input instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options?: DateRangeInputHarnessFilters): HarnessPredicate; /** Gets the combined value of the start and end inputs, including the separator. */ getValue(): Promise; /** Gets the inner start date input inside the range input. */ getStartInput(): Promise; /** Gets the inner start date input inside the range input. */ getEndInput(): Promise; /** Gets the separator text between the values of the two inputs. */ getSeparator(): Promise; /** Gets whether the range input is disabled. */ isDisabled(): Promise; /** Gets whether the range input is required. */ isRequired(): Promise; /** Opens the calendar associated with the input. */ isCalendarOpen(): Promise; protected _openCalendar(): Promise; } export { DatepickerTriggerHarnessBase as D, MatDatepickerInputHarness as M, MatStartDateHarness as e, MatEndDateHarness as f, MatDateRangeInputHarness as g, CalendarView as h, MatCalendarHarness as i, MatCalendarCellHarness as j }; export type { CalendarHarnessFilters as C, DatepickerToggleHarnessFilters as a, DatepickerInputHarnessFilters as b, CalendarCellHarnessFilters as c, DateRangeInputHarnessFilters as d };