Page MenuHomePhabricator

[native] Create Flow ExpoBarcodeScanner libdef
ClosedPublic

Authored by rohan on Aug 9 2023, 11:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 10:11 PM
Unknown Object (File)
Mon, Oct 28, 1:28 PM
Unknown Object (File)
Sun, Oct 27, 9:00 AM
Unknown Object (File)
Sep 28 2024, 7:33 PM
Unknown Object (File)
Sep 27 2024, 1:58 PM
Unknown Object (File)
Sep 27 2024, 1:58 PM
Unknown Object (File)
Sep 27 2024, 1:58 PM
Unknown Object (File)
Sep 27 2024, 1:58 PM
Subscribers

Details

Summary

To use certain types when writing the BarCodeScanner integration, it'll probably be useful to have the types available (not entirely necessary, so this can always be abandoned / revisited at a later point if it takes too much time).

Mainly used the types in the flow-typed repo as inspiration alongside the actual typescript file from expo. I did only include the methods in the class that I planned to use, but if it's better to include them all I can do that

Depends on D8770

Test Plan

Confirmed that I can now use these types on native. Also ran flow and no errors were present

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

rohan edited the summary of this revision. (Show Details)
rohan requested review of this revision.Aug 9 2023, 11:40 AM
native/flow-typed/npm/expo-barcode-scanner_vx.x.x.js
106

You probably want $ReadOnlyArray here

110–112

Generally better to use spread

114–116

In a libdef, it's best to avoid the ambiguous {} (which depends on .flowconfig) and instead use more precise types: either {||} (exact) or {...} (inexact)

Accepting, but make sure to address @ashoat's feedback before landing

This revision is now accepted and ready to land.Aug 9 2023, 2:57 PM