foundation.d.ts 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**
  2. * @license
  3. * Copyright 2016 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. */
  23. import { MDCFoundation } from '@material/base/foundation';
  24. import { MDCRippleAdapter } from './adapter';
  25. export declare class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {
  26. static readonly cssClasses: {
  27. BG_FOCUSED: string;
  28. FG_ACTIVATION: string;
  29. FG_DEACTIVATION: string;
  30. ROOT: string;
  31. UNBOUNDED: string;
  32. };
  33. static readonly strings: {
  34. VAR_FG_SCALE: string;
  35. VAR_FG_SIZE: string;
  36. VAR_FG_TRANSLATE_END: string;
  37. VAR_FG_TRANSLATE_START: string;
  38. VAR_LEFT: string;
  39. VAR_TOP: string;
  40. };
  41. static readonly numbers: {
  42. DEACTIVATION_TIMEOUT_MS: number;
  43. FG_DEACTIVATION_MS: number;
  44. INITIAL_ORIGIN_SCALE: number;
  45. PADDING: number;
  46. TAP_DELAY_MS: number;
  47. };
  48. static readonly defaultAdapter: MDCRippleAdapter;
  49. private activationAnimationHasEnded_;
  50. private activationState_;
  51. private activationTimer_;
  52. private fgDeactivationRemovalTimer_;
  53. private fgScale_;
  54. private frame_;
  55. private initialSize_;
  56. private layoutFrame_;
  57. private maxRadius_;
  58. private unboundedCoords_;
  59. private readonly activationTimerCallback_;
  60. private readonly activateHandler_;
  61. private readonly deactivateHandler_;
  62. private readonly focusHandler_;
  63. private readonly blurHandler_;
  64. private readonly resizeHandler_;
  65. private previousActivationEvent_?;
  66. constructor(adapter?: Partial<MDCRippleAdapter>);
  67. init(): void;
  68. destroy(): void;
  69. /**
  70. * @param evt Optional event containing position information.
  71. */
  72. activate(evt?: Event): void;
  73. deactivate(): void;
  74. layout(): void;
  75. setUnbounded(unbounded: boolean): void;
  76. handleFocus(): void;
  77. handleBlur(): void;
  78. /**
  79. * We compute this property so that we are not querying information about the client
  80. * until the point in time where the foundation requests it. This prevents scenarios where
  81. * client-side feature-detection may happen too early, such as when components are rendered on the server
  82. * and then initialized at mount time on the client.
  83. */
  84. private supportsPressRipple_;
  85. private defaultActivationState_;
  86. /**
  87. * supportsPressRipple Passed from init to save a redundant function call
  88. */
  89. private registerRootHandlers_;
  90. private registerDeactivationHandlers_;
  91. private deregisterRootHandlers_;
  92. private deregisterDeactivationHandlers_;
  93. private removeCssVars_;
  94. private activate_;
  95. private checkElementMadeActive_;
  96. private animateActivation_;
  97. private getFgTranslationCoordinates_;
  98. private runDeactivationUXLogicIfReady_;
  99. private rmBoundedActivationClasses_;
  100. private resetActivationState_;
  101. private deactivate_;
  102. private animateDeactivation_;
  103. private layoutInternal_;
  104. private updateLayoutCssVars_;
  105. }
  106. export default MDCRippleFoundation;