本文整理匯總了TypeScript中terminal-kit.terminal.restoreCursor方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript terminal.restoreCursor方法的具體用法?TypeScript terminal.restoreCursor怎麽用?TypeScript terminal.restoreCursor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類terminal-kit.terminal
的用法示例。
在下文中一共展示了terminal.restoreCursor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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
}
}
}