Skip to content

Commit

Permalink
Removing Promise from axios typings in favor of built-in type declara…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
nickuraltsev committed Mar 15, 2017
1 parent fe810b1 commit 3704d57
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 19 deletions.
13 changes: 8 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
}
},
Expand Down Expand Up @@ -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']);
};
6 changes: 0 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"grunt-eslint": "^19.0.0",
"grunt-karma": "^2.0.0",
"grunt-ts": "^6.0.0-beta.3",
"grunt-typings": "^0.1.5",
"grunt-webpack": "^1.0.18",
"istanbul-instrumenter-loader": "^1.0.0",
"jasmine-core": "^2.4.1",
Expand Down
2 changes: 0 additions & 2 deletions test/typescript/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import axios, {
Canceler
} from '../../';

import { Promise } from 'es6-promise';

const config: AxiosRequestConfig = {
url: '/user',
method: 'get',
Expand Down
5 changes: 0 additions & 5 deletions typings.json

This file was deleted.

0 comments on commit 3704d57

Please sign in to comment.