Add TypeScript declarations

This commit is contained in:
Nick Gerleman
2022-12-23 02:43:45 -08:00
parent 3352385fb0
commit aaadf57b19
15 changed files with 576 additions and 649 deletions

190
javascript/sources/YGEnums.d.ts vendored Normal file
View File

@@ -0,0 +1,190 @@
/**
* 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
export const ALIGN_AUTO: 0;
export const ALIGN_FLEX_START: 1;
export const ALIGN_CENTER: 2;
export const ALIGN_FLEX_END: 3;
export const ALIGN_STRETCH: 4;
export const ALIGN_BASELINE: 5;
export const ALIGN_SPACE_BETWEEN: 6;
export const ALIGN_SPACE_AROUND: 7;
export const DIMENSION_WIDTH: 0;
export const DIMENSION_HEIGHT: 1;
export const DIRECTION_INHERIT: 0;
export const DIRECTION_LTR: 1;
export const DIRECTION_RTL: 2;
export const DISPLAY_FLEX: 0;
export const DISPLAY_NONE: 1;
export const EDGE_LEFT: 0;
export const EDGE_TOP: 1;
export const EDGE_RIGHT: 2;
export const EDGE_BOTTOM: 3;
export const EDGE_START: 4;
export const EDGE_END: 5;
export const EDGE_HORIZONTAL: 6;
export const EDGE_VERTICAL: 7;
export const EDGE_ALL: 8;
export const EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0;
export const FLEX_DIRECTION_COLUMN: 0;
export const FLEX_DIRECTION_COLUMN_REVERSE: 1;
export const FLEX_DIRECTION_ROW: 2;
export const FLEX_DIRECTION_ROW_REVERSE: 3;
export const GUTTER_COLUMN: 0;
export const GUTTER_ROW: 1;
export const GUTTER_ALL: 2;
export const JUSTIFY_FLEX_START: 0;
export const JUSTIFY_CENTER: 1;
export const JUSTIFY_FLEX_END: 2;
export const JUSTIFY_SPACE_BETWEEN: 3;
export const JUSTIFY_SPACE_AROUND: 4;
export const JUSTIFY_SPACE_EVENLY: 5;
export const LOG_LEVEL_ERROR: 0;
export const LOG_LEVEL_WARN: 1;
export const LOG_LEVEL_INFO: 2;
export const LOG_LEVEL_DEBUG: 3;
export const LOG_LEVEL_VERBOSE: 4;
export const LOG_LEVEL_FATAL: 5;
export const MEASURE_MODE_UNDEFINED: 0;
export const MEASURE_MODE_EXACTLY: 1;
export const MEASURE_MODE_AT_MOST: 2;
export const NODE_TYPE_DEFAULT: 0;
export const NODE_TYPE_TEXT: 1;
export const OVERFLOW_VISIBLE: 0;
export const OVERFLOW_HIDDEN: 1;
export const OVERFLOW_SCROLL: 2;
export const POSITION_TYPE_STATIC: 0;
export const POSITION_TYPE_RELATIVE: 1;
export const POSITION_TYPE_ABSOLUTE: 2;
export const PRINT_OPTIONS_LAYOUT: 1;
export const PRINT_OPTIONS_STYLE: 2;
export const PRINT_OPTIONS_CHILDREN: 4;
export const UNIT_UNDEFINED: 0;
export const UNIT_POINT: 1;
export const UNIT_PERCENT: 2;
export const UNIT_AUTO: 3;
export const WRAP_NO_WRAP: 0;
export const WRAP_WRAP: 1;
export const WRAP_WRAP_REVERSE: 2;
export type Align =
| typeof ALIGN_AUTO
| typeof ALIGN_FLEX_START
| typeof ALIGN_CENTER
| typeof ALIGN_FLEX_END
| typeof ALIGN_STRETCH
| typeof ALIGN_BASELINE
| typeof ALIGN_SPACE_BETWEEN
| typeof ALIGN_SPACE_AROUND;
export type Dimension =
| typeof DIMENSION_WIDTH
| typeof DIMENSION_HEIGHT;
export type Direction =
| typeof DIRECTION_INHERIT
| typeof DIRECTION_LTR
| typeof DIRECTION_RTL;
export type Display =
| typeof DISPLAY_FLEX
| typeof DISPLAY_NONE;
export type Edge =
| typeof EDGE_LEFT
| typeof EDGE_TOP
| typeof EDGE_RIGHT
| typeof EDGE_BOTTOM
| typeof EDGE_START
| typeof EDGE_END
| typeof EDGE_HORIZONTAL
| typeof EDGE_VERTICAL
| typeof EDGE_ALL;
export type ExperimentalFeature =
| typeof EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS;
export type FlexDirection =
| typeof FLEX_DIRECTION_COLUMN
| typeof FLEX_DIRECTION_COLUMN_REVERSE
| typeof FLEX_DIRECTION_ROW
| typeof FLEX_DIRECTION_ROW_REVERSE;
export type Gutter =
| typeof GUTTER_COLUMN
| typeof GUTTER_ROW
| typeof GUTTER_ALL;
export type Justify =
| typeof JUSTIFY_FLEX_START
| typeof JUSTIFY_CENTER
| typeof JUSTIFY_FLEX_END
| typeof JUSTIFY_SPACE_BETWEEN
| typeof JUSTIFY_SPACE_AROUND
| typeof JUSTIFY_SPACE_EVENLY;
export type LogLevel =
| typeof LOG_LEVEL_ERROR
| typeof LOG_LEVEL_WARN
| typeof LOG_LEVEL_INFO
| typeof LOG_LEVEL_DEBUG
| typeof LOG_LEVEL_VERBOSE
| typeof LOG_LEVEL_FATAL;
export type MeasureMode =
| typeof MEASURE_MODE_UNDEFINED
| typeof MEASURE_MODE_EXACTLY
| typeof MEASURE_MODE_AT_MOST;
export type NodeType =
| typeof NODE_TYPE_DEFAULT
| typeof NODE_TYPE_TEXT;
export type Overflow =
| typeof OVERFLOW_VISIBLE
| typeof OVERFLOW_HIDDEN
| typeof OVERFLOW_SCROLL;
export type PositionType =
| typeof POSITION_TYPE_STATIC
| typeof POSITION_TYPE_RELATIVE
| typeof POSITION_TYPE_ABSOLUTE;
export type PrintOptions =
| typeof PRINT_OPTIONS_LAYOUT
| typeof PRINT_OPTIONS_STYLE
| typeof PRINT_OPTIONS_CHILDREN;
export type Unit =
| typeof UNIT_UNDEFINED
| typeof UNIT_POINT
| typeof UNIT_PERCENT
| typeof UNIT_AUTO;
export type Wrap =
| typeof WRAP_NO_WRAP
| typeof WRAP_WRAP
| typeof WRAP_WRAP_REVERSE;