本文整理汇总了TypeScript中readline.clearScreenDown函数的典型用法代码示例。如果您正苦于以下问题:TypeScript clearScreenDown函数的具体用法?TypeScript clearScreenDown怎么用?TypeScript clearScreenDown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clearScreenDown函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
keyHandler.bind(['CTRL+D'], () => {
if (lineReader.isEmpty()) {
process.stdout.write('\n');
readline.clearScreenDown(process.stdout);
process.exit();
}
});
示例2: function
.on('accept', function (line: string) {
rootPanel.writers.forEach(function (writer) {
if (writer !== rootPanel.prompt) {
writer.cursorTo(1, 1);
writer.clearScreenDown();
}
});
process.stdin.setRawMode(false);
process.stdin.pause();
readline.clearScreenDown(process.stdout);
paused = true;
var err: DescentParserNode;
var rootNode: DescentParserNode = defaultLineParser.parseCmdLine(line, commands);
if (rootNode.err && rootNode.firstCommand) {
/* Immediately failed parsing for CMD, try JS */
err = rootNode;
rootNode = defaultLineParser.parseJS(line);
executerVisitor.visit(rootNode, stdio, result => {
if (result instanceof Error) {
// Magic! If line is ambiguous and could have been both a command and JS, but both errored, show both errors
if (err.message) {
console.log(err.message.red);
} else {
console.log(inspect(err));
}
}
doneCB(result);
});
} else if (rootNode.err) {
/* Failed CMD parsing later on, can not recover */
doneCB(rootNode);
} else {
/* Succeeded in CMD parsing, execute */
executerVisitor.visit(rootNode, stdio, doneCB);
}
});
示例3: Buffer
let dy: number | string;
readline.moveCursor(stream, dx, dy);
}
{
let stream: NodeJS.WritableStream;
let dir: number;
readline.clearLine(stream, dir);
}
{
let stream: NodeJS.WritableStream;
readline.clearScreenDown(stream);
}
}
////////////////////////////////////////////////////
/// string_decoder tests : https://nodejs.org/api/string_decoder.html
////////////////////////////////////////////////////
namespace string_decoder_tests {
const StringDecoder = string_decoder.StringDecoder;
const buffer = new Buffer('test');
const decoder = new StringDecoder('utf8');
const part: string = decoder.write(new Buffer('test'));
const end: string = decoder.end();
}
示例4: glk_window_clear
function glk_window_clear(){
readline.cursorTo(process.stdout, 0, 0);
readline.clearScreenDown(process.stdout);
}