dcl-catalyst-commons
Version:
Common tools and types to share between catalyst servers and clients
14 lines (13 loc) • 1.17 kB
TypeScript
import { CompleteRequestOptions, RequestOptions } from './FetcherConfiguration';
/** @deprecated migrate this function to your project */
export declare function delay(time: string): Promise<void>;
/** @deprecated migrate this function to your project */
export declare function retry<T>(execution: () => Promise<T>, attempts: number, waitTime?: string, failedAttemptCallback?: (attemptsLeft: number) => void): Promise<T>;
/** Add defaults to missing properties in the partial object */
export declare function applyDefaults<T, K = T | Partial<T>>(defaults: K, partial?: Partial<T>): K;
/** Add some defaults to missing properties in the partial object. This means that the object is not yet complete */
export declare function applySomeDefaults<T>(defaults: Partial<T>, partial?: Partial<T>): Partial<T>;
/** @deprecated migrate this function to your project
As headers field is Record<string, string> type, then when merging request Options
it's needed to merge the array instead of just applying the defaults. */
export declare function mergeRequestOptions<T = CompleteRequestOptions | RequestOptions>(target: T, source?: RequestOptions): T;