neura-sdk
Version:
TypeScript SDK for interacting with the Neura AI API
39 lines (33 loc) • 834 B
TypeScript
declare module 'p-retry' {
interface Options {
retries?: number;
factor?: number;
minTimeout?: number;
maxTimeout?: number;
randomize?: boolean;
onFailedAttempt?: (error: {
attemptNumber: number;
retriesLeft: number;
message: string;
}) => void | Promise<void>;
}
function pRetry<T>(
input: (attemptCount: number) => PromiseLike<T> | T,
options?: Options
): Promise<T>;
export = pRetry;
}
declare module 'p-throttle' {
interface Options {
limit: number;
interval: number;
}
interface ThrottledFunction<T extends (...args: any[]) => any> {
(...args: Parameters<T>): ReturnType<T>;
abort: () => void;
}
function pThrottle(options: Options): <T extends (...args: any[]) => any>(
fn: T
) => ThrottledFunction<T>;
export = pThrottle;
}