# flagstaff/boxen

> Every export of flagstaff/boxen, with its signature and doc comment: boxen, _borderStyles, plus 6 types.

Source: https://flagstaff.interlace.tools/docs/api/boxen

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

```ts
import boxen from 'flagstaff/boxen';
import { _borderStyles } from 'flagstaff/boxen';
```

## Functions

### default

The default export, declared as `boxen`.

`import boxen from 'boxen'` is the incumbent's surface. A named export here would break
every migration this file exists to serve, so the house rule yields to the host.

```ts
function boxen(text: string, options?: BoxenOptions): string;
```

| Parameter | Type |
| :-- | :-- |
| `text` | `string` |
| `options` (optional) | `BoxenOptions` |

**Returns** `string`

## Constants

### _borderStyles

cli-boxes 4, as data. boxen re-exports this as `_borderStyles`, so it is part of the
surface a caller can reach and not an implementation detail to be hidden.

```ts
const BOXES: Record<string, BoxenBorderStyle>;
```

## Interfaces

### BoxenBorderStyle

```ts
interface BoxenBorderStyle {
    topLeft: string;
    top: string;
    topRight: string;
    left: string;
    right: string;
    bottomLeft: string;
    bottom: string;
    bottomRight: string;
    /** Retro-compatibility: sets `left` and `right` together. */
    vertical?: string;
    /** Retro-compatibility: sets `top` and `bottom` together. */
    horizontal?: string;
}
```

### BoxenOptions

```ts
interface BoxenOptions {
    borderStyle?: string | BoxenBorderStyle;
    borderColor?: string;
    backgroundColor?: string;
    dimBorder?: boolean;
    title?: string;
    titleAlignment?: 'left' | 'center' | 'right';
    textAlignment?: 'left' | 'center' | 'right';
    /** @deprecated boxen's own name for `textAlignment`, still honoured. */
    align?: 'left' | 'center' | 'right';
    padding?: number | Spacing;
    margin?: number | Spacing;
    width?: number;
    height?: number;
    float?: 'left' | 'center' | 'right';
    fullscreen?: boolean | ((columns: number, rows: number) => [number, number]);
}
```

### Spacing

```ts
interface Spacing {
    top?: number;
    right?: number;
    bottom?: number;
    left?: number;
}
```

## Types

### Boxes

```ts
type Boxes = typeof BOXES;
```

### CustomBorderStyle

```ts
type CustomBorderStyle = BoxenBorderStyle;
```

### Options

```ts
type Options = BoxenOptions;
```
