UNPKG

pddl-planning-service-client

Version:
38 lines (37 loc) 1.81 kB
import { planner, Plan, ProblemInfo, DomainInfo, parser } from 'pddl-workspace'; /** Abstract implementation of both sync/async planning service client. */ export declare abstract class PlannerService<I extends ServerRequest, O extends ServerResponse> extends planner.Planner { constructor(plannerUrl: string, plannerConfiguration: planner.PlannerRunConfiguration, providerConfiguration: planner.ProviderConfiguration); abstract createRequestBody(domainFileInfo: DomainInfo, problemFileInfo: ProblemInfo): Promise<I | null>; abstract createUrl(): string; abstract processServerResponseBody(origUrl: string, responseBody: O, planParser: parser.PddlPlannerOutputParser, parent: planner.PlannerResponseHandler): Promise<Plan[]>; plan(domainFileInfo: DomainInfo, problemFileInfo: ProblemInfo, planParser: parser.PddlPlannerOutputParser, parent: planner.PlannerResponseHandler): Promise<Plan[]>; /** Gets timeout in seconds. */ abstract getTimeout(): number; convertPlanSteps(planSteps: JsonPlanStep[], planParser: parser.PddlPlannerOutputParser): void; } export interface HttpConnectionError { message: string; /** Host name or IP address e.g. 127.0.0.1 */ address: string; code: string; errno: string; port: number; } export interface HttpConnectionRefusedError extends HttpConnectionError { } export declare function instanceOfHttpConnectionError(object: any): object is HttpConnectionError; export declare function instanceOfHttpConnectionRefusedError(object: any): object is HttpConnectionRefusedError; /** Server request body. */ export interface ServerRequest { } /** Server response body. */ export interface ServerResponse { } interface JsonPlanStep { /** Action name. */ name: string; time?: number; duration?: number; } export {};