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';
You an skip checking files in different ways:
// @ts-nocheck
.// @ts-ignore
.checkJs: false
in the appropriatetsconfig.json
file.
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.