ai-planning-val
Version:
Javascript/typescript wrapper for VAL (AI Planning plan validation and evaluation tools from KCL Planning department and the planning community around the ICAPS conference).
24 lines (23 loc) • 911 B
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import { URL } from 'url';
export declare function getJson<T>(url: URL): Promise<T>;
export declare function getFile(url: URL, localFilePath: string): Promise<void>;
export declare function getText(url: URL, options?: {
expectedContentType?: RegExp;
}): Promise<string>;
/**
* Post JSON body and expects JSON response.
* @param url url to call
* @param content content to post
* @param headers headers to add
* @returns returned body
* @throws HttpStatusError if the status code >= 300
*/
export declare function postJson<O>(url: URL, content: unknown, headers?: NodeJS.Dict<string>): Promise<O>;
export declare class HttpStatusError extends Error {
readonly statusCode: number;
readonly statusMessage: string | undefined;
readonly url: URL;
constructor(statusCode: number, statusMessage: string | undefined, url: URL);
}