diff --git a/types/axios-cancel/axios-cancel-tests.ts b/types/axios-cancel/axios-cancel-tests.ts new file mode 100644 index 0000000000..627f86b29b --- /dev/null +++ b/types/axios-cancel/axios-cancel-tests.ts @@ -0,0 +1,10 @@ +import axios, {AxiosPromise} from "axios" +import axiosCancel from "axios-cacel"; + +axiosCancel(axios); + +axios.get( + 'https://jsonplaceholder.typicode.com/users', { + requestId: "test id" + } +) // $ExpectType AxiosPromise diff --git a/types/axios-cancel/index.d.ts b/types/axios-cancel/index.d.ts new file mode 100644 index 0000000000..bd594bbd72 --- /dev/null +++ b/types/axios-cancel/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for axios-cancel 0.2 +// Project: https://github.com/thaerlabs/axios-cancel, https://www.npmjs.com/package/axios-cancel +// Definitions by: TheDSCPL +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 1.0 + +import axios from "axios"; + +declare module 'axios' { + export interface AxiosRequestConfig { + requestId?: string + } +} + +function axiosCancel(a: typeof axios): void; + +export default axiosCancel; diff --git a/types/axios-cancel/tsconfig.json b/types/axios-cancel/tsconfig.json new file mode 100644 index 0000000000..6d5f377fb1 --- /dev/null +++ b/types/axios-cancel/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "axios-cancel-tests.ts" + ] +} diff --git a/types/axios-cancel/tslint.json b/types/axios-cancel/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/axios-cancel/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }