Wildcard module declaration not work in TypeScript 2 why

0 votes

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

The goal - to use a file content in a variable:

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

or so:

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

If we do declaration as follows: declare module "/js/views/layouts/wnd.html!text" {} - everything works, but if this method is used "*!text" I get an error cannot find module. How do I force work this template: "*!text"?

The reference to an example of the documentation

I use systemJS with plug-in for download text files

Typescript version - 2.0.6

Jun 15 in TypeSript by Logan
• 1,580 points
12 views

1 answer to this question.

0 votes
I managed to resolve this by forcing the version "@typescript-eslint/eslint-plugin": "^4.17.0" - just using npm update didn't seem to work
answered Jun 16 by Nina
• 2,900 points

Related Questions In TypeSript

0 votes
1 answer

VS Code enforces semicolons, but why doesn't Angular and TypeScript not use it consistently?

JavaScript has a syntactic feature known as semicolon ...READ MORE

answered May 31 in TypeSript by Nina
• 2,900 points
22 views
0 votes
1 answer

How to use moment.js library in angular 2 typescript app?

REFERENCE: https://momentjs.com/docs/#/use-it/typescript/ You can install this by using: npm install ...READ MORE

answered Jun 1 in TypeSript by Nina
• 2,900 points
15 views
0 votes
1 answer
0 votes
1 answer

TypeScript Object assign gives me an error property assign does not exist on type ObjectConstructor

For TypeScript 2.1 and higher, you can ...READ MORE

answered May 31 in TypeSript by Nina
• 2,900 points
28 views
0 votes
1 answer

TypeScript ES6: import module "File is not a module error"

We need the export, as a part of ...READ MORE

answered Jun 7 in TypeSript by Nina
• 2,900 points
46 views
0 votes
1 answer

React Native Performance: Javascript vs Typescript

TypeScript is just compiled to JavaScript. Think ...READ MORE

answered Jun 13 in TypeSript by Nina
• 2,900 points
9 views
0 votes
1 answer

How to set meta tags using Angular universal SSR and ngx-seo plug-in?

first Install the plug-in with npm i ngx-seo ...READ MORE

answered Feb 11 in Others by narikkadan
• 10,840 points
508 views
0 votes
1 answer

What's the difference between using "let" and "var"?

The main difference is scoping rules wherein ...READ MORE

answered Feb 17 in Java by Aditya
• 7,280 points
67 views
0 votes
1 answer

What is TypeScript and why would I use it in place of JavaScript?

TypeScript is a superset of JavaScript which primarily ...READ MORE

answered May 31 in TypeSript by Nina
• 2,900 points
8 views
0 votes
1 answer

What is "not assignable to parameter of type never" error in TypeScript?

All you have to do is define ...READ MORE

answered May 31 in TypeSript by Nina
• 2,900 points
28 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP