Commit f97b9a5
fix(types): add missing standard properties to URL and URLSearchParams (#54787)
Summary:
This PR related to issue #54789 updates the `URL` and `URLSearchParams` definitions in `globals.d.ts` to include missing standard properties and methods that are already supported by the runtime implementation.
**Motivation:**
I noticed that while the runtime supports standard URL operations (backed by `whatwg-url`), the TypeScript definitions were incomplete, causing unnecessary type errors when using standard Web APIs.
## Changelog:
[GENERAL] [FIXED] - Added missing standard properties to `URL` (hash, host, pathname, etc.) and methods to `URLSearchParams` (get, set, delete, etc.).
Pull Request resolved: #54787
Test Plan:
1. Open `globals.d.ts`.
2. Verify that `URL` interface now includes all standard properties.
3. Verify that `URLSearchParams` interface now includes all standard methods.
4. Verify that no new TypeScript errors are introduced.
Screenshot:
Before making changes
<img width="1512" height="982" alt="Screenshot 2025-12-04 at 11 38 58 PM" src="https://github.com/user-attachments/assets/1b3bd18e-0f3e-476c-824f-a6b537092755" />
After making changes
![Uploading Screenshot 2025-12-04 at 11.39.42 PM.png…]()
Reviewed By: javache
Differential Revision: D88517037
Pulled By: alanleedev
fbshipit-source-id: 9225b86e134be27dac7b135370de5266d414afb41 parent dc73ec4 commit f97b9a5
1 file changed
+30
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
465 | 474 | | |
| 475 | + | |
466 | 476 | | |
467 | 477 | | |
468 | 478 | | |
| |||
479 | 489 | | |
480 | 490 | | |
481 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
482 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
483 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
484 | 513 | | |
485 | 514 | | |
486 | 515 | | |
| |||
0 commit comments