import CancelablePromise from './CancelablePromise.js'; import './Promise.js'; /** * Runs given callback async. * @param callback a function to execute async * @param delay the delay in msec * @param args the arguments pushed to the callback during execution. * @returns the execution promise * @example * ```ts * import async from "apprt-core/async"; * // a sum function * const sum = (x: number, y: number) => x + y; * // execute 3 + 4, 200msec later * const result = await async(sum, 200, 3, 4); * // result === 7 * assert.equal(result, 7); * ``` */ declare function async(callback: (...args: Args) => Result | PromiseLike, delay: number, ...args: Args): CancelablePromise; /** * Same as the first overload, but without a delay. */ declare function async(callback: (...args: Args) => Result | PromiseLike, ...args: Args): CancelablePromise; export { async, async as default };