UNPKG

openblox

Version:

Roblox API Wrapper For Both Classic And OpenCloud APIs.

13 lines (12 loc) 878 B
import { ObjectPrettify } from "typeforge"; import type { CallApiMethod } from "../apis/apiGroup/apiGroup.types"; import { HttpHandlerProps, HttpResponse } from "../http/http.utils"; import { OpenbloxConfig } from "../config"; export type PollConfig = ObjectPrettify<{ iterations?: number; multiplyer?: number; retryOffset?: number; debug?: boolean; }>; export declare function pollMethod<MethodBase extends ReturnType<CallApiMethod<any, any, true | false>>, Method extends MethodBase | Awaited<MethodBase>>(method: Method, handlerFn: (result: Awaited<MethodBase>, stopPolling: () => void) => Promise<boolean | void>): Promise<Awaited<Method>>; export declare function pollHttp<Body extends any>(this: OpenbloxConfig | void, httpArgs: HttpHandlerProps, handlerFn: (result: HttpResponse<Body>, stopPolling: () => void) => Promise<boolean | void>): Promise<void>;