From 6bceb234d877e521b949adec6953e0decf0c769e Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Fri, 28 Oct 2016 15:11:25 +0100 Subject: [PATCH] In AureliaSpa, use whatwg-fetch to provide type info --- .../ClientApp/app/components/fetchdata/fetchdata.ts | 4 +++- templates/AureliaSpa/package.json | 1 + templates/AureliaSpa/tsconfig.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts b/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts index 6ec772b..fe9a207 100644 --- a/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts +++ b/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts @@ -1,5 +1,7 @@ -/// +// The following line is a workaround for aurelia-fetch-client requiring the type UrlSearchParams +// to exist in global scope, but that type not being declared in any public @types/* package. /// + import { HttpClient } from 'aurelia-fetch-client'; import { inject } from 'aurelia-framework'; diff --git a/templates/AureliaSpa/package.json b/templates/AureliaSpa/package.json index 8ea0cb9..d7137e8 100644 --- a/templates/AureliaSpa/package.json +++ b/templates/AureliaSpa/package.json @@ -22,6 +22,7 @@ }, "devDependencies": { "@types/node": "^6.0.45", + "@types/whatwg-fetch": "0.0.32", "aspnet-webpack": "^1.0.11", "aurelia-webpack-plugin": "^1.1.0", "copy-webpack-plugin": "^3.0.1", diff --git a/templates/AureliaSpa/tsconfig.json b/templates/AureliaSpa/tsconfig.json index 94b22fc..71d738e 100644 --- a/templates/AureliaSpa/tsconfig.json +++ b/templates/AureliaSpa/tsconfig.json @@ -7,7 +7,7 @@ "emitDecoratorMetadata": true, "skipDefaultLibCheck": true, "lib": [ "es6", "dom" ], - "types": [ "node" ] + "types": [ "node", "whatwg-fetch" ] }, "exclude": [ "bin", "node_modules" ], "atom": { "rewriteTsconfig": false }