How to extend the ‘Window’ typescript interface
You need the declare global declare global { interface Window { fetch:(url: string, options?: {}) => Promise<any> } } This works then: window.fetch(‘/blah’).then(…);
You need the declare global declare global { interface Window { fetch:(url: string, options?: {}) => Promise<any> } } This works then: window.fetch(‘/blah’).then(…);
This is a known bug that we have fixed in VS 2015, however you could have been affected if you installed the “Universal Windows App Development Tools” during a specific period of time. We will soon be publishing a KB with the following workaround: If the “Universal Windows App Development Tools” are still installed: Go … Read more
EDIT (Jun 5 2019): While the idea that “TypeScript supports Map natively” is still true, since version 2.1 TypeScript supports something called Record. type MyMapLikeType = Record<string, IPerson>; const peopleA: MyMapLikeType = { “a”: { name: “joe” }, “b”: { name: “bart” }, }; Unfortunately the first generic parameter (key type) is still not fully … Read more