Expose style names (#566)

Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
This commit is contained in:
LitoMore 2022-10-05 22:44:40 +08:00 committed by GitHub
parent 96f44c976b
commit d7d75717b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 0 deletions

5
source/index.d.ts vendored
View file

@ -284,4 +284,9 @@ export {
// } from '#supports-color';
} from './vendor/supports-color/index.js';
export const modifiers: readonly Modifiers[];
export const foregroundColors: readonly ForegroundColor[];
export const backgroundColors: readonly BackgroundColor[];
export const colors: readonly Color[];
export default chalk;

View file

@ -209,4 +209,9 @@ export {
stderrColor as supportsColorStderr,
};
export const modifiers = Object.keys(ansiStyles.modifier);
export const foregroundColors = Object.keys(ansiStyles.color);
export const backgroundColors = Object.keys(ansiStyles.bgColor);
export const colors = [...foregroundColors, ...backgroundColors];
export default chalk;