UNPKG

12.4 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/toolbar' {
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/toolbar/adapter';
31 export * from '@material/toolbar/component';
32 export * from '@material/toolbar/constants';
33 export * from '@material/toolbar/foundation';
34 export * from '@material/toolbar/types';
35}
36
37declare module '@material/toolbar/adapter' {
38 /**
39 * @license
40 * Copyright 2019 Google Inc.
41 *
42 * Permission is hereby granted, free of charge, to any person obtaining a copy
43 * of this software and associated documentation files (the "Software"), to deal
44 * in the Software without restriction, including without limitation the rights
45 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
46 * copies of the Software, and to permit persons to whom the Software is
47 * furnished to do so, subject to the following conditions:
48 *
49 * The above copyright notice and this permission notice shall be included in
50 * all copies or substantial portions of the Software.
51 *
52 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
54 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
55 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
56 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
57 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
58 * THE SOFTWARE.
59 */
60 import { SpecificEventListener } from '@material/base/types';
61 import { MDCToolbarEventDetail } from '@material/toolbar/types';
62 /**
63 * Defines the shape of the adapter expected by the foundation.
64 * Implement this adapter for your framework of choice to delegate updates to
65 * the component in your framework of choice. See architecture documentation
66 * for more details.
67 * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
68 */
69 export interface MDCToolbarAdapter {
70 hasClass: (className: string) => boolean;
71 addClass: (className: string) => void;
72 removeClass: (className: string) => void;
73 registerScrollHandler: (handler: SpecificEventListener<'scroll'>) => void;
74 deregisterScrollHandler: (handler: SpecificEventListener<'scroll'>) => void;
75 registerResizeHandler: (handler: SpecificEventListener<'resize'>) => void;
76 deregisterResizeHandler: (handler: SpecificEventListener<'resize'>) => void;
77 getViewportWidth: () => number;
78 getViewportScrollY: () => number;
79 getOffsetHeight: () => number;
80 getFirstRowElementOffsetHeight: () => number;
81 notifyChange: (evtData: MDCToolbarEventDetail) => void;
82 setStyle: (property: string, value: string) => void;
83 setStyleForTitleElement: (property: string, value: string) => void;
84 setStyleForFlexibleRowElement: (property: string, value: string) => void;
85 setStyleForFixedAdjustElement: (property: string, value: string) => void;
86 }
87}
88
89declare module '@material/toolbar/component' {
90 /**
91 * @license
92 * Copyright 2017 Google Inc.
93 *
94 * Permission is hereby granted, free of charge, to any person obtaining a copy
95 * of this software and associated documentation files (the "Software"), to deal
96 * in the Software without restriction, including without limitation the rights
97 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
98 * copies of the Software, and to permit persons to whom the Software is
99 * furnished to do so, subject to the following conditions:
100 *
101 * The above copyright notice and this permission notice shall be included in
102 * all copies or substantial portions of the Software.
103 *
104 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
110 * THE SOFTWARE.
111 */
112 import { MDCComponent } from '@material/base/component';
113 import { MDCToolbarFoundation } from '@material/toolbar/foundation';
114 export class MDCToolbar extends MDCComponent<MDCToolbarFoundation> {
115 static attachTo(root: Element): MDCToolbar;
116 protected root_: HTMLElement;
117 initialize(): void;
118 destroy(): void;
119 fixedAdjustElement: HTMLElement | null;
120 getDefaultFoundation(): MDCToolbarFoundation;
121 }
122}
123
124declare module '@material/toolbar/constants' {
125 /**
126 * @license
127 * Copyright 2017 Google Inc.
128 *
129 * Permission is hereby granted, free of charge, to any person obtaining a copy
130 * of this software and associated documentation files (the "Software"), to deal
131 * in the Software without restriction, including without limitation the rights
132 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
133 * copies of the Software, and to permit persons to whom the Software is
134 * furnished to do so, subject to the following conditions:
135 *
136 * The above copyright notice and this permission notice shall be included in
137 * all copies or substantial portions of the Software.
138 *
139 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
140 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
141 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
142 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
143 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
144 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
145 * THE SOFTWARE.
146 */
147 export const cssClasses: {
148 FIXED: string;
149 FIXED_AT_LAST_ROW: string;
150 FIXED_LASTROW: string;
151 FLEXIBLE_DEFAULT_BEHAVIOR: string;
152 FLEXIBLE_MAX: string;
153 FLEXIBLE_MIN: string;
154 TOOLBAR_ROW_FLEXIBLE: string;
155 };
156 export const strings: {
157 CHANGE_EVENT: string;
158 FIRST_ROW_SELECTOR: string;
159 ICON_SELECTOR: string;
160 TITLE_SELECTOR: string;
161 };
162 export const numbers: {
163 MAX_TITLE_SIZE: number;
164 MIN_TITLE_SIZE: number;
165 TOOLBAR_MOBILE_BREAKPOINT: number;
166 TOOLBAR_ROW_HEIGHT: number;
167 TOOLBAR_ROW_MOBILE_HEIGHT: number;
168 };
169}
170
171declare module '@material/toolbar/foundation' {
172 /**
173 * @license
174 * Copyright 2017 Google Inc.
175 *
176 * Permission is hereby granted, free of charge, to any person obtaining a copy
177 * of this software and associated documentation files (the "Software"), to deal
178 * in the Software without restriction, including without limitation the rights
179 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
180 * copies of the Software, and to permit persons to whom the Software is
181 * furnished to do so, subject to the following conditions:
182 *
183 * The above copyright notice and this permission notice shall be included in
184 * all copies or substantial portions of the Software.
185 *
186 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
187 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
188 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
189 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
190 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
191 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
192 * THE SOFTWARE.
193 */
194 import { MDCFoundation } from '@material/base/foundation';
195 import { MDCToolbarAdapter } from '@material/toolbar/adapter';
196 export class MDCToolbarFoundation extends MDCFoundation<MDCToolbarAdapter> {
197 static readonly cssClasses: {
198 FIXED: string;
199 FIXED_AT_LAST_ROW: string;
200 FIXED_LASTROW: string;
201 FLEXIBLE_DEFAULT_BEHAVIOR: string;
202 FLEXIBLE_MAX: string;
203 FLEXIBLE_MIN: string;
204 TOOLBAR_ROW_FLEXIBLE: string;
205 };
206 static readonly strings: {
207 CHANGE_EVENT: string;
208 FIRST_ROW_SELECTOR: string;
209 ICON_SELECTOR: string;
210 TITLE_SELECTOR: string;
211 };
212 static readonly numbers: {
213 MAX_TITLE_SIZE: number; /** The ratio of max scrollTop that we should listen to to row height. */
214 MIN_TITLE_SIZE: number;
215 TOOLBAR_MOBILE_BREAKPOINT: number;
216 TOOLBAR_ROW_HEIGHT: number;
217 TOOLBAR_ROW_MOBILE_HEIGHT: number;
218 };
219 static readonly defaultAdapter: MDCToolbarAdapter;
220 constructor(adapter?: Partial<MDCToolbarAdapter>);
221 init(): void;
222 destroy(): void;
223 updateAdjustElementStyles(): void;
224 }
225 export default MDCToolbarFoundation;
226}
227
228declare module '@material/toolbar/types' {
229 /**
230 * @license
231 * Copyright 2019 Google Inc.
232 *
233 * Permission is hereby granted, free of charge, to any person obtaining a copy
234 * of this software and associated documentation files (the "Software"), to deal
235 * in the Software without restriction, including without limitation the rights
236 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
237 * copies of the Software, and to permit persons to whom the Software is
238 * furnished to do so, subject to the following conditions:
239 *
240 * The above copyright notice and this permission notice shall be included in
241 * all copies or substantial portions of the Software.
242 *
243 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
244 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
245 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
246 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
247 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
248 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
249 * THE SOFTWARE.
250 */
251 export interface MDCToolbarEventDetail {
252 flexibleExpansionRatio: number;
253 }
254 export interface MDCToolbarEvent extends Event {
255 readonly detail: MDCToolbarEventDetail;
256 }
257}
258