UNPKG

@olakai/sdk

Version:

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

13 lines 940 B
import type { MonitorOptions } from "./types"; /** * Monitor a function and send the data to the Olakai API * Always returns an async function, but can monitor both sync and async functions * @param options - The options for the monitored function * @param fn - The function to monitor (sync or async) * @returns The monitored async function * @throws {OlakaiBlockedError} if the function is blocked by Olakai's Control API * @throws {Error} throw the original function's error if the function fails */ export declare function monitor<TArgs extends any[], TResult>(options: MonitorOptions<TArgs, TResult>): (fn: (...args: TArgs) => TResult | Promise<TResult>) => (...args: TArgs) => Promise<TResult>; export declare function monitor<TArgs extends any[], TResult>(fn: (...args: TArgs) => TResult | Promise<TResult>, options: MonitorOptions<TArgs, TResult>): (...args: TArgs) => Promise<TResult>; //# sourceMappingURL=monitor.d.ts.map