import { Logger } from '../../logger.js';
import { RuntimeCtx } from '../ctx.js';
import { Element } from '../element.js';
import { RetryOptions } from '../retry.js';
import { JsonSchema } from '../schema.js';
import { ReporterService, ResolverService } from '../services/index.js';
import { Context } from './context.js';
import { EntityList } from './list.js';
import { Module } from './module.js';
import { Pipe } from './pipe.js';
import { Pipeline } from './pipeline.js';
import { Unit } from './unit.js';
export interface ActionClass extends Module {
    $schema: JsonSchema;
    new (owner: ActionList): Action;
}
export type ActionOwner = Context | Action;
export declare abstract class Action extends Unit<ActionList> {
    static $schema: JsonSchema;
    id: string;
    label: string;
    notes: string;
    children: ActionList;
    $runtime: ActionRuntime;
    abstract exec(): Promise<void>;
    get $entityType(): string;
    get type(): string;
    get $index(): number;
    get $context(): Context;
    get $parent(): ActionOwner;
    get $reporter(): ReporterService;
    get $action(): Action;
    get $logger(): Logger;
    get $class(): ActionClass;
    get $key(): string;
    init(spec: any): void;
    hasChildren(): boolean;
    reset(): void;
    resetSubtree(): void;
    resetDescendants(): void;
    getLabel(): string;
    isLabelEditable(): boolean;
    validate<T>(value: T): T;
    isRunning(): boolean | 0 | null;
    isFinished(): number | null;
    getDuration(): number;
    getStatus(): ActionStatus;
    createCtx(): RuntimeCtx;
    resolveScope(): Promise<Element[]>;
    resolveChildrenScope(): Promise<Element[]>;
    run(): Promise<void>;
    afterRun(): void;
    protected _trackRuntimeStats(asyncFn: () => Promise<void>): Promise<void>;
    enter(): void;
    leave(): void;
    skip(): void;
    executeWithRetry<T>(asyncFn: () => Promise<T>, options?: RetryOptions): Promise<T>;
    retry<T>(asyncFn: () => Promise<T>, options?: RetryOptions): Promise<T>;
    selectSingle(pipeline: Pipeline, optional: boolean, ctx?: RuntimeCtx): Promise<Element | null>;
    selectOne(pipeline: Pipeline, ctx?: RuntimeCtx): Promise<Element>;
    selectAll(pipeline: Pipeline, ctx?: RuntimeCtx): Promise<Element[]>;
    getDepth(): number;
    descendentActions(): IterableIterator<Action>;
    descendentPipes(): IterableIterator<Pipe>;
    previousSiblings(): IterableIterator<Action>;
    nextSiblings(): IterableIterator<Action>;
    collectInputKeys(): Generator<any, void, unknown>;
    collectOutputKeys(): IterableIterator<string>;
    getUsedDefinitionIds(): string[];
    collectDefinitionIds(): IterableIterator<string>;
}
export declare class ActionList extends EntityList<ActionOwner, Action> {
    create(_spec: any): Action;
    get $entityType(): string;
    get $script(): import("./script.js").Script;
    get $context(): Context;
    get $logger(): Logger;
    get $idDatabase(): import("./script.js").Script;
    get $resolver(): ResolverService;
    protected coerceSpecType(type: string): string;
    resolveScope(): Promise<Element[]>;
}
export declare class MatcherList extends ActionList {
    protected coerceSpecType(_type: string): string;
}
export declare class DefinitionList extends ActionList {
    protected coerceSpecType(_type: string): string;
}
export declare class UnresolvedAction extends Action {
    static $type: string;
    static $icon: string;
    static $hidden: boolean;
    $originalSpec: any;
    init(spec?: any): void;
    toJSON(): any;
    exec(): Promise<void>;
}
export interface ActionRuntime {
    startedAt: number | null;
    finishedAt: number | null;
    error: Error | null;
    bypassed: boolean | null;
}
export interface ActionParamReference {
    actionId: string;
    paramName: string;
}
export type ActionStatus = 'idle' | 'running' | 'success' | 'fail';
//# sourceMappingURL=action.d.ts.map