UNPKG

10.8 kBTypeScriptView Raw
1// Generated by dts-bundle v0.7.3
2// Dependencies for this module:
3// ../../@material/base/component
4// ../../@material/ripple/component
5// ../../@material/ripple/types
6// ../../@material/base/foundation
7
8declare module '@material/checkbox' {
9 /**
10 * @license
11 * Copyright 2019 Google Inc.
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining a copy
14 * of this software and associated documentation files (the "Software"), to deal
15 * in the Software without restriction, including without limitation the rights
16 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 * copies of the Software, and to permit persons to whom the Software is
18 * furnished to do so, subject to the following conditions:
19 *
20 * The above copyright notice and this permission notice shall be included in
21 * all copies or substantial portions of the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29 * THE SOFTWARE.
30 */
31 export * from '@material/checkbox/adapter';
32 export * from '@material/checkbox/component';
33 export * from '@material/checkbox/constants';
34 export * from '@material/checkbox/foundation';
35}
36
37declare module '@material/checkbox/adapter' {
38 /**
39 * Defines the shape of the adapter expected by the foundation.
40 * Implement this adapter for your framework of choice to delegate updates to
41 * the component in your framework of choice. See architecture documentation
42 * for more details.
43 * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
44 */
45 export interface MDCCheckboxAdapter {
46 addClass(className: string): void;
47 forceLayout(): void;
48 hasNativeControl(): boolean;
49 isAttachedToDOM(): boolean;
50 isChecked(): boolean;
51 isIndeterminate(): boolean;
52 removeClass(className: string): void;
53 removeNativeControlAttr(attr: string): void;
54 setNativeControlAttr(attr: string, value: string): void;
55 setNativeControlDisabled(disabled: boolean): void;
56 }
57}
58
59declare module '@material/checkbox/component' {
60 /**
61 * @license
62 * Copyright 2016 Google Inc.
63 *
64 * Permission is hereby granted, free of charge, to any person obtaining a copy
65 * of this software and associated documentation files (the "Software"), to deal
66 * in the Software without restriction, including without limitation the rights
67 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
68 * copies of the Software, and to permit persons to whom the Software is
69 * furnished to do so, subject to the following conditions:
70 *
71 * The above copyright notice and this permission notice shall be included in
72 * all copies or substantial portions of the Software.
73 *
74 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
75 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
76 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
77 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
78 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
79 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
80 * THE SOFTWARE.
81 */
82 import { MDCComponent } from '@material/base/component';
83 import { MDCRipple } from '@material/ripple/component';
84 import { MDCRippleCapableSurface } from '@material/ripple/types';
85 import { MDCCheckboxFoundation } from '@material/checkbox/foundation';
86 export type MDCCheckboxFactory = (el: Element, foundation?: MDCCheckboxFoundation) => MDCCheckbox;
87 export class MDCCheckbox extends MDCComponent<MDCCheckboxFoundation> implements MDCRippleCapableSurface {
88 static attachTo(root: Element): MDCCheckbox;
89 get ripple(): MDCRipple;
90 get checked(): boolean;
91 set checked(checked: boolean);
92 get indeterminate(): boolean;
93 set indeterminate(indeterminate: boolean);
94 get disabled(): boolean;
95 set disabled(disabled: boolean);
96 get value(): string;
97 set value(value: string);
98 initialize(): void;
99 initialSyncWithDOM(): void;
100 destroy(): void;
101 getDefaultFoundation(): MDCCheckboxFoundation;
102 }
103}
104
105declare module '@material/checkbox/constants' {
106 /**
107 * @license
108 * Copyright 2016 Google Inc.
109 *
110 * Permission is hereby granted, free of charge, to any person obtaining a copy
111 * of this software and associated documentation files (the "Software"), to deal
112 * in the Software without restriction, including without limitation the rights
113 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
114 * copies of the Software, and to permit persons to whom the Software is
115 * furnished to do so, subject to the following conditions:
116 *
117 * The above copyright notice and this permission notice shall be included in
118 * all copies or substantial portions of the Software.
119 *
120 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
121 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
122 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
123 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
124 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
125 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
126 * THE SOFTWARE.
127 */
128 export const cssClasses: {
129 ANIM_CHECKED_INDETERMINATE: string;
130 ANIM_CHECKED_UNCHECKED: string;
131 ANIM_INDETERMINATE_CHECKED: string;
132 ANIM_INDETERMINATE_UNCHECKED: string;
133 ANIM_UNCHECKED_CHECKED: string;
134 ANIM_UNCHECKED_INDETERMINATE: string;
135 BACKGROUND: string;
136 CHECKED: string;
137 CHECKMARK: string;
138 CHECKMARK_PATH: string;
139 DISABLED: string;
140 INDETERMINATE: string;
141 MIXEDMARK: string;
142 NATIVE_CONTROL: string;
143 ROOT: string;
144 SELECTED: string;
145 UPGRADED: string;
146 };
147 export const strings: {
148 ARIA_CHECKED_ATTR: string;
149 ARIA_CHECKED_INDETERMINATE_VALUE: string;
150 DATA_INDETERMINATE_ATTR: string;
151 NATIVE_CONTROL_SELECTOR: string;
152 TRANSITION_STATE_CHECKED: string;
153 TRANSITION_STATE_INDETERMINATE: string;
154 TRANSITION_STATE_INIT: string;
155 TRANSITION_STATE_UNCHECKED: string;
156 };
157 export const numbers: {
158 ANIM_END_LATCH_MS: number;
159 };
160}
161
162declare module '@material/checkbox/foundation' {
163 /**
164 * @license
165 * Copyright 2016 Google Inc.
166 *
167 * Permission is hereby granted, free of charge, to any person obtaining a copy
168 * of this software and associated documentation files (the "Software"), to deal
169 * in the Software without restriction, including without limitation the rights
170 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
171 * copies of the Software, and to permit persons to whom the Software is
172 * furnished to do so, subject to the following conditions:
173 *
174 * The above copyright notice and this permission notice shall be included in
175 * all copies or substantial portions of the Software.
176 *
177 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
178 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
179 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
180 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
181 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
182 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
183 * THE SOFTWARE.
184 */
185 import { MDCFoundation } from '@material/base/foundation';
186 import { MDCCheckboxAdapter } from '@material/checkbox/adapter';
187 export class MDCCheckboxFoundation extends MDCFoundation<MDCCheckboxAdapter> {
188 static get cssClasses(): {
189 ANIM_CHECKED_INDETERMINATE: string;
190 ANIM_CHECKED_UNCHECKED: string;
191 ANIM_INDETERMINATE_CHECKED: string;
192 ANIM_INDETERMINATE_UNCHECKED: string;
193 ANIM_UNCHECKED_CHECKED: string;
194 ANIM_UNCHECKED_INDETERMINATE: string;
195 BACKGROUND: string;
196 CHECKED: string;
197 CHECKMARK: string;
198 CHECKMARK_PATH: string;
199 DISABLED: string;
200 INDETERMINATE: string;
201 MIXEDMARK: string;
202 NATIVE_CONTROL: string;
203 ROOT: string;
204 SELECTED: string;
205 UPGRADED: string;
206 };
207 static get strings(): {
208 ARIA_CHECKED_ATTR: string;
209 ARIA_CHECKED_INDETERMINATE_VALUE: string;
210 DATA_INDETERMINATE_ATTR: string;
211 NATIVE_CONTROL_SELECTOR: string;
212 TRANSITION_STATE_CHECKED: string;
213 TRANSITION_STATE_INDETERMINATE: string;
214 TRANSITION_STATE_INIT: string;
215 TRANSITION_STATE_UNCHECKED: string;
216 };
217 static get numbers(): {
218 ANIM_END_LATCH_MS: number;
219 };
220 static get defaultAdapter(): MDCCheckboxAdapter;
221 constructor(adapter?: Partial<MDCCheckboxAdapter>);
222 init(): void;
223 destroy(): void;
224 setDisabled(disabled: boolean): void;
225 /**
226 * Handles the animationend event for the checkbox
227 */
228 handleAnimationEnd(): void;
229 /**
230 * Handles the change event for the checkbox
231 */
232 handleChange(): void;
233 }
234 export default MDCCheckboxFoundation;
235}
236