usertiming.d.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. declare interface PerformanceEntryFilterOptions {
  2. // the name of a performance entry.
  3. name?: string;
  4. // the entry type. The valid entry types are listed in the PerformanceEntry.entryType method.
  5. entryType?: string;
  6. // the type of the initiating resource (for example an HTML element). The values are defined by the
  7. initiatorType?: string;
  8. }
  9. declare interface PerformanceEntry {
  10. // A DOMString representing the name of a performance entry when the metric was created.
  11. name: string;
  12. // A DOMString representing the type of performance metric such as "mark". See entryType for a list of valid values.
  13. entryType: string;
  14. // A DOMHighResTimeStamp representing the starting time for the performance metric.
  15. startTime: Date;
  16. // A DOMHighResTimeStamp representing the time value of the duration of the performance event.
  17. duration: Number;
  18. }
  19. declare interface Performance {
  20. mark(name: string);
  21. measure(name: string, startMark: string, endMark: string);
  22. getEntries();
  23. getEntries(performanceEntryFilterOptions: PerformanceEntryFilterOptions): PerformanceEntry[];
  24. getEntriesByType(entryType:string);
  25. }
  26. declare const performance: Performance;
  27. export = performance;