Added the definition of the "axios-cancel" package

This commit is contained in:
TheDSCPL
2019-04-10 16:55:33 +01:00
committed by Luis
parent aaaca878cb
commit ba14504819
4 changed files with 51 additions and 0 deletions
+10
View File
@@ -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<any>
+17
View File
@@ -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 <https://github.com/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;
+23
View File
@@ -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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }