mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Added roslibjs definition
This commit is contained in:
parent
3fc1377ce2
commit
dc377a32e2
13
roslibjs/roslibjs-tests.ts
Normal file
13
roslibjs/roslibjs-tests.ts
Normal 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
24
roslibjs/roslibjs.d.ts
vendored
Normal 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
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user