# roundel/chalk

> Every export of roundel/chalk, with its signature and doc comment: modifierNames, foregroundColorNames, backgroundColorNames, underlineColorNames, colorNames, supportsColor and 3 more, plus 16 types.

Source: https://roundel.interlace.tools/docs/api/chalk

<!-- Generated by scripts/api-reference.ts from the built dist/*.d.ts. Do not edit; run `npx tsx scripts/api-reference.ts`. -->

`roundel/chalk` (R6): chalk 6's public API — the chainable builder, the mutable `level`,
`Chalk`, `chalkStderr`, `supportsColor` — over the tokens' emitter and the policy's
level, graded by chalk's own suite vendored into `compat-oracle`.

chalk's mutable `level` is honoured here and nowhere else: `chalk.level = 0` silences
this façade, not the tokens, which read the policy. The template literal
(`` chalk`{red x}` ``) went with chalk 5 and is not resurrected. Not one escape is
written here: parameters are computed, `sgr()` in tokens emits them (R3).

The SGR numbers below are chalk's tables (ansi-styles) as written; naming each would
double the file the R8 ceiling measures, so the lint's magic-number rule is off here.

```ts
import chalk from 'roundel/chalk';
import { modifierNames, foregroundColorNames, backgroundColorNames, … } from 'roundel/chalk';
```

## Constants

### default

The default export, declared as `chalk`.

```ts
const chalk: ChalkInstance;
```

### backgroundColorNames

```ts
const backgroundColorNames: BackgroundColorName[];
```

### chalkStderr

```ts
const chalkStderr: ChalkInstance;
```

### colorNames

```ts
const colorNames: ColorName[];
```

### foregroundColorNames

```ts
const foregroundColorNames: ForegroundColorName[];
```

### modifierNames

```ts
const modifierNames: ModifierName[];
```

### supportsColor

```ts
const supportsColor: ColorInfo;
```

### supportsColorStderr

```ts
const supportsColorStderr: ColorInfo;
```

### underlineColorNames

```ts
const underlineColorNames: UnderlineColorName[];
```

## Interfaces

### Chalk

`new Chalk({ level })` — an instance with its own level, detected when the option is omitted.

```ts
interface Chalk extends ChalkInstance {
}

class Chalk {
    constructor(options?: ChalkOptions);
}
```

### ChalkOptions

```ts
interface ChalkOptions {
    /** `undefined` asks for the level to be detected, as omitting it does. */
    readonly level?: ColorSupportLevel | undefined;
}
```

### ColorSupport

```ts
interface ColorSupport {
    level: ColorSupportLevel;
    hasBasic: boolean;
    has256: boolean;
    has16m: boolean;
}
```

## Types

### BackgroundColor

```ts
type BackgroundColor = BackgroundColorName;
```

### BackgroundColorName

```ts
type BackgroundColorName = `bg${Capitalize<Basic | Bright>}`;
```

### ChalkInstance

```ts
type ChalkInstance = Base & {
    readonly [K in ModifierName | ColorName | UnderlineColorName | 'visible']: ChalkInstance;
};
```

### Color

```ts
type Color = ColorName;
```

### ColorInfo

```ts
type ColorInfo = ColorSupport | false;
```

### ColorName

```ts
type ColorName = ForegroundColorName | BackgroundColorName;
```

### ColorSupportLevel

Colour support: none, 16 colours, 256 colours, truecolor. chalk's name for the policy's level.

```ts
type ColorSupportLevel = ColorLevel;
```

### ForegroundColor

```ts
type ForegroundColor = ForegroundColorName;
```

### ForegroundColorName

```ts
type ForegroundColorName = Basic | Bright;
```

### ModifierName

```ts
type ModifierName = keyof typeof MODIFIERS;
```

### Modifiers

```ts
type Modifiers = ModifierName;
```

### Options

```ts
type Options = ChalkOptions;
```

### UnderlineColorName

```ts
type UnderlineColorName = `underline${Capitalize<Basic | Bright>}`;
```
