Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "table"

Index

Type aliases

Cell

Cell: { body: string[]; format?: undefined | number; height?: undefined | number }

Type declaration

  • body: string[]
  • Optional format?: undefined | number
  • Optional height?: undefined | number

RawCell

RawCell: { body: string; format?: undefined | number; height?: undefined | number }

Type declaration

  • body: string
  • Optional format?: undefined | number
  • Optional height?: undefined | number

Functions

Const drawTable

  • drawTable(canvas: Canvas, x: number, y: number, opts: ReturnType<typeof initTable>): void

Const initTable

  • initTable(opts: TableOpts, cells: (string | { body: string; format?: undefined | number; height?: undefined | number })[][]): { b: Border; bFH: number; bFV: number; bH: number; bV: number; cells: { body: string[]; format?: undefined | number; height?: undefined | number }[][]; cols: { width: number }[]; format: undefined | number; formatHead: undefined | number; height: number; numCols: number; numRows: number; padH: number; padV: number; rowHeights: number[]; style: undefined | StrokeStyle; width: number }
  • Parameters

    • opts: TableOpts
    • cells: (string | { body: string; format?: undefined | number; height?: undefined | number })[][]

    Returns { b: Border; bFH: number; bFV: number; bH: number; bV: number; cells: { body: string[]; format?: undefined | number; height?: undefined | number }[][]; cols: { width: number }[]; format: undefined | number; formatHead: undefined | number; height: number; numCols: number; numRows: number; padH: number; padV: number; rowHeights: number[]; style: undefined | StrokeStyle; width: number }

    • b: Border
    • bFH: number
    • bFV: number
    • bH: number
    • bV: number
    • cells: { body: string[]; format?: undefined | number; height?: undefined | number }[][]
    • cols: { width: number }[]
    • format: undefined | number
    • formatHead: undefined | number
    • height: number
    • numCols: number
    • numRows: number
    • padH: number
    • padV: number
    • rowHeights: number[]
    • style: undefined | StrokeStyle
    • width: number

Const table

  • table(canvas: Canvas, x: number, y: number, opts: TableOpts, cells: (string | { body: string; format?: undefined | number; height?: undefined | number })[][]): number[]

Const tableCanvas

  • tableCanvas(opts: TableOpts, cells: (string | { body: string; format?: undefined | number; height?: undefined | number })[][]): Canvas
  • Initializes table with given options and contents. Then creates auto-sized canvas for it, renders table and returns canvas.

    Parameters

    • opts: TableOpts

      table config

    • cells: (string | { body: string; format?: undefined | number; height?: undefined | number })[][]

      table cells (row major)

    Returns Canvas

Generated using TypeDoc