Skip to content

Commit 6bceb23

Browse files
In AureliaSpa, use whatwg-fetch to provide type info
1 parent acfb253 commit 6bceb23

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
/// <reference path="../../../../node_modules/aurelia-fetch-client/doc/whatwg-fetch.d.ts" />
1+
// The following line is a workaround for aurelia-fetch-client requiring the type UrlSearchParams
2+
// to exist in global scope, but that type not being declared in any public @types/* package.
23
/// <reference path="../../../../node_modules/aurelia-fetch-client/doc/url.d.ts" />
4+
35
import { HttpClient } from 'aurelia-fetch-client';
46
import { inject } from 'aurelia-framework';
57

templates/AureliaSpa/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
},
2323
"devDependencies": {
2424
"@types/node": "^6.0.45",
25+
"@types/whatwg-fetch": "0.0.32",
2526
"aspnet-webpack": "^1.0.11",
2627
"aurelia-webpack-plugin": "^1.1.0",
2728
"copy-webpack-plugin": "^3.0.1",

templates/AureliaSpa/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"emitDecoratorMetadata": true,
88
"skipDefaultLibCheck": true,
99
"lib": [ "es6", "dom" ],
10-
"types": [ "node" ]
10+
"types": [ "node", "whatwg-fetch" ]
1111
},
1212
"exclude": [ "bin", "node_modules" ],
1313
"atom": { "rewriteTsconfig": false }

0 commit comments

Comments
 (0)