mirror of
https://github.com/tenrok/axios.git
synced 2026-06-23 20:40:40 +03:00
Removing Promise from axios typings in favor of built-in type declarations
This commit is contained in:
+8
-5
@@ -11,12 +11,15 @@ module.exports = function(grunt) {
|
|||||||
dist: 'dist/**'
|
dist: 'dist/**'
|
||||||
},
|
},
|
||||||
|
|
||||||
typings: {
|
|
||||||
install: {}
|
|
||||||
},
|
|
||||||
|
|
||||||
ts: {
|
ts: {
|
||||||
test: {
|
test: {
|
||||||
|
options: {
|
||||||
|
lib: [
|
||||||
|
'es5',
|
||||||
|
'es2015.promise',
|
||||||
|
'dom'
|
||||||
|
]
|
||||||
|
},
|
||||||
src: ['typings/index.d.ts', 'test/typescript/*.ts']
|
src: ['typings/index.d.ts', 'test/typescript/*.ts']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -93,7 +96,7 @@ module.exports = function(grunt) {
|
|||||||
grunt.file.write('bower.json', JSON.stringify(bower, null, 2));
|
grunt.file.write('bower.json', JSON.stringify(bower, null, 2));
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.registerTask('test', 'Run the jasmine and nodeunit tests', ['eslint', 'nodeunit', 'karma:single', 'typings', 'ts']);
|
grunt.registerTask('test', 'Run the jasmine and nodeunit tests', ['eslint', 'nodeunit', 'karma:single', 'ts']);
|
||||||
grunt.registerTask('build', 'Run webpack and bundle the source', ['clean', 'webpack']);
|
grunt.registerTask('build', 'Run webpack and bundle the source', ['clean', 'webpack']);
|
||||||
grunt.registerTask('version', 'Sync version info for a release', ['usebanner', 'package2bower']);
|
grunt.registerTask('version', 'Sync version info for a release', ['usebanner', 'package2bower']);
|
||||||
};
|
};
|
||||||
|
|||||||
Vendored
-6
@@ -58,12 +58,6 @@ export interface AxiosError extends Error {
|
|||||||
response?: AxiosResponse;
|
response?: AxiosResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Promise<V> {
|
|
||||||
then<R1, R2>(onFulfilled: (value: V) => R1 | Promise<R1>, onRejected: (error: any) => R2 | Promise<R2>): Promise<R1 | R2>;
|
|
||||||
then<R>(onFulfilled: (value: V) => R | Promise<R>): Promise<R>;
|
|
||||||
catch<R>(onRejected: (error: any) => R | Promise<R>): Promise<R>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AxiosPromise extends Promise<AxiosResponse> {
|
export interface AxiosPromise extends Promise<AxiosResponse> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,6 @@
|
|||||||
"grunt-eslint": "^19.0.0",
|
"grunt-eslint": "^19.0.0",
|
||||||
"grunt-karma": "^2.0.0",
|
"grunt-karma": "^2.0.0",
|
||||||
"grunt-ts": "^6.0.0-beta.3",
|
"grunt-ts": "^6.0.0-beta.3",
|
||||||
"grunt-typings": "^0.1.5",
|
|
||||||
"grunt-webpack": "^1.0.18",
|
"grunt-webpack": "^1.0.18",
|
||||||
"istanbul-instrumenter-loader": "^1.0.0",
|
"istanbul-instrumenter-loader": "^1.0.0",
|
||||||
"jasmine-core": "^2.4.1",
|
"jasmine-core": "^2.4.1",
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import axios, {
|
|||||||
Canceler
|
Canceler
|
||||||
} from '../../';
|
} from '../../';
|
||||||
|
|
||||||
import { Promise } from 'es6-promise';
|
|
||||||
|
|
||||||
const config: AxiosRequestConfig = {
|
const config: AxiosRequestConfig = {
|
||||||
url: '/user',
|
url: '/user',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"dependencies": {
|
|
||||||
"es6-promise": "registry:npm/es6-promise#3.0.0+20160723033700"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user