# @types/cli-table

> TypeScript definitions for cli-table

Latest version **0.3.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/cli-table
pnpm add @types/cli-table
yarn add @types/cli-table
bun add @types/cli-table
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.4 |
| Published | 2023-11-07 |
| First published | 2018-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/cli-table
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cli-table
- npm.io page: https://npm.io/package/@types/cli-table

## Recent versions

- 0.3.4 (latest) — 2023-11-07
- 0.3.0 (ts2.1) — 2018-05-19
- 0.3.3 — 2023-10-17
- 0.3.2 — 2023-09-04
- 0.3.1 — 2022-09-27

## README

# Installation
> `npm install --save @types/cli-table`

# Summary
This package contains type definitions for cli-table (https://github.com/Automattic/cli-table).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cli-table.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cli-table/index.d.ts)
````ts
type HorizontalTableRow = string[];
type VerticalTableRow = Record<string, string>;
type CrossTableRow = Record<string, string[]>;
type TableRow = HorizontalTableRow | VerticalTableRow | CrossTableRow;

interface TableOptions<T extends TableRow = TableRow> {
    rows?: T[];
    chars?: {
        [
            k in
                | "top"
                | "top-mid"
                | "top-left"
                | "top-right"
                | "bottom"
                | "bottom-mid"
                | "bottom-left"
                | "bottom-right"
                | "left"
                | "left-mid"
                | "mid"
                | "mid-mid"
                | "right"
                | "right-mid"
                | "middle"
        ]?: string;
    };
    truncate?: string;
    colors?: boolean;
    colWidths?: number[];
    colAligns?: Array<"left" | "middle" | "right">;
    style?: {
        "padding-left"?: number;
        "padding-right"?: number;
        head?: string[];
        border?: string[];
        compact?: boolean;
    };
    head?: string[];
}

declare class Table<T extends TableRow = TableRow> extends Array<T> {
    /**
     * Table constructor
     *
     * @param options
     * @api public
     */
    constructor(options?: T extends CrossTableRow ? never : TableOptions<T>);
    constructor(options: T extends CrossTableRow ? TableOptions<T> & { head: ["", ...string[]] } : never);

    /**
     * Width getter
     *
     * @return width
     * @api public
     */
    get width(): number;

    /**
     * Render to a string.
     *
     * @return table representation
     * @api public
     */
    render(): string;

    /**
     * Render to a string.
     *
     * @return table representation
     * @api public
     */
    toString(): string;

    static readonly version: string;
}

export = Table;

````

### Additional Details
 * Last updated: Mon, 06 Nov 2023 22:41:05 GMT
 * Dependencies: none

# Credits
These definitions were written by [AryloYeung](https://github.com/arylo), and [Antoni Spaanderman](https://github.com/antonilol).

---
_Source: https://npm.io/package/@types/cli-table · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
