mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Added the definition of the "axios-cancel" package
This commit is contained in:
parent
db82e27b78
commit
7f1710ce85
@ -1,7 +1,7 @@
|
||||
// can't test because it depends on axios which makes Travis CI be unable to compile with the error "expect TypeScript@next compile error: Cannot find module 'axios'."
|
||||
|
||||
import axios, { AxiosPromise } from "axios"
|
||||
import axiosCancel, { AxiosStatic } from "axios-cancel";
|
||||
import axios, { AxiosPromise } from "axios";
|
||||
import axiosCancel from "axios-cancel";
|
||||
|
||||
axiosCancel(axios); // $ExpectType void
|
||||
|
||||
@ -9,7 +9,7 @@ axios.get(
|
||||
'https://jsonplaceholder.typicode.com/users', {
|
||||
requestId: "test id"
|
||||
}
|
||||
); // $ExpectType AxiosPromise<any>
|
||||
); // $ExpectType Promise<any>
|
||||
|
||||
axios.cancel("test id"); // $ExpectType void
|
||||
|
||||
|
||||
6
types/axios-cancel/index.d.ts
vendored
6
types/axios-cancel/index.d.ts
vendored
@ -4,13 +4,13 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
import {AxiosStatic} from "axios";
|
||||
import { AxiosStatic } from "axios";
|
||||
|
||||
declare module 'axios' {
|
||||
export interface AxiosRequestConfig {
|
||||
interface AxiosRequestConfig {
|
||||
requestId?: string;
|
||||
}
|
||||
export interface AxiosStatic {
|
||||
interface AxiosStatic {
|
||||
cancel: (requestId: string) => void;
|
||||
cancelAll: () => void;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user