mdc.checkbox.d.ts 10 KB

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