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 { Platform } from '@angular/cdk/platform';
|
---|
9 | /**
|
---|
10 | * Configuration for the isFocusable method.
|
---|
11 | */
|
---|
12 | export declare class IsFocusableConfig {
|
---|
13 | /**
|
---|
14 | * Whether to count an element as focusable even if it is not currently visible.
|
---|
15 | */
|
---|
16 | ignoreVisibility: boolean;
|
---|
17 | }
|
---|
18 | /**
|
---|
19 | * Utility for checking the interactivity of an element, such as whether is is focusable or
|
---|
20 | * tabbable.
|
---|
21 | */
|
---|
22 | export declare class InteractivityChecker {
|
---|
23 | private _platform;
|
---|
24 | constructor(_platform: Platform);
|
---|
25 | /**
|
---|
26 | * Gets whether an element is disabled.
|
---|
27 | *
|
---|
28 | * @param element Element to be checked.
|
---|
29 | * @returns Whether the element is disabled.
|
---|
30 | */
|
---|
31 | isDisabled(element: HTMLElement): boolean;
|
---|
32 | /**
|
---|
33 | * Gets whether an element is visible for the purposes of interactivity.
|
---|
34 | *
|
---|
35 | * This will capture states like `display: none` and `visibility: hidden`, but not things like
|
---|
36 | * being clipped by an `overflow: hidden` parent or being outside the viewport.
|
---|
37 | *
|
---|
38 | * @returns Whether the element is visible.
|
---|
39 | */
|
---|
40 | isVisible(element: HTMLElement): boolean;
|
---|
41 | /**
|
---|
42 | * Gets whether an element can be reached via Tab key.
|
---|
43 | * Assumes that the element has already been checked with isFocusable.
|
---|
44 | *
|
---|
45 | * @param element Element to be checked.
|
---|
46 | * @returns Whether the element is tabbable.
|
---|
47 | */
|
---|
48 | isTabbable(element: HTMLElement): boolean;
|
---|
49 | /**
|
---|
50 | * Gets whether an element can be focused by the user.
|
---|
51 | *
|
---|
52 | * @param element Element to be checked.
|
---|
53 | * @param config The config object with options to customize this method's behavior
|
---|
54 | * @returns Whether the element is focusable.
|
---|
55 | */
|
---|
56 | isFocusable(element: HTMLElement, config?: IsFocusableConfig): boolean;
|
---|
57 | }
|
---|