refactor(debugger): add JSDoc types for CDP getProperties#7418
refactor(debugger): add JSDoc types for CDP getProperties#7418
Conversation
Add comprehensive type definitions for Runtime.getProperties results from Chrome DevTools Protocol API, including extended typedefs for cases where optional properties are guaranteed to exist (e.g., internalProperties for iterables, proxies, and ArrayBuffers). This improves type safety and documentation without changing runtime behavior.
Overall package sizeSelf size: 4.5 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.3 | 76.87 kB | 808.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7418 +/- ##
==========================================
- Coverage 80.39% 80.39% -0.01%
==========================================
Files 732 732
Lines 31028 31028
==========================================
- Hits 24945 24944 -1
- Misses 6083 6084 +1 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
BenchmarksBenchmark execution time: 2026-02-03 06:53:48 Comparing candidate commit 5fbfb43 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 227 metrics, 33 unstable metrics. |
Add comprehensive type definitions for Runtime.getProperties results from Chrome DevTools Protocol API, including extended typedefs for cases where optional properties are guaranteed to exist (e.g., internalProperties for iterables, proxies, and ArrayBuffers). This improves type safety and documentation without changing runtime behavior.
Add comprehensive type definitions for Runtime.getProperties results from Chrome DevTools Protocol API, including extended typedefs for cases where optional properties are guaranteed to exist (e.g., internalProperties for iterables, proxies, and ArrayBuffers). This improves type safety and documentation without changing runtime behavior.
Add comprehensive type definitions for Runtime.getProperties results from Chrome DevTools Protocol API, including extended typedefs for cases where optional properties are guaranteed to exist (e.g., internalProperties for iterables, proxies, and ArrayBuffers). This improves type safety and documentation without changing runtime behavior.
Add comprehensive type definitions for Runtime.getProperties results from Chrome DevTools Protocol API, including extended typedefs for cases where optional properties are guaranteed to exist (e.g., internalProperties for iterables, proxies, and ArrayBuffers). This improves type safety and documentation without changing runtime behavior.

What does this PR do?
Adds comprehensive JSDoc type definitions for Chrome DevTools Protocol (CDP)
Runtime.getPropertiesAPI calls in the debugger snapshot collector. The changes introduce several extended typedefs that capture cases where optional properties are guaranteed to exist in practice (e.g.,internalPropertiesfor iterables, proxies, and ArrayBuffers, andprivatePropertiesfor all objects).Motivation
The CDP API returns results with optional properties that are context-dependent. While TypeScript definitions mark these as optional, certain object types always have specific properties populated. This PR adds type safety and better documentation by:
GetPropertiesResulttypedef that extends the base type to includeprivatePropertiesGetPropertiesResultWithInternalsandGetPropertiesResultWithInternalValuesfor cases where internal properties are guaranteedThis improves code maintainability and helps prevent potential bugs from incorrect assumptions about property existence.
Additional Notes