aboutsummaryrefslogtreecommitdiff
path: root/ext/js/comm/frame-client.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-28 00:48:33 -0500
committerGitHub <noreply@github.com>2023-12-28 05:48:33 +0000
commit76805bc0fc65452ca830623aa810888f9c476a2b (patch)
treed91e257fd335c75dfca1a37784eb12769fbb5a66 /ext/js/comm/frame-client.js
parentfc2123a45b3ceacc2ec887d24e5e752dca59bb4f (diff)
API type safety updates (#457)
* Update message handlers in SearchDisplayController * Update types * Updates * Updates * Simplify * Updates * Updates * Rename * Improve types * Improve types * Resolve TODOs
Diffstat (limited to 'ext/js/comm/frame-client.js')
-rw-r--r--ext/js/comm/frame-client.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/js/comm/frame-client.js b/ext/js/comm/frame-client.js
index 5e997622..cb591ca9 100644
--- a/ext/js/comm/frame-client.js
+++ b/ext/js/comm/frame-client.js
@@ -110,14 +110,14 @@ export class FrameClient {
contentWindow.postMessage({action, params}, targetOrigin);
};
- /** @type {import('extension').ChromeRuntimeOnMessageCallback<import('extension').ChromeRuntimeMessageWithFrameId>} */
+ /** @type {import('extension').ChromeRuntimeOnMessageCallback<import('application').ApiMessageAny>} */
const onMessage = (message) => {
onMessageInner(message);
return false;
};
/**
- * @param {import('extension').ChromeRuntimeMessageWithFrameId} message
+ * @param {import('application').ApiMessageAny} message
*/
const onMessageInner = async (message) => {
try {
@@ -130,7 +130,7 @@ export class FrameClient {
switch (action) {
case 'frameEndpointReady':
{
- const {secret} = /** @type {import('frame-client').FrameEndpointReadyDetails} */ (params);
+ const {secret} = params;
const token = generateId(16);
tokenMap.set(secret, token);
postMessage('frameEndpointConnect', {secret, token, hostFrameId});
@@ -138,7 +138,7 @@ export class FrameClient {
break;
case 'frameEndpointConnected':
{
- const {secret, token} = /** @type {import('frame-client').FrameEndpointConnectedDetails} */ (params);
+ const {secret, token} = params;
const frameId = message.frameId;
const token2 = tokenMap.get(secret);
if (typeof token2 !== 'undefined' && token === token2 && typeof frameId === 'number') {