Page MenuHomePhabricator

[native] Create Flow ExpoBarcodeScanner libdef
ClosedPublic

Authored by rohan on Aug 9 2023, 11:22 AM.
Tags
None
Referenced Files
F3516259: D8771.id29816.diff
Sun, Dec 22, 1:06 PM
Unknown Object (File)
Thu, Dec 19, 4:19 AM
Unknown Object (File)
Sat, Dec 14, 5:25 AM
Unknown Object (File)
Sun, Dec 1, 12:30 AM
Unknown Object (File)
Sat, Nov 23, 1:58 PM
Unknown Object (File)
Sat, Nov 23, 1:57 PM
Unknown Object (File)
Sat, Nov 23, 12:59 PM
Unknown Object (File)
Sat, Nov 23, 12:59 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