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

0.2.3 • Public • Published

Installation

npm install --save @types/lynx

Summary

This package contains type definitions for lynx (https://github.com/dscape/lynx).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lynx.

index.d.ts

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

import { Socket } from "node:dgram";
import { Transform } from "node:stream";
type HRTime = [number, number];
interface LynxOptions {
    socket?: Socket;
    on_error?: (e: Error) => void;
    scope?: string;
}

interface Timer {
    stat: string;
    sample_rate: number;
    start_time: HRTime;
    stop(): void;
}

interface Stats {
    [stat: string]: string;
}

declare class Lynx extends Transform {
    constructor(host?: string, port?: number, options?: LynxOptions);

    createTimer(stat: string, sample_rate?: number): Timer;
    increment(stats: string | string[], sample_rate?: number): void;
    decrement(stats: string | string[], sample_rate?: number): void;
    count(stats: string | string[], delta: number, sample_rate?: number): void;
    timing(stat: string, duration: number, sample_rate?: number): void;
    set(stat: string, value: number, sample_rate?: number): void;
    gauge(stat: string, value: number, sample_rate?: number): void;
    send(stats: Stats, sample_rate?: number): void;
    close(): void;
}

export = Lynx;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/node

Credits

These definitions were written by floy.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/lynx

Weekly Downloads

278

Version

0.2.3

License

MIT

Unpacked Size

4.72 kB

Total Files

5

Last publish

Collaborators

  • types