-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <mike@mikepennisi.com>
- Loading branch information
1 parent
33b65e2
commit 58da311
Showing
26 changed files
with
239 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/// <reference path="./types.js" /> | ||
|
||
/** | ||
* @module host | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/// <reference path="types.js" /> | ||
|
||
/** | ||
* @module host | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
/// <reference path="../shared/file-record-types.js" /> | ||
/// <reference path="types.js" /> | ||
|
||
/** | ||
* @module host | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
/// <reference path="../shared/file-record.js" /> | ||
/// <reference path="types.js" /> | ||
|
||
/** | ||
* @module host | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/// <reference path="types.js" /> | ||
|
||
/** | ||
* @module host | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<HostLogType>; | ||
|
||
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<void>; | ||
ready: Promise<void>; | ||
baseUrl: string; | ||
} | ||
|
||
export interface ReferenceFileServerSlice { | ||
id: string; | ||
baseUrl: AriaATCIShared.BaseURL; | ||
} | ||
|
||
export type EmitPlanResults = (plan: TestPlan) => Promise<void> | void; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
/// <reference path="../shared/types.js" /> | ||
/// <reference path="types.js" /> | ||
|
||
/** | ||
* @module runner | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
declare namespace AriaATCIRunner { | ||
type Message = | ||
| 'start' | ||
| 'uncaughtError' | ||
| 'willStop' | ||
| 'startTest' | ||
| 'openPage' | ||
| 'invalidKeys' | ||
| 'pressKeys' | ||
| 'speechEvent' | ||
| 'noRunTestSetup' | ||
| 'atDriverComms' | ||
| 'capabilities'; | ||
|
||
type Log = AriaATCIShared.Log<Message>; | ||
|
||
type TestIterable = AsyncIterable<AriaATCIData.Test>; | ||
|
||
interface TestRunner { | ||
run(test: AriaATCIData.Test): Promise<AriaATCIData.TestResultOutput>; | ||
} | ||
|
||
type ReportResult = (result: AriaATCIData.TestResult) => Promise<void>; | ||
|
||
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<void>; | ||
documentReady(): Promise<void>; | ||
clickWhenPresent(selector: string, timeout: number): Promise<void>; | ||
getCapabilities(): Promise<BrowserCapabilities>; | ||
quit(): Promise<void>; | ||
} | ||
} |
Oops, something went wrong.