mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
onoff: Provides its own types (#39487)
This commit is contained in:
committed by
Jesse Trinity
parent
4ef144a791
commit
a19d4fdcd3
@@ -2706,6 +2706,12 @@
|
||||
"sourceRepoURL": "https://github.com/sindresorhus/onetime",
|
||||
"asOfVersion": "4.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "onoff",
|
||||
"typingsPackageName": "onoff",
|
||||
"sourceRepoURL": "https://github.com/fivdi/onoff",
|
||||
"asOfVersion": "4.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Onsen UI",
|
||||
"typingsPackageName": "onsenui",
|
||||
|
||||
Vendored
-64
@@ -1,64 +0,0 @@
|
||||
// Type definitions for onoff v3.2
|
||||
// Project: https://github.com/fivdi/onoff
|
||||
// Definitions by: Marcel Ernst <https://github.com/marcel-ernst>
|
||||
// Kallu609 <https://github.com/Kallu609>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export = __ONOFF;
|
||||
|
||||
declare namespace __ONOFF {
|
||||
var version: string;
|
||||
|
||||
interface GpioOptions {
|
||||
debounceTimeout?: number;
|
||||
activeLow?: boolean;
|
||||
}
|
||||
|
||||
type Direction = 'in' | 'out' | 'high' | 'low';
|
||||
type Edge = 'none' | 'falling' | 'rising' | 'both';
|
||||
|
||||
class Gpio {
|
||||
constructor(gpio: number, direction: Direction, options?: GpioOptions);
|
||||
constructor(
|
||||
gpio: number,
|
||||
direction: Direction,
|
||||
edge?: Edge,
|
||||
options?: GpioOptions
|
||||
);
|
||||
|
||||
static accessible: boolean;
|
||||
|
||||
gpio: number;
|
||||
gpioPath: string;
|
||||
opts: GpioOptions;
|
||||
readBuffer: Buffer;
|
||||
listeners: Array<(err: 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: (err: Error, value: number) => void): void;
|
||||
unwatch(): void;
|
||||
unwatch(cb: (err: Error, value: number) => void): void;
|
||||
unwatchAll(): void;
|
||||
|
||||
direction(): Direction;
|
||||
setDirection(value: Direction): void;
|
||||
|
||||
edge(): Edge;
|
||||
setEdge(value: Edge): void;
|
||||
|
||||
activeLow(): boolean;
|
||||
setActiveLow(invert?: boolean): void;
|
||||
|
||||
options(): GpioOptions;
|
||||
|
||||
unexport(): void;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import * as onoff from 'onoff';
|
||||
|
||||
var led:onoff.Gpio = new onoff.Gpio(17, 'out');
|
||||
|
||||
var toggleLed = function():void {
|
||||
var lastState:number = led.readSync();
|
||||
led.writeSync(lastState ^ 1);
|
||||
};
|
||||
|
||||
var intervalId:NodeJS.Timer = setInterval(toggleLed, 100);
|
||||
|
||||
setTimeout(function() {
|
||||
clearInterval(intervalId);
|
||||
led.writeSync(0);
|
||||
led.unexport();
|
||||
}, 2000);
|
||||
|
||||
var accessible:boolean = onoff.Gpio.accessible;
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"onoff-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"npm-naming": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user