import { uvRun } from "./build/Release/binding.node"; export { uvRun }; /** * Run tasks in the event loop until the `pred` returns true. * * @param pred A function that returns boolean loop condition. */ export declare function loopWhile(pred: () => boolean): void; /** * Run micro tasks until the micro task queue has been exhausted, * then run a macro task (if any). */ export declare function runLoopOnce(): void; type Callback = (error: unknown, result: R) => void; type CallbackArgs = [...args: A, cb: Callback]; /** * A generic replacement of callback-style function type. */ type Fn = (this: T, ...args: CallbackArgs) => void; /** * Generic wrapper of async function with conventional API signature * `function (...args, (error, result) => {})`. * * Returns `result` and throws `error` as exception if not null. * * @param fn the original callback style function * @return the wrapped function */ export declare function deasync(fn: Fn): (this: T, ...args: A) => R; /** * Similar with the keyword `await` but synchronously. * * @param promise A Promise or any value to wait for * @return Returns the fulfilled value of the promise, or the value itself if it's not a Promise. */ export declare function awaitSync(promise: T): Awaited;