Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 1.3 KB

FAQ.md

File metadata and controls

25 lines (16 loc) · 1.3 KB

Frequently asked questions

Property 'style' does not exist on type 'Element'. ts(2339)

document.getElementById returns a plain Element. If you know that it is an element of any specific kind, you can specify that by adding a type cast as SomeElement. There are a lot of different element types. Take a look at the device document elements.

For example:

const demo = document.getElementById('demo') as GraphicsElement;
demo.style.fill = 'red';

Ignore typescript errors

You an skip checking files in different ways:

K-pay

If you have K-pay files copied within your own source code, you may see that it contains TypeScript errors. You can easily skip those checks by using one of the Ignore typescript errors techniques. The most interesting one in this case may be to checkJs: false to avoid checking K-pay .js files, while effectively checking your own .ts files.