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
• 2,140 points
59 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
• 3,020 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 in TypeSript by Abhinaya
• 760 points
12 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 in TypeSript by Nina
• 3,020 points
47 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
• 3,020 points
55 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 in TypeSript by Logan
• 2,140 points
9 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
• 3,020 points
460 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
• 3,020 points
17 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 in TypeSript by Abhinaya
• 760 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
• 11,280 points
702 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
• 3,020 points
12 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
• 3,020 points
641 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