Generics 如何为highlandjs键入提示流?

Generics 如何为highlandjs键入提示流?,generics,typescript,typescript-typings,highland.js,Generics,Typescript,Typescript Typings,Highland.js,我正在使用typescript@2和highlandjs图书馆。highland的键入缺少mergeWithLimit(n)功能。它: 获取流并将其值和错误合并到 单个新流,限制可以 任何时候都可以跑步 现在,这个方法还没有为它的应用提供类型提示。我试图添加它,但是只有一个接口流,而流流没有 然而,我如何为一个流创建一个接口呢?我尝试定义一个接口: interface Stream<Stream<R>> implements Stream<R> { m

我正在使用typescript@2和highlandjs图书馆。highland的键入缺少
mergeWithLimit(n)
功能。它:

获取流并将其值和错误合并到 单个新流,限制可以 任何时候都可以跑步

现在,这个方法还没有为它的应用提供类型提示。我试图添加它,但是只有一个
接口流
,而流流没有

然而,我如何为一个流创建一个接口呢?我尝试定义一个接口:

interface Stream<Stream<R>> implements Stream<R> {
    mergeWithLimit(n: number): Stream<R>;
}
interface StreamOfStreams<R> extends Stream<Stream<R>> {
    /**
     * Takes a Stream of Streams and merges their values and errors into a single new Stream,
     * limitting the number of unpaused streams that can running at any one time.
     *
     * @id mergeWithLimit
     * @section Streams
     * @name Stream.mergeWithLimit()
     * @api public
     */
    mergeWithLimit(n: number): Stream<R>;
}
接口流实现流{
mergeWithLimit(n:编号):流;
}
但它没有编译:

365     interface Stream<Stream<R>> implements Stream<R> {
                               ~

index.d.ts(365,28): error TS1005: ',' expected.


365     interface Stream<Stream<R>> implements Stream<R> {
                                  ~

index.d.ts(365,31): error TS1109: Expression expected.


365     interface Stream<Stream<R>> implements Stream<R> {
                                               ~~~~~~

index.d.ts(365,44): error TS1005: ';' expected.
365接口流实现流{
~
index.d.ts(365,28):错误TS1005:'预期为'。
365接口流实现流{
~
index.d.ts(365,31):错误TS1109:应为表达式。
365接口流实现流{
~~~~~~
index.d.ts(365,44):错误TS1005:“;”应为。

如何正确地输入提示
mergeWithLimit

我们通过定义一个接口来正确地管理输入提示:

interface Stream<Stream<R>> implements Stream<R> {
    mergeWithLimit(n: number): Stream<R>;
}
interface StreamOfStreams<R> extends Stream<Stream<R>> {
    /**
     * Takes a Stream of Streams and merges their values and errors into a single new Stream,
     * limitting the number of unpaused streams that can running at any one time.
     *
     * @id mergeWithLimit
     * @section Streams
     * @name Stream.mergeWithLimit()
     * @api public
     */
    mergeWithLimit(n: number): Stream<R>;
}