Skip to content

Commit

Permalink
feat(@142vip/utils): 增加类型约束
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdapl committed Dec 12, 2024
1 parent 117f147 commit bf7963c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/utils/src/core/color.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { create } from 'ansi-colors'

// 参考:https://www.npmjs.com/package/ansi-colors
/**
* 参考:https://www.npmjs.com/package/ansi-colors
*/

/**
* 终端修改颜色
Expand Down
1 change: 0 additions & 1 deletion packages/utils/src/core/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export async function isInstallDockerCompose(args?: DockerOptions) {

/**
* 推送Docker镜像到指定仓库
* @param imageName
*/
export async function pushImage(imageName: string) {
const command = `docker push ${imageName}`
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/src/core/inquirer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function promptList(choiceList: string[], message?: string): Promis
/**
* 终端交互选择,多选
*/
export async function promptCheckBox(choiceList: string[], message?: string) {
export async function promptCheckBox(choiceList: string[], message?: string): Promise<string[]> {
return (await inquirer.prompt([
{
type: 'checkbox',
Expand All @@ -39,7 +39,7 @@ export async function promptCheckBox(choiceList: string[], message?: string) {
/**
* 终端交互确认,确认框,可配置默认值
*/
export async function promptConfirm(message: string, defaultValue?: boolean) {
export async function promptConfirm(message: string, defaultValue?: boolean): Promise<boolean> {
return (await inquirer.prompt({
type: 'confirm',
name: 'app',
Expand Down

0 comments on commit bf7963c

Please sign in to comment.