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, 2022 in TypeSript by Logan
• 2,140 points
805 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, 2022 by Nina
• 3,060 points

Related Questions In TypeSript

0 votes
1 answer

Why is Event.target not Element in Typescript?

JLRishe's answer is correct, so I simply ...READ MORE

answered Aug 3, 2022 in TypeSript by Abhinaya
• 1,160 points
4,252 views
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, 2022 in TypeSript by Nina
• 3,060 points
4,828 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, 2022 in TypeSript by Nina
• 3,060 points
1,657 views
0 votes
0 answers

Why I can't create Face3 in ThreeJS Typescript project

I am trying to create Mesh by ...READ MORE

Jul 5, 2022 in TypeSript by Logan
• 2,140 points
605 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, 2022 in TypeSript by Nina
• 3,060 points
17,633 views
0 votes
1 answer

React Native Performance: Javascript vs Typescript

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

answered Jun 13, 2022 in TypeSript by Nina
• 3,060 points
874 views
0 votes
1 answer

Using spread syntax and new Set() with typescript

This seems to be a typescript ES6 ...READ MORE

answered Aug 3, 2022 in TypeSript by Abhinaya
• 1,160 points
1,282 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, 2022 in Others by narikkadan
• 63,600 points
2,202 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, 2022 in TypeSript by Nina
• 3,060 points
535 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, 2022 in TypeSript by Nina
• 3,060 points
57,219 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP