0.1.3 • Published 2 years ago

@types/glossy v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Installation

npm install --save @types/glossy

Summary

This package contains type definitions for glossy (https://github.com/squeeks/glossy).

Details

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

index.d.ts

// Type definitions for glossy 0.1
// Project: https://github.com/squeeks/glossy
// Definitions by: bmaupin <https://github.com/bmaupin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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

export interface ProduceOptions {
    facility?: string;
    severity?: string;
    host?: string;
    appName?: string;
    pid?: string | number;
    msgID?: string;
    type?: string;
}

export interface MessageOptions {
    facility?: string;
    severity?: string;
    prival?: number;
    host?: string;
    appName?: string;
    pid?: string | number;
    date?: Date;
    time?: Date;
    msgID?: string;
    structuredData?: unknown;
    message?: string;
}

export interface ProducerCallback {
    (compiledMessage: string): void;
}

export class Produce {
    constructor(options: ProduceOptions | string);

    alert(options: MessageOptions, callback?: ProducerCallback): string | void;

    crit(options: MessageOptions, callback?: ProducerCallback): string | void;

    debug(options: MessageOptions, callback?: ProducerCallback): string | void;

    emergency(options: MessageOptions, callback?: ProducerCallback): string | void;

    info(options: MessageOptions, callback?: ProducerCallback): string | void;

    notice(options: MessageOptions, callback?: ProducerCallback): string | void;

    produce(options: MessageOptions, callback?: ProducerCallback): string | void;

    warn(options: MessageOptions, callback?: ProducerCallback): string | void;
}

export interface ParserCallback {
    (parsedMessage: SyslogMessage): void;
}

export interface SyslogMessage {
    originalMessage: string;
    type: string;
    time: Date;
    message: string;
    host?: string | null;
    appName?: string | null;
    pid?: string | null;
    msgID?: string | null;
    structuredData?: unknown;
}

export namespace Parse {
    function parse(rawMessage: string | Buffer, callback?: ParserCallback): SyslogMessage | void;
}

Additional Details

  • Last updated: Tue, 26 Oct 2021 12:31:21 GMT
  • Dependencies: @types/node
  • Global values: none

Credits

These definitions were written by bmaupin.