diff --git a/types/react-axe/index.d.ts b/types/react-axe/index.d.ts new file mode 100644 index 0000000000..5671204762 --- /dev/null +++ b/types/react-axe/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for react-axe 3.1 +// Project: https://github.com/dequelabs/react-axe +// Definitions by: Akshay Karthik +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import { Spec } from "axe-core"; + +export = axe; + +declare function axe( + react: typeof React, + reactDOM: typeof ReactDOM, + timeout: number, + config?: axe.ReactAxeConfig +): void; + +declare namespace axe { + type ReactAxeConfig = Spec; +} diff --git a/types/react-axe/package.json b/types/react-axe/package.json new file mode 100644 index 0000000000..9d078dcda4 --- /dev/null +++ b/types/react-axe/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "axe-core": "3.2.2" + } +} diff --git a/types/react-axe/react-axe-tests.tsx b/types/react-axe/react-axe-tests.tsx new file mode 100644 index 0000000000..4b7997293f --- /dev/null +++ b/types/react-axe/react-axe-tests.tsx @@ -0,0 +1,5 @@ +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import * as axe from "react-axe"; + +axe(React, ReactDOM, 1000); diff --git a/types/react-axe/tsconfig.json b/types/react-axe/tsconfig.json new file mode 100644 index 0000000000..8efb1ddb70 --- /dev/null +++ b/types/react-axe/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-axe-tests.tsx" + ] +} diff --git a/types/react-axe/tslint.json b/types/react-axe/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/react-axe/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file