當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。