Skip to content

TypeScript

The library provides a built-in support of Typescript that should work out of the box

It adds the <idlive-document-capture> tag and the type HTMLIdLiveDocCaptureElement to the global scope

In addition, it provides types for all events emitted by the component

import type { CaptureEvent } from 'idlive-document-capture-web';

const idliveDocCapture: HTMLIdLiveDocCaptureElement = document.querySelector('idlive-document-capture');

idliveDocCapture.addEventListener('capture', (event) => {
    // event has type CaptureEvent
    handleCapture(event);
});

const handleCapture = (event: CaptureEvent) => {};