提交 3704d57e 编写于 作者: N Nick Uraltsev

Removing Promise from axios typings in favor of built-in type declarations

上级 fe810b1e
......@@ -11,12 +11,15 @@ module.exports = function(grunt) {
dist: 'dist/**'
},
typings: {
install: {}
},
ts: {
test: {
options: {
lib: [
'es5',
'es2015.promise',
'dom'
]
},
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.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('version', 'Sync version info for a release', ['usebanner', 'package2bower']);
};
......@@ -58,12 +58,6 @@ export interface AxiosError extends Error {
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> {
}
......
......@@ -10,8 +10,6 @@ import axios, {
Canceler
} from '../../';
import { Promise } from 'es6-promise';
const config: AxiosRequestConfig = {
url: '/user',
method: 'get',
......
{
"dependencies": {
"es6-promise": "registry:npm/es6-promise#3.0.0+20160723033700"
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册