UNPKG

@stacksjs/clapp

Version:

A toolkit for building CLI prompts in TypeScript.

66 lines 2.17 kB
import type Option from './Option'; export declare function removeBrackets(v: string): string; export declare function findAllBrackets(v: string): { required: boolean value: string variadic: boolean }[]; export declare function getMriOptions(options: Option[]): MriOptions; export declare function findLongest(arr: string[]): string; export declare function padRight(str: string, length: number): string; export declare function camelcase(input: string): string; export declare function setDotProp(obj: { [k: string]: any }, keys: string[], val: any): void; export declare function setByType(obj: { [k: string]: any }, transforms: { [k: string]: any }): void; export declare function getFileName(input: string): string; export declare function camelcaseOptionName(name: string): string; // Thank you to // https://github.com/sindresorhus/is-unicode-supported/blob/main/index.js export declare function isUnicodeSupported(): boolean; // thanks to sisteransi export declare const ESC: string; export declare const CSI: string; export declare const beep: string; export declare const cursor: Cursor; export declare const scroll: Scroll; export declare const erase: Erase; export declare const clear: Clear; declare interface MriOptions { alias: { [k: string]: string[] } boolean: string[] } export declare interface Cursor { to: (x: number, y: number) => string move: (x: number, y: number) => string up: (count?: number) => string down: (count?: number) => string forward: (count?: number) => string backward: (count?: number) => string nextLine: (count?: number) => string prevLine: (count?: number) => string left: string hide: string show: string save: string restore: string } export declare interface Scroll { up: (count?: number) => string down: (count?: number) => string } export declare interface Erase { screen: string up: (count?: number) => string down: (count?: number) => string line: string lineEnd: string lineStart: string lines: (count: number) => string } export declare interface Clear { screen: string } export declare class ClappError extends Error { constructor(message: string); }