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

@types/terminal-kit

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/terminal-kit - npm Package Compare versions

Comparing version 2.5.1 to 2.5.2

16

terminal-kit/index.d.ts

@@ -19,19 +19,19 @@ // Type definitions for terminal-kit 2.5

export function createTerminal(
createOptions?: Terminal.CreateOptions
createOptions?: Terminal.CreateOptions,
): Terminal;
export function getParentTerminalInfo(
callback: (error: any, codename?: string, name?: string, pid?: number) => void
callback: (error: any, codename?: string, name?: string, pid?: number) => void,
): void;
export function getDetectedTerminal(
calback: (error: any, term: Terminal) => void
calback: (error: any, term: Terminal) => void,
): void;
export function autoComplete(
array: ReadonlyArray<string>,
startString: string,
returnAlternatives?: boolean,
prefix?: string,
postfix?: string
array: ReadonlyArray<string>,
startString: string,
returnAlternatives?: boolean,
prefix?: string,
postfix?: string,
): string;

@@ -38,0 +38,0 @@

{
"name": "@types/terminal-kit",
"version": "2.5.1",
"version": "2.5.2",
"description": "TypeScript definitions for terminal-kit",

@@ -30,4 +30,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/terminal-kit",

},
"typesPublisherContentHash": "e7a35124a7e116c738db84763100afdb8e056d86bf2e891ce6798190161ada33",
"typesPublisherContentHash": "aa96dacfe56528cdcfa3881a59ab16b62f57d0ee212a77a16ffa31584121dc1a",
"typeScriptVersion": "4.9"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Wed, 23 Nov 2022 18:11:56 GMT
* Last updated: Tue, 12 Sep 2023 12:34:33 GMT
* Dependencies: [@types/nextgen-events](https://npmjs.com/package/@types/nextgen-events)

@@ -14,0 +14,0 @@ * Global values: `TextBuffer`

@@ -6,37 +6,37 @@ import Terminal = require("./Terminal");

declare class Rect {
readonly width: number;
readonly height: number;
readonly xmin: number;
readonly ymin: number;
readonly xmax: number;
readonly ymax: number;
readonly isNull: boolean;
readonly width: number;
readonly height: number;
readonly xmin: number;
readonly ymin: number;
readonly xmax: number;
readonly ymax: number;
readonly isNull: boolean;
constructor(
options:
| Rect.AbsoluteOptions
| Rect.Region
| Rect
| Terminal
| ScreenBuffer
| TextBuffer
);
constructor(xmin: number, xmax: number, ymin: number, ymax: number);
constructor(
options:
| Rect.AbsoluteOptions
| Rect.Region
| Rect
| Terminal
| ScreenBuffer
| TextBuffer,
);
constructor(xmin: number, xmax: number, ymin: number, ymax: number);
static wrappingRect(params: {
srcRect: Rect;
dstRect: Rect;
offsetX: number;
offsetY: number;
wrapOnly?: "x" | "y" | undefined;
}): void;
static wrappingRect(params: {
srcRect: Rect;
dstRect: Rect;
offsetX: number;
offsetY: number;
wrapOnly?: "x" | "y" | undefined;
}): void;
set(obj: Rect.Region): void;
set(obj: Rect.Region): void;
clip(
dstRect: Rect,
offsetX: number,
offsetY: number,
dstClipping: boolean
): void;
clip(
dstRect: Rect,
offsetX: number,
offsetY: number,
dstClipping: boolean,
): void;
}

@@ -47,17 +47,17 @@

declare namespace Rect {
type Options = AbsoluteOptions | Region;
type Options = AbsoluteOptions | Region;
interface AbsoluteOptions {
width: number;
height: number;
x?: number | undefined;
y?: number | undefined;
}
interface AbsoluteOptions {
width: number;
height: number;
x?: number | undefined;
y?: number | undefined;
}
interface Region {
xmin: number;
ymin: number;
xmax: number;
ymax: number;
}
interface Region {
xmin: number;
ymin: number;
xmax: number;
ymax: number;
}
}

@@ -8,78 +8,78 @@ import NextGenEvents = require("nextgen-events");

declare class ScreenBuffer extends NextGenEvents {
readonly dst: Terminal | ScreenBuffer;
readonly x: number;
readonly y: number;
readonly blending: boolean | ScreenBufferHD.IsBlending;
readonly width: number;
readonly height: number;
readonly dst: Terminal | ScreenBuffer;
readonly x: number;
readonly y: number;
readonly blending: boolean | ScreenBufferHD.IsBlending;
readonly width: number;
readonly height: number;
constructor(options: ScreenBuffer.Options);
constructor(options: ScreenBuffer.Options);
static create(options: ScreenBuffer.Options): ScreenBuffer;
static create(options: ScreenBuffer.Options): ScreenBuffer;
static createFromString(
options: {
attr: number | ScreenBuffer.Attributes;
transparencyChar: string;
transparencyType: number;
},
str: string
): ScreenBuffer;
static createFromString(
options: {
attr: number | ScreenBuffer.Attributes;
transparencyChar: string;
transparencyType: number;
},
str: string,
): ScreenBuffer;
static loadImage(
url: string,
options: {
terminal: Terminal;
shrink?: {
width: number;
height: number;
} | undefined;
},
calback: (error: any, image: ScreenBufferHD) => void
): void;
static loadImage(
url: string,
options: {
terminal: Terminal;
shrink?: {
width: number;
height: number;
} | undefined;
},
calback: (error: any, image: ScreenBufferHD) => void,
): void;
static loadImage(
url: string,
calback: (error?: any, image?: ScreenBufferHD) => void
): void;
static loadImage(
url: string,
calback: (error?: any, image?: ScreenBufferHD) => void,
): void;
static attr2object(attrFlags: number): void;
attr2object(attrFlags: number): void;
static attr2object(attrFlags: number): void;
attr2object(attrFlags: number): void;
static object2attr(attrObject: ScreenBuffer.Attributes): void;
object2attr(attrObject: ScreenBuffer.Attributes): void;
static object2attr(attrObject: ScreenBuffer.Attributes): void;
object2attr(attrObject: ScreenBuffer.Attributes): void;
static loadSync(filepath: string): ScreenBuffer;
static loadSync(filepath: string): ScreenBuffer;
fill(options?: {
attr: ScreenBuffer.Attributes | number;
char?: string | undefined;
}): void;
fill(options?: {
attr: ScreenBuffer.Attributes | number;
char?: string | undefined;
}): void;
clear(): void;
clear(): void;
put(
options: ScreenBuffer.PutOptions,
format: string,
...formatArgumets: any[]
): void;
put(
options: ScreenBuffer.PutOptions,
format: string,
...formatArgumets: any[]
): void;
get(options?: {
x: number;
y: number;
}): { char: string; attr: ScreenBuffer.Attributes };
get(options?: {
x: number;
y: number;
}): { char: string; attr: ScreenBuffer.Attributes };
resize(fromRect: Rect | Rect.Options): void;
resize(fromRect: Rect | Rect.Options): void;
draw(options?: ScreenBuffer.DrawOptions): void;
draw(options?: ScreenBuffer.DrawOptions): void;
drawCursor(options?: { dst: Terminal | ScreenBuffer }): void;
drawCursor(options?: { dst: Terminal | ScreenBuffer }): void;
moveTo(x: number, y: number): void;
moveTo(x: number, y: number): void;
vScroll(offset: number, drawToTerminal: boolean): void;
vScroll(offset: number, drawToTerminal: boolean): void;
dumpChars(): string;
dumpChars(): string;
saveSync(filepath: string): void;
saveSync(filepath: string): void;
}

@@ -90,54 +90,54 @@

declare namespace ScreenBuffer {
interface Options {
width?: number | undefined;
height?: number | undefined;
dst: Terminal | ScreenBuffer;
x?: number | undefined;
y?: number | undefined;
blending?: boolean | undefined;
wrap?: boolean | undefined;
noFill?: boolean | undefined;
}
interface Options {
width?: number | undefined;
height?: number | undefined;
dst: Terminal | ScreenBuffer;
x?: number | undefined;
y?: number | undefined;
blending?: boolean | undefined;
wrap?: boolean | undefined;
noFill?: boolean | undefined;
}
interface DrawOptions {
dst?: Terminal | ScreenBuffer | undefined;
x?: number | undefined;
y?: number | undefined;
srcClipRect?: Rect | undefined;
dstClipRect?: Rect | undefined;
blending?: boolean | undefined;
delta?: boolean | undefined;
wrap?: boolean | "x" | "y" | undefined;
tile?: boolean | undefined;
}
interface DrawOptions {
dst?: Terminal | ScreenBuffer | undefined;
x?: number | undefined;
y?: number | undefined;
srcClipRect?: Rect | undefined;
dstClipRect?: Rect | undefined;
blending?: boolean | undefined;
delta?: boolean | undefined;
wrap?: boolean | "x" | "y" | undefined;
tile?: boolean | undefined;
}
interface Attributes {
color?: number | string | undefined;
defaultColor?: boolean | undefined;
bgColor?: number | string | undefined;
bgDefaultColor?: boolean | undefined;
bold?: boolean | undefined;
dim?: boolean | undefined;
italic?: boolean | undefined;
underline?: boolean | undefined;
blink?: boolean | undefined;
inverse?: boolean | undefined;
hidden?: boolean | undefined;
strike?: boolean | undefined;
transparency?: boolean | undefined;
fgTransparency?: boolean | undefined;
bgTransparency?: boolean | undefined;
styleTransparency?: boolean | undefined;
charTransparency?: boolean | undefined;
}
interface Attributes {
color?: number | string | undefined;
defaultColor?: boolean | undefined;
bgColor?: number | string | undefined;
bgDefaultColor?: boolean | undefined;
bold?: boolean | undefined;
dim?: boolean | undefined;
italic?: boolean | undefined;
underline?: boolean | undefined;
blink?: boolean | undefined;
inverse?: boolean | undefined;
hidden?: boolean | undefined;
strike?: boolean | undefined;
transparency?: boolean | undefined;
fgTransparency?: boolean | undefined;
bgTransparency?: boolean | undefined;
styleTransparency?: boolean | undefined;
charTransparency?: boolean | undefined;
}
interface PutOptions {
x: number;
y: number;
attr: Attributes | number;
wrap: boolean;
direction?: "right" | "left" | "up" | "down" | null | undefined;
dx: number;
dy: number;
}
interface PutOptions {
x: number;
y: number;
attr: Attributes | number;
wrap: boolean;
direction?: "right" | "left" | "up" | "down" | null | undefined;
dx: number;
dy: number;
}
}
import ScreenBuffer = require("./ScreenBuffer");
declare class ScreenBufferHD extends ScreenBuffer {
constructor(
options: { blending: ScreenBufferHD.IsBlending } | ScreenBuffer.Options
);
constructor(
options: { blending: ScreenBufferHD.IsBlending } | ScreenBuffer.Options,
);
readonly blending: ScreenBufferHD.IsBlending;
readonly blending: ScreenBufferHD.IsBlending;
static loadImage(
url: string,
calback: (error?: any, image?: ScreenBufferHD) => void
): void;
static loadImage(
url: string,
calback: (error?: any, image?: ScreenBufferHD) => void,
): void;
static loadImage(
url: string,
options: { shrink?: { height: number; width: number } | undefined },
callback: (error: any, image: ScreenBufferHD) => void
): void;
static loadImage(
url: string,
options: { shrink?: { height: number; width: number } | undefined },
callback: (error: any, image: ScreenBufferHD) => void,
): void;
draw(
options?: ScreenBuffer.DrawOptions | { blending: ScreenBufferHD.IsBlending }
): void;
draw(
options?: ScreenBuffer.DrawOptions | { blending: ScreenBufferHD.IsBlending },
): void;
fill(
options?:
| {
attr: ScreenBuffer.Attributes | number;
char?: string | undefined;
}
| {
attr: ScreenBufferHD.Attributes | number;
char?: string | undefined;
}
): void;
fill(
options?:
| {
attr: ScreenBuffer.Attributes | number;
char?: string | undefined;
}
| {
attr: ScreenBufferHD.Attributes | number;
char?: string | undefined;
},
): void;
}

@@ -41,44 +41,44 @@

declare namespace ScreenBufferHD {
interface Attributes {
r: number;
g: number;
b: number;
a?: number | undefined;
defaultColor?: boolean | undefined;
bgR: number;
bgG: number;
bgB: number;
bgA?: number | undefined;
bgDefaultColor?: boolean | undefined;
bold?: boolean | undefined;
dim?: boolean | undefined;
italic?: boolean | undefined;
underline?: boolean | undefined;
blink?: boolean | undefined;
inverse?: boolean | undefined;
hidden?: boolean | undefined;
strike?: boolean | undefined;
transparency?: boolean | undefined;
styleTransparency?: boolean | undefined;
charTransparency?: boolean | undefined;
}
interface Attributes {
r: number;
g: number;
b: number;
a?: number | undefined;
defaultColor?: boolean | undefined;
bgR: number;
bgG: number;
bgB: number;
bgA?: number | undefined;
bgDefaultColor?: boolean | undefined;
bold?: boolean | undefined;
dim?: boolean | undefined;
italic?: boolean | undefined;
underline?: boolean | undefined;
blink?: boolean | undefined;
inverse?: boolean | undefined;
hidden?: boolean | undefined;
strike?: boolean | undefined;
transparency?: boolean | undefined;
styleTransparency?: boolean | undefined;
charTransparency?: boolean | undefined;
}
type IsBlending = false | Blending;
type IsBlending = false | Blending;
interface Blending {
fn: BlendFunction;
opacity: number;
blendSrcFgWithDstBg: boolean;
}
interface Blending {
fn: BlendFunction;
opacity: number;
blendSrcFgWithDstBg: boolean;
}
type BlendFunction = (src: number, dst: number) => number;
type BlendFunction = (src: number, dst: number) => number;
interface BlendFn {
normal: BlendFunction;
multiply: BlendFunction;
screen: BlendFunction;
overlay: BlendFunction;
hardLight: BlendFunction;
softLight: BlendFunction;
}
interface BlendFn {
normal: BlendFunction;
multiply: BlendFunction;
screen: BlendFunction;
overlay: BlendFunction;
hardLight: BlendFunction;
softLight: BlendFunction;
}
}

@@ -10,616 +10,620 @@ import EventEmitter = require("nextgen-events");

declare namespace Terminal {
interface Impl {
width: number;
height: number;
appName: string;
app: string;
generic: string;
termconfigFile: string;
interface Impl {
width: number;
height: number;
appName: string;
app: string;
generic: string;
termconfigFile: string;
(str?: string): Terminal;
(...args: any[]): Terminal;
(str?: string): Terminal;
(...args: any[]): Terminal;
defaultColor: CTerminal;
black: CTerminal;
red: CTerminal;
green: CTerminal;
yellow: CTerminal;
blue: CTerminal;
magenta: CTerminal;
cyan: CTerminal;
white: CTerminal;
brightBlack: CTerminal;
gray: CTerminal;
grey: CTerminal;
brightRed: CTerminal;
brightGreen: CTerminal;
brightYellow: CTerminal;
brightBlue: CTerminal;
brightMagenta: CTerminal;
brightCyan: CTerminal;
brightWhite: CTerminal;
color: (color: number | string, str?: string) => Terminal;
darkColor: (color: number | string, str?: string) => Terminal;
brightColor: (color: number | string, str?: string) => Terminal;
color256: (color: number | string, str?: string) => Terminal;
colorRgb: (r: number, g: number, b: number, str?: string) => Terminal;
colorRgbHex: (rgb: string, str?: string) => Terminal;
colorGrayscale: (I: number, str?: string) => Terminal;
defaultColor: CTerminal;
black: CTerminal;
red: CTerminal;
green: CTerminal;
yellow: CTerminal;
blue: CTerminal;
magenta: CTerminal;
cyan: CTerminal;
white: CTerminal;
brightBlack: CTerminal;
gray: CTerminal;
grey: CTerminal;
brightRed: CTerminal;
brightGreen: CTerminal;
brightYellow: CTerminal;
brightBlue: CTerminal;
brightMagenta: CTerminal;
brightCyan: CTerminal;
brightWhite: CTerminal;
color: (color: number | string, str?: string) => Terminal;
darkColor: (color: number | string, str?: string) => Terminal;
brightColor: (color: number | string, str?: string) => Terminal;
color256: (color: number | string, str?: string) => Terminal;
colorRgb: (r: number, g: number, b: number, str?: string) => Terminal;
colorRgbHex: (rgb: string, str?: string) => Terminal;
colorGrayscale: (I: number, str?: string) => Terminal;
bgDefaultColor: CTerminal;
bgBlack: CTerminal;
bgRed: CTerminal;
bgGreen: CTerminal;
bgYellow: CTerminal;
bgBlue: CTerminal;
bgMagenta: CTerminal;
bgCyan: CTerminal;
bgWhite: CTerminal;
bgBrightBlack: CTerminal;
bgGray: CTerminal;
bgGrey: CTerminal;
bgBrightRed: CTerminal;
bgBrightGreen: CTerminal;
bgBrightYellow: CTerminal;
bgBrightBlue: CTerminal;
bgBrightMagenta: CTerminal;
bgBrightCyan: CTerminal;
bgBrightWhite: CTerminal;
bgColor: (color: number | string, str?: string) => Terminal;
bgDarkColor: (color: number | string, str?: string) => Terminal;
bgBrightColor: (color: number | string, str?: string) => Terminal;
bgColor256: (color: number | string, str?: string) => Terminal;
bgColorRgb: (r: number, g: number, b: number, str?: string) => Terminal;
bgColorRgbHex: (rgb: string, str?: string) => Terminal;
bgColorGrayscale: (I: number, str?: string) => Terminal;
bgDefaultColor: CTerminal;
bgBlack: CTerminal;
bgRed: CTerminal;
bgGreen: CTerminal;
bgYellow: CTerminal;
bgBlue: CTerminal;
bgMagenta: CTerminal;
bgCyan: CTerminal;
bgWhite: CTerminal;
bgBrightBlack: CTerminal;
bgGray: CTerminal;
bgGrey: CTerminal;
bgBrightRed: CTerminal;
bgBrightGreen: CTerminal;
bgBrightYellow: CTerminal;
bgBrightBlue: CTerminal;
bgBrightMagenta: CTerminal;
bgBrightCyan: CTerminal;
bgBrightWhite: CTerminal;
bgColor: (color: number | string, str?: string) => Terminal;
bgDarkColor: (color: number | string, str?: string) => Terminal;
bgBrightColor: (color: number | string, str?: string) => Terminal;
bgColor256: (color: number | string, str?: string) => Terminal;
bgColorRgb: (r: number, g: number, b: number, str?: string) => Terminal;
bgColorRgbHex: (rgb: string, str?: string) => Terminal;
bgColorGrayscale: (I: number, str?: string) => Terminal;
styleReset: CTerminal;
bold: CTerminal;
dim: CTerminal;
italic: CTerminal;
underline: CTerminal;
blink: CTerminal;
inverse: CTerminal;
hidden: CTerminal;
strike: CTerminal;
styleReset: CTerminal;
bold: CTerminal;
dim: CTerminal;
italic: CTerminal;
underline: CTerminal;
blink: CTerminal;
inverse: CTerminal;
hidden: CTerminal;
strike: CTerminal;
saveCursor: Terminal;
restoreCursor: Terminal;
up: ((n: number) => Terminal) | ((n: number, ...args: any[]) => Terminal);
down: (n: number) => Terminal;
right: (n: number) => Terminal;
left: (n: number) => Terminal;
nextLine: (n: number) => Terminal;
previousLine: (n: number) => Terminal;
column: (x: number) => Terminal;
scrollUp: (n: number) => Terminal;
scrollDown: (n: number) => Terminal;
scrollingRegion: (top: number, bottom: number) => Terminal;
resetScrollingRegion: Terminal;
moveTo: CTerminal;
move: (x: number, y: number) => Terminal;
hideCursor: Terminal;
tabSet: Terminal;
tabClear: Terminal;
tabClearAll: Terminal;
forwardTab: (n: number) => Terminal;
backwardTab: (n: number) => Terminal;
saveCursor: Terminal;
restoreCursor: Terminal;
up: ((n: number) => Terminal) | ((n: number, ...args: any[]) => Terminal);
down: (n: number) => Terminal;
right: (n: number) => Terminal;
left: (n: number) => Terminal;
nextLine: (n: number) => Terminal;
previousLine: (n: number) => Terminal;
column: (x: number) => Terminal;
scrollUp: (n: number) => Terminal;
scrollDown: (n: number) => Terminal;
scrollingRegion: (top: number, bottom: number) => Terminal;
resetScrollingRegion: Terminal;
moveTo: CTerminal;
move: (x: number, y: number) => Terminal;
hideCursor: Terminal;
tabSet: Terminal;
tabClear: Terminal;
tabClearAll: Terminal;
forwardTab: (n: number) => Terminal;
backwardTab: (n: number) => Terminal;
clear: Terminal;
eraseDisplayBelow: Terminal;
eraseDisplayAbove: Terminal;
eraseDisplay: Terminal;
eraseScrollback: Terminal;
eraseLineAfter: Terminal;
eraseLineBefore: Terminal;
eraseLine: Terminal;
eraseArea: (
x: number,
y: number,
width?: number,
height?: number
) => Terminal;
insertLine: (n: number) => Terminal;
deleteLine: (n: number) => Terminal;
insert: (n: number) => Terminal;
delete: (n: number) => Terminal;
backDelete: Terminal;
alternateScreenBuffer: Terminal;
clear: Terminal;
eraseDisplayBelow: Terminal;
eraseDisplayAbove: Terminal;
eraseDisplay: Terminal;
eraseScrollback: Terminal;
eraseLineAfter: Terminal;
eraseLineBefore: Terminal;
eraseLine: Terminal;
eraseArea: (
x: number,
y: number,
width?: number,
height?: number,
) => Terminal;
insertLine: (n: number) => Terminal;
deleteLine: (n: number) => Terminal;
insert: (n: number) => Terminal;
delete: (n: number) => Terminal;
backDelete: Terminal;
alternateScreenBuffer: Terminal;
requestCursorLocation: Terminal;
requestScreenSize: Terminal;
requestColor: (n: number) => Terminal;
applicationKeypad: Terminal;
requestCursorLocation: Terminal;
requestScreenSize: Terminal;
requestColor: (n: number) => Terminal;
applicationKeypad: Terminal;
mouseButton: Terminal;
mouseDrag: Terminal;
mouseMotion: Terminal;
mouseSGR: Terminal;
focusEvent: Terminal;
cwd: (uri: string) => Terminal;
windowTitle: (str: string) => Terminal;
iconName: (str: string) => Terminal;
notify: (title: string, text: string) => Terminal;
mouseButton: Terminal;
mouseDrag: Terminal;
mouseMotion: Terminal;
mouseSGR: Terminal;
focusEvent: Terminal;
cwd: (uri: string) => Terminal;
windowTitle: (str: string) => Terminal;
iconName: (str: string) => Terminal;
notify: (title: string, text: string) => Terminal;
error: Terminal;
str: Terminal;
noFormat: CTerminal;
markupOnly: CTerminal;
wrap: CTerminal;
bindArgs: (...args: any[]) => Terminal;
error: Terminal;
str: Terminal;
noFormat: CTerminal;
markupOnly: CTerminal;
wrap: CTerminal;
bindArgs: (...args: any[]) => Terminal;
reset: Terminal;
bell: Terminal;
setCursorColor: (register: number) => Terminal;
setCursorColorRgb: (r: number, g: number, b: number) => Terminal;
resetCursorColorRgb: Terminal;
setDefaultColorRgb: (r: number, g: number, b: number) => Terminal;
resetDefaultColorRgb: Terminal;
setDefaultBgColorRgb: (r: number, g: number, b: number) => Terminal;
resetDefaultBgColorRgb: Terminal;
setHighlightBgColorRgb: (r: number, g: number, b: number) => Terminal;
resetHighlightBgColorRgb: Terminal;
reset: Terminal;
bell: Terminal;
setCursorColor: (register: number) => Terminal;
setCursorColorRgb: (r: number, g: number, b: number) => Terminal;
resetCursorColorRgb: Terminal;
setDefaultColorRgb: (r: number, g: number, b: number) => Terminal;
resetDefaultColorRgb: Terminal;
setDefaultBgColorRgb: (r: number, g: number, b: number) => Terminal;
resetDefaultBgColorRgb: Terminal;
setHighlightBgColorRgb: (r: number, g: number, b: number) => Terminal;
resetHighlightBgColorRgb: Terminal;
fullscreen: (options: boolean | { noAlternate: boolean }) => void;
processExit: (code: number) => void;
asyncCleanup: () => Promise<void>;
grabInput(
options:
| boolean
| {
mouse?: "button" | "drag" | "motion" | undefined;
safe?: boolean | undefined;
},
safeCallback?: boolean
): void;
fullscreen: (options: boolean | { noAlternate: boolean }) => void;
processExit: (code: number) => void;
asyncCleanup: () => Promise<void>;
grabInput(
options:
| boolean
| {
mouse?: "button" | "drag" | "motion" | undefined;
safe?: boolean | undefined;
},
safeCallback?: boolean,
): void;
getCursorLocation: (
callback: (error: any, x?: number, y?: number) => void
) => void;
getColor(
register: number,
callback?: Callback<{ r: number; g: number; b: number }>
): void;
setColor(
register: number,
r: number,
g: number,
b: number,
names?: ReadonlyArray<string>
): void;
setColor(
register: number,
rgb: { r: number; g: number; b: number },
names?: ReadonlyArray<string>
): void;
getPalette(register: number, callback?: Callback<Palette>): void;
setPalette(palette: string | Palette): void;
getCursorLocation: (
callback: (error: any, x?: number, y?: number) => void,
) => void;
getColor(
register: number,
callback?: Callback<{ r: number; g: number; b: number }>,
): void;
setColor(
register: number,
r: number,
g: number,
b: number,
names?: ReadonlyArray<string>,
): void;
setColor(
register: number,
rgb: { r: number; g: number; b: number },
names?: ReadonlyArray<string>,
): void;
getPalette(register: number, callback?: Callback<Palette>): void;
setPalette(palette: string | Palette): void;
table(tableCells: ReadonlyArray<ReadonlyArray<string>>, options?: TextTableOptions): void;
table(tableCells: ReadonlyArray<ReadonlyArray<string>>, options?: TextTableOptions): void;
spinner(options?: AnimatedTextOptions): Promise<AnimatedText>;
spinner(options?: AnimatedTextOptions): Promise<AnimatedText>;
spinner(animation: AnimationOption): Promise<AnimatedText>;
wrapColumn(options?: {
width: null | number;
x: number;
continue?: boolean | undefined;
offset?: number | undefined;
}): void;
wrapColumn(x: undefined | number, width: number): void;
spinner(animation: AnimationOption): Promise<AnimatedText>;
wrapColumn(options?: {
width: null | number;
x: number;
continue?: boolean | undefined;
offset?: number | undefined;
}): void;
wrapColumn(x: undefined | number, width: number): void;
yesOrNo(options: YesOrNoOptions, callback: Callback<boolean>): void;
yesOrNo(options: YesOrNoOptions, callback: Callback<boolean>): void;
yesOrNo(
options?: YesOrNoOptions
): {
abort: () => void;
promise?: Promise<boolean> | undefined;
};
yesOrNo(
options?: YesOrNoOptions,
): {
abort: () => void;
promise?: Promise<boolean> | undefined;
};
inputField(options?: InputFieldOptions, callback?: Callback<string | undefined>): {
abort: () => void;
promise: Promise<string | undefined>;
};
inputField(callback: Callback<string | undefined>): {
abort: () => void;
promise: Promise<string | undefined>;
};
inputField(options?: InputFieldOptions, callback?: Callback<string | undefined>): {
abort: () => void;
promise: Promise<string | undefined>;
};
inputField(callback: Callback<string | undefined>): {
abort: () => void;
promise: Promise<string | undefined>;
};
fileInput(options: IFileInputOptions, callback: Callback<string>): void;
fileInput(options?: IFileInputOptions): Promise<string>;
fileInput(options: IFileInputOptions, callback: Callback<string>): void;
fileInput(options?: IFileInputOptions): Promise<string>;
singleLineMenu(
menuItems: ReadonlyArray<string>,
options: SingleLineMenuOptions,
callback: Callback<SingleLineMenuResponse>
): void;
singleLineMenu(
menuItems: ReadonlyArray<string>,
options: SingleLineMenuOptions,
callback: Callback<SingleLineMenuResponse>,
): void;
singleLineMenu(
menuItems: ReadonlyArray<string>,
callback: Callback<SingleLineMenuResponse>
): void;
singleLineMenu(
menuItems: ReadonlyArray<string>,
callback: Callback<SingleLineMenuResponse>,
): void;
singleLineMenu(
menuItems: ReadonlyArray<string>,
options?: SingleLineMenuOptions
): {
promise: Promise<SingleLineMenuResponse>;
};
singleLineMenu(
menuItems: ReadonlyArray<string>,
options?: SingleLineMenuOptions,
): {
promise: Promise<SingleLineMenuResponse>;
};
singleRowMenu(
menuItems: ReadonlyArray<string>,
options: SingleLineMenuOptions,
callback: Callback<SingleLineMenuResponse>
): void;
singleRowMenu(
menuItems: ReadonlyArray<string>,
options: SingleLineMenuOptions,
callback: Callback<SingleLineMenuResponse>,
): void;
singleRowMenu(
menuItems: ReadonlyArray<string>,
callback: Callback<SingleLineMenuResponse>
): void;
singleRowMenu(
menuItems: ReadonlyArray<string>,
callback: Callback<SingleLineMenuResponse>,
): void;
singleRowMenu(
menuItems: ReadonlyArray<string>,
options?: SingleLineMenuOptions
): {
promise: Promise<SingleLineMenuResponse>;
};
singleRowMenu(
menuItems: ReadonlyArray<string>,
options?: SingleLineMenuOptions,
): {
promise: Promise<SingleLineMenuResponse>;
};
singleColumnMenu(
menuItems: ReadonlyArray<string>,
options: SingleColumnMenuOptions,
callback: Callback<SingleColumnMenuResponse>
): void;
singleColumnMenu(
menuItems: ReadonlyArray<string>,
options: SingleColumnMenuOptions,
callback: Callback<SingleColumnMenuResponse>,
): void;
singleColumnMenu(
menuItems: ReadonlyArray<string>,
callback: Callback<SingleColumnMenuResponse>
): void;
singleColumnMenu(
menuItems: ReadonlyArray<string>,
callback: Callback<SingleColumnMenuResponse>,
): void;
singleColumnMenu(
menuItems: ReadonlyArray<string>,
options?: SingleColumnMenuOptions
): {
promise: Promise<SingleColumnMenuResponse>;
};
singleColumnMenu(
menuItems: ReadonlyArray<string>,
options?: SingleColumnMenuOptions,
): {
promise: Promise<SingleColumnMenuResponse>;
};
gridMenu(
menuItems: ReadonlyArray<string>,
options: GridMenuOptions,
callback: Callback<GridMenuResponse>
): void;
gridMenu(
menuItems: ReadonlyArray<string>,
options: GridMenuOptions,
callback: Callback<GridMenuResponse>,
): void;
gridMenu(
menuItems: ReadonlyArray<string>,
callback: Callback<GridMenuResponse>
): void;
gridMenu(
menuItems: ReadonlyArray<string>,
callback: Callback<GridMenuResponse>,
): void;
gridMenu(
menuItems: ReadonlyArray<string>,
options?: GridMenuOptions
): {
promise: Promise<GridMenuResponse>;
};
gridMenu(
menuItems: ReadonlyArray<string>,
options?: GridMenuOptions,
): {
promise: Promise<GridMenuResponse>;
};
progressBar(options?: ProgressBarOptions): ProgressBarController;
progressBar(options?: ProgressBarOptions): ProgressBarController;
bar(
value: number,
options?: { innerSize?: number | undefined; barStyle?: CTerminal | undefined }
): void;
bar(
value: number,
options?: { innerSize?: number | undefined; barStyle?: CTerminal | undefined },
): void;
slowTyping(
str: string,
options: {
style?: CTerminal | undefined;
flashStyle?: CTerminal | undefined;
delay?: number | undefined;
flashDelay?: number | undefined;
},
callback: Callback<void>
): void;
slowTyping(str: string, callback: Callback<void>): void;
slowTyping(
str: string,
options: {
style?: CTerminal | undefined;
flashStyle?: CTerminal | undefined;
delay?: number | undefined;
flashDelay?: number | undefined;
},
callback: Callback<void>,
): void;
slowTyping(str: string, callback: Callback<void>): void;
slowTyping(
str: string,
options?: {
style?: CTerminal | undefined;
flashStyle?: CTerminal | undefined;
delay?: number | undefined;
flashDelay?: number | undefined;
}
): Promise<void>;
slowTyping(
str: string,
options?: {
style?: CTerminal | undefined;
flashStyle?: CTerminal | undefined;
delay?: number | undefined;
flashDelay?: number | undefined;
},
): Promise<void>;
drawImage(
url: string,
options: {
shrink?: {
width: number;
height: number;
} | undefined;
},
callback: Callback<void>
): void;
drawImage(
url: string,
options: {
shrink?: {
width: number;
height: number;
} | undefined;
},
callback: Callback<void>,
): void;
drawImage(url: string, callback: Callback<void>): void;
drawImage(url: string, callback: Callback<void>): void;
drawImage(
url: string,
options?: {
shrink?: {
width: number;
height: number;
} | undefined;
}
): Promise<void>;
}
drawImage(
url: string,
options?: {
shrink?: {
width: number;
height: number;
} | undefined;
},
): Promise<void>;
}
interface ChainableInterface<T> {
(str: string, ...args: any[]): T;
(...args: any[]): T;
}
interface ChainableInterface<T> {
(str: string, ...args: any[]): T;
(...args: any[]): T;
}
type Chainable<T> = T & ChainableInterface<T>;
type Chainable<T> = T & ChainableInterface<T>;
type CTerminal = Terminal & ((...args: any[]) => Terminal);
type CTerminal = Terminal & ((...args: any[]) => Terminal);
type Palette = Array<{
r: number;
g: number;
b: number;
names: ReadonlyArray<string>;
}>;
type Palette = Array<{
r: number;
g: number;
b: number;
names: ReadonlyArray<string>;
}>;
interface YesOrNoOptions {
yes: string | ReadonlyArray<string>;
no: string | ReadonlyArray<string>;
echoYes?: string | undefined;
echoNo?: string | undefined;
}
interface YesOrNoOptions {
yes: string | ReadonlyArray<string>;
no: string | ReadonlyArray<string>;
echoYes?: string | undefined;
echoNo?: string | undefined;
}
type Autocompletion =
| ((
inputString: string,
callback: Callback<string | AutocompletionArray<string>>
) => void)
| ((inputString: string) => Promise<string | AutocompletionArray<string>>);
type Autocompletion =
| ((
inputString: string,
callback: Callback<string | AutocompletionArray<string>>,
) => void)
| ((inputString: string) => Promise<string | AutocompletionArray<string>>);
interface CreateOptions {
stdin?: NodeJS.Process | undefined;
stdout?: NodeJS.Process | undefined;
stderr?: NodeJS.Process | undefined;
generic?: string | undefined;
appId: string;
appName: string;
isTTY?: boolean | undefined;
isSSH?: boolean | undefined;
pid?: any;
preferProcessSigwinch?: boolean | undefined;
processSigwinch?: boolean | undefined;
}
interface CreateOptions {
stdin?: NodeJS.Process | undefined;
stdout?: NodeJS.Process | undefined;
stderr?: NodeJS.Process | undefined;
generic?: string | undefined;
appId: string;
appName: string;
isTTY?: boolean | undefined;
isSSH?: boolean | undefined;
pid?: any;
preferProcessSigwinch?: boolean | undefined;
processSigwinch?: boolean | undefined;
}
class AutocompletionArray<T> extends Array<T> {
prefix?: string | undefined;
postfix?: string | undefined;
}
class AutocompletionArray<T> extends Array<T> {
prefix?: string | undefined;
postfix?: string | undefined;
}
interface HookConfig {
style?: CTerminal | undefined;
hintStyle?: CTerminal | undefined;
tokenRegExp?: RegExp | undefined;
autoComplete?: string[] | Autocompletion | undefined;
autoCompleteMenu?: boolean | Autocompletion | undefined;
autoCompleteHint?: boolean | undefined;
}
interface HookConfig {
style?: CTerminal | undefined;
hintStyle?: CTerminal | undefined;
tokenRegExp?: RegExp | undefined;
autoComplete?: string[] | Autocompletion | undefined;
autoCompleteMenu?: boolean | Autocompletion | undefined;
autoCompleteHint?: boolean | undefined;
}
interface InputFieldOptions {
echo?: boolean | undefined;
echoChar?: string | true | undefined;
default?: string | undefined;
cursorPosition?: number | undefined;
cancelable?: boolean | undefined;
style?: CTerminal | undefined;
hintStyle?: CTerminal | undefined;
maxLength?: number | undefined;
minLength?: number | undefined;
history?: string[] | undefined;
autoComplete?: string[] | Autocompletion | undefined;
autoCompleteMenu?: boolean | Autocompletion | undefined;
autoCompleteHint?: boolean | undefined;
keyBindings?: { [key: string]: string } | undefined;
tokenHook?: ((
token: string,
isEndOfInput: boolean,
previousTokens: ReadonlyArray<string>,
term: Terminal,
config: HookConfig
) => string | CTerminal | null | void) | undefined;
tokenResetHook?: ((
term: Terminal,
config?: HookConfig
) => string | CTerminal) | undefined;
tokenRegExp?: RegExp | undefined;
}
interface InputFieldOptions {
echo?: boolean | undefined;
echoChar?: string | true | undefined;
default?: string | undefined;
cursorPosition?: number | undefined;
cancelable?: boolean | undefined;
style?: CTerminal | undefined;
hintStyle?: CTerminal | undefined;
maxLength?: number | undefined;
minLength?: number | undefined;
history?: string[] | undefined;
autoComplete?: string[] | Autocompletion | undefined;
autoCompleteMenu?: boolean | Autocompletion | undefined;
autoCompleteHint?: boolean | undefined;
keyBindings?: { [key: string]: string } | undefined;
tokenHook?:
| ((
token: string,
isEndOfInput: boolean,
previousTokens: ReadonlyArray<string>,
term: Terminal,
config: HookConfig,
) => string | CTerminal | null | void)
| undefined;
tokenResetHook?:
| ((
term: Terminal,
config?: HookConfig,
) => string | CTerminal)
| undefined;
tokenRegExp?: RegExp | undefined;
}
type IFileInputOptions = InputFieldOptions & { baseDir: string };
type IFileInputOptions = InputFieldOptions & { baseDir: string };
interface SingleLineMenuResponse {
selectedIndex: number;
selectedText: string;
x: number;
y: number;
canceled: boolean;
unexpectedKey: string;
}
interface SingleLineMenuResponse {
selectedIndex: number;
selectedText: string;
x: number;
y: number;
canceled: boolean;
unexpectedKey: string;
}
interface SingleLineMenuOptions {
y?: number | undefined;
separator?: string | undefined;
nextPageHint?: string | undefined;
previousPageHint?: string | undefined;
style?: CTerminal | undefined;
selectedStyle?: CTerminal | undefined;
keyBindings?: { [key: string]: string } | undefined;
cancelable?: boolean | undefined;
exitOnUnexpectedKey?: boolean | undefined;
}
interface SingleLineMenuOptions {
y?: number | undefined;
separator?: string | undefined;
nextPageHint?: string | undefined;
previousPageHint?: string | undefined;
style?: CTerminal | undefined;
selectedStyle?: CTerminal | undefined;
keyBindings?: { [key: string]: string } | undefined;
cancelable?: boolean | undefined;
exitOnUnexpectedKey?: boolean | undefined;
}
interface SingleColumnMenuOptions {
y?: number | undefined;
style?: CTerminal | undefined;
selectedStyle?: CTerminal | undefined;
submittedStyle?: CTerminal | undefined;
leftPadding?: string | undefined;
selectedLeftPadding?: string | undefined;
submittedLeftPadding?: string | undefined;
extraLines?: number | undefined;
oneLineItem?: boolean | undefined;
itemMaxWidth?: number | undefined;
continueOnSubmit?: boolean | undefined;
selectedIndex?: number | undefined;
keyBindings?: { [key: string]: string } | undefined;
cancelable?: boolean | undefined;
exitOnUnexpectedKey?: boolean | undefined;
}
interface SingleColumnMenuOptions {
y?: number | undefined;
style?: CTerminal | undefined;
selectedStyle?: CTerminal | undefined;
submittedStyle?: CTerminal | undefined;
leftPadding?: string | undefined;
selectedLeftPadding?: string | undefined;
submittedLeftPadding?: string | undefined;
extraLines?: number | undefined;
oneLineItem?: boolean | undefined;
itemMaxWidth?: number | undefined;
continueOnSubmit?: boolean | undefined;
selectedIndex?: number | undefined;
keyBindings?: { [key: string]: string } | undefined;
cancelable?: boolean | undefined;
exitOnUnexpectedKey?: boolean | undefined;
}
interface SingleColumnMenuResponse {
selectedIndex: number;
selectedText: string;
submitted: boolean;
x: number;
y: number;
canceled: boolean;
unexpectedKey: string;
}
interface SingleColumnMenuResponse {
selectedIndex: number;
selectedText: string;
submitted: boolean;
x: number;
y: number;
canceled: boolean;
unexpectedKey: string;
}
interface GridMenuOptions {
y?: number | undefined;
x?: number | undefined;
width?: number | undefined;
style?: CTerminal | undefined;
selectedStyle?: CTerminal | undefined;
leftPadding?: string | undefined;
selectedLeftPadding?: string | undefined;
rightPadding?: string | undefined;
selectedRightPadding?: string | undefined;
itemMaxWidth?: number | undefined;
keyBindings?: { [key: string]: string } | undefined;
exitOnUnexpectedKey?: boolean | undefined;
}
interface GridMenuOptions {
y?: number | undefined;
x?: number | undefined;
width?: number | undefined;
style?: CTerminal | undefined;
selectedStyle?: CTerminal | undefined;
leftPadding?: string | undefined;
selectedLeftPadding?: string | undefined;
rightPadding?: string | undefined;
selectedRightPadding?: string | undefined;
itemMaxWidth?: number | undefined;
keyBindings?: { [key: string]: string } | undefined;
exitOnUnexpectedKey?: boolean | undefined;
}
interface GridMenuResponse {
selectedIndex: number;
selectedText: string;
x: number;
y: number;
unexpectedKey: string;
}
interface GridMenuResponse {
selectedIndex: number;
selectedText: string;
x: number;
y: number;
unexpectedKey: string;
}
interface ProgressBarOptions {
width?: number | undefined;
percent?: boolean | undefined;
eta?: boolean | undefined;
items?: number | undefined;
title?: string | undefined;
barStyle?: CTerminal | undefined;
barBracketStyle?: CTerminal | undefined;
percentStyle?: CTerminal | undefined;
etaStyle?: CTerminal | undefined;
itemStyle?: CTerminal | undefined;
titleStyle?: CTerminal | undefined;
itemSize?: number | undefined;
titleSize?: number | undefined;
barChar?: string | undefined;
barHeadChar?: string | undefined;
maxRefreshTime?: number | undefined;
minRefreshTime?: number | undefined;
inline?: boolean | undefined;
syncMode?: boolean | undefined;
}
interface ProgressBarOptions {
width?: number | undefined;
percent?: boolean | undefined;
eta?: boolean | undefined;
items?: number | undefined;
title?: string | undefined;
barStyle?: CTerminal | undefined;
barBracketStyle?: CTerminal | undefined;
percentStyle?: CTerminal | undefined;
etaStyle?: CTerminal | undefined;
itemStyle?: CTerminal | undefined;
titleStyle?: CTerminal | undefined;
itemSize?: number | undefined;
titleSize?: number | undefined;
barChar?: string | undefined;
barHeadChar?: string | undefined;
maxRefreshTime?: number | undefined;
minRefreshTime?: number | undefined;
inline?: boolean | undefined;
syncMode?: boolean | undefined;
}
interface ProgressBarController {
update: (
updateObject:
| number
| { progress: number | null; items?: number | undefined; title?: string | undefined }
) => void;
startItem: (name: string) => void;
itemDone: (name: string) => void;
stop: () => void;
resume: () => void;
reset: () => void;
}
interface ProgressBarController {
update: (
updateObject:
| number
| { progress: number | null; items?: number | undefined; title?: string | undefined },
) => void;
startItem: (name: string) => void;
itemDone: (name: string) => void;
stop: () => void;
resume: () => void;
reset: () => void;
}
interface TextTableOptions {
width?: number;
cellContents?: ReadonlyArray<ReadonlyArray<string>>;
contentHasMarkup?: boolean | string;
textAttr?: object;
voidAttr?: object;
firstRowTextAttr?: object;
firstRowVoidAttr?: object;
evenRowTextAttr?: object;
evenRowVoidAttr?: object;
firstColumnTextAttr?: object;
firstColumnVoidAttr?: object;
evenColumnTextAttr?: object;
evenColumnVoidAttr?: object;
firstCellTextAttr?: object;
firstCellVoidAttr?: object;
evenCellTextAttr?: object;
evenCellVoidAttr?: object;
checkerEvenCellTextAttr?: object;
checkerEvenCellVoidAttr?: object;
expandToWidth?: boolean;
shrinkToWidth?: boolean;
expandToHeight?: boolean;
shrinkToHeight?: boolean;
lineWrap?: boolean;
wordWrap?: boolean;
fit?: boolean;
hasBorder?: boolean;
borderAttr?: object;
borderChars?: CustomBorderObject | BuiltinBorder;
textBoxKeyBindings?: object;
}
interface TextTableOptions {
width?: number;
cellContents?: ReadonlyArray<ReadonlyArray<string>>;
contentHasMarkup?: boolean | string;
textAttr?: object;
voidAttr?: object;
firstRowTextAttr?: object;
firstRowVoidAttr?: object;
evenRowTextAttr?: object;
evenRowVoidAttr?: object;
firstColumnTextAttr?: object;
firstColumnVoidAttr?: object;
evenColumnTextAttr?: object;
evenColumnVoidAttr?: object;
firstCellTextAttr?: object;
firstCellVoidAttr?: object;
evenCellTextAttr?: object;
evenCellVoidAttr?: object;
checkerEvenCellTextAttr?: object;
checkerEvenCellVoidAttr?: object;
expandToWidth?: boolean;
shrinkToWidth?: boolean;
expandToHeight?: boolean;
shrinkToHeight?: boolean;
lineWrap?: boolean;
wordWrap?: boolean;
fit?: boolean;
hasBorder?: boolean;
borderAttr?: object;
borderChars?: CustomBorderObject | BuiltinBorder;
textBoxKeyBindings?: object;
}
type AnimationOption = BuiltinAnimation | AnimationArray;
type AnimationOption = BuiltinAnimation | AnimationArray;
// see https://github.com/cronvel/terminal-kit/blob/master/doc/spChars.md#ref.spChars.animation
// see https://github.com/cronvel/terminal-kit/blob/master/doc/spChars.md#ref.spChars.animation
type BuiltinAnimation =
| 'asciiSpinner'
| 'lineSpinner'
| 'dotSpinner'
| 'bitDots'
| 'impulse'
| 'unboxing'
| 'unboxing-color';
type BuiltinAnimation =
| "asciiSpinner"
| "lineSpinner"
| "dotSpinner"
| "bitDots"
| "impulse"
| "unboxing"
| "unboxing-color";
type BuiltinBorder = 'plain' | 'empty' | 'ascii' | 'light' | 'lightRounded' | 'heavy' | 'double' | 'dotted';
type BuiltinBorder = "plain" | "empty" | "ascii" | "light" | "lightRounded" | "heavy" | "double" | "dotted";
type AnimationArray = string[];
interface CustomBorderObject {
vertical: string;
horizontal: string;
topLeft: string;
topRight: string;
bottomLeft: string;
bottomRight: string;
topTee: string;
bottomTee: string;
leftTee: string;
rightTee: string;
cross: string;
}
type AnimationArray = string[];
interface CustomBorderObject {
vertical: string;
horizontal: string;
topLeft: string;
topRight: string;
bottomLeft: string;
bottomRight: string;
topTee: string;
bottomTee: string;
leftTee: string;
rightTee: string;
cross: string;
}
interface AnimatedTextOptions {
animation: AnimationOption;
internal?: boolean;
attr?: object;
}
interface AnimatedTextOptions {
animation: AnimationOption;
internal?: boolean;
attr?: object;
}
interface AnimatedText {
animate(speed: number | false): void;
}
interface AnimatedText {
animate(speed: number | false): void;
}
}

@@ -7,73 +7,73 @@ import ScreenBuffer = require("./ScreenBuffer");

declare class TextBuffer {
readonly x: number;
readonly y: number;
readonly x: number;
readonly y: number;
constructor(options: TextBuffer.Options);
constructor(options: TextBuffer.Options);
getText(): string;
setText(text: string): void;
getText(): string;
setText(text: string): void;
getHidden(): boolean;
setHidden(state: boolean): void;
getHidden(): boolean;
setHidden(state: boolean): void;
getContentSize(): { width: number; height: number };
getContentSize(): { width: number; height: number };
setEmptyCellAttr(attr: ScreenBuffer.Attributes | number): void;
setEmptyCellAttr(attr: ScreenBuffer.Attributes | number): void;
setAttrAt(attr: ScreenBuffer.Attributes | number, x: number, y: number): void;
setAttrCodeAt(attr: number, x: number, y: number): void;
setAttrAt(attr: ScreenBuffer.Attributes | number, x: number, y: number): void;
setAttrCodeAt(attr: number, x: number, y: number): void;
setAttrRegion(
attr: ScreenBuffer.Attributes | number,
region?: Rect.Region
): void;
setAttrCodeRegion(attr: number, region?: Rect.Region): void;
setAttrRegion(
attr: ScreenBuffer.Attributes | number,
region?: Rect.Region,
): void;
setAttrCodeRegion(attr: number, region?: Rect.Region): void;
getMisc(): any;
getMiscAt(x: number, y: number): any;
getMisc(): any;
getMiscAt(x: number, y: number): any;
moveTo(x: number, y: number): void;
moveToColumn(x: number): void;
moveToLine(y: number): void;
moveToRow(y: number): void;
moveTo(x: number, y: number): void;
moveToColumn(x: number): void;
moveToLine(y: number): void;
moveToRow(y: number): void;
move(x: number, y: number): void;
moveUp(): void;
moveDown(): void;
moveLeft(): void;
moveRight(): void;
moveForward(justSkipNullCells: boolean): void;
moveBackward(justSkipNullCells: boolean): void;
moveToEndOfLine(): void;
moveInBound(ignoreCx: boolean): void;
move(x: number, y: number): void;
moveUp(): void;
moveDown(): void;
moveLeft(): void;
moveRight(): void;
moveForward(justSkipNullCells: boolean): void;
moveBackward(justSkipNullCells: boolean): void;
moveToEndOfLine(): void;
moveInBound(ignoreCx: boolean): void;
insert(text: string, attr?: ScreenBuffer.Attributes | number): void;
insert(text: string, attr?: ScreenBuffer.Attributes | number): void;
delete(n?: number): void;
backDelete(n?: number): void;
delete(n?: number): void;
backDelete(n?: number): void;
newLine(): void;
joinLine(): void;
newLine(): void;
joinLine(): void;
iterate(
options: { finalCall: boolean },
callback: (
cellData: {
offset: number;
x: number;
y: number;
text: string;
attr: number;
misc: any;
}
) => void
): void;
iterate(
options: { finalCall: boolean },
callback: (
cellData: {
offset: number;
x: number;
y: number;
text: string;
attr: number;
misc: any;
},
) => void,
): void;
draw(options?: ScreenBuffer.DrawOptions): void;
draw(options?: ScreenBuffer.DrawOptions): void;
drawCursor(options?: { dst: ScreenBuffer }): void;
drawCursor(options?: { dst: ScreenBuffer }): void;
load(filepath: string, callback: (error?: any) => void): void;
load(filepath: string, callback: (error?: any) => void): void;
save(filepath: string, callback: (error?: any) => void): void;
save(filepath: string, callback: (error?: any) => void): void;
}

@@ -84,13 +84,13 @@

declare namespace TextBuffer {
interface Options {
dst: ScreenBuffer;
width?: number | undefined;
height?: number | undefined;
x?: number | undefined;
y?: number | undefined;
tabWidth?: number | undefined;
forceInBound?: number | undefined;
hidden?: boolean | undefined;
wrap?: boolean | undefined;
}
interface Options {
dst: ScreenBuffer;
width?: number | undefined;
height?: number | undefined;
x?: number | undefined;
y?: number | undefined;
tabWidth?: number | undefined;
forceInBound?: number | undefined;
hidden?: boolean | undefined;
wrap?: boolean | undefined;
}
}
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