属性'提升'在类型中无法分配给基本类型中的同一属性。
我在 objection.d.ts
文件中遇到有关属性 lift
的错误,并且不确定如何纠正它。我正在使用RXJS版本5.0.1。
Error TS2416 (TS) Property 'lift' in type 'Subject<T>' is not assignable to the same property in base type 'Observable<T>'.
Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<R>'.
Type 'Observable<T>' is not assignable to type 'Observable<R>'.
Type 'T' is not assignable to type 'R'.
'R' could be instantiated with an arbitrary type which could be unrelated to 'T'.
/**
* @class Subject<T>
*/
export declare class Subject<T> extends Observable<T> implements ISubscription {
observers: Observer<T>[];
closed: boolean;
isStopped: boolean;
hasError: boolean;
thrownError: any;
constructor();
static create: Function;
lift<R>(operator: Operator<T, R>): Observable<T>;
next(value?: T): void;
error(err: any): void;
complete(): void;
unsubscribe(): void;
protected _subscribe(subscriber: Subscriber<T>): Subscription;
asObservable(): Observable<T>;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RXJS打字中的签名不正确,并得到在v5.4.2中: https://github.com/reactivex/ rxjs/pult/2722/files 。
因此,解决方案是为了更新为
代码>。
The signature in the RxJS's typings was incorrect and got fixed in v5.4.2: https://github.com/ReactiveX/rxjs/pull/2722/files.
The solution is therefore to update to
[email protected]
.