From 896400a6c90500f8f9c02b578fecf50cbadf7621 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Thu, 2 Mar 2023 07:05:05 +0100 Subject: [PATCH] refactor(frontend): add explicit `Promise` return types in `os.ts` (#10156) --- packages/frontend/src/os.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 7e38fe5f6d..f0af9f081b 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -362,7 +362,7 @@ export function select(props: { }); } -export function success() { +export function success(): Promise { return new Promise((resolve, reject) => { const showing = ref(true); window.setTimeout(() => { @@ -377,7 +377,7 @@ export function success() { }); } -export function waiting() { +export function waiting(): Promise { return new Promise((resolve, reject) => { const showing = ref(true); popup(MkWaitingDialog, { @@ -528,7 +528,7 @@ export function popupMenu(items: MenuItem[] | Ref, src?: HTMLElement width?: number; viaKeyboard?: boolean; onClosing?: () => void; -}) { +}): Promise { return new Promise((resolve, reject) => { let dispose; popup(MkPopupMenu, { @@ -551,7 +551,7 @@ export function popupMenu(items: MenuItem[] | Ref, src?: HTMLElement }); } -export function contextMenu(items: MenuItem[] | Ref, ev: MouseEvent) { +export function contextMenu(items: MenuItem[] | Ref, ev: MouseEvent): Promise { ev.preventDefault(); return new Promise((resolve, reject) => { let dispose; @@ -569,7 +569,7 @@ export function contextMenu(items: MenuItem[] | Ref, ev: MouseEvent) }); } -export function post(props: Record = {}) { +export function post(props: Record = {}): Promise { return new Promise((resolve, reject) => { // NOTE: MkPostFormDialogをdynamic importするとiOSでテキストエリアに自動フォーカスできない // NOTE: ただ、dynamic importしない場合、MkPostFormDialogインスタンスが使いまわされ、