microsoft / TypeScript-DOM-lib-generator

Tool for generating dom related TypeScript and JavaScript library files
Apache License 2.0
617 stars 418 forks source link

[audioworklet] AudioWorkletProcessor is missing options for constructor #1453

Open aleclarson opened 1 year ago

aleclarson commented 1 year ago

https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletProcessor/AudioWorkletProcessor

interface AudioWorkletNodeOptions {
  /** @default 1 */
  numberOfInputs?: number
  /** @default 1 */
  numberOfOutputs?: number
  outputChannelCount?: number[]
  parameterData?: any
  processorOptions?: any
}

Parameters

  • options

    • : An object that is passed as options parameter to the {{domxref("AudioWorkletNode.AudioWorkletNode", "AudioWorkletNode constructor")}} and passed through the structured clone algorithm. Available properties are as follows:
    • numberOfInputs {{optional_inline}}
      • : The value to initialize the {{domxref("AudioNode.numberOfInputs", "numberOfInputs")}} property to. Defaults to 1.
    • numberOfOutputs {{optional_inline}}
      • : The value to initialize the {{domxref("AudioNode.numberOfOutputs", "numberOfOutputs")}} property to. Defaults to 1.
    • outputChannelCount {{optional_inline}}
      • : An array defining the number of channels for each output. For example, outputChannelCount: [n, m] specifies the number of channels in the first output to be n and the second output to be m. The array length must match numberOfOutputs.
    • parameterData {{optional_inline}}
      • : An object containing the initial values of custom {{domxref("AudioParam")}} objects on this node (in its {{domxref("AudioWorkletNode.parameters", "parameters")}} property), with key being the name of a custom parameter and value being its initial value.
    • processorOptions {{optional_inline}}
      • : Any additional data that can be used for custom initialization of the underlying {{domxref("AudioWorkletProcessor")}}.

    Note that there are default values for the first two properties, so even if there are no options object passed to the {{domxref("AudioWorkletNode.AudioWorkletNode", "AudioWorkletNode constructor")}}, the options object passed by the node to the AudioWorkletProcessor constructor will exist and at minimum have numberOfInputs and numberOfOutputs.

aleclarson commented 1 year ago

Oh I see now that the type is provided by the lib.dom.d.ts

aleclarson commented 1 year ago

Well, the constructor for AudioWorkletProcessor still needs to be fixed :)