This repository has been archived by the owner on Dec 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathutil.d.ts
128 lines (122 loc) · 4.74 KB
/
util.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
declare module "@qualweb/util" {
import { QWElement } from "@qualweb/qw-element";
interface AriaAttributesRoles {
[attribute: string]: {
global: string;
typeValue: string;
values: string | Array<string>;
defaultValue: string;
};
}
interface Roles {
[role: string]: {
baseConcept: string | Array<string>;
attribute: string | Array<string>;
requiredContextRole: string | Array<string>;
requiredAria?: string | Array<string>;
requiredRoles?: string | Array<string>;
supportedAria?: string | Array<string>;
supportedRoles?: string | Array<string>;
implicitValueRoles: Array<Array<string>>;
requiredOwnedElements: any;
prohibitedAria?: string | Array<string>;
};
}
interface Languages {
[lang: string]: number;
}
class DomUtils {
public static elementIdIsReferenced(
element: QWElement,
id: string,
attribute: string
): boolean;
public static getElementReferencedByHREF(
element: QWElement
): QWElement | null;
public static getVideoMetadata(element: QWElement): any;
public static isHumanLanguage(text: string): boolean;
public static getTextSize(
font: string,
fontSize: number,
bold: boolean,
italic: boolean,
text: string
): number;
public static isElementADescendantOf(
element: QWElement,
names: Array<string>,
roles: Array<string>
): boolean;
public static isElementADescendantOfExplicitRole(
element: QWElement,
names: Array<string>,
roles: Array<string>
): boolean;
public static isElementHidden(element: QWElement): boolean;
public static isElementHiddenByCSS(element: QWElement): boolean;
public static isElementHiddenByCSSAux(element: QWElement): boolean;
public static isElementVisible(element: QWElement): boolean;
public static videoElementHasAudio(element: QWElement): boolean;
public static elementHasContent(
element: QWElement,
checkChildren: boolean
): boolean;
public static getTrimmedText(element: QWElement): string;
public static objectElementIsNonText(element: QWElement): boolean;
}
class AccessibilityUtils {
public static ariaAttributesRoles: AriaAttributesRoles;
public static roles: Roles;
public static languages: Languages;
public static isElementChildPresentationalAux(element: QWElement): boolean;
public static isElementChildPresentational(element: QWElement): boolean;
public static isFocusableBrowser(element: QWElement): boolean;
public static isElementFocusable(element: QWElement): boolean;
public static isElementFocusableByDefault(element: QWElement): boolean;
public static elementHasGlobalARIAPropertyOrAttribute(
element: QWElement
): boolean;
public static getAccessibleNameRecursion(
element: QWElement,
recursion: boolean,
isWidget: boolean
): string | undefined;
public static getLinkContext(element: QWElement): Array<string>;
public static allowsNameFromContent(element: QWElement): boolean;
public static elementHasValidRole(element: QWElement): boolean;
public static getElementValidExplicitRole(
element: QWElement
): string | null;
public static getAccessibleName(element: QWElement): string | undefined;
public static getAccessibleNameSelector(
element: QWElement
): Array<string> | undefined;
public static getAccessibleNameSVG(element: QWElement): string | undefined;
public static getDefaultName(element: QWElement): string;
public static getDisabledWidgets(): Array<QWElement>;
public static getElementRole(element: QWElement): string | null;
public static getElementRoleAName(
element: QWElement,
aName: string | undefined
): string | null;
public static getValueFromEmbeddedControl(element: QWElement): string;
public static isDataTable(element: QWElement): boolean;
public static isElementControl(element: QWElement): boolean;
public static isElementInAT(element: QWElement): boolean;
public static isElementReferencedByAriaLabel(element: QWElement): boolean;
public static isElementWidget(element: QWElement): boolean;
public static getImplicitRole(
element: QWElement,
accessibleName: string | undefined
): string | null;
public static getOwnerElement(element: QWElement): QWElement | null;
public static isPartOfSequentialFocusNavigation(
element: QWElement
): boolean;
public static getAriaOwner(element: QWElement): QWElement | null;
public static getOwnedElements(element: QWElement): Array<QWElement>;
public static landmarkIsTopLevel(element: QWElement): boolean;
}
export { AriaAttributesRoles, Roles, DomUtils, AccessibilityUtils };
}