Replies: 4 comments 12 replies
-
Do you have this package installed? https://www.npmjs.com/package/@types/prismjs |
Beta Was this translation helpful? Give feedback.
-
How you use Prism very much depends on your environment. Do you use a framework to build a website (meaning that Prism will be executed in the browser), or do you build a server application (meaning that Prism will be executed by NodeJS)? Also, |
Beta Was this translation helpful? Give feedback.
-
I tried The only thing I managed to work so far is to do this:
Meaning I have to hard code the type. I thought including |
Beta Was this translation helpful? Give feedback.
-
1 and 2 above both import types, but neither will give a type for the Prism global object. Hence I had to create my own type. It seems Prism requires one to declare a global variable of a certain type. All examples I have seen are using the We only do one call to Prism, the one mentioned above. It's an Angular CLI generated app. No babel plugin. All I am looking for is the type for the Prism global variable. It has the |
Beta Was this translation helpful? Give feedback.
-
I wonder if you have an example how to use Prism from typescript? I cannot find any and cannot figure it out.
I have seen code like this, but that doesn’t use any types. I saw you added types, but how do you import them and use them here?
I tried this:
import * as Prism from 'prismjs';
But then calls to Prism didn’t work. No errors, just nothing happened. So I assume I need to declare the Prism variable and a type but cannot figure out what type to use.
Beta Was this translation helpful? Give feedback.
All reactions