Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types #18

Open
Sytten opened this issue May 5, 2020 · 5 comments · May be fixed by #19
Open

Add types #18

Sytten opened this issue May 5, 2020 · 5 comments · May be fixed by #19
Assignees
Labels
enhancement New feature or request

Comments

@Sytten
Copy link

Sytten commented May 5, 2020

Hi!
I am using logdna in a typescript project, would it possible to create the .d.ts files to help us out there?
Thanks!

@Sytten Sytten linked a pull request May 6, 2020 that will close this issue
@smusali smusali self-assigned this May 25, 2020
@smusali smusali added the enhancement New feature or request label May 25, 2020
@smusali
Copy link
Contributor

smusali commented May 25, 2020

Hey @Sytten, thanks for bringing this up and suggesting the fix! I have already added some comments there.

@saini-g
Copy link

saini-g commented Sep 1, 2020

Hey @smusali , any update on this?

@Sytten
Copy link
Author

Sytten commented Sep 1, 2020

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.

@saini-g
Copy link

saini-g commented Sep 8, 2020

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));

@aq1018
Copy link

aq1018 commented Jun 17, 2021

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants