Skip to content

Commit

Permalink
fix: typescript interface updates (#973)
Browse files Browse the repository at this point in the history
* fix: update type alias to enum for better typing support.

* fix: update type/ inteface names to follow TitleCase.

* fix: runOnly interface issue #972

* fix: revert to type over enum, to avoid breaking change/ major release.
  • Loading branch information
jeeyyy authored Jun 26, 2018
1 parent 3d9afcd commit f8c9905
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions axe.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ declare module axe {

type ReporterVersion = "v1" | "v2";

type RunOnlyType = "rule" | "rules" | "tag" | "tags";
type RunOnlyType = "rule" | "rules" | "tag" | "tags";

type resultGroups = "inapplicable" | "passes" | "incomplete" | "violations";

Expand All @@ -19,13 +19,13 @@ declare module axe {
exclude?: string[] | string[][]
}

type RunCallback = (error: Error, results:AxeResults) => void;
type RunCallback = (error: Error, results: AxeResults) => void;

type ElementContext = Node | string | RunOnlyObject;

interface RunOnly {
type: RunOnlyType,
values?: TagValue[] | RunOnlyObject
values?: TagValue[] | string[]
}
interface RunOptions {
runOnly?: RunOnly,
Expand Down Expand Up @@ -103,12 +103,12 @@ declare module axe {
}
interface AxePlugin {
id: string,
run(...args:any[]): any,
run(...args: any[]): any,
commands: {
id: string,
callback(...args:any[]): void
callback(...args: any[]): void
}[],
cleanup?(callback:Function): void
cleanup?(callback: Function): void
}

let plugins: any
Expand All @@ -133,7 +133,7 @@ declare module axe {
*/
function run(context?: ElementContext): Promise<AxeResults>
function run(options: RunOptions): Promise<AxeResults>
function run(callback: (error: Error, results:AxeResults) => void): void
function run(callback: (error: Error, results: AxeResults) => void): void
function run(context: ElementContext, callback: RunCallback): void
function run(options: RunOptions, callback: RunCallback): void
function run(context: ElementContext, options: RunOptions): Promise<AxeResults>
Expand Down

0 comments on commit f8c9905

Please sign in to comment.