Latest repo

This commit is contained in:
Marc
2025-06-02 16:42:16 +00:00
parent 53ddf1a329
commit cde5fae175
27907 changed files with 3875388 additions and 1 deletions

View File

@@ -0,0 +1,189 @@
/**
* 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.
*/
export declare enum Align {
Auto = 0,
FlexStart = 1,
Center = 2,
FlexEnd = 3,
Stretch = 4,
Baseline = 5,
SpaceBetween = 6,
SpaceAround = 7,
SpaceEvenly = 8
}
export declare enum BoxSizing {
BorderBox = 0,
ContentBox = 1
}
export declare enum Dimension {
Width = 0,
Height = 1
}
export declare enum Direction {
Inherit = 0,
LTR = 1,
RTL = 2
}
export declare enum Display {
Flex = 0,
None = 1,
Contents = 2
}
export declare enum Edge {
Left = 0,
Top = 1,
Right = 2,
Bottom = 3,
Start = 4,
End = 5,
Horizontal = 6,
Vertical = 7,
All = 8
}
export declare enum Errata {
None = 0,
StretchFlexBasis = 1,
AbsolutePositionWithoutInsetsExcludesPadding = 2,
AbsolutePercentAgainstInnerSize = 4,
All = 2147483647,
Classic = 2147483646
}
export declare enum ExperimentalFeature {
WebFlexBasis = 0
}
export declare enum FlexDirection {
Column = 0,
ColumnReverse = 1,
Row = 2,
RowReverse = 3
}
export declare enum Gutter {
Column = 0,
Row = 1,
All = 2
}
export declare enum Justify {
FlexStart = 0,
Center = 1,
FlexEnd = 2,
SpaceBetween = 3,
SpaceAround = 4,
SpaceEvenly = 5
}
export declare enum LogLevel {
Error = 0,
Warn = 1,
Info = 2,
Debug = 3,
Verbose = 4,
Fatal = 5
}
export declare enum MeasureMode {
Undefined = 0,
Exactly = 1,
AtMost = 2
}
export declare enum NodeType {
Default = 0,
Text = 1
}
export declare enum Overflow {
Visible = 0,
Hidden = 1,
Scroll = 2
}
export declare enum PositionType {
Static = 0,
Relative = 1,
Absolute = 2
}
export declare enum Unit {
Undefined = 0,
Point = 1,
Percent = 2,
Auto = 3
}
export declare enum Wrap {
NoWrap = 0,
Wrap = 1,
WrapReverse = 2
}
declare const constants: {
ALIGN_AUTO: Align;
ALIGN_FLEX_START: Align;
ALIGN_CENTER: Align;
ALIGN_FLEX_END: Align;
ALIGN_STRETCH: Align;
ALIGN_BASELINE: Align;
ALIGN_SPACE_BETWEEN: Align;
ALIGN_SPACE_AROUND: Align;
ALIGN_SPACE_EVENLY: Align;
BOX_SIZING_BORDER_BOX: BoxSizing;
BOX_SIZING_CONTENT_BOX: BoxSizing;
DIMENSION_WIDTH: Dimension;
DIMENSION_HEIGHT: Dimension;
DIRECTION_INHERIT: Direction;
DIRECTION_LTR: Direction;
DIRECTION_RTL: Direction;
DISPLAY_FLEX: Display;
DISPLAY_NONE: Display;
DISPLAY_CONTENTS: Display;
EDGE_LEFT: Edge;
EDGE_TOP: Edge;
EDGE_RIGHT: Edge;
EDGE_BOTTOM: Edge;
EDGE_START: Edge;
EDGE_END: Edge;
EDGE_HORIZONTAL: Edge;
EDGE_VERTICAL: Edge;
EDGE_ALL: Edge;
ERRATA_NONE: Errata;
ERRATA_STRETCH_FLEX_BASIS: Errata;
ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING: Errata;
ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: Errata;
ERRATA_ALL: Errata;
ERRATA_CLASSIC: Errata;
EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: ExperimentalFeature;
FLEX_DIRECTION_COLUMN: FlexDirection;
FLEX_DIRECTION_COLUMN_REVERSE: FlexDirection;
FLEX_DIRECTION_ROW: FlexDirection;
FLEX_DIRECTION_ROW_REVERSE: FlexDirection;
GUTTER_COLUMN: Gutter;
GUTTER_ROW: Gutter;
GUTTER_ALL: Gutter;
JUSTIFY_FLEX_START: Justify;
JUSTIFY_CENTER: Justify;
JUSTIFY_FLEX_END: Justify;
JUSTIFY_SPACE_BETWEEN: Justify;
JUSTIFY_SPACE_AROUND: Justify;
JUSTIFY_SPACE_EVENLY: Justify;
LOG_LEVEL_ERROR: LogLevel;
LOG_LEVEL_WARN: LogLevel;
LOG_LEVEL_INFO: LogLevel;
LOG_LEVEL_DEBUG: LogLevel;
LOG_LEVEL_VERBOSE: LogLevel;
LOG_LEVEL_FATAL: LogLevel;
MEASURE_MODE_UNDEFINED: MeasureMode;
MEASURE_MODE_EXACTLY: MeasureMode;
MEASURE_MODE_AT_MOST: MeasureMode;
NODE_TYPE_DEFAULT: NodeType;
NODE_TYPE_TEXT: NodeType;
OVERFLOW_VISIBLE: Overflow;
OVERFLOW_HIDDEN: Overflow;
OVERFLOW_SCROLL: Overflow;
POSITION_TYPE_STATIC: PositionType;
POSITION_TYPE_RELATIVE: PositionType;
POSITION_TYPE_ABSOLUTE: PositionType;
UNIT_UNDEFINED: Unit;
UNIT_POINT: Unit;
UNIT_PERCENT: Unit;
UNIT_AUTO: Unit;
WRAP_NO_WRAP: Wrap;
WRAP_WRAP: Wrap;
WRAP_WRAP_REVERSE: Wrap;
};
export default constants;

211
node_modules/yoga-layout/dist/src/generated/YGEnums.js generated vendored Normal file
View File

@@ -0,0 +1,211 @@
/**
* 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 let Align = /*#__PURE__*/function (Align) {
Align[Align["Auto"] = 0] = "Auto";
Align[Align["FlexStart"] = 1] = "FlexStart";
Align[Align["Center"] = 2] = "Center";
Align[Align["FlexEnd"] = 3] = "FlexEnd";
Align[Align["Stretch"] = 4] = "Stretch";
Align[Align["Baseline"] = 5] = "Baseline";
Align[Align["SpaceBetween"] = 6] = "SpaceBetween";
Align[Align["SpaceAround"] = 7] = "SpaceAround";
Align[Align["SpaceEvenly"] = 8] = "SpaceEvenly";
return Align;
}({});
export let BoxSizing = /*#__PURE__*/function (BoxSizing) {
BoxSizing[BoxSizing["BorderBox"] = 0] = "BorderBox";
BoxSizing[BoxSizing["ContentBox"] = 1] = "ContentBox";
return BoxSizing;
}({});
export let Dimension = /*#__PURE__*/function (Dimension) {
Dimension[Dimension["Width"] = 0] = "Width";
Dimension[Dimension["Height"] = 1] = "Height";
return Dimension;
}({});
export let Direction = /*#__PURE__*/function (Direction) {
Direction[Direction["Inherit"] = 0] = "Inherit";
Direction[Direction["LTR"] = 1] = "LTR";
Direction[Direction["RTL"] = 2] = "RTL";
return Direction;
}({});
export let Display = /*#__PURE__*/function (Display) {
Display[Display["Flex"] = 0] = "Flex";
Display[Display["None"] = 1] = "None";
Display[Display["Contents"] = 2] = "Contents";
return Display;
}({});
export let Edge = /*#__PURE__*/function (Edge) {
Edge[Edge["Left"] = 0] = "Left";
Edge[Edge["Top"] = 1] = "Top";
Edge[Edge["Right"] = 2] = "Right";
Edge[Edge["Bottom"] = 3] = "Bottom";
Edge[Edge["Start"] = 4] = "Start";
Edge[Edge["End"] = 5] = "End";
Edge[Edge["Horizontal"] = 6] = "Horizontal";
Edge[Edge["Vertical"] = 7] = "Vertical";
Edge[Edge["All"] = 8] = "All";
return Edge;
}({});
export let Errata = /*#__PURE__*/function (Errata) {
Errata[Errata["None"] = 0] = "None";
Errata[Errata["StretchFlexBasis"] = 1] = "StretchFlexBasis";
Errata[Errata["AbsolutePositionWithoutInsetsExcludesPadding"] = 2] = "AbsolutePositionWithoutInsetsExcludesPadding";
Errata[Errata["AbsolutePercentAgainstInnerSize"] = 4] = "AbsolutePercentAgainstInnerSize";
Errata[Errata["All"] = 2147483647] = "All";
Errata[Errata["Classic"] = 2147483646] = "Classic";
return Errata;
}({});
export let ExperimentalFeature = /*#__PURE__*/function (ExperimentalFeature) {
ExperimentalFeature[ExperimentalFeature["WebFlexBasis"] = 0] = "WebFlexBasis";
return ExperimentalFeature;
}({});
export let FlexDirection = /*#__PURE__*/function (FlexDirection) {
FlexDirection[FlexDirection["Column"] = 0] = "Column";
FlexDirection[FlexDirection["ColumnReverse"] = 1] = "ColumnReverse";
FlexDirection[FlexDirection["Row"] = 2] = "Row";
FlexDirection[FlexDirection["RowReverse"] = 3] = "RowReverse";
return FlexDirection;
}({});
export let Gutter = /*#__PURE__*/function (Gutter) {
Gutter[Gutter["Column"] = 0] = "Column";
Gutter[Gutter["Row"] = 1] = "Row";
Gutter[Gutter["All"] = 2] = "All";
return Gutter;
}({});
export let Justify = /*#__PURE__*/function (Justify) {
Justify[Justify["FlexStart"] = 0] = "FlexStart";
Justify[Justify["Center"] = 1] = "Center";
Justify[Justify["FlexEnd"] = 2] = "FlexEnd";
Justify[Justify["SpaceBetween"] = 3] = "SpaceBetween";
Justify[Justify["SpaceAround"] = 4] = "SpaceAround";
Justify[Justify["SpaceEvenly"] = 5] = "SpaceEvenly";
return Justify;
}({});
export let LogLevel = /*#__PURE__*/function (LogLevel) {
LogLevel[LogLevel["Error"] = 0] = "Error";
LogLevel[LogLevel["Warn"] = 1] = "Warn";
LogLevel[LogLevel["Info"] = 2] = "Info";
LogLevel[LogLevel["Debug"] = 3] = "Debug";
LogLevel[LogLevel["Verbose"] = 4] = "Verbose";
LogLevel[LogLevel["Fatal"] = 5] = "Fatal";
return LogLevel;
}({});
export let MeasureMode = /*#__PURE__*/function (MeasureMode) {
MeasureMode[MeasureMode["Undefined"] = 0] = "Undefined";
MeasureMode[MeasureMode["Exactly"] = 1] = "Exactly";
MeasureMode[MeasureMode["AtMost"] = 2] = "AtMost";
return MeasureMode;
}({});
export let NodeType = /*#__PURE__*/function (NodeType) {
NodeType[NodeType["Default"] = 0] = "Default";
NodeType[NodeType["Text"] = 1] = "Text";
return NodeType;
}({});
export let Overflow = /*#__PURE__*/function (Overflow) {
Overflow[Overflow["Visible"] = 0] = "Visible";
Overflow[Overflow["Hidden"] = 1] = "Hidden";
Overflow[Overflow["Scroll"] = 2] = "Scroll";
return Overflow;
}({});
export let PositionType = /*#__PURE__*/function (PositionType) {
PositionType[PositionType["Static"] = 0] = "Static";
PositionType[PositionType["Relative"] = 1] = "Relative";
PositionType[PositionType["Absolute"] = 2] = "Absolute";
return PositionType;
}({});
export let Unit = /*#__PURE__*/function (Unit) {
Unit[Unit["Undefined"] = 0] = "Undefined";
Unit[Unit["Point"] = 1] = "Point";
Unit[Unit["Percent"] = 2] = "Percent";
Unit[Unit["Auto"] = 3] = "Auto";
return Unit;
}({});
export let Wrap = /*#__PURE__*/function (Wrap) {
Wrap[Wrap["NoWrap"] = 0] = "NoWrap";
Wrap[Wrap["Wrap"] = 1] = "Wrap";
Wrap[Wrap["WrapReverse"] = 2] = "WrapReverse";
return Wrap;
}({});
const constants = {
ALIGN_AUTO: Align.Auto,
ALIGN_FLEX_START: Align.FlexStart,
ALIGN_CENTER: Align.Center,
ALIGN_FLEX_END: Align.FlexEnd,
ALIGN_STRETCH: Align.Stretch,
ALIGN_BASELINE: Align.Baseline,
ALIGN_SPACE_BETWEEN: Align.SpaceBetween,
ALIGN_SPACE_AROUND: Align.SpaceAround,
ALIGN_SPACE_EVENLY: Align.SpaceEvenly,
BOX_SIZING_BORDER_BOX: BoxSizing.BorderBox,
BOX_SIZING_CONTENT_BOX: BoxSizing.ContentBox,
DIMENSION_WIDTH: Dimension.Width,
DIMENSION_HEIGHT: Dimension.Height,
DIRECTION_INHERIT: Direction.Inherit,
DIRECTION_LTR: Direction.LTR,
DIRECTION_RTL: Direction.RTL,
DISPLAY_FLEX: Display.Flex,
DISPLAY_NONE: Display.None,
DISPLAY_CONTENTS: Display.Contents,
EDGE_LEFT: Edge.Left,
EDGE_TOP: Edge.Top,
EDGE_RIGHT: Edge.Right,
EDGE_BOTTOM: Edge.Bottom,
EDGE_START: Edge.Start,
EDGE_END: Edge.End,
EDGE_HORIZONTAL: Edge.Horizontal,
EDGE_VERTICAL: Edge.Vertical,
EDGE_ALL: Edge.All,
ERRATA_NONE: Errata.None,
ERRATA_STRETCH_FLEX_BASIS: Errata.StretchFlexBasis,
ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING: Errata.AbsolutePositionWithoutInsetsExcludesPadding,
ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: Errata.AbsolutePercentAgainstInnerSize,
ERRATA_ALL: Errata.All,
ERRATA_CLASSIC: Errata.Classic,
EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: ExperimentalFeature.WebFlexBasis,
FLEX_DIRECTION_COLUMN: FlexDirection.Column,
FLEX_DIRECTION_COLUMN_REVERSE: FlexDirection.ColumnReverse,
FLEX_DIRECTION_ROW: FlexDirection.Row,
FLEX_DIRECTION_ROW_REVERSE: FlexDirection.RowReverse,
GUTTER_COLUMN: Gutter.Column,
GUTTER_ROW: Gutter.Row,
GUTTER_ALL: Gutter.All,
JUSTIFY_FLEX_START: Justify.FlexStart,
JUSTIFY_CENTER: Justify.Center,
JUSTIFY_FLEX_END: Justify.FlexEnd,
JUSTIFY_SPACE_BETWEEN: Justify.SpaceBetween,
JUSTIFY_SPACE_AROUND: Justify.SpaceAround,
JUSTIFY_SPACE_EVENLY: Justify.SpaceEvenly,
LOG_LEVEL_ERROR: LogLevel.Error,
LOG_LEVEL_WARN: LogLevel.Warn,
LOG_LEVEL_INFO: LogLevel.Info,
LOG_LEVEL_DEBUG: LogLevel.Debug,
LOG_LEVEL_VERBOSE: LogLevel.Verbose,
LOG_LEVEL_FATAL: LogLevel.Fatal,
MEASURE_MODE_UNDEFINED: MeasureMode.Undefined,
MEASURE_MODE_EXACTLY: MeasureMode.Exactly,
MEASURE_MODE_AT_MOST: MeasureMode.AtMost,
NODE_TYPE_DEFAULT: NodeType.Default,
NODE_TYPE_TEXT: NodeType.Text,
OVERFLOW_VISIBLE: Overflow.Visible,
OVERFLOW_HIDDEN: Overflow.Hidden,
OVERFLOW_SCROLL: Overflow.Scroll,
POSITION_TYPE_STATIC: PositionType.Static,
POSITION_TYPE_RELATIVE: PositionType.Relative,
POSITION_TYPE_ABSOLUTE: PositionType.Absolute,
UNIT_UNDEFINED: Unit.Undefined,
UNIT_POINT: Unit.Point,
UNIT_PERCENT: Unit.Percent,
UNIT_AUTO: Unit.Auto,
WRAP_NO_WRAP: Wrap.NoWrap,
WRAP_WRAP: Wrap.Wrap,
WRAP_WRAP_REVERSE: Wrap.WrapReverse
};
export default constants;
//# sourceMappingURL=YGEnums.js.map

File diff suppressed because one or more lines are too long

12
node_modules/yoga-layout/dist/src/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
/**
* 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.
*
* @format
*/
export type { Config, DirtiedFunction, MeasureFunction, Node, } from './wrapAssembly.ts';
declare const Yoga: import("./wrapAssembly.ts").Yoga;
export default Yoga;
export * from './generated/YGEnums.ts';

16
node_modules/yoga-layout/dist/src/index.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* 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.
*
* @format
*/
// @ts-ignore untyped from Emscripten
import loadYoga from '../binaries/yoga-wasm-base64-esm.js';
import wrapAssembly from "./wrapAssembly.js";
const Yoga = wrapAssembly(await loadYoga());
export default Yoga;
export * from "./generated/YGEnums.js";
//# sourceMappingURL=index.js.map

1
node_modules/yoga-layout/dist/src/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["loadYoga","wrapAssembly","Yoga"],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\n\n// @ts-ignore untyped from Emscripten\nimport loadYoga from '../binaries/yoga-wasm-base64-esm.js';\nimport wrapAssembly from './wrapAssembly.ts';\n\nexport type {\n Config,\n DirtiedFunction,\n MeasureFunction,\n Node,\n} from './wrapAssembly.ts';\n\nconst Yoga = wrapAssembly(await loadYoga());\nexport default Yoga;\nexport * from './generated/YGEnums.ts';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAOA,QAAQ,MAAM,qCAAqC;AAC1D,OAAOC,YAAY,MAAM,mBAAmB;AAS5C,MAAMC,IAAI,GAAGD,YAAY,CAAC,MAAMD,QAAQ,CAAC,CAAC,CAAC;AAC3C,eAAeE,IAAI;AACnB,cAAc,wBAAwB","ignoreList":[]}

11
node_modules/yoga-layout/dist/src/load.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* 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.
*
* @format
*/
export type { Config, DirtiedFunction, MeasureFunction, Node, Yoga, } from './wrapAssembly.ts';
export declare function loadYoga(): Promise<import("./wrapAssembly.ts").Yoga>;
export * from './generated/YGEnums.ts';

17
node_modules/yoga-layout/dist/src/load.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
/**
* 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.
*
* @format
*/
// @ts-ignore untyped from Emscripten
import loadYogaImpl from '../binaries/yoga-wasm-base64-esm.js';
import wrapAssembly from "./wrapAssembly.js";
export async function loadYoga() {
return wrapAssembly(await loadYogaImpl());
}
export * from "./generated/YGEnums.js";
//# sourceMappingURL=load.js.map

1
node_modules/yoga-layout/dist/src/load.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"load.js","names":["loadYogaImpl","wrapAssembly","loadYoga"],"sources":["../../src/load.ts"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\n\n// @ts-ignore untyped from Emscripten\nimport loadYogaImpl from '../binaries/yoga-wasm-base64-esm.js';\nimport wrapAssembly from './wrapAssembly.ts';\n\nexport type {\n Config,\n DirtiedFunction,\n MeasureFunction,\n Node,\n Yoga,\n} from './wrapAssembly.ts';\n\nexport async function loadYoga() {\n return wrapAssembly(await loadYogaImpl());\n}\nexport * from './generated/YGEnums.ts';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAOA,YAAY,MAAM,qCAAqC;AAC9D,OAAOC,YAAY,MAAM,mBAAmB;AAU5C,OAAO,eAAeC,QAAQA,CAAA,EAAG;EAC/B,OAAOD,YAAY,CAAC,MAAMD,YAAY,CAAC,CAAC,CAAC;AAC3C;AACA,cAAc,wBAAwB","ignoreList":[]}

155
node_modules/yoga-layout/dist/src/wrapAssembly.d.ts generated vendored Normal file
View File

@@ -0,0 +1,155 @@
/**
* 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.
*
* @format
*/
import { Unit, Direction } from './generated/YGEnums.ts';
import YGEnums from './generated/YGEnums.ts';
import type { Align, BoxSizing, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, MeasureMode, Overflow, PositionType, Wrap } from './generated/YGEnums.ts';
type Layout = {
left: number;
right: number;
top: number;
bottom: number;
width: number;
height: number;
};
type Size = {
width: number;
height: number;
};
type Value = {
unit: Unit;
value: number;
};
export type Config = {
free(): void;
isExperimentalFeatureEnabled(feature: ExperimentalFeature): boolean;
setExperimentalFeatureEnabled(feature: ExperimentalFeature, enabled: boolean): void;
setPointScaleFactor(factor: number): void;
getErrata(): Errata;
setErrata(errata: Errata): void;
useWebDefaults(): boolean;
setUseWebDefaults(useWebDefaults: boolean): void;
};
export type DirtiedFunction = (node: Node) => void;
export type MeasureFunction = (width: number, widthMode: MeasureMode, height: number, heightMode: MeasureMode) => Size;
export type Node = {
calculateLayout(width: number | 'auto' | undefined, height: number | 'auto' | undefined, direction?: Direction): void;
copyStyle(node: Node): void;
free(): void;
freeRecursive(): void;
getAlignContent(): Align;
getAlignItems(): Align;
getAlignSelf(): Align;
getAspectRatio(): number;
getBorder(edge: Edge): number;
getChild(index: number): Node;
getChildCount(): number;
getComputedBorder(edge: Edge): number;
getComputedBottom(): number;
getComputedHeight(): number;
getComputedLayout(): Layout;
getComputedLeft(): number;
getComputedMargin(edge: Edge): number;
getComputedPadding(edge: Edge): number;
getComputedRight(): number;
getComputedTop(): number;
getComputedWidth(): number;
getDirection(): Direction;
getDisplay(): Display;
getFlexBasis(): Value;
getFlexDirection(): FlexDirection;
getFlexGrow(): number;
getFlexShrink(): number;
getFlexWrap(): Wrap;
getHeight(): Value;
getJustifyContent(): Justify;
getGap(gutter: Gutter): Value;
getMargin(edge: Edge): Value;
getMaxHeight(): Value;
getMaxWidth(): Value;
getMinHeight(): Value;
getMinWidth(): Value;
getOverflow(): Overflow;
getPadding(edge: Edge): Value;
getParent(): Node | null;
getPosition(edge: Edge): Value;
getPositionType(): PositionType;
getBoxSizing(): BoxSizing;
getWidth(): Value;
insertChild(child: Node, index: number): void;
isDirty(): boolean;
isReferenceBaseline(): boolean;
markDirty(): void;
hasNewLayout(): boolean;
markLayoutSeen(): void;
removeChild(child: Node): void;
reset(): void;
setAlignContent(alignContent: Align): void;
setAlignItems(alignItems: Align): void;
setAlignSelf(alignSelf: Align): void;
setAspectRatio(aspectRatio: number | undefined): void;
setBorder(edge: Edge, borderWidth: number | undefined): void;
setDirection(direction: Direction): void;
setDisplay(display: Display): void;
setFlex(flex: number | undefined): void;
setFlexBasis(flexBasis: number | 'auto' | `${number}%` | undefined): void;
setFlexBasisPercent(flexBasis: number | undefined): void;
setFlexBasisAuto(): void;
setFlexDirection(flexDirection: FlexDirection): void;
setFlexGrow(flexGrow: number | undefined): void;
setFlexShrink(flexShrink: number | undefined): void;
setFlexWrap(flexWrap: Wrap): void;
setHeight(height: number | 'auto' | `${number}%` | undefined): void;
setIsReferenceBaseline(isReferenceBaseline: boolean): void;
setHeightAuto(): void;
setHeightPercent(height: number | undefined): void;
setJustifyContent(justifyContent: Justify): void;
setGap(gutter: Gutter, gapLength: number | `${number}%` | undefined): Value;
setGapPercent(gutter: Gutter, gapLength: number | undefined): Value;
setMargin(edge: Edge, margin: number | 'auto' | `${number}%` | undefined): void;
setMarginAuto(edge: Edge): void;
setMarginPercent(edge: Edge, margin: number | undefined): void;
setMaxHeight(maxHeight: number | `${number}%` | undefined): void;
setMaxHeightPercent(maxHeight: number | undefined): void;
setMaxWidth(maxWidth: number | `${number}%` | undefined): void;
setMaxWidthPercent(maxWidth: number | undefined): void;
setDirtiedFunc(dirtiedFunc: DirtiedFunction | null): void;
setMeasureFunc(measureFunc: MeasureFunction | null): void;
setMinHeight(minHeight: number | `${number}%` | undefined): void;
setMinHeightPercent(minHeight: number | undefined): void;
setMinWidth(minWidth: number | `${number}%` | undefined): void;
setMinWidthPercent(minWidth: number | undefined): void;
setOverflow(overflow: Overflow): void;
setPadding(edge: Edge, padding: number | `${number}%` | undefined): void;
setPaddingPercent(edge: Edge, padding: number | undefined): void;
setPosition(edge: Edge, position: number | `${number}%` | undefined): void;
setPositionPercent(edge: Edge, position: number | undefined): void;
setPositionType(positionType: PositionType): void;
setPositionAuto(edge: Edge): void;
setBoxSizing(boxSizing: BoxSizing): void;
setWidth(width: number | 'auto' | `${number}%` | undefined): void;
setWidthAuto(): void;
setWidthPercent(width: number | undefined): void;
unsetDirtiedFunc(): void;
unsetMeasureFunc(): void;
setAlwaysFormsContainingBlock(alwaysFormsContainingBlock: boolean): void;
};
export type Yoga = {
Config: {
create(): Config;
destroy(config: Config): void;
};
Node: {
create(config?: Config): Node;
createDefault(): Node;
createWithConfig(config: Config): Node;
destroy(node: Node): void;
};
} & typeof YGEnums;
export default function wrapAssembly(lib: any): Yoga;
export {};

125
node_modules/yoga-layout/dist/src/wrapAssembly.js generated vendored Normal file
View File

@@ -0,0 +1,125 @@
/**
* 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.
*
* @format
*/
// @ts-nocheck
import { Unit, Direction } from "./generated/YGEnums.js";
import YGEnums from "./generated/YGEnums.js";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export default function wrapAssembly(lib) {
function patch(prototype, name, fn) {
const original = prototype[name];
prototype[name] = function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return fn.call(this, original, ...args);
};
}
for (const fnName of ['setPosition', 'setMargin', 'setFlexBasis', 'setWidth', 'setHeight', 'setMinWidth', 'setMinHeight', 'setMaxWidth', 'setMaxHeight', 'setPadding', 'setGap']) {
const methods = {
[Unit.Point]: lib.Node.prototype[fnName],
[Unit.Percent]: lib.Node.prototype[`${fnName}Percent`],
[Unit.Auto]: lib.Node.prototype[`${fnName}Auto`]
};
patch(lib.Node.prototype, fnName, function (original) {
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
// We patch all these functions to add support for the following calls:
// .setWidth(100) / .setWidth("100%") / .setWidth(.getWidth()) / .setWidth("auto")
const value = args.pop();
let unit, asNumber;
if (value === 'auto') {
unit = Unit.Auto;
asNumber = undefined;
} else if (typeof value === 'object') {
unit = value.unit;
asNumber = value.valueOf();
} else {
unit = typeof value === 'string' && value.endsWith('%') ? Unit.Percent : Unit.Point;
asNumber = parseFloat(value);
if (value !== undefined && !Number.isNaN(value) && Number.isNaN(asNumber)) {
throw new Error(`Invalid value ${value} for ${fnName}`);
}
}
if (!methods[unit]) throw new Error(`Failed to execute "${fnName}": Unsupported unit '${value}'`);
if (asNumber !== undefined) {
return methods[unit].call(this, ...args, asNumber);
} else {
return methods[unit].call(this, ...args);
}
});
}
function wrapMeasureFunction(measureFunction) {
return lib.MeasureCallback.implement({
measure: function () {
const {
width,
height
} = measureFunction(...arguments);
return {
width: width ?? NaN,
height: height ?? NaN
};
}
});
}
patch(lib.Node.prototype, 'setMeasureFunc', function (original, measureFunc) {
// This patch is just a convenience patch, since it helps write more
// idiomatic source code (such as .setMeasureFunc(null))
if (measureFunc) {
return original.call(this, wrapMeasureFunction(measureFunc));
} else {
return this.unsetMeasureFunc();
}
});
function wrapDirtiedFunc(dirtiedFunction) {
return lib.DirtiedCallback.implement({
dirtied: dirtiedFunction
});
}
patch(lib.Node.prototype, 'setDirtiedFunc', function (original, dirtiedFunc) {
original.call(this, wrapDirtiedFunc(dirtiedFunc));
});
patch(lib.Config.prototype, 'free', function () {
// Since we handle the memory allocation ourselves (via lib.Config.create),
// we also need to handle the deallocation
lib.Config.destroy(this);
});
patch(lib.Node, 'create', (_, config) => {
// We decide the constructor we want to call depending on the parameters
return config ? lib.Node.createWithConfig(config) : lib.Node.createDefault();
});
patch(lib.Node.prototype, 'free', function () {
// Since we handle the memory allocation ourselves (via lib.Node.create),
// we also need to handle the deallocation
lib.Node.destroy(this);
});
patch(lib.Node.prototype, 'freeRecursive', function () {
for (let t = 0, T = this.getChildCount(); t < T; ++t) {
this.getChild(0).freeRecursive();
}
this.free();
});
patch(lib.Node.prototype, 'calculateLayout', function (original) {
let width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NaN;
let height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : NaN;
let direction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Direction.LTR;
// Just a small patch to add support for the function default parameters
return original.call(this, width, height, direction);
});
return {
Config: lib.Config,
Node: lib.Node,
...YGEnums
};
}
//# sourceMappingURL=wrapAssembly.js.map

File diff suppressed because one or more lines are too long