rxjs / Subscription没有导出的成员“ ISubscription”

时间:2018-09-25 13:01:00

标签: angular rxjs

我正从5号角迁移到6号角。当我使npm run build时,我将其抛出以下错误:

  

ngc编译失败:ng-formly / core / src / components / formly.field.ts(10,10):错误TS2305:模块'“ C:/PrjNET/Elevation3/FW/4.00/Mainline/Framework/Development /Client/ElevationJS/ngcore/.tmp/node_modules/rxjs/Subscription“'没有导出的成员'Subscription'。

我有一个类似的错误:rxjs/Subscription has no exported member Subscription,我通过导入Subscription来解决:

import { Subscription } from "rxjs";

但是我不能对ISubscription做同样的事情。

任何人都知道如何导入ISubscription吗?

2 个答案:

答案 0 :(得分:5)

在RxJS v6中,from PyPDF2 import PdfFileReader, PdfFileWriter from PyPDF2.pdf import ContentStream from PyPDF2.generic import TextStringObject, NameObject from PyPDF2.utils import b_ source = PdfFileReader(open('some.pdf', "rb")) output = PdfFileWriter() for page_idx in range(0, 1): # Get the current page and it's contents page = source.getPage(page_idx) content_object = page["/Contents"].getObject() content = ContentStream(content_object, source) for operands, operator in content.operations: if operator == b_("BDC"): operands[1][NameObject('/Contents')] = TextStringObject('xyz') if operator == b_("Tj"): operands[0] = TextStringObject('xyz') output.addPage(page) # Write the stream outputStream = open("output.pdf", "wb") output.write(outputStream) outputStream.close() 重命名为ISubscription,因为这是Typescript自己的类型声明中使用的约定。

类似地,SubscriptionLike重命名为IScheduler

答案 1 :(得分:0)

我认为您不能直接使用ISubscription界面。如果您选中Subscription.d.ts,则该接口没有declare类型。我认为您必须使用Subscription,因为它正在实现ISubscription接口。