strongloop / modern-syslog

modern-syslog
Other
49 stars 19 forks source link

Provide .d.ts file for TypeScript #28

Closed fgm closed 5 years ago

fgm commented 6 years ago

Currently trying to convert my filog package using modern-syslog to TypeScript, and modern-syslog is the only dependency which doesn't either have builtin .d.ts files or an entry for @types/modern-syslog.

Either solution would help anyone trying to use modern-syslog with TypeScript.

fgm commented 6 years ago

I added a version which appears to work for me on https://github.com/fgm/modern-syslog/blob/28-typescript/modern-syslog.d.ts : would you be interesting in checking it out and possibly taking a PR ? Or should I submit it to https://github.com/DefinitelyTyped/DefinitelyTyped ?

sam-github commented 5 years ago

@rmg thoughts? I'm not keen to maintain mappings for a language I never use, but then again, the API is not likely to change, so there shouldn't be much maintenance.

rmg commented 5 years ago

I think it makes more sense to keep it in this repo.

rmg commented 5 years ago

@fgm if you're still willing to open a pull request for this based on the version you linked to, my first/only feedback on it would be that the exported Stream class/ctor is a stream.Writable, not a stream.Stream.

fgm commented 5 years ago

@rmg Thanks for answering. In the meantime, I received other feedback suggesting it might be better to submit it to DefinitelyTyped instead if the package is not supposed to be converted to TypeScript itself, which is unlikely since it is in C and not in JS. And it would avoid your having to care for a file you don't use.

rmg commented 5 years ago

I figured it would be easier to keep it in sync if it was in-repo, but in this case the API is highly unlikely to change much, if at all, so I suppose it doesn't really matter much.

sam-github commented 5 years ago

The exposed API is partly javascript, and I've no interest in rewriting it as ts.

Anyhow, if you provide one as @rmg suggests, I'll accept, if you put in definitely typed, that's OK too.

fgm commented 5 years ago

Thanks for your answers.