Skip to content

Commit 03abc54

Browse files
DavertMikclaude
andcommitted
fix(typings): avoid nullable-shorthand-on-inline-object-shape in new CDPBrowser jsdoc
_armActionSettle's return type and _waitForAction's armed param used the {?{...}} nullable shorthand on an inline object shape, the exact pattern a sibling commit (0081ef3) just swept the rest of this file for -- also visibly malformed the generated docs (a trailing "?" on the type, doubled to "??" on the optional param). Converted both to the union form ({...}|null), matching the rest of the file. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 0a27ad9 commit 03abc54

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/helpers/CDPBrowser.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ No timeout here: `_waitForAction` applies the grace window itself, starting from
8181
runs (after the action's own dispatch already resolved), racing this already-armed listener
8282
against a fresh timer instead of one that started ticking before the action even began.
8383

84-
Returns **{promise: [Promise][1]<([string][2] | null)>, cancel: [function][3]}?**&#x20;
84+
Returns **({promise: [Promise][1]<([string][2] | null)>, cancel: [function][3]} | null)**&#x20;
8585

8686
### _assertLayoutSupported
8787

@@ -538,7 +538,7 @@ actually takes: strictly more correct for a slow navigation, not just faster for
538538

539539
#### Parameters
540540

541-
* `armed` **{promise: [Promise][1]<([string][2] | null)>, cancel: [function][3]}??** from `_armActionSettle`, called before the action.
541+
* `armed` **({promise: [Promise][1]<([string][2] | null)>, cancel: [function][3]} | null)?** from `_armActionSettle`, called before the action.
542542

543543
Returns **[Promise][1]<void>**&#x20;
544544

lib/helper/CDPBrowser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ class CDPBrowser extends Helper {
313313
* runs (after the action's own dispatch already resolved), racing this already-armed listener
314314
* against a fresh timer instead of one that started ticking before the action even began.
315315
*
316-
* @returns {?{promise: Promise<string|null>, cancel: function}}
316+
* @returns {({promise: Promise<string|null>, cancel: function}|null)}
317317
* @protected
318318
*/
319319
_armActionSettle() {
@@ -1515,7 +1515,7 @@ class CDPBrowser extends Helper {
15151515
* actually finish, rather than a fixed sleep that has no relationship to how long the navigation
15161516
* actually takes: strictly more correct for a slow navigation, not just faster for a fast one.
15171517
*
1518-
* @param {?{promise: Promise<string|null>, cancel: function}} [armed] - from `_armActionSettle`, called before the action.
1518+
* @param {({promise: Promise<string|null>, cancel: function}|null)} [armed] - from `_armActionSettle`, called before the action.
15191519
* @returns {Promise<void>}
15201520
* @protected
15211521
*/

0 commit comments

Comments
 (0)