puppeteer-events.d.ts 955 B

123456789101112131415161718192021
  1. import type { SerializedEvent } from '@stencil/core/internal';
  2. import type * as pd from './puppeteer-declarations';
  3. import type * as puppeteer from 'puppeteer';
  4. export declare function initPageEvents(page: pd.E2EPageInternal): Promise<void>;
  5. export declare function waitForEvent(page: pd.E2EPageInternal, eventName: string, elementHandle: puppeteer.ElementHandle): Promise<any>;
  6. export declare class EventSpy implements EventSpy {
  7. eventName: string;
  8. events: SerializedEvent[];
  9. private cursor;
  10. private queuedHandler;
  11. constructor(eventName: string);
  12. get length(): number;
  13. get firstEvent(): SerializedEvent;
  14. get lastEvent(): SerializedEvent;
  15. next(): Promise<{
  16. done: boolean;
  17. value: SerializedEvent;
  18. }>;
  19. push(ev: SerializedEvent): void;
  20. }
  21. export declare function addE2EListener(page: pd.E2EPageInternal, elmHandle: puppeteer.JSHandle, eventName: string, callback: (ev: any) => void): Promise<void>;