From 7280abd9980f1c221f44360df4bd4a209837c136 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Tue, 29 Oct 2019 17:05:56 +0200 Subject: [PATCH] vue-resource: Provides its own types (#39567) --- notNeededPackages.json | 6 ++ types/vue-resource/index.d.ts | 124 ----------------------- types/vue-resource/package.json | 6 -- types/vue-resource/tsconfig.json | 24 ----- types/vue-resource/tslint.json | 80 --------------- types/vue-resource/vue-resource-tests.ts | 63 ------------ 6 files changed, 6 insertions(+), 297 deletions(-) delete mode 100644 types/vue-resource/index.d.ts delete mode 100644 types/vue-resource/package.json delete mode 100644 types/vue-resource/tsconfig.json delete mode 100644 types/vue-resource/tslint.json delete mode 100644 types/vue-resource/vue-resource-tests.ts diff --git a/notNeededPackages.json b/notNeededPackages.json index f985dc0c27..4acc593eb4 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -4398,6 +4398,12 @@ "sourceRepoURL": "https://github.com/kazupon/vue-i18n", "asOfVersion": "7.0.0" }, + { + "libraryName": "vue-resource", + "typingsPackageName": "vue-resource", + "sourceRepoURL": "https://github.com/vuejs/vue-resource", + "asOfVersion": "1.3.6" + }, { "libraryName": "vue-router", "typingsPackageName": "vue-router", diff --git a/types/vue-resource/index.d.ts b/types/vue-resource/index.d.ts deleted file mode 100644 index 5300f722dc..0000000000 --- a/types/vue-resource/index.d.ts +++ /dev/null @@ -1,124 +0,0 @@ -// Type definitions for vue-resoure 0.9.3 -// Project: https://github.com/vuejs/vue-resource -// Definitions by: kaorun343 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace vuejs { - - interface HttpHeaders { - put?: { [key: string]: string }; - post?: { [key: string]: string }; - patch?: { [key: string]: string }; - delete?: { [key: string]: string }; - common?: { [key: string]: string }; - custom?: { [key: string]: string }; - [key: string]: any; - } - - interface HttpResponse { - data: Object; - ok: boolean; - status: number; - statusText: string; - headers: Function; - text():string; - json():any; - blob():Blob; - } - - interface HttpOptions { - url?: string; - method?: string; - body?: any; - params?: any; - headers?: any; - before?(request: any): any; - progress?(event: any): any; - credentials?:boolean; - emulateHTTP?: boolean; - emulateJSON?: boolean; - } - - interface $http { - (url: string, data?: any, options?: HttpOptions): PromiseLike; - (url: string, options?: HttpOptions): PromiseLike; - } - - interface HttpInterceptor { - request?(request: HttpOptions): HttpOptions; - response?(response: HttpResponse): HttpResponse; - } - - interface Http { - options: HttpOptions & { root: string }; - headers: HttpHeaders; - interceptors: (HttpInterceptor | (() => HttpInterceptor))[]; - get: $http; - post: $http; - put: $http; - patch: $http; - delete: $http; - jsonp: $http; - } - - interface ResourceActions { - get: { method: string }; - save: { method: string }; - query: { method: string }; - update: { method: string }; - remove: { method: string }; - delete: { method: string }; - } - - interface ResourceMethod { - (params: any, data?: any, success?: Function, error?: Function): PromiseLike; - (params: any, success?: Function, error?: Function): PromiseLike; - (success?: Function, error?: Function): PromiseLike; - } - - interface ResourceMethods { - get: ResourceMethod; - save: ResourceMethod; - query: ResourceMethod; - update: ResourceMethod; - remove: ResourceMethod; - delete: ResourceMethod; - } - - interface $resource { - (url: string, params?: Object, actions?: any, options?: HttpOptions): ResourceMethods; - } - - interface Resource extends $resource { - actions: ResourceActions; - } - - interface Vue { - $http: { - (options: HttpOptions): PromiseLike; - get: $http; - post: $http; - put: $http; - patch: $http; - delete: $http; - jsonp: $http; - }; - $resource: $resource; - } - - interface VueStatic { - http: Http; - resource: Resource; - } - - interface ComponentOption { - http?: (HttpOptions & { headers?: HttpHeaders } & { [key: string]: any }) - } -} - -declare module "vue-resource" { - const install: (vue: vuejs.VueStatic) => void; - export = install; -} diff --git a/types/vue-resource/package.json b/types/vue-resource/package.json deleted file mode 100644 index 95d860e575..0000000000 --- a/types/vue-resource/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "@types/vue": "^1.0.31" - } -} diff --git a/types/vue-resource/tsconfig.json b/types/vue-resource/tsconfig.json deleted file mode 100644 index 62b9761326..0000000000 --- a/types/vue-resource/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "vue-resource-tests.ts" - ] -} \ No newline at end of file diff --git a/types/vue-resource/tslint.json b/types/vue-resource/tslint.json deleted file mode 100644 index 3d59f55fda..0000000000 --- a/types/vue-resource/tslint.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "npm-naming": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} diff --git a/types/vue-resource/vue-resource-tests.ts b/types/vue-resource/vue-resource-tests.ts deleted file mode 100644 index 07baf8eaf6..0000000000 --- a/types/vue-resource/vue-resource-tests.ts +++ /dev/null @@ -1,63 +0,0 @@ - - -Vue.http.options.root = '/root'; -Vue.http.headers.common['Authorization'] = 'Basic YXBpOnBhc3N3b3Jk'; - -new Vue({ - http: { - root: '/root', - headers: { - Authorization: 'Basic' - } - } -}); - -Vue.http.options.emulateJSON = true; -Vue.http.options.emulateHTTP = true; - -class App extends Vue { - ready() { - this.$http({ url: '/someUrl', method: 'GET' }).then((response) => { - // - }, (response) => { - // - }); - - this.$http.get('/someUrl').then((response) => { - const status = response.status; - const headers = response.headers(); - response.headers('expires'); - - this.$set('someData', response.data); - this.$set('someJsonData', response.json()); - this.$set('someTextData', response.text()); - this.$set('someBlobData', response.blob()); - }); - - var resource = this.$resource('someItem/{id}'); - resource.get({id: 1}).then((response) => {}); - resource.save({id: 1}, {item: 30}).then((responce) => {}); - } -} - -Vue.http.get('/someUrl', {}, {}); - -Vue.http.interceptors.push({ - request: function(request) { - return request; - }, - response: function(response) { - return response; - } -}); - -Vue.http.interceptors.push(function() { - return { - request: function(request) { - return request; - }, - response: function(response) { - return response; - } - } -});