Skip to content
This repository was archived by the owner on Apr 21, 2022. It is now read-only.
This repository was archived by the owner on Apr 21, 2022. It is now read-only.

Typescript support #68

@tjoskar

Description

@tjoskar

Hi,

I'm using this module with typescript but since there is no typescript definition file I had to create my own:

declare module "logdna" {
  interface Options {
    app?: string,
    hostname?: string,
    env?: string,
    index_meta?: boolean,
    ip?: string,
    level?: 'Debug' | 'Trace' | 'Info' | 'Warn' | 'Error' | 'Fatal',
    mac?: string,
    max_length?: boolean,
    timeout?: number,
    with_credentials?: boolean
  }
  interface LogOptions extends Options {
    meta?: Object
  }
  export interface LogDna {
    log: (line: string, options?: LogOptions) => void;
  }

  export function createLogger(key: string, options?: Options): LogDna;
  export function flushAll(): void;
  export function cleanUpAll(): void;
}

Is this something you want to add in to this project?

This can easily be done by creating a new file in this project types.d.ts and then add types: "types.d.ts" in package.json.

I can create a PR if you want.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions