UNPKG

396 BTypeScriptView Raw
1import { CollectionProp, QueryParams } from '../common-types';
2declare type IterableFn<P = any, T = any> = (params: P) => Promise<CollectionProp<T>>;
3declare type ParamsType<T extends IterableFn> = T extends (params: infer P) => any ? P : never;
4export declare const asIterator: <P extends QueryParams, T, F extends IterableFn<P, T>>(fn: F, params: ParamsType<F>) => AsyncIterable<T>;
5export {};