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)
Mon, May 6, 4:51 PM
Unknown Object (File)
Mon, May 6, 12:28 PM
Unknown Object (File)
Mon, May 6, 12:28 PM
Unknown Object (File)
Sun, May 5, 3:02 AM
Unknown Object (File)
Sun, May 5, 3:02 AM
Unknown Object (File)
Sat, May 4, 4:51 PM
Unknown Object (File)
Thu, May 2, 6:35 PM
Unknown Object (File)
Wed, May 1, 7:13 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
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #29792)

You probably want $ReadOnlyArray here

110–112 ↗(On Diff #29792)

Generally better to use spread

114–116 ↗(On Diff #29792)

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