From 66aa87bc58846e49ed88710078856bf415797f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 27 Apr 2026 04:26:00 -0700 Subject: [PATCH] Fix toJSON return types in bom.js.flow (#56623) Summary: Fix the return types of toJSON() methods in PerformanceEntry, PerformanceServerTiming, and Performance to return an object representation ({[string]: unknown}) instead of a string, per the WebIDL spec ([Default] object toJSON()). Changelog: [internal] Differential Revision: D102597516 --- packages/react-native/flow/bom.js.flow | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/flow/bom.js.flow b/packages/react-native/flow/bom.js.flow index f38641c0802..c6855f3df77 100644 --- a/packages/react-native/flow/bom.js.flow +++ b/packages/react-native/flow/bom.js.flow @@ -108,7 +108,7 @@ declare class PerformanceEntry { entryType: string; name: string; startTime: DOMHighResTimeStamp; - toJSON(): string; + toJSON(): {[string]: unknown}; } // https://w3c.github.io/user-timing/#performancemark @@ -127,7 +127,7 @@ declare class PerformanceServerTiming { description: string; duration: DOMHighResTimeStamp; name: string; - toJSON(): string; + toJSON(): {[string]: unknown}; } // https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming @@ -224,7 +224,7 @@ declare class Performance { endMark?: string, ): PerformanceMeasure; now(): DOMHighResTimeStamp; - toJSON(): string; + toJSON(): {[string]: unknown}; } declare var performance: Performance;