@geoapify/route-planner-sdk
Version:
TypeScript SDK for the Geoapify Route Planner API. Supports route optimization, delivery planning, and timeline visualization in browser and Node.js
58 lines (57 loc) • 2.83 kB
TypeScript
import { RoutePlannerResult } from "./models/entities/route-planner-result";
import { Job, Shipment } from "./models";
export declare class RoutePlannerResultEditor {
private readonly result;
constructor(result: RoutePlannerResult);
/**
* Assigns a job to an agent. Removes the job if it's currently assigned to another agent
* @param agentIdOrIndex - The index/id of the agent.
* @param jobIndexesOrIds - Indexes/ids of the jobs.
* @param newPriority - The new priority of the job.
* @returns {boolean} - Returns true if the job was successfully assigned.
*/
assignJobs(agentIdOrIndex: string | number, jobIndexesOrIds: number[] | string[], newPriority?: number): Promise<boolean>;
/**
* Assigns a shipment to an agent. Removes the shipment if it's currently assigned to another agent
* @param shipmentIndexesOrIds - The indexes/ids of the shipments.
* @param agentIdOrIndex - The index/id of the agent.
* @param newPriority - The new priority of the shipment.
* @returns {boolean} - Returns true if the shipment was successfully assigned.
*/
assignShipments(agentIdOrIndex: string | number, shipmentIndexesOrIds: number[] | string[], newPriority?: number): Promise<boolean>;
/**
* Removes a job from the plan.
* @param jobIndexesOrIds - The indexes/ids of the jobs to remove.
* @returns {boolean} - Returns true if the job was successfully removed.
*/
removeJobs(jobIndexesOrIds: number[] | string[]): Promise<boolean>;
/**
* Removes a shipment from the plan.
* @param shipmentIndexesOrIds - The indexes/ids of the shipments to remove.
* @returns {boolean} - Returns true if the shipment was successfully removed.
*/
removeShipments(shipmentIndexesOrIds: number[] | string[]): Promise<boolean>;
/**
* Adds new jobs to an agent's schedule.
* @param jobs - An array of job objects to be added.
* @param agentIdOrIndex - The index/id of the agent.
* @returns {boolean} - Returns true if jobs were successfully added.
*/
addNewJobs(agentIdOrIndex: string | number, jobs: Job[]): Promise<boolean>;
/**
* Adds new shipments to an agent's schedule.
* @param shipments - An array of shipment objects to be added.
* @param agentIdOrIndex - The index/id of the agent.
* @returns {boolean} - Returns true if shipments were successfully added.
*/
addNewShipments(agentIdOrIndex: string | number, shipments: Shipment[]): Promise<boolean>;
/**
* Returns the modified result.
* @returns {RoutePlannerResult} - The modified result object.
*/
getModifiedResult(): RoutePlannerResult;
private assertArray;
private convertJobsToIndexes;
private convertShipmentsToIndexes;
private convertAgentToIndex;
}