# LitElement TypeScript

This project includes a sample component using LitElement with TypeScript.
In order to install it and see the example, you will have to copy SDK files the demo folder and launch a series of commands that you will see below.
## Install dependencies

To install the necessary dependencies of LitElement you have to launch in the command console:

```bash
npm i
```

## Copy SDK files

Copy ``assets`` folder, ``vd-document.es.js`` and ``vd-document.umd.js`` files from your own sdk folder to the static assets folder (/demo) of your project. Please refer to [Veridas product documentation hub](https://docs.veridas.com/) for setup, configuration and integration examples

## Build

This sample uses the TypeScript compiler to produce JavaScript that runs in modern browsers.

To build the JavaScript version of your component:

```bash
npm run build
```

To watch files and rebuild when the files are modified, run the following command in a separate shell:

```bash
npm run build:watch
```

Both the TypeScript compiler and lit-analyzer are configured to be very strict. You may want to change `tsconfig.json` to make them less strict.

## Development server

To be able to see the changes that are made while developing or to see the example that has been made, you have to launch the following command:

```bash
npm run start
```

There is a development HTML file located at `/demo/index.html` that you can view at `https://localhost:8000/demo/index.html`.

This sample uses modern-web.dev's [@web/dev-server](https://www.npmjs.com/package/@web/dev-server) for previewing the project without additional build steps. Web Dev Server handles resolving Node-style "bare" import specifiers, which aren't supported in browsers. It also automatically transpiles JavaScript and adds polyfills to support older browsers. See [modern-web.dev's Web Dev Server documentation](https://modern-web.dev/docs/dev-server/overview/) for more information.

For more information about the framework visit this [link](https://lit.dev/)
