diff --git a/src/components/Dialog/Dialog.ts b/src/components/Dialog/Dialog.ts index 9e72648727..bb96794a66 100644 --- a/src/components/Dialog/Dialog.ts +++ b/src/components/Dialog/Dialog.ts @@ -16,27 +16,27 @@ import { withProgressDotNotation as withProgress } from "@/store/ui"; type MediaType = "audio" | "text"; export type TextDialogResult = "OK" | "CANCEL"; -export type TextAlertDialogOptions = { +export type AlertDialogOptions = { type?: DialogType; title: string; message: string; ok?: string; }; -export type TextConfirmDialogOptions = { +export type ConfirmDialogOptions = { type?: DialogType; title: string; message: string; actionName: string; cancel?: string; }; -export type TextWarningDialogOptions = { +export type WarningDialogOptions = { type?: DialogType; title: string; message: string; actionName: string; cancel?: string; }; -export type TextQuestionDialogOptions = { +export type QuestionDialogOptions = { type?: DialogType; title: string; message: string; @@ -55,7 +55,7 @@ export type NotifyAndNotShowAgainButtonOption = { export type LoadingScreenOption = { message: string }; // 汎用ダイアログを表示 -export const showAlertDialog = async (options: TextAlertDialogOptions) => { +export const showAlertDialog = async (options: AlertDialogOptions) => { options.ok ??= "閉じる"; const { promise, resolve } = Promise.withResolvers(); @@ -74,7 +74,7 @@ export const showAlertDialog = async (options: TextAlertDialogOptions) => { return "OK" as const; }; -export const showConfirmDialog = async (options: TextConfirmDialogOptions) => { +export const showConfirmDialog = async (options: ConfirmDialogOptions) => { options.cancel ??= "キャンセル"; const { promise, resolve } = Promise.withResolvers(); @@ -94,7 +94,7 @@ export const showConfirmDialog = async (options: TextConfirmDialogOptions) => { return index === 1 ? "OK" : "CANCEL"; }; -export const showWarningDialog = async (options: TextWarningDialogOptions) => { +export const showWarningDialog = async (options: WarningDialogOptions) => { options.cancel ??= "キャンセル"; const { promise, resolve } = Promise.withResolvers(); @@ -115,7 +115,7 @@ export const showWarningDialog = async (options: TextWarningDialogOptions) => { }; export const showQuestionDialog = async ( - options: TextQuestionDialogOptions, + options: QuestionDialogOptions, ) => { const { promise, resolve } = Promise.withResolvers(); Dialog.create({ diff --git a/src/store/type.ts b/src/store/type.ts index 92e9eaf7d3..a577651f81 100644 --- a/src/store/type.ts +++ b/src/store/type.ts @@ -60,9 +60,9 @@ import { TextDialogResult, NotifyAndNotShowAgainButtonOption, LoadingScreenOption, - TextAlertDialogOptions, - TextConfirmDialogOptions, - TextWarningDialogOptions, + AlertDialogOptions, + ConfirmDialogOptions, + WarningDialogOptions, } from "@/components/Dialog/Dialog"; import { LatestProjectType, @@ -1972,15 +1972,15 @@ export type UiStoreTypes = { }; SHOW_ALERT_DIALOG: { - action(payload: TextAlertDialogOptions): TextDialogResult; + action(payload: AlertDialogOptions): TextDialogResult; }; SHOW_CONFIRM_DIALOG: { - action(payload: TextConfirmDialogOptions): TextDialogResult; + action(payload: ConfirmDialogOptions): TextDialogResult; }; SHOW_WARNING_DIALOG: { - action(payload: TextWarningDialogOptions): TextDialogResult; + action(payload: WarningDialogOptions): TextDialogResult; }; SHOW_NOTIFY_AND_NOT_SHOW_AGAIN_BUTTON: { diff --git a/src/store/ui.ts b/src/store/ui.ts index 4be5dd8b58..d338134735 100644 --- a/src/store/ui.ts +++ b/src/store/ui.ts @@ -17,9 +17,9 @@ import { import { createDotNotationPartialStore as createPartialStore } from "./vuex"; import { ActivePointScrollMode } from "@/type/preload"; import { - TextAlertDialogOptions, - TextConfirmDialogOptions, - TextWarningDialogOptions, + AlertDialogOptions, + ConfirmDialogOptions, + WarningDialogOptions, LoadingScreenOption, NotifyAndNotShowAgainButtonOption, connectAndExportTextWithDialog, @@ -246,7 +246,7 @@ export const uiStore = createPartialStore({ SHOW_ALERT_DIALOG: { action: createDotNotationUILockAction( - async (_, payload: TextAlertDialogOptions) => { + async (_, payload: AlertDialogOptions) => { return await showAlertDialog(payload); }, ), @@ -254,7 +254,7 @@ export const uiStore = createPartialStore({ SHOW_CONFIRM_DIALOG: { action: createDotNotationUILockAction( - async (_, payload: TextConfirmDialogOptions) => { + async (_, payload: ConfirmDialogOptions) => { return await showConfirmDialog(payload); }, ), @@ -262,7 +262,7 @@ export const uiStore = createPartialStore({ SHOW_WARNING_DIALOG: { action: createDotNotationUILockAction( - async (_, payload: TextWarningDialogOptions) => { + async (_, payload: WarningDialogOptions) => { return await showWarningDialog(payload); }, ),