/ native-ts / yoga-layout / enums.ts
enums.ts
  1  /**
  2   * Yoga enums — ported from yoga-layout/src/generated/YGEnums.ts
  3   * Kept as `const` objects (not TS enums) per repo convention.
  4   * Values match upstream exactly so callers don't change.
  5   */
  6  
  7  export const Align = {
  8    Auto: 0,
  9    FlexStart: 1,
 10    Center: 2,
 11    FlexEnd: 3,
 12    Stretch: 4,
 13    Baseline: 5,
 14    SpaceBetween: 6,
 15    SpaceAround: 7,
 16    SpaceEvenly: 8,
 17  } as const
 18  export type Align = (typeof Align)[keyof typeof Align]
 19  
 20  export const BoxSizing = {
 21    BorderBox: 0,
 22    ContentBox: 1,
 23  } as const
 24  export type BoxSizing = (typeof BoxSizing)[keyof typeof BoxSizing]
 25  
 26  export const Dimension = {
 27    Width: 0,
 28    Height: 1,
 29  } as const
 30  export type Dimension = (typeof Dimension)[keyof typeof Dimension]
 31  
 32  export const Direction = {
 33    Inherit: 0,
 34    LTR: 1,
 35    RTL: 2,
 36  } as const
 37  export type Direction = (typeof Direction)[keyof typeof Direction]
 38  
 39  export const Display = {
 40    Flex: 0,
 41    None: 1,
 42    Contents: 2,
 43  } as const
 44  export type Display = (typeof Display)[keyof typeof Display]
 45  
 46  export const Edge = {
 47    Left: 0,
 48    Top: 1,
 49    Right: 2,
 50    Bottom: 3,
 51    Start: 4,
 52    End: 5,
 53    Horizontal: 6,
 54    Vertical: 7,
 55    All: 8,
 56  } as const
 57  export type Edge = (typeof Edge)[keyof typeof Edge]
 58  
 59  export const Errata = {
 60    None: 0,
 61    StretchFlexBasis: 1,
 62    AbsolutePositionWithoutInsetsExcludesPadding: 2,
 63    AbsolutePercentAgainstInnerSize: 4,
 64    All: 2147483647,
 65    Classic: 2147483646,
 66  } as const
 67  export type Errata = (typeof Errata)[keyof typeof Errata]
 68  
 69  export const ExperimentalFeature = {
 70    WebFlexBasis: 0,
 71  } as const
 72  export type ExperimentalFeature =
 73    (typeof ExperimentalFeature)[keyof typeof ExperimentalFeature]
 74  
 75  export const FlexDirection = {
 76    Column: 0,
 77    ColumnReverse: 1,
 78    Row: 2,
 79    RowReverse: 3,
 80  } as const
 81  export type FlexDirection = (typeof FlexDirection)[keyof typeof FlexDirection]
 82  
 83  export const Gutter = {
 84    Column: 0,
 85    Row: 1,
 86    All: 2,
 87  } as const
 88  export type Gutter = (typeof Gutter)[keyof typeof Gutter]
 89  
 90  export const Justify = {
 91    FlexStart: 0,
 92    Center: 1,
 93    FlexEnd: 2,
 94    SpaceBetween: 3,
 95    SpaceAround: 4,
 96    SpaceEvenly: 5,
 97  } as const
 98  export type Justify = (typeof Justify)[keyof typeof Justify]
 99  
100  export const MeasureMode = {
101    Undefined: 0,
102    Exactly: 1,
103    AtMost: 2,
104  } as const
105  export type MeasureMode = (typeof MeasureMode)[keyof typeof MeasureMode]
106  
107  export const Overflow = {
108    Visible: 0,
109    Hidden: 1,
110    Scroll: 2,
111  } as const
112  export type Overflow = (typeof Overflow)[keyof typeof Overflow]
113  
114  export const PositionType = {
115    Static: 0,
116    Relative: 1,
117    Absolute: 2,
118  } as const
119  export type PositionType = (typeof PositionType)[keyof typeof PositionType]
120  
121  export const Unit = {
122    Undefined: 0,
123    Point: 1,
124    Percent: 2,
125    Auto: 3,
126  } as const
127  export type Unit = (typeof Unit)[keyof typeof Unit]
128  
129  export const Wrap = {
130    NoWrap: 0,
131    Wrap: 1,
132    WrapReverse: 2,
133  } as const
134  export type Wrap = (typeof Wrap)[keyof typeof Wrap]