Convert blink module to typescript

Change-type: patch
Signed-off-by: Cameron Diver <cameron@resin.io>
This commit is contained in:
Cameron Diver 2018-05-01 12:05:53 +01:00
parent c1fbc2dc21
commit 273224547c
No known key found for this signature in database
GPG Key ID: 69264F9C923F55C1
4 changed files with 24 additions and 2 deletions

View File

@ -41,6 +41,7 @@ RUN JOBS=MAX npm install --no-optional --unsafe-perm
COPY webpack.config.js fix-jsonstream.js hardcode-migrations.js tsconfig.json /usr/src/app/
COPY src /usr/src/app/src
COPY test /usr/src/app/test
COPY typings /usr/src/app/typings
RUN npm test \
&& npm run build

View File

@ -1,2 +0,0 @@
constants = require './constants'
module.exports = require('blinking')(constants.ledFile)

5
src/lib/blink.ts Normal file
View File

@ -0,0 +1,5 @@
import blinking = require('blinking');
import constants = require('./constants');
export = blinking(constants.ledFile);

18
typings/blinking.d.ts vendored Normal file
View File

@ -0,0 +1,18 @@
declare module 'blinking' {
interface Pattern {
blinks?: number;
onDuration?: number;
offDuration?: number;
pause?: number;
}
interface Blink {
start: (pattern: Pattern) => void
stop: () => void;
}
function blinking(ledFile: string): Blink;
export = blinking;
}