6

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.

saftione
  • 61
  • 4
  • Interface NavigatorWithSerial extends Navigator? – MikeOne Dec 09 '20 at 19:02
  • Sorry, I do not really understand your answer. – saftione Dec 10 '20 at 10:38
  • Thanks, awesome!! Maybe you could respond the question with the link and mark it as answer: it is hard to see that this has been solved on stackblitz. Also I had to add `filters` option in SerialOptions [see docs](https://wicg.github.io/serial/#requestport-method) – Miquel Dec 29 '21 at 18:18

1 Answers1

5

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

npm install @types/dom-serial
ximon
  • 197
  • 3
  • 11