From 3704d57ed47712e0470586f743a4780dd884c6de Mon Sep 17 00:00:00 2001 From: Nick Uraltsev Date: Tue, 14 Mar 2017 19:23:05 -0700 Subject: [PATCH] Removing Promise from axios typings in favor of built-in type declarations --- Gruntfile.js | 13 ++++++++----- index.d.ts | 6 ------ package.json | 1 - test/typescript/axios.ts | 2 -- typings.json | 5 ----- 5 files changed, 8 insertions(+), 19 deletions(-) delete mode 100644 typings.json diff --git a/Gruntfile.js b/Gruntfile.js index 05b45cc..c4a92c3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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']); }; diff --git a/index.d.ts b/index.d.ts index 03c7f1b..04b85d6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -58,12 +58,6 @@ export interface AxiosError extends Error { response?: AxiosResponse; } -export interface Promise { - then(onFulfilled: (value: V) => R1 | Promise, onRejected: (error: any) => R2 | Promise): Promise; - then(onFulfilled: (value: V) => R | Promise): Promise; - catch(onRejected: (error: any) => R | Promise): Promise; -} - export interface AxiosPromise extends Promise { } diff --git a/package.json b/package.json index 029c2ef..320c5cd 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/typescript/axios.ts b/test/typescript/axios.ts index d3d3198..c5492d8 100644 --- a/test/typescript/axios.ts +++ b/test/typescript/axios.ts @@ -10,8 +10,6 @@ import axios, { Canceler } from '../../'; -import { Promise } from 'es6-promise'; - const config: AxiosRequestConfig = { url: '/user', method: 'get', diff --git a/typings.json b/typings.json deleted file mode 100644 index e168043..0000000 --- a/typings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "es6-promise": "registry:npm/es6-promise#3.0.0+20160723033700" - } -}