UNPKG

385 BTypeScriptView Raw
1import type { CollectionProp, QueryParams } from '../common-types';
2type IterableFn<P = any, T = any> = (params: P) => Promise<CollectionProp<T>>;
3type 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 {};