Added roslibjs definition

This commit is contained in:
Stefan Profanter 2015-10-09 18:10:26 +02:00
parent 3fc1377ce2
commit dc377a32e2
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,13 @@
/// <reference path="roslibjs.d.ts" />
var ros = new ROSLIB.Ros({url: "http://localhost:9090"});
ros.on('error', function(event) {
//do nothing
});
var service = new ROSLIB.Service({
ros: ros,
name: '/service_name',
serviceType: 'service_type'
});

24
roslibjs/roslibjs.d.ts vendored Normal file
View File

@ -0,0 +1,24 @@
// Type definitions for roslib.js
// Project: http://wiki.ros.org/roslibjs
// Definitions by: Stefan Profanter <https://github.com/Pro/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module ROSLIB {
export class Ros {
constructor(data: {
url: string
});
on(eventName: string, callback: (event: any) => void);
connect(url: string);
}
export class Service {
constructor(data: {
ros: Ros,
name: string,
serviceType: string
});
}
}