提交 0370a6eb 编写于 作者: M Matt Bierner

add explicit jsdoc types

上级 29bc5baa
......@@ -9,7 +9,9 @@
const hostMessaging = new class HostMessaging {
constructor() {
/** @type {Map<string, (event: MessageEvent, data: any) => void>} */
this.handlers = new Map();
window.addEventListener('message', (e) => {
if (e.data && (e.data.command === 'onmessage' || e.data.command === 'do-update-state')) {
// Came from inner iframe
......@@ -41,6 +43,7 @@
hostMessaging.postMessage('fatal-error', { message });
}
/** @type {Promise<void>} */
const workerReady = new Promise(async (resolveWorkerReady) => {
if (onElectron) {
return resolveWorkerReady();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册