|
1 |
| -/* eslint-disable @typescript-eslint/member-ordering */ |
2 |
| -import type { Buffer } from 'node:buffer'; |
3 |
| - |
4 | 1 | // From https://github.com/sindresorhus/type-fest
|
5 | 2 | type Primitive =
|
6 | 3 | | null // eslint-disable-line @typescript-eslint/ban-types
|
@@ -237,31 +234,29 @@ export function link(text: string, url: string): string;
|
237 | 234 | /**
|
238 | 235 | Display an image.
|
239 | 236 |
|
240 |
| -_Currently only supported on iTerm2 >=3_ |
241 |
| -
|
242 | 237 | See [term-img](https://github.com/sindresorhus/term-img) for a higher-level module.
|
243 | 238 |
|
244 |
| -@param buffer - Buffer of an image. Usually read in with `fs.readFile()`. |
| 239 | +@param data - Image data. Usually read in with `fs.readFile()`. |
245 | 240 | */
|
246 |
| -export function image(buffer: Buffer, options?: ImageOptions): string; |
| 241 | +export function image(data: Uint8Array, options?: ImageOptions): string; |
247 | 242 |
|
248 |
| -export namespace iTerm { |
| 243 | +export const iTerm: { |
249 | 244 | /**
|
250 |
| - [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). |
| 245 | + [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). |
251 | 246 |
|
252 |
| - @param cwd - Current directory. Default: `process.cwd()`. |
253 |
| - */ |
254 |
| - function setCwd(cwd?: string): string; |
| 247 | + @param cwd - Current directory. Default: `process.cwd()`. |
| 248 | + */ |
| 249 | + setCwd(cwd?: string): string, |
255 | 250 |
|
256 | 251 | /**
|
257 |
| - An annotation looks like this when shown: |
| 252 | + An annotation looks like this when shown: |
258 | 253 |
|
259 |
| -  |
| 254 | +  |
260 | 255 |
|
261 |
| - See the [iTerm Proprietary Escape Codes documentation](https://iterm2.com/documentation-escape-codes.html) for more information. |
| 256 | + See the [iTerm Proprietary Escape Codes documentation](https://iterm2.com/documentation-escape-codes.html) for more information. |
262 | 257 |
|
263 |
| - @param message - The message to display within the annotation. The `|` character is disallowed and will be stripped. |
264 |
| - @returns An escape code which will create an annotation when printed in iTerm2. |
265 |
| - */ |
266 |
| - function annotation(message: string, options?: AnnotationOptions): string; |
267 |
| -} |
| 258 | + @param message - The message to display within the annotation. The `|` character is disallowed and will be stripped. |
| 259 | + @returns An escape code which will create an annotation when printed in iTerm2. |
| 260 | + */ |
| 261 | + annotation(message: string, options?: AnnotationOptions): string |
| 262 | +}; |
0 commit comments