Skip to content

Commit 655d038

Browse files
Fix FileReader.result type to include null
The TypeScript declaration for FileReader.result is typed as string | ArrayBuffer, but the actual implementation returns null when no read operation has completed or when the read was aborted. This matches the WHATWG FileReader spec where result is null in the EMPTY and LOADING states. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8bac1df commit 655d038

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-native/src/types/globals.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ declare global {
667667
| ((this: FileReader, ev: ProgressEvent<FileReader>) => any)
668668
| null;
669669
readonly readyState: number;
670-
readonly result: string | ArrayBuffer;
670+
readonly result: string | ArrayBuffer | null;
671671
abort(): void;
672672
readAsArrayBuffer(blob: Blob): void;
673673
readAsDataURL(blob: Blob): void;

0 commit comments

Comments
 (0)