diff --git a/firmata/index.d.ts b/firmata/index.d.ts index ab409921ef..6d4c7921c2 100644 --- a/firmata/index.d.ts +++ b/firmata/index.d.ts @@ -20,7 +20,6 @@ declare class Board extends NodeJS.EventEmitter constructor(serialPort: string, callback?: (error: any) => void) MODES: Board.PinModes; STEPPER: Board.StepperConstants; - // tslint:disable-next-line interface-name I2C_MODES: Board.I2cModes; SERIAL_MODES: Board.SerialModes; SERIAL_PORT_IDs: Board.SerialPortIds; @@ -147,6 +146,7 @@ declare namespace Board DIRECTION: { CCW: STEPPER_DIRECTION, CW: STEPPER_DIRECTION } } + // tslint:disable-next-line interface-name export interface I2cModes { WRITE: I2C_MODE, READ: I2C_MODE, CONTINUOUS_READ: I2C_MODE, STOP_READING: I2C_MODE diff --git a/firmata/readme.md b/firmata/readme.md index 32bb7df11f..77c8741dab 100644 --- a/firmata/readme.md +++ b/firmata/readme.md @@ -16,13 +16,9 @@ You will find that `const enums` are exported under the namespace `Board` for ea use with other libraries before any boards are actually instantiated. It's also important to note that if you want to extend the `Board` class in typescript, the -following will work (as long as you turn on `--noImplicitUseStrict` when compiling); here's -an example: +following will work: ```typescript -// store as script.ts and compile with `tsc --noImplicitUseStrict script.ts` -// then run `node script.js` - import * as Board from 'firmata' let portString = 'port string'; @@ -38,7 +34,7 @@ class MyBoard extends Board } } -let myBoard:MyBoard = new MyBoard(portString, () => +let myBoard: MyBoard = new MyBoard(portString, () => { console.log('extended board ready'); myBoard.Disconnect();