Valetudo/backend/lib/core/capabilities/MapSegmentationCapability.js

61 lines
1.5 KiB
JavaScript

const Capability = require("./Capability");
const NotImplementedError = require("../NotImplementedError");
/**
* @template {import("../ValetudoRobot")} T
* @extends Capability<T>
*/
class MapSegmentationCapability extends Capability {
/**
* @returns {Promise<Array<import("../../entities/core/ValetudoMapSegment")>>}
*/
async getSegments() {
return this.robot.state.map.getSegments();
}
/**
* Could be phrased as "cleanSegments" for vacuums or "mowSegments" for lawnmowers
*
*
* @param {Array<import("../../entities/core/ValetudoMapSegment")>} segments
* @param {object} [options]
* @param {number} [options.iterations]
* @param {boolean} [options.customOrder]
* @returns {Promise<void>}
*/
async executeSegmentAction(segments, options) {
throw new NotImplementedError();
}
/**
* @returns {MapSegmentationCapabilityProperties}
*/
getProperties() {
return {
iterationCount: {
min: 1,
max: 1
},
customOrderSupport: false
};
}
getType() {
return MapSegmentationCapability.TYPE;
}
}
MapSegmentationCapability.TYPE = "MapSegmentationCapability";
module.exports = MapSegmentationCapability;
/**
* @typedef {object} MapSegmentationCapabilityProperties
*
* @property {object} iterationCount
* @property {number} iterationCount.min
* @property {number} iterationCount.max
*
* @property {boolean} customOrderSupport
*/