This commit is contained in:
syuilo 2024-08-25 20:43:13 +09:00
parent 57a64b3fe2
commit 67d2fde1db
3 changed files with 3 additions and 11 deletions

View File

@ -4,7 +4,6 @@
*/ */
export const postMessageEventTypes = [ export const postMessageEventTypes = [
'misskey:shareForm:shareCompleted',
'misskey:embed:ready', 'misskey:embed:ready',
'misskey:embed:changeHeight', 'misskey:embed:changeHeight',
] as const; ] as const;
@ -12,7 +11,6 @@ export const postMessageEventTypes = [
export type PostMessageEventType = typeof postMessageEventTypes[number]; export type PostMessageEventType = typeof postMessageEventTypes[number];
export interface PostMessageEventPayload extends Record<PostMessageEventType, any> { export interface PostMessageEventPayload extends Record<PostMessageEventType, any> {
'misskey:shareForm:shareCompleted': undefined;
'misskey:embed:ready': undefined; 'misskey:embed:ready': undefined;
'misskey:embed:changeHeight': { 'misskey:embed:changeHeight': {
height: number; height: number;

View File

@ -25,9 +25,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup> <script lang="ts" setup>
import { ref, shallowRef, onMounted, onUnmounted, inject } from 'vue'; import { ref, shallowRef, onMounted, onUnmounted, inject } from 'vue';
import type { ParsedEmbedParams } from '@/scripts/embed-page.js'; import type { ParsedEmbedParams } from '@/embed-page.js';
import { postMessageToParentWindow } from '@/scripts/post-message.js'; import { postMessageToParentWindow } from '@/post-message.js';
import { defaultEmbedParams } from '@/scripts/embed-page.js'; import { defaultEmbedParams } from '@/embed-page.js';
const embedParams = inject<ParsedEmbedParams>('embedParams', defaultEmbedParams); const embedParams = inject<ParsedEmbedParams>('embedParams', defaultEmbedParams);

View File

@ -5,18 +5,12 @@
export const postMessageEventTypes = [ export const postMessageEventTypes = [
'misskey:shareForm:shareCompleted', 'misskey:shareForm:shareCompleted',
'misskey:embed:ready',
'misskey:embed:changeHeight',
] as const; ] as const;
export type PostMessageEventType = typeof postMessageEventTypes[number]; export type PostMessageEventType = typeof postMessageEventTypes[number];
export interface PostMessageEventPayload extends Record<PostMessageEventType, any> { export interface PostMessageEventPayload extends Record<PostMessageEventType, any> {
'misskey:shareForm:shareCompleted': undefined; 'misskey:shareForm:shareCompleted': undefined;
'misskey:embed:ready': undefined;
'misskey:embed:changeHeight': {
height: number;
};
} }
export type MiPostMessageEvent<T extends PostMessageEventType = PostMessageEventType> = { export type MiPostMessageEvent<T extends PostMessageEventType = PostMessageEventType> = {