forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
onoff.d.ts
55 lines (40 loc) · 1.43 KB
/
onoff.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Type definitions for onoff
// Project: https://github.com/fivdi/onoff
// Definitions by: Marcel Ernst <https://github.com/marcel-ernst>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare namespace __ONOFF {
var version:string;
interface GpioOptions {
debounceTimeout:number;
}
class Gpio {
constructor(gpio:number, direction:string);
constructor(gpio:number, direction:string, edge:string);
constructor(gpio:number, direction:string, edge:string, options:GpioOptions);
constructor(gpio:number, direction:string, options:GpioOptions);
gpio:number
gpioPath:string;
opts:GpioOptions;
readBuffer:Buffer;
listeners:Array<(error:Error, value:number) => void>;
valueFd:number;
read(cb:(err:Error, value:number) => void):void;
readSync():number;
write(value:number, cb:(err:Error, value:number) => void):void;
writeSync(value:number):void;
watch(cb:(error:Error, value:number) => void):void;
unwatch():void;
unwatch(cb:(error:Error, value:number) => void):void;
unwatchAll():void;
direction():string;
setDirection(value:string):void;
edge():string;
setEdge(value:string):void;
options():GpioOptions;
unexport():void;
}
}
declare module "onoff" {
export = __ONOFF;
}