UNPKG

32.8 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/tabs' {
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 export * from '@material/tabs/tab/index';
31 export * from '@material/tabs/tab-bar/index';
32 export * from '@material/tabs/tab-bar-scroller/index';
33}
34
35declare module '@material/tabs/tab/index' {
36 /**
37 * @license
38 * Copyright 2019 Google Inc.
39 *
40 * Permission is hereby granted, free of charge, to any person obtaining a copy
41 * of this software and associated documentation files (the "Software"), to deal
42 * in the Software without restriction, including without limitation the rights
43 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
44 * copies of the Software, and to permit persons to whom the Software is
45 * furnished to do so, subject to the following conditions:
46 *
47 * The above copyright notice and this permission notice shall be included in
48 * all copies or substantial portions of the Software.
49 *
50 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
53 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
54 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
55 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
56 * THE SOFTWARE.
57 */
58 export * from '@material/tabs/tab/adapter';
59 export * from '@material/tabs/tab/component';
60 export * from '@material/tabs/tab/foundation';
61 export { cssClasses as tabCssClasses, strings as tabStrings } from '@material/tabs/tab/constants';
62}
63
64declare module '@material/tabs/tab-bar/index' {
65 /**
66 * @license
67 * Copyright 2019 Google Inc.
68 *
69 * Permission is hereby granted, free of charge, to any person obtaining a copy
70 * of this software and associated documentation files (the "Software"), to deal
71 * in the Software without restriction, including without limitation the rights
72 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
73 * copies of the Software, and to permit persons to whom the Software is
74 * furnished to do so, subject to the following conditions:
75 *
76 * The above copyright notice and this permission notice shall be included in
77 * all copies or substantial portions of the Software.
78 *
79 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
80 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
81 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
82 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
83 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
84 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
85 * THE SOFTWARE.
86 */
87 export * from '@material/tabs/tab-bar/adapter';
88 export * from '@material/tabs/tab-bar/component';
89 export * from '@material/tabs/tab-bar/foundation';
90 export * from '@material/tabs/tab-bar/types';
91 export { cssClasses as tabBarCssClasses, strings as tabBarStrings } from '@material/tabs/tab-bar/constants';
92}
93
94declare module '@material/tabs/tab-bar-scroller/index' {
95 /**
96 * @license
97 * Copyright 2019 Google Inc.
98 *
99 * Permission is hereby granted, free of charge, to any person obtaining a copy
100 * of this software and associated documentation files (the "Software"), to deal
101 * in the Software without restriction, including without limitation the rights
102 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
103 * copies of the Software, and to permit persons to whom the Software is
104 * furnished to do so, subject to the following conditions:
105 *
106 * The above copyright notice and this permission notice shall be included in
107 * all copies or substantial portions of the Software.
108 *
109 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
110 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
111 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
112 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
113 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
114 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
115 * THE SOFTWARE.
116 */
117 export * from '@material/tabs/tab-bar-scroller/adapter';
118 export * from '@material/tabs/tab-bar-scroller/component';
119 export * from '@material/tabs/tab-bar-scroller/foundation';
120 export { cssClasses as tabBarScrollerCssClasses, strings as tabBarScrollerStrings } from '@material/tabs/tab-bar-scroller/constants';
121}
122
123declare module '@material/tabs/tab/adapter' {
124 /**
125 * @license
126 * Copyright 2019 Google Inc.
127 *
128 * Permission is hereby granted, free of charge, to any person obtaining a copy
129 * of this software and associated documentation files (the "Software"), to deal
130 * in the Software without restriction, including without limitation the rights
131 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
132 * copies of the Software, and to permit persons to whom the Software is
133 * furnished to do so, subject to the following conditions:
134 *
135 * The above copyright notice and this permission notice shall be included in
136 * all copies or substantial portions of the Software.
137 *
138 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
139 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
140 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
141 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
142 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
143 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
144 * THE SOFTWARE.
145 */
146 import { EventType, SpecificEventListener } from '@material/base/types';
147 export interface MDCTabAdapter {
148 addClass: (className: string) => void;
149 removeClass: (className: string) => void;
150 registerInteractionHandler: <K extends EventType>(type: K, handler: SpecificEventListener<K>) => void;
151 deregisterInteractionHandler: <K extends EventType>(type: K, handler: SpecificEventListener<K>) => void;
152 getOffsetWidth: () => number;
153 getOffsetLeft: () => number;
154 notifySelected: () => void;
155 }
156}
157
158declare module '@material/tabs/tab/component' {
159 /**
160 * @license
161 * Copyright 2017 Google Inc.
162 *
163 * Permission is hereby granted, free of charge, to any person obtaining a copy
164 * of this software and associated documentation files (the "Software"), to deal
165 * in the Software without restriction, including without limitation the rights
166 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
167 * copies of the Software, and to permit persons to whom the Software is
168 * furnished to do so, subject to the following conditions:
169 *
170 * The above copyright notice and this permission notice shall be included in
171 * all copies or substantial portions of the Software.
172 *
173 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
174 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
175 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
176 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
177 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
178 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
179 * THE SOFTWARE.
180 */
181 import { MDCComponent } from '@material/base/component';
182 import { MDCTabFoundation } from '@material/tabs/tab/foundation';
183 export type MDCTabFactory = (el: Element, foundation?: MDCTabFoundation) => MDCTab;
184 export interface MDCTabSelectedEventDetail {
185 tab: MDCTab;
186 }
187 export interface MDCTabSelectedEvent extends Event {
188 readonly detail: MDCTabSelectedEventDetail;
189 }
190 export class MDCTab extends MDCComponent<MDCTabFoundation> {
191 static attachTo(root: Element): MDCTab;
192 readonly computedWidth: number;
193 readonly computedLeft: number;
194 isActive: boolean;
195 preventDefaultOnClick: boolean;
196 protected root_: HTMLElement;
197 destroy(): void;
198 getDefaultFoundation(): MDCTabFoundation;
199 initialSyncWithDOM(): void;
200 measureSelf(): void;
201 }
202}
203
204declare module '@material/tabs/tab/foundation' {
205 /**
206 * @license
207 * Copyright 2017 Google Inc.
208 *
209 * Permission is hereby granted, free of charge, to any person obtaining a copy
210 * of this software and associated documentation files (the "Software"), to deal
211 * in the Software without restriction, including without limitation the rights
212 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
213 * copies of the Software, and to permit persons to whom the Software is
214 * furnished to do so, subject to the following conditions:
215 *
216 * The above copyright notice and this permission notice shall be included in
217 * all copies or substantial portions of the Software.
218 *
219 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
220 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
221 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
222 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
223 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
224 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
225 * THE SOFTWARE.
226 */
227 import { MDCFoundation } from '@material/base/foundation';
228 import { MDCTabAdapter } from '@material/tabs/tab/adapter';
229 export class MDCTabFoundation extends MDCFoundation<MDCTabAdapter> {
230 static readonly cssClasses: {
231 ACTIVE: string;
232 };
233 static readonly strings: {
234 SELECTED_EVENT: string;
235 };
236 static readonly defaultAdapter: MDCTabAdapter;
237 constructor(adapter?: Partial<MDCTabAdapter>);
238 init(): void;
239 destroy(): void;
240 getComputedWidth(): number;
241 getComputedLeft(): number;
242 isActive(): boolean;
243 setActive(isActive: boolean): void;
244 preventsDefaultOnClick(): boolean;
245 setPreventDefaultOnClick(preventDefaultOnClick: boolean): void;
246 measureSelf(): void;
247 }
248 export default MDCTabFoundation;
249}
250
251declare module '@material/tabs/tab/constants' {
252 /**
253 * @license
254 * Copyright 2017 Google Inc.
255 *
256 * Permission is hereby granted, free of charge, to any person obtaining a copy
257 * of this software and associated documentation files (the "Software"), to deal
258 * in the Software without restriction, including without limitation the rights
259 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
260 * copies of the Software, and to permit persons to whom the Software is
261 * furnished to do so, subject to the following conditions:
262 *
263 * The above copyright notice and this permission notice shall be included in
264 * all copies or substantial portions of the Software.
265 *
266 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
267 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
268 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
269 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
270 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
271 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
272 * THE SOFTWARE.
273 */
274 export const cssClasses: {
275 ACTIVE: string;
276 };
277 export const strings: {
278 SELECTED_EVENT: string;
279 };
280}
281
282declare module '@material/tabs/tab-bar/adapter' {
283 /**
284 * @license
285 * Copyright 2019 Google Inc.
286 *
287 * Permission is hereby granted, free of charge, to any person obtaining a copy
288 * of this software and associated documentation files (the "Software"), to deal
289 * in the Software without restriction, including without limitation the rights
290 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
291 * copies of the Software, and to permit persons to whom the Software is
292 * furnished to do so, subject to the following conditions:
293 *
294 * The above copyright notice and this permission notice shall be included in
295 * all copies or substantial portions of the Software.
296 *
297 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
298 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
299 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
300 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
301 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
302 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
303 * THE SOFTWARE.
304 */
305 import { SpecificEventListener } from '@material/base/types';
306 import { MDCTabBarChangeEventDetail } from '@material/tabs/tab-bar/types';
307 export interface MDCTabBarAdapter {
308 addClass: (className: string) => void;
309 removeClass: (className: string) => void;
310 bindOnMDCTabSelectedEvent: () => void;
311 unbindOnMDCTabSelectedEvent: () => void;
312 registerResizeHandler: (handler: SpecificEventListener<'resize'>) => void;
313 deregisterResizeHandler: (handler: SpecificEventListener<'resize'>) => void;
314 getOffsetWidth: () => number;
315 setStyleForIndicator: (propertyName: string, value: string) => void;
316 getOffsetWidthForIndicator: () => number;
317 notifyChange: (evtData: MDCTabBarChangeEventDetail) => void;
318 getNumberOfTabs: () => number;
319 isTabActiveAtIndex: (index: number) => boolean;
320 setTabActiveAtIndex: (index: number, isActive: boolean) => void;
321 isDefaultPreventedOnClickForTabAtIndex: (index: number) => boolean;
322 setPreventDefaultOnClickForTabAtIndex: (index: number, preventDefaultOnClick: boolean) => void;
323 measureTabAtIndex: (index: number) => void;
324 getComputedWidthForTabAtIndex: (index: number) => number;
325 getComputedLeftForTabAtIndex: (index: number) => number;
326 }
327}
328
329declare module '@material/tabs/tab-bar/component' {
330 /**
331 * @license
332 * Copyright 2017 Google Inc.
333 *
334 * Permission is hereby granted, free of charge, to any person obtaining a copy
335 * of this software and associated documentation files (the "Software"), to deal
336 * in the Software without restriction, including without limitation the rights
337 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
338 * copies of the Software, and to permit persons to whom the Software is
339 * furnished to do so, subject to the following conditions:
340 *
341 * The above copyright notice and this permission notice shall be included in
342 * all copies or substantial portions of the Software.
343 *
344 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
345 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
346 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
347 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
348 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
349 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
350 * THE SOFTWARE.
351 */
352 import { MDCComponent } from '@material/base/component';
353 import { MDCTab, MDCTabFactory } from '@material/tabs/tab/component';
354 import { MDCTabBarFoundation } from '@material/tabs/tab-bar/foundation';
355 export type MDCTabBarFactory = (el: Element, foundation?: MDCTabBarFoundation) => MDCTabBar;
356 export class MDCTabBar extends MDCComponent<MDCTabBarFoundation> {
357 static attachTo(root: Element): MDCTabBar;
358 readonly tabs: MDCTab[];
359 activeTab: MDCTab;
360 activeTabIndex: number;
361 protected root_: HTMLElement;
362 initialize(tabFactory?: MDCTabFactory): void;
363 getDefaultFoundation(): MDCTabBarFoundation;
364 layout(): void;
365 }
366}
367
368declare module '@material/tabs/tab-bar/foundation' {
369 /**
370 * @license
371 * Copyright 2017 Google Inc.
372 *
373 * Permission is hereby granted, free of charge, to any person obtaining a copy
374 * of this software and associated documentation files (the "Software"), to deal
375 * in the Software without restriction, including without limitation the rights
376 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
377 * copies of the Software, and to permit persons to whom the Software is
378 * furnished to do so, subject to the following conditions:
379 *
380 * The above copyright notice and this permission notice shall be included in
381 * all copies or substantial portions of the Software.
382 *
383 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
384 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
385 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
386 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
387 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
388 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
389 * THE SOFTWARE.
390 */
391 import { MDCFoundation } from '@material/base/foundation';
392 import { MDCTabBarAdapter } from '@material/tabs/tab-bar/adapter';
393 export class MDCTabBarFoundation extends MDCFoundation<MDCTabBarAdapter> {
394 static readonly cssClasses: {
395 UPGRADED: string;
396 };
397 static readonly strings: {
398 CHANGE_EVENT: string;
399 INDICATOR_SELECTOR: string;
400 TAB_SELECTOR: string;
401 };
402 static readonly defaultAdapter: MDCTabBarAdapter;
403 constructor(adapter?: Partial<MDCTabBarAdapter>);
404 init(): void;
405 destroy(): void;
406 layout(): void;
407 switchToTabAtIndex(index: number, shouldNotify: boolean): void;
408 getActiveTabIndex(): number;
409 }
410 export default MDCTabBarFoundation;
411}
412
413declare module '@material/tabs/tab-bar/types' {
414 /**
415 * @license
416 * Copyright 2019 Google Inc.
417 *
418 * Permission is hereby granted, free of charge, to any person obtaining a copy
419 * of this software and associated documentation files (the "Software"), to deal
420 * in the Software without restriction, including without limitation the rights
421 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
422 * copies of the Software, and to permit persons to whom the Software is
423 * furnished to do so, subject to the following conditions:
424 *
425 * The above copyright notice and this permission notice shall be included in
426 * all copies or substantial portions of the Software.
427 *
428 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
429 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
430 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
431 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
432 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
433 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
434 * THE SOFTWARE.
435 */
436 export interface MDCTabBarChangeEventDetail {
437 activeTabIndex: number;
438 }
439 export interface MDCTabBarChangeEvent extends Event {
440 readonly detail: MDCTabBarChangeEventDetail;
441 }
442}
443
444declare module '@material/tabs/tab-bar/constants' {
445 /**
446 * @license
447 * Copyright 2017 Google Inc.
448 *
449 * Permission is hereby granted, free of charge, to any person obtaining a copy
450 * of this software and associated documentation files (the "Software"), to deal
451 * in the Software without restriction, including without limitation the rights
452 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
453 * copies of the Software, and to permit persons to whom the Software is
454 * furnished to do so, subject to the following conditions:
455 *
456 * The above copyright notice and this permission notice shall be included in
457 * all copies or substantial portions of the Software.
458 *
459 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
460 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
461 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
462 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
463 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
464 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
465 * THE SOFTWARE.
466 */
467 export const cssClasses: {
468 UPGRADED: string;
469 };
470 export const strings: {
471 CHANGE_EVENT: string;
472 INDICATOR_SELECTOR: string;
473 TAB_SELECTOR: string;
474 };
475}
476
477declare module '@material/tabs/tab-bar-scroller/adapter' {
478 /**
479 * @license
480 * Copyright 2019 Google Inc.
481 *
482 * Permission is hereby granted, free of charge, to any person obtaining a copy
483 * of this software and associated documentation files (the "Software"), to deal
484 * in the Software without restriction, including without limitation the rights
485 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
486 * copies of the Software, and to permit persons to whom the Software is
487 * furnished to do so, subject to the following conditions:
488 *
489 * The above copyright notice and this permission notice shall be included in
490 * all copies or substantial portions of the Software.
491 *
492 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
493 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
494 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
495 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
496 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
497 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
498 * THE SOFTWARE.
499 */
500 import { EventType, SpecificEventListener } from '@material/base/types';
501 export interface MDCTabBarScrollerAdapter {
502 addClass: (className: string) => void;
503 removeClass: (className: string) => void;
504 eventTargetHasClass: (target: Element, className: string) => boolean;
505 addClassToForwardIndicator: (className: string) => void;
506 removeClassFromForwardIndicator: (className: string) => void;
507 addClassToBackIndicator: (className: string) => void;
508 removeClassFromBackIndicator: (className: string) => void;
509 isRTL: () => boolean;
510 registerBackIndicatorClickHandler: (handler: SpecificEventListener<'click'>) => void;
511 deregisterBackIndicatorClickHandler: (handler: SpecificEventListener<'click'>) => void;
512 registerForwardIndicatorClickHandler: (handler: SpecificEventListener<'click'>) => void;
513 deregisterForwardIndicatorClickHandler: (handler: SpecificEventListener<'click'>) => void;
514 registerCapturedInteractionHandler: <K extends EventType>(evt: K, handler: SpecificEventListener<K>) => void;
515 deregisterCapturedInteractionHandler: <K extends EventType>(evt: K, handler: SpecificEventListener<K>) => void;
516 registerWindowResizeHandler: (handler: SpecificEventListener<'resize'>) => void;
517 deregisterWindowResizeHandler: (handler: SpecificEventListener<'resize'>) => void;
518 getNumberOfTabs: () => number;
519 getComputedWidthForTabAtIndex: (index: number) => number;
520 getComputedLeftForTabAtIndex: (index: number) => number;
521 getOffsetWidthForScrollFrame: () => number;
522 getScrollLeftForScrollFrame: () => number;
523 setScrollLeftForScrollFrame: (scrollLeftAmount: number) => void;
524 getOffsetWidthForTabBar: () => number;
525 setTransformStyleForTabBar: (value: string) => void;
526 getOffsetLeftForEventTarget: (target: HTMLElement) => number;
527 getOffsetWidthForEventTarget: (target: HTMLElement) => number;
528 }
529}
530
531declare module '@material/tabs/tab-bar-scroller/component' {
532 /**
533 * @license
534 * Copyright 2017 Google Inc.
535 *
536 * Permission is hereby granted, free of charge, to any person obtaining a copy
537 * of this software and associated documentation files (the "Software"), to deal
538 * in the Software without restriction, including without limitation the rights
539 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
540 * copies of the Software, and to permit persons to whom the Software is
541 * furnished to do so, subject to the following conditions:
542 *
543 * The above copyright notice and this permission notice shall be included in
544 * all copies or substantial portions of the Software.
545 *
546 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
547 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
548 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
549 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
550 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
551 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
552 * THE SOFTWARE.
553 */
554 import { MDCComponent } from '@material/base/component';
555 import { MDCTabBar, MDCTabBarFactory } from '@material/tabs/tab-bar/component';
556 import { MDCTabBarScrollerFoundation } from '@material/tabs/tab-bar-scroller/foundation';
557 export class MDCTabBarScroller extends MDCComponent<MDCTabBarScrollerFoundation> {
558 static attachTo(root: Element): MDCTabBarScroller;
559 readonly tabBar: MDCTabBar;
560 protected root_: HTMLElement;
561 initialize(tabBarFactory?: MDCTabBarFactory): void;
562 getDefaultFoundation(): MDCTabBarScrollerFoundation;
563 layout(): void;
564 }
565}
566
567declare module '@material/tabs/tab-bar-scroller/foundation' {
568 /**
569 * @license
570 * Copyright 2017 Google Inc.
571 *
572 * Permission is hereby granted, free of charge, to any person obtaining a copy
573 * of this software and associated documentation files (the "Software"), to deal
574 * in the Software without restriction, including without limitation the rights
575 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
576 * copies of the Software, and to permit persons to whom the Software is
577 * furnished to do so, subject to the following conditions:
578 *
579 * The above copyright notice and this permission notice shall be included in
580 * all copies or substantial portions of the Software.
581 *
582 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
583 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
584 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
585 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
586 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
587 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
588 * THE SOFTWARE.
589 */
590 import { MDCFoundation } from '@material/base/foundation';
591 import { MDCTabBarScrollerAdapter } from '@material/tabs/tab-bar-scroller/adapter';
592 export class MDCTabBarScrollerFoundation extends MDCFoundation<MDCTabBarScrollerAdapter> {
593 static readonly cssClasses: {
594 INDICATOR_BACK: string;
595 INDICATOR_ENABLED: string;
596 INDICATOR_FORWARD: string;
597 TAB: string;
598 };
599 static readonly strings: {
600 FRAME_SELECTOR: string;
601 INDICATOR_BACK_SELECTOR: string;
602 INDICATOR_FORWARD_SELECTOR: string;
603 TABS_SELECTOR: string;
604 TAB_SELECTOR: string;
605 };
606 static readonly defaultAdapter: MDCTabBarScrollerAdapter;
607 constructor(adapter?: Partial<MDCTabBarScrollerAdapter>);
608 init(): void;
609 destroy(): void;
610 scrollBack(evt?: MouseEvent): void;
611 scrollForward(evt?: MouseEvent): void;
612 layout(): void;
613 scrollToTabAtIndex(index: number): void;
614 }
615 export default MDCTabBarScrollerFoundation;
616}
617
618declare module '@material/tabs/tab-bar-scroller/constants' {
619 /**
620 * @license
621 * Copyright 2017 Google Inc.
622 *
623 * Permission is hereby granted, free of charge, to any person obtaining a copy
624 * of this software and associated documentation files (the "Software"), to deal
625 * in the Software without restriction, including without limitation the rights
626 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
627 * copies of the Software, and to permit persons to whom the Software is
628 * furnished to do so, subject to the following conditions:
629 *
630 * The above copyright notice and this permission notice shall be included in
631 * all copies or substantial portions of the Software.
632 *
633 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
634 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
635 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
636 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
637 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
638 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
639 * THE SOFTWARE.
640 */
641 export const cssClasses: {
642 INDICATOR_BACK: string;
643 INDICATOR_ENABLED: string;
644 INDICATOR_FORWARD: string;
645 TAB: string;
646 };
647 export const strings: {
648 FRAME_SELECTOR: string;
649 INDICATOR_BACK_SELECTOR: string;
650 INDICATOR_FORWARD_SELECTOR: string;
651 TABS_SELECTOR: string;
652 TAB_SELECTOR: string;
653 };
654}
655