UNPKG

2.55 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2021 Google Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 * THE SOFTWARE.
22 */
23import { MDCComponent } from '@material/base/component';
24import { MDCRippleAdapter } from '@material/ripple/adapter';
25import { MDCRipple } from '@material/ripple/component';
26import { MDCRippleFoundation } from '@material/ripple/foundation';
27import { MDCRippleCapableSurface } from '@material/ripple/types';
28import { MDCSwitchRenderAdapter, MDCSwitchState } from './adapter';
29import { MDCSwitchRenderFoundation } from './foundation';
30/**
31 * `MDCSwitch` provides a component implementation of a Material Design switch.
32 */
33export declare class MDCSwitch extends MDCComponent<MDCSwitchRenderFoundation> implements MDCSwitchState, MDCRippleCapableSurface {
34 root: HTMLButtonElement;
35 /**
36 * Creates a new `MDCSwitch` and attaches it to the given root element.
37 * @param root The root to attach to.
38 * @return the new component instance.
39 */
40 static attachTo(root: HTMLButtonElement): MDCSwitch;
41 disabled: boolean;
42 processing: boolean;
43 selected: boolean;
44 ripple: MDCRipple;
45 private rippleElement;
46 constructor(root: HTMLButtonElement, foundation?: MDCSwitchRenderFoundation);
47 initialize(): void;
48 initialSyncWithDOM(): void;
49 destroy(): void;
50 getDefaultFoundation(): MDCSwitchRenderFoundation;
51 protected createAdapter(): MDCSwitchRenderAdapter;
52 protected createRippleFoundation(): MDCRippleFoundation;
53 protected createRippleAdapter(): MDCRippleAdapter;
54}