/**
 * Flowtype definitions for v8cpuFormatter
 * Generated by Flowgen from a Typescript Definition
 * Flowgen v1.11.0
 * @flow
 */

import { CPUProfile } from "./chrome";

/**
 * This importer handles an old format used by the C++ API of V8. This format is still used by v8-profiler-node8.
 * There are two differences between the two formats:
 *   - Nodes are a tree in the old format and a flat array in the new format
 *   - Weights are timestamps in the old format and deltas in the new format.
 *
 * For more information, see https://github.com/hyj1991/v8-profiler-node8
 */
declare interface OldCPUProfileNode {
  functionName: string;
  lineNumber: number;
  scriptId: string;
  url: string;
  hitCount: number;
  bailoutReason: string;
  id: number;
  children: OldCPUProfileNode[];
}
export interface OldCPUProfile {
  startTime: number;
  endTime: number;
  head: OldCPUProfileNode;
  samples: number[];
  timestamps: number[];
}
/**
 * Convert the old tree-based format to the new flat-array based format
 */
declare export function chromeTreeToNodes(content: OldCPUProfile): CPUProfile;
declare export {};
