refactor(frontend): os.popup()
のprops
の型チェックを有効化 (#13140)
* refactor(frontend): `os.popup()`の`props`の型チェックを有効化 * refactor: `ComponentProps`に書き換え * refacor: `import type`
This commit is contained in:
@@ -9,6 +9,7 @@ import { Component, markRaw, Ref, ref, defineAsyncComponent } from 'vue';
|
||||
import { EventEmitter } from 'eventemitter3';
|
||||
import insertTextAtCursor from 'insert-text-at-cursor';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import type { ComponentProps } from 'vue-component-type-helpers';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import MkPostFormDialog from '@/components/MkPostFormDialog.vue';
|
||||
@@ -143,7 +144,7 @@ export function claimZIndex(priority: keyof typeof zIndexes = 'low'): number {
|
||||
return zIndexes[priority];
|
||||
}
|
||||
|
||||
export async function popup(component: Component, props: Record<string, any>, events = {}, disposeEvent?: string) {
|
||||
export async function popup<T extends Component>(component: T, props: ComponentProps<T>, events = {}, disposeEvent?: string) {
|
||||
markRaw(component);
|
||||
|
||||
const id = ++popupIdCount;
|
||||
|
Reference in New Issue
Block a user