import type * as Protocol from '../../generated/protocol.js'; import type * as Platform from '../platform/platform.js'; import { type DebuggerModel } from './DebuggerModel.js'; import { type RemoteObject } from './RemoteObject.js'; import { RuntimeModel } from './RuntimeModel.js'; import { type Target } from './Target.js'; import { SDKModel } from './SDKModel.js'; export declare class HeapProfilerModel extends SDKModel { #private; constructor(target: Target); debuggerModel(): DebuggerModel; runtimeModel(): RuntimeModel; enable(): Promise; startSampling(samplingRateInBytes?: number): Promise; stopSampling(): Promise; getSamplingProfile(): Promise; collectGarbage(): Promise; snapshotObjectIdForObjectId(objectId: Protocol.Runtime.RemoteObjectId): Promise; objectForSnapshotObjectId(snapshotObjectId: Protocol.HeapProfiler.HeapSnapshotObjectId, objectGroupName: string): Promise; addInspectedHeapObject(snapshotObjectId: Protocol.HeapProfiler.HeapSnapshotObjectId): Promise; takeHeapSnapshot(heapSnapshotOptions: Protocol.HeapProfiler.TakeHeapSnapshotRequest): Promise; startTrackingHeapObjects(recordAllocationStacks: boolean): Promise; stopTrackingHeapObjects(reportProgress: boolean): Promise; heapStatsUpdate(samples: number[]): void; lastSeenObjectId(lastSeenObjectId: number, timestamp: number): void; addHeapSnapshotChunk(chunk: string): void; reportHeapSnapshotProgress(done: number, total: number, finished?: boolean): void; resetProfiles(): void; } export declare enum Events { HeapStatsUpdate = "HeapStatsUpdate", LastSeenObjectId = "LastSeenObjectId", AddHeapSnapshotChunk = "AddHeapSnapshotChunk", ReportHeapSnapshotProgress = "ReportHeapSnapshotProgress", ResetProfiles = "ResetProfiles" } /** * An array of triplets. Each triplet describes a fragment. The first number is the fragment * index, the second number is a total count of objects for the fragment, the third number is * a total size of the objects for the fragment. */ export type HeapStatsUpdateSamples = number[]; export interface LastSeenObjectId { lastSeenObjectId: number; timestamp: number; } export interface HeapSnapshotProgress { done: number; total: number; finished?: boolean; } export type EventTypes = { [Events.HeapStatsUpdate]: HeapStatsUpdateSamples; [Events.LastSeenObjectId]: LastSeenObjectId; [Events.AddHeapSnapshotChunk]: string; [Events.ReportHeapSnapshotProgress]: HeapSnapshotProgress; [Events.ResetProfiles]: HeapProfilerModel; }; export interface NativeProfilerCallFrame { functionName: string; url: Platform.DevToolsPath.UrlString; scriptId?: string; lineNumber?: number; columnNumber?: number; } export interface CommonHeapProfileNode { callFrame: NativeProfilerCallFrame; selfSize: number; id?: number; children: CommonHeapProfileNode[]; } export interface CommonHeapProfile { head: CommonHeapProfileNode; modules: Protocol.Memory.Module[]; }