docs-ts icon indicating copy to clipboard operation
docs-ts copied to clipboard

ts-morph needs updating

Open adameier opened this issue 2 years ago • 0 comments

I've been trying to see how to update fp-ts-rxjs with the latest version of rxjs, however as has been noted before, the docs that are generated afterwards have the type any in place of the expected Observable. I have found that using a version of docs-ts with the latest ts-morph to generate the docs solves the issue.

When Observable is imported from rxjs@^7.0, a function such as the following

export const ap: <A>(fa: Observable<A>) => <B>(fab: Observable<(a: A) => B>) => Observable<B> = fa => fab =>
  combineLatest([fab, fa]).pipe(rxMap(([f, a]) => f(a)))

has its generated documented type set as

export declare const ap: <A>(fa: any) => <B>(fab: any) => any

When docs-ts uses the latest morph-ts, we get the correct result:

export declare const ap: <A>(fa: Observable<A>) => <B>(fab: Observable<(a: A) => B>) => Observable<B>

Note that the documentation is generated correctly with the latest release of docs-ts and rxjs@^6.0. I'm not too sure exactly what changes to ts-morph fix the issue or exactly how the bug is caused with the current version of docs-ts.

adameier avatar May 02 '22 15:05 adameier