import { Console } from '@hackbg/logs'; /** A Promise that captures the stack at creation. */ export declare class Traced extends Promise { /** Captured stack at construction. Used for a more informative stack trace. */ stack: string; /** Create a promise and capture stack trace. */ constructor(...args: ConstructorParameters>); } /** A promise that can be resolved from outsid . */ export declare class Deferred extends Traced { /** Whether the promise was already resolved or rejected. */ completed: boolean; /** Resolve the promise. */ resolve: (result: X | PromiseLike) => void; /** Reject the promise. */ reject: (reason?: any) => void; /** Create a manually resolved promise. */ constructor(); /** Some magic CC BY-SA 4.0 https://stackoverflow.com/a/60328122 */ static get [Symbol.species](): PromiseConstructor; /** More magic */ get [Symbol.toStringTag](): string; } /** A lazily evaluated variant of Promise. */ export declare class Lazy extends Deferred { /** The function that is called to provide the value. */ resolver: () => X | PromiseLike; /** Whether the resolver has already been called. */ started: boolean; /** Create a lazily evaluated promise. */ constructor(resolver: () => X | PromiseLike); /** @returns Promise */ then(resolved?: ((result: X) => Y | PromiseLike) | null, rejected?: ((reason: any) => Z | PromiseLike) | null): Promise; get [Symbol.toStringTag](): string; /** Equivalent to Promise.all but also lazily evaluated. */ static all: (lazies: Promise[]) => Lazy; } export type TaskCallback = () => X | PromiseLike | Promise; /** Base class for class-based deploy procedure. Adds progress logging. */ export declare class Task extends Lazy { log: Console; name?: string; cb?: TaskCallback; context?: C; constructor(name: string, cb: TaskCallback, context?: C); constructor(cb: TaskCallback, context?: C); get [Symbol.toStringTag](): string; /** Define a subtask * @returns A Lazy or Promise containing a task. */ task(name: string, cb: (this: Task) => Promise): Task, T>; static get [Symbol.species](): PromiseConstructor; } //# sourceMappingURL=task.d.ts.map