mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-12 12:26:43 -06:00
c1514ce91d
Fix #13290
25 lines
548 B
TypeScript
25 lines
548 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
export const postMessageEventTypes = [
|
|
'misskey:shareForm:shareCompleted',
|
|
] as const;
|
|
|
|
export type PostMessageEventType = typeof postMessageEventTypes[number];
|
|
|
|
export type MiPostMessageEvent = {
|
|
type: PostMessageEventType;
|
|
payload?: any;
|
|
};
|
|
|
|
/**
|
|
* 親フレームにイベントを送信
|
|
*/
|
|
export function postMessageToParentWindow(type: PostMessageEventType, payload?: any): void {
|
|
window.postMessage({
|
|
type,
|
|
payload,
|
|
}, '*');
|
|
}
|