TomFrost / Bristol

Insanely configurable logging for Node.js
MIT License
113 stars 19 forks source link

TypeScript #59

Open brandonros opened 5 years ago

brandonros commented 5 years ago

Can you make a types/@bristol pull request or add a index.d.ts file to the repo and do an npm release please?

I have this I believe:

interface LogError {
  message?: string,
  reason?: any,
  stack?: any
}

interface LogData {
  code?: number,
  id?: string,
  path?: string,
  error?: LogError,
  data?: any
}

declare module 'bristol' {
  function addTarget(target: any, opts?: any) : any
  function withFormatter(formatter: string) : any
  function withLowestSeverity(severity: string): any
  function info(message: string, data: LogData) : any
  function warn(message: string, data: LogData) : any
  function error(message: string, data: LogData) : any
}