/**
 * Closure Hook Dispatcher
 *
 * Dispatches increment closure to external tool providers (GitHub, JIRA, ADO)
 * using the function-map pattern per ADR-0240.
 *
 * Design:
 * - Each provider is a function, not an adapter class
 * - Partial failures are isolated — one provider crashing doesn't block others
 * - incrementClosed is always true (closure is a local SpecWeave operation;
 *   external sync failures are non-blocking)
 * - Provider functions are injected for testability; production wiring
 *   lazy-imports plugin modules
 *
 * @module core/closure-dispatcher
 */
/**
 * Context passed to each provider close function.
 */
export interface ClosureContext {
    projectRoot: string;
    incrementId: string;
}
/**
 * Per-provider toggle config for closure hooks.
 */
export interface ClosureConfig {
    github: boolean;
    jira: boolean;
    ado: boolean;
}
/**
 * Result from a single provider close function.
 */
export interface ProviderCloseResult {
    closed: string[];
    provider: string;
}
/**
 * Signature for a provider close function.
 */
export type ProviderCloseFn = (context: ClosureContext) => Promise<ProviderCloseResult>;
/**
 * Failure detail for a single provider.
 */
export interface ClosureFailure {
    provider: string;
    error: string;
}
/**
 * Aggregate result from dispatching closure to all providers.
 */
export interface ClosureResult {
    /** Always true — increment closure is a local operation */
    incrementClosed: boolean;
    /** Providers that succeeded */
    successes: ProviderCloseResult[];
    /** Providers that failed (non-blocking) */
    failures: ClosureFailure[];
}
/**
 * Dispatch closure to all enabled providers.
 *
 * Each provider runs independently — failures are captured, not propagated.
 * The function-map pattern (ADR-0240) keeps this flat and simple:
 * no adapter interfaces, no orchestrator classes.
 *
 * @param context - Project root and increment ID
 * @param config - Per-provider enable/disable flags
 * @param closeFns - Map of provider name → close function (injected for testing)
 */
export declare function dispatchClosure(context: ClosureContext, config: ClosureConfig, closeFns: Record<string, ProviderCloseFn>): Promise<ClosureResult>;
/**
 * Build production close functions that lazy-import plugin modules.
 *
 * Called by SyncCoordinator to get the real provider functions.
 * Each function lazy-imports its plugin to avoid loading unused providers.
 */
export declare function buildProductionCloseFns(): Record<string, ProviderCloseFn>;
/**
 * Build closure config from SpecWeave hooks configuration.
 *
 * Reads the post_increment_done section and maps legacy flag names
 * to per-provider booleans. All default to true when not specified.
 */
export declare function buildClosureConfigFromHooks(hooks?: {
    post_increment_done?: {
        close_github_issue?: boolean;
        close_jira_issue?: boolean;
        close_ado_work_item?: boolean;
        close_external_issue?: boolean;
    };
}, syncSettings?: {
    canUpdateExternalItems?: boolean;
}): ClosureConfig;
//# sourceMappingURL=closure-dispatcher.d.ts.map