Skip to content

Enhance HowlOptions with pannerAttr attribute#74960

Open
igor-tmrw wants to merge 1 commit into
DefinitelyTyped:masterfrom
igor-tmrw:patch-1
Open

Enhance HowlOptions with pannerAttr attribute#74960
igor-tmrw wants to merge 1 commit into
DefinitelyTyped:masterfrom
igor-tmrw:patch-1

Conversation

@igor-tmrw
Copy link
Copy Markdown

Add pannerAttr option to HowlOptions interface

Please fill in this template.

If changing an existing definition:

Add pannerAttr option to HowlOptions interface
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented May 6, 2026

@igor-tmrw Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

This PR can be merged once it's reviewed by a DT maintainer.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 Only a DT maintainer can approve changes without tests

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 74960,
  "author": "igor-tmrw",
  "headCommitOid": "832482f6c3edca156f5d0ad14bcfd9d97dbf6d56",
  "mergeBaseOid": "5afdcf191470cfb4efc44ff12fe66231ca64f1d9",
  "lastPushDate": "2026-05-06T09:45:45.000Z",
  "lastActivityDate": "2026-05-06T22:55:11.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "tooManyCommits": false,
  "tooManyReviews": false,
  "popularityLevel": "Popular",
  "pkgInfo": [
    {
      "name": "howler",
      "kind": "edit",
      "files": [
        {
          "path": "types/howler/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "xperiments",
        "alien35",
        "nicholashza",
        "cjurango",
        "MrGriefs"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    }
  ],
  "reviews": [
    {
      "type": "changereq",
      "reviewer": "andrewbranch",
      "date": "2026-05-06T22:55:11.000Z"
    }
  ],
  "mainBotCommentID": 4386847222,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Untested Change This PR does not touch tests labels May 6, 2026
@typescript-bot
Copy link
Copy Markdown
Contributor

Hey @igor-tmrw,

😒 Your PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Please consider adding tests to cover the change you're making. Including tests allows this PR to be merged by yourself and the owners of this module.

This can potentially save days of time for you!

@typescript-bot typescript-bot moved this to Waiting for Code Reviews in Pull Request Status Board May 6, 2026
@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @xperiments @alien35 @nicholashza @cjurango @MrGriefs — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@DangerBotOSS
Copy link
Copy Markdown

Formatting

The following files are not formatted:

  1. types/howler/index.d.ts

Consider running pnpm dprint fmt on these files to make review easier.

Generated by 🚫 dangerJS against 832482f

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board May 6, 2026
Copy link
Copy Markdown
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a documentation bug—the constructor never reads options.pannerAttr; instead, it reads all the subproperties of PannerAttributes directly off the options object:

 Howl.prototype.init = (function(_super) {
    return function(o) {
      var self = this;

      // Setup user-defined default properties.
      self._orientation = o.orientation || [1, 0, 0];
      self._stereo = o.stereo || null;
      self._pos = o.pos || null;
      self._pannerAttr = {
        coneInnerAngle: typeof o.coneInnerAngle !== 'undefined' ? o.coneInnerAngle : 360,
        coneOuterAngle: typeof o.coneOuterAngle !== 'undefined' ? o.coneOuterAngle : 360,
        coneOuterGain: typeof o.coneOuterGain !== 'undefined' ? o.coneOuterGain : 0,
        distanceModel: typeof o.distanceModel !== 'undefined' ? o.distanceModel : 'inverse',
        maxDistance: typeof o.maxDistance !== 'undefined' ? o.maxDistance : 10000,
        panningModel: typeof o.panningModel !== 'undefined' ? o.panningModel : 'HRTF',
        refDistance: typeof o.refDistance !== 'undefined' ? o.refDistance : 1,
        rolloffFactor: typeof o.rolloffFactor !== 'undefined' ? o.rolloffFactor : 1
      };

      // Setup event listeners.
      self._onstereo = o.onstereo ? [{fn: o.onstereo}] : [];
      self._onpos = o.onpos ? [{fn: o.onpos}] : [];
      self._onorientation = o.onorientation ? [{fn: o.onorientation}] : [];

      // Complete initilization with howler.js core's init function.
      return _super.call(this, o);
    };
  })(Howl.prototype.init);

It looks like the correct thing would be to make HowlOptions extend PannerAttributes.

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label May 6, 2026
@typescript-bot
Copy link
Copy Markdown
Contributor

@igor-tmrw One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@typescript-bot typescript-bot moved this from Needs Maintainer Review to Needs Author Action in Pull Request Status Board May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Popular package This PR affects a popular package (as counted by NPM download counts). Revision needed This PR needs code changes before it can be merged. Untested Change This PR does not touch tests

Projects

Status: Needs Author Action

Development

Successfully merging this pull request may close these issues.

4 participants