Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

implementing Navigator.serial in Angular

I have the problem that in my Angular app the error Property 'serial' does not exist on type 'Navigator'. get.

https://stackblitz.com/edit/angular-ivy-kf19n7?file=src/app/app.component.ts

The app works in local mode. To fix this error I have to integrate serial into the Navigator interface.

https://wicg.github.io/serial/

can someone please help me how to do this ?

My attempts unfortunately show errors

interface Navigator extends MSFileSaver,..... {

readonly Serial: serial; }

Thanks :)

EDIT: solved

I Edited the Stackblitz files.

like image 983
saftione Avatar asked Jun 24 '26 04:06

saftione


1 Answers

The type information for navigator.serial is available from DefinitelyTyped as dom-serial

npm install --save-dev @types/dom-serial
like image 112
Austin Salonen Avatar answered Jun 26 '26 19:06

Austin Salonen