refactor: apiWithDialogのdataの型付け

This commit is contained in:
zyoshoka 2024-02-07 00:10:24 +09:00
parent 366575a70e
commit 4132965807
No known key found for this signature in database
GPG Key ID: 0C2CB8FBA309A5B8
1 changed files with 2 additions and 2 deletions

View File

@ -26,9 +26,9 @@ import { showMovedDialog } from '@/scripts/show-moved-dialog.js';
export const openingWindowsCount = ref(0); export const openingWindowsCount = ref(0);
export const apiWithDialog = (<E extends keyof Misskey.Endpoints = keyof Misskey.Endpoints>( export const apiWithDialog = (<E extends keyof Misskey.Endpoints = keyof Misskey.Endpoints, P extends Misskey.Endpoints[E]['req'] = Misskey.Endpoints[E]['req']>(
endpoint: E, endpoint: E,
data: Record<string, any> = {}, data: P = {} as any,
token?: string | null | undefined, token?: string | null | undefined,
) => { ) => {
const promise = misskeyApi(endpoint, data, token); const promise = misskeyApi(endpoint, data, token);