本文整理汇总了TypeScript中readline.cursorTo函数的典型用法代码示例。如果您正苦于以下问题:TypeScript cursorTo函数的具体用法?TypeScript cursorTo怎么用?TypeScript cursorTo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cursorTo函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
}
{
let data: string|Buffer;
let key: readline.Key;
rl.write(data);
rl.write(null, key);
}
{
let stream: NodeJS.WritableStream;
let x: number;
let y: number;
readline.cursorTo(stream, x, y);
}
{
let stream: NodeJS.WritableStream;
let dx: number|string;
let dy: number|string;
readline.moveCursor(stream, dx, dy);
}
{
let stream: NodeJS.WritableStream;
let dir: number;
readline.clearLine(stream, dir);
示例2:
}
{
const data: string | Buffer = "asd";
const key: readline.Key = {};
rl.write(data);
rl.write('asd', key);
}
{
const strm: NodeJS.WritableStream = new stream.Writable();
const x = 1;
const y = 1;
readline.cursorTo(strm, x);
readline.cursorTo(strm, x, y);
}
{
const strm: NodeJS.ReadableStream = new stream.Readable();
const readLineInterface: readline.ReadLine = readline.createInterface(new stream.Readable());
readline.emitKeypressEvents(strm);
readline.emitKeypressEvents(strm, readLineInterface);
}
{
const strm: NodeJS.WritableStream = new stream.Writable();
const dx: number | string = 1;
const dy: number | string = 1;