Skip to content

Commit 66aa87b

Browse files
rubennortefacebook-github-bot
authored andcommitted
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
1 parent 0518d72 commit 66aa87b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/react-native/flow/bom.js.flow

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ declare class PerformanceEntry {
108108
entryType: string;
109109
name: string;
110110
startTime: DOMHighResTimeStamp;
111-
toJSON(): string;
111+
toJSON(): {[string]: unknown};
112112
}
113113

114114
// https://w3c.github.io/user-timing/#performancemark
@@ -127,7 +127,7 @@ declare class PerformanceServerTiming {
127127
description: string;
128128
duration: DOMHighResTimeStamp;
129129
name: string;
130-
toJSON(): string;
130+
toJSON(): {[string]: unknown};
131131
}
132132

133133
// https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming
@@ -224,7 +224,7 @@ declare class Performance {
224224
endMark?: string,
225225
): PerformanceMeasure;
226226
now(): DOMHighResTimeStamp;
227-
toJSON(): string;
227+
toJSON(): {[string]: unknown};
228228
}
229229

230230
declare var performance: Performance;

0 commit comments

Comments
 (0)