import ServiceRequest from "./ServiceRequest.js"; import ServiceResponse from "./ServiceResponse.js"; import Ros from "./Ros.js"; import EventEmitter2 from "eventemitter2"; declare type ServiceHandler = (message: ServiceRequest, response: ServiceResponse) => boolean; /** * A ROS service client. * * @constructor * @params options - possible keys include: * * ros - the ROSLIB.Ros connection handle * * name - the service name, like /add_two_ints * * serviceType - the service type, like 'rospy_tutorials/AddTwoInts' */ declare class Service extends EventEmitter2 { ros: Ros; name: string; serviceType: string; isAdvertised: boolean; _serviceCallback: ServiceHandler; constructor(options?: { ros?: Ros; name?: string; serviceType?: string; }); callService(request?: ServiceRequest): Promise; /** * Advertise the service. This turns the Service object from a client * into a server. The callback will be called with every request * that's made on this service. * * @param callback - This works similarly to the callback for a C++ service and should take the following params: * * request - the service request * * response - an empty dictionary. Take care not to overwrite this. Instead, only modify the values within. * It should return true if the service has finished successfully, * i.e. without any fatal errors. */ advertise(callback: ServiceHandler): void; unadvertise(): void; _serviceResponse(rosbridgeRequest: any): void; } export default Service; //# sourceMappingURL=Service.d.ts.map