import { WorldState, type GOAPStateShape } from "./GOAP";
export type HTNTaskResult = "success" | "running" | "failure";
export type HTNTaskType = "primitive" | "compound";
export interface HTNTaskMethod {
    readonly name: string;
    readonly preconditions?: GOAPStateShape;
    readonly subtasks: readonly HTNTask[];
    readonly priority?: number;
    readonly check?: (state: WorldState, context: unknown) => boolean;
}
export interface HTNPrimitiveTaskOptions {
    readonly name: string;
    readonly preconditions?: GOAPStateShape;
    readonly effects?: GOAPStateShape;
    readonly execute?: (state: WorldState, context: unknown) => HTNTaskResult;
}
export interface HTNCompoundTaskOptions {
    readonly name: string;
    readonly methods?: readonly HTNTaskMethod[];
}
export interface HTNPlannerOptions {
    readonly maxDepth?: number;
    readonly maxIterations?: number;
}
export interface HTNPlan {
    readonly valid: boolean;
    readonly rootTask: string;
    readonly tasks: readonly string[];
    readonly methodTrace: readonly string[];
    readonly decompositions: number;
    readonly maxDepthReached: number;
    readonly iterations: number;
    readonly finalState: GOAPStateShape;
}
export declare class HTNTask {
    readonly name: string;
    readonly type: HTNTaskType;
    readonly preconditions: GOAPStateShape;
    readonly effects: GOAPStateShape;
    private readonly methods;
    private readonly executeCallback?;
    private constructor();
    static primitive(options: HTNPrimitiveTaskOptions): HTNTask;
    static compound(options: HTNCompoundTaskOptions): HTNTask;
    getMethods(): readonly HTNTaskMethod[];
    canRun(state: WorldState): boolean;
    applyEffects(state: WorldState): WorldState;
    execute(state: WorldState, context: unknown): HTNTaskResult;
}
export declare class HTNPlanner {
    private readonly maxDepth;
    private readonly maxIterations;
    constructor(options?: HTNPlannerOptions);
    plan(rootTask: HTNTask, initialState: WorldState, context?: unknown): HTNPlan;
    isPlanValid(plan: HTNPlan, rootTask: HTNTask, initialState: WorldState, context?: unknown): boolean;
    private decompose;
}
//# sourceMappingURL=HTN.d.ts.map