vscode hover'resent'可以显示错误:
[ts]
Argument of type 'NativeFs' is not assignable to parameter of type 'Observable<any>'.
Property '_isScalar' is missing in type 'NativeFs'.
这是源代码:
interface NativeFs {
<T>(...args: any[]): Rx.Observable<T>;
}
let readFile: NativeFs = Rx.Observable.bindNodeCallback(fs.readFile);
let exists: NativeFs = Rx.Observable.bindNodeCallback(fs.exists);
hierarchyPath$
.takeUntil(exists) // <- "exists" error
我进入了控制台:
src/entity/index.ts(27,14): error TS2345: Argument of type 'NativeFs' is not assignable to parameter of type 'Observable<any>'.
Property '_isScalar' is missing in type 'NativeFs'.
tsc版本信息:
tsc -v
Version 2.5.3