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 ansi and bgAnsi to TypeScript declaration #369

Merged
merged 1 commit into from Nov 9, 2019

Conversation

pedrottimark
Copy link
Contributor

Here are remaining methods, after I researched the meaning of the argument:

  1. Add 2 type tests to index.test-d.ts which failed first
  2. Add 2 declarations to index.d.ts
  3. Add link and example to readme.md

Thank you very much for quick turn-around on #368 ❤️

@pedrottimark
Copy link
Contributor Author

What do y’all think about removing these 2 methods from chalk public interface?

Through research and discussion in #370 I see internal use of ansi to convert down to lower-level format, but it seems like SGR color code as argument is a limited use case for chalk callers:

  • first I jumped to assumption that argument is 4-bit unsigned color index, like 1 for red
  • then I jumped to assumption that at level 1 the argument could be any SGR code, like 1 for bold, but the close code does not match: default color not normal weight, or whatever else

@sindresorhus
Copy link
Member

@pedrottimark Can you move the above into a new issue? The Chalk v3 release is imminent, but we can discuss whether to remove them for the next major version.

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.

None yet

2 participants