当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript readline.clearScreenDown函数代码示例

本文整理汇总了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();
		}
	});
开发者ID:bteixeira,项目名称:nodeshell,代码行数:7,代码来源:defaultKeyBindings.ts

示例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);
		}
	});
开发者ID:bteixeira,项目名称:nodeshell,代码行数:37,代码来源:shell.ts

示例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();
}
开发者ID:Crevil,项目名称:DefinitelyTyped,代码行数:30,代码来源:node-tests.ts

示例4: glk_window_clear

function glk_window_clear(){
	readline.cursorTo(process.stdout, 0, 0);
	readline.clearScreenDown(process.stdout);
}
开发者ID:ChicagoDave,项目名称:glulx-typescript,代码行数:4,代码来源:_runGameImage.ts


注:本文中的readline.clearScreenDown函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。