1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
---|
9 | import { SliderHarnessFilters } from './slider-harness-filters';
|
---|
10 | /** Harness for interacting with a standard mat-slider in tests. */
|
---|
11 | export declare class MatSliderHarness extends ComponentHarness {
|
---|
12 | /** The selector for the host element of a `MatSlider` instance. */
|
---|
13 | static hostSelector: string;
|
---|
14 | /**
|
---|
15 | * Gets a `HarnessPredicate` that can be used to search for a `MatSliderHarness` that meets
|
---|
16 | * certain criteria.
|
---|
17 | * @param options Options for filtering which slider instances are considered a match.
|
---|
18 | * @return a `HarnessPredicate` configured with the given options.
|
---|
19 | */
|
---|
20 | static with(options?: SliderHarnessFilters): HarnessPredicate<MatSliderHarness>;
|
---|
21 | private _textLabel;
|
---|
22 | private _wrapper;
|
---|
23 | /** Gets the slider's id. */
|
---|
24 | getId(): Promise<string | null>;
|
---|
25 | /**
|
---|
26 | * Gets the current display value of the slider. Returns a null promise if the thumb label is
|
---|
27 | * disabled.
|
---|
28 | */
|
---|
29 | getDisplayValue(): Promise<string | null>;
|
---|
30 | /** Gets the current percentage value of the slider. */
|
---|
31 | getPercentage(): Promise<number>;
|
---|
32 | /** Gets the current value of the slider. */
|
---|
33 | getValue(): Promise<number>;
|
---|
34 | /** Gets the maximum value of the slider. */
|
---|
35 | getMaxValue(): Promise<number>;
|
---|
36 | /** Gets the minimum value of the slider. */
|
---|
37 | getMinValue(): Promise<number>;
|
---|
38 | /** Whether the slider is disabled. */
|
---|
39 | isDisabled(): Promise<boolean>;
|
---|
40 | /** Gets the orientation of the slider. */
|
---|
41 | getOrientation(): Promise<'horizontal' | 'vertical'>;
|
---|
42 | /**
|
---|
43 | * Sets the value of the slider by clicking on the slider track.
|
---|
44 | *
|
---|
45 | * Note that in rare cases the value cannot be set to the exact specified value. This
|
---|
46 | * can happen if not every value of the slider maps to a single pixel that could be
|
---|
47 | * clicked using mouse interaction. In such cases consider using the keyboard to
|
---|
48 | * select the given value or expand the slider's size for a better user experience.
|
---|
49 | */
|
---|
50 | setValue(value: number): Promise<void>;
|
---|
51 | /** Focuses the slider. */
|
---|
52 | focus(): Promise<void>;
|
---|
53 | /** Blurs the slider. */
|
---|
54 | blur(): Promise<void>;
|
---|
55 | /** Whether the slider is focused. */
|
---|
56 | isFocused(): Promise<boolean>;
|
---|
57 | /** Calculates the percentage of the given value. */
|
---|
58 | private _calculatePercentage;
|
---|
59 | }
|
---|