CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
base.d.ts308 linesDownload Raw Back to ansi-escapes
1// From https://github.com/sindresorhus/type-fest2type Primitive =3	| null // eslint-disable-line @typescript-eslint/ban-types4	| undefined5	| string6	| number7	| boolean8	| symbol9	| bigint;10 11type LiteralUnion<LiteralType, BaseType extends Primitive> =12	| LiteralType13	| (BaseType & Record<never, never>);14// -15 16export type ImageOptions = {17	/**18	The width is given as a number followed by a unit, or the word `'auto'`.19 20	- `N`: N character cells.21	- `Npx`: N pixels.22	- `N%`: N percent of the session's width or height.23	- `auto`: The image's inherent size will be used to determine an appropriate dimension.24	*/25	readonly width?: LiteralUnion<'auto', number | string>;26 27	/**28	The height is given as a number followed by a unit, or the word `'auto'`.29 30	- `N`: N character cells.31	- `Npx`: N pixels.32	- `N%`: N percent of the session's width or height.33	- `auto`: The image's inherent size will be used to determine an appropriate dimension.34	*/35	readonly height?: LiteralUnion<'auto', number | string>;36 37	/**38	@default true39	*/40	readonly preserveAspectRatio?: boolean;41};42 43export type AnnotationOptions = {44	/**45	Nonzero number of columns to annotate.46 47	Default: The remainder of the line.48	*/49	readonly length?: number;50 51	/**52	Starting X coordinate.53 54	Must be used with `y` and `length`.55 56	Default: The cursor position57	*/58	readonly x?: number;59 60	/**61	Starting Y coordinate.62 63	Must be used with `x` and `length`.64 65	Default: Cursor position.66	*/67	readonly y?: number;68 69	/**70	Create a "hidden" annotation.71 72	Annotations created this way can be shown using the "Show Annotations" iTerm command.73	*/74	readonly isHidden?: boolean;75};76 77/**78Set the absolute position of the cursor. `x0` `y0` is the top left of the screen.79*/80export function cursorTo(x: number, y?: number): string;81 82/**83Set the position of the cursor relative to its current position.84*/85export function cursorMove(x: number, y?: number): string;86 87/**88Move cursor up a specific amount of rows.89 90@param count - Count of rows to move up. Default is `1`.91*/92export function cursorUp(count?: number): string;93 94/**95Move cursor down a specific amount of rows.96 97@param count - Count of rows to move down. Default is `1`.98*/99export function cursorDown(count?: number): string;100 101/**102Move cursor forward a specific amount of rows.103 104@param count - Count of rows to move forward. Default is `1`.105*/106export function cursorForward(count?: number): string;107 108/**109Move cursor backward a specific amount of rows.110 111@param count - Count of rows to move backward. Default is `1`.112*/113export function cursorBackward(count?: number): string;114 115/**116Move cursor to the left side.117*/118export const cursorLeft: string;119 120/**121Save cursor position.122*/123export const cursorSavePosition: string;124 125/**126Restore saved cursor position.127*/128export const cursorRestorePosition: string;129 130/**131Get cursor position.132*/133export const cursorGetPosition: string;134 135/**136Move cursor to the next line.137*/138export const cursorNextLine: string;139 140/**141Move cursor to the previous line.142*/143export const cursorPrevLine: string;144 145/**146Hide cursor.147*/148export const cursorHide: string;149 150/**151Show cursor.152*/153export const cursorShow: string;154 155/**156Erase from the current cursor position up the specified amount of rows.157 158@param count - Count of rows to erase.159*/160export function eraseLines(count: number): string;161 162/**163Erase from the current cursor position to the end of the current line.164*/165export const eraseEndLine: string;166 167/**168Erase from the current cursor position to the start of the current line.169*/170export const eraseStartLine: string;171 172/**173Erase the entire current line.174*/175export const eraseLine: string;176 177/**178Erase the screen from the current line down to the bottom of the screen.179*/180export const eraseDown: string;181 182/**183Erase the screen from the current line up to the top of the screen.184*/185export const eraseUp: string;186 187/**188Erase the screen and move the cursor the top left position.189*/190export const eraseScreen: string;191 192/**193Scroll display up one line.194*/195export const scrollUp: string;196 197/**198Scroll display down one line.199*/200export const scrollDown: string;201 202/**203Clear only the visible terminal screen (viewport) without affecting scrollback buffer or terminal state.204 205This is a safer alternative to `clearScreen` that works consistently across terminals.206*/207export const clearViewport: string;208 209/**210Clear the terminal screen.211 212⚠️ **Warning:** Uses RIS (Reset to Initial State) which may also:213- Clear scrollback buffer in some terminals (xterm.js, VTE)214- Reset terminal modes and state215- Not behave consistently across different terminals216 217Consider using `clearViewport` for safer viewport-only clearing.218*/219export const clearScreen: string;220 221/**222Clear the whole terminal, including scrollback buffer. (Not just the visible part of it)223*/224export const clearTerminal: string;225 226/**227Enter the [alternative screen](https://terminalguide.namepad.de/mode/p47/).228*/229export const enterAlternativeScreen: string;230 231/**232Exit the [alternative screen](https://terminalguide.namepad.de/mode/p47/), assuming `enterAlternativeScreen` was called before.233*/234export const exitAlternativeScreen: string;235 236/**237Begin [synchronized output](https://contour-terminal.org/vt-extensions/synchronized-output/) to reduce flicker during renders.238*/239export const beginSynchronizedOutput: string;240 241/**242End [synchronized output](https://contour-terminal.org/vt-extensions/synchronized-output/).243*/244export const endSynchronizedOutput: string;245 246/**247Wrap output in [synchronized output](https://contour-terminal.org/vt-extensions/synchronized-output/) sequences to reduce flicker during renders.248*/249export function synchronizedOutput(text: string): string;250 251/**252Output a beeping sound.253*/254export const beep: string;255 256/**257Create a clickable link.258 259[Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) Use [`supports-hyperlinks`](https://github.com/jamestalmage/supports-hyperlinks) to detect link support.260*/261export function link(text: string, url: string): string;262 263/**264Display an image.265 266See [term-img](https://github.com/sindresorhus/term-img) for a higher-level module.267 268@param data - Image data. Usually read in with `fs.readFile()`.269*/270export function image(data: Uint8Array, options?: ImageOptions): string;271 272export const iTerm: {273	/**274	[Inform iTerm2](https://www.iterm2.com/documentation-escape-codes.html) of the current directory to help semantic history and enable [Cmd-clicking relative paths](https://coderwall.com/p/b7e82q/quickly-open-files-in-iterm-with-cmd-click).275 276	@param cwd - Current directory. Default: `process.cwd()`.277	*/278	setCwd(cwd?: string): string;279 280	/**281	An annotation looks like this when shown:282 283	![screenshot of iTerm annotation](https://user-images.githubusercontent.com/924465/64382136-b60ac700-cfe9-11e9-8a35-9682e8dc4b72.png)284 285	See the [iTerm Proprietary Escape Codes documentation](https://iterm2.com/documentation-escape-codes.html) for more information.286 287	@param message - The message to display within the annotation. The `|` character is disallowed and will be stripped.288	@returns An escape code which will create an annotation when printed in iTerm2.289	*/290	annotation(message: string, options?: AnnotationOptions): string;291};292 293export const ConEmu: {294	/**295	[Inform ConEmu](https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC) about shell current working directory.296 297	@param cwd - Current directory. Default: `process.cwd()`.298	*/299	setCwd(cwd?: string): string;300};301 302/**303Set the current working directory for both iTerm2 and ConEmu.304 305@param cwd - Current directory. Default: `process.cwd()`.306*/307export function setCwd(cwd?: string): string;308 
basant307/AI_Governance_Project · CoolFace