UNPKG

15.6 kBTypeScriptView Raw
1// Generated by dts-bundle v0.7.3
2// Dependencies for this module:
3// ../../@material/base/types
4// ../../@material/base/component
5// ../../@material/base/foundation
6
7declare module '@material/ripple' {
8 /**
9 * @license
10 * Copyright 2019 Google Inc.
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a copy
13 * of this software and associated documentation files (the "Software"), to deal
14 * in the Software without restriction, including without limitation the rights
15 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16 * copies of the Software, and to permit persons to whom the Software is
17 * furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included in
20 * all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28 * THE SOFTWARE.
29 */
30 import * as util from '@material/ripple/util';
31 export { util };
32 export * from '@material/ripple/adapter';
33 export * from '@material/ripple/component';
34 export * from '@material/ripple/constants';
35 export * from '@material/ripple/foundation';
36 export * from '@material/ripple/types';
37}
38
39declare module '@material/ripple/util' {
40 /**
41 * @license
42 * Copyright 2016 Google Inc.
43 *
44 * Permission is hereby granted, free of charge, to any person obtaining a copy
45 * of this software and associated documentation files (the "Software"), to deal
46 * in the Software without restriction, including without limitation the rights
47 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48 * copies of the Software, and to permit persons to whom the Software is
49 * furnished to do so, subject to the following conditions:
50 *
51 * The above copyright notice and this permission notice shall be included in
52 * all copies or substantial portions of the Software.
53 *
54 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
60 * THE SOFTWARE.
61 */
62 import { MDCRipplePoint } from '@material/ripple/types';
63 export function supportsCssVariables(windowObj: typeof globalThis, forceRefresh?: boolean): boolean;
64 export function getNormalizedEventCoords(evt: Event | undefined, pageOffset: MDCRipplePoint, clientRect: ClientRect): MDCRipplePoint;
65}
66
67declare module '@material/ripple/adapter' {
68 /**
69 * @license
70 * Copyright 2016 Google Inc.
71 *
72 * Permission is hereby granted, free of charge, to any person obtaining a copy
73 * of this software and associated documentation files (the "Software"), to deal
74 * in the Software without restriction, including without limitation the rights
75 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
76 * copies of the Software, and to permit persons to whom the Software is
77 * furnished to do so, subject to the following conditions:
78 *
79 * The above copyright notice and this permission notice shall be included in
80 * all copies or substantial portions of the Software.
81 *
82 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
83 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
84 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
85 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
86 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
87 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
88 * THE SOFTWARE.
89 */
90 import { EventType, SpecificEventListener } from '@material/base/types';
91 import { MDCRipplePoint } from '@material/ripple/types';
92 /**
93 * Defines the shape of the adapter expected by the foundation.
94 * Implement this adapter for your framework of choice to delegate updates to
95 * the component in your framework of choice. See architecture documentation
96 * for more details.
97 * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
98 */
99 export interface MDCRippleAdapter {
100 browserSupportsCssVars(): boolean;
101 isUnbounded(): boolean;
102 isSurfaceActive(): boolean;
103 isSurfaceDisabled(): boolean;
104 addClass(className: string): void;
105 removeClass(className: string): void;
106 containsEventTarget(target: EventTarget | null): boolean;
107 registerInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
108 deregisterInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
109 registerDocumentInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
110 deregisterDocumentInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
111 registerResizeHandler(handler: SpecificEventListener<'resize'>): void;
112 deregisterResizeHandler(handler: SpecificEventListener<'resize'>): void;
113 updateCssVariable(varName: string, value: string | null): void;
114 computeBoundingRect(): ClientRect;
115 getWindowPageOffset(): MDCRipplePoint;
116 }
117}
118
119declare module '@material/ripple/component' {
120 /**
121 * @license
122 * Copyright 2016 Google Inc.
123 *
124 * Permission is hereby granted, free of charge, to any person obtaining a copy
125 * of this software and associated documentation files (the "Software"), to deal
126 * in the Software without restriction, including without limitation the rights
127 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
128 * copies of the Software, and to permit persons to whom the Software is
129 * furnished to do so, subject to the following conditions:
130 *
131 * The above copyright notice and this permission notice shall be included in
132 * all copies or substantial portions of the Software.
133 *
134 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
135 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
136 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
137 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
138 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
139 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
140 * THE SOFTWARE.
141 */
142 import { MDCComponent } from '@material/base/component';
143 import { MDCRippleAdapter } from '@material/ripple/adapter';
144 import { MDCRippleFoundation } from '@material/ripple/foundation';
145 import { MDCRippleAttachOpts, MDCRippleCapableSurface } from '@material/ripple/types';
146 export type MDCRippleFactory = (el: Element, foundation?: MDCRippleFoundation) => MDCRipple;
147 export class MDCRipple extends MDCComponent<MDCRippleFoundation> implements MDCRippleCapableSurface {
148 static attachTo(root: Element, opts?: MDCRippleAttachOpts): MDCRipple;
149 static createAdapter(instance: MDCRippleCapableSurface): MDCRippleAdapter;
150 disabled: boolean;
151 get unbounded(): boolean;
152 set unbounded(unbounded: boolean);
153 activate(): void;
154 deactivate(): void;
155 layout(): void;
156 getDefaultFoundation(): MDCRippleFoundation;
157 initialSyncWithDOM(): void;
158 }
159}
160
161declare module '@material/ripple/constants' {
162 /**
163 * @license
164 * Copyright 2016 Google Inc.
165 *
166 * Permission is hereby granted, free of charge, to any person obtaining a copy
167 * of this software and associated documentation files (the "Software"), to deal
168 * in the Software without restriction, including without limitation the rights
169 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
170 * copies of the Software, and to permit persons to whom the Software is
171 * furnished to do so, subject to the following conditions:
172 *
173 * The above copyright notice and this permission notice shall be included in
174 * all copies or substantial portions of the Software.
175 *
176 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
177 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
178 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
179 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
180 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
181 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
182 * THE SOFTWARE.
183 */
184 export const cssClasses: {
185 BG_FOCUSED: string;
186 FG_ACTIVATION: string;
187 FG_DEACTIVATION: string;
188 ROOT: string;
189 UNBOUNDED: string;
190 };
191 export const strings: {
192 VAR_FG_SCALE: string;
193 VAR_FG_SIZE: string;
194 VAR_FG_TRANSLATE_END: string;
195 VAR_FG_TRANSLATE_START: string;
196 VAR_LEFT: string;
197 VAR_TOP: string;
198 };
199 export const numbers: {
200 DEACTIVATION_TIMEOUT_MS: number;
201 FG_DEACTIVATION_MS: number;
202 INITIAL_ORIGIN_SCALE: number;
203 PADDING: number;
204 TAP_DELAY_MS: number;
205 };
206}
207
208declare module '@material/ripple/foundation' {
209 /**
210 * @license
211 * Copyright 2016 Google Inc.
212 *
213 * Permission is hereby granted, free of charge, to any person obtaining a copy
214 * of this software and associated documentation files (the "Software"), to deal
215 * in the Software without restriction, including without limitation the rights
216 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
217 * copies of the Software, and to permit persons to whom the Software is
218 * furnished to do so, subject to the following conditions:
219 *
220 * The above copyright notice and this permission notice shall be included in
221 * all copies or substantial portions of the Software.
222 *
223 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
224 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
225 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
226 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
227 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
228 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
229 * THE SOFTWARE.
230 */
231 import { MDCFoundation } from '@material/base/foundation';
232 import { MDCRippleAdapter } from '@material/ripple/adapter';
233 export class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {
234 static get cssClasses(): {
235 BG_FOCUSED: string;
236 FG_ACTIVATION: string;
237 FG_DEACTIVATION: string;
238 ROOT: string;
239 UNBOUNDED: string;
240 };
241 static get strings(): {
242 VAR_FG_SCALE: string;
243 VAR_FG_SIZE: string;
244 VAR_FG_TRANSLATE_END: string;
245 VAR_FG_TRANSLATE_START: string;
246 VAR_LEFT: string;
247 VAR_TOP: string;
248 };
249 static get numbers(): {
250 DEACTIVATION_TIMEOUT_MS: number;
251 FG_DEACTIVATION_MS: number;
252 INITIAL_ORIGIN_SCALE: number;
253 PADDING: number;
254 TAP_DELAY_MS: number;
255 };
256 static get defaultAdapter(): MDCRippleAdapter;
257 constructor(adapter?: Partial<MDCRippleAdapter>);
258 init(): void;
259 destroy(): void;
260 /**
261 * @param evt Optional event containing position information.
262 */
263 activate(evt?: Event): void;
264 deactivate(): void;
265 layout(): void;
266 setUnbounded(unbounded: boolean): void;
267 handleFocus(): void;
268 handleBlur(): void;
269 }
270 export default MDCRippleFoundation;
271}
272
273declare module '@material/ripple/types' {
274 /**
275 * @license
276 * Copyright 2019 Google Inc.
277 *
278 * Permission is hereby granted, free of charge, to any person obtaining a copy
279 * of this software and associated documentation files (the "Software"), to deal
280 * in the Software without restriction, including without limitation the rights
281 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
282 * copies of the Software, and to permit persons to whom the Software is
283 * furnished to do so, subject to the following conditions:
284 *
285 * The above copyright notice and this permission notice shall be included in
286 * all copies or substantial portions of the Software.
287 *
288 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
289 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
290 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
291 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
292 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
293 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
294 * THE SOFTWARE.
295 */
296 export interface MDCRipplePoint {
297 x: number;
298 y: number;
299 }
300 /**
301 * Options passed in when attaching a ripple to an object.
302 */
303 export interface MDCRippleAttachOpts {
304 isUnbounded?: boolean;
305 }
306 /**
307 * See Material Design spec for more details on when to use ripples.
308 * https://material.io/guidelines/motion/choreography.html#choreography-creation
309 * unbounded Whether or not the ripple bleeds out of the bounds of the element.
310 * disabled Whether or not the ripple is attached to a disabled component.
311 */
312 export interface MDCRippleCapableSurface {
313 root: Element;
314 unbounded?: boolean;
315 disabled?: boolean;
316 }
317}
318