Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/cli-table

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/cli-table

TypeScript definitions for cli-table

  • 0.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
123K
increased by5.87%
Maintainers
1
Weekly downloads
 
Created
Source

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

// Type definitions for cli-table 0.3
// Project: https://github.com/Automattic/cli-table
// Definitions by: AryloYeung <https://github.com/arylo>
//                 Antoni Spaanderman <https://github.com/antonilol>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 4.9

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, 04 Sep 2023 15:40:53 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by AryloYeung, and Antoni Spaanderman.

FAQs

Package last updated on 04 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc