inspector.d.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import type { Container, SliceType } from '../context';
  2. import type { Clock, TimerStatus, TimerType } from '../timer';
  3. import type { Meta } from './meta';
  4. export interface Telemetry {
  5. metadata: Meta;
  6. injectedSlices: {
  7. name: string;
  8. value: unknown;
  9. }[];
  10. consumedSlices: {
  11. name: string;
  12. value: unknown;
  13. }[];
  14. recordedTimers: {
  15. name: string;
  16. duration: number;
  17. status: TimerStatus;
  18. }[];
  19. waitTimers: {
  20. name: string;
  21. duration: number;
  22. status: TimerStatus;
  23. }[];
  24. }
  25. export declare class Inspector {
  26. #private;
  27. constructor(container: Container, clock: Clock, meta: Meta);
  28. read: () => Telemetry;
  29. readonly onRecord: (timerType: TimerType) => void;
  30. readonly onClear: (timerType: TimerType) => void;
  31. readonly onDone: (timerType: TimerType) => void;
  32. readonly onWait: (timerType: TimerType, promise: Promise<void>) => void;
  33. readonly onInject: (sliceType: SliceType | string) => void;
  34. readonly onRemove: (sliceType: SliceType | string) => void;
  35. readonly onUse: (sliceType: SliceType | string) => void;
  36. }
  37. //# sourceMappingURL=inspector.d.ts.map