constants.d.ts 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. declare const cssClasses: {
  24. ANCHOR: string;
  25. ANIMATING_CLOSED: string;
  26. ANIMATING_OPEN: string;
  27. FIXED: string;
  28. IS_OPEN_BELOW: string;
  29. OPEN: string;
  30. ROOT: string;
  31. };
  32. declare const strings: {
  33. CLOSED_EVENT: string;
  34. CLOSING_EVENT: string;
  35. OPENED_EVENT: string;
  36. OPENING_EVENT: string;
  37. FOCUSABLE_ELEMENTS: string;
  38. };
  39. declare const numbers: {
  40. /** Total duration of menu-surface open animation. */
  41. TRANSITION_OPEN_DURATION: number;
  42. /** Total duration of menu-surface close animation. */
  43. TRANSITION_CLOSE_DURATION: number;
  44. /**
  45. * Margin left to the edge of the viewport when menu-surface is at maximum
  46. * possible height. Also used as a viewport margin.
  47. */
  48. MARGIN_TO_EDGE: number;
  49. /**
  50. * Ratio of anchor width to menu-surface width for switching from corner
  51. * positioning to center positioning.
  52. */
  53. ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: number;
  54. /**
  55. * Amount of time to wait before restoring focus when closing the menu
  56. * surface. This is important because if a touch event triggered the menu
  57. * close, and the subsequent mouse event occurs after focus is restored, then
  58. * the restored focus would be lost.
  59. */
  60. TOUCH_EVENT_WAIT_MS: number;
  61. };
  62. /**
  63. * Enum for bits in the {@see Corner) bitmap.
  64. */
  65. declare enum CornerBit {
  66. BOTTOM = 1,
  67. CENTER = 2,
  68. RIGHT = 4,
  69. FLIP_RTL = 8
  70. }
  71. /**
  72. * Enum for representing an element corner for positioning the menu-surface.
  73. *
  74. * The START constants map to LEFT if element directionality is left
  75. * to right and RIGHT if the directionality is right to left.
  76. * Likewise END maps to RIGHT or LEFT depending on the directionality.
  77. */
  78. declare enum Corner {
  79. TOP_LEFT = 0,
  80. TOP_RIGHT = 4,
  81. BOTTOM_LEFT = 1,
  82. BOTTOM_RIGHT = 5,
  83. TOP_START = 8,
  84. TOP_END = 12,
  85. BOTTOM_START = 9,
  86. BOTTOM_END = 13
  87. }
  88. export { cssClasses, strings, numbers, CornerBit, Corner };