@types/supports-color
TypeScript icon, indicating that this package has built-in type declarations

8.1.3 • Public • Published

Installation

npm install --save @types/supports-color

Summary

This package contains type definitions for supports-color (https://github.com/chalk/supports-color).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/supports-color.

index.d.ts

export namespace supportsColor {
    interface Level {
        level: number;
        hasBasic: boolean;
        has256: boolean;
        has16m: boolean;
    }

    interface Options {
        /**
         * By default it is `true`, which instructs `supportsColor()` to sniff `process.argv`
         * for the multitude of `--color` flags (see _Info_ below).
         * If `false`, then `process.argv` is not considered when determining color support.
         * @default true
         */
        sniffFlags?: boolean | undefined;
        isTTY?: boolean | undefined;
    }

    type SupportsColor = false | Level;
}

export function supportsColor(
    stream: {
        isTTY?: boolean | undefined;
    },
    options?: supportsColor.Options,
): supportsColor.SupportsColor;

export const stdout: supportsColor.SupportsColor;
export const stderr: supportsColor.SupportsColor;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Melvin Groenhoff, Matt Traynham, and Piotr Błażejewicz.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/supports-color

Weekly Downloads

841,501

Version

8.1.3

License

MIT

Unpacked Size

4.78 kB

Total Files

5

Last publish

Collaborators

  • types