lucagrulla / node-tail

The zero dependency Node.js module for tailing a file
https://www.lucagrulla.com/node-tail/
MIT License
467 stars 76 forks source link

Support RxJS with TypeScript check #150

Closed QimatLuo closed 2 years ago

QimatLuo commented 2 years ago
import { fromEvent } from "rxjs";
import { Tail } from "tail";

const tail = new Tail("fileToTail");

fromEvent(tail, "line");

[tsserver 2769] [E] No overload matches this call. The last overload gave the following error. Argument of type 'Tail' is not assignable to parameter of type 'JQueryStyleEventEmitter<any, unknown> ArrayLike<JQueryStyleEventEmitter<any, unknown>>'. Property 'off' is missing in type 'Tail' but required in type 'JQueryStyleEventEmitter<any, unknown>'.

RxJS is a good library to handle async process. If this Tail library can fit the typing will be good.

lucagrulla commented 2 years ago

If the problem is type definitions, you might want to check out tail the DT type declaration:

https://definitelytyped.org/ https://www.npmjs.com/package/@types/tail

QimatLuo commented 2 years ago

Thanks for the info. I created the same issue there: https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/57956