Files
yoga/javascript/src_js/generated/YGEnums.js

93 lines
1.7 KiB
JavaScript
Raw Normal View History

Revive JavaScript Bindings (#1177) Summary: Yoga's JavaScript bindings do not work past Node 10, or on recent versions of Ubuntu even using it. This is due to a reliance on `nbind`, a library which is no longer maintained. `nbind` itself abstracts over `embind` running Emscripten to generate an asm.js build, along with building Node native modules. In the meantime, [yoga-layout-prebuilt](https://www.npmjs.com/package/yoga-layout-prebuilt) has been used by the community instead of the official package. https://github.com/facebook/yoga/pull/1177 was contributed as a conversion of bindings created using `nbind` to instead use `embind` directly. I continued building on this to add more: 1. WebAssembly support (required to be async in browsers) 2. CMake + Ninja Build for the 4 flavors 3. TypeScript typings (partially generated) 4. yarn scripts to build (working on macOS, Ubuntu, Windows) 5. A README with some usage and contribution instructions 6. Updated tests to work with Jest, and updated general infra 7. ESLint and clang-format scripts 8. More GitHub actions (and now testing Windows) 9. Probably more I kinda got carried away here lol The plan is to eventually publish this to NPM, but there is a little bit of work after this before that happens. Pull Request resolved: https://github.com/facebook/yoga/pull/1177 Test Plan: The bindings pass Jest tests (both manual and generated). GitHub actions added for the different yarn scripts. Did some manual checks on using the library as TS. Reviewed By: christophpurrer Differential Revision: D42207782 Pulled By: NickGerleman fbshipit-source-id: 1dc5ce440f1c2b9705a005bbdcc86f952785d94e
2022-12-28 01:27:12 -08:00
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @generated by enums.py
module.exports = {
ALIGN_AUTO: 0,
ALIGN_FLEX_START: 1,
ALIGN_CENTER: 2,
ALIGN_FLEX_END: 3,
ALIGN_STRETCH: 4,
ALIGN_BASELINE: 5,
ALIGN_SPACE_BETWEEN: 6,
ALIGN_SPACE_AROUND: 7,
DIMENSION_WIDTH: 0,
DIMENSION_HEIGHT: 1,
DIRECTION_INHERIT: 0,
DIRECTION_LTR: 1,
DIRECTION_RTL: 2,
DISPLAY_FLEX: 0,
DISPLAY_NONE: 1,
EDGE_LEFT: 0,
EDGE_TOP: 1,
EDGE_RIGHT: 2,
EDGE_BOTTOM: 3,
EDGE_START: 4,
EDGE_END: 5,
EDGE_HORIZONTAL: 6,
EDGE_VERTICAL: 7,
EDGE_ALL: 8,
EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0,
FLEX_DIRECTION_COLUMN: 0,
FLEX_DIRECTION_COLUMN_REVERSE: 1,
FLEX_DIRECTION_ROW: 2,
FLEX_DIRECTION_ROW_REVERSE: 3,
GUTTER_COLUMN: 0,
GUTTER_ROW: 1,
GUTTER_ALL: 2,
JUSTIFY_FLEX_START: 0,
JUSTIFY_CENTER: 1,
JUSTIFY_FLEX_END: 2,
JUSTIFY_SPACE_BETWEEN: 3,
JUSTIFY_SPACE_AROUND: 4,
JUSTIFY_SPACE_EVENLY: 5,
LOG_LEVEL_ERROR: 0,
LOG_LEVEL_WARN: 1,
LOG_LEVEL_INFO: 2,
LOG_LEVEL_DEBUG: 3,
LOG_LEVEL_VERBOSE: 4,
LOG_LEVEL_FATAL: 5,
MEASURE_MODE_UNDEFINED: 0,
MEASURE_MODE_EXACTLY: 1,
MEASURE_MODE_AT_MOST: 2,
NODE_TYPE_DEFAULT: 0,
NODE_TYPE_TEXT: 1,
OVERFLOW_VISIBLE: 0,
OVERFLOW_HIDDEN: 1,
OVERFLOW_SCROLL: 2,
POSITION_TYPE_STATIC: 0,
POSITION_TYPE_RELATIVE: 1,
POSITION_TYPE_ABSOLUTE: 2,
PRINT_OPTIONS_LAYOUT: 1,
PRINT_OPTIONS_STYLE: 2,
PRINT_OPTIONS_CHILDREN: 4,
UNIT_UNDEFINED: 0,
UNIT_POINT: 1,
UNIT_PERCENT: 2,
UNIT_AUTO: 3,
WRAP_NO_WRAP: 0,
WRAP_WRAP: 1,
WRAP_WRAP_REVERSE: 2,
};