Namespaced and TypeScript Enums #1285

Closed
NickGerleman wants to merge 1 commits from export-D45570417 into main

1 Commits

Author SHA1 Message Date
Nick Gerleman
4f4f52bc11 Namespaced and TypeScript Enums
Summary:
Enums are currently exposed to the JS package as constants (e.g. `import {ERRATA_NONE} from 'yoga-layout'`).

This exports enums in the form of `import {Errata} from 'yoga-layout'` then `Errata.None`.

It would be more ergonomic for these to be string union based enums instead, but right now it is a pretty thin wrapper around the native API, we need ordinal values to do things with bit masks, and folks have wanted to serialize them before.

Reviewed By: yungsters

Differential Revision: D45570417

fbshipit-source-id: 04568224569fa85801de7a265f9633cfcfa92a2f
2023-05-09 21:08:30 -07:00