UNPKG

@olakai/sdk

Version:

This document demonstrates how to use the Olakai SDK with all its features.

21 lines 963 B
import { Middleware } from "./index"; /** * Create a timeout middleware * This middleware sets a timeout for a function call. * @param _timeoutMs - The timeout in milliseconds * @returns A middleware function */ export declare function createTimeoutMiddleware<TArgs extends any[], TResult>(_timeoutMs: number): Middleware<TArgs, TResult>; /** * Create a validation middleware * This middleware validates the arguments and result of a function call. * @param options - The options for the middleware * @param options.validateArgs - The function to validate the arguments * @param options.validateResult - The function to validate the result * @returns A middleware function */ export declare function createValidationMiddleware<TArgs extends any[], TResult>(options: { validateArgs?: (args: TArgs) => boolean | string; validateResult?: (result: TResult) => boolean | string; }): Middleware<TArgs, TResult>; //# sourceMappingURL=timeout.d.ts.map