-
Notifications
You must be signed in to change notification settings - Fork 124
/
onoff.d.ts
46 lines (33 loc) · 1.17 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
export type High = 1;
export type Low = 0;
export type Direction = "in" | "out" | "high" | "low";
export type Edge = "none" | "rising" | "falling" | "both";
export type Options = {
debounceTimeout?: number,
activeLow?: boolean,
reconfigureDirection?: boolean,
}
export type BinaryValue = High | Low;
export type ValueCallback = (err: Error | null | undefined, value: BinaryValue) => void;
export class Gpio {
static HIGH: High;
static LOW: Low;
static accessible: boolean;
constructor(gpio: number, direction: Direction, edge?: Edge, options?: Options);
read(callback: ValueCallback): void;
read(): Promise<BinaryValue>;
readSync(): BinaryValue;
write(value: BinaryValue, callback: (err: Error | null | undefined) => void): void;
write(value: BinaryValue): Promise<void>;
writeSync(value: BinaryValue): void;
watch(callback: ValueCallback): void;
unwatch(callback?: ValueCallback): void;
unwatchAll(): void;
direction(): Direction;
setDirection(direction: Direction): void;
edge(): Edge;
setEdge(edge: Edge): void;
activeLow(): boolean;
setActiveLow(invert: boolean): void;
unexport(): void
}