@types/gc-stats
TypeScript icon, indicating that this package has built-in type declarations

1.4.3 • Public • Published

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

/// <reference types="node" />

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: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Vitor Fernandes.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/gc-stats

Weekly Downloads

18,154

Version

1.4.3

License

MIT

Unpacked Size

5.33 kB

Total Files

5

Last publish

Collaborators

  • types