Use more specific enums types where previously using number (#1198)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1198 The Yoga JS bindings converted a previous Flow type directly to TypeScript. The enum types we expose are safer than accepting raw ordinal numbers, and we should replace the places in the typings where an ordinal was accepted instead of the specific type. Reviewed By: cipolleschi Differential Revision: D42265824 fbshipit-source-id: 6adcf24a612e79037fdceab0e9f6e4db09fe3ab2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cfc3696013
commit
9fe1e77274
24
javascript/src_js/wrapAsm.d.ts
vendored
24
javascript/src_js/wrapAsm.d.ts
vendored
@@ -8,17 +8,19 @@
|
||||
*/
|
||||
|
||||
import type {
|
||||
Edge,
|
||||
Wrap,
|
||||
Align,
|
||||
Direction,
|
||||
Display,
|
||||
Edge,
|
||||
ExperimentalFeature,
|
||||
FlexDirection,
|
||||
Gutter,
|
||||
Direction,
|
||||
PositionType,
|
||||
Overflow,
|
||||
Justify,
|
||||
Display,
|
||||
ExperimentalFeature,
|
||||
MeasureMode,
|
||||
Overflow,
|
||||
PositionType,
|
||||
Unit,
|
||||
Wrap,
|
||||
} from './generated/YGEnums';
|
||||
|
||||
import type * as YGEnums from './generated/YGEnums';
|
||||
@@ -38,7 +40,7 @@ type Size = {
|
||||
}
|
||||
|
||||
type Value = {
|
||||
unit: number;
|
||||
unit: Unit;
|
||||
value: number;
|
||||
}
|
||||
|
||||
@@ -53,14 +55,14 @@ export type Config = {
|
||||
useLegacyStretchBehaviour(): boolean,
|
||||
setUseLegacyStretchBehaviour(useLegacyStretchBehaviour: boolean): void,
|
||||
useWebDefaults(): boolean,
|
||||
setUseWebDefaults(useWebDefaults): void,
|
||||
setUseWebDefaults(useWebDefaults: boolean): void,
|
||||
};
|
||||
|
||||
export type MeasureFunction = (
|
||||
width: number,
|
||||
widthMode: number,
|
||||
widthMode: MeasureMode,
|
||||
height: number,
|
||||
heightMode: number
|
||||
heightMode: MeasureMode
|
||||
) => Size;
|
||||
|
||||
export type Node = {
|
||||
|
Reference in New Issue
Block a user