2017-01-02 02:22:45 -08:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
2018-01-18 07:55:50 -08:00
|
|
|
*
|
|
|
|
* @flow
|
|
|
|
* @format
|
2017-01-02 02:22:45 -08:00
|
|
|
*/
|
|
|
|
|
2018-01-19 11:25:26 -08:00
|
|
|
const Yoga = require('./entry-common');
|
2018-01-18 07:55:50 -08:00
|
|
|
const nbind = require('../build/Release/nbind.js');
|
2017-01-02 02:22:45 -08:00
|
|
|
|
2018-01-18 07:55:50 -08:00
|
|
|
let ran = false;
|
|
|
|
let ret = null;
|
2017-01-02 02:22:45 -08:00
|
|
|
|
2018-01-18 07:55:50 -08:00
|
|
|
nbind({}, function(err, result) {
|
|
|
|
if (ran) {
|
|
|
|
return;
|
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
|
2018-01-18 07:55:50 -08:00
|
|
|
ran = true;
|
2017-01-02 02:22:45 -08:00
|
|
|
|
2018-01-18 07:55:50 -08:00
|
|
|
if (err) {
|
|
|
|
throw err;
|
|
|
|
}
|
2017-01-02 02:22:45 -08:00
|
|
|
|
2018-01-18 07:55:50 -08:00
|
|
|
ret = result;
|
2017-01-02 02:22:45 -08:00
|
|
|
});
|
|
|
|
|
2018-01-18 07:55:50 -08:00
|
|
|
if (!ran) {
|
|
|
|
throw new Error(
|
|
|
|
"Failed to load the yoga module - it needed to be loaded synchronously, but didn't",
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// $FlowFixMe ret will not be null here
|
|
|
|
module.exports = Yoga(ret.bind, ret.lib);
|
|
|
|
|
|
|
|
export type {
|
|
|
|
Yoga$JustifyContent,
|
|
|
|
Yoga$Align,
|
|
|
|
Yoga$FlexDirection,
|
|
|
|
Yoga$Direction,
|
|
|
|
Yoga$FlexWrap,
|
|
|
|
Yoga$Edge,
|
|
|
|
Yoga$Display,
|
|
|
|
Yoga$Unit,
|
|
|
|
Yoga$Overflow,
|
|
|
|
Yoga$PositionType,
|
|
|
|
Yoga$ExperimentalFeature,
|
|
|
|
} from './YGEnums.js';
|
2018-02-15 09:32:29 -08:00
|
|
|
|
|
|
|
export type {Yoga$Node, Yoga$Config} from './entry-common';
|