diff --git a/src/commondao/common.dao.ts b/src/commondao/common.dao.ts index dc79dd1..2cb21eb 100644 --- a/src/commondao/common.dao.ts +++ b/src/commondao/common.dao.ts @@ -484,7 +484,7 @@ export class CommonDao< async streamQueryAsDBMForEach( q: DBQuery, - mapper: AsyncMapper, + mapper: AsyncMapper, void>, opt: CommonDaoStreamForEachOptions = {}, ): Promise { q.table = opt.table || q.table @@ -515,7 +515,7 @@ export class CommonDao< errorMode: opt.errorMode, }, ), - transformMap(mapper, { + transformMap, void>(mapper, { ...opt, predicate: _passthroughPredicate, // to be able to logProgress }), @@ -535,7 +535,10 @@ export class CommonDao< /** * Stream as Readable, to be able to .pipe() it further with support of backpressure. */ - streamQueryAsDBM(q: DBQuery, opt: CommonDaoStreamOptions = {}): ReadableTyped { + streamQueryAsDBM( + q: DBQuery, + opt: CommonDaoStreamOptions = {}, + ): ReadableTyped> { q.table = opt.table || q.table opt.skipValidation = opt.skipValidation !== false // default true opt.skipConversion = opt.skipConversion !== false // default true diff --git a/src/query/dbQuery.ts b/src/query/dbQuery.ts index 53bd0a9..c6d5426 100644 --- a/src/query/dbQuery.ts +++ b/src/query/dbQuery.ts @@ -297,7 +297,7 @@ export class RunnableDBQuery< } async streamQueryAsDBMForEach( - mapper: AsyncMapper, + mapper: AsyncMapper, void>, opt?: CommonDaoStreamForEachOptions, ): Promise { await this.dao.streamQueryAsDBMForEach(this, mapper, opt) @@ -307,7 +307,7 @@ export class RunnableDBQuery< return this.dao.streamQuery(this, opt) } - streamQueryAsDBM(opt?: CommonDaoStreamOptions): ReadableTyped { + streamQueryAsDBM(opt?: CommonDaoStreamOptions): ReadableTyped> { return this.dao.streamQueryAsDBM(this, opt) }