foundation.d.ts 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**
  2. * @license
  3. * Copyright 2018 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 { MDCDrawerAdapter } from '../adapter';
  25. /** MDC Dismissible Drawer Foundation */
  26. export declare class MDCDismissibleDrawerFoundation extends MDCFoundation<MDCDrawerAdapter> {
  27. static get strings(): {
  28. APP_CONTENT_SELECTOR: string;
  29. CLOSE_EVENT: string;
  30. OPEN_EVENT: string;
  31. SCRIM_SELECTOR: string;
  32. LIST_SELECTOR: string;
  33. LIST_ITEM_ACTIVATED_SELECTOR: string;
  34. };
  35. static get cssClasses(): {
  36. ANIMATE: string;
  37. CLOSING: string;
  38. DISMISSIBLE: string;
  39. MODAL: string;
  40. OPEN: string;
  41. OPENING: string;
  42. ROOT: string;
  43. };
  44. static get defaultAdapter(): MDCDrawerAdapter;
  45. private animationFrame;
  46. private animationTimer;
  47. constructor(adapter?: Partial<MDCDrawerAdapter>);
  48. destroy(): void;
  49. /**
  50. * Opens the drawer from the closed state.
  51. */
  52. open(): void;
  53. /**
  54. * Closes the drawer from the open state.
  55. */
  56. close(): void;
  57. /**
  58. * Returns true if the drawer is in the open position.
  59. * @return true if drawer is in open state.
  60. */
  61. isOpen(): boolean;
  62. /**
  63. * Returns true if the drawer is animating open.
  64. * @return true if drawer is animating open.
  65. */
  66. isOpening(): boolean;
  67. /**
  68. * Returns true if the drawer is animating closed.
  69. * @return true if drawer is animating closed.
  70. */
  71. isClosing(): boolean;
  72. /**
  73. * Keydown handler to close drawer when key is escape.
  74. */
  75. handleKeydown(evt: KeyboardEvent): void;
  76. /**
  77. * Handles the `transitionend` event when the drawer finishes opening/closing.
  78. */
  79. handleTransitionEnd(evt: TransitionEvent): void;
  80. /**
  81. * Extension point for when drawer finishes open animation.
  82. */
  83. protected opened(): void;
  84. /**
  85. * Extension point for when drawer finishes close animation.
  86. */
  87. protected closed(): void;
  88. /**
  89. * Runs the given logic on the next animation frame, using setTimeout to
  90. * factor in Firefox reflow behavior.
  91. */
  92. private runNextAnimationFrame;
  93. private isElement;
  94. }
  95. export default MDCDismissibleDrawerFoundation;