5.0.6 • Published 2 years ago

@types/librato-node v5.0.6

Weekly downloads
1,079
License
MIT
Repository
github
Last release
2 years ago

Installation

npm install --save @types/librato-node

Summary

This package contains type definitions for librato-node (https://github.com/goodeggs/librato-node).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/librato-node.

index.d.ts

// Type definitions for librato-node 5.0
// Project: https://github.com/goodeggs/librato-node
// Definitions by: Jim Geurts <https://github.com/jgeurts>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

export interface CustomSource {
    source: string;
}

export interface LibratoRequestOptions {
    method?: string | undefined;
    uri?: string | undefined;
    headers?: { [index: string]: string } | undefined;
    maxAttempts?: number | undefined;
    retryDelay?: number | undefined;
    delayStrategy?: (() => number) | undefined;
    authorization?: string | undefined;
    'user-agent'?: string | undefined;
}

export interface LibratoConfig {
    email: string;
    token: string;
    prefix?: string | undefined;
    source?: string | undefined;
    requestOptions?: LibratoRequestOptions | undefined;
    period?: number | undefined;
    simulate?: false | undefined;
}

export interface LibratoSimulate {
    simulate: true;
}

export function configure(config: LibratoConfig | LibratoSimulate): void;
export function increment(name: string, value?: number, opts?: CustomSource): void;
export function measure(name: string, value: number, opts?: CustomSource): void;
export function timing(name: string, fn: (done: () => void) => void, cb: ((err?: Error | null) => void)): void;
export function timing(name: string, fn: (done: () => void) => void, opts?: CustomSource, cb?: ((err?: Error | null) => void)): void;
export function timing<T>(name: string, fn: (done: (err: Error | null | undefined, result: T) => T) => void, cb: ((err?: Error | null) => void)): T;
export function timing<T>(name: string, fn: (done: (err: Error | null | undefined, result: T) => T) => void, opts?: CustomSource, cb?: ((err?: Error | null) => void)): T;
export function start(): void;
export function stop(cb?: (err?: Error) => void): void;
export function flush(cb?: (err?: Error) => void): void;
export function middleware(config?: {
    requestCountKey?: string | undefined;
    responseTimeKey?: string | undefined;
    statusCodeKey?: string | undefined;
}): (req: object, res: object, next: () => void | Promise<void>) => void;

export function on(event: 'error', handler: (err: Error) => void): void;
export function on(event: 'SIGINT', handler: () => void): void;

Additional Details

  • Last updated: Thu, 08 Jul 2021 16:23:44 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Jim Geurts.

5.0.6

2 years ago

5.0.5

2 years ago

5.0.4

2 years ago

5.0.3

4 years ago

5.0.2

5 years ago

5.0.1

5 years ago

5.0.0

6 years ago