UNPKG

@visulima/boxen

Version:

Util.format-like string formatting utility.

48 lines (45 loc) 1.51 kB
interface BaseOptions { borderColor?: (border: string, position: BorderPosition, length: number) => string; float?: "center" | "left" | "right"; footerText?: string; footerTextColor?: (text: string) => string; fullscreen?: boolean | ((width: number, height: number) => { columns: number; rows: number; }); headerText?: string; headerTextColor?: (text: string) => string; height?: number; textColor?: (text: string) => string; transformTabToSpace?: number | false; width?: number; } type Spacer = { bottom: number; left: number; right: number; top: number; }; interface BorderStyle { bottom?: string; bottomLeft?: string; bottomRight?: string; horizontal?: string; left?: string; right?: string; top?: string; topLeft?: string; topRight?: string; vertical?: string; } type BorderPosition = "bottom" | "bottomLeft" | "bottomRight" | "horizontal" | "left" | "right" | "top" | "topLeft" | "topRight"; interface Options extends BaseOptions { borderStyle?: BorderStyle | "arrow" | "bold" | "classic" | "double" | "doubleSingle" | "none" | "round" | "single" | "singleDouble"; footerAlignment?: "center" | "left" | "right"; headerAlignment?: "center" | "left" | "right"; margin?: Partial<Spacer> | number; padding?: Partial<Spacer> | number; textAlignment?: "center" | "left" | "right"; } declare const boxen: (text: string, options?: Options) => string; export { boxen };