本文整理汇总了TypeScript中terminal-kit.terminal.eraseDisplayBelow方法的典型用法代码示例。如果您正苦于以下问题:TypeScript terminal.eraseDisplayBelow方法的具体用法?TypeScript terminal.eraseDisplayBelow怎么用?TypeScript terminal.eraseDisplayBelow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类terminal-kit.terminal
的用法示例。
在下文中一共展示了terminal.eraseDisplayBelow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: handleSelect
async function handleSelect(selectedIndices: number[], projects: ProjectInfo[], env: SystemEnvironment): Promise<void> {
terminal(`\n\n${deletingProjectWarningMessage}`)
terminal.grabInput(true)
await new Promise(resolve => {
terminal.on('key', function (name) {
if (name !== 'y') {
process.exit(0)
}
terminal.grabInput(false)
resolve()
})
})
const projectIdsToDelete = selectedIndices.reduce((prev: string[], current: number) => {
prev.push(projects[current].projectId)
return prev
}, [])
terminal.restoreCursor()
terminal.eraseDisplayBelow()
terminal.hideCursor(false)
env.out.startSpinner(deletingProjectsMessage(projectIdsToDelete))
try {
await deleteProject(projectIdsToDelete, env.resolver)
env.out.stopSpinner()
env.out.write(deletedProjectMessage(projectIdsToDelete))
} catch (e) {
env.out.stopSpinner()
if (e.errors) {
const errors = parseErrors(e)
const output = generateErrorOutput(errors)
env.out.writeError(`${output}`)
} else {
throw e
}
}
}
示例2: clear
function clear(projects: ProjectInfo[]) {
const lineCount = _.flatten(projects).length - 1
terminal.up(lineCount)
terminal.left(10000)
terminal.eraseDisplayBelow()
}