Skip to content
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

Merged
merged 10 commits into from
Feb 19, 2019
Merged

Conversation

MrTarantula
Copy link
Contributor

@MrTarantula MrTarantula commented Jan 16, 2019

Preparing to add typings to carden so I'll upstream first.

index.d.ts Outdated Show resolved Hide resolved
@MrTarantula MrTarantula mentioned this pull request Jan 16, 2019
@MrTarantula
Copy link
Contributor Author

I also reviewed sindresorhus/cli-cursor#4 to help.

index.d.ts Outdated Show resolved Hide resolved
@MrTarantula
Copy link
Contributor Author

Sure. I'll open a PR to cli-boxes.

index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
@MrTarantula
Copy link
Contributor Author

I've opened sindresorhus/cli-boxes#2. Once that is in I will revise this.

@MrTarantula
Copy link
Contributor Author

MrTarantula commented Feb 4, 2019

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 {
Copy link
Owner

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';
Copy link
Owner

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.

Copy link
Contributor Author

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?

Copy link
Owner

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.

Copy link
Contributor Author

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.

@sindresorhus sindresorhus merged commit dd85217 into sindresorhus:master Feb 19, 2019
@sindresorhus
Copy link
Owner

Looks good. Thank you for your hard work on this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants