standardized-audio-context-mock
standardized-audio-context-mock copied to clipboard
overloading global AudioContext produces a typescript error
When you use;
import { AudioContext } from 'standardized-audio-context-mock';
global.AudioContext = AudioContext;
typescript gives you an error of;
Type 'typeof AudioContextMock' is not assignable to type '{ new (contextOptions?: AudioContextOptions | undefined): AudioContext; prototype: AudioContext; }'.
Types of property 'prototype' are incompatible.
Type 'AudioContextMock' is missing the following properties from type 'AudioContext': getOutputTimestamp, createScriptProcessor