'可观察<任何>'。 'NativeFs'类型中缺少属性'_isScalar'

时间:2017-10-18 12:18:58

标签: typescript

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

0 个答案:

没有答案