ZJONSSON / node-etl

npm install etl
232 stars 49 forks source link

Typescript typings #105

Open shayded-exe opened 4 years ago

shayded-exe commented 4 years ago

Would it be possible to get Typescript typings for this library?

I'll start making my own, but it probably won't be comprehensive.

ZJONSSON commented 4 years ago

Hey @PachowStudios that is a great idea, can you work towards a PR?

antonsamper commented 4 years ago

I'm happy to contribute. @PachowStudios Is it worth creating a set of very basic typings and merging that? The other can build on top.

Can you share what you have so far?

shayded-exe commented 4 years ago

I had forgotten about this. I don't have time to make a PR, but here's what I created previously:

declare module 'etl' {
  import { Transform } from 'stream';

  export type MapStream = Transform & {
    promise(): Promise<void>;
  };

  export function map(fn: (...args: any[]) => void | Promise<void>): MapStream;
}

I only needed the map function so it's all I bothered to type out.

gordonwho commented 5 months ago

Is this done? I am getting an error

Could not find a declaration file for module 'etl'. 'c:/dev/GitHub/Scheduling/node_modules/etl/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/etl` if it exists or add a new declaration (.d.ts) file containing `declare module 'etl';`ts(7016)