mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-08 12:53:45 +08:00
Even though we were using the SDK files in the unittests for SDK, not all files were included. A CL which attempts to use sdk.js (e.g. https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165757) would then fail on several generated .d.ts issues. Issues fixed: - Usage of `Object` instead of `Map` causing issues with a type alias of `string`, since TypeScript object notation only allows primitives to be used as indices. - Missing return types for function types - A reference to `Protocol.NetworkAgent` which does not exist on the protocol. Instead, that is part of the protocol-proxy-api. Therefore, we must include the declaration file in the ts_library. This also showed that the `ProtocolApi` needs to be exported instead of declared. This means that for any future reference to any Protocol type that is actually an agent, we should be using the `ProtocolProxyApi` definitions instead. To make sure Closure understands that type, I aliased it in the externs. R=jacktfranklin@chromium.org CC=sigurds@chromium.org,szuend@chromium.org DISABLE_THIRD_PARTY_CHECK=Typescript fixes No-Presubmit: true Bug: 1011811 Change-Id: I4f5a488edb2d5fa6c5ed12d33411efb5f7fb8133 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165795 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>