type AnyFunc = (...args: any[]) => any; type Methods = { [P in keyof Scope as Scope[P] extends AnyFunc ? P : never]: Scope[P]; }; type MethodNames = string & keyof Methods; /** * Combination of {@link bind} and {@link async}. * Binds a method to a given scope and arguments and runs it async. * * @param scope the scope to bind the function to * @param name a function to execute async * @param delay the delay in msec * @param partials the arguments pushed to the callback during execution. * @returns the function which runs the cb async * @deprecated use apprt-core/async with plain functions instead * @example * ```ts * import bindAsync from "apprt-core/bindAsync"; * class Counter { * count = 0; * inc() { * return ++this.count; * } * } * const counter = new Counter(); * const asyncInc = bindAsync(counter, "inc"); * // execute counter.inc() async * const result = await asyncInc(); * // result === 1 * console.log(result)); * ``` */ declare function bindAsync, Partials extends any[]>(scope: Scope, name: MethodName, delay?: number, ...partials: Partials): (...args: any[]) => Promise; /** @deprecated use apprt-core/async with plain functions instead */ declare function bindAsync(scope: Scope, fn: (this: Scope, ...a: A) => R, delay?: number, ...args: Partials): (...a: any[]) => Promise; export { bindAsync, bindAsync as default };