mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
final lint fix and README update
This commit is contained in:
Vendored
+1
-1
@@ -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
|
||||
|
||||
+2
-6
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user