Sync code
This commit is contained in:
parent
ef53fde412
commit
79e9185fd6
5 changed files with 80 additions and 53 deletions
48
source/vendor/ansi-styles/index.d.ts
vendored
48
source/vendor/ansi-styles/index.d.ts
vendored
|
|
@ -180,6 +180,49 @@ export interface ConvertColor {
|
|||
hexToAnsi(hex: string): number;
|
||||
}
|
||||
|
||||
/**
|
||||
Basic modifier names.
|
||||
*/
|
||||
export type ModifierName = keyof Modifier;
|
||||
|
||||
/**
|
||||
Basic foreground color names.
|
||||
[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support)
|
||||
*/
|
||||
export type ForegroundColorName = keyof ForegroundColor;
|
||||
|
||||
/**
|
||||
Basic background color names.
|
||||
[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support)
|
||||
*/
|
||||
export type BackgroundColorName = keyof BackgroundColor;
|
||||
|
||||
/**
|
||||
Basic color names. The combination of foreground and background color names.
|
||||
[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support)
|
||||
*/
|
||||
export type ColorName = ForegroundColorName | BackgroundColorName;
|
||||
|
||||
/**
|
||||
Basic modifier names.
|
||||
*/
|
||||
export const modifierNames: readonly ModifierName[];
|
||||
|
||||
/**
|
||||
Basic foreground color names.
|
||||
*/
|
||||
export const foregroundColorNames: readonly ForegroundColorName[];
|
||||
|
||||
/**
|
||||
Basic background color names.
|
||||
*/
|
||||
export const backgroundColorNames: readonly BackgroundColorName[];
|
||||
|
||||
/*
|
||||
Basic color names. The combination of foreground and background color names.
|
||||
*/
|
||||
export const colorNames: readonly ColorName[];
|
||||
|
||||
declare const ansiStyles: {
|
||||
readonly modifier: Modifier;
|
||||
readonly color: ColorBase & ForegroundColor;
|
||||
|
|
@ -187,9 +230,4 @@ declare const ansiStyles: {
|
|||
readonly codes: ReadonlyMap<number, number>;
|
||||
} & ForegroundColor & BackgroundColor & Modifier & ConvertColor;
|
||||
|
||||
declare const modifiers: readonly Modifier[];
|
||||
declare const foregroundColors: readonly ForegroundColor[];
|
||||
declare const backgroundColors: readonly BackgroundColor[];
|
||||
declare const colors: readonly Color[];
|
||||
|
||||
export default ansiStyles;
|
||||
|
|
|
|||
7
source/vendor/ansi-styles/index.js
vendored
7
source/vendor/ansi-styles/index.js
vendored
|
|
@ -214,8 +214,9 @@ function assembleStyles() {
|
|||
}
|
||||
|
||||
const ansiStyles = assembleStyles();
|
||||
export const modifiers = Object.keys(styles.modifier);
|
||||
export const foregroundColors = Object.keys(styles.color);
|
||||
export const backgroundColors = Object.keys(styles.bgColor);
|
||||
export const modifierNames = Object.keys(styles.modifier);
|
||||
export const foregroundColorNames = Object.keys(styles.color);
|
||||
export const backgroundColorNames = Object.keys(styles.bgColor);
|
||||
export const colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
||||
|
||||
export default ansiStyles;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue