From 58da311be319f73d7e742684013de5dd7d838b17 Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Mon, 23 Sep 2024 17:42:57 -0700 Subject: [PATCH] Jsdoc type declarations to Typescript types (#71) * First pass on JSDoc types -> Typescript Types conversion * Second pass, declared namespaces * Handle merge with updated main * TS types for FileRecord, expect-errors for incorrectly typed EventEmitter, TextEncoder, TextDecoder objects * Remove incorrect autoimport * Remove remaining jsdoc imports * Preserve property description --------- Co-authored-by: Mike Pennisi --- src/host/cli.js | 2 - src/host/main.js | 4 +- src/host/messages.js | 2 - src/host/plan-from.js | 3 - src/host/plan-object.js | 3 - src/host/server.js | 2 - src/host/tests/plan-from.js | 4 +- src/host/types.d.ts | 65 ++++++++++++ src/host/types.js | 83 --------------- .../create-safari-apple-script-driver.js | 2 +- .../browser-driver/create-web-driver.js | 2 +- src/runner/browser-driver/create.js | 4 +- src/runner/create-test-runner.js | 5 +- src/runner/driver-test-runner.js | 10 +- src/runner/messages.js | 3 - src/runner/mock-test-runner.js | 4 - src/runner/types.d.ts | 51 +++++++++ src/runner/types.js | 70 ------------ src/shared/file-record-types.js | 24 ----- src/shared/file-record.js | 1 - src/shared/job.js | 1 - src/shared/messages.js | 2 - src/shared/times-option.js | 20 ++-- src/shared/types.d.ts | 100 ++++++++++++++++++ src/shared/types.js | 58 ---------- tsconfig.json | 2 + 26 files changed, 239 insertions(+), 288 deletions(-) create mode 100644 src/host/types.d.ts delete mode 100644 src/host/types.js create mode 100644 src/runner/types.d.ts delete mode 100644 src/runner/types.js create mode 100644 src/shared/types.d.ts delete mode 100644 src/shared/types.js diff --git a/src/host/cli.js b/src/host/cli.js index 4598641..9fcc59c 100644 --- a/src/host/cli.js +++ b/src/host/cli.js @@ -1,5 +1,3 @@ -/// - /** * @module host */ diff --git a/src/host/main.js b/src/host/main.js index 1abeff0..3f1c6ee 100644 --- a/src/host/main.js +++ b/src/host/main.js @@ -1,5 +1,3 @@ -/// - /** * @module host */ @@ -129,6 +127,7 @@ export async function hostMain(options) { plan = addTestLogToTestPlan(plan, test); } }; + /** @ts-expect-error EventEmitter is not correctly typed */ logger.emitter.on('message', addLogtoPlan); try { @@ -153,6 +152,7 @@ export async function hostMain(options) { await lastCallbackRequest; throw exception; } finally { + /** @ts-expect-error EventEmitter is not correctly typed */ logger.emitter.off('message', addLogtoPlan); } } diff --git a/src/host/messages.js b/src/host/messages.js index 5fe37fe..c64ff88 100644 --- a/src/host/messages.js +++ b/src/host/messages.js @@ -1,5 +1,3 @@ -/// - /** * @module host */ diff --git a/src/host/plan-from.js b/src/host/plan-from.js index 347151e..092ee55 100644 --- a/src/host/plan-from.js +++ b/src/host/plan-from.js @@ -1,6 +1,3 @@ -/// -/// - /** * @module host */ diff --git a/src/host/plan-object.js b/src/host/plan-object.js index 3c45e08..3ac04b9 100644 --- a/src/host/plan-object.js +++ b/src/host/plan-object.js @@ -1,6 +1,3 @@ -/// -/// - /** * @module host */ diff --git a/src/host/server.js b/src/host/server.js index 2fad660..45debdb 100644 --- a/src/host/server.js +++ b/src/host/server.js @@ -1,5 +1,3 @@ -/// - /** * @module host */ diff --git a/src/host/tests/plan-from.js b/src/host/tests/plan-from.js index cea8d6f..8196ebf 100644 --- a/src/host/tests/plan-from.js +++ b/src/host/tests/plan-from.js @@ -1,5 +1,3 @@ -/// - import * as path from 'path'; import { fileURLToPath } from 'url'; @@ -114,6 +112,7 @@ function isTextFile(filePath) { function normalizeTextRecordEOL(file, { textEncoder, textDecoder } = textCoders()) { return { ...file, + // @ts-expect-error - TextEncoder and TextDecoder are not typed as classes. bufferData: textEncoder.encode(textDecoder.decode(file.bufferData).replace(/\r\n/g, '\n')), }; } @@ -122,5 +121,6 @@ function normalizeTextRecordEOL(file, { textEncoder, textDecoder } = textCoders( * @returns {{textEncoder: TextEncoder, textDecoder: TextDecoder}} */ function textCoders() { + // @ts-expect-error - TextEncoder and TextDecoder are not typed as classes. return { textEncoder: new TextEncoder(), textDecoder: new TextDecoder() }; } diff --git a/src/host/types.d.ts b/src/host/types.d.ts new file mode 100644 index 0000000..53f84a5 --- /dev/null +++ b/src/host/types.d.ts @@ -0,0 +1,65 @@ +declare namespace AriaATCIHost { + export type HostLogType = + | 'start' + | 'uncaughtError' + | 'willStop' + | 'startServer' + | 'planRead' + | 'serverListening' + | 'stopServer' + | 'stopDrivers' + | 'addServerDirectory' + | 'removeServerDirectory' + | 'serverLog' + | 'startTest' + | 'reportingError' + | 'testError' + | 'atDriverComms' + | 'openPage' + | 'pressKeys' + | 'speechEvent' + | 'invalidKeys' + | 'noRunTestSetup' + | 'capabilities'; + + export type Log = AriaATCIShared.Log; + + export interface Logger { + log: Log; + emitter: typeof import('events').EventEmitter; + } + + export interface TestPlan { + name: string; + serverOptions: { + baseUrl: AriaATCIShared.BaseURL; + }; + tests: Array<{ + id: string; + filepath: string; + log: number[]; + results: any[]; + }>; + files: FileRecord.NamedRecord[]; + log: AriaATCIData.Log[]; + } + + export interface TestPlanServerOptionsPartial { + baseUrl?: AriaATCIShared.BaseURL; + } + + export interface ReferenceFileServer { + addFiles: (files: FileRecord.NamedRecord[]) => ReferenceFileServerSlice; + removeFiles: (slice: ReferenceFileServerSlice) => void; + close: () => Promise; + ready: Promise; + baseUrl: string; + } + + export interface ReferenceFileServerSlice { + id: string; + baseUrl: AriaATCIShared.BaseURL; + } + + export type EmitPlanResults = (plan: TestPlan) => Promise | void; +} diff --git a/src/host/types.js b/src/host/types.js deleted file mode 100644 index f90c434..0000000 --- a/src/host/types.js +++ /dev/null @@ -1,83 +0,0 @@ -/// -/// -/// -/// - -/** - * @namespace AriaATCIHost - */ - -/** - * @typedef {'start' - * | 'uncaughtError' - * | 'willStop' - * | 'startServer' - * | 'planRead' - * | 'serverListening' - * | 'stopServer' - * | 'stopDrivers' - * | 'addServerDirectory' - * | 'removeServerDirectory' - * | 'serverLog' - * | 'startTest' - * | 'reportingError' - * | 'testError' - * | 'atDriverComms' - * | 'openPage' - * | 'pressKeys' - * | 'speechEvent' - * | 'invalidKeys' - * | 'noRunTestSetup' - * | 'capabilities' - * } AriaATCIHost.HostLogType - */ - -/** - * @typedef {AriaATCIShared.Log} AriaATCIHost.Log - */ - -/** - * @typedef AriaATCIHost.Logger - * @property {AriaATCIHost.Log} log - * @property {import("events").EventEmitter} emitter - */ - -/** - * @typedef AriaATCIHost.TestPlan - * @property {string} name - * @property {object} serverOptions - * @property {AriaATCIShared.BaseURL} serverOptions.baseUrl - * @property {object[]} tests - * @property {string} tests[].id - * @property {string} tests[].filepath - * @property {number[]} tests[].log - * @property {Array} tests[].results - * @property {FileRecord.NamedRecord[]} files - * @property {AriaATCIData.Log[]} log - */ - -/** - * @typedef AriaATCIHost.TestPlanServerOptionsPartial - * @property {AriaATCIShared.BaseURL} [baseUrl] - */ - -/** - * @typedef AriaATCIHost.ReferenceFileServer - * @property {function(FileRecord.NamedRecord[]): AriaATCIHost.ReferenceFileServerSlice} addFiles - * @property {function(AriaATCIHost.ReferenceFileServerSlice): void} removeFiles - * @property {function(): Promise} close - * @property {Promise} ready - * @property {string} baseUrl - */ - -/** - * @typedef AriaATCIHost.ReferenceFileServerSlice - * @property {string} id - * @property {AriaATCIShared.BaseURL} baseUrl - */ - -/** - * @callback AriaATCIHost.EmitPlanResults - * @param {AriaATCIHost.TestPlan} plan - * @returns {Promise | void} - */ diff --git a/src/runner/browser-driver/create-safari-apple-script-driver.js b/src/runner/browser-driver/create-safari-apple-script-driver.js index 6c82c2b..f703bc8 100644 --- a/src/runner/browser-driver/create-safari-apple-script-driver.js +++ b/src/runner/browser-driver/create-safari-apple-script-driver.js @@ -41,7 +41,7 @@ const evalJavaScript = source => { }; /** - * @param {AriaATCIShared.timesOption} timesOption + * @param {AriaATCIShared.TimesOption} timesOption */ export default async timesOption => { await execScript(`tell application "Safari" diff --git a/src/runner/browser-driver/create-web-driver.js b/src/runner/browser-driver/create-web-driver.js index 04c2fd1..e9ab531 100644 --- a/src/runner/browser-driver/create-web-driver.js +++ b/src/runner/browser-driver/create-web-driver.js @@ -1,7 +1,7 @@ import { Builder } from 'selenium-webdriver'; import { until, By } from 'selenium-webdriver'; -/** @returns {Promise} */ +/** @returns {Promise} */ export default async (browser, serverUrl) => { const driver = await new Builder().forBrowser(browser).usingServer(serverUrl).build(); diff --git a/src/runner/browser-driver/create.js b/src/runner/browser-driver/create.js index 28944c6..4ed752e 100644 --- a/src/runner/browser-driver/create.js +++ b/src/runner/browser-driver/create.js @@ -6,9 +6,9 @@ import createSafariAppleScriptDriver from './create-safari-apple-script-driver.j * @param {{toString: function(): string}} options.url * @param {AriaATCIRunner.Browser} [options.browser] * @param {Promise} options.abortSignal - * @param {AriaATCIShared.timesOption} options.timesOption + * @param {AriaATCIShared.TimesOption} options.timesOption * - * @returns {Promise} + * @returns {Promise} */ export async function createBrowserDriver({ url, browser = 'firefox', abortSignal, timesOption }) { const driver = diff --git a/src/runner/create-test-runner.js b/src/runner/create-test-runner.js index 6c07b7a..ff07d06 100644 --- a/src/runner/create-test-runner.js +++ b/src/runner/create-test-runner.js @@ -1,6 +1,3 @@ -/// -/// - /** * @module agent */ @@ -18,7 +15,7 @@ import { createATDriver } from './at-driver.js'; * @param {Promise} options.abortSignal * @param {boolean} [options.mock] * @param {AriaATCIRunner.Browser} [options.webDriverBrowser] - * @param {AriaATCIShared.timesOption} options.timesOption + * @param {AriaATCIShared.TimesOption} options.timesOption * @param {{toString: function(): string}} options.webDriverUrl * @returns {Promise} */ diff --git a/src/runner/driver-test-runner.js b/src/runner/driver-test-runner.js index e9c95f2..2f39fdc 100644 --- a/src/runner/driver-test-runner.js +++ b/src/runner/driver-test-runner.js @@ -1,7 +1,3 @@ -/// -/// -/// - import { startJob } from '../shared/job.js'; import { ATDriver, ATKey, webDriverCodePoints } from './at-driver.js'; @@ -15,10 +11,10 @@ export class DriverTestRunner { /** * @param {object} options * @param {URL} options.baseUrl - * @param {AriaATCIHost.Log} options.log - * @param {BrowserDriver} options.browserDriver + * @param {AriaATCIRunner.Log} options.log + * @param {AriaATCIRunner.BrowserDriver} options.browserDriver * @param {ATDriver} options.atDriver - * @param {AriaATCIShared.timesOption} options.timesOption + * @param {AriaATCIShared.TimesOption} options.timesOption */ constructor({ baseUrl, log, browserDriver, atDriver, timesOption }) { this.baseUrl = baseUrl; diff --git a/src/runner/messages.js b/src/runner/messages.js index a015664..aec3eb1 100644 --- a/src/runner/messages.js +++ b/src/runner/messages.js @@ -1,6 +1,3 @@ -/// -/// - /** * @module runner */ diff --git a/src/runner/mock-test-runner.js b/src/runner/mock-test-runner.js index c683efb..20400e6 100644 --- a/src/runner/mock-test-runner.js +++ b/src/runner/mock-test-runner.js @@ -1,7 +1,3 @@ -/// -/// -/// - /** * @module agent */ diff --git a/src/runner/types.d.ts b/src/runner/types.d.ts new file mode 100644 index 0000000..e48d620 --- /dev/null +++ b/src/runner/types.d.ts @@ -0,0 +1,51 @@ +declare namespace AriaATCIRunner { + type Message = + | 'start' + | 'uncaughtError' + | 'willStop' + | 'startTest' + | 'openPage' + | 'invalidKeys' + | 'pressKeys' + | 'speechEvent' + | 'noRunTestSetup' + | 'atDriverComms' + | 'capabilities'; + + type Log = AriaATCIShared.Log; + + type TestIterable = AsyncIterable; + + interface TestRunner { + run(test: AriaATCIData.Test): Promise; + } + + type ReportResult = (result: AriaATCIData.TestResult) => Promise; + + type Browser = 'chrome' | 'firefox' | 'safari'; + + interface CliOptions { + debug?: boolean; + quiet?: boolean; + verbose?: Message[]; + referenceBaseUrl?: AriaATCIShared.BaseURL; + mock?: boolean; + webDriverUrl?: AriaATCIShared.BaseURL; + webDriverBrowser?: Browser; + atDriverUrl?: AriaATCIShared.BaseURL; + timesOption?: AriaATCIShared.TimesOption; + } + + interface BrowserCapabilities { + browserName: string; + browserVersion: string; + } + + interface BrowserDriver { + navigate(url: string): Promise; + documentReady(): Promise; + clickWhenPresent(selector: string, timeout: number): Promise; + getCapabilities(): Promise; + quit(): Promise; + } +} diff --git a/src/runner/types.js b/src/runner/types.js deleted file mode 100644 index 7ad37b2..0000000 --- a/src/runner/types.js +++ /dev/null @@ -1,70 +0,0 @@ -/// -/// - -/** @namespace AriaATCIRunner */ - -/** - * @typedef {'start' - * | 'uncaughtError' - * | 'willStop' - * | 'startTest' - * | 'openPage' - * | 'invalidKeys' - * | 'pressKeys' - * | 'speechEvent' - * | 'noRunTestSetup' - * | 'atDriverComms' - * | 'capabilities' - * } AriaATCIRunner.Message - */ - -/** - * @typedef {AriaATCIShared.Log} AriaATCIRunner.Log - */ - -/** - * @typedef {AsyncIterable} AriaATCIRunner.TestIterable - */ - -/** - * @typedef AriaATCIRunner.TestRunner - * @property {function(AriaATCIData.Test): Promise} run run a test - */ - -/** - * @callback AriaATCIRunner.ReportResult - * @param {AriaATCIData.TestResult} result - * @returns {Promise} - */ - -/** - * @typedef {'chrome' | 'firefox' | 'safari'} AriaATCIRunner.Browser - */ - -/** - * @typedef AriaATCIRunner.CliOptions - * @property {boolean} [debug] - * @property {boolean} [quiet] - * @property {AriaATCIRunner.Message[]} [verbose] - * @property {AriaATCIShared.BaseURL} [referenceBaseUrl] - * @property {boolean} [mock] - * @property {AriaATCIShared.BaseURL} [webDriverUrl] - * @property {AriaATCIRunner.Browser} [webDriverBrowser] - * @property {AriaATCIShared.BaseURL} [atDriverUrl] - * @property {AriaATCIShared.timesOption} [timesOption] - */ - -/** - * @typedef {object} BrowserCapabilities - * @property {string} browserName - * @property {string} browserVersion - */ - -/** - * @typedef {object} BrowserDriver - * @property {(url: string) => Promise} navigate - * @property {() => Promise} documentReady - * @property {(selector: string, timeout: number) => Promise} clickWhenPresent - * @property {() => Promise} getCapabilities - * @property {() => Promise} quit - */ diff --git a/src/shared/file-record-types.js b/src/shared/file-record-types.js index d06dd50..e759943 100644 --- a/src/shared/file-record-types.js +++ b/src/shared/file-record-types.js @@ -1,12 +1,5 @@ -/** - * @namespace FileRecord - */ const FileRecord = {}; -/** - * @interface - * @memberof FileRecord - */ FileRecord.Host = { /** * Recursively read items from a file system starting from root. @@ -30,20 +23,3 @@ FileRecord.Host = { throw new Error('Not implemented.'); }, }; - -/** - * @typedef FileRecord.Record - * @property {FileRecord.NamedRecord[] | null} [entries] an array of NamedRecords or null if it should be removed - * @property {Uint8Array | null} [bufferData] a Uint8Array or null if it should be removed - */ - -/** - * @typedef FileRecord.NamedRecord - * @property {string} name - * @property {FileRecord.NamedRecord[] | null} [entries] an array of FileRecord.NamedRecord or null if it should be removed - * @property {Uint8Array | null} [bufferData] a Uint8Array or null if it should be removed - */ - -/** - * @typedef {function(FileRecord.Record, string[], FileRecord.Record[]): PromiseLike | FileRecord.Record} FileRecord.Functor - */ diff --git a/src/shared/file-record.js b/src/shared/file-record.js index 2a370db..ab856ab 100644 --- a/src/shared/file-record.js +++ b/src/shared/file-record.js @@ -1,5 +1,4 @@ // @ts-nocheck -/// /** * @module shared diff --git a/src/shared/job.js b/src/shared/job.js index 6a4c1e4..3245936 100644 --- a/src/shared/job.js +++ b/src/shared/job.js @@ -1,5 +1,4 @@ // @ts-nocheck -/// /** * @module shared diff --git a/src/shared/messages.js b/src/shared/messages.js index 73fcfce..41ead69 100644 --- a/src/shared/messages.js +++ b/src/shared/messages.js @@ -1,5 +1,3 @@ -/// - /** * @module shared */ diff --git a/src/shared/times-option.js b/src/shared/times-option.js index e3c52fc..e67481c 100644 --- a/src/shared/times-option.js +++ b/src/shared/times-option.js @@ -1,11 +1,9 @@ -/// - /** * @module shared */ /** - * @type AriaATCIShared.timesOption + * @type AriaATCIShared.TimesOption */ const timesDefaults = { afterNav: 1000, @@ -16,8 +14,8 @@ const timesDefaults = { }; /** - * Create a yargs description for the specified timesOption. - * @param {keyof AriaATCIShared.timesOption} optionName Key from timesOption + * Create a yargs description for the specified TimesOption. + * @param {keyof AriaATCIShared.TimesOption} optionName Key from TimesOption * @param {string} argName The text used for the argument (without leading --) * @param {string} describe Description to be used in --show-help */ @@ -42,7 +40,7 @@ function addOptionConfig(optionName, argName, describe) { } /** - * @type Map + * @type Map */ const timesOptionsArgNameMap = new Map(); @@ -74,7 +72,7 @@ addOptionConfig('docReady', 'time-doc-ready', 'Timeout used waiting for document /** * Convert the times dictionary to an array of strings to pass back to args. - * @param {AriaATCIShared.timesOption} opts + * @param {AriaATCIShared.TimesOption} opts * @returns {string[]} */ export function timesArgs(opts) { @@ -85,7 +83,7 @@ export function timesArgs(opts) { if (value == timesDefaults[key]) continue; // casting in jsdoc syntax is complicated - the extra () around key are // required to make the type annotation work. - const argName = timesOptionsArgNameMap.get(/** @type keyof AriaATCIShared.timesOption */ (key)); + const argName = timesOptionsArgNameMap.get(/** @type keyof AriaATCIShared.TimesOption */ (key)); args.push('--' + argName); args.push(String(value)); } @@ -93,14 +91,14 @@ export function timesArgs(opts) { } /** - * Convert the arguments parse result into a timesOption object. + * Convert the arguments parse result into a TimesOption object. * @param {any} args The parsed arguments - * @returns {AriaATCIShared.timesOption} + * @returns {AriaATCIShared.TimesOption} */ export function getTimesOption(args) { const result = { ...timesDefaults }; for (const key in result) { - const mapped = timesOptionsArgNameMap.get(/** @type keyof AriaATCIShared.timesOption */ (key)); + const mapped = timesOptionsArgNameMap.get(/** @type keyof AriaATCIShared.TimesOption */ (key)); if (mapped) { if (args[mapped]) result[key] = args[mapped]; } diff --git a/src/shared/types.d.ts b/src/shared/types.d.ts new file mode 100644 index 0000000..c0d63f4 --- /dev/null +++ b/src/shared/types.d.ts @@ -0,0 +1,100 @@ +declare namespace AriaATCIShared { + export type Log = (type: Type, more?: any) => void; + + export interface BaseURL { + protocol: string; + hostname: string; + port: number | string; + pathname: string; + } + + export interface PartialBaseURL { + protocol?: string; + hostname?: string; + port?: number | string; + pathname?: string; + } + + /** + * A token for some parallelized work. + * Canceling the job will stop any loops of async iterables that have been + * wrapped with AriaATCIShared.JobBinding#cancelable. + */ + export interface Job { + cancel: () => Promise; + } + + /** + * A binding for some parallelized work. + */ + export interface JobBinding { + /** + * Finish the iterable if the job is canceled + */ + cancelable: (iterable: AsyncIterable) => AsyncIterable; + } + + /** + * The work to be done in a job. + */ + export type JobWork = (binding: JobBinding) => Promise; + + export interface TimesOption { + /** + * Timeout used after navigation to collect and discard speech. + */ + afterNav: number; + /** + * Timeout used to wait for speech to finish after pressing keys. + */ + afterKeys: number; + /** + * Timeout used after pressing test setup button to collect and discard speech. + */ + testSetup: number; + /** + * Timeout used after switching modes to check resulting speech (NVDA). + */ + modeSwitch: number; + /** + * docReady Timeout used waiting for document ready (Safari). + */ + docReady: number; + } +} + +declare namespace FileRecord { + export interface Host { + read(root: string, options?: { glob?: string }): Promise; + collapse(record: Record): NamedRecord[]; + } + + export interface Record { + /** + * an array of NamedRecords or null if it should be removed + */ + entries?: NamedRecord[] | null; + /** + * a Uint8Array or null if it should be removed + */ + bufferData?: Uint8Array | null; + } + + export interface NamedRecord { + name: string; + /** + * an array of NamedRecords or null if it should be removed + */ + entries?: NamedRecord[] | null; + /** + * a Uint8Array or null if it should be removed + */ + bufferData?: Uint8Array | null; + } + + export type Functor = ( + record: Record, + path: string[], + ancestors: Record[] + ) => PromiseLike | Record; +} diff --git a/src/shared/types.js b/src/shared/types.js deleted file mode 100644 index 8df72e0..0000000 --- a/src/shared/types.js +++ /dev/null @@ -1,58 +0,0 @@ -/** @namespace AriaATCIShared */ - -/** - * @template {string} Type - * @callback AriaATCIShared.Log - * @param {Type} type - * @param {*} [more] - */ - -/** - * @typedef AriaATCIShared.BaseURL - * @property {string} protocol - * @property {string} hostname - * @property {number | string} port - * @property {string} pathname - */ - -/** - * @typedef AriaATCIShared.PartialBaseURL - * @property {string} [protocol] - * @property {string} [hostname] - * @property {number | string} [port] - * @property {string} [pathname] - */ - -/** - * A token to some parallelized work. - * - * Canceling the job will stop any loops of async iterables that have been - * wrapped with AriaATCIShared.JobBinding#cancelable. - * - * @template T - * @typedef AriaATCIShared.Job - * @property {function(): Promise} cancel - */ - -/** - * @template T - * @typedef AriaATCIShared.JobBinding - * @property {function(AsyncIterable): AsyncIterable} cancelable finish - * the iterable if the job is canceled - */ - -/** - * @template T - * @callback AriaATCIShared.JobWork - * @param {AriaATCIShared.JobBinding<*>} binding - * @returns {Promise} - */ - -/** - * @typedef AriaATCIShared.timesOption - * @property {number} afterNav Timeout used after navigation to collect and discard speech. - * @property {number} afterKeys Timeout used to wait for speech to finish after pressing keys. - * @property {number} testSetup Timeout used after pressing test setup button to collect and discard speech. - * @property {number} modeSwitch Timeout used after switching modes to check resulting speech (NVDA). - * @property {number} docReady Timeout used waiting for document ready (Safari). - */ diff --git a/tsconfig.json b/tsconfig.json index 7158dc4..09e20d0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,9 +1,11 @@ { "compilerOptions": { "checkJs": true, + "allowJs": true, "noEmit": true, "target": "ES6", "module": "es2020", + "types": ["node"], "moduleResolution": "node", "lib": ["es2022"] },