# roundel/tokens

> Every export of roundel/tokens, with its signature and doc comment: sgr, error, warn, ok, hint, muted and 4 more, plus 2 types.

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

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

```ts
import { sgr, error, warn, … } from 'roundel/tokens';
```

## Functions

### sgr

Wrap `s` in a chain of SGR pairs, outermost first, as chalk does: a close already inside
`s` is followed by a re-open so a nested style survives it, and every line break closes
before it and re-opens after (chalk/chalk#92). The façade computes parameters; the
escape itself is emitted here and nowhere else (R3, R6).

```ts
function sgr(chain: readonly SgrPair[], s: string): string;
```

| Parameter | Type |
| :-- | :-- |
| `chain` | `readonly SgrPair[]` |
| `s` | `string` |

**Returns** `string`

## Constants

### command

```ts
const command: Token;
```

### error

```ts
const error: Token;
```

### flag

```ts
const flag: Token;
```

### heading

```ts
const heading: Token;
```

### hint

```ts
const hint: Token;
```

### muted

```ts
const muted: Token;
```

### ok

```ts
const ok: Token;
```

### value

```ts
const value: Token;
```

### warn

```ts
const warn: Token;
```

## Interfaces

### SgrPair

One SGR pair as the chalk façade composes them: the parameters that open and close it, no escape.

```ts
interface SgrPair {
    readonly open: string;
    readonly close: string;
}
```

## Types

### Token

```ts
type Token = (s: string) => string;
```
