UNPKG

@shopify/cli-kit

Version:

A set of utilities, interfaces, and models that are common across all the platform features

24 lines (23 loc) 914 B
import { RestResponse } from './admin.js'; /** * Throttles a provided action, limiting the number of globally parallel requests, or by the last seen API limit * headers. * * @param request - A function performing a request. * @returns - The result of the request, once it eventually runs. */ export declare function throttle<T>(request: () => T): Promise<T>; /** * Keep track of the latest API call limit data from a response. * * @param response - The response object. */ export declare function updateApiCallLimitFromResponse(response: RestResponse): void; /** * Retries an operation after a delay specified in the response headers. * * @param response - The response object. * @param operation - The operation to retry. * @returns - The response of the operation. */ export declare function delayAwareRetry(response: RestResponse, operation: () => Promise<RestResponse>): Promise<RestResponse>;