diff --git a/enums.py b/enums.py index be219cd7..ddc9c6b2 100644 --- a/enums.py +++ b/enums.py @@ -247,7 +247,7 @@ for name, values in sorted(ENUMS.items()): f.write("}\n") # write out javascript file -with open(root + "/javascript/src_js/generated/YGEnums.js", "w") as f: +with open(root + "/javascript/src/generated/YGEnums.js", "w") as f: f.write(get_license("js")) items = sorted(ENUMS.items()) for name, values in items: @@ -265,7 +265,7 @@ with open(root + "/javascript/src_js/generated/YGEnums.js", "w") as f: if name != items[-1][0]: f.write("\n") -with open(root + "/javascript/src_js/generated/YGEnums.d.ts", "w") as f: +with open(root + "/javascript/src/generated/YGEnums.d.ts", "w") as f: f.write(get_license("js")) for name, values in sorted(ENUMS.items()): @@ -277,7 +277,7 @@ with open(root + "/javascript/src_js/generated/YGEnums.d.ts", "w") as f: f.write( ( "type {name}_{value} = {ordinal} & ['{name}']\n" - + "export const {name}_{value}: {name}_{value};\n\n" + + "export declare const {name}_{value}: {name}_{value};\n\n" ).format( name=to_java_upper(name), value=to_java_upper(value_arg), diff --git a/javascript/.prettierignore b/javascript/.prettierignore index 81f49fc9..8b9a7043 100644 --- a/javascript/.prettierignore +++ b/javascript/.prettierignore @@ -1,2 +1,2 @@ tests/generated/ -src_js/generated/ +src/generated/ diff --git a/javascript/CMakeLists.txt b/javascript/CMakeLists.txt index 1306dace..01177fcc 100644 --- a/javascript/CMakeLists.txt +++ b/javascript/CMakeLists.txt @@ -10,7 +10,7 @@ project(yoga) file(GLOB SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../yoga/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../yoga/**/*.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src_native/*.cc) + ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) include_directories(..) diff --git a/javascript/just.config.ts b/javascript/just.config.ts index 3b4175ac..dcc7776e 100644 --- a/javascript/just.config.ts +++ b/javascript/just.config.ts @@ -10,7 +10,6 @@ import { argv, cleanTask, - copyTask, eslintTask, logger, jestTask, @@ -32,15 +31,6 @@ option('fix'); task('clean', cleanTask({paths: ['build', 'dist']})); -task( - 'prepare-for-build', - parallel( - babelTransformTask({paths: ['src_js'], dest: 'dist'}), - copyTask({paths: ['src_js/**/*.d.ts'], dest: 'dist'}), - emcmakeGenerateTask(), - ), -); - function defineFlavor(flavor: string, env: NodeJS.ProcessEnv) { task(`cmake-build:${flavor}`, cmakeBuildTask({targets: [flavor]})); task( @@ -49,7 +39,7 @@ function defineFlavor(flavor: string, env: NodeJS.ProcessEnv) { ); task( `test:${flavor}`, - series('prepare-for-build', `cmake-build:${flavor}`, `jest:${flavor}`), + series(emcmakeGenerateTask(), `cmake-build:${flavor}`, `jest:${flavor}`), ); } @@ -68,12 +58,12 @@ task( cmakeBuildTask({targets: ['asmjs-sync', 'wasm-sync']}), ); -task('build', series('prepare-for-build', 'cmake-build:all')); +task('build', series(emcmakeGenerateTask(), 'cmake-build:all')); task( 'test', series( - 'prepare-for-build', + emcmakeGenerateTask(), series('cmake-build:asmjs-async', 'jest:asmjs-async'), series('cmake-build:asmjs-sync', 'jest:asmjs-sync'), series('cmake-build:wasm-async', 'jest:wasm-async'), @@ -83,26 +73,41 @@ task( task( 'benchmark', - series('prepare-for-build', 'cmake-build:sync', runBenchTask()), + series(emcmakeGenerateTask(), 'cmake-build:sync', runBenchTask()), ); task( 'lint', parallel( - tscTask(), + tscTask({noEmit: true}), series(eslintTask({fix: argv().fix}), clangFormatTask({fix: argv().fix})), ), ); -function babelTransformTask(opts: { - paths: ReadonlyArray; - dest: string; -}) { - return () => { - const args = [...opts.paths, '--source-maps', '--out-dir', opts.dest]; - logger.info(`Transforming [${opts.paths.join(',')}] to '${opts.dest}'`); +task( + 'prepublish', + parallel( + 'build', + tscTask({emitDeclarationOnly: true}), + babelTransformTask({dir: 'src'}), + ), +); - return spawn(node, [require.resolve('@babel/cli/bin/babel'), ...args]); +function babelTransformTask(opts: {dir: string}) { + return () => { + const args = [ + opts.dir, + '--source-maps', + '--out-dir', + opts.dir, + '--extensions', + '.js,.ts', + ]; + logger.info(`Transforming "${path.resolve(opts.dir)}"`); + + return spawn(node, [require.resolve('@babel/cli/bin/babel'), ...args], { + cwd: __dirname, + }); }; } diff --git a/javascript/package.json b/javascript/package.json index 7aa94eec..683ec3b3 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -7,23 +7,23 @@ "type": "git", "url": "git@github.com:facebook/yoga.git" }, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", + "main": "./src/index.js", + "types": "./src/index.d.ts", "exports": { ".": { - "browser": "./dist/entrypoint/wasm-async.js", - "node": "./dist/entrypoint/wasm-async.js", - "default": "./dist/entrypoint/asmjs-async.js" + "browser": "./src/entrypoint/wasm-async.js", + "node": "./src/entrypoint/wasm-async.js", + "default": "./src/entrypoint/asmjs-async.js" }, "./sync": { - "browser": "./dist/entrypoint/asmjs-sync.js", - "node": "./dist/entrypoint/wasm-sync.js", - "default": "./dist/entrypoint/asmjs-sync.js" + "browser": "./src/entrypoint/asmjs-sync.js", + "node": "./src/entrypoint/wasm-sync.js", + "default": "./src/entrypoint/asmjs-sync.js" } }, "files": [ "dist/**", - "src_js/**" + "src/**" ], "scripts": { "benchmark": "just benchmark", @@ -31,6 +31,7 @@ "clean": "just clean", "lint": "just lint", "lint:fix": "just lint --fix", + "prepublish": "just prepublish", "test": "just test", "test:asmjs-async": "just test:asmjs-async", "test:asmjs-sync": "just test:asmjs-sync", diff --git a/javascript/src_native/Config.cc b/javascript/src/Config.cpp similarity index 98% rename from javascript/src_native/Config.cc rename to javascript/src/Config.cpp index edd5294b..986e553e 100644 --- a/javascript/src_native/Config.cc +++ b/javascript/src/Config.cpp @@ -7,7 +7,7 @@ #include -#include "./Config.hh" +#include "./Config.h" /* static */ Config* Config::create(void) { return new Config(); diff --git a/javascript/src_native/Config.hh b/javascript/src/Config.h similarity index 100% rename from javascript/src_native/Config.hh rename to javascript/src/Config.h diff --git a/javascript/src_native/Layout.hh b/javascript/src/Layout.h similarity index 100% rename from javascript/src_native/Layout.hh rename to javascript/src/Layout.h diff --git a/javascript/src_native/Node.cc b/javascript/src/Node.cpp similarity index 99% rename from javascript/src_native/Node.cc rename to javascript/src/Node.cpp index daadf753..2a1afa98 100644 --- a/javascript/src_native/Node.cc +++ b/javascript/src/Node.cpp @@ -9,10 +9,10 @@ #include -#include "./Node.hh" -#include "./Layout.hh" -#include "./Size.hh" -#include "./Config.hh" +#include "./Node.h" +#include "./Layout.h" +#include "./Size.h" +#include "./Config.h" static YGSize globalMeasureFunc( YGNodeRef nodeRef, diff --git a/javascript/src_native/Node.hh b/javascript/src/Node.h similarity index 98% rename from javascript/src_native/Node.hh rename to javascript/src/Node.h index d416f8e0..7adb5424 100644 --- a/javascript/src_native/Node.hh +++ b/javascript/src/Node.h @@ -12,10 +12,10 @@ #include #include -#include "./Layout.hh" -#include "./Size.hh" -#include "./Value.hh" -#include "./Config.hh" +#include "./Layout.h" +#include "./Size.h" +#include "./Value.h" +#include "./Config.h" class MeasureCallback { public: diff --git a/javascript/src_native/Size.hh b/javascript/src/Size.h similarity index 100% rename from javascript/src_native/Size.hh rename to javascript/src/Size.h diff --git a/javascript/src_native/Value.hh b/javascript/src/Value.h similarity index 100% rename from javascript/src_native/Value.hh rename to javascript/src/Value.h diff --git a/javascript/src_native/embind.cc b/javascript/src/embind.cpp similarity index 98% rename from javascript/src_native/embind.cc rename to javascript/src/embind.cpp index 280d9328..d30094e9 100644 --- a/javascript/src_native/embind.cc +++ b/javascript/src/embind.cpp @@ -5,11 +5,11 @@ * LICENSE file in the root directory of this source tree. */ -#include "./Node.hh" -#include "./Layout.hh" -#include "./Size.hh" -#include "./Value.hh" -#include "./Config.hh" +#include "./Node.h" +#include "./Layout.h" +#include "./Size.h" +#include "./Value.h" +#include "./Config.h" #include #include diff --git a/javascript/src_js/entrypoint/_entryAsync.js b/javascript/src/entrypoint/_entryAsync.js similarity index 100% rename from javascript/src_js/entrypoint/_entryAsync.js rename to javascript/src/entrypoint/_entryAsync.js diff --git a/javascript/src_js/entrypoint/_entrySync.js b/javascript/src/entrypoint/_entrySync.js similarity index 100% rename from javascript/src_js/entrypoint/_entrySync.js rename to javascript/src/entrypoint/_entrySync.js diff --git a/javascript/src_js/entrypoint/asmjs-async.js b/javascript/src/entrypoint/asmjs-async.js similarity index 100% rename from javascript/src_js/entrypoint/asmjs-async.js rename to javascript/src/entrypoint/asmjs-async.js diff --git a/javascript/src_js/entrypoint/asmjs-sync.js b/javascript/src/entrypoint/asmjs-sync.js similarity index 100% rename from javascript/src_js/entrypoint/asmjs-sync.js rename to javascript/src/entrypoint/asmjs-sync.js diff --git a/javascript/src_js/entrypoint/wasm-async.js b/javascript/src/entrypoint/wasm-async.js similarity index 100% rename from javascript/src_js/entrypoint/wasm-async.js rename to javascript/src/entrypoint/wasm-async.js diff --git a/javascript/src_js/entrypoint/wasm-sync.js b/javascript/src/entrypoint/wasm-sync.js similarity index 100% rename from javascript/src_js/entrypoint/wasm-sync.js rename to javascript/src/entrypoint/wasm-sync.js diff --git a/javascript/src_js/generated/YGEnums.d.ts b/javascript/src/generated/YGEnums.d.ts similarity index 58% rename from javascript/src_js/generated/YGEnums.d.ts rename to javascript/src/generated/YGEnums.d.ts index cd31ee7d..0881bd2f 100644 --- a/javascript/src_js/generated/YGEnums.d.ts +++ b/javascript/src/generated/YGEnums.d.ts @@ -8,234 +8,234 @@ // @generated by enums.py type ALIGN_AUTO = 0 & ['ALIGN'] -export const ALIGN_AUTO: ALIGN_AUTO; +export declare const ALIGN_AUTO: ALIGN_AUTO; type ALIGN_FLEX_START = 1 & ['ALIGN'] -export const ALIGN_FLEX_START: ALIGN_FLEX_START; +export declare const ALIGN_FLEX_START: ALIGN_FLEX_START; type ALIGN_CENTER = 2 & ['ALIGN'] -export const ALIGN_CENTER: ALIGN_CENTER; +export declare const ALIGN_CENTER: ALIGN_CENTER; type ALIGN_FLEX_END = 3 & ['ALIGN'] -export const ALIGN_FLEX_END: ALIGN_FLEX_END; +export declare const ALIGN_FLEX_END: ALIGN_FLEX_END; type ALIGN_STRETCH = 4 & ['ALIGN'] -export const ALIGN_STRETCH: ALIGN_STRETCH; +export declare const ALIGN_STRETCH: ALIGN_STRETCH; type ALIGN_BASELINE = 5 & ['ALIGN'] -export const ALIGN_BASELINE: ALIGN_BASELINE; +export declare const ALIGN_BASELINE: ALIGN_BASELINE; type ALIGN_SPACE_BETWEEN = 6 & ['ALIGN'] -export const ALIGN_SPACE_BETWEEN: ALIGN_SPACE_BETWEEN; +export declare const ALIGN_SPACE_BETWEEN: ALIGN_SPACE_BETWEEN; type ALIGN_SPACE_AROUND = 7 & ['ALIGN'] -export const ALIGN_SPACE_AROUND: ALIGN_SPACE_AROUND; +export declare const ALIGN_SPACE_AROUND: ALIGN_SPACE_AROUND; type DIMENSION_WIDTH = 0 & ['DIMENSION'] -export const DIMENSION_WIDTH: DIMENSION_WIDTH; +export declare const DIMENSION_WIDTH: DIMENSION_WIDTH; type DIMENSION_HEIGHT = 1 & ['DIMENSION'] -export const DIMENSION_HEIGHT: DIMENSION_HEIGHT; +export declare const DIMENSION_HEIGHT: DIMENSION_HEIGHT; type DIRECTION_INHERIT = 0 & ['DIRECTION'] -export const DIRECTION_INHERIT: DIRECTION_INHERIT; +export declare const DIRECTION_INHERIT: DIRECTION_INHERIT; type DIRECTION_LTR = 1 & ['DIRECTION'] -export const DIRECTION_LTR: DIRECTION_LTR; +export declare const DIRECTION_LTR: DIRECTION_LTR; type DIRECTION_RTL = 2 & ['DIRECTION'] -export const DIRECTION_RTL: DIRECTION_RTL; +export declare const DIRECTION_RTL: DIRECTION_RTL; type DISPLAY_FLEX = 0 & ['DISPLAY'] -export const DISPLAY_FLEX: DISPLAY_FLEX; +export declare const DISPLAY_FLEX: DISPLAY_FLEX; type DISPLAY_NONE = 1 & ['DISPLAY'] -export const DISPLAY_NONE: DISPLAY_NONE; +export declare const DISPLAY_NONE: DISPLAY_NONE; type EDGE_LEFT = 0 & ['EDGE'] -export const EDGE_LEFT: EDGE_LEFT; +export declare const EDGE_LEFT: EDGE_LEFT; type EDGE_TOP = 1 & ['EDGE'] -export const EDGE_TOP: EDGE_TOP; +export declare const EDGE_TOP: EDGE_TOP; type EDGE_RIGHT = 2 & ['EDGE'] -export const EDGE_RIGHT: EDGE_RIGHT; +export declare const EDGE_RIGHT: EDGE_RIGHT; type EDGE_BOTTOM = 3 & ['EDGE'] -export const EDGE_BOTTOM: EDGE_BOTTOM; +export declare const EDGE_BOTTOM: EDGE_BOTTOM; type EDGE_START = 4 & ['EDGE'] -export const EDGE_START: EDGE_START; +export declare const EDGE_START: EDGE_START; type EDGE_END = 5 & ['EDGE'] -export const EDGE_END: EDGE_END; +export declare const EDGE_END: EDGE_END; type EDGE_HORIZONTAL = 6 & ['EDGE'] -export const EDGE_HORIZONTAL: EDGE_HORIZONTAL; +export declare const EDGE_HORIZONTAL: EDGE_HORIZONTAL; type EDGE_VERTICAL = 7 & ['EDGE'] -export const EDGE_VERTICAL: EDGE_VERTICAL; +export declare const EDGE_VERTICAL: EDGE_VERTICAL; type EDGE_ALL = 8 & ['EDGE'] -export const EDGE_ALL: EDGE_ALL; +export declare const EDGE_ALL: EDGE_ALL; type ERRATA_NONE = 0 & ['ERRATA'] -export const ERRATA_NONE: ERRATA_NONE; +export declare const ERRATA_NONE: ERRATA_NONE; type ERRATA_STRETCH_FLEX_BASIS = 1 & ['ERRATA'] -export const ERRATA_STRETCH_FLEX_BASIS: ERRATA_STRETCH_FLEX_BASIS; +export declare const ERRATA_STRETCH_FLEX_BASIS: ERRATA_STRETCH_FLEX_BASIS; type ERRATA_ALL = 2147483647 & ['ERRATA'] -export const ERRATA_ALL: ERRATA_ALL; +export declare const ERRATA_ALL: ERRATA_ALL; type ERRATA_CLASSIC = 2147483646 & ['ERRATA'] -export const ERRATA_CLASSIC: ERRATA_CLASSIC; +export declare const ERRATA_CLASSIC: ERRATA_CLASSIC; type EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS = 0 & ['EXPERIMENTAL_FEATURE'] -export const EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS; +export declare const EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS; type EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE = 1 & ['EXPERIMENTAL_FEATURE'] -export const EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE: EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE; +export declare const EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE: EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE; type EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN = 2 & ['EXPERIMENTAL_FEATURE'] -export const EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN: EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN; +export declare const EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN: EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN; type FLEX_DIRECTION_COLUMN = 0 & ['FLEX_DIRECTION'] -export const FLEX_DIRECTION_COLUMN: FLEX_DIRECTION_COLUMN; +export declare const FLEX_DIRECTION_COLUMN: FLEX_DIRECTION_COLUMN; type FLEX_DIRECTION_COLUMN_REVERSE = 1 & ['FLEX_DIRECTION'] -export const FLEX_DIRECTION_COLUMN_REVERSE: FLEX_DIRECTION_COLUMN_REVERSE; +export declare const FLEX_DIRECTION_COLUMN_REVERSE: FLEX_DIRECTION_COLUMN_REVERSE; type FLEX_DIRECTION_ROW = 2 & ['FLEX_DIRECTION'] -export const FLEX_DIRECTION_ROW: FLEX_DIRECTION_ROW; +export declare const FLEX_DIRECTION_ROW: FLEX_DIRECTION_ROW; type FLEX_DIRECTION_ROW_REVERSE = 3 & ['FLEX_DIRECTION'] -export const FLEX_DIRECTION_ROW_REVERSE: FLEX_DIRECTION_ROW_REVERSE; +export declare const FLEX_DIRECTION_ROW_REVERSE: FLEX_DIRECTION_ROW_REVERSE; type GUTTER_COLUMN = 0 & ['GUTTER'] -export const GUTTER_COLUMN: GUTTER_COLUMN; +export declare const GUTTER_COLUMN: GUTTER_COLUMN; type GUTTER_ROW = 1 & ['GUTTER'] -export const GUTTER_ROW: GUTTER_ROW; +export declare const GUTTER_ROW: GUTTER_ROW; type GUTTER_ALL = 2 & ['GUTTER'] -export const GUTTER_ALL: GUTTER_ALL; +export declare const GUTTER_ALL: GUTTER_ALL; type JUSTIFY_FLEX_START = 0 & ['JUSTIFY'] -export const JUSTIFY_FLEX_START: JUSTIFY_FLEX_START; +export declare const JUSTIFY_FLEX_START: JUSTIFY_FLEX_START; type JUSTIFY_CENTER = 1 & ['JUSTIFY'] -export const JUSTIFY_CENTER: JUSTIFY_CENTER; +export declare const JUSTIFY_CENTER: JUSTIFY_CENTER; type JUSTIFY_FLEX_END = 2 & ['JUSTIFY'] -export const JUSTIFY_FLEX_END: JUSTIFY_FLEX_END; +export declare const JUSTIFY_FLEX_END: JUSTIFY_FLEX_END; type JUSTIFY_SPACE_BETWEEN = 3 & ['JUSTIFY'] -export const JUSTIFY_SPACE_BETWEEN: JUSTIFY_SPACE_BETWEEN; +export declare const JUSTIFY_SPACE_BETWEEN: JUSTIFY_SPACE_BETWEEN; type JUSTIFY_SPACE_AROUND = 4 & ['JUSTIFY'] -export const JUSTIFY_SPACE_AROUND: JUSTIFY_SPACE_AROUND; +export declare const JUSTIFY_SPACE_AROUND: JUSTIFY_SPACE_AROUND; type JUSTIFY_SPACE_EVENLY = 5 & ['JUSTIFY'] -export const JUSTIFY_SPACE_EVENLY: JUSTIFY_SPACE_EVENLY; +export declare const JUSTIFY_SPACE_EVENLY: JUSTIFY_SPACE_EVENLY; type LOG_LEVEL_ERROR = 0 & ['LOG_LEVEL'] -export const LOG_LEVEL_ERROR: LOG_LEVEL_ERROR; +export declare const LOG_LEVEL_ERROR: LOG_LEVEL_ERROR; type LOG_LEVEL_WARN = 1 & ['LOG_LEVEL'] -export const LOG_LEVEL_WARN: LOG_LEVEL_WARN; +export declare const LOG_LEVEL_WARN: LOG_LEVEL_WARN; type LOG_LEVEL_INFO = 2 & ['LOG_LEVEL'] -export const LOG_LEVEL_INFO: LOG_LEVEL_INFO; +export declare const LOG_LEVEL_INFO: LOG_LEVEL_INFO; type LOG_LEVEL_DEBUG = 3 & ['LOG_LEVEL'] -export const LOG_LEVEL_DEBUG: LOG_LEVEL_DEBUG; +export declare const LOG_LEVEL_DEBUG: LOG_LEVEL_DEBUG; type LOG_LEVEL_VERBOSE = 4 & ['LOG_LEVEL'] -export const LOG_LEVEL_VERBOSE: LOG_LEVEL_VERBOSE; +export declare const LOG_LEVEL_VERBOSE: LOG_LEVEL_VERBOSE; type LOG_LEVEL_FATAL = 5 & ['LOG_LEVEL'] -export const LOG_LEVEL_FATAL: LOG_LEVEL_FATAL; +export declare const LOG_LEVEL_FATAL: LOG_LEVEL_FATAL; type MEASURE_MODE_UNDEFINED = 0 & ['MEASURE_MODE'] -export const MEASURE_MODE_UNDEFINED: MEASURE_MODE_UNDEFINED; +export declare const MEASURE_MODE_UNDEFINED: MEASURE_MODE_UNDEFINED; type MEASURE_MODE_EXACTLY = 1 & ['MEASURE_MODE'] -export const MEASURE_MODE_EXACTLY: MEASURE_MODE_EXACTLY; +export declare const MEASURE_MODE_EXACTLY: MEASURE_MODE_EXACTLY; type MEASURE_MODE_AT_MOST = 2 & ['MEASURE_MODE'] -export const MEASURE_MODE_AT_MOST: MEASURE_MODE_AT_MOST; +export declare const MEASURE_MODE_AT_MOST: MEASURE_MODE_AT_MOST; type NODE_TYPE_DEFAULT = 0 & ['NODE_TYPE'] -export const NODE_TYPE_DEFAULT: NODE_TYPE_DEFAULT; +export declare const NODE_TYPE_DEFAULT: NODE_TYPE_DEFAULT; type NODE_TYPE_TEXT = 1 & ['NODE_TYPE'] -export const NODE_TYPE_TEXT: NODE_TYPE_TEXT; +export declare const NODE_TYPE_TEXT: NODE_TYPE_TEXT; type OVERFLOW_VISIBLE = 0 & ['OVERFLOW'] -export const OVERFLOW_VISIBLE: OVERFLOW_VISIBLE; +export declare const OVERFLOW_VISIBLE: OVERFLOW_VISIBLE; type OVERFLOW_HIDDEN = 1 & ['OVERFLOW'] -export const OVERFLOW_HIDDEN: OVERFLOW_HIDDEN; +export declare const OVERFLOW_HIDDEN: OVERFLOW_HIDDEN; type OVERFLOW_SCROLL = 2 & ['OVERFLOW'] -export const OVERFLOW_SCROLL: OVERFLOW_SCROLL; +export declare const OVERFLOW_SCROLL: OVERFLOW_SCROLL; type POSITION_TYPE_STATIC = 0 & ['POSITION_TYPE'] -export const POSITION_TYPE_STATIC: POSITION_TYPE_STATIC; +export declare const POSITION_TYPE_STATIC: POSITION_TYPE_STATIC; type POSITION_TYPE_RELATIVE = 1 & ['POSITION_TYPE'] -export const POSITION_TYPE_RELATIVE: POSITION_TYPE_RELATIVE; +export declare const POSITION_TYPE_RELATIVE: POSITION_TYPE_RELATIVE; type POSITION_TYPE_ABSOLUTE = 2 & ['POSITION_TYPE'] -export const POSITION_TYPE_ABSOLUTE: POSITION_TYPE_ABSOLUTE; +export declare const POSITION_TYPE_ABSOLUTE: POSITION_TYPE_ABSOLUTE; type PRINT_OPTIONS_LAYOUT = 1 & ['PRINT_OPTIONS'] -export const PRINT_OPTIONS_LAYOUT: PRINT_OPTIONS_LAYOUT; +export declare const PRINT_OPTIONS_LAYOUT: PRINT_OPTIONS_LAYOUT; type PRINT_OPTIONS_STYLE = 2 & ['PRINT_OPTIONS'] -export const PRINT_OPTIONS_STYLE: PRINT_OPTIONS_STYLE; +export declare const PRINT_OPTIONS_STYLE: PRINT_OPTIONS_STYLE; type PRINT_OPTIONS_CHILDREN = 4 & ['PRINT_OPTIONS'] -export const PRINT_OPTIONS_CHILDREN: PRINT_OPTIONS_CHILDREN; +export declare const PRINT_OPTIONS_CHILDREN: PRINT_OPTIONS_CHILDREN; type UNIT_UNDEFINED = 0 & ['UNIT'] -export const UNIT_UNDEFINED: UNIT_UNDEFINED; +export declare const UNIT_UNDEFINED: UNIT_UNDEFINED; type UNIT_POINT = 1 & ['UNIT'] -export const UNIT_POINT: UNIT_POINT; +export declare const UNIT_POINT: UNIT_POINT; type UNIT_PERCENT = 2 & ['UNIT'] -export const UNIT_PERCENT: UNIT_PERCENT; +export declare const UNIT_PERCENT: UNIT_PERCENT; type UNIT_AUTO = 3 & ['UNIT'] -export const UNIT_AUTO: UNIT_AUTO; +export declare const UNIT_AUTO: UNIT_AUTO; type WRAP_NO_WRAP = 0 & ['WRAP'] -export const WRAP_NO_WRAP: WRAP_NO_WRAP; +export declare const WRAP_NO_WRAP: WRAP_NO_WRAP; type WRAP_WRAP = 1 & ['WRAP'] -export const WRAP_WRAP: WRAP_WRAP; +export declare const WRAP_WRAP: WRAP_WRAP; type WRAP_WRAP_REVERSE = 2 & ['WRAP'] -export const WRAP_WRAP_REVERSE: WRAP_WRAP_REVERSE; +export declare const WRAP_WRAP_REVERSE: WRAP_WRAP_REVERSE; export type Align = diff --git a/javascript/src_js/generated/YGEnums.js b/javascript/src/generated/YGEnums.js similarity index 100% rename from javascript/src_js/generated/YGEnums.js rename to javascript/src/generated/YGEnums.js diff --git a/javascript/src_js/index.d.ts b/javascript/src/index.d.ts similarity index 100% rename from javascript/src_js/index.d.ts rename to javascript/src/index.d.ts diff --git a/javascript/src_js/index.js b/javascript/src/index.js similarity index 100% rename from javascript/src_js/index.js rename to javascript/src/index.js diff --git a/javascript/src_js/sync.d.ts b/javascript/src/sync.d.ts similarity index 100% rename from javascript/src_js/sync.d.ts rename to javascript/src/sync.d.ts diff --git a/javascript/src_js/sync.js b/javascript/src/sync.js similarity index 100% rename from javascript/src_js/sync.js rename to javascript/src/sync.js diff --git a/javascript/src_js/wrapAsm.d.ts b/javascript/src/wrapAsm.d.ts similarity index 100% rename from javascript/src_js/wrapAsm.d.ts rename to javascript/src/wrapAsm.d.ts diff --git a/javascript/src_js/wrapAsm.js b/javascript/src/wrapAsm.js similarity index 100% rename from javascript/src_js/wrapAsm.js rename to javascript/src/wrapAsm.js diff --git a/javascript/tsconfig.json b/javascript/tsconfig.json index 5bce5bdc..2568d1e1 100644 --- a/javascript/tsconfig.json +++ b/javascript/tsconfig.json @@ -3,13 +3,13 @@ "target": "es2018", "module": "commonjs", "strict": true, + "declaration": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "noEmit": true, "baseUrl": ".", "paths": { - "yoga-layout": ["src_js"] + "yoga-layout": ["src"] } }, "ts-node": {