-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add TypeScript definition #39
Conversation
I also reviewed sindresorhus/cli-cursor#4 to help. |
Sure. I'll open a PR to |
I've opened sindresorhus/cli-boxes#2. Once that is in I will revise this. |
I've updated this PR with the changes needed if the TS team fixes autocomplete, along with the other fixes you suggested. |
index.d.ts
Outdated
readonly bottomRight: string; | ||
readonly horizontal: string; | ||
readonly vertical: string; | ||
declare const enum BorderStyle { |
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 you export it instead of declaring it?
@@ -0,0 +1,141 @@ | |||
import cliBoxes, {BoxStyle} from 'cli-boxes'; |
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 you re-export the BoxStyle
type?
And also use this in the type tests instead of from cli-boxes
.
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.
This is basically what I was doing with CustomBorderStyle
. Should I remove it?
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.
Ah, sorry, missed that. No, just change the type test to use CustomBorderStyle
instead of BoxStyle
.
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.
And what about the TypeScript "bug"? It doesn't appear to be getting much traction. I can change it so that the values work with current tooling, maybe with a TODO referencing the issue.
Looks good. Thank you for your hard work on this :) |
Preparing to add typings to carden so I'll upstream first.