-
Notifications
You must be signed in to change notification settings - Fork 15
Added type definitions #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| declare module 'lcd' { | ||
| import { EventEmitter } from 'events'; | ||
| export default class Lcd extends EventEmitter { | ||
| constructor(args: { | ||
| rs: number, | ||
| e: number, | ||
| data: [number, number, number, number], | ||
| cols: number, | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| rows: number, | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The constructor supports an optional |
||
|
|
||
| print(val: any, cb?: (err: Error, str: string) => void): void; | ||
|
|
||
| clear(cb?: (err: Error) => void): void; | ||
|
|
||
| home(cb?: (err: Error) => void): void; | ||
|
|
||
| setCursor(col: number, row: number): void; | ||
|
|
||
| cursor(): void; | ||
|
|
||
| noCursor(): void; | ||
|
|
||
| blink(): void; | ||
|
|
||
| noBlink(): void; | ||
|
|
||
| scrollDisplayLeft(): void; | ||
|
|
||
| scrollDisplayRight(): void; | ||
|
|
||
| leftToRight(): void; | ||
|
|
||
| rightToLeft(): void; | ||
|
|
||
| autoscroll(): void; | ||
|
|
||
| noAutoscroll(): void; | ||
|
|
||
| close(): void; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| "version": "2.0.5", | ||
| "description": "Hitachi HD44780 LCD driver", | ||
| "main": "lcd.js", | ||
| "types": "lcd.d.ts", | ||
| "directories": { | ||
| "example": "example", | ||
| "test": "test" | ||
|
|
@@ -23,6 +24,7 @@ | |
| "mutexify": "^1.2.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^11.12.1", | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What purpose does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you are using node core libraries in a Typescript project you need Really an npm module with pretensions of taking its place in the modern node ecosystem should have typings as a matter of course.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. this looks good. |
||
| "async": "^2.6.2", | ||
| "jshint": "^2.10.2" | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can
argsbe renamed toconfigso that the naming is the same as the corresponding JavaScript code?