summaryrefslogtreecommitdiff
path: root/ext/js/accessibility/google-docs.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-27 12:48:14 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-27 12:48:14 -0500
commit4da4827bcbcdd1ef163f635d9b29416ff272b0bb (patch)
treea8a0f1a8befdb78a554e1be91f2c6059ca3ad5f9 /ext/js/accessibility/google-docs.js
parentfd6bba8a2a869eaf2b2c1fa49001f933fce3c618 (diff)
Add JSDoc type annotations to project (rebased)
Diffstat (limited to 'ext/js/accessibility/google-docs.js')
-rw-r--r--ext/js/accessibility/google-docs.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/ext/js/accessibility/google-docs.js b/ext/js/accessibility/google-docs.js
index f9290078..da6ab994 100644
--- a/ext/js/accessibility/google-docs.js
+++ b/ext/js/accessibility/google-docs.js
@@ -18,9 +18,17 @@
(async () => {
// Reentrant check
+ // @ts-ignore : Checking a property to the global object
if (self.googleDocsAccessibilitySetup) { return; }
+ // @ts-ignore : Adding a property to the global object
self.googleDocsAccessibilitySetup = true;
+ /**
+ * @template [TReturn=unknown]
+ * @param {string} action
+ * @param {import('core').SerializableObject} params
+ * @returns {Promise<TReturn>}
+ */
const invokeApi = (action, params) => {
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage({action, params}, (response) => {
@@ -37,6 +45,7 @@
};
const optionsContext = {depth: 0, url: location.href};
+ /** @type {import('api').OptionsGetResult} */
let options;
try {
options = await invokeApi('optionsGet', {optionsContext});
@@ -48,9 +57,8 @@
// The extension ID below is on an allow-list that is used on the Google Docs webpage.
/* eslint-disable */
- const inject = () => {
- window._docs_annotate_canvas_by_ext = 'ogmnaimimemjmbakcfefmnahgdfhfami';
- };
+ // @ts-ignore : Adding a property to the global object
+ const inject = () => { window._docs_annotate_canvas_by_ext = 'ogmnaimimemjmbakcfefmnahgdfhfami'; };
/* eslint-enable */
let parent = document.head;