本文整理匯總了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);
}