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

0.3.6 • Public • Published

Installation

npm install --save @types/memwatch-next

Summary

This package contains type definitions for memwatch-next (https://github.com/marcominetti/node-memwatch).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/memwatch-next.

index.d.ts

declare module "memwatch-next" {
    type EventCallback = (data: LeakInformation | StatsInformation | Object) => void;

    /**
     * Compare the state of your heap between two points in time, telling you what has been allocated, and what has been released.
     */
    export class HeapDiff {
        /**
         * Compute the diff.
         */
        end: () => void;
    }

    /**
     * Stats information.
     * @interface
     */
    export interface StatsInformation {
        current_base: number;
        estimated_base: number;
        heap_compactions: number;
        max: number;
        min: number;
        num_full_gc: number;
        num_inc_gc: number;
        usage_trend: number;
    }

    /**
     * Leak information.
     * @interface
     */
    export interface LeakInformation {
        /**
         * End date.
         */
        end: Date;

        /**
         * Growth.
         */
        growth: number;

        /**
         * Reason leak.
         */
        reason: string;

        /**
         * Start date.
         */
        start: Date;
    }

    /**
     * Subscribe to a event.
     * @param {string} eventName A event name.
     * @param {EventCallback} callback A callback;
     */
    export function on(eventName: string, callback: EventCallback): void;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by Cyril Schumacher.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/memwatch-next

Weekly Downloads

68

Version

0.3.6

License

MIT

Unpacked Size

5.22 kB

Total Files

5

Last publish

Collaborators

  • types