mirror of https://github.com/status-im/js-waku.git
feat: template type on store APIs
This commit is contained in:
parent
879734b780
commit
cc3b46ffbb
|
@ -106,7 +106,7 @@ export class WakuStore {
|
|||
*/
|
||||
async queryOrderedCallback<T extends Message>(
|
||||
decoders: Decoder<T>[],
|
||||
callback: (message: Message) => Promise<void | boolean> | boolean | void,
|
||||
callback: (message: T) => Promise<void | boolean> | boolean | void,
|
||||
options?: QueryOptions
|
||||
): Promise<void> {
|
||||
const abort = false;
|
||||
|
@ -156,7 +156,7 @@ export class WakuStore {
|
|||
async queryCallbackOnPromise<T extends Message>(
|
||||
decoders: Decoder<T>[],
|
||||
callback: (
|
||||
message: Promise<Message | undefined>
|
||||
message: Promise<T | undefined>
|
||||
) => Promise<void | boolean> | boolean | void,
|
||||
options?: QueryOptions
|
||||
): Promise<void> {
|
||||
|
@ -194,7 +194,7 @@ export class WakuStore {
|
|||
async *queryGenerator<T extends Message>(
|
||||
decoders: Decoder<T>[],
|
||||
options?: QueryOptions
|
||||
): AsyncGenerator<Promise<Message | undefined>[]> {
|
||||
): AsyncGenerator<Promise<T | undefined>[]> {
|
||||
let startTime, endTime;
|
||||
|
||||
if (options?.timeFilter) {
|
||||
|
@ -245,7 +245,7 @@ export class WakuStore {
|
|||
|
||||
if (!connection) throw "Failed to get a connection to the peer";
|
||||
|
||||
for await (const messages of paginate(
|
||||
for await (const messages of paginate<T>(
|
||||
connection,
|
||||
protocol,
|
||||
queryOpts,
|
||||
|
|
Loading…
Reference in New Issue