aboutsummaryrefslogtreecommitdiff
path: root/ext/js/accessibility/accessibility-controller.js
diff options
context:
space:
mode:
authorDarius Jahandarie <djahandarie@gmail.com>2023-12-06 03:53:16 +0000
committerGitHub <noreply@github.com>2023-12-06 03:53:16 +0000
commitbd5bc1a5db29903bc098995cd9262c4576bf76af (patch)
treec9214189e0214480fcf6539ad1c6327aef6cbd1c /ext/js/accessibility/accessibility-controller.js
parentfd6bba8a2a869eaf2b2c1fa49001f933fce3c618 (diff)
parent23e6fb76319c9ed7c9bcdc3efba39bc5dd38f288 (diff)
Merge pull request #339 from toasted-nutbread/type-annotations
Type annotations
Diffstat (limited to 'ext/js/accessibility/accessibility-controller.js')
-rw-r--r--ext/js/accessibility/accessibility-controller.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/ext/js/accessibility/accessibility-controller.js b/ext/js/accessibility/accessibility-controller.js
index e9a24880..8250b369 100644
--- a/ext/js/accessibility/accessibility-controller.js
+++ b/ext/js/accessibility/accessibility-controller.js
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import {ScriptManager} from '../background/script-manager.js';
import {log} from '../core.js';
/**
@@ -25,18 +24,22 @@ import {log} from '../core.js';
export class AccessibilityController {
/**
* Creates a new instance.
- * @param {ScriptManager} scriptManager An instance of the `ScriptManager` class.
+ * @param {import('../background/script-manager.js').ScriptManager} scriptManager An instance of the `ScriptManager` class.
*/
constructor(scriptManager) {
+ /** @type {import('../background/script-manager.js').ScriptManager} */
this._scriptManager = scriptManager;
+ /** @type {?import('core').TokenObject} */
this._updateGoogleDocsAccessibilityToken = null;
+ /** @type {?Promise<void>} */
this._updateGoogleDocsAccessibilityPromise = null;
+ /** @type {boolean} */
this._forceGoogleDocsHtmlRenderingAny = false;
}
/**
* Updates the accessibility handlers.
- * @param {object} fullOptions The full options object from the `Backend` instance.
+ * @param {import('settings').Options} fullOptions The full options object from the `Backend` instance.
* The value is treated as read-only and is not modified.
*/
async update(fullOptions) {
@@ -53,8 +56,12 @@ export class AccessibilityController {
// Private
+ /**
+ * @param {boolean} forceGoogleDocsHtmlRenderingAny
+ */
async _updateGoogleDocsAccessibility(forceGoogleDocsHtmlRenderingAny) {
// Reentrant token
+ /** @type {?import('core').TokenObject} */
const token = {};
this._updateGoogleDocsAccessibilityToken = token;
@@ -72,6 +79,9 @@ export class AccessibilityController {
this._updateGoogleDocsAccessibilityPromise = null;
}
+ /**
+ * @param {boolean} forceGoogleDocsHtmlRenderingAny
+ */
async _updateGoogleDocsAccessibilityInner(forceGoogleDocsHtmlRenderingAny) {
if (this._forceGoogleDocsHtmlRenderingAny === forceGoogleDocsHtmlRenderingAny) { return; }
@@ -81,6 +91,7 @@ export class AccessibilityController {
try {
if (forceGoogleDocsHtmlRenderingAny) {
if (await this._scriptManager.isContentScriptRegistered(id)) { return; }
+ /** @type {import('script-manager').RegistrationDetails} */
const details = {
allFrames: true,
matchAboutBlank: true,