mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
compile errors gone
This commit is contained in:
Vendored
+131
-46
@@ -2,20 +2,19 @@
|
||||
// Project: https://github.com/firmata/firmata.js
|
||||
// Definitions by: Troy W. <https://github.com/troywweber7, https://bitbucket.org/troywweber/>
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare module 'firmata'
|
||||
{
|
||||
import * as SerialPort from 'serialport'
|
||||
import { EventEmitter } from 'events'
|
||||
|
||||
/**
|
||||
* Most of these are generated by observing https://github.com/firmata/firmata.js/blob/master/lib/firmata.js
|
||||
* items not exported are intentionally so, they exist only to inform intelligent completion and should not be exported
|
||||
* without good reasoning.
|
||||
* Most of these are generated by observing https://github.com/firmata/firmata.js/blob/master/lib/firmata.js.
|
||||
*
|
||||
* Also, this is a starting point that appeared to work fine for months within a project of my company, but I give no
|
||||
* This is a starting point that appeared to work fine for months within a project of my company, but I give no
|
||||
* guarantee that it cannot be improved.
|
||||
*/
|
||||
class Board extends EventEmitter
|
||||
class Board extends NodeJS.EventEmitter
|
||||
{
|
||||
constructor(serialPort:string, callback?:(error:any) => void)
|
||||
|
||||
@@ -35,66 +34,152 @@ declare module 'firmata'
|
||||
public settings:Board.ISettings;
|
||||
|
||||
public reportVersion(callback:() => void):void
|
||||
|
||||
public queryFirmware(callback:() => void):void
|
||||
|
||||
public analogRead(pin:number, callback:(value:number) => void):void
|
||||
|
||||
public analogWrite(pin:number, value:number):void
|
||||
|
||||
public pwmWrite(pin:number, value:number):void
|
||||
|
||||
public servoConfig(pin:number, min:number, max:number):void
|
||||
|
||||
public servoWrite(pin:number, value:number):void
|
||||
|
||||
public pinMode(pin:number, mode:Board.PIN_MODES):void
|
||||
|
||||
public digitalWrite(pin:number, val:Board.PIN_STATE):void
|
||||
|
||||
public digitalRead(pin:number, callback:(val:Board.PIN_STATE) => void):void
|
||||
|
||||
public queryCapabilities(callback:() => void):void
|
||||
|
||||
public queryAnalogMapping(callback:() => void):void
|
||||
|
||||
public queryPinState(pin:number, callback:() => void):void
|
||||
public sendString(str):void // TODO untested/incomplete --- TWW
|
||||
public sendI2CConfig(delay):void // TODO untested/incomplete --- TWW
|
||||
public i2cConfig(options):void // TODO untested/incomplete --- TWW
|
||||
public sendI2CWriteRequest(slaveAddress, bytes):void // TODO untested/incomplete --- TWW
|
||||
public i2cWrite(address, registerOrData, inBytes):void // TODO untested/incomplete --- TWW
|
||||
public i2cWriteReg(address, register, byte):void // TODO untested/incomplete --- TWW
|
||||
public sendI2CReadRequest(address, numBytes, callback):void // TODO untested/incomplete --- TWW
|
||||
public i2cRead(address, register, bytesToRead, callback):void // TODO untested/incomplete --- TWW
|
||||
public i2cStop(options):void // TODO untested/incomplete --- TWW
|
||||
public i2cReadOnce(address, register, bytesToRead, callback):void // TODO untested/incomplete --- TWW
|
||||
public sendOneWireConfig(pin, enableParasiticPower):void // TODO untested/incomplete --- TWW
|
||||
public sendOneWireSearch(pin, callback):void // TODO untested/incomplete --- TWW
|
||||
public sendOneWireAlarmsSearch(pin, callback):void // TODO untested/incomplete --- TWW
|
||||
public sendOneWireRead(pin, device, numBytesToRead, callback):void // TODO untested/incomplete --- TWW
|
||||
public sendOneWireReset(pin):void // TODO untested/incomplete --- TWW
|
||||
public sendOneWireWrite(pin, device, data):void // TODO untested/incomplete --- TWW
|
||||
public sendOneWireDelay(pin, delay):void // TODO untested/incomplete --- TWW
|
||||
public sendOneWireWriteAndRead(pin, device, data, numBytesToRead, callback):void // TODO untested/incomplete --- TWW
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendString(str:string):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendI2CConfig(delay:number):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public i2cConfig(options:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendI2CWriteRequest(slaveAddress:any, bytes:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public i2cWrite(address:any, registerOrData:any, inBytes:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public i2cWriteReg(address:any, register:any, byte:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendI2CReadRequest(address:any, numBytes:number, callback:() => void):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public i2cRead(address:any, register:any, bytesToRead:number, callback:() => void):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public i2cStop(options:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public i2cReadOnce(address:any, register:any, bytesToRead:number, callback:() => void):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendOneWireConfig(pin:number, enableParasiticPower:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendOneWireSearch(pin:number, callback:() => void):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendOneWireAlarmsSearch(pin:number, callback:() => void):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendOneWireRead(pin:number, device:any, numBytesToRead:any, callback:() => void):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendOneWireReset(pin:number):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendOneWireWrite(pin:number, device:any, data:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendOneWireDelay(pin:number, delay:number):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sendOneWireWriteAndRead(pin:number, device:any, data:any, numBytesToRead:any, callback:() => void):void
|
||||
|
||||
public setSamplingInterval(interval:number):void
|
||||
public getSamplingInterval():number // TODO untested/incomplete --- TWW
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public getSamplingInterval():number
|
||||
|
||||
public reportAnalogPin(pin:number, value:Board.REPORTING):void
|
||||
|
||||
public reportDigitalPin(pin:number, value:Board.REPORTING):void
|
||||
public pingRead(opts, callback):void // TODO untested/incomplete --- TWW
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public pingRead(opts:any, callback:() => void):void
|
||||
|
||||
public stepperConfig(deviceNum:number, type:number, stepsPerRev:number, dirOrMotor1Pin:number,
|
||||
stepOrMotor2Pin:number,
|
||||
motor3Pin?:number, motor4Pin?:number):void
|
||||
public stepperStep(deviceNum:number, direction:number, steps:number, speed:number, accel:number, decel:number,
|
||||
callback:(bool?:boolean) => void):void
|
||||
public serialConfig(options):void // TODO untested/incomplete --- TWW
|
||||
public serialWrite(portId, inBytes):void // TODO untested/incomplete --- TWW
|
||||
public serialRead(portId, maxBytesToRead, callback):void // TODO untested/incomplete --- TWW
|
||||
public serialStop(portId):void // TODO untested/incomplete --- TWW
|
||||
public serialClose(portId):void // TODO untested/incomplete --- TWW
|
||||
public serialFlush(portId):void // TODO untested/incomplete --- TWW
|
||||
public serialListen(portId):void // TODO untested/incomplete --- TWW
|
||||
public sysexResponse(commandByte, handler):void // TODO untested/incomplete --- TWW
|
||||
public sysexCommand(message):void // TODO untested/incomplete --- TWW
|
||||
stepOrMotor2Pin:number, motor3Pin?:number, motor4Pin?:number):void
|
||||
|
||||
public stepperStep(deviceNum:number, direction:Board.STEPPER_DIRECTIONS, steps:number, speed:number,
|
||||
accel:number, decel:number, callback:(bool?:boolean) => void):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public serialConfig(options:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public serialWrite(portId:any, inBytes:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public serialRead(portId:any, maxBytesToRead:any, callback:() => void):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public serialStop(portId:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public serialClose(portId:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public serialFlush(portId:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public serialListen(portId:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sysexResponse(commandByte:any, handler:any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public sysexCommand(message:any):void
|
||||
|
||||
public reset():void
|
||||
public static isAcceptablePort(port:Board.IPort):boolean // TODO untested/incomplete --- TWW
|
||||
public static requestPort(callback:(error:any, port:Board.IPort) => any):void // TODO untested/incomplete --- TWW
|
||||
public static encode(data:number[]):number[] // TODO untested/incomplete --- TWW
|
||||
public static decode(data:number[]):number[] // TODO untested/incomplete --- TWW
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public static isAcceptablePort(port:Board.IPort):boolean
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public static requestPort(callback:(error:any, port:Board.IPort) => any):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public static encode(data:number[]):number[]
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
public static decode(data:number[]):number[]
|
||||
|
||||
protected transport:SerialPort;
|
||||
|
||||
protected _sendOneWireSearch(type, event, pin, callback):void // TODO untested/incomplete --- TWW
|
||||
protected _sendOneWireRequest(pin, subcommand, device, numBytesToRead, correlationId, delay, dataToWrite, event,
|
||||
callback):void // TODO untested/incomplete --- TWW
|
||||
// TODO untested/incomplete --- TWW
|
||||
protected _sendOneWireSearch(type:any, event:any, pin:number, callback:() => void):void
|
||||
|
||||
// TODO untested/incomplete --- TWW
|
||||
protected _sendOneWireRequest(pin:number, subcommand:any, device:any, numBytesToRead:any, correlationId:any,
|
||||
delay:number, dataToWrite:any, event:any, callback:() => void):void
|
||||
}
|
||||
|
||||
namespace Board
|
||||
|
||||
Reference in New Issue
Block a user