1.4.3 • Published 2 years ago
@types/gc-stats v1.4.3
Installation
npm install --save @types/gc-stats
Summary
This package contains type definitions for gc-stats (https://github.com/dainis/node-gcstats#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gc-stats.
index.d.ts
// Type definitions for gc-stats 1.4
// Project: https://github.com/dainis/node-gcstats#readme
// Definitions by: Vitor Fernandes <https://github.com/vfernandestoptal>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { EventEmitter } from "events";
declare namespace GCStats {
interface MemoryStatistics {
totalHeapSize: number;
totalHeapExecutableSize: number;
usedHeapSize: number;
heapSizeLimit: number;
totalPhysicalSize: number;
totalAvailableSize: number;
mallocedMemory?: number | undefined; // became available with node 7+
peakMallocedMemory?: number | undefined; // became available with node 7+
numberOfNativeContexts?: number | undefined; // became available with node 10+
numberOfDetachedContexts?: number | undefined; // became available with node 10+
}
interface GCStatistics {
startTime: number;
endTime: number;
pause: number;
pauseMS: number;
gctype: 1 | 2 | 4 | 8 | 15;
before: MemoryStatistics;
after: MemoryStatistics;
diff: MemoryStatistics;
}
type GCStatsListener = (stats: GCStatistics) => void;
interface GCStatsEventEmitter extends EventEmitter {
on(event: "stats", listener: GCStatsListener): this;
addListener(event: "stats", listener: GCStatsListener): this;
once(event: "stats", listener: GCStatsListener): this;
}
}
declare function GCStats(): GCStats.GCStatsEventEmitter;
export = GCStats;
Additional Details
- Last updated: Thu, 08 Jul 2021 12:02:01 GMT
- Dependencies: none
- Global values: none
Credits
These definitions were written by Vitor Fernandes.