1 | // Generated by dts-bundle v0.7.3
|
2 |
|
3 | declare module '@material/dom' {
|
4 | /**
|
5 | * @license
|
6 | * Copyright 2018 Google Inc.
|
7 | *
|
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
9 | * of this software and associated documentation files (the "Software"), to deal
|
10 | * in the Software without restriction, including without limitation the rights
|
11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12 | * copies of the Software, and to permit persons to whom the Software is
|
13 | * furnished to do so, subject to the following conditions:
|
14 | *
|
15 | * The above copyright notice and this permission notice shall be included in
|
16 | * all copies or substantial portions of the Software.
|
17 | *
|
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24 | * THE SOFTWARE.
|
25 | */
|
26 | import * as events from '@material/dom/events';
|
27 | import * as focusTrap from '@material/dom/focus-trap';
|
28 | import * as keyboard from '@material/dom/keyboard';
|
29 | import * as ponyfill from '@material/dom/ponyfill';
|
30 | export { events, focusTrap, keyboard, ponyfill };
|
31 | }
|
32 |
|
33 | declare module '@material/dom/events' {
|
34 | /**
|
35 | * Determine whether the current browser supports passive event listeners, and
|
36 | * if so, use them.
|
37 | */
|
38 | export function applyPassive(globalObj?: Window): boolean | EventListenerOptions;
|
39 | }
|
40 |
|
41 | declare module '@material/dom/focus-trap' {
|
42 | /**
|
43 | * Utility to trap focus in a given root element, e.g. for modal components such
|
44 | * as dialogs. The root should have at least one focusable child element,
|
45 | * for setting initial focus when trapping focus.
|
46 | * Also tracks the previously focused element, and restores focus to that
|
47 | * element when releasing focus.
|
48 | */
|
49 | export class FocusTrap {
|
50 | constructor(root: HTMLElement, options?: FocusOptions);
|
51 | /**
|
52 | * Traps focus in `root`. Also focuses on either `initialFocusEl` if set;
|
53 | * otherwises sets initial focus to the first focusable child element.
|
54 | */
|
55 | trapFocus(): void;
|
56 | /**
|
57 | * Releases focus from `root`. Also restores focus to the previously focused
|
58 | * element.
|
59 | */
|
60 | releaseFocus(): void;
|
61 | }
|
62 | /** Customization options. */
|
63 | export interface FocusOptions {
|
64 | initialFocusEl?: HTMLElement;
|
65 | skipInitialFocus?: boolean;
|
66 | skipRestoreFocus?: boolean;
|
67 | }
|
68 | }
|
69 |
|
70 | declare module '@material/dom/keyboard' {
|
71 | /**
|
72 | * KEY provides normalized string values for keys.
|
73 | */
|
74 | export const KEY: {
|
75 | UNKNOWN: string;
|
76 | BACKSPACE: string;
|
77 | ENTER: string;
|
78 | SPACEBAR: string;
|
79 | PAGE_UP: string;
|
80 | PAGE_DOWN: string;
|
81 | END: string;
|
82 | HOME: string;
|
83 | ARROW_LEFT: string;
|
84 | ARROW_UP: string;
|
85 | ARROW_RIGHT: string;
|
86 | ARROW_DOWN: string;
|
87 | DELETE: string;
|
88 | ESCAPE: string;
|
89 | TAB: string;
|
90 | };
|
91 | /**
|
92 | * normalizeKey returns the normalized string for a navigational action.
|
93 | */
|
94 | export function normalizeKey(evt: KeyboardEvent): string;
|
95 | /**
|
96 | * isNavigationEvent returns whether the event is a navigation event
|
97 | */
|
98 | export function isNavigationEvent(evt: KeyboardEvent): boolean;
|
99 | }
|
100 |
|
101 | declare module '@material/dom/ponyfill' {
|
102 | /**
|
103 | * @fileoverview A "ponyfill" is a polyfill that doesn't modify the global prototype chain.
|
104 | * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.
|
105 | */
|
106 | export function closest(element: Element, selector: string): Element | null;
|
107 | export function matches(element: Element, selector: string): boolean;
|
108 | /**
|
109 | * Used to compute the estimated scroll width of elements. When an element is
|
110 | * hidden due to display: none; being applied to a parent element, the width is
|
111 | * returned as 0. However, the element will have a true width once no longer
|
112 | * inside a display: none context. This method computes an estimated width when
|
113 | * the element is hidden or returns the true width when the element is visble.
|
114 | * @param {Element} element the element whose width to estimate
|
115 | */
|
116 | export function estimateScrollWidth(element: Element): number;
|
117 | }
|
118 |
|