-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
index.test-d.ts
54 lines (52 loc) · 2.53 KB
/
index.test-d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import {Buffer} from 'node:buffer';
import {expectType} from 'tsd';
import ansiEscapes from './index.js';
// Note: `ansiEscapes` is composed of the named exports, so we don't need to
// test named export types directly.
expectType<string>(ansiEscapes.cursorTo(0));
expectType<string>(ansiEscapes.cursorTo(0, 1));
expectType<string>(ansiEscapes.cursorMove(0));
expectType<string>(ansiEscapes.cursorMove(0, 1));
expectType<string>(ansiEscapes.cursorUp());
expectType<string>(ansiEscapes.cursorUp(1));
expectType<string>(ansiEscapes.cursorDown());
expectType<string>(ansiEscapes.cursorDown(1));
expectType<string>(ansiEscapes.cursorForward());
expectType<string>(ansiEscapes.cursorForward(1));
expectType<string>(ansiEscapes.cursorBackward());
expectType<string>(ansiEscapes.cursorBackward(1));
expectType<string>(ansiEscapes.cursorLeft);
expectType<string>(ansiEscapes.cursorSavePosition);
expectType<string>(ansiEscapes.cursorRestorePosition);
expectType<string>(ansiEscapes.cursorGetPosition);
expectType<string>(ansiEscapes.cursorNextLine);
expectType<string>(ansiEscapes.cursorPrevLine);
expectType<string>(ansiEscapes.cursorHide);
expectType<string>(ansiEscapes.cursorShow);
expectType<string>(ansiEscapes.eraseLines(2));
expectType<string>(ansiEscapes.eraseEndLine);
expectType<string>(ansiEscapes.eraseStartLine);
expectType<string>(ansiEscapes.eraseLine);
expectType<string>(ansiEscapes.eraseDown);
expectType<string>(ansiEscapes.eraseUp);
expectType<string>(ansiEscapes.eraseScreen);
expectType<string>(ansiEscapes.scrollUp);
expectType<string>(ansiEscapes.scrollDown);
expectType<string>(ansiEscapes.clearScreen);
expectType<string>(ansiEscapes.clearTerminal);
expectType<string>(ansiEscapes.enterAlternativeScreen);
expectType<string>(ansiEscapes.exitAlternativeScreen);
expectType<string>(ansiEscapes.beep);
expectType<string>(ansiEscapes.link('foo', 'https://foo.bar'));
expectType<string>(ansiEscapes.image(Buffer.from('1')));
expectType<string>(ansiEscapes.image(Buffer.from('1'), {width: 1}));
expectType<string>(ansiEscapes.image(Buffer.from('1'), {width: '1px'}));
expectType<string>(ansiEscapes.image(Buffer.from('1'), {width: 'auto'}));
expectType<string>(ansiEscapes.image(Buffer.from('1'), {height: 1}));
expectType<string>(ansiEscapes.image(Buffer.from('1'), {height: '1px'}));
expectType<string>(ansiEscapes.image(Buffer.from('1'), {height: 'auto'}));
expectType<string>(
ansiEscapes.image(Buffer.from('1'), {preserveAspectRatio: false}),
);
expectType<string>(ansiEscapes.iTerm.setCwd('/foo/bar'));
expectType<string>(ansiEscapes.iTerm.annotation('foo bar'));