event-objects.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.io/license
  7. */
  8. /** Modifier keys that may be held while typing. */
  9. export interface ModifierKeys {
  10. control?: boolean;
  11. alt?: boolean;
  12. shift?: boolean;
  13. meta?: boolean;
  14. }
  15. /**
  16. * Creates a browser MouseEvent with the specified options.
  17. * @docs-private
  18. */
  19. export declare function createMouseEvent(type: string, x?: number, y?: number, button?: number): MouseEvent;
  20. /**
  21. * Creates a browser TouchEvent with the specified pointer coordinates.
  22. * @docs-private
  23. */
  24. export declare function createTouchEvent(type: string, pageX?: number, pageY?: number): UIEvent;
  25. /**
  26. * Dispatches a keydown event from an element.
  27. * @docs-private
  28. */
  29. export declare function createKeyboardEvent(type: string, keyCode?: number, key?: string, target?: Element, modifiers?: ModifierKeys): any;
  30. /**
  31. * Creates a fake event object with any desired event type.
  32. * @docs-private
  33. */
  34. export declare function createFakeEvent(type: string, canBubble?: boolean, cancelable?: boolean): Event;