Why doesn't this declaration method work: declare module "*!text" {} ?

The goal is to use the contents of the file in a variable:

 import layout = require("/js/views/layouts/wnd.html!text"); 

or so:

 import layout from "/js/views/layouts/wnd.html!text"; 

If you make the declaration like this: declare module "/js/views/layouts/wnd.html!text" {} - then everything works, and if you use such a method "*!text" you get an error cannot find module . How to make such a template "*!text" ?

Link to example from documentation

I use systemJS with this plugin to download text files.

TS Version 2.0.6

  • what version of ts do you use? - anstarovoyt
  • @anstarovoyt Version typescript - 2.0 - sanu0074
  • why do you think it should work at all? - Grundy
  • @Grundy because there is an example: typescriptlang.org/docs/handbook/… - sanu0074
  • add this link to the question itself. and pay attention to the first line there: Some module loaders such as SystemJS and AMD allow non-javascript content to be imported. - Grundy

0