Enhance HowlOptions with pannerAttr attribute#74960
Conversation
Add pannerAttr option to HowlOptions interface
|
@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 PRCode ReviewsThis PR can be merged once it's reviewed by a DT maintainer. You can test the changes of this PR in the Playground. Status
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"
} |
|
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! |
|
🔔 @xperiments @alien35 @nicholashza @cjurango @MrGriefs — please review this PR in the next few days. Be sure to explicitly select |
andrewbranch
left a comment
There was a problem hiding this comment.
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.
|
@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! |
Add pannerAttr option to HowlOptions interface
Please fill in this template.
pnpm test <package to test>.If changing an existing definition: