Trying to integrate the Web Speech API Interfaces (https://github.com/mdn/web-speech-api/) with an Angular application (version 4.25) and an ASP Core web server. The project is built using Visual Studio 2017 (version 15.7.1). Added @types/webspeechapi type definitions to the package.json file (version 0.0.29).
The Angular component code snippet appears as follows:
/// <reference path="../../../../node_modules/@types/webspeechapi/index.d.ts" />
import { Component } from '@angular/core';
@Component({
selector: 'home',
templateUrl: './home.component.html'
})
export class HomeComponent {
constructor() {
var recognition = new SpeechRecognition();
var speechRecognitionList = new SpeechGrammarList();
...
No compilation errors are shown at design time. However, attempting to open the page results in a 500 error message NodeInvocationException: Uncaught (in promise): ReferenceError: SpeechRecognition is not defined
The console log of the web server within Visual Studio displays the same error message.
The goal was to utilize the typing definitions but there seems to be an issue with resolving the type SpeechRecognition.