refactor: apiWithDialogのdataの型付け
This commit is contained in:
parent
366575a70e
commit
4132965807
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue