type SignalFunc = (signal: AbortSignal) => void | Promise<void>;
type HaltFunc = (signal: AbortSignal, resume: AbortSignal) => void | Promise<void>;
/**
 * Manages a group of signals to create a unified signal that has the super lifecycle of all of them.
 */
export declare class CGroup {
    private shutdownCause;
    private controller?;
    private active;
    private tasks;
    private readonly halts;
    private resumeController?;
    private resumeStart?;
    /**
     * Adds a signal to this group.
     * Returns `true` if the signal was not already aborted and was added to the active set.
     */
    add(signal: AbortSignal): boolean;
    /**
     * Starts the group and returns its {@link AbortSignal}.
     * If no valid signals were added, this will be immediately aborted.
     */
    start(): AbortSignal;
    /**
     * Ensures the group has started, then waits until the group's signal is aborted.
     */
    wait(): Promise<void>;
    /**
     * Runs the given function as part of this group.
     * It will only start after `start()` has been called.
     * Any returned error will cancel the group's signal.
     */
    go(fn: SignalFunc): boolean;
    /**
     * Registers a function to run when the group is about to shut down.
     * It is passed the group's signal and a "resume" signal which is aborted if the group restarts.
     * Any returned error will cancel the group's signal.
     */
    halt(fn: HaltFunc): boolean;
    /**
     * Helper to execute a task and handle its potential error.
     */
    private runTask;
}
export {};
