mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-11 11:50:54 +08:00
[webaudioapi] Specialize event handler type
The event handler was defined to take an argument of generic type Event: this loses the audio event specific type info as defined in the (unused) AudioProcessingEvent interface. This patch declares the onaudioprocessing event handler as accepting an argument of the correct type.
This commit is contained in:
@@ -323,3 +323,11 @@ declare var footstepsBuffer: any;
|
||||
context.startRendering();
|
||||
}
|
||||
|
||||
// Test automatic type inference of the audio processing event handler
|
||||
() => {
|
||||
var context = new AudioContext();
|
||||
var recorder = context.createScriptProcessor(2048, 1, 1);
|
||||
recorder.onaudioprocess = function (e) {
|
||||
e.inputBuffer;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user