fix(ai-voice): resolve speech recognition typescript and closure errors - #77
Merged
MistryVishwa merged 1 commit intoJul 8, 2026
Conversation
Creates a global ambient declaration file for the Web Speech API to resolve TS2717 conflicts across multiple pages. Removes duplicate module-scoped declarations from ai-voice and ai-tutor pages. Fixes a stale closure bug in the AI Voice page's onend handler by introducing a ref for state. Closes MistryVishwa#76
|
@Mohammad-Hassan027 is attempting to deploy a commit to the vishwamistrylearning-1037's projects Team on Vercel. A member of the Team first needs to authorize it. |
MistryVishwa
approved these changes
Jul 8, 2026
prasiddhi-105
pushed a commit
to prasiddhi-105/edupilot-1
that referenced
this pull request
Jul 9, 2026
…voice-ts-errors fix(ai-voice): resolve speech recognition typescript and closure errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves the TypeScript compilation failures affecting the Web Speech API implementations across the project, specifically addressing the issues in the AI Voice page.
Changes introduced:
types/speech-recognition.d.tsas a single, authoritative global ambient declaration for the Web Speech API.SpeechRecognitioninterfaces fromapp/(dashboard)/ai-voice/page.tsx,app/(dashboard)/ai-tutor/page.tsx, andapp/(dashboard)/ai-tutor/old-page.tsxwhich were causingTS2717clashes.TS2367) in theonendevent handler ofai-voice/page.tsxby implementing avoiceStateRefto properly track the live state inside async callbacks.Related Issue: Closes #76
Type of Change
How Has This Been Tested?
npx tsc --noEmitlocally. Verified that all previousSpeechRecognitionname/property errors (TS2304,TS2717,TS2339,TS2551) inai-voiceandai-tutorare fully resolved.voiceStateRef.currentinstead of a stale capturedvoiceState, allowing the UI to reset properly after speech ends.Visual Proof (Screenshots/GIFs/Videos):
N/A — This is primarily a type-safety and internal state management fix. No visible UI design changes were made.
Checklist:
main