observe.d.ts 557 B

123456789101112
  1. export interface PerformanceEntryHandler {
  2. (entry: PerformanceEntry): void;
  3. }
  4. /**
  5. * Takes a performance entry type and a callback function, and creates a
  6. * `PerformanceObserver` instance that will observe the specified entry type
  7. * with buffering enabled and call the callback _for each entry_.
  8. *
  9. * This function also feature-detects entry support and wraps the logic in a
  10. * try/catch to avoid errors in unsupporting browsers.
  11. */
  12. export declare const observe: (type: string, callback: PerformanceEntryHandler) => PerformanceObserver | undefined;