-
Notifications
You must be signed in to change notification settings - Fork 24.8k
/
accessibility.ts
46 lines (43 loc) 路 1.52 KB
/
accessibility.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
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* An event-type set when the event contract detects a KEYDOWN event but
* doesn't know if the key press can be treated like a click. The dispatcher
* will use this event-type to parse the keypress and handle it accordingly.
*/
export const MAYBE_CLICK_EVENT_TYPE = 'maybe_click';
/**
* A property added to a dispatched event that had the MAYBE_CLICK_EVENTTYPE
* event-type but could not be used as a click. The dispatcher sets this
* property for non-global dispatches before it retriggers the event and it
* signifies that the event contract should not dispatch this event globally.
*/
export const SKIP_GLOBAL_DISPATCH = 'a11ysgd';
/**
* A property added to a dispatched event that had the MAYBE_CLICK_EVENTTYPE
* event-type but could not be used as a click. The dispatcher sets this
* property before it retriggers the event and it signifies that the event
* contract should not look at CLICK actions for KEYDOWN events.
*/
export const SKIP_A11Y_CHECK = 'a11ysc';
/**
* Defines special EventInfo and Event properties used when
* A11Y_SUPPORT_IN_DISPATCHER is enabled.
*/
export const Attribute = {
MAYBE_CLICK_EVENT_TYPE,
SKIP_GLOBAL_DISPATCH,
SKIP_A11Y_CHECK,
};
declare global {
interface Event {
[MAYBE_CLICK_EVENT_TYPE]?: boolean;
[SKIP_GLOBAL_DISPATCH]?: boolean;
[SKIP_A11Y_CHECK]?: boolean;
}
}