@node-3d/webaudio 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import { inspect } from 'node:util';
2
- declare const AudioBuffer: import("./native.ts").TNativeEs5Constructor<[context: import("./native.ts").TBaseAudioContext, source?: Readonly<{
2
+ declare const AudioBuffer: import("./native.js").TNativeEs5Constructor<[context: import("./native.js").TBaseAudioContext, source?: Readonly<{
3
3
  length?: number;
4
4
  numberOfChannels?: number;
5
5
  sampleRate?: number;
6
- }> | import("./native.ts").TNativeExternal | undefined], import("./native.ts").TAudioBuffer>;
6
+ }> | import("./native.js").TNativeExternal | undefined], import("./native.js").TAudioBuffer>;
7
7
  declare class JsAudioBuffer extends AudioBuffer {
8
8
  [inspect.custom](): string;
9
9
  toString(): string;
@@ -1,4 +1,4 @@
1
- import type { TJsBaseAudioContext } from './base-audio-context.ts';
2
- import type { TAudioContext, TAudioContextOptions, TNativeConstructor } from './native.ts';
1
+ import type { TJsBaseAudioContext } from './base-audio-context.js';
2
+ import type { TAudioContext, TAudioContextOptions, TNativeConstructor } from './native.js';
3
3
  declare const WrappedAudioContext: TNativeConstructor<[opts?: TAudioContextOptions], TAudioContext & TJsBaseAudioContext>;
4
4
  export { WrappedAudioContext as AudioContext };
@@ -1,4 +1,4 @@
1
- import type { TAudioDestinationNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.ts';
1
+ import type { TAudioDestinationNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.js';
2
2
  type TAudioDestinationNodeConstructor = TNativeConstructor<[
3
3
  ctx: TBaseAudioContext,
4
4
  node: TNativeExternal
@@ -1,6 +1,6 @@
1
1
  import { inspect } from 'node:util';
2
- import type { TBaseAudioContext, TNativeExternal } from './native.ts';
3
- declare const AudioListener: import("./native.ts").TNativeEs5Constructor<[context: TBaseAudioContext, listener: TNativeExternal, paramCtor: import("./native.ts").TAudioParamConstructor], import("./native.ts").TAudioListener>;
2
+ import type { TBaseAudioContext, TNativeExternal } from './native.js';
3
+ declare const AudioListener: import("./native.js").TNativeEs5Constructor<[context: TBaseAudioContext, listener: TNativeExternal, paramCtor: import("./native.js").TAudioParamConstructor], import("./native.js").TAudioListener>;
4
4
  declare class JsAudioListener extends AudioListener {
5
5
  constructor(ctx: TBaseAudioContext, listener: TNativeExternal);
6
6
  [inspect.custom](): string;
@@ -1,4 +1,4 @@
1
- import type { TAudioNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.ts';
1
+ import type { TAudioNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.js';
2
2
  type TAudioNodeConstructor = TNativeConstructor<[
3
3
  ctx: TBaseAudioContext,
4
4
  node: TNativeExternal
@@ -1,6 +1,6 @@
1
1
  import { inspect } from 'node:util';
2
- import type { TAudioEventCallbackList } from './native.ts';
3
- declare const AudioParam: import("./native.ts").TAudioParamConstructor;
2
+ import type { TAudioEventCallbackList } from './native.js';
3
+ declare const AudioParam: import("./native.js").TAudioParamConstructor;
4
4
  declare class JsAudioParam extends AudioParam {
5
5
  get onerror(): TAudioEventCallbackList;
6
6
  set onerror(cb: TAudioEventCallbackList);
@@ -1,4 +1,4 @@
1
- import type { TAudioScheduledSourceNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.ts';
1
+ import type { TAudioScheduledSourceNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.js';
2
2
  type TAudioScheduledSourceNodeConstructor = TNativeConstructor<[
3
3
  ctx: TBaseAudioContext,
4
4
  node: TNativeExternal
@@ -1,6 +1,6 @@
1
- import { AudioDestinationNode } from './audio-destination-node.ts';
2
- import { AudioListener } from './audio-listener.ts';
3
- import type { TAnalyserNode, TAudioBuffer, TAudioBufferSourceNode, TAudioNodeOptions, TBaseAudioContext, TBiquadFilterNode, TConvolverNode, TDelayNode, TGainNode, TNativeConstructor, TNativeExternal, TOscillatorNode, TPannerNode } from './native.ts';
1
+ import { AudioDestinationNode } from './audio-destination-node.js';
2
+ import { AudioListener } from './audio-listener.js';
3
+ import type { TAnalyserNode, TAudioBuffer, TAudioBufferSourceNode, TAudioNodeOptions, TBaseAudioContext, TBiquadFilterNode, TConvolverNode, TDelayNode, TGainNode, TNativeConstructor, TNativeExternal, TOscillatorNode, TPannerNode } from './native.js';
4
4
  export type TJsBaseAudioContext = TBaseAudioContext & {
5
5
  _initListener: (destinationCtor: typeof AudioDestinationNode, listenerCtor: typeof AudioListener, sampleRate: number) => void;
6
6
  createAnalyser: (opts?: TAudioNodeOptions) => TAnalyserNode;
package/dist/core.d.ts CHANGED
@@ -1 +1 @@
1
- export { native } from './native.ts';
1
+ export { native } from './native.js';
package/dist/events.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { EventEmitter } from 'node:events';
2
- import type { TAudioEventCallbackList } from './native.ts';
2
+ import type { TAudioEventCallbackList } from './native.js';
3
3
  export declare const setEventCallbacks: (emitter: EventEmitter, eventName: string, callbacks: TAudioEventCallbackList) => void;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { AudioBuffer } from './audio-buffer.ts';
2
- export { AudioContext } from './audio-context.ts';
3
- export { AudioParam } from './audio-param.ts';
4
- export * from './nodes.ts';
5
- export type * from './native.ts';
1
+ export { AudioBuffer } from './audio-buffer.js';
2
+ export { AudioContext } from './audio-context.js';
3
+ export { AudioParam } from './audio-param.js';
4
+ export * from './nodes.js';
5
+ export type * from './native.js';
package/dist/index.js CHANGED
@@ -111,14 +111,14 @@ class JsAudioParam extends AudioParam {
111
111
  get onerror() {
112
112
  return this.listeners('error');
113
113
  }
114
- set onerror(cb1) {
115
- setEventCallbacks(this, 'error', cb1);
114
+ set onerror(cb) {
115
+ setEventCallbacks(this, 'error', cb);
116
116
  }
117
117
  get onended() {
118
118
  return this.listeners('ended');
119
119
  }
120
- set onended(cb1) {
121
- setEventCallbacks(this, 'ended', cb1);
120
+ set onended(cb) {
121
+ setEventCallbacks(this, 'ended', cb);
122
122
  }
123
123
  [audio_param_computedKey]() {
124
124
  return this.toString();
@@ -274,14 +274,14 @@ const baseAudioContextPrototype = {
274
274
  createBufferSource (opts = {}) {
275
275
  return new nodes.AudioBufferSourceNode(this, opts);
276
276
  },
277
- createChannelMerger (opts = {}) {
278
- return new nodes.ChannelMergerNode(this, opts);
277
+ createChannelMerger () {
278
+ throw new Error('createChannelMerger is not implemented by this audio backend');
279
279
  },
280
- createChannelSplitter (opts = {}) {
281
- return new nodes.ChannelSplitterNode(this, opts);
280
+ createChannelSplitter () {
281
+ throw new Error('createChannelSplitter is not implemented by this audio backend');
282
282
  },
283
- createConstantSource (opts = {}) {
284
- return new nodes.ConstantSourceNode(this, opts);
283
+ createConstantSource () {
284
+ throw new Error('createConstantSource is not implemented by this audio backend');
285
285
  },
286
286
  createConvolver (opts = {}) {
287
287
  return new nodes.ConvolverNode(this, opts);
@@ -291,14 +291,14 @@ const baseAudioContextPrototype = {
291
291
  maxDelayTime
292
292
  });
293
293
  },
294
- createDynamicsCompressor (opts = {}) {
295
- return new nodes.DynamicsCompressorNode(this, opts);
294
+ createDynamicsCompressor () {
295
+ throw new Error('createDynamicsCompressor is not implemented by this audio backend');
296
296
  },
297
297
  createGain (opts = {}) {
298
298
  return new nodes.GainNode(this, opts);
299
299
  },
300
- createIIRFilter (opts = {}) {
301
- return new nodes.IIRFilterNode(this, opts);
300
+ createIIRFilter () {
301
+ throw new Error('createIIRFilter is not implemented by this audio backend');
302
302
  },
303
303
  createOscillator (opts = {}) {
304
304
  return new nodes.OscillatorNode(this, opts);
@@ -306,21 +306,21 @@ const baseAudioContextPrototype = {
306
306
  createPanner (opts = {}) {
307
307
  return new nodes.PannerNode(this, opts);
308
308
  },
309
- createPeriodicWave (opts = {}) {
310
- return new nodes.PeriodicWaveNode(this, opts);
309
+ createPeriodicWave () {
310
+ throw new Error('createPeriodicWave is not implemented by this audio backend');
311
311
  },
312
- createScriptProcessor (opts = {}) {
313
- return new nodes.ScriptProcessorNode(this, opts);
312
+ createScriptProcessor () {
313
+ throw new Error('createScriptProcessor is not implemented by this audio backend');
314
314
  },
315
- createStereoPanner (opts = {}) {
316
- return new nodes.StereoPannerNode(this, opts);
315
+ createStereoPanner () {
316
+ throw new Error('createStereoPanner is not implemented by this audio backend');
317
317
  },
318
- createWaveShaper (opts = {}) {
319
- return new nodes.WaveShaperNode(this, opts);
318
+ createWaveShaper () {
319
+ throw new Error('createWaveShaper is not implemented by this audio backend');
320
320
  }
321
321
  };
322
- base_audio_context_JsBaseAudioContext.prototype = baseAudioContextPrototype;
323
322
  inherits(base_audio_context_JsBaseAudioContext, BaseAudioContext);
323
+ Object.defineProperties(base_audio_context_JsBaseAudioContext.prototype, Object.getOwnPropertyDescriptors(baseAudioContextPrototype));
324
324
  function audio_context_to_primitive(input, hint) {
325
325
  if ("object" !== audio_context_type_of(input) || null === input) return input;
326
326
  var prim = input[Symbol.toPrimitive];
package/dist/native.d.ts CHANGED
@@ -5,7 +5,8 @@ export type TAudioEvent = Readonly<{
5
5
  type: string;
6
6
  [key: string]: unknown;
7
7
  }>;
8
- export type TAudioEventCallback<T extends TAudioEvent = TAudioEvent> = (event: T) => boolean | undefined;
8
+ /** Event listener return values are ignored, matching Node's EventEmitter behavior. */
9
+ export type TAudioEventCallback<T extends TAudioEvent = TAudioEvent> = (event: T) => void;
9
10
  export type TAudioEventCallbackList<T extends TAudioEvent = TAudioEvent> = TAudioEventCallback<T> | readonly TAudioEventCallback<T>[] | null | undefined;
10
11
  export type TAudioContextState = 'closed' | 'interrupted' | 'running' | 'suspended';
11
12
  export type TChannelCountMode = 'clamped-max' | 'explicit' | 'max';
package/dist/nodes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { TAnalyserNode, TAudioBufferSourceNode, TAudioNode, TAudioNodeOptions, TAudioScheduledSourceNode, TBaseAudioContext, TBiquadFilterNode, TConvolverNode, TDelayNode, TGainNode, TOscillatorNode, TPannerNode } from './native.ts';
1
+ import type { TAnalyserNode, TAudioBufferSourceNode, TAudioNode, TAudioNodeOptions, TAudioScheduledSourceNode, TBaseAudioContext, TBiquadFilterNode, TConvolverNode, TDelayNode, TGainNode, TOscillatorNode, TPannerNode } from './native.js';
2
2
  type TNodeConstructor<TInstance extends object = TAudioNode> = new (ctx: TBaseAudioContext, opts?: TAudioNodeOptions) => TInstance;
3
3
  type TExportedNodeName = 'AnalyserNode' | 'AudioBufferSourceNode' | 'AudioScheduledSourceNode' | 'BiquadFilterNode' | 'ConvolverNode' | 'DelayNode' | 'GainNode' | 'OscillatorNode' | 'PannerNode';
4
4
  type TNodeMap = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Luis Blanco <luisblanco1337@gmail.com>",
3
3
  "name": "@node-3d/webaudio",
4
- "version": "6.0.0",
4
+ "version": "6.0.1",
5
5
  "description": "Web Audio for Node.js",
6
6
  "license": "MIT",
7
7
  "main": "dist/index.js",
@@ -19,15 +19,14 @@
19
19
  "files": [
20
20
  "dist",
21
21
  "install.js",
22
- "LICENSE",
23
- "package.json",
24
- "tsconfig.json"
22
+ "LICENSE"
25
23
  ],
26
24
  "engines": {
27
- "node": ">=24.13.0",
28
- "npm": ">=11.6.2"
25
+ "node": ">=22.18.0",
26
+ "npm": ">=10.9.0"
29
27
  },
30
28
  "scripts": {
29
+ "i": "npm install --workspaces=false",
31
30
  "postinstall": "node install.js",
32
31
  "build:rebuild": "cd src && node-gyp rebuild -j max && node -e \"import('@node-3d/addon-tools').then((m) => m.cpbin('webaudio'))\"",
33
32
  "build:compile": "cd src && node-gyp build -j max && node -e \"import('@node-3d/addon-tools').then((m) => m.cpbin('webaudio'))\"",
@@ -50,17 +49,18 @@
50
49
  "url": "git+https://github.com/node-3d/webaudio.git"
51
50
  },
52
51
  "dependencies": {
53
- "@node-3d/addon-tools": "~10.0.1",
54
- "@node-3d/deps-labsound": "~7.0.0",
55
- "@node-3d/segfault": "~4.0.0"
52
+ "@node-3d/addon-tools": "~10.1.0",
53
+ "@node-3d/deps-labsound": "~7.0.1",
54
+ "@node-3d/segfault": "~4.0.2"
56
55
  },
57
56
  "devDependencies": {
58
57
  "@types/node": "24.13.2",
59
- "node-addon-api": "8.9.0",
60
- "oxlint": "1.72.0",
58
+ "node-addon-api": "8.9.2",
59
+ "oxlint": "1.81.0",
60
+ "oxlint-tsgolint": "7.0.2001",
61
61
  "tslib": "2.8.1",
62
- "@rslib/core": "0.23.2",
63
- "oxfmt": "0.57.0",
62
+ "@rslib/core": "1.0.0",
63
+ "oxfmt": "0.66.0",
64
64
  "typescript": "7.0.2",
65
65
  "clang-format-node": "3.0.7"
66
66
  },
package/tsconfig.json DELETED
@@ -1,30 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2024",
4
- "module": "ESNext",
5
- "moduleResolution": "Bundler",
6
- "strict": true,
7
- "allowImportingTsExtensions": true,
8
- "rewriteRelativeImportExtensions": true,
9
- "declaration": true,
10
- "declarationMap": false,
11
- "sourceMap": false,
12
- "rootDir": ".",
13
- "outDir": "dist",
14
- "paths": {
15
- "@node-3d/webaudio": [
16
- "./ts/index.ts"
17
- ]
18
- },
19
- "verbatimModuleSyntax": true,
20
- "skipLibCheck": true,
21
- "types": [
22
- "node"
23
- ]
24
- },
25
- "include": [
26
- "*.ts",
27
- "ts/**/*.ts",
28
- "examples/**/*.ts"
29
- ]
30
- }