mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-19 05:37:53 +00:00
Convert blink module to typescript
Change-type: patch Signed-off-by: Cameron Diver <cameron@resin.io>
This commit is contained in:
parent
c1fbc2dc21
commit
273224547c
@ -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
|
||||
|
@ -1,2 +0,0 @@
|
||||
constants = require './constants'
|
||||
module.exports = require('blinking')(constants.ledFile)
|
5
src/lib/blink.ts
Normal file
5
src/lib/blink.ts
Normal 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
18
typings/blinking.d.ts
vendored
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user