Open Sytten opened 4 years ago
Hey @Sytten, thanks for bringing this up and suggesting the fix! I have already added some comments there.
Hey @smusali , any update on this?
Like I said in the Pr I do not have the bandwidth nor the interest to do another revision of it. It is better that someone from logdna does it so it respects their standard.
Using the old require
syntax worked for me. But it would be nice to have the type definitions created
const LogdnaWinston = require('logdna-winston');
const logger = winston.createLogger({
level: 'info,
transports: [],
});
const options = {
key: '...',
app: '...'
};
logger.add(new LogdnaWinston(options));
I had to make my own types for this package, just create a logdna-winston.d.ts
on top level and copy paste this:
declare module 'logdna-winston' {
import TransportStream, { TransportStreamOptions } from 'winston-transport'
import { ConstructorOptions } from '@logdna/logger'
type LogDNATransportOptions =
Omit<ConstructorOptions, 'level'> &
TransportStreamOptions & {
key?: string
}
class LogDNATransport extends TransportStream {
constructor(options: LogDNATransportOptions)
}
export = LogDNATransport
}
Hi! I am using logdna in a typescript project, would it possible to create the
.d.ts
files to help us out there? Thanks!