Export createSupportsColor function from supports-color
This commit is contained in:
parent
a370f468a4
commit
d0927f56a0
4 changed files with 10 additions and 2 deletions
1
source/index.d.ts
vendored
1
source/index.d.ts
vendored
|
|
@ -251,6 +251,7 @@ export {
|
|||
ColorInfo,
|
||||
ColorSupport,
|
||||
ColorSupportLevel,
|
||||
createSupportsColor,
|
||||
// } from '#supports-color';
|
||||
} from './vendor/supports-color/index.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { // eslint-disable-line import/order
|
|||
stringEncaseCRLFWithFirstIndex,
|
||||
} from './utilities.js';
|
||||
|
||||
const {stdout: stdoutColor, stderr: stderrColor} = supportsColor;
|
||||
const {stdout: stdoutColor, stderr: stderrColor, createSupportsColor} = supportsColor;
|
||||
|
||||
const GENERATOR = Symbol('GENERATOR');
|
||||
const STYLER = Symbol('STYLER');
|
||||
|
|
@ -218,6 +218,7 @@ export {
|
|||
} from './vendor/ansi-styles/index.js';
|
||||
|
||||
export {
|
||||
createSupportsColor,
|
||||
stdoutColor as supportsColor,
|
||||
stderrColor as supportsColorStderr,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import {expectType, expectAssignable, expectError, expectDeprecated} from 'tsd';
|
||||
import chalk, {
|
||||
Chalk, ChalkInstance, ColorInfo, ColorSupport, ColorSupportLevel, chalkStderr, supportsColor, supportsColorStderr,
|
||||
Chalk, ChalkInstance, ColorInfo, ColorSupport, ColorSupportLevel, chalkStderr, supportsColor, supportsColorStderr, createSupportsColor,
|
||||
ModifierName, ForegroundColorName, BackgroundColorName, ColorName,
|
||||
Modifiers,
|
||||
} from './index.js';
|
||||
|
|
@ -24,6 +24,8 @@ if (supportsColorStderr) {
|
|||
expectType<boolean>(supportsColorStderr.has16m);
|
||||
}
|
||||
|
||||
expectType<ColorInfo>(createSupportsColor());
|
||||
|
||||
// -- `supportsColorStderr` is not a member of the Chalk interface --
|
||||
expectError(chalk.reset.supportsColorStderr);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue