diff --git a/package.json b/package.json index d983798..350fbcd 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "main": "src/index.js", "module": "dist/index.js", "source": "src/index.js", + "types": "src/index.d.ts", "scripts": { "prebuild": "npm run lint", "build": "babel src --out-dir dist", diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 0000000..56a93fe --- /dev/null +++ b/src/index.d.ts @@ -0,0 +1,19 @@ +import { EventEmitter2 } from 'eventemitter2' +import ROSLIB from 'roslib' + +export class AutoRos extends EventEmitter2 { + + public ros: ROSLIB.Ros; + + constructor(options?: { + reconnectTimeOut?: number, + rosOptions?: { + encoding?: string, + } + }); + + connect(url: string): void; + +} + +export default AutoRos;