rwsdk
Version:
Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime
25 lines (24 loc) • 1.06 kB
text/typescript
import { log } from "./constants.mjs";
export { log };
export declare function isRunningInCI(ciFlag?: boolean): boolean;
/**
* Handles test failure by logging the error and initiating teardown
*/
export declare function fail(error: unknown, exitCode?: number, step?: string): Promise<never>;
/**
* Handles resource teardown and exits the process with appropriate exit code
*/
export declare function teardown(): Promise<void>;
/**
* Formats the path suffix from a custom path
*/
export declare function formatPathSuffix(customPath?: string): string;
/**
* Wraps an async function with retry logic.
* @param fn The async function to execute.
* @param description A description of the operation for logging.
* @param beforeRetry A function to run before each retry attempt.
* @param maxRetries The maximum number of retries.
* @param delay The delay between retries in milliseconds.
*/
export declare function withRetries<T>(fn: () => Promise<T>, description: string, beforeRetry?: () => Promise<void>, maxRetries?: number, delay?: number): Promise<T>;