diff --git a/.gitignore b/.gitignore index d471748..3810013 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build/ +builddir/ runtime/ shaderc rayjs diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..754bb87 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,39 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +Add your changes after this line, example: + +`## [MAJOR.MINOR.REVISION-STABILITY] - DD.MM.YYYY` + +## [1.0.1-dev] - 17.03.2024 + +### Added + +- Changes specifier in [CHANGELOG.md](./CHANGELOG.md) +- Version specifier in [VERSION](./VERSION) +- Node version specifier in [.nvmrc](./bindings/.nvmrc) to allow compatibility +- Simple shell script to invoke the bindings generator in [`generate-bindings.sh`](./generate-bindings.sh) +- Simple shell script to invoke the build process in one step in [`build-rayjs.sh`](./build-rayjs.sh) + +### Changed + +- Upgraded raylib to [9a8d73e](https://github.com/raysan5/raylib/commit/9a8d73e6c32514275a0ba53fe528bcb7c2693e27) +- Upgraded raygui to [82ba2b1](https://github.com/raysan5/raygui/commit/82ba2b1a783208d6a1f80d8977d796635260c161) +- Upgraded quickjs to [6a89d7c](https://github.com/bellard/quickjs/commit/6a89d7c27099be84e5312a7ec73205d6a7abe1b4) +- Generated new bindings +- Upgraded all packages of the bindings generator + +### Removed + +- Removed the need of transpilation when using the bindings generator (this is useful to debug generator issues as ts-node can represent errors as they are, without the need of source maps) +- Removed webpack requirement + +### Fixed + +- Markdown linting errors diff --git a/CMakeLists.txt b/CMakeLists.txt index 23ee8cd..81e40f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,10 @@ IF (WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") ENDIF() +if (UNIX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DCONFIG_BIGNUM") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -DCONFIG_BIGNUM") +endif (UNIX) project(rayjs) @@ -17,14 +21,16 @@ message("=== Configure QuickJS ===") set(quickjs_version 2021-03-27) set(quickjs_sources_root ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/quickjs) set(quickjs_sources - ${quickjs_sources_root}/quickjs.h - #${quickjs_sources_root}/quickjs-libc.h - ${quickjs_sources_root}/quickjs.c - ${quickjs_sources_root}/libregexp.c - ${quickjs_sources_root}/libunicode.c - ${quickjs_sources_root}/libbf.c ${quickjs_sources_root}/cutils.c - #${quickjs_sources_root}/quickjs-libc.c + ${quickjs_sources_root}/cutils.h + ${quickjs_sources_root}/libbf.c + ${quickjs_sources_root}/libbf.h + ${quickjs_sources_root}/libregexp.c + ${quickjs_sources_root}/libregexp.h + ${quickjs_sources_root}/libunicode.h + ${quickjs_sources_root}/libunicode.c + ${quickjs_sources_root}/quickjs.h + ${quickjs_sources_root}/quickjs.c ) add_library(quickjs STATIC ${quickjs_sources} diff --git a/readme.md b/README.md similarity index 86% rename from readme.md rename to README.md index 61b5f26..ce96186 100644 --- a/readme.md +++ b/README.md @@ -1,22 +1,29 @@ ![rayjs logo](./doc/logo.png) + # rayjs - Javascript + Raylib + QuickJS based Javascript bindings for raylib in a single ~3mb executable ## What is this? + rayjs is small ES2020 compliant Javascript interpreter based on [QuickJS](https://bellard.org/quickjs/) with bindings for [Raylib](https://www.raylib.com/). You can use it to develop desktop games with Javascript. ## What this is not + rayjs is not a binding for NodeJS nor is it running in the browser (yet). It's comes with its own Javascript engine (QuickJS) similar to how NodeJS comes with the V8 engine. That makes it much easier to run and distribute rayjs programs as all you need to run a program / game is the small rayjs executable. No installation, no dlls or additional files are needed. ## Features + * Compiles into a single, small executable without any dependencies for easy distribution * Use modern Javascript features like classes or async/await * In-depth auto-complete with definitions for the whole API ## Getting started + 1. Download the binary for your platform from the [release section](https://github.com/mode777/rayjs/releases). 2. Unzip the executable to a folder and create a new text file in the same folder. Rename the file to `main.js` 3. Open the file with a text-editor (e.g. Notepad) and add the following code + ```javascript const screenWidth = 800; const screenHeight = 450; @@ -35,11 +42,14 @@ rayjs is not a binding for NodeJS nor is it running in the browser (yet). It's c } closeWindow(); ``` + 4. Run the `rayjs` executable -5. Congratulations, you have created your first rayjs app. +5. Congratulations, you have created your first rayjs app. ## Running code -rayjs will run code in three different modes + +Rayjs will run code in three different modes + 1. If no parameter is given it will look for a file called `main.js` in the executable directory 2. It will run a given Javascript file given as a command line argument like this `rayjs ` 3. It will look for a file called `main.js` in a folder given as a command line argument like this `rayjs ` @@ -50,18 +60,18 @@ The directory of the main Javascript module will also be the working directory o The following raylib APIs are supported so far (with a few exceptions): -- core (no VR support yet) -- shapes -- textures -- text (no support for GlyphInfo yet) -- models (no animation support) -- shaders -- audio -- raymath -- rcamera -- rlights -- raygui -- reasings +* core (no VR support yet) +* shapes +* textures +* text (no support for GlyphInfo yet) +* models (no animation support) +* shaders +* audio +* raymath +* rcamera +* rlights +* raygui +* reasings Similar to including a header in C and for your convenience, all types/functions are provided globally. They are additionally available in a module called 'raylib' @@ -70,6 +80,7 @@ To check which API functions are not available (yet) check `/bindings/src/index. ## Additional APIs Rayjs comes with some additional functionality on top of raylib to make writing raylib code with Javascript easier + ```typescript /** Replace material in slot materialIndex (Material is NOT unloaded) */ declare function setModelMaterial(model: Model, materialIndex: number, material: Material): void; @@ -92,6 +103,7 @@ Additionally it also comes with bindings to [lightmapper.h](https://github.com/a ## Auto-Complete / Intellisense rayjs comes with full auto-complete support in the form of the definitions file `lib.raylib.d.ts`. These will work with Typescript and Javascript. In order to use them with Javascript you should create a Typescript configuration file in the project root (even if you are not using Typescript) called `tsconfig.json` with the following configuration + ```json { "compilerOptions": { @@ -103,74 +115,87 @@ rayjs comes with full auto-complete support in the form of the definitions file } } ``` + After that put the `lib.raylib.d.ts` file in the same folder and optionally restart your IDE. Auto-complete should be working: -![](doc/auto-complete.png) +![Autocomplete example](doc/auto-complete.png) ## Examples -Some official raylib examples were already ported to Javascript and can be found in the `examples` folder. +Some official raylib examples were already ported to Javascript and can be found in the `examples` folder. Additional examples are described here. -``` +```shell ./rayjs examples/js_example_project ``` + Barebones example project on how to structure a project that uses Javascript -``` + +```shell ./rayjs examples/js_mesh_generation.js ``` + Shows how to create a mesh from Javascript ArrayBuffers -``` + +```shell ./rayjs examples/shaders/js_shaders_gradient_lighting.js ``` + Creates a gradient and uses it as lighting for a 3d scene -``` + +```shell ./rayjs examples/ts_dungeon ``` + Small example game that uses Typescript with Webpack for transpilation and bundling -``` + +```shell ./rayjs examples/ts_game ``` + Example how to integrate existing JS libraries. This example integrates the Inkjs library to compile and play a game written in the Ink interactive fiction language. - ### Lightmapper usage -Rayjs integrates the [lightmapper.h](https://github.com/ands/lightmapper/tree/master) library to render baked lighting. + +Rayjs integrates the [lightmapper.h](https://github.com/ands/lightmapper/tree/master) library to render baked lighting. The example demonstrates it's usage. -``` + +```shell ./rayjs examples/js_lightmapper.js ``` Meshes must have unwrapped lightmap uvs in the second UV channel. -![](2023-07-20-13-08-52.png) +![Example lightmap](2023-07-20-13-08-52.png) The example uses an environment that is uniform white which will lead to baking pure ambient occlusion. To bake other light sources, lower the amount of ambient lighting and everything that is rendered with a color other than black will become an emissive lightsource during baking. Rendering will just work as usual and custom shaders are supported. E.g. while the raylib default shader does not support color intensities greater than 1.0, the lightmapper does support them for higher intensity lighting. The example will try to bake lighting alongside the render loop which is still buggy and leads to artifacts. Baking before rendering works better. ## Performance -QuickJS is one of the [faster JS interpreters](https://bellard.org/quickjs/bench.html). I'm getting about 13000 bunnys in the unmodified bunnmark before dropping any frames on my 2020 Macbook Air M1 which seems pretty good. -![Bunnymark](doc/bunny.png) + +QuickJS is one of the [faster JS interpreters](https://bellard.org/quickjs/bench.html). I'm getting about 13000 bunnies in the unmodified bunnmark before dropping any frames on my 2020 Macbook Air M1 which seems pretty good. +![Bunnymark](doc/bunny.png) ## Building + Here are some basic steps if you want to compile rayjs yourself. You should use CMake for building. **Please note that QuickJS needs Mingw in order to compile correctly on Windows** ### Check out required files -```bash + +```shell git clone https://github.com/mode777/rayjs.git git submodule update --init --recursive ``` ### Build with cmake + Make sure you have cmake installed and in your path. -```bash + +```shell cd rayjs -mkdir build -cd build -cmake .. -make +./build-rayjs.sh ``` - +See [`build-rayjs.sh`](./build-rayjs.sh) to understand how to integrate diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..8c555f2 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.0.1-dev \ No newline at end of file diff --git a/bindings/.nvmrc b/bindings/.nvmrc new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/bindings/.nvmrc @@ -0,0 +1 @@ +20 diff --git a/bindings/package-lock.json b/bindings/package-lock.json index a75070a..111a2f4 100644 --- a/bindings/package-lock.json +++ b/bindings/package-lock.json @@ -1,26 +1,23 @@ { "name": "bindings", "version": "1.0.0", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "bindings", "version": "1.0.0", "license": "ISC", - "devDependencies": { - "ts-loader": "^9.4.2", - "ts-node": "^10.9.1", - "typescript": "^5.0.4", - "webpack": "^5.82.0", - "webpack-cli": "^5.0.2" + "dependencies": { + "ts-loader": "^9.5.1", + "ts-node": "^10.9.2", + "typescript": "^5.4.2" } }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -28,68 +25,76 @@ "node": ">=12" } }, - "node_modules/@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "peer": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, + "node_modules/@jridgewell/gen-mapping/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true, + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "peer": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", - "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", - "dev": true, + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "peer": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/source-map/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -98,272 +103,226 @@ "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==" }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" }, "node_modules/@tsconfig/node16": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", - "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", - "dev": true + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==" }, "node_modules/@types/eslint": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", - "integrity": "sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ==", - "dev": true, + "version": "8.56.5", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.5.tgz", + "integrity": "sha512-u5/YPJHo1tvkSF2CE0USEkxon82Z5DBy2xR+qfyYNszpX9qcs4sT6uq2kBbj4BXY1+DBGDPnrhMZV3pKWGNukw==", + "peer": true, "dependencies": { "@types/estree": "*", "@types/json-schema": "*" } }, "node_modules/@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", - "dev": true, + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "peer": true, "dependencies": { "@types/eslint": "*", "@types/estree": "*" } }, "node_modules/@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", - "dev": true + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "peer": true }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "peer": true }, "node_modules/@types/node": { - "version": "20.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.0.tgz", - "integrity": "sha512-O+z53uwx64xY7D6roOi4+jApDGFg0qn6WHcxe5QeqjMaTezBO/mxdfFXIVAVVyNWKx84OmPB3L8kbVYOTeN34A==", - "dev": true + "version": "20.11.28", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.28.tgz", + "integrity": "sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==", + "peer": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.5.tgz", - "integrity": "sha512-LHY/GSAZZRpsNQH+/oHqhRQ5FT7eoULcBqgfyTB5nQHogFnK3/7QoN7dLnwSE/JkUAF0SrRuclT7ODqMFtWxxQ==", - "dev": true, + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", + "peer": true, "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.5", - "@webassemblyjs/helper-wasm-bytecode": "1.11.5" + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.5.tgz", - "integrity": "sha512-1j1zTIC5EZOtCplMBG/IEwLtUojtwFVwdyVMbL/hwWqbzlQoJsWCOavrdnLkemwNoC/EOwtUFch3fuo+cbcXYQ==", - "dev": true + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "peer": true }, "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.5.tgz", - "integrity": "sha512-L65bDPmfpY0+yFrsgz8b6LhXmbbs38OnwDCf6NpnMUYqa+ENfE5Dq9E42ny0qz/PdR0LJyq/T5YijPnU8AXEpA==", - "dev": true + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "peer": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.5.tgz", - "integrity": "sha512-fDKo1gstwFFSfacIeH5KfwzjykIE6ldh1iH9Y/8YkAZrhmu4TctqYjSh7t0K2VyDSXOZJ1MLhht/k9IvYGcIxg==", - "dev": true + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", + "peer": true }, "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.5.tgz", - "integrity": "sha512-DhykHXM0ZABqfIGYNv93A5KKDw/+ywBFnuWybZZWcuzWHfbp21wUfRkbtz7dMGwGgT4iXjWuhRMA2Mzod6W4WA==", - "dev": true, + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "peer": true, "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.5", - "@webassemblyjs/helper-api-error": "1.11.5", + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.5.tgz", - "integrity": "sha512-oC4Qa0bNcqnjAowFn7MPCETQgDYytpsfvz4ujZz63Zu/a/v71HeCAAmZsgZ3YVKec3zSPYytG3/PrRCqbtcAvA==", - "dev": true + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "peer": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.5.tgz", - "integrity": "sha512-uEoThA1LN2NA+K3B9wDo3yKlBfVtC6rh0i4/6hvbz071E8gTNZD/pT0MsBf7MeD6KbApMSkaAK0XeKyOZC7CIA==", - "dev": true, + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", + "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.5", - "@webassemblyjs/helper-buffer": "1.11.5", - "@webassemblyjs/helper-wasm-bytecode": "1.11.5", - "@webassemblyjs/wasm-gen": "1.11.5" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.5.tgz", - "integrity": "sha512-37aGq6qVL8A8oPbPrSGMBcp38YZFXcHfiROflJn9jxSdSMMM5dS5P/9e2/TpaJuhE+wFrbukN2WI6Hw9MH5acg==", - "dev": true, + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "peer": true, "dependencies": { "@xtuc/ieee754": "^1.2.0" } }, "node_modules/@webassemblyjs/leb128": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.5.tgz", - "integrity": "sha512-ajqrRSXaTJoPW+xmkfYN6l8VIeNnR4vBOTQO9HzR7IygoCcKWkICbKFbVTNMjMgMREqXEr0+2M6zukzM47ZUfQ==", - "dev": true, + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "peer": true, "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.5.tgz", - "integrity": "sha512-WiOhulHKTZU5UPlRl53gHR8OxdGsSOxqfpqWeA2FmcwBMaoEdz6b2x2si3IwC9/fSPLfe8pBMRTHVMk5nlwnFQ==", - "dev": true + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "peer": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.5.tgz", - "integrity": "sha512-C0p9D2fAu3Twwqvygvf42iGCQ4av8MFBLiTb+08SZ4cEdwzWx9QeAHDo1E2k+9s/0w1DM40oflJOpkZ8jW4HCQ==", - "dev": true, + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", + "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.5", - "@webassemblyjs/helper-buffer": "1.11.5", - "@webassemblyjs/helper-wasm-bytecode": "1.11.5", - "@webassemblyjs/helper-wasm-section": "1.11.5", - "@webassemblyjs/wasm-gen": "1.11.5", - "@webassemblyjs/wasm-opt": "1.11.5", - "@webassemblyjs/wasm-parser": "1.11.5", - "@webassemblyjs/wast-printer": "1.11.5" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.5.tgz", - "integrity": "sha512-14vteRlRjxLK9eSyYFvw1K8Vv+iPdZU0Aebk3j6oB8TQiQYuO6hj9s4d7qf6f2HJr2khzvNldAFG13CgdkAIfA==", - "dev": true, + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", + "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.5", - "@webassemblyjs/helper-wasm-bytecode": "1.11.5", - "@webassemblyjs/ieee754": "1.11.5", - "@webassemblyjs/leb128": "1.11.5", - "@webassemblyjs/utf8": "1.11.5" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.5.tgz", - "integrity": "sha512-tcKwlIXstBQgbKy1MlbDMlXaxpucn42eb17H29rawYLxm5+MsEmgPzeCP8B1Cl69hCice8LeKgZpRUAPtqYPgw==", - "dev": true, + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", + "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.5", - "@webassemblyjs/helper-buffer": "1.11.5", - "@webassemblyjs/wasm-gen": "1.11.5", - "@webassemblyjs/wasm-parser": "1.11.5" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.5.tgz", - "integrity": "sha512-SVXUIwsLQlc8srSD7jejsfTU83g7pIGr2YYNb9oHdtldSxaOhvA5xwvIiWIfcX8PlSakgqMXsLpLfbbJ4cBYew==", - "dev": true, + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", + "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.5", - "@webassemblyjs/helper-api-error": "1.11.5", - "@webassemblyjs/helper-wasm-bytecode": "1.11.5", - "@webassemblyjs/ieee754": "1.11.5", - "@webassemblyjs/leb128": "1.11.5", - "@webassemblyjs/utf8": "1.11.5" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.5.tgz", - "integrity": "sha512-f7Pq3wvg3GSPUPzR0F6bmI89Hdb+u9WXrSKc4v+N0aV0q6r42WoF92Jp2jEorBEBRoRNXgjp53nBniDXcqZYPA==", - "dev": true, + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", + "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.5", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, - "node_modules/@webpack-cli/configtest": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.0.1.tgz", - "integrity": "sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A==", - "dev": true, - "engines": { - "node": ">=14.15.0" - }, - "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" - } - }, - "node_modules/@webpack-cli/info": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.1.tgz", - "integrity": "sha512-fE1UEWTwsAxRhrJNikE7v4EotYflkEhBL7EbajfkPlf6E37/2QshOy/D48Mw8G5XMFlQtS6YV42vtbG9zBpIQA==", - "dev": true, - "engines": { - "node": ">=14.15.0" - }, - "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" - } - }, - "node_modules/@webpack-cli/serve": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.2.tgz", - "integrity": "sha512-S9h3GmOmzUseyeFW3tYNnWS7gNUuwxZ3mmMq0JyW78Vx1SGKPSkt5bT4pB0rUnVfHjP0EL9gW2bOzmtiTfQt0A==", - "dev": true, - "engines": { - "node": ">=14.15.0" - }, - "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" - }, - "peerDependenciesMeta": { - "webpack-dev-server": { - "optional": true - } - } - }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true + "peer": true }, "node_modules/@xtuc/long": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true + "peer": true }, "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true, + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "bin": { "acorn": "bin/acorn" }, @@ -372,19 +331,18 @@ } }, "node_modules/acorn-import-assertions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", - "dev": true, + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "peer": true, "peerDependencies": { "acorn": "^8" } }, "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "engines": { "node": ">=0.4.0" } @@ -393,7 +351,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -409,7 +367,7 @@ "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, + "peer": true, "peerDependencies": { "ajv": "^6.9.1" } @@ -418,7 +376,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -432,14 +389,12 @@ "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" }, "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -448,10 +403,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", - "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", - "dev": true, + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "funding": [ { "type": "opencollective", @@ -460,13 +414,18 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], + "peer": true, "dependencies": { - "caniuse-lite": "^1.0.30001449", - "electron-to-chromium": "^1.4.284", - "node-releases": "^2.0.8", - "update-browserslist-db": "^1.0.10" + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" }, "bin": { "browserslist": "cli.js" @@ -479,13 +438,12 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "peer": true }, "node_modules/caniuse-lite": { - "version": "1.0.30001485", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001485.tgz", - "integrity": "sha512-8aUpZ7sjhlOyiNsg+pgcrTTPUXKh+rg544QYHSvQErljVEKJzvkYkCR/hUFeeVoEfTToUtY9cUKNRC7+c45YkA==", - "dev": true, + "version": "1.0.30001598", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001598.tgz", + "integrity": "sha512-j8mQRDziG94uoBfeFuqsJUNECW37DXpnvhcMJMdlH2u3MRkq1sAI0LJcXP1i/Py0KbSIC4UDj8YHPrTn5YsL+Q==", "funding": [ { "type": "opencollective", @@ -499,13 +457,13 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "peer": true }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -517,46 +475,19 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chalk/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", - "dev": true, + "peer": true, "engines": { "node": ">=6.0" } }, - "node_modules/clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -567,61 +498,37 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "peer": true }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, "engines": { "node": ">=0.3.1" } }, "node_modules/electron-to-chromium": { - "version": "1.4.385", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.385.tgz", - "integrity": "sha512-L9zlje9bIw0h+CwPQumiuVlfMcV4boxRjFIWDcLfFqTZNbkwOExBzfmswytHawObQX4OUhtNv8gIiB21kOurIg==", - "dev": true + "version": "1.4.708", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.708.tgz", + "integrity": "sha512-iWgEEvREL4GTXXHKohhh33+6Y8XkPI5eHihDmm8zUk5Zo7HICEW+wI/j5kJ2tbuNUCXJ/sNXa03ajW635DiJXA==", + "peer": true }, "node_modules/enhanced-resolve": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz", - "integrity": "sha512-eyV8f0y1+bzyfh8xAwW/WTSZpLbjhqc4ne9eGSH4Zo2ejdyiNG9pU6mf9DG8a7+Auk6MFTlNOT4Y2y/9k8GKVg==", - "dev": true, + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", + "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -630,29 +537,17 @@ "node": ">=10.13.0" } }, - "node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", - "dev": true, - "bin": { - "envinfo": "dist/cli.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/es-module-lexer": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.2.1.tgz", - "integrity": "sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==", - "dev": true + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", + "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==", + "peer": true }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "peer": true, "engines": { "node": ">=6" } @@ -661,7 +556,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, + "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -674,7 +569,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, + "peer": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -686,7 +581,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, + "peer": true, "engines": { "node": ">=4.0" } @@ -695,7 +590,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, + "peer": true, "engines": { "node": ">=4.0" } @@ -704,7 +599,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, + "peer": true, "engines": { "node": ">=0.8.x" } @@ -713,28 +608,18 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "peer": true }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fastest-levenshtein": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", - "dev": true, - "engines": { - "node": ">= 4.9.1" - } + "peer": true }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -742,139 +627,38 @@ "node": ">=8" } }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, "node_modules/glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true + "peer": true }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "engines": { "node": ">=8" } }, - "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", - "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/interpret": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", - "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", - "dev": true, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/is-core-module": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", - "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", - "dev": true, + "peer": true, "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -884,53 +668,46 @@ "node": ">= 10.13.0" } }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true + "peer": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "peer": true }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", - "dev": true, + "peer": true, "engines": { "node": ">=6.11.5" } }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -941,20 +718,18 @@ "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "peer": true }, "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -967,7 +742,7 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, + "peer": true, "engines": { "node": ">= 0.6" } @@ -976,7 +751,7 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, + "peer": true, "dependencies": { "mime-db": "1.52.0" }, @@ -988,85 +763,24 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true + "peer": true }, "node_modules/node-releases": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", - "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", - "dev": true - }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "peer": true }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "peer": true }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -1074,23 +788,11 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "peer": true, "engines": { "node": ">=6" } @@ -1099,66 +801,15 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, + "peer": true, "dependencies": { "safe-buffer": "^5.1.0" } }, - "node_modules/rechoir": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", - "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", - "dev": true, - "dependencies": { - "resolve": "^1.20.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", - "dev": true, - "dependencies": { - "is-core-module": "^2.11.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -1172,13 +823,14 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "peer": true }, "node_modules/schema-utils": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.2.tgz", - "integrity": "sha512-pvjEHOgWc9OWA/f/DE3ohBWTD6EleVLf7iFUkoSwAxttdBhB9QUebQgxER2kWueOvRJXPHNnyrvvh9eZINB8Eg==", - "dev": true, + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "peer": true, "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", @@ -1193,10 +845,9 @@ } }, "node_modules/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", - "dev": true, + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -1208,110 +859,68 @@ } }, "node_modules/serialize-javascript": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", - "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", - "dev": true, + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "peer": true, "dependencies": { "randombytes": "^2.1.0" } }, - "node_modules/shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "engines": { - "node": ">=0.10.0" + "node": ">= 8" } }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, + "peer": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dependencies": { "has-flag": "^4.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true, "engines": { "node": ">=6" } }, "node_modules/terser": { - "version": "5.17.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.1.tgz", - "integrity": "sha512-hVl35zClmpisy6oaoKALOpS0rDYLxRFLHhRuDlEGTKey9qHjS1w9GMORjuwIMt70Wan4lwsLYyWDVnWgF+KUEw==", - "dev": true, + "version": "5.29.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.29.2.tgz", + "integrity": "sha512-ZiGkhUBIM+7LwkNjXYJq8svgkd+QK3UUr0wJqY4MieaezBSAIPgbSPZyIx0idM6XWK5CMzSWa8MJIzmRcB8Caw==", + "peer": true, "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -1323,16 +932,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.7.tgz", - "integrity": "sha512-AfKwIktyP7Cu50xNjXF/6Qb5lBNzYaWpU6YfoX3uZicTx0zTy0stDDCsvjDapKsSDvOeWo5MEq4TmdBy2cNoHw==", - "dev": true, + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", + "peer": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.17", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.1", - "terser": "^5.16.5" + "terser": "^5.26.0" }, "engines": { "node": ">= 10.13.0" @@ -1356,36 +965,20 @@ } } }, - "node_modules/terser-webpack-plugin/node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/terser-webpack-plugin/node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, "node_modules/terser-webpack-plugin/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", - "dev": true, + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "peer": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -1394,15 +987,15 @@ } }, "node_modules/ts-loader": { - "version": "9.4.2", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", - "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", - "dev": true, + "version": "9.5.1", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.1.tgz", + "integrity": "sha512-rNH3sK9kGZcH9dYzC7CewQm4NtxJTjSEVRJ2DyBZR7f8/wcta+iV44UPCXc5+nzDzivKtlzV6c9P4e+oFhDLYg==", "dependencies": { "chalk": "^4.1.0", "enhanced-resolve": "^5.0.0", "micromatch": "^4.0.0", - "semver": "^7.3.4" + "semver": "^7.3.4", + "source-map": "^0.7.4" }, "engines": { "node": ">=12.0.0" @@ -1413,10 +1006,9 @@ } }, "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -1456,23 +1048,27 @@ } }, "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", - "dev": true, + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=12.20" + "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "peer": true + }, "node_modules/update-browserslist-db": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", - "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", - "dev": true, + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "funding": [ { "type": "opencollective", @@ -1487,6 +1083,7 @@ "url": "https://github.com/sponsors/ai" } ], + "peer": true, "dependencies": { "escalade": "^3.1.1", "picocolors": "^1.0.0" @@ -1502,7 +1099,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, + "peer": true, "dependencies": { "punycode": "^2.1.0" } @@ -1510,14 +1107,13 @@ "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" }, "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", - "dev": true, + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz", + "integrity": "sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==", + "peer": true, "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -1527,21 +1123,21 @@ } }, "node_modules/webpack": { - "version": "5.82.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.82.0.tgz", - "integrity": "sha512-iGNA2fHhnDcV1bONdUu554eZx+XeldsaeQ8T67H6KKHl2nUSwX8Zm7cmzOA46ox/X1ARxf7Bjv8wQ/HsB5fxBg==", - "dev": true, + "version": "5.90.3", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.3.tgz", + "integrity": "sha512-h6uDYlWCctQRuXBs1oYpVe6sFcWedl0dpcVaTf/YF67J9bKvwJajFulMVSYKHrksMB3I/pIagRzDxwxkebuzKA==", + "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", + "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.11.5", "@webassemblyjs/wasm-edit": "^1.11.5", "@webassemblyjs/wasm-parser": "^1.11.5", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.7.6", - "browserslist": "^4.14.5", + "acorn-import-assertions": "^1.9.0", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.13.0", + "enhanced-resolve": "^5.15.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -1551,9 +1147,9 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.2", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", + "terser-webpack-plugin": "^5.3.10", "watchpack": "^2.4.0", "webpack-sources": "^3.2.3" }, @@ -1573,1340 +1169,27 @@ } } }, - "node_modules/webpack-cli": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.0.2.tgz", - "integrity": "sha512-4y3W5Dawri5+8dXm3+diW6Mn1Ya+Dei6eEVAdIduAmYNLzv1koKVAqsfgrrc9P2mhrYHQphx5htnGkcNwtubyQ==", - "dev": true, - "dependencies": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^2.0.1", - "@webpack-cli/info": "^2.0.1", - "@webpack-cli/serve": "^2.0.2", - "colorette": "^2.0.14", - "commander": "^10.0.1", - "cross-spawn": "^7.0.3", - "envinfo": "^7.7.3", - "fastest-levenshtein": "^1.0.12", - "import-local": "^3.0.2", - "interpret": "^3.1.1", - "rechoir": "^0.8.0", - "webpack-merge": "^5.7.3" - }, - "bin": { - "webpack-cli": "bin/cli.js" - }, - "engines": { - "node": ">=14.15.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "5.x.x" - }, - "peerDependenciesMeta": { - "@webpack-cli/generators": { - "optional": true - }, - "webpack-bundle-analyzer": { - "optional": true - }, - "webpack-dev-server": { - "optional": true - } - } - }, - "node_modules/webpack-cli/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/webpack-merge": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", - "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", - "dev": true, - "dependencies": { - "clone-deep": "^4.0.1", - "wildcard": "^2.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/webpack-sources": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "dev": true, + "peer": true, "engines": { "node": ">=10.13.0" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wildcard": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", - "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", - "dev": true - }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, "engines": { "node": ">=6" } } - }, - "dependencies": { - "@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "requires": { - "@jridgewell/trace-mapping": "0.3.9" - } - }, - "@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", - "dev": true - }, - "@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true - }, - "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true - }, - "@jridgewell/source-map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", - "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", - "dev": true, - "requires": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true - }, - "@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true - }, - "@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true - }, - "@tsconfig/node16": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", - "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", - "dev": true - }, - "@types/eslint": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", - "integrity": "sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ==", - "dev": true, - "requires": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", - "dev": true, - "requires": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, - "@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", - "dev": true - }, - "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, - "@types/node": { - "version": "20.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.0.tgz", - "integrity": "sha512-O+z53uwx64xY7D6roOi4+jApDGFg0qn6WHcxe5QeqjMaTezBO/mxdfFXIVAVVyNWKx84OmPB3L8kbVYOTeN34A==", - "dev": true - }, - "@webassemblyjs/ast": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.5.tgz", - "integrity": "sha512-LHY/GSAZZRpsNQH+/oHqhRQ5FT7eoULcBqgfyTB5nQHogFnK3/7QoN7dLnwSE/JkUAF0SrRuclT7ODqMFtWxxQ==", - "dev": true, - "requires": { - "@webassemblyjs/helper-numbers": "1.11.5", - "@webassemblyjs/helper-wasm-bytecode": "1.11.5" - } - }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.5.tgz", - "integrity": "sha512-1j1zTIC5EZOtCplMBG/IEwLtUojtwFVwdyVMbL/hwWqbzlQoJsWCOavrdnLkemwNoC/EOwtUFch3fuo+cbcXYQ==", - "dev": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.5.tgz", - "integrity": "sha512-L65bDPmfpY0+yFrsgz8b6LhXmbbs38OnwDCf6NpnMUYqa+ENfE5Dq9E42ny0qz/PdR0LJyq/T5YijPnU8AXEpA==", - "dev": true - }, - "@webassemblyjs/helper-buffer": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.5.tgz", - "integrity": "sha512-fDKo1gstwFFSfacIeH5KfwzjykIE6ldh1iH9Y/8YkAZrhmu4TctqYjSh7t0K2VyDSXOZJ1MLhht/k9IvYGcIxg==", - "dev": true - }, - "@webassemblyjs/helper-numbers": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.5.tgz", - "integrity": "sha512-DhykHXM0ZABqfIGYNv93A5KKDw/+ywBFnuWybZZWcuzWHfbp21wUfRkbtz7dMGwGgT4iXjWuhRMA2Mzod6W4WA==", - "dev": true, - "requires": { - "@webassemblyjs/floating-point-hex-parser": "1.11.5", - "@webassemblyjs/helper-api-error": "1.11.5", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.5.tgz", - "integrity": "sha512-oC4Qa0bNcqnjAowFn7MPCETQgDYytpsfvz4ujZz63Zu/a/v71HeCAAmZsgZ3YVKec3zSPYytG3/PrRCqbtcAvA==", - "dev": true - }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.5.tgz", - "integrity": "sha512-uEoThA1LN2NA+K3B9wDo3yKlBfVtC6rh0i4/6hvbz071E8gTNZD/pT0MsBf7MeD6KbApMSkaAK0XeKyOZC7CIA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.5", - "@webassemblyjs/helper-buffer": "1.11.5", - "@webassemblyjs/helper-wasm-bytecode": "1.11.5", - "@webassemblyjs/wasm-gen": "1.11.5" - } - }, - "@webassemblyjs/ieee754": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.5.tgz", - "integrity": "sha512-37aGq6qVL8A8oPbPrSGMBcp38YZFXcHfiROflJn9jxSdSMMM5dS5P/9e2/TpaJuhE+wFrbukN2WI6Hw9MH5acg==", - "dev": true, - "requires": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "@webassemblyjs/leb128": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.5.tgz", - "integrity": "sha512-ajqrRSXaTJoPW+xmkfYN6l8VIeNnR4vBOTQO9HzR7IygoCcKWkICbKFbVTNMjMgMREqXEr0+2M6zukzM47ZUfQ==", - "dev": true, - "requires": { - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/utf8": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.5.tgz", - "integrity": "sha512-WiOhulHKTZU5UPlRl53gHR8OxdGsSOxqfpqWeA2FmcwBMaoEdz6b2x2si3IwC9/fSPLfe8pBMRTHVMk5nlwnFQ==", - "dev": true - }, - "@webassemblyjs/wasm-edit": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.5.tgz", - "integrity": "sha512-C0p9D2fAu3Twwqvygvf42iGCQ4av8MFBLiTb+08SZ4cEdwzWx9QeAHDo1E2k+9s/0w1DM40oflJOpkZ8jW4HCQ==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.5", - "@webassemblyjs/helper-buffer": "1.11.5", - "@webassemblyjs/helper-wasm-bytecode": "1.11.5", - "@webassemblyjs/helper-wasm-section": "1.11.5", - "@webassemblyjs/wasm-gen": "1.11.5", - "@webassemblyjs/wasm-opt": "1.11.5", - "@webassemblyjs/wasm-parser": "1.11.5", - "@webassemblyjs/wast-printer": "1.11.5" - } - }, - "@webassemblyjs/wasm-gen": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.5.tgz", - "integrity": "sha512-14vteRlRjxLK9eSyYFvw1K8Vv+iPdZU0Aebk3j6oB8TQiQYuO6hj9s4d7qf6f2HJr2khzvNldAFG13CgdkAIfA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.5", - "@webassemblyjs/helper-wasm-bytecode": "1.11.5", - "@webassemblyjs/ieee754": "1.11.5", - "@webassemblyjs/leb128": "1.11.5", - "@webassemblyjs/utf8": "1.11.5" - } - }, - "@webassemblyjs/wasm-opt": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.5.tgz", - "integrity": "sha512-tcKwlIXstBQgbKy1MlbDMlXaxpucn42eb17H29rawYLxm5+MsEmgPzeCP8B1Cl69hCice8LeKgZpRUAPtqYPgw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.5", - "@webassemblyjs/helper-buffer": "1.11.5", - "@webassemblyjs/wasm-gen": "1.11.5", - "@webassemblyjs/wasm-parser": "1.11.5" - } - }, - "@webassemblyjs/wasm-parser": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.5.tgz", - "integrity": "sha512-SVXUIwsLQlc8srSD7jejsfTU83g7pIGr2YYNb9oHdtldSxaOhvA5xwvIiWIfcX8PlSakgqMXsLpLfbbJ4cBYew==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.5", - "@webassemblyjs/helper-api-error": "1.11.5", - "@webassemblyjs/helper-wasm-bytecode": "1.11.5", - "@webassemblyjs/ieee754": "1.11.5", - "@webassemblyjs/leb128": "1.11.5", - "@webassemblyjs/utf8": "1.11.5" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.5.tgz", - "integrity": "sha512-f7Pq3wvg3GSPUPzR0F6bmI89Hdb+u9WXrSKc4v+N0aV0q6r42WoF92Jp2jEorBEBRoRNXgjp53nBniDXcqZYPA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.11.5", - "@xtuc/long": "4.2.2" - } - }, - "@webpack-cli/configtest": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.0.1.tgz", - "integrity": "sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A==", - "dev": true, - "requires": {} - }, - "@webpack-cli/info": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.1.tgz", - "integrity": "sha512-fE1UEWTwsAxRhrJNikE7v4EotYflkEhBL7EbajfkPlf6E37/2QshOy/D48Mw8G5XMFlQtS6YV42vtbG9zBpIQA==", - "dev": true, - "requires": {} - }, - "@webpack-cli/serve": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.2.tgz", - "integrity": "sha512-S9h3GmOmzUseyeFW3tYNnWS7gNUuwxZ3mmMq0JyW78Vx1SGKPSkt5bT4pB0rUnVfHjP0EL9gW2bOzmtiTfQt0A==", - "dev": true, - "requires": {} - }, - "@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true - }, - "acorn-import-assertions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", - "dev": true, - "requires": {} - }, - "acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "browserslist": { - "version": "4.21.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", - "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001449", - "electron-to-chromium": "^1.4.284", - "node-releases": "^2.0.8", - "update-browserslist-db": "^1.0.10" - } - }, - "buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "caniuse-lite": { - "version": "1.0.30001485", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001485.tgz", - "integrity": "sha512-8aUpZ7sjhlOyiNsg+pgcrTTPUXKh+rg544QYHSvQErljVEKJzvkYkCR/hUFeeVoEfTToUtY9cUKNRC7+c45YkA==", - "dev": true - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", - "dev": true - }, - "clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, - "electron-to-chromium": { - "version": "1.4.385", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.385.tgz", - "integrity": "sha512-L9zlje9bIw0h+CwPQumiuVlfMcV4boxRjFIWDcLfFqTZNbkwOExBzfmswytHawObQX4OUhtNv8gIiB21kOurIg==", - "dev": true - }, - "enhanced-resolve": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz", - "integrity": "sha512-eyV8f0y1+bzyfh8xAwW/WTSZpLbjhqc4ne9eGSH4Zo2ejdyiNG9pU6mf9DG8a7+Auk6MFTlNOT4Y2y/9k8GKVg==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - } - }, - "envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", - "dev": true - }, - "es-module-lexer": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.2.1.tgz", - "integrity": "sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==", - "dev": true - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fastest-levenshtein": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", - "dev": true - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, - "graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", - "dev": true, - "requires": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - } - }, - "interpret": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", - "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", - "dev": true - }, - "is-core-module": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", - "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", - "dev": true - }, - "jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", - "dev": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - } - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true - }, - "loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", - "dev": true - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "requires": { - "mime-db": "1.52.0" - } - }, - "neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "node-releases": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", - "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", - "dev": true - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - }, - "punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "rechoir": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", - "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", - "dev": true, - "requires": { - "resolve": "^1.20.0" - } - }, - "resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", - "dev": true, - "requires": { - "is-core-module": "^2.11.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, - "resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "requires": { - "resolve-from": "^5.0.0" - } - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - }, - "schema-utils": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.2.tgz", - "integrity": "sha512-pvjEHOgWc9OWA/f/DE3ohBWTD6EleVLf7iFUkoSwAxttdBhB9QUebQgxER2kWueOvRJXPHNnyrvvh9eZINB8Eg==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - }, - "semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "serialize-javascript": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", - "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "requires": { - "kind-of": "^6.0.2" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true - }, - "tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true - }, - "terser": { - "version": "5.17.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.1.tgz", - "integrity": "sha512-hVl35zClmpisy6oaoKALOpS0rDYLxRFLHhRuDlEGTKey9qHjS1w9GMORjuwIMt70Wan4lwsLYyWDVnWgF+KUEw==", - "dev": true, - "requires": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - } - }, - "terser-webpack-plugin": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.7.tgz", - "integrity": "sha512-AfKwIktyP7Cu50xNjXF/6Qb5lBNzYaWpU6YfoX3uZicTx0zTy0stDDCsvjDapKsSDvOeWo5MEq4TmdBy2cNoHw==", - "dev": true, - "requires": { - "@jridgewell/trace-mapping": "^0.3.17", - "jest-worker": "^27.4.5", - "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.1", - "terser": "^5.16.5" - }, - "dependencies": { - "@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true - }, - "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", - "dev": true, - "requires": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" - } - } - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "ts-loader": { - "version": "9.4.2", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", - "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "enhanced-resolve": "^5.0.0", - "micromatch": "^4.0.0", - "semver": "^7.3.4" - } - }, - "ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, - "requires": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - } - }, - "typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", - "dev": true - }, - "update-browserslist-db": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", - "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", - "dev": true, - "requires": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" - } - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true - }, - "watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", - "dev": true, - "requires": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - } - }, - "webpack": { - "version": "5.82.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.82.0.tgz", - "integrity": "sha512-iGNA2fHhnDcV1bONdUu554eZx+XeldsaeQ8T67H6KKHl2nUSwX8Zm7cmzOA46ox/X1ARxf7Bjv8wQ/HsB5fxBg==", - "dev": true, - "requires": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", - "acorn": "^8.7.1", - "acorn-import-assertions": "^1.7.6", - "browserslist": "^4.14.5", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.13.0", - "es-module-lexer": "^1.2.1", - "eslint-scope": "5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", - "json-parse-even-better-errors": "^2.3.1", - "loader-runner": "^4.2.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "schema-utils": "^3.1.2", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", - "watchpack": "^2.4.0", - "webpack-sources": "^3.2.3" - } - }, - "webpack-cli": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.0.2.tgz", - "integrity": "sha512-4y3W5Dawri5+8dXm3+diW6Mn1Ya+Dei6eEVAdIduAmYNLzv1koKVAqsfgrrc9P2mhrYHQphx5htnGkcNwtubyQ==", - "dev": true, - "requires": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^2.0.1", - "@webpack-cli/info": "^2.0.1", - "@webpack-cli/serve": "^2.0.2", - "colorette": "^2.0.14", - "commander": "^10.0.1", - "cross-spawn": "^7.0.3", - "envinfo": "^7.7.3", - "fastest-levenshtein": "^1.0.12", - "import-local": "^3.0.2", - "interpret": "^3.1.1", - "rechoir": "^0.8.0", - "webpack-merge": "^5.7.3" - }, - "dependencies": { - "commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true - } - } - }, - "webpack-merge": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", - "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", - "dev": true, - "requires": { - "clone-deep": "^4.0.1", - "wildcard": "^2.0.0" - } - }, - "webpack-sources": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wildcard": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", - "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true - } } } diff --git a/bindings/package.json b/bindings/package.json index 6ad7a2d..185322e 100644 --- a/bindings/package.json +++ b/bindings/package.json @@ -1,20 +1,16 @@ { "name": "bindings", - "version": "1.0.0", + "version": "1.0.1", "description": "", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "build": "webpack --config webpack.config.js", - "watch": "webpack --watch --config webpack.config.js --mode development" + "bindings:generate": "ts-node ./src/index.ts" }, "keywords": [], "author": "", "license": "ISC", - "devDependencies": { - "ts-loader": "^9.4.2", - "ts-node": "^10.9.1", - "typescript": "^5.0.4", - "webpack": "^5.82.0", - "webpack-cli": "^5.0.2" + "dependencies": { + "ts-loader": "^9.5.1", + "ts-node": "^10.9.2", + "typescript": "^5.4.2" } } diff --git a/bindings/src/index.ts b/bindings/src/index.ts index ca9485a..0ed55aa 100644 --- a/bindings/src/index.ts +++ b/bindings/src/index.ts @@ -1,4 +1,5 @@ import { readFileSync, writeFileSync } from "fs"; +import path from "path"; import { RayLibApi, RayLibFunction, RayLibStruct } from "./interfaces"; import { RayLibHeader } from "./raylib-header"; import { HeaderParser } from "./header-parser"; @@ -23,8 +24,10 @@ function ignore(name: string){ getFunction(api.functions, name)!.binding = { ignore: true } } -function main(){ - +function main() { + const baseDir = path.join(__dirname, "../../"); + process.chdir(baseDir); + // Load the pre-generated raylib api api = JSON.parse(readFileSync("thirdparty/raylib/parser/output/raylib_api.json", 'utf8')) @@ -330,7 +333,6 @@ function main(){ vResolution: { set: true, get: true }, hScreenSize: { set: true, get: true }, vScreenSize: { set: true, get: true }, - vScreenCenter: { set: true, get: true }, eyeToScreenDistance: { set: true, get: true }, lensSeparationDistance: { set: true, get: true }, interpupillaryDistance: { set: true, get: true }, diff --git a/bindings/src/quickjs.ts b/bindings/src/quickjs.ts index d333780..7b8b60a 100644 --- a/bindings/src/quickjs.ts +++ b/bindings/src/quickjs.ts @@ -75,15 +75,24 @@ export abstract class GenericQuickJsGenerator extend return sub } - jsToC(type: string, name: string, src: string, classIds: StructLookup = {}, supressDeclaration = false, typeAlias?: string){ - switch (typeAlias ?? type) { + jsToC(type: string, name: string, src: string, classIds: StructLookup = {}, suppressDeclaration = false, typeAlias?: string){ + let typeSpecifier = typeAlias ?? type; + if (typeSpecifier !== undefined) { + typeSpecifier = typeSpecifier.replace(" *", "*"); // allow specifiers like type * and type* to be the same + } + switch (typeSpecifier) { // Array Buffer - case "const void *": - case "void *": - case "float *": - case "unsigned short *": - case "unsigned char *": - case "const unsigned char *": + case "const void*": + case "void*": + case "bool*": + case "int*": + case "float*": + case "float*": + case "unsigned short*": + case "unsigned char*": + case "const unsigned char*": + case "unsigned int*": + case "const unsigned int*": this.declare(name+"_size", "size_t") this.declare(name+"_js", "void *", false, `(void *)JS_GetArrayBuffer(ctx, &${name}_size, ${src})`) this.if(name+"_js == NULL").returnExp("JS_EXCEPTION") @@ -91,44 +100,47 @@ export abstract class GenericQuickJsGenerator extend this.call("memcpy", ["(void *)"+name, "(const void *)"+name+"_js", name+"_size"]) break; // String - case "const char *": + case "const char*": //case "char *": - if(!supressDeclaration) this.statement(`${type} ${name} = (JS_IsNull(${src}) || JS_IsUndefined(${src})) ? NULL : (${type})JS_ToCString(ctx, ${src})`) + if(!suppressDeclaration) this.statement(`${type} ${name} = (JS_IsNull(${src}) || JS_IsUndefined(${src})) ? NULL : (${type})JS_ToCString(ctx, ${src})`) else this.statement(`${name} = (JS_IsNull(${src}) || JS_IsUndefined(${src})) ? NULL : (${type})JS_ToCString(ctx, ${src})`) break; case "double": - if(!supressDeclaration) this.statement(`${type} ${name}`) + if(!suppressDeclaration) this.statement(`${type} ${name}`) this.statement(`JS_ToFloat64(ctx, &${name}, ${src})`) break; case "float": this.statement("double _double_"+name) this.statement(`JS_ToFloat64(ctx, &_double_${name}, ${src})`) - if(!supressDeclaration) this.statement(`${type} ${name} = (${type})_double_${name}`) + if(!suppressDeclaration) this.statement(`${type} ${name} = (${type})_double_${name}`) else this.statement(`${name} = (${type})_double_${name}`) break; case "int": - if(!supressDeclaration) this.statement(`${type} ${name}`) + if(!suppressDeclaration) this.statement(`${type} ${name}`) this.statement(`JS_ToInt32(ctx, &${name}, ${src})`) break; case "unsigned int": - if(!supressDeclaration) this.statement(`${type} ${name}`) + if(!suppressDeclaration) this.statement(`${type} ${name}`) this.statement(`JS_ToUint32(ctx, &${name}, ${src})`) break; case "unsigned char": this.statement("unsigned int _int_"+name) this.statement(`JS_ToUint32(ctx, &_int_${name}, ${src})`) - if(!supressDeclaration) this.statement(`${type} ${name} = (${type})_int_${name}`) + if(!suppressDeclaration) this.statement(`${type} ${name} = (${type})_int_${name}`) else this.statement(`${name} = (${type})_int_${name}`) break; case "bool": - if(!supressDeclaration) this.statement(`${type} ${name} = JS_ToBool(ctx, ${src})`) + if(!suppressDeclaration) this.statement(`${type} ${name} = JS_ToBool(ctx, ${src})`) else this.statement(`${name} = JS_ToBool(ctx, ${src})`) break; default: const isConst = type.startsWith('const') const isPointer = type.endsWith(' *') const classId = classIds[type.replace("const ", "").replace(" *", "")] - if(!classId) throw new Error("Cannot convert into parameter type: " + type) + if(!classId) { + console.error("Type: ", {type, name, src}, " not registered in ClassIds: ", classIds) + throw new Error("Cannot convert into parameter type: " + type) + } const suffix = isPointer ? "" : "_ptr" this.jsOpqToStructPtr(type.replace(" *", ""), name+suffix, src, classId) this.statement(`if(${name+suffix} == NULL) return JS_EXCEPTION`) @@ -156,10 +168,16 @@ export abstract class GenericQuickJsGenerator extend case "double": this.declare(name, 'JSValue', false, `JS_NewFloat64(ctx, ${src})`) break; + case "unsigned char *": case "const char *": case "char *": this.declare(name, 'JSValue', false, `JS_NewString(ctx, ${src})`) break; + case "unsigned int *": + case "const int *": + case "int *": + this.declare(name, 'JSValue', false, `JS_NewArrayBufferCopy(ctx, ${src}, sizeof(${src}))`) + break; // case "unsigned char *": // this.declare(name, 'JSValue', false, `JS_NewString(ctx, ${src})`) // break; diff --git a/bindings/webpack.config.js b/bindings/webpack.config.js deleted file mode 100644 index 76bf1f2..0000000 --- a/bindings/webpack.config.js +++ /dev/null @@ -1,24 +0,0 @@ -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - devtool: false, - target: "node", - mode: 'production', - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/, - }, - ], - }, - resolve: { - extensions: ['.tsx', '.ts', '.js'], - }, - output: { - filename: 'generate-bindings.js', - path: path.resolve(__dirname, '..'), - }, -}; diff --git a/build-rayjs.sh b/build-rayjs.sh new file mode 100755 index 0000000..299c8ed --- /dev/null +++ b/build-rayjs.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -o errexit -o nounset -o pipefail + +SCRIPTPATH=$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P ) +PROJECT_HOME=$( realpath "$SCRIPTPATH" ) +BUILD_TYPE=Debug +BUILD_DIR=build + +cd "$PROJECT_HOME" && \ +echo "Cleaning up build directory" && \ +rm -fr build && \ +./generate-bindings.sh && \ +echo "Generating build files" && \ +cmake -B "$BUILD_DIR" -DCMAKE_BUILD_TYPE=$BUILD_TYPE && \ +echo "Building" && \ +cmake --build "$BUILD_DIR" --config $BUILD_TYPE diff --git a/examples/lib.raylib.d.ts b/examples/lib.raylib.d.ts index 753df65..3774b81 100644 --- a/examples/lib.raylib.d.ts +++ b/examples/lib.raylib.d.ts @@ -334,8 +334,6 @@ interface VrDeviceInfo { hScreenSize: number, /** Vertical size in meters */ vScreenSize: number, - /** Screen center in meters */ - vScreenCenter: number, /** Distance between eye and display in meters */ eyeToScreenDistance: number, /** Lens separation distance in meters */ @@ -357,6 +355,16 @@ interface FilePathList { declare var FilePathList: { prototype: FilePathList; } +interface AutomationEvent { +} +declare var AutomationEvent: { + prototype: AutomationEvent; +} +interface AutomationEventList { +} +declare var AutomationEventList: { + prototype: AutomationEventList; +} interface Light { type: number, enabled: boolean, @@ -390,10 +398,10 @@ declare var LightmapperConfig: { } /** Initialize window and OpenGL context */ declare function initWindow(width: number, height: number, title: string | undefined | null): void; -/** Check if KEY_ESCAPE pressed or Close icon pressed */ -declare function windowShouldClose(): boolean; /** Close window and unload OpenGL context */ declare function closeWindow(): void; +/** Check if application should close (KEY_ESCAPE pressed or windows close icon clicked) */ +declare function windowShouldClose(): boolean; /** Check if window has been initialized successfully */ declare function isWindowReady(): boolean; /** Check if window is currently fullscreen */ @@ -416,6 +424,8 @@ declare function setWindowState(flags: number): void; declare function clearWindowState(flags: number): void; /** Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) */ declare function toggleFullscreen(): void; +/** Toggle window state: borderless windowed (only PLATFORM_DESKTOP) */ +declare function toggleBorderlessWindowed(): void; /** Set window state: maximized, if resizable (only PLATFORM_DESKTOP) */ declare function maximizeWindow(): void; /** Set window state: minimized, if resizable (only PLATFORM_DESKTOP) */ @@ -424,18 +434,22 @@ declare function minimizeWindow(): void; declare function restoreWindow(): void; /** Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP) */ declare function setWindowIcon(image: Image): void; -/** Set title for window (only PLATFORM_DESKTOP) */ +/** Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB) */ declare function setWindowTitle(title: string | undefined | null): void; /** Set window position on screen (only PLATFORM_DESKTOP) */ declare function setWindowPosition(x: number, y: number): void; -/** Set monitor for the current window (fullscreen mode) */ +/** Set monitor for the current window */ declare function setWindowMonitor(monitor: number): void; /** Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) */ declare function setWindowMinSize(width: number, height: number): void; +/** Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE) */ +declare function setWindowMaxSize(width: number, height: number): void; /** Set window dimensions */ declare function setWindowSize(width: number, height: number): void; /** Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) */ declare function setWindowOpacity(opacity: number): void; +/** Set window focused (only PLATFORM_DESKTOP) */ +declare function setWindowFocused(): void; /** Get current screen width */ declare function getScreenWidth(): number; /** Get current screen height */ @@ -464,7 +478,7 @@ declare function getMonitorRefreshRate(monitor: number): number; declare function getWindowPosition(): Vector2; /** Get window scale DPI factor */ declare function getWindowScaleDPI(): Vector2; -/** Get the human-readable, UTF-8 encoded name of the primary monitor */ +/** Get the human-readable, UTF-8 encoded name of the specified monitor */ declare function getMonitorName(monitor: number): string | undefined | null; /** Set clipboard text content */ declare function setClipboardText(text: string | undefined | null): void; @@ -543,45 +557,51 @@ declare function setShaderValueTexture(shader: Shader, locIndex: number, texture /** Unload shader from GPU memory (VRAM) */ declare function unloadShader(shader: Shader): void; /** Get a ray trace from mouse position */ -declare function getMouseRay(mousePosition: Vector2, camera: Camera3D): Ray; -/** Get camera transform matrix (view matrix) */ -declare function getCameraMatrix(camera: Camera3D): Matrix; -/** Get camera 2d transform matrix */ -declare function getCameraMatrix2D(camera: Camera2D): Matrix; +declare function getScreenToWorldRay(mousePosition: Vector2, camera: Camera3D): Ray; +/** Get a ray trace from mouse position in a viewport */ +declare function getScreenToWorldRayEx(mousePosition: Vector2, camera: Camera3D, width: number, height: number): Ray; /** Get the screen space position for a 3d world space position */ declare function getWorldToScreen(position: Vector3, camera: Camera3D): Vector2; -/** Get the world space position for a 2d camera screen space position */ -declare function getScreenToWorld2D(position: Vector2, camera: Camera2D): Vector2; /** Get size position for a 3d world space position */ declare function getWorldToScreenEx(position: Vector3, camera: Camera3D, width: number, height: number): Vector2; /** Get the screen space position for a 2d camera world space position */ declare function getWorldToScreen2D(position: Vector2, camera: Camera2D): Vector2; +/** Get the world space position for a 2d camera screen space position */ +declare function getScreenToWorld2D(position: Vector2, camera: Camera2D): Vector2; +/** Get camera transform matrix (view matrix) */ +declare function getCameraMatrix(camera: Camera3D): Matrix; +/** Get camera 2d transform matrix */ +declare function getCameraMatrix2D(camera: Camera2D): Matrix; /** Set target FPS (maximum) */ declare function setTargetFPS(fps: number): void; -/** Get current FPS */ -declare function getFPS(): number; /** Get time in seconds for last frame drawn (delta time) */ declare function getFrameTime(): number; /** Get elapsed time in seconds since InitWindow() */ declare function getTime(): number; -/** Get a random value between min and max (both included) */ -declare function getRandomValue(min: number, max: number): number; +/** Get current FPS */ +declare function getFPS(): number; /** Set the seed for the random number generator */ declare function setRandomSeed(seed: number): void; +/** Get a random value between min and max (both included) */ +declare function getRandomValue(min: number, max: number): number; +/** Load random values sequence, no values repeated */ +declare function loadRandomSequence(count: number, min: number, max: number): int; +/** Unload random values sequence */ +declare function unloadRandomSequence(sequence: int): void; /** Takes a screenshot of current screen (filename extension defines format) */ declare function takeScreenshot(fileName: string | undefined | null): void; /** Setup init configuration flags (view FLAGS) */ declare function setConfigFlags(flags: number): void; +/** Open URL with default system browser (if available) */ +declare function openURL(url: string | undefined | null): void; /** Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) */ declare function traceLog(logLevel: number, text: string | undefined | null): void; /** Set the current threshold (minimum) log level */ declare function setTraceLogLevel(logLevel: number): void; -/** Open URL with default system browser (if available) */ -declare function openURL(url: string | undefined | null): void; /** Load file data as byte array (read) */ declare function loadFileData(fileName: string | undefined | null): ArrayBuffer; /** Save data to file from byte array (write), returns true on success */ -declare function saveFileData(fileName: string | undefined | null, data: any, bytesToWrite: number): boolean; +declare function saveFileData(fileName: string | undefined | null, data: any, dataSize: number): boolean; /** Load text data from file (read), returns a '\0' terminated string */ declare function loadFileText(fileName: string | undefined | null): string | undefined | null; /** Save text data to file (write), string must be '\0' terminated, returns true on success */ @@ -606,7 +626,7 @@ declare function getDirectoryPath(filePath: string | undefined | null): string | declare function getPrevDirectoryPath(dirPath: string | undefined | null): string | undefined | null; /** Get current working directory (uses static string) */ declare function getWorkingDirectory(): string | undefined | null; -/** Get the directory if the running application (uses static string) */ +/** Get the directory of the running application (uses static string) */ declare function getApplicationDirectory(): string | undefined | null; /** Change working directory, return true on success */ declare function changeDirectory(dir: string | undefined | null): boolean; @@ -622,20 +642,38 @@ declare function isFileDropped(): boolean; declare function loadDroppedFiles(): string[]; /** Get file modification time (last write time) */ declare function getFileModTime(fileName: string | undefined | null): number; +/** Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS */ +declare function loadAutomationEventList(fileName: string | undefined | null): AutomationEventList; +/** Unload automation events list from file */ +declare function unloadAutomationEventList(list: AutomationEventList): void; +/** Export automation events list as text file */ +declare function exportAutomationEventList(list: AutomationEventList, fileName: string | undefined | null): boolean; +/** Set automation event list to record to */ +declare function setAutomationEventList(list: AutomationEventList): void; +/** Set automation event internal base frame to start recording */ +declare function setAutomationEventBaseFrame(frame: number): void; +/** Start recording automation events (AutomationEventList must be set) */ +declare function startAutomationEventRecording(): void; +/** Stop recording automation events */ +declare function stopAutomationEventRecording(): void; +/** Play a recorded automation event */ +declare function playAutomationEvent(event: AutomationEvent): void; /** Check if a key has been pressed once */ declare function isKeyPressed(key: number): boolean; +/** Check if a key has been pressed again (Only PLATFORM_DESKTOP) */ +declare function isKeyPressedRepeat(key: number): boolean; /** Check if a key is being pressed */ declare function isKeyDown(key: number): boolean; /** Check if a key has been released once */ declare function isKeyReleased(key: number): boolean; /** Check if a key is NOT being pressed */ declare function isKeyUp(key: number): boolean; -/** Set a custom key to exit program (default is ESC) */ -declare function setExitKey(key: number): void; /** Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty */ declare function getKeyPressed(): number; /** Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty */ declare function getCharPressed(): number; +/** Set a custom key to exit program (default is ESC) */ +declare function setExitKey(key: number): void; /** Check if a gamepad is available */ declare function isGamepadAvailable(gamepad: number): boolean; /** Get gamepad internal name id */ @@ -656,6 +694,8 @@ declare function getGamepadAxisCount(gamepad: number): number; declare function getGamepadAxisMovement(gamepad: number, axis: number): number; /** Set internal gamepad mappings (SDL_GameControllerDB) */ declare function setGamepadMappings(mappings: string | undefined | null): number; +/** Set gamepad vibration for both motors */ +declare function setGamepadVibration(gamepad: number, leftMotor: number, rightMotor: number): void; /** Check if a mouse button has been pressed once */ declare function isMouseButtonPressed(button: number): boolean; /** Check if a mouse button is being pressed */ @@ -716,22 +756,22 @@ declare function updateCamera(camera: Camera3D, mode: number): void; declare function updateCameraPro(camera: Camera3D, movement: Vector3, rotation: Vector3, zoom: number): void; /** Set texture and rectangle to be used on shapes drawing */ declare function setShapesTexture(texture: Texture, source: Rectangle): void; +/** Get texture that is used for shapes drawing */ +declare function getShapesTexture(): Texture; +/** Get texture source rectangle that is used for shapes drawing */ +declare function getShapesTextureRectangle(): Rectangle; /** Draw a pixel */ declare function drawPixel(posX: number, posY: number, color: Color): void; /** Draw a pixel (Vector version) */ declare function drawPixelV(position: Vector2, color: Color): void; /** Draw a line */ declare function drawLine(startPosX: number, startPosY: number, endPosX: number, endPosY: number, color: Color): void; -/** Draw a line (Vector version) */ +/** Draw a line (using gl lines) */ declare function drawLineV(startPos: Vector2, endPos: Vector2, color: Color): void; -/** Draw a line defining thickness */ +/** Draw a line (using triangles/quads) */ declare function drawLineEx(startPos: Vector2, endPos: Vector2, thick: number, color: Color): void; -/** Draw a line using cubic-bezier curves in-out */ +/** Draw line segment cubic-bezier in-out interpolation */ declare function drawLineBezier(startPos: Vector2, endPos: Vector2, thick: number, color: Color): void; -/** Draw line using quadratic bezier curves with a control point */ -declare function drawLineBezierQuad(startPos: Vector2, endPos: Vector2, controlPos: Vector2, thick: number, color: Color): void; -/** Draw line using cubic bezier curves with 2 control points */ -declare function drawLineBezierCubic(startPos: Vector2, endPos: Vector2, startControlPos: Vector2, endControlPos: Vector2, thick: number, color: Color): void; /** Draw a color-filled circle */ declare function drawCircle(centerX: number, centerY: number, radius: number, color: Color): void; /** Draw a piece of a circle */ @@ -744,6 +784,8 @@ declare function drawCircleGradient(centerX: number, centerY: number, radius: nu declare function drawCircleV(center: Vector2, radius: number, color: Color): void; /** Draw circle outline */ declare function drawCircleLines(centerX: number, centerY: number, radius: number, color: Color): void; +/** Draw circle outline (Vector version) */ +declare function drawCircleLinesV(center: Vector2, radius: number, color: Color): void; /** Draw ellipse */ declare function drawEllipse(centerX: number, centerY: number, radiusH: number, radiusV: number, color: Color): void; /** Draw ellipse outline */ @@ -784,6 +826,36 @@ declare function drawPoly(center: Vector2, sides: number, radius: number, rotati declare function drawPolyLines(center: Vector2, sides: number, radius: number, rotation: number, color: Color): void; /** Draw a polygon outline of n sides with extended parameters */ declare function drawPolyLinesEx(center: Vector2, sides: number, radius: number, rotation: number, lineThick: number, color: Color): void; +/** Draw spline: Linear, minimum 2 points */ +declare function drawSplineLinear(points: Vector2, pointCount: number, thick: number, color: Color): void; +/** Draw spline: B-Spline, minimum 4 points */ +declare function drawSplineBasis(points: Vector2, pointCount: number, thick: number, color: Color): void; +/** Draw spline: Catmull-Rom, minimum 4 points */ +declare function drawSplineCatmullRom(points: Vector2, pointCount: number, thick: number, color: Color): void; +/** Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] */ +declare function drawSplineBezierQuadratic(points: Vector2, pointCount: number, thick: number, color: Color): void; +/** Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] */ +declare function drawSplineBezierCubic(points: Vector2, pointCount: number, thick: number, color: Color): void; +/** Draw spline segment: Linear, 2 points */ +declare function drawSplineSegmentLinear(p1: Vector2, p2: Vector2, thick: number, color: Color): void; +/** Draw spline segment: B-Spline, 4 points */ +declare function drawSplineSegmentBasis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: number, color: Color): void; +/** Draw spline segment: Catmull-Rom, 4 points */ +declare function drawSplineSegmentCatmullRom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: number, color: Color): void; +/** Draw spline segment: Quadratic Bezier, 2 points, 1 control point */ +declare function drawSplineSegmentBezierQuadratic(p1: Vector2, c2: Vector2, p3: Vector2, thick: number, color: Color): void; +/** Draw spline segment: Cubic Bezier, 2 points, 2 control points */ +declare function drawSplineSegmentBezierCubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, thick: number, color: Color): void; +/** Get (evaluate) spline point: Linear */ +declare function getSplinePointLinear(startPos: Vector2, endPos: Vector2, t: number): Vector2; +/** Get (evaluate) spline point: B-Spline */ +declare function getSplinePointBasis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: number): Vector2; +/** Get (evaluate) spline point: Catmull-Rom */ +declare function getSplinePointCatmullRom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: number): Vector2; +/** Get (evaluate) spline point: Quadratic Bezier */ +declare function getSplinePointBezierQuad(p1: Vector2, c2: Vector2, p3: Vector2, t: number): Vector2; +/** Get (evaluate) spline point: Cubic Bezier */ +declare function getSplinePointBezierCubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, t: number): Vector2; /** Check collision between two rectangles */ declare function checkCollisionRecs(rec1: Rectangle, rec2: Rectangle): boolean; /** Check collision between two circles */ @@ -804,6 +876,10 @@ declare function getCollisionRec(rec1: Rectangle, rec2: Rectangle): Rectangle; declare function loadImage(fileName: string | undefined | null): Image; /** Load image from RAW file data */ declare function loadImageRaw(fileName: string | undefined | null, width: number, height: number, format: number, headerSize: number): Image; +/** Load image from SVG file data or string with specified size */ +declare function loadImageSvg(fileNameOrString: string | undefined | null, width: number, height: number): Image; +/** Load image sequence from memory buffer */ +declare function loadImageAnimFromMemory(fileType: string | undefined | null, fileData: ArrayBuffer, dataSize: number, frames: int): Image; /** Load image from memory buffer, fileType refers to extension: i.e. '.png' */ declare function loadImageFromMemory(fileType: string | undefined | null, fileData: ArrayBuffer, dataSize: number): Image; /** Load image from GPU texture data */ @@ -816,6 +892,8 @@ declare function isImageReady(image: Image): boolean; declare function unloadImage(image: Image): void; /** Export image data to file, returns true on success */ declare function exportImage(image: Image, fileName: string | undefined | null): boolean; +/** Export image to memory buffer */ +declare function exportImageToMemory(image: Image, fileType: string | undefined | null, fileSize: int): ArrayBuffer; /** Generate image: plain color */ declare function genImageColor(width: number, height: number, color: Color): Image; /** Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient */ @@ -858,6 +936,8 @@ declare function imageAlphaMask(image: Image, alphaMask: Image): void; declare function imageAlphaPremultiply(image: Image): void; /** Apply Gaussian blur using a box blur approximation */ declare function imageBlurGaussian(image: Image, blurSize: number): void; +/** Apply Custom Square image convolution kernel */ +declare function imageKernelConvolution(image: Image, kernel: float*, kernelSize: number): void; /** Resize image (Bicubic scaling algorithm) */ declare function imageResize(image: Image, newWidth: number, newHeight: number): void; /** Resize image (Nearest-Neighbor scaling algorithm) */ @@ -872,7 +952,7 @@ declare function imageDither(image: Image, rBpp: number, gBpp: number, bBpp: num declare function imageFlipVertical(image: Image): void; /** Flip image horizontally */ declare function imageFlipHorizontal(image: Image): void; -/** Rotate image by input angle in degrees (-359 to 359) */ +/** Rotate image by input angle in degrees (-359 to 359) */ declare function imageRotate(image: Image, degrees: number): void; /** Rotate image clockwise 90deg */ declare function imageRotateCW(image: Image): void; @@ -966,9 +1046,11 @@ declare function drawTextureRec(texture: Texture, source: Rectangle, position: V declare function drawTexturePro(texture: Texture, source: Rectangle, dest: Rectangle, origin: Vector2, rotation: number, tint: Color): void; /** Draws a texture (or part of it) that stretches or shrinks nicely */ declare function drawTextureNPatch(texture: Texture, nPatchInfo: NPatchInfo, dest: Rectangle, origin: Vector2, rotation: number, tint: Color): void; +/** Check if two colors are equal */ +declare function colorIsEqual(col1: Color, col2: Color): boolean; /** Get color with alpha applied, alpha goes from 0.0f to 1.0f */ declare function fade(color: Color, alpha: number): Color; -/** Get hexadecimal value for a Color */ +/** Get hexadecimal value for a Color (0xRRGGBBAA) */ declare function colorToInt(color: Color): number; /** Get Color normalized as float [0..1] */ declare function colorNormalize(color: Color): Vector4; @@ -996,7 +1078,7 @@ declare function getPixelDataSize(width: number, height: number, format: number) declare function getFontDefault(): Font; /** Load font from file into GPU memory (VRAM) */ declare function loadFont(fileName: string | undefined | null): Font; -/** Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set */ +/** Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont */ declare function loadFontEx(fileName: string | undefined | null, fontSize: number): Font; /** Load font from Image (XNA style) */ declare function loadFontFromImage(image: Image, key: Color, firstChar: number): Font; @@ -1014,6 +1096,8 @@ declare function drawTextEx(font: Font, text: string | undefined | null, positio declare function drawTextPro(font: Font, text: string | undefined | null, position: Vector2, origin: Vector2, rotation: number, fontSize: number, spacing: number, tint: Color): void; /** Draw one character (codepoint) */ declare function drawTextCodepoint(font: Font, codepoint: number, position: Vector2, fontSize: number, tint: Color): void; +/** Set vertical line spacing when drawing with line-breaks */ +declare function setTextLineSpacing(spacing: number): void; /** Measure string width for default font */ declare function measureText(text: string | undefined | null, fontSize: number): number; /** Measure string size for Font */ @@ -1098,12 +1182,14 @@ declare function unloadMesh(mesh: Mesh): void; declare function drawMesh(mesh: Mesh, material: Material, transform: Matrix): void; /** Draw multiple mesh instances with material and different transforms */ declare function drawMeshInstanced(mesh: Mesh, material: Material, transforms: Matrix, instances: number): void; -/** Export mesh data to file, returns true on success */ -declare function exportMesh(mesh: Mesh, fileName: string | undefined | null): boolean; /** Compute mesh bounding box limits */ declare function getMeshBoundingBox(mesh: Mesh): BoundingBox; /** Compute mesh tangents */ declare function genMeshTangents(mesh: Mesh): void; +/** Export mesh data to file, returns true on success */ +declare function exportMesh(mesh: Mesh, fileName: string | undefined | null): boolean; +/** Export mesh as code file (.h) defining multiple arrays of vertex attributes */ +declare function exportMeshAsCode(mesh: Mesh, fileName: string | undefined | null): boolean; /** Generate polygonal mesh */ declare function genMeshPoly(sides: number, radius: number): Mesh; /** Generate plane mesh (with subdivisions) */ @@ -1160,6 +1246,8 @@ declare function closeAudioDevice(): void; declare function isAudioDeviceReady(): boolean; /** Set master volume (listener) */ declare function setMasterVolume(volume: number): void; +/** Get master volume (listener) */ +declare function getMasterVolume(): number; /** Load wave data from file */ declare function loadWave(fileName: string | undefined | null): Wave; /** Load wave from memory buffer, fileType refers to extension: i.e. '.wav' */ @@ -1170,6 +1258,8 @@ declare function isWaveReady(wave: Wave): boolean; declare function loadSound(fileName: string | undefined | null): Sound; /** Load sound from wave data */ declare function loadSoundFromWave(wave: Wave): Sound; +/** Create a new sound that shares the same sample data as the source sound, does not own the sound data */ +declare function loadSoundAlias(source: Sound): Sound; /** Checks if a sound is ready */ declare function isSoundReady(sound: Sound): boolean; /** Update sound buffer with new data */ @@ -1178,6 +1268,8 @@ declare function updateSound(sound: Sound, data: any, sampleCount: number): void declare function unloadWave(wave: Wave): void; /** Unload sound */ declare function unloadSound(sound: Sound): void; +/** Unload a sound alias (does not deallocate sample data) */ +declare function unloadSoundAlias(alias: Sound): void; /** Export wave data to file, returns true on success */ declare function exportWave(wave: Wave, fileName: string | undefined | null): boolean; /** Play a sound */ @@ -1289,6 +1381,10 @@ declare function vector2Transform(v: Vector2, mat: Matrix): Vector2; declare function vector2Lerp(v1: Vector2, v2: Vector2, amount: number): Vector2; /** Calculate reflected vector to normal */ declare function vector2Reflect(v: Vector2, normal: Vector2): Vector2; +/** Get min value for each pair of components */ +declare function vector2Min(v1: Vector2, v2: Vector2): Vector2; +/** Get max value for each pair of components */ +declare function vector2Max(v1: Vector2, v2: Vector2): Vector2; /** Rotate vector by angle */ declare function vector2Rotate(v: Vector2, angle: number): Vector2; /** Move Vector towards target */ @@ -1302,6 +1398,12 @@ declare function vector2Clamp(v: Vector2, min: Vector2, max: Vector2): Vector2; declare function vector2ClampValue(v: Vector2, min: number, max: number): Vector2; /** Check whether two given vectors are almost equal */ declare function vector2Equals(p: Vector2, q: Vector2): number; +/** Compute the direction of a refracted ray +v: normalized direction of the incoming ray +n: normalized normal vector of the interface of two optical media +r: ratio of the refractive index of the medium from where the ray comes + to the refractive index of the medium on the other side of the surface */ +declare function vector2Refract(v: Vector2, n: Vector2, r: number): Vector2; /** Vector with components value 0.0f */ declare function vector3Zero(): Vector3; /** Vector with components value 1.0f */ @@ -1340,12 +1442,18 @@ declare function vector3Negate(v: Vector3): Vector3; declare function vector3Divide(v1: Vector3, v2: Vector3): Vector3; /** Normalize provided vector */ declare function vector3Normalize(v: Vector3): Vector3; +/** //Calculate the projection of the vector v1 on to v2 */ +declare function vector3Project(v1: Vector3, v2: Vector3): Vector3; +/** //Calculate the rejection of the vector v1 on to v2 */ +declare function vector3Reject(v1: Vector3, v2: Vector3): Vector3; /** Transforms a Vector3 by a given Matrix */ declare function vector3Transform(v: Vector3, mat: Matrix): Vector3; /** Transform a vector by quaternion rotation */ declare function vector3RotateByQuaternion(v: Vector3, q: Vector4): Vector3; /** Rotates a vector around an axis */ declare function vector3RotateByAxisAngle(v: Vector3, axis: Vector3, angle: number): Vector3; +/** Move Vector towards target */ +declare function vector3MoveTowards(v: Vector3, target: Vector3, maxDistance: number): Vector3; /** Calculate linear interpolation between two vectors */ declare function vector3Lerp(v1: Vector3, v2: Vector3, amount: number): Vector3; /** Calculate reflected vector to normal */ @@ -1369,13 +1477,36 @@ declare function vector3Clamp(v: Vector3, min: Vector3, max: Vector3): Vector3; declare function vector3ClampValue(v: Vector3, min: number, max: number): Vector3; /** Check whether two given vectors are almost equal */ declare function vector3Equals(p: Vector3, q: Vector3): number; -/** Compute the direction of a refracted ray where v specifies the -normalized direction of the incoming ray, n specifies the -normalized normal vector of the interface of two optical media, -and r specifies the ratio of the refractive index of the medium -from where the ray comes to the refractive index of the medium -on the other side of the surface */ +/** Compute the direction of a refracted ray +v: normalized direction of the incoming ray +n: normalized normal vector of the interface of two optical media +r: ratio of the refractive index of the medium from where the ray comes + to the refractive index of the medium on the other side of the surface */ declare function vector3Refract(v: Vector3, n: Vector3, r: number): Vector3; +/** Calculate distance between two vectors */ +declare function vector4Distance(v1: Vector4, v2: Vector4): number; +/** Calculate square distance between two vectors */ +declare function vector4DistanceSqr(v1: Vector4, v2: Vector4): number; +/** Multiply vector by vector */ +declare function vector4Multiply(v1: Vector4, v2: Vector4): Vector4; +/** Negate vector */ +declare function vector4Negate(v: Vector4): Vector4; +/** Divide vector by vector */ +declare function vector4Divide(v1: Vector4, v2: Vector4): Vector4; +/** Normalize provided vector */ +declare function vector4Normalize(v: Vector4): Vector4; +/** Get min value for each pair of components */ +declare function vector4Min(v1: Vector4, v2: Vector4): Vector4; +/** Get max value for each pair of components */ +declare function vector4Max(v1: Vector4, v2: Vector4): Vector4; +/** Calculate linear interpolation between two vectors */ +declare function vector4Lerp(v1: Vector4, v2: Vector4, amount: number): Vector4; +/** Move Vector towards target */ +declare function vector4MoveTowards(v: Vector4, target: Vector4, maxDistance: number): Vector4; +/** Invert the given vector */ +declare function vector4Invert(v: Vector4): Vector4; +/** Check whether two given vectors are almost equal */ +declare function vector4Equals(p: Vector4, q: Vector4): number; /** Compute matrix determinant */ declare function matrixDeterminant(mat: Matrix): number; /** Get the trace of the matrix (sum of the values along the diagonal) */ @@ -1506,7 +1637,7 @@ declare function guiUnlock(): void; /** Check if gui is locked (global state) */ declare function guiIsLocked(): boolean; /** Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f */ -declare function guiFade(alpha: number): void; +declare function guiSetAlpha(alpha: number): void; /** Set gui state (global state) */ declare function guiSetState(state: number): void; /** Get gui state (global state) */ @@ -1519,64 +1650,6 @@ declare function guiGetFont(): Font; declare function guiSetStyle(control: number, property: number, value: number): void; /** Get one style property */ declare function guiGetStyle(control: number, property: number): number; -/** Window Box control, shows a window that can be closed */ -declare function guiWindowBox(bounds: Rectangle, title: string | undefined | null): boolean; -/** Group Box control with text name */ -declare function guiGroupBox(bounds: Rectangle, text: string | undefined | null): void; -/** Line separator control, could contain text */ -declare function guiLine(bounds: Rectangle, text: string | undefined | null): void; -/** Panel control, useful to group controls */ -declare function guiPanel(bounds: Rectangle, text: string | undefined | null): void; -/** Scroll Panel control */ -declare function guiScrollPanel(bounds: Rectangle, text: string | undefined | null, content: Rectangle, scroll: Vector2): Rectangle; -/** Label control, shows text */ -declare function guiLabel(bounds: Rectangle, text: string | undefined | null): void; -/** Button control, returns true when clicked */ -declare function guiButton(bounds: Rectangle, text: string | undefined | null): boolean; -/** Label button control, show true when clicked */ -declare function guiLabelButton(bounds: Rectangle, text: string | undefined | null): boolean; -/** Toggle Button control, returns true when active */ -declare function guiToggle(bounds: Rectangle, text: string | undefined | null, active: boolean): boolean; -/** Toggle Group control, returns active toggle index */ -declare function guiToggleGroup(bounds: Rectangle, text: string | undefined | null, active: number): number; -/** Check Box control, returns true when active */ -declare function guiCheckBox(bounds: Rectangle, text: string | undefined | null, checked: boolean): boolean; -/** Combo Box control, returns selected item index */ -declare function guiComboBox(bounds: Rectangle, text: string | undefined | null, active: number): number; -/** Dropdown Box control, returns selected item */ -declare function guiDropdownBox(bounds: Rectangle, text: string | undefined | null, active: { active: number }, editMode: boolean): boolean; -/** Spinner control, returns selected value */ -declare function guiSpinner(bounds: Rectangle, text: string | undefined | null, value: { value: number }, minValue: number, maxValue: number, editMode: boolean): boolean; -/** Value Box control, updates input text with numbers */ -declare function guiValueBox(bounds: Rectangle, text: string | undefined | null, value: { value: number }, minValue: number, maxValue: number, editMode: boolean): boolean; -/** Text Box control, updates input text */ -declare function guiTextBox(bounds: Rectangle, text: { text: string }, editMode: boolean): boolean; -/** Slider control, returns selected value */ -declare function guiSlider(bounds: Rectangle, textLeft: string | undefined | null, textRight: string | undefined | null, value: number, minValue: number, maxValue: number): number; -/** Slider Bar control, returns selected value */ -declare function guiSliderBar(bounds: Rectangle, textLeft: string | undefined | null, textRight: string | undefined | null, value: number, minValue: number, maxValue: number): number; -/** Progress Bar control, shows current progress value */ -declare function guiProgressBar(bounds: Rectangle, textLeft: string | undefined | null, textRight: string | undefined | null, value: number, minValue: number, maxValue: number): number; -/** Status Bar control, shows info text */ -declare function guiStatusBar(bounds: Rectangle, text: string | undefined | null): void; -/** Dummy control for placeholders */ -declare function guiDummyRec(bounds: Rectangle, text: string | undefined | null): void; -/** Grid control, returns mouse cell position */ -declare function guiGrid(bounds: Rectangle, text: string | undefined | null, spacing: number, subdivs: number): Vector2; -/** List View control, returns selected list item index */ -declare function guiListView(bounds: Rectangle, text: string | undefined | null, scrollIndex: { scrollIndex: number }, active: number): number; -/** Message Box control, displays a message */ -declare function guiMessageBox(bounds: Rectangle, title: string | undefined | null, message: string | undefined | null, buttons: string | undefined | null): number; -/** Text Input Box control, ask for text, supports secret */ -declare function guiTextInputBox(bounds: Rectangle, title: string | undefined | null, message: string | undefined | null, buttons: string | undefined | null, text: { text: string }, secretViewActive: { secretViewActive: number }): number; -/** Color Picker control (multiple color controls) */ -declare function guiColorPicker(bounds: Rectangle, text: string | undefined | null, color: Color): Color; -/** Color Panel control */ -declare function guiColorPanel(bounds: Rectangle, text: string | undefined | null, color: Color): Color; -/** Color Bar Alpha control */ -declare function guiColorBarAlpha(bounds: Rectangle, text: string | undefined | null, alpha: number): number; -/** Color Bar Hue control */ -declare function guiColorBarHue(bounds: Rectangle, text: string | undefined | null, value: number): number; /** Load style file over global style variable (.rgs) */ declare function guiLoadStyle(fileName: string | undefined | null): void; /** Load style default over global style */ @@ -1593,6 +1666,70 @@ declare function guiIconText(iconId: number, text: string | undefined | null): s declare function guiSetIconScale(scale: number): void; /** Draw icon using pixel size at specified position */ declare function guiDrawIcon(iconId: number, posX: number, posY: number, pixelSize: number, color: Color): void; +/** Window Box control, shows a window that can be closed */ +declare function guiWindowBox(bounds: Rectangle, title: string | undefined | null): number; +/** Group Box control with text name */ +declare function guiGroupBox(bounds: Rectangle, text: string | undefined | null): number; +/** Line separator control, could contain text */ +declare function guiLine(bounds: Rectangle, text: string | undefined | null): number; +/** Panel control, useful to group controls */ +declare function guiPanel(bounds: Rectangle, text: string | undefined | null): number; +/** Scroll Panel control */ +declare function guiScrollPanel(bounds: Rectangle, text: string | undefined | null, content: Rectangle, scroll: Vector2, view: Rectangle): number; +/** Label control */ +declare function guiLabel(bounds: Rectangle, text: string | undefined | null): number; +/** Button control, returns true when clicked */ +declare function guiButton(bounds: Rectangle, text: string | undefined | null): number; +/** Label button control, returns true when clicked */ +declare function guiLabelButton(bounds: Rectangle, text: string | undefined | null): number; +/** Toggle Button control */ +declare function guiToggle(bounds: Rectangle, text: string | undefined | null, active: bool): number; +/** Toggle Group control */ +declare function guiToggleGroup(bounds: Rectangle, text: string | undefined | null, active: int): number; +/** Toggle Slider control */ +declare function guiToggleSlider(bounds: Rectangle, text: string | undefined | null, active: int): number; +/** Check Box control, returns true when active */ +declare function guiCheckBox(bounds: Rectangle, text: string | undefined | null, checked: bool): number; +/** Combo Box control */ +declare function guiComboBox(bounds: Rectangle, text: string | undefined | null, active: int): number; +/** Dropdown Box control */ +declare function guiDropdownBox(bounds: Rectangle, text: string | undefined | null, active: { active: number }, editMode: boolean): number; +/** Spinner control */ +declare function guiSpinner(bounds: Rectangle, text: string | undefined | null, value: { value: number }, minValue: number, maxValue: number, editMode: boolean): number; +/** Value Box control, updates input text with numbers */ +declare function guiValueBox(bounds: Rectangle, text: string | undefined | null, value: { value: number }, minValue: number, maxValue: number, editMode: boolean): number; +/** Text Box control, updates input text */ +declare function guiTextBox(bounds: Rectangle, text: { text: string }, editMode: boolean): number; +/** Slider control */ +declare function guiSlider(bounds: Rectangle, textLeft: string | undefined | null, textRight: string | undefined | null, value: ArrayBuffer, minValue: number, maxValue: number): number; +/** Slider Bar control */ +declare function guiSliderBar(bounds: Rectangle, textLeft: string | undefined | null, textRight: string | undefined | null, value: ArrayBuffer, minValue: number, maxValue: number): number; +/** Progress Bar control */ +declare function guiProgressBar(bounds: Rectangle, textLeft: string | undefined | null, textRight: string | undefined | null, value: ArrayBuffer, minValue: number, maxValue: number): number; +/** Status Bar control, shows info text */ +declare function guiStatusBar(bounds: Rectangle, text: string | undefined | null): number; +/** Dummy control for placeholders */ +declare function guiDummyRec(bounds: Rectangle, text: string | undefined | null): number; +/** Grid control */ +declare function guiGrid(bounds: Rectangle, text: string | undefined | null, spacing: number, subdivs: number, mouseCell: Vector2): number; +/** List View control */ +declare function guiListView(bounds: Rectangle, text: string | undefined | null, scrollIndex: { scrollIndex: number }, active: int): number; +/** Message Box control, displays a message */ +declare function guiMessageBox(bounds: Rectangle, title: string | undefined | null, message: string | undefined | null, buttons: string | undefined | null): number; +/** Text Input Box control, ask for text, supports secret */ +declare function guiTextInputBox(bounds: Rectangle, title: string | undefined | null, message: string | undefined | null, buttons: string | undefined | null, text: { text: string }, secretViewActive: { secretViewActive: number }): number; +/** Color Picker control (multiple color controls) */ +declare function guiColorPicker(bounds: Rectangle, text: string | undefined | null, color: Color): number; +/** Color Panel control */ +declare function guiColorPanel(bounds: Rectangle, text: string | undefined | null, color: Color): number; +/** Color Bar Alpha control */ +declare function guiColorBarAlpha(bounds: Rectangle, text: string | undefined | null, alpha: ArrayBuffer): number; +/** Color Bar Hue control */ +declare function guiColorBarHue(bounds: Rectangle, text: string | undefined | null, value: ArrayBuffer): number; +/** Color Picker control that avoids conversion to RGB on each call (multiple color controls) */ +declare function guiColorPickerHSV(bounds: Rectangle, text: string | undefined | null, colorHsv: Vector3): number; +/** Color Panel control that updates Hue-Saturation-Value color value, used by GuiColorPickerHSV() */ +declare function guiColorPanelHSV(bounds: Rectangle, text: string | undefined | null, colorHsv: Vector3): number; /** //---------------------------------------------------------------------------------- Module Functions Declaration //---------------------------------------------------------------------------------- */ @@ -1759,6 +1896,8 @@ declare var FLAG_WINDOW_TRANSPARENT: number; declare var FLAG_WINDOW_HIGHDPI: number; /** Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED */ declare var FLAG_WINDOW_MOUSE_PASSTHROUGH: number; +/** Set to run program in borderless windowed mode */ +declare var FLAG_BORDERLESS_WINDOWED_MODE: number; /** Set to try enabling MSAA 4X */ declare var FLAG_MSAA_4X_HINT: number; /** Set to try enabling interlaced video format (for V3D) */ @@ -2203,6 +2342,12 @@ declare var PIXELFORMAT_UNCOMPRESSED_R32: number; declare var PIXELFORMAT_UNCOMPRESSED_R32G32B32: number; /** 32*4 bpp (4 channels - float) */ declare var PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: number; +/** 16 bpp (1 channel - half float) */ +declare var PIXELFORMAT_UNCOMPRESSED_R16: number; +/** 16*3 bpp (3 channels - half float) */ +declare var PIXELFORMAT_UNCOMPRESSED_R16G16B16: number; +/** 16*4 bpp (4 channels - half float) */ +declare var PIXELFORMAT_UNCOMPRESSED_R16G16B16A16: number; /** 4 bpp (no alpha) */ declare var PIXELFORMAT_COMPRESSED_DXT1_RGB: number; /** 4 bpp (1 bit alpha) */ @@ -2336,6 +2481,18 @@ declare var TEXT_ALIGN_CENTER: number; /** */ declare var TEXT_ALIGN_RIGHT: number; /** */ +declare var TEXT_ALIGN_TOP: number; +/** */ +declare var TEXT_ALIGN_MIDDLE: number; +/** */ +declare var TEXT_ALIGN_BOTTOM: number; +/** */ +declare var TEXT_WRAP_NONE: number; +/** */ +declare var TEXT_WRAP_CHAR: number; +/** */ +declare var TEXT_WRAP_WORD: number; +/** */ declare var DEFAULT: number; /** Used also for: LABELBUTTON */ declare var LABEL: number; @@ -2343,7 +2500,7 @@ declare var LABEL: number; declare var BUTTON: number; /** Used also for: TOGGLEGROUP */ declare var TOGGLE: number; -/** Used also for: SLIDERBAR */ +/** Used also for: SLIDERBAR, TOGGLESLIDER */ declare var SLIDER: number; /** */ declare var PROGRESSBAR: number; @@ -2367,38 +2524,36 @@ declare var COLORPICKER: number; declare var SCROLLBAR: number; /** */ declare var STATUSBAR: number; -/** */ +/** Control border color in STATE_NORMAL */ declare var BORDER_COLOR_NORMAL: number; -/** */ +/** Control base color in STATE_NORMAL */ declare var BASE_COLOR_NORMAL: number; -/** */ +/** Control text color in STATE_NORMAL */ declare var TEXT_COLOR_NORMAL: number; -/** */ +/** Control border color in STATE_FOCUSED */ declare var BORDER_COLOR_FOCUSED: number; -/** */ +/** Control base color in STATE_FOCUSED */ declare var BASE_COLOR_FOCUSED: number; -/** */ +/** Control text color in STATE_FOCUSED */ declare var TEXT_COLOR_FOCUSED: number; -/** */ +/** Control border color in STATE_PRESSED */ declare var BORDER_COLOR_PRESSED: number; -/** */ +/** Control base color in STATE_PRESSED */ declare var BASE_COLOR_PRESSED: number; -/** */ +/** Control text color in STATE_PRESSED */ declare var TEXT_COLOR_PRESSED: number; -/** */ +/** Control border color in STATE_DISABLED */ declare var BORDER_COLOR_DISABLED: number; -/** */ +/** Control base color in STATE_DISABLED */ declare var BASE_COLOR_DISABLED: number; -/** */ +/** Control text color in STATE_DISABLED */ declare var TEXT_COLOR_DISABLED: number; -/** */ +/** Control border size, 0 for no border */ declare var BORDER_WIDTH: number; -/** */ +/** Control text padding, not considering border */ declare var TEXT_PADDING: number; -/** */ +/** Control text horizontal alignment inside control text bound (after border and padding) */ declare var TEXT_ALIGNMENT: number; -/** */ -declare var RESERVED: number; /** Text size (glyphs max height) */ declare var TEXT_SIZE: number; /** Text spacing between glyphs */ @@ -2407,6 +2562,12 @@ declare var TEXT_SPACING: number; declare var LINE_COLOR: number; /** Background color */ declare var BACKGROUND_COLOR: number; +/** Text spacing between lines */ +declare var TEXT_LINE_SPACING: number; +/** Text vertical alignment inside text bounds (after border and padding) */ +declare var TEXT_ALIGNMENT_VERTICAL: number; +/** Text wrap-mode inside text bounds */ +declare var TEXT_WRAP_MODE: number; /** ToggleGroup separation between toggles */ declare var GROUP_PADDING: number; /** Slider size of internal bar */ @@ -2415,17 +2576,17 @@ declare var SLIDER_WIDTH: number; declare var SLIDER_PADDING: number; /** ProgressBar internal padding */ declare var PROGRESS_PADDING: number; -/** */ +/** ScrollBar arrows size */ declare var ARROWS_SIZE: number; -/** */ +/** ScrollBar arrows visible */ declare var ARROWS_VISIBLE: number; -/** (SLIDERBAR, SLIDER_PADDING) */ +/** ScrollBar slider internal padding */ declare var SCROLL_SLIDER_PADDING: number; -/** */ +/** ScrollBar slider size */ declare var SCROLL_SLIDER_SIZE: number; -/** */ +/** ScrollBar scroll padding from arrows */ declare var SCROLL_PADDING: number; -/** */ +/** ScrollBar scrolling speed */ declare var SCROLL_SPEED: number; /** CheckBox internal check padding */ declare var CHECK_PADDING: number; @@ -2437,16 +2598,8 @@ declare var COMBO_BUTTON_SPACING: number; declare var ARROW_PADDING: number; /** DropdownBox items separation */ declare var DROPDOWN_ITEMS_SPACING: number; -/** TextBox/TextBoxMulti/ValueBox/Spinner inner text padding */ -declare var TEXT_INNER_PADDING: number; -/** TextBoxMulti lines separation */ -declare var TEXT_LINES_SPACING: number; -/** TextBoxMulti vertical alignment: 0-CENTERED, 1-UP, 2-DOWN */ -declare var TEXT_ALIGNMENT_VERTICAL: number; -/** TextBox supports multiple lines */ -declare var TEXT_MULTILINE: number; -/** TextBox wrap mode for multiline: 0-NO_WRAP, 1-CHAR_WRAP, 2-WORD_WRAP */ -declare var TEXT_WRAP_MODE: number; +/** TextBox in read-only mode: 0-text editable, 1-text no-editable */ +declare var TEXT_READONLY: number; /** Spinner left/right buttons width */ declare var SPIN_BUTTON_WIDTH: number; /** Spinner buttons separation */ @@ -2457,7 +2610,7 @@ declare var LIST_ITEMS_HEIGHT: number; declare var LIST_ITEMS_SPACING: number; /** ListView scrollbar size (usually width) */ declare var SCROLLBAR_WIDTH: number; -/** ListView scrollbar side (0-left, 1-right) */ +/** ListView scrollbar side (0-SCROLLBAR_LEFT_SIDE, 1-SCROLLBAR_RIGHT_SIDE) */ declare var SCROLLBAR_SIDE: number; /** */ declare var COLOR_SELECTOR_SIZE: number; @@ -2910,11 +3063,11 @@ declare var ICON_FILE: number; /** */ declare var ICON_SAND_TIMER: number; /** */ -declare var ICON_220: number; +declare var ICON_WARNING: number; /** */ -declare var ICON_221: number; +declare var ICON_HELP_BOX: number; /** */ -declare var ICON_222: number; +declare var ICON_INFO_BOX: number; /** */ declare var ICON_223: number; /** */ diff --git a/examples/tsconfig.json b/examples/tsconfig.json index 1bc331d..c66b633 100644 --- a/examples/tsconfig.json +++ b/examples/tsconfig.json @@ -1,9 +1,9 @@ { "compilerOptions": { "allowJs": true, - "target": "es2020", - "lib": [ - "ES2020" - ] + "checkJs": true, + "noEmit": true, + // get intellisense for the available platform APIs + "lib": ["es2020"] } } \ No newline at end of file diff --git a/generate-bindings.js b/generate-bindings.js deleted file mode 100644 index 7b0b54a..0000000 --- a/generate-bindings.js +++ /dev/null @@ -1,1575 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./src/generation.ts": -/*!***************************!*\ - !*** ./src/generation.ts ***! - \***************************/ -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CodeGenerator = exports.GenericCodeGenerator = exports.CodeWriter = exports.StringWriter = void 0; -class StringWriter { - constructor() { - this.buffer = ''; - } - write(value) { - this.buffer += value; - } - writeLine(value = '') { - this.buffer += value + '\n'; - } - toString() { - return this.buffer; - } -} -exports.StringWriter = StringWriter; -class CodeWriter extends StringWriter { - constructor() { - super(...arguments); - this.indent = 0; - this.needsIndent = true; - } - writeGenerator(generator) { - const tokens = generator.iterateTokens(); - const text = generator.iterateText(); - const children = generator.iterateChildren(); - let result = tokens.next(); - while (!result.done) { - switch (result.value) { - case Token.STRING: - const str = text.next().value; - if (this.needsIndent) { - this.write(" ".repeat(this.indent)); - this.needsIndent = false; - } - this.write(str); - break; - case Token.GOSUB: - const sub = children.next().value; - this.writeGenerator(sub); - break; - case Token.INDENT: - this.indent++; - break; - case Token.UNINDENT: - this.indent = this.indent > 0 ? this.indent - 1 : 0; - break; - case Token.NEWLINE: - this.write("\n"); - this.needsIndent = true; - break; - default: - break; - } - result = tokens.next(); - } - } -} -exports.CodeWriter = CodeWriter; -var Token; -(function (Token) { - Token[Token["STRING"] = 0] = "STRING"; - Token[Token["NEWLINE"] = 1] = "NEWLINE"; - Token[Token["INDENT"] = 2] = "INDENT"; - Token[Token["UNINDENT"] = 3] = "UNINDENT"; - Token[Token["GOSUB"] = 4] = "GOSUB"; -})(Token || (Token = {})); -class GenericCodeGenerator { - constructor() { - this.children = []; - this.text = []; - this.tokens = []; - this.tags = {}; - } - getTag(key) { - return this.tags[key]; - } - setTag(key, value) { - this.tags[key] = value; - } - iterateTokens() { - return this.tokens[Symbol.iterator](); - } - iterateText() { - return this.text[Symbol.iterator](); - } - iterateChildren() { - return this.children[Symbol.iterator](); - } - line(text) { - this.tokens.push(Token.STRING, Token.NEWLINE); - this.text.push(text); - } - comment(text) { - this.line("// " + text); - } - call(name, params, returnVal = null) { - if (returnVal) - this.inline(`${returnVal.type} ${returnVal.name} = `); - this.inline(name + "("); - this.inline(params.join(", ")); - this.statement(")"); - } - declare(name, type, isStatic = false, initValue = null) { - if (isStatic) - this.inline("static "); - this.inline(type + " " + name); - if (initValue) - this.inline(" = " + initValue); - this.statement(""); - } - child(sub) { - if (!sub) - sub = this.createGenerator(); - this.tokens.push(Token.GOSUB); - this.children.push(sub); - return sub; - } - inline(str) { - this.tokens.push(Token.STRING); - this.text.push(str); - } - statement(str) { - this.line(str + ";"); - } - breakLine() { - this.tokens.push(Token.NEWLINE); - } - indent() { - this.tokens.push(Token.INDENT); - } - unindent() { - this.tokens.push(Token.UNINDENT); - } - function(name, returnType, args, isStatic, func) { - const sub = this.createGenerator(); - sub.setTag("_type", "function-body"); - sub.setTag("_name", name); - sub.setTag("_isStatic", isStatic); - sub.setTag("_returnType", returnType); - if (isStatic) - this.inline("static "); - this.inline(returnType + " " + name + "("); - this.inline(args.map(x => x.type + " " + x.name).join(", ")); - this.inline(") {"); - this.breakLine(); - this.indent(); - this.child(sub); - this.unindent(); - this.line("}"); - this.breakLine(); - if (func) - func(sub); - return sub; - } - if(condition, funIf) { - this.line("if(" + condition + ") {"); - this.indent(); - const sub = this.createGenerator(); - sub.setTag("_type", "if-body"); - sub.setTag("_condition", condition); - this.child(sub); - this.unindent(); - this.line("}"); - if (funIf) - funIf(sub); - return sub; - } - else(funElse) { - this.line("else {"); - this.indent(); - const sub = this.createGenerator(); - sub.setTag("_type", "else-body"); - this.child(sub); - this.unindent(); - this.line("}"); - if (funElse) - funElse(sub); - return sub; - } - returnExp(exp) { - this.statement("return " + exp); - } - include(name) { - this.line("#include <" + name + ">"); - } - for(indexVar, lengthVar) { - this.line(`for(int ${indexVar}; i < ${lengthVar}; i++){`); - this.indent(); - const child = this.child(); - this.unindent(); - this.line("}"); - return child; - } - header(guard, fun) { - this.line("#ifndef " + guard); - this.line("#define " + guard); - this.breakLine(); - const sub = this.child(); - sub.setTag("_type", "header-body"); - sub.setTag("_guardName", guard); - this.line("#endif // " + guard); - if (fun) - fun(sub); - return sub; - } - declareStruct(structName, varName, values, isStatic = false) { - if (isStatic) - this.inline("static "); - this.statement(`${structName} ${varName} = { ${values.join(', ')} }`); - } - switch(switchVar) { - this.line(`switch(${switchVar}) {`); - this.indent(); - const body = this.child(); - this.unindent(); - this.line("}"); - return body; - } - case(value) { - this.line(`case ${value}:`); - } - defaultBreak() { - this.line("default:"); - this.line("{"); - this.indent(); - const body = this.child(); - this.statement("break"); - this.unindent(); - this.line("}"); - return body; - } - caseBreak(value) { - this.case(value); - this.line("{"); - this.indent(); - const body = this.child(); - this.statement("break"); - this.unindent(); - this.line("}"); - return body; - } -} -exports.GenericCodeGenerator = GenericCodeGenerator; -class CodeGenerator extends GenericCodeGenerator { - createGenerator() { - return new CodeGenerator(); - } -} -exports.CodeGenerator = CodeGenerator; - - -/***/ }), - -/***/ "./src/header-parser.ts": -/*!******************************!*\ - !*** ./src/header-parser.ts ***! - \******************************/ -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HeaderParser = void 0; -class HeaderParser { - parseEnums(input) { - const matches = [...input.matchAll(/((?:\/\/.+\n)*)typedef enum {\n([^}]+)} ([^;]+)/gm)]; - return matches.map(groups => { - return { - description: this.parseComments(groups[1]), - values: this.parseEnumValues(groups[2]), - name: groups[3], - }; - }); - } - parseEnumValues(input) { - let lastNumber = 0; - return input.split('\n') - .map(line => line.trim().match(/([^ ,]+)(?: = ([0-9]+))?,?(?: *)(?:\/\/ (.+))?/)) - .filter(x => x !== null && !x[0].startsWith("/")) - .map(groups => { - let val = lastNumber = groups[2] ? parseInt(groups[2]) : lastNumber; - lastNumber++; - return { - name: groups[1], - description: groups[3] || "", - value: val - }; - }); - } - parseComments(input) { - return input.split('\n').map(x => x.replace("// ", "")).join('\n').trim(); - } - parseFunctionDefinitions(input) { - const matches = [...input.matchAll(/^[A-Z]+ (.+?)(\w+)\(([^\)]+)\);(?: +\/\/ (.+))?$/gm)]; - return matches.map(groups => ({ - returnType: groups[1].trim(), - name: groups[2], - params: this.parseFunctionArgs(groups[3]), - description: groups[4] || "" - })); - } - parseFunctions(input, noPrefix = false) { - const matches = noPrefix - ? [...input.matchAll(/((?:\/\/.+\n)+)^(.+?)(\w+)\(([^\)]+)\)/gm)] - : [...input.matchAll(/((?:\/\/.+\n)+)^[A-Z]+ (.+?)(\w+)\(([^\)]+)\)/gm)]; - return matches.map(groups => ({ - returnType: groups[2].trim(), - name: groups[3], - params: this.parseFunctionArgs(groups[4]), - description: groups[1] ? this.parseComments(groups[1]) : "" - })); - } - parseFunctionArgs(input) { - return input.split(',').filter(x => x !== 'void').map(arg => { - arg = arg.trim().replace(" *", "* "); - const frags = arg.split(' '); - const name = frags.pop(); - const type = frags.join(' ').replace("*", " *"); - return { name: name || "", type: type.trim() }; - }); - } - parseStructs(input) { - return [...input.matchAll(/((?:\/\/.+\n)+)typedef struct {([^}]+)} ([^;]+);/gm)].map(groups => ({ - name: groups[3], - fields: this.parseStructFields(groups[2]), - description: this.parseComments(groups[1]) - })); - } - parseStructFields(input) { - return input.trim().split("\n").map(x => x.trim()).filter(x => !x.startsWith("/") && x.endsWith(";")).map(x => { - const match = x.match(/([^ ]+(?: \*)?) ([^;]+);/); - return { - name: match[2], - type: match[1], - description: "" - }; - }); - } -} -exports.HeaderParser = HeaderParser; - - -/***/ }), - -/***/ "./src/quickjs.ts": -/*!************************!*\ - !*** ./src/quickjs.ts ***! - \************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.QuickJsGenerator = exports.GenericQuickJsGenerator = exports.QuickJsHeader = void 0; -const fs_1 = __webpack_require__(/*! fs */ "fs"); -const generation_1 = __webpack_require__(/*! ./generation */ "./src/generation.ts"); -class QuickJsHeader { - constructor(name) { - this.name = name; - this.structLookup = {}; - const root = this.root = new QuickJsGenerator(); - const body = this.body = root.header("JS_" + this.name + "_GUARD"); - const includes = this.includes = body.child(); - includes.include("stdio.h"); - includes.include("stdlib.h"); - includes.include("string.h"); - includes.breakLine(); - includes.include("quickjs.h"); - body.breakLine(); - body.line("#ifndef countof"); - body.line("#define countof(x) (sizeof(x) / sizeof((x)[0]))"); - body.line("#endif"); - body.breakLine(); - this.definitions = body.child(); - body.breakLine(); - this.structs = body.child(); - this.functions = body.child(); - this.moduleFunctionList = body.jsFunctionList("js_" + name + "_funcs"); - const moduleInitFunc = body.function("js_" + this.name + "_init", "int", [{ type: "JSContext *", name: "ctx" }, { type: "JSModuleDef *", name: "m" }], true); - const moduleInit = this.moduleInit = moduleInitFunc.child(); - moduleInit.statement(`JS_SetModuleExportList(ctx, m,${this.moduleFunctionList.getTag("_name")},countof(${this.moduleFunctionList.getTag("_name")}))`); - moduleInitFunc.returnExp("0"); - const moduleEntryFunc = body.function("js_init_module_" + this.name, "JSModuleDef *", [{ type: "JSContext *", name: "ctx" }, { type: "const char *", name: "module_name" }], false); - const moduleEntry = this.moduleEntry = moduleEntryFunc.child(); - moduleEntry.statement("JSModuleDef *m"); - moduleEntry.statement(`m = JS_NewCModule(ctx, module_name, ${moduleInitFunc.getTag("_name")})`); - moduleEntry.statement("if(!m) return NULL"); - moduleEntry.statement(`JS_AddModuleExportList(ctx, m, ${this.moduleFunctionList.getTag("_name")}, countof(${this.moduleFunctionList.getTag("_name")}))`); - moduleEntryFunc.statement("return m"); - } - registerStruct(struct, classId) { - this.structLookup[struct] = classId; - } - writeTo(filename) { - const writer = new generation_1.CodeWriter(); - writer.writeGenerator(this.root); - (0, fs_1.writeFileSync)(filename, writer.toString()); - } -} -exports.QuickJsHeader = QuickJsHeader; -class GenericQuickJsGenerator extends generation_1.GenericCodeGenerator { - jsBindingFunction(jsName) { - const args = [ - { type: "JSContext *", name: "ctx" }, - { type: "JSValueConst", name: "this_val" }, - { type: "int", name: "argc" }, - { type: "JSValueConst *", name: "argv" }, - ]; - const sub = this.function("js_" + jsName, "JSValue", args, true); - return sub; - } - jsToC(type, name, src, classIds = {}, supressDeclaration = false, typeAlias) { - switch (typeAlias ?? type) { - // Array Buffer - case "const void *": - case "void *": - case "float *": - case "unsigned short *": - case "unsigned char *": - case "const unsigned char *": - this.declare(name + "_size", "size_t"); - this.declare(name + "_js", "void *", false, `(void *)JS_GetArrayBuffer(ctx, &${name}_size, ${src})`); - this.if(name + "_js == NULL").returnExp("JS_EXCEPTION"); - this.declare(name, type, false, "malloc(" + name + "_size)"); - this.call("memcpy", ["(void *)" + name, "(const void *)" + name + "_js", name + "_size"]); - break; - // String - case "const char *": - //case "char *": - if (!supressDeclaration) - this.statement(`${type} ${name} = (JS_IsNull(${src}) || JS_IsUndefined(${src})) ? NULL : (${type})JS_ToCString(ctx, ${src})`); - else - this.statement(`${name} = (JS_IsNull(${src}) || JS_IsUndefined(${src})) ? NULL : (${type})JS_ToCString(ctx, ${src})`); - break; - case "double": - if (!supressDeclaration) - this.statement(`${type} ${name}`); - this.statement(`JS_ToFloat64(ctx, &${name}, ${src})`); - break; - case "float": - this.statement("double _double_" + name); - this.statement(`JS_ToFloat64(ctx, &_double_${name}, ${src})`); - if (!supressDeclaration) - this.statement(`${type} ${name} = (${type})_double_${name}`); - else - this.statement(`${name} = (${type})_double_${name}`); - break; - case "int": - if (!supressDeclaration) - this.statement(`${type} ${name}`); - this.statement(`JS_ToInt32(ctx, &${name}, ${src})`); - break; - case "unsigned int": - if (!supressDeclaration) - this.statement(`${type} ${name}`); - this.statement(`JS_ToUint32(ctx, &${name}, ${src})`); - break; - case "unsigned char": - this.statement("unsigned int _int_" + name); - this.statement(`JS_ToUint32(ctx, &_int_${name}, ${src})`); - if (!supressDeclaration) - this.statement(`${type} ${name} = (${type})_int_${name}`); - else - this.statement(`${name} = (${type})_int_${name}`); - break; - case "bool": - if (!supressDeclaration) - this.statement(`${type} ${name} = JS_ToBool(ctx, ${src})`); - else - this.statement(`${name} = JS_ToBool(ctx, ${src})`); - break; - default: - const isConst = type.startsWith('const'); - const isPointer = type.endsWith(' *'); - const classId = classIds[type.replace("const ", "").replace(" *", "")]; - if (!classId) - throw new Error("Cannot convert into parameter type: " + type); - const suffix = isPointer ? "" : "_ptr"; - this.jsOpqToStructPtr(type.replace(" *", ""), name + suffix, src, classId); - this.statement(`if(${name + suffix} == NULL) return JS_EXCEPTION`); - if (!isPointer) - this.declare(name, type, false, `*${name}_ptr`); - } - } - jsToJs(type, name, src, classIds = {}) { - switch (type) { - case "int": - case "long": - this.declare(name, 'JSValue', false, `JS_NewInt32(ctx, ${src})`); - break; - case "long": - this.declare(name, 'JSValue', false, `JS_NewInt64(ctx, ${src})`); - break; - case "unsigned int": - case "unsigned char": - this.declare(name, 'JSValue', false, `JS_NewUint32(ctx, ${src})`); - break; - case "bool": - this.declare(name, 'JSValue', false, `JS_NewBool(ctx, ${src})`); - break; - case "float": - case "double": - this.declare(name, 'JSValue', false, `JS_NewFloat64(ctx, ${src})`); - break; - case "const char *": - case "char *": - this.declare(name, 'JSValue', false, `JS_NewString(ctx, ${src})`); - break; - // case "unsigned char *": - // this.declare(name, 'JSValue', false, `JS_NewString(ctx, ${src})`) - // break; - default: - const classId = classIds[type]; - if (!classId) - throw new Error("Cannot convert parameter type to Javascript: " + type); - this.jsStructToOpq(type, name, src, classId); - } - } - jsStructToOpq(structType, jsVar, srcVar, classId) { - this.declare(jsVar + "_ptr", structType + "*", false, `(${structType}*)js_malloc(ctx, sizeof(${structType}))`); - this.statement("*" + jsVar + "_ptr = " + srcVar); - this.declare(jsVar, "JSValue", false, `JS_NewObjectClass(ctx, ${classId})`); - this.call("JS_SetOpaque", [jsVar, jsVar + "_ptr"]); - } - jsCleanUpParameter(type, name) { - switch (type) { - case "char *": - case "const char *": - this.statement(`JS_FreeCString(ctx, ${name})`); - break; - case "const void *": - case "void *": - case "float *": - case "unsigned short *": - case "unsigned char *": - case "const unsigned char *": - this.statement(`free((void *)${name})`); - break; - default: - break; - } - } - jsFunctionList(name) { - this.line("static const JSCFunctionListEntry " + name + "[] = {"); - this.indent(); - const sub = this.createGenerator(); - sub.setTag("_type", "js-function-list"); - sub.setTag("_name", name); - this.child(sub); - this.unindent(); - this.statement("}"); - this.breakLine(); - return sub; - } - jsFuncDef(jsName, numArgs, cName) { - this.line(`JS_CFUNC_DEF("${jsName}",${numArgs},${cName}),`); - } - jsClassId(id) { - this.declare(id, "JSClassID", true); - return id; - } - jsPropStringDef(key, value) { - this.line(`JS_PROP_STRING_DEF("${key}","${value}", JS_PROP_CONFIGURABLE),`); - } - jsGetSetDef(key, getFunc, setFunc) { - this.line(`JS_CGETSET_DEF("${key}",${getFunc || "NULL"},${setFunc || "NULL"}),`); - } - jsStructFinalizer(classId, structName, onFinalize) { - const args = [{ type: "JSRuntime *", name: "rt" }, { type: "JSValue", name: "val" }]; - const body = this.function(`js_${structName}_finalizer`, "void", args, true); - body.statement(`${structName}* ptr = JS_GetOpaque(val, ${classId})`); - body.if("ptr", cond => { - //cond.call("TraceLog", ["LOG_INFO",`"Finalize ${structName} %p"`,"ptr"]) - if (onFinalize) - onFinalize(cond, "ptr"); - cond.call("js_free_rt", ["rt", "ptr"]); - }); - return body; - } - jsClassDeclaration(structName, classId, finalizerName, funcListName) { - const body = this.function("js_declare_" + structName, "int", [{ type: "JSContext *", name: "ctx" }, { type: "JSModuleDef *", name: "m" }], true); - body.call("JS_NewClassID", ["&" + classId]); - const classDefName = `js_${structName}_def`; - body.declare(classDefName, "JSClassDef", false, `{ .class_name = "${structName}", .finalizer = ${finalizerName} }`); - body.call("JS_NewClass", ["JS_GetRuntime(ctx)", classId, "&" + classDefName]); - body.declare("proto", "JSValue", false, "JS_NewObject(ctx)"); - body.call("JS_SetPropertyFunctionList", ["ctx", "proto", funcListName, `countof(${funcListName})`]); - body.call("JS_SetClassProto", ["ctx", classId, "proto"]); - body.statement("return 0"); - return body; - } - jsStructGetter(structName, classId, field, type, classIds, overrideRead) { - const args = [{ type: "JSContext*", name: "ctx" }, { type: "JSValueConst", name: "this_val" }]; - const fun = this.function(`js_${structName}_get_${field}`, "JSValue", args, true); - fun.declare("ptr", structName + "*", false, `JS_GetOpaque2(ctx, this_val, ${classId})`); - if (overrideRead) { - overrideRead(fun); - } - else { - fun.declare(field, type, false, "ptr->" + field); - } - fun.jsToJs(type, "ret", field, classIds); - fun.returnExp("ret"); - return fun; - } - jsStructSetter(structName, classId, field, type, classIds, overrideWrite) { - const args = [{ type: "JSContext*", name: "ctx" }, { type: "JSValueConst", name: "this_val" }, { type: "JSValueConst", name: "v" }]; - const fun = this.function(`js_${structName}_set_${field}`, "JSValue", args, true); - fun.declare("ptr", structName + "*", false, `JS_GetOpaque2(ctx, this_val, ${classId})`); - fun.jsToC(type, "value", "v", classIds); - if (overrideWrite) { - overrideWrite(fun); - } - else { - fun.statement("ptr->" + field + " = value"); - } - fun.returnExp("JS_UNDEFINED"); - return fun; - } - jsOpqToStructPtr(structType, structVar, srcVar, classId) { - this.declare(structVar, structType + "*", false, `(${structType}*)JS_GetOpaque2(ctx, ${srcVar}, ${classId})`); - } - jsStructConstructor(structName, fields, classId, classIds) { - const body = this.jsBindingFunction(structName + "_constructor"); - for (let i = 0; i < fields.length; i++) { - const para = fields[i]; - body.jsToC(para.type, para.name, "argv[" + i + "]", classIds); - } - body.declareStruct(structName, "_struct", fields.map(x => x.name)); - body.jsStructToOpq(structName, "_return", "_struct", classId); - body.returnExp("_return"); - return body; - } -} -exports.GenericQuickJsGenerator = GenericQuickJsGenerator; -class QuickJsGenerator extends GenericQuickJsGenerator { - createGenerator() { - return new QuickJsGenerator(); - } -} -exports.QuickJsGenerator = QuickJsGenerator; - - -/***/ }), - -/***/ "./src/raylib-header.ts": -/*!******************************!*\ - !*** ./src/raylib-header.ts ***! - \******************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RayLibHeader = void 0; -const quickjs_1 = __webpack_require__(/*! ./quickjs */ "./src/quickjs.ts"); -const typescript_1 = __webpack_require__(/*! ./typescript */ "./src/typescript.ts"); -class RayLibHeader extends quickjs_1.QuickJsHeader { - constructor(name) { - super(name); - this.typings = new typescript_1.TypeScriptDeclaration(); - this.includes.include("raylib.h"); - //this.includes.line("#define RAYMATH_IMPLEMENTATION") - } - addApiFunction(api) { - const options = api.binding || {}; - if (options.ignore) - return; - const jName = options.jsName || api.name.charAt(0).toLowerCase() + api.name.slice(1); - console.log("Binding function " + api.name); - const fun = this.functions.jsBindingFunction(jName); - if (options.body) { - options.body(fun); - } - else { - if (options.before) - options.before(fun); - // read parameters - api.params = api.params || []; - const activeParams = api.params.filter(x => !x.binding?.ignore); - for (let i = 0; i < activeParams.length; i++) { - const para = activeParams[i]; - if (para.binding?.customConverter) - para.binding.customConverter(fun, "argv[" + i + "]"); - else - fun.jsToC(para.type, para.name, "argv[" + i + "]", this.structLookup, false, para.binding?.typeAlias); - } - // call c function - if (options.customizeCall) - fun.line(options.customizeCall); - else - fun.call(api.name, api.params.map(x => x.name), api.returnType === "void" ? null : { type: api.returnType, name: "returnVal" }); - // clean up parameters - for (let i = 0; i < activeParams.length; i++) { - const param = activeParams[i]; - if (param.binding?.customCleanup) - param.binding.customCleanup(fun, "argv[" + i + "]"); - else - fun.jsCleanUpParameter(param.type, param.name); - } - // return result - if (api.returnType === "void") { - if (options.after) - options.after(fun); - fun.statement("return JS_UNDEFINED"); - } - else { - fun.jsToJs(api.returnType, "ret", "returnVal", this.structLookup); - if (options.after) - options.after(fun); - fun.returnExp("ret"); - } - } - // add binding to function declaration - this.moduleFunctionList.jsFuncDef(jName, (api.params || []).filter(x => !x.binding?.ignore).length, fun.getTag("_name")); - this.typings.addFunction(jName, api); - } - addEnum(renum) { - console.log("Binding enum " + renum.name); - renum.values.forEach(x => this.exportGlobalInt(x.name, x.description)); - } - addApiStruct(struct) { - const options = struct.binding || {}; - console.log("Binding struct " + struct.name); - const classId = this.definitions.jsClassId(`js_${struct.name}_class_id`); - this.registerStruct(struct.name, classId); - options.aliases?.forEach(x => this.registerStruct(x, classId)); - const finalizer = this.structs.jsStructFinalizer(classId, struct.name, (gen, ptr) => options.destructor && gen.call(options.destructor.name, ["*" + ptr])); - const propDeclarations = this.structs.createGenerator(); - if (options && options.properties) { - for (const field of Object.keys(options.properties)) { - const type = struct.fields.find(x => x.name === field)?.type; - if (!type) - throw new Error(`Struct ${struct.name} does not contain field ${field}`); - const el = options.properties[field]; - let _get = undefined; - let _set = undefined; - if (el.get) - _get = this.structs.jsStructGetter(struct.name, classId, field, type, /*Be carefull when allocating memory in a getter*/ this.structLookup, el.overrideRead); - if (el.set) - _set = this.structs.jsStructSetter(struct.name, classId, field, type, this.structLookup, el.overrideWrite); - propDeclarations.jsGetSetDef(field, _get?.getTag("_name"), _set?.getTag("_name")); - } - } - const classFuncList = this.structs.jsFunctionList(`js_${struct.name}_proto_funcs`); - classFuncList.child(propDeclarations); - classFuncList.jsPropStringDef("[Symbol.toStringTag]", struct.name); - const classDecl = this.structs.jsClassDeclaration(struct.name, classId, finalizer.getTag("_name"), classFuncList.getTag("_name")); - this.moduleInit.call(classDecl.getTag("_name"), ["ctx", "m"]); - if (options?.createConstructor || options?.createEmptyConstructor) { - const body = this.functions.jsStructConstructor(struct.name, options?.createEmptyConstructor ? [] : struct.fields, classId, this.structLookup); - this.moduleInit.statement(`JSValue ${struct.name}_constr = JS_NewCFunction2(ctx, ${body.getTag("_name")},"${struct.name})", ${struct.fields.length}, JS_CFUNC_constructor_or_func, 0)`); - this.moduleInit.call("JS_SetModuleExport", ["ctx", "m", `"${struct.name}"`, struct.name + "_constr"]); - this.moduleEntry.call("JS_AddModuleExport", ["ctx", "m", '"' + struct.name + '"']); - } - this.typings.addStruct(struct); - } - exportGlobalStruct(structName, exportName, values, description) { - this.moduleInit.declareStruct(structName, exportName + "_struct", values); - const classId = this.structLookup[structName]; - if (!classId) - throw new Error("Struct " + structName + " not found in register"); - this.moduleInit.jsStructToOpq(structName, exportName + "_js", exportName + "_struct", classId); - this.moduleInit.call("JS_SetModuleExport", ["ctx", "m", `"${exportName}"`, exportName + "_js"]); - this.moduleEntry.call("JS_AddModuleExport", ["ctx", "m", `"${exportName}"`]); - this.typings.constants.tsDeclareConstant(exportName, structName, description); - } - exportGlobalInt(name, description) { - this.moduleInit.statement(`JS_SetModuleExport(ctx, m, "${name}", JS_NewInt32(ctx, ${name}))`); - this.moduleEntry.statement(`JS_AddModuleExport(ctx, m, "${name}")`); - this.typings.constants.tsDeclareConstant(name, "number", description); - } - exportGlobalDouble(name, description) { - this.moduleInit.statement(`JS_SetModuleExport(ctx, m, "${name}", JS_NewFloat64(ctx, ${name}))`); - this.moduleEntry.statement(`JS_AddModuleExport(ctx, m, "${name}")`); - this.typings.constants.tsDeclareConstant(name, "number", description); - } -} -exports.RayLibHeader = RayLibHeader; - - -/***/ }), - -/***/ "./src/typescript.ts": -/*!***************************!*\ - !*** ./src/typescript.ts ***! - \***************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TypescriptGenerator = exports.GenericTypescriptGenerator = exports.TypeScriptDeclaration = void 0; -const generation_1 = __webpack_require__(/*! ./generation */ "./src/generation.ts"); -const fs_1 = __webpack_require__(/*! fs */ "fs"); -class TypeScriptDeclaration { - constructor() { - this.root = new TypescriptGenerator(); - this.structs = this.root.child(); - this.functions = this.root.child(); - this.constants = this.root.child(); - } - addFunction(name, api) { - const options = api.binding || {}; - const para = (api.params || []).filter(x => !x.binding?.ignore).map(x => ({ name: x.name, type: x.binding?.jsType ?? this.toJsType(x.type) })); - const returnType = options.jsReturns ?? this.toJsType(api.returnType); - this.functions.tsDeclareFunction(name, para, returnType, api.description); - } - addStruct(api) { - const options = api.binding || {}; - var fields = api.fields.filter(x => !!(options.properties || {})[x.name]).map(x => ({ name: x.name, description: x.description, type: this.toJsType(x.type) })); - this.structs.tsDeclareInterface(api.name, fields); - this.structs.tsDeclareType(api.name, !!(options.createConstructor || options.createEmptyConstructor), options.createEmptyConstructor ? [] : fields); - } - toJsType(type) { - switch (type) { - case "int": - case "long": - case "unsigned int": - case "unsigned char": - case "float": - case "double": - return "number"; - case "const unsigned char *": - case "unsigned char *": - case "unsigned short *": - case "float *": - return "ArrayBuffer"; - case "bool": - return "boolean"; - case "const char *": - case "char *": - return "string | undefined | null"; - case "void *": - case "const void *": - return "any"; - case "Camera": - case "Camera *": - return "Camera3D"; - case "Texture2D": - case "Texture2D *": - case "TextureCubemap": - return "Texture"; - case "RenderTexture2D": - case "RenderTexture2D *": - return "RenderTexture"; - case "Quaternion": - return "Vector4"; - default: - return type.replace(" *", "").replace("const ", ""); - } - } - writeTo(filename) { - const writer = new generation_1.CodeWriter(); - writer.writeGenerator(this.root); - (0, fs_1.writeFileSync)(filename, writer.toString()); - } -} -exports.TypeScriptDeclaration = TypeScriptDeclaration; -class GenericTypescriptGenerator extends generation_1.GenericCodeGenerator { - tsDeclareFunction(name, parameters, returnType, description) { - this.tsDocComment(description); - this.statement(`declare function ${name}(${parameters.map(x => x.name + ': ' + x.type).join(', ')}): ${returnType}`); - } - tsDeclareConstant(name, type, description) { - this.tsDocComment(description); - this.statement(`declare var ${name}: ${type}`); - } - tsDeclareType(name, hasConstructor, parameters) { - this.line(`declare var ${name}: {`); - this.indent(); - this.statement("prototype: " + name); - if (hasConstructor) - this.statement(`new(${parameters.map(x => x.name + ": " + x.type).join(', ')}): ${name}`); - this.unindent(); - this.line("}"); - } - tsDeclareInterface(name, fields) { - this.line(`interface ${name} {`); - this.indent(); - for (const field of fields) { - if (field.description) - this.tsDocComment(field.description); - this.line(field.name + ": " + field.type + ","); - } - this.unindent(); - this.line("}"); - } - tsDocComment(comment) { - this.line(`/** ${comment} */`); - } -} -exports.GenericTypescriptGenerator = GenericTypescriptGenerator; -class TypescriptGenerator extends GenericTypescriptGenerator { - createGenerator() { - return new TypescriptGenerator(); - } -} -exports.TypescriptGenerator = TypescriptGenerator; - - -/***/ }), - -/***/ "fs": -/*!*********************!*\ - !*** external "fs" ***! - \*********************/ -/***/ ((module) => { - -module.exports = require("fs"); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. -(() => { -var exports = __webpack_exports__; -/*!**********************!*\ - !*** ./src/index.ts ***! - \**********************/ - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs_1 = __webpack_require__(/*! fs */ "fs"); -const raylib_header_1 = __webpack_require__(/*! ./raylib-header */ "./src/raylib-header.ts"); -const header_parser_1 = __webpack_require__(/*! ./header-parser */ "./src/header-parser.ts"); -let api; -function getFunction(funList, name) { - return funList.find(x => x.name === name); -} -function getStruct(strList, name) { - return strList.find(x => x.name === name); -} -function getAliases(aliasList, name) { - return aliasList.filter(x => x.type === name).map(x => x.name); -} -function ignore(name) { - getFunction(api.functions, name).binding = { ignore: true }; -} -function main() { - // Load the pre-generated raylib api - api = JSON.parse((0, fs_1.readFileSync)("thirdparty/raylib/parser/output/raylib_api.json", 'utf8')); - const parser = new header_parser_1.HeaderParser(); - const rmathHeader = (0, fs_1.readFileSync)("thirdparty/raylib/src/raymath.h", "utf8"); - const mathApi = parser.parseFunctions(rmathHeader); - mathApi.forEach(x => api.functions.push(x)); - const rcameraHeader = (0, fs_1.readFileSync)("thirdparty/raylib/src/rcamera.h", "utf8"); - const cameraApi = parser.parseFunctionDefinitions(rcameraHeader); - cameraApi.forEach(x => api.functions.push(x)); - const rguiHeader = (0, fs_1.readFileSync)("thirdparty/raygui/src/raygui.h", "utf8"); - const rguiFunctions = parser.parseFunctionDefinitions(rguiHeader); - const rguiEnums = parser.parseEnums(rguiHeader); - //rguiApi.forEach(x => console.log(`core.addApiFunctionByName("${x.name}")`)) - rguiFunctions.forEach(x => api.functions.push(x)); - rguiEnums.forEach(x => api.enums.push(x)); - const rlightsHeader = (0, fs_1.readFileSync)("include/rlights.h", "utf8"); - const rlightsFunctions = parser.parseFunctions(rlightsHeader, true); - api.functions.push(rlightsFunctions[0]); - api.functions.push(rlightsFunctions[1]); - const rlightsEnums = parser.parseEnums(rlightsHeader); - rlightsEnums.forEach(x => api.enums.push(x)); - const rlightsStructs = parser.parseStructs(rlightsHeader); - rlightsStructs[0].binding = { - properties: { - type: { get: true, set: true }, - enabled: { get: true, set: true }, - position: { get: true, set: true }, - target: { get: true, set: true }, - color: { get: true, set: true }, - attenuation: { get: true, set: true }, - }, - }; - api.structs.push(rlightsStructs[0]); - const reasingsHeader = (0, fs_1.readFileSync)("include/reasings.h", "utf8"); - const reasingsFunctions = parser.parseFunctions(reasingsHeader); - reasingsFunctions.forEach(x => api.functions.push(x)); - const rlightmapperHeader = (0, fs_1.readFileSync)("src/rlightmapper.h", "utf8"); - const rlightmapperFunctions = parser.parseFunctionDefinitions(rlightmapperHeader); - const rlightmapperStructs = parser.parseStructs(rlightmapperHeader); - rlightmapperFunctions.forEach(x => api.functions.push(x)); - rlightmapperStructs.forEach(x => api.structs.push(x)); - rlightmapperStructs[0].binding = { - properties: { - w: { get: true }, - h: { get: true }, - progress: { get: true } - } - }; - rlightmapperStructs[1].binding = { - properties: { - hemisphereSize: { get: true, set: true }, - zNear: { get: true, set: true }, - zFar: { get: true, set: true }, - backgroundColor: { get: true, set: true }, - interpolationPasses: { get: true, set: true }, - interpolationThreshold: { get: true, set: true }, - cameraToSurfaceDistanceModifier: { get: true, set: true }, - } - }; - const rextensionsHeader = (0, fs_1.readFileSync)("src/rextensions.h", "utf8"); - const rextensionsFunctions = parser.parseFunctionDefinitions(rextensionsHeader); - console.log(rextensionsFunctions); - rextensionsFunctions.forEach(x => api.functions.push(x)); - // Define a new header - const core = new raylib_header_1.RayLibHeader("raylib_core"); - core.includes.include("raymath.h"); - core.includes.include("rcamera.h"); - core.includes.line("#define RAYGUI_IMPLEMENTATION"); - core.includes.include("raygui.h"); - core.includes.line("#define RLIGHTS_IMPLEMENTATION"); - core.includes.include("rlights.h"); - core.includes.include("reasings.h"); - core.includes.line("#define RLIGHTMAPPER_IMPLEMENTATION"); - core.includes.include("rlightmapper.h"); - getStruct(api.structs, "Color").binding = { - properties: { - r: { get: true, set: true }, - g: { get: true, set: true }, - b: { get: true, set: true }, - a: { get: true, set: true }, - }, - createConstructor: true - }; - getStruct(api.structs, "Rectangle").binding = { - properties: { - x: { get: true, set: true }, - y: { get: true, set: true }, - width: { get: true, set: true }, - height: { get: true, set: true }, - }, - createConstructor: true - }; - getStruct(api.structs, "Vector2").binding = { - properties: { - x: { get: true, set: true }, - y: { get: true, set: true }, - }, - createConstructor: true - }; - getStruct(api.structs, "Vector3").binding = { - properties: { - x: { get: true, set: true }, - y: { get: true, set: true }, - z: { get: true, set: true }, - }, - createConstructor: true - }; - getStruct(api.structs, "Vector4").binding = { - properties: { - x: { get: true, set: true }, - y: { get: true, set: true }, - z: { get: true, set: true }, - w: { get: true, set: true }, - }, - createConstructor: true, - aliases: getAliases(api.aliases, "Vector4") - }; - getStruct(api.structs, "Ray").binding = { - properties: { - position: { get: false, set: true }, - direction: { get: false, set: true }, - }, - createConstructor: true - }; - getStruct(api.structs, "RayCollision").binding = { - properties: { - hit: { get: true, set: false }, - distance: { get: true, set: false }, - point: { get: true, set: false }, - normal: { get: true, set: false }, - }, - createConstructor: false - }; - getStruct(api.structs, "Camera2D").binding = { - properties: { - offset: { get: true, set: true }, - target: { get: true, set: true }, - rotation: { get: true, set: true }, - zoom: { get: true, set: true }, - }, - createConstructor: true - }; - getStruct(api.structs, "Camera3D").binding = { - properties: { - position: { get: true, set: true }, - target: { get: true, set: true }, - up: { get: false, set: true }, - fovy: { get: true, set: true }, - projection: { get: true, set: true }, - }, - createConstructor: true, - aliases: getAliases(api.aliases, "Camera3D") - }; - getStruct(api.structs, "BoundingBox").binding = { - properties: { - min: { get: true, set: true }, - max: { get: true, set: true }, - }, - createConstructor: true - }; - getStruct(api.structs, "Matrix").binding = { - properties: {}, - createConstructor: false - }; - getStruct(api.structs, "NPatchInfo").binding = { - properties: { - source: { get: true, set: true }, - left: { get: true, set: true }, - top: { get: true, set: true }, - right: { get: true, set: true }, - bottom: { get: true, set: true }, - layout: { get: true, set: true }, - }, - createConstructor: true - }; - getStruct(api.structs, "Image").binding = { - properties: { - data: { set: true }, - width: { get: true, set: true }, - height: { get: true, set: true }, - mipmaps: { get: true, set: true }, - format: { get: true, set: true } - }, - createEmptyConstructor: true - //destructor: "UnloadImage" - }; - getStruct(api.structs, "Wave").binding = { - properties: { - frameCount: { get: true }, - sampleRate: { get: true }, - sampleSize: { get: true }, - channels: { get: true } - }, - //destructor: "UnloadWave" - }; - getStruct(api.structs, "Sound").binding = { - properties: { - frameCount: { get: true } - }, - //destructor: "UnloadSound" - }; - getStruct(api.structs, "Music").binding = { - properties: { - frameCount: { get: true }, - looping: { get: true, set: true }, - ctxType: { get: true }, - }, - //destructor: "UnloadMusicStream" - }; - getStruct(api.structs, "Model").binding = { - properties: { - transform: { get: true, set: true }, - meshCount: { get: true }, - materialCount: { get: true }, - boneCount: { get: true }, - }, - //destructor: "UnloadModel" - }; - getStruct(api.structs, "Mesh").binding = { - properties: { - vertexCount: { get: true, set: true }, - triangleCount: { get: true, set: true }, - // TODO: Free previous pointers before overwriting - vertices: { set: true }, - texcoords: { set: true }, - texcoords2: { set: true }, - normals: { set: true }, - tangents: { set: true }, - colors: { set: true }, - indices: { set: true }, - animVertices: { set: true }, - animNormals: { set: true }, - boneIds: { set: true }, - boneWeights: { set: true }, - }, - createEmptyConstructor: true - //destructor: "UnloadMesh" - }; - getStruct(api.structs, "Shader").binding = { - properties: { - id: { get: true } - }, - //destructor: "UnloadShader" - }; - getStruct(api.structs, "Texture").binding = { - properties: { - width: { get: true }, - height: { get: true }, - mipmaps: { get: true }, - format: { get: true }, - }, - aliases: getAliases(api.aliases, "Texture") - //destructor: "UnloadTexture" - }; - getStruct(api.structs, "Font").binding = { - properties: { - baseSize: { get: true }, - glyphCount: { get: true }, - glyphPadding: { get: true }, - }, - //destructor: "UnloadFont" - }; - getStruct(api.structs, "RenderTexture").binding = { - properties: { - id: { get: true }, - texture: { get: true }, - depth: { get: true }, - }, - aliases: getAliases(api.aliases, "RenderTexture") - //destructor: "UnloadRenderTexture" - }; - getStruct(api.structs, "MaterialMap").binding = { - properties: { - texture: { set: true }, - color: { set: true, get: true }, - value: { get: true, set: true } - }, - //destructor: "UnloadMaterialMap" - }; - getStruct(api.structs, "Material").binding = { - properties: { - shader: { get: true, set: true } - }, - //destructor: "UnloadMaterial" - }; - const structDI = getStruct(api.structs, "VrDeviceInfo"); - structDI.fields.filter(x => x.name === "lensDistortionValues")[0].type = "Vector4"; - structDI.binding = { - createEmptyConstructor: true, - properties: { - hResolution: { set: true, get: true }, - vResolution: { set: true, get: true }, - hScreenSize: { set: true, get: true }, - vScreenSize: { set: true, get: true }, - vScreenCenter: { set: true, get: true }, - eyeToScreenDistance: { set: true, get: true }, - lensSeparationDistance: { set: true, get: true }, - interpupillaryDistance: { set: true, get: true }, - // lensDistortionValues: { - // set: true, - // get: true, - // overrideRead(fn) { - // fn.line("// TODO") - // }, - // overrideWrite(fn) { - // fn.line("// TODO") - // }, - // }, - } - }; - getFunction(api.functions, "EndDrawing").binding = { after: gen => gen.call("app_update_quickjs", []) }; - ignore("SetWindowIcons"); - ignore("GetWindowHandle"); - // Custom frame control functions - // NOT SUPPORTED BECAUSE NEEDS COMPILER FLAG - ignore("SwapScreenBuffer"); - ignore("PollInputEvents"); - ignore("WaitTime"); - //ignore("BeginVrStereoMode") - //ignore("EndVrStereoMode") - //ignore("LoadVrStereoConfig") - //ignore("UnloadVrStereoConfig") - getFunction(api.functions, "SetShaderValue").binding = { body: (gen) => { - gen.jsToC("Shader", "shader", "argv[0]", core.structLookup); - gen.jsToC("int", "locIndex", "argv[1]", core.structLookup); - gen.declare("value", "void *", false, "NULL"); - gen.declare("valueFloat", "float"); - gen.declare("valueInt", "int"); - gen.jsToC("int", "uniformType", "argv[3]", core.structLookup); - const sw = gen.switch("uniformType"); - let b = sw.caseBreak("SHADER_UNIFORM_FLOAT"); - b.jsToC("float", "valueFloat", "argv[2]", core.structLookup, true); - b.statement("value = (void *)&valueFloat"); - b = sw.caseBreak("SHADER_UNIFORM_VEC2"); - b.jsToC("Vector2 *", "valueV2", "argv[2]", core.structLookup); - b.statement("value = (void*)valueV2"); - b = sw.caseBreak("SHADER_UNIFORM_VEC3"); - b.jsToC("Vector3 *", "valueV3", "argv[2]", core.structLookup); - b.statement("value = (void*)valueV3"); - b = sw.caseBreak("SHADER_UNIFORM_VEC4"); - b.jsToC("Vector4 *", "valueV4", "argv[2]", core.structLookup); - b.statement("value = (void*)valueV4"); - b = sw.caseBreak("SHADER_UNIFORM_INT"); - b.jsToC("int", "valueInt", "argv[2]", core.structLookup, true); - b.statement("value = (void*)&valueInt"); - b = sw.defaultBreak(); - b.returnExp("JS_EXCEPTION"); - gen.call("SetShaderValue", ["shader", "locIndex", "value", "uniformType"]); - gen.returnExp("JS_UNDEFINED"); - } }; - ignore("SetShaderValueV"); - const traceLog = getFunction(api.functions, "TraceLog"); - traceLog.params?.pop(); - // Memory functions not supported on JS, just use ArrayBuffer - ignore("MemAlloc"); - ignore("MemRealloc"); - ignore("MemFree"); - // Callbacks not supported on JS - ignore("SetTraceLogCallback"); - ignore("SetLoadFileDataCallback"); - ignore("SetSaveFileDataCallback"); - ignore("SetLoadFileTextCallback"); - ignore("SetSaveFileTextCallback"); - // Files management functions - const lfd = getFunction(api.functions, "LoadFileData"); - lfd.params[lfd.params.length - 1].binding = { ignore: true }; - lfd.binding = { - body: gen => { - gen.jsToC("const char *", "fileName", "argv[0]"); - gen.declare("bytesRead", "unsigned int"); - gen.call("LoadFileData", ["fileName", "&bytesRead"], { type: "unsigned char *", name: "retVal" }); - gen.statement("JSValue buffer = JS_NewArrayBufferCopy(ctx, (const uint8_t*)retVal, bytesRead)"); - gen.call("UnloadFileData", ["retVal"]); - gen.jsCleanUpParameter("const char*", "fileName"); - gen.returnExp("buffer"); - } - }; - ignore("UnloadFileData"); - // TODO: SaveFileData works but unnecessary makes copy of memory - getFunction(api.functions, "SaveFileData").binding = {}; - ignore("ExportDataAsCode"); - getFunction(api.functions, "LoadFileText").binding = { after: gen => gen.call("UnloadFileText", ["returnVal"]) }; - getFunction(api.functions, "SaveFileText").params[1].binding = { typeAlias: "const char *" }; - ignore("UnloadFileText"); - const createFileList = (gen, loadName, unloadName, args) => { - gen.call(loadName, args, { type: "FilePathList", name: "files" }); - gen.call("JS_NewArray", ["ctx"], { type: "JSValue", name: "ret" }); - const f = gen.for("i", "files.count"); - f.call("JS_SetPropertyUint32", ["ctx", "ret", "i", "JS_NewString(ctx,files.paths[i])"]); - gen.call(unloadName, ["files"]); - }; - getFunction(api.functions, "LoadDirectoryFiles").binding = { - jsReturns: "string[]", - body: gen => { - gen.jsToC("const char *", "dirPath", "argv[0]"); - createFileList(gen, "LoadDirectoryFiles", "UnloadDirectoryFiles", ["dirPath"]); - gen.jsCleanUpParameter("const char *", "dirPath"); - gen.returnExp("ret"); - } - }; - getFunction(api.functions, "LoadDirectoryFilesEx").binding = { - jsReturns: "string[]", - body: gen => { - gen.jsToC("const char *", "basePath", "argv[0]"); - gen.jsToC("const char *", "filter", "argv[1]"); - gen.jsToC("bool", "scanSubdirs", "argv[2]"); - createFileList(gen, "LoadDirectoryFilesEx", "UnloadDirectoryFiles", ["basePath", "filter", "scanSubdirs"]); - gen.jsCleanUpParameter("const char *", "basePath"); - gen.jsCleanUpParameter("const char *", "filter"); - gen.returnExp("ret"); - } - }; - ignore("UnloadDirectoryFiles"); - getFunction(api.functions, "LoadDroppedFiles").binding = { - jsReturns: "string[]", - body: gen => { - createFileList(gen, "LoadDroppedFiles", "UnloadDroppedFiles", []); - gen.returnExp("ret"); - } - }; - ignore("UnloadDroppedFiles"); - // Compression/encoding functionality - ignore("CompressData"); - ignore("DecompressData"); - ignore("EncodeDataBase64"); - ignore("DecodeDataBase64"); - ignore("DrawLineStrip"); - ignore("DrawTriangleFan"); - ignore("DrawTriangleStrip"); - ignore("CheckCollisionPointPoly"); - ignore("CheckCollisionLines"); - ignore("LoadImageAnim"); - ignore("ExportImageAsCode"); - getFunction(api.functions, "LoadImageColors").binding = { - jsReturns: "ArrayBuffer", - body: gen => { - gen.jsToC("Image", "image", "argv[0]", core.structLookup); - gen.call("LoadImageColors", ["image"], { name: "colors", type: "Color *" }); - gen.statement("JSValue retVal = JS_NewArrayBufferCopy(ctx, (const uint8_t*)colors, image.width*image.height*sizeof(Color))"); - gen.call("UnloadImageColors", ["colors"]); - gen.returnExp("retVal"); - } - }; - ignore("LoadImagePalette"); - ignore("UnloadImageColors"); - ignore("UnloadImagePalette"); - ignore("GetPixelColor"); - ignore("SetPixelColor"); - const lfx = getFunction(api.functions, "LoadFontEx"); - lfx.params[2].binding = { ignore: true }; - lfx.params[3].binding = { ignore: true }; - lfx.binding = { customizeCall: "Font returnVal = LoadFontEx(fileName, fontSize, NULL, 0);" }; - ignore("LoadFontFromMemory"); - ignore("LoadFontData"); - ignore("GenImageFontAtlas"); - ignore("UnloadFontData"); - ignore("ExportFontAsCode"); - ignore("DrawTextCodepoints"); - ignore("GetGlyphInfo"); - ignore("LoadUTF8"); - ignore("UnloadUTF8"); - ignore("LoadCodepoints"); - ignore("UnloadCodepoints"); - ignore("GetCodepointCount"); - ignore("GetCodepoint"); - ignore("GetCodepointNext"); - ignore("GetCodepointPrevious"); - ignore("CodepointToUTF8"); - // Not supported, use JS Stdlib instead - api.functions.filter(x => x.name.startsWith("Text")).forEach(x => ignore(x.name)); - ignore("DrawTriangleStrip3D"); - ignore("LoadMaterials"); - ignore("LoadModelAnimations"); - ignore("UpdateModelAnimation"); - ignore("UnloadModelAnimation"); - ignore("UnloadModelAnimations"); - ignore("IsModelAnimationValid"); - ignore("ExportWaveAsCode"); - // Wave/Sound management functions - ignore("LoadWaveSamples"); - ignore("UnloadWaveSamples"); - ignore("LoadMusicStreamFromMemory"); - ignore("LoadAudioStream"); - ignore("IsAudioStreamReady"); - ignore("UnloadAudioStream"); - ignore("UpdateAudioStream"); - ignore("IsAudioStreamProcessed"); - ignore("PlayAudioStream"); - ignore("PauseAudioStream"); - ignore("ResumeAudioStream"); - ignore("IsAudioStreamPlaying"); - ignore("StopAudioStream"); - ignore("SetAudioStreamVolume"); - ignore("SetAudioStreamPitch"); - ignore("SetAudioStreamPan"); - ignore("SetAudioStreamBufferSizeDefault"); - ignore("SetAudioStreamCallback"); - ignore("AttachAudioStreamProcessor"); - ignore("DetachAudioStreamProcessor"); - ignore("AttachAudioMixedProcessor"); - ignore("DetachAudioMixedProcessor"); - ignore("Vector3OrthoNormalize"); - ignore("Vector3ToFloatV"); - ignore("MatrixToFloatV"); - ignore("QuaternionToAxisAngle"); - core.exportGlobalDouble("DEG2RAD", "(PI/180.0)"); - core.exportGlobalDouble("RAD2DEG", "(180.0/PI)"); - const setOutParam = (fun, index) => { - const param = fun.params[index]; - param.binding = { - jsType: `{ ${param.name}: number }`, - customConverter: (gen, src) => { - gen.declare(param.name, param.type, false, "NULL"); - gen.declare(param.name + "_out", param.type.replace(" *", "")); - const body = gen.if("!JS_IsNull(" + src + ")"); - body.statement(param.name + " = &" + param.name + "_out"); - body.call("JS_GetPropertyStr", ["ctx", src, '"' + param.name + '"'], { name: param.name + "_js", type: "JSValue" }); - body.call("JS_ToInt32", ["ctx", param.name, param.name + "_js"]); - }, - customCleanup: (gen, src) => { - const body = gen.if("!JS_IsNull(" + src + ")"); - body.call("JS_SetPropertyStr", ["ctx", src, `"${param.name}"`, "JS_NewInt32(ctx," + param.name + "_out)"]); - } - }; - }; - const setOutParamString = (fun, index, indexLen) => { - const lenParam = fun.params[indexLen]; - lenParam.binding = { ignore: true }; - const param = fun.params[index]; - param.binding = { - jsType: `{ ${param.name}: string }`, - customConverter: (gen, src) => { - gen.call("JS_GetPropertyStr", ["ctx", src, '"' + param.name + '"'], { name: param.name + "_js", type: "JSValue" }); - gen.declare(param.name + "_len", "size_t"); - gen.call("JS_ToCStringLen", ["ctx", "&" + param.name + "_len", param.name + "_js"], { name: param.name + "_val", type: "const char *" }); - gen.call("memcpy", ["(void *)textbuffer", param.name + "_val", param.name + "_len"]); - gen.statement("textbuffer[" + param.name + "_len] = 0"); - gen.declare(param.name, param.type, false, "textbuffer"); - gen.declare(lenParam.name, lenParam.type, false, "4096"); - }, - customCleanup: (gen, src) => { - gen.jsCleanUpParameter("const char *", param.name + "_val"); - gen.call("JS_SetPropertyStr", ["ctx", src, `"${param.name}"`, "JS_NewString(ctx," + param.name + ")"]); - } - }; - }; - core.definitions.declare("textbuffer[4096]", "char", true); - setOutParam(getFunction(api.functions, "GuiDropdownBox"), 2); - setOutParam(getFunction(api.functions, "GuiSpinner"), 2); - setOutParam(getFunction(api.functions, "GuiValueBox"), 2); - setOutParam(getFunction(api.functions, "GuiListView"), 2); - // const setStringListParam = (fun: RayLibFunction, index: number, indexLen: number) => { - // const lenParam = fun!.params![indexLen] - // lenParam.binding = { ignore: true } - // const param = fun!.params![index] - // fun.binding = { customizeCall: "int returnVal = GuiListViewEx(bounds, text, count, focus, scrollIndex, active);" } - // param.binding = { - // jsType: `{ ${param.name}: string[] }`, - // customConverter: (gen,src) => { - // gen.line("// TODO: Read string values") - // }, - // customCleanup: (gen, src) => { - // gen.line("// TODO: Dispose strings") - // } - // } - // } - //const glve = getFunction(api.functions, "GuiListViewEx")! - //setStringListParam(glve, 1,2) - //setOutParam(glve, 3) - //setOutParam(glve, 4) - ignore("GuiListViewEx"); - setOutParamString(getFunction(api.functions, "GuiTextBox"), 1, 2); - const gtib = getFunction(api.functions, "GuiTextInputBox"); - setOutParamString(gtib, 4, 5); - setOutParam(gtib, 6); - // needs string array - ignore("GuiTabBar"); - ignore("GuiGetIcons"); - ignore("GuiLoadIcons"); - api.structs.forEach(x => core.addApiStruct(x)); - api.functions.forEach(x => core.addApiFunction(x)); - api.defines.filter(x => x.type === "COLOR").map(x => ({ name: x.name, description: x.description, values: (x.value.match(/\{([^}]+)\}/) || "")[1].split(',').map(x => x.trim()) })).forEach(x => { - core.exportGlobalStruct("Color", x.name, x.values, x.description); - }); - api.enums.forEach(x => core.addEnum(x)); - core.exportGlobalInt("MATERIAL_MAP_DIFFUSE", "Albedo material (same as: MATERIAL_MAP_DIFFUSE"); - core.exportGlobalInt("MATERIAL_MAP_SPECULAR", "Metalness material (same as: MATERIAL_MAP_SPECULAR)"); - core.writeTo("src/bindings/js_raylib_core.h"); - core.typings.writeTo("examples/lib.raylib.d.ts"); - const ignored = api.functions.filter(x => x.binding?.ignore).length; - console.log(`Converted ${api.functions.length - ignored} function. ${ignored} ignored`); - console.log("Success!"); - // TODO: Expose PLatform defines -} -main(); - -})(); - -/******/ })() -; \ No newline at end of file diff --git a/generate-bindings.sh b/generate-bindings.sh new file mode 100755 index 0000000..c75d232 --- /dev/null +++ b/generate-bindings.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -o errexit -o nounset -o pipefail + +SCRIPTPATH=$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P ) +PROJECT_HOME=$( realpath "$SCRIPTPATH" ) + +echo "Generating bindings" + +cd "$PROJECT_HOME/bindings" && \ + npm run bindings:generate diff --git a/src/bindings/js_raylib_core.h b/src/bindings/js_raylib_core.h index 026c006..aa84e8c 100644 --- a/src/bindings/js_raylib_core.h +++ b/src/bindings/js_raylib_core.h @@ -54,6 +54,8 @@ static JSClassID js_Music_class_id; static JSClassID js_VrDeviceInfo_class_id; static JSClassID js_VrStereoConfig_class_id; static JSClassID js_FilePathList_class_id; +static JSClassID js_AutomationEvent_class_id; +static JSClassID js_AutomationEventList_class_id; static JSClassID js_Light_class_id; static JSClassID js_Lightmapper_class_id; static JSClassID js_LightmapperConfig_class_id; @@ -1920,22 +1922,6 @@ static JSValue js_VrDeviceInfo_set_vScreenSize(JSContext* ctx, JSValueConst this return JS_UNDEFINED; } -static JSValue js_VrDeviceInfo_get_vScreenCenter(JSContext* ctx, JSValueConst this_val) { - VrDeviceInfo* ptr = JS_GetOpaque2(ctx, this_val, js_VrDeviceInfo_class_id); - float vScreenCenter = ptr->vScreenCenter; - JSValue ret = JS_NewFloat64(ctx, vScreenCenter); - return ret; -} - -static JSValue js_VrDeviceInfo_set_vScreenCenter(JSContext* ctx, JSValueConst this_val, JSValueConst v) { - VrDeviceInfo* ptr = JS_GetOpaque2(ctx, this_val, js_VrDeviceInfo_class_id); - double _double_value; - JS_ToFloat64(ctx, &_double_value, v); - float value = (float)_double_value; - ptr->vScreenCenter = value; - return JS_UNDEFINED; -} - static JSValue js_VrDeviceInfo_get_eyeToScreenDistance(JSContext* ctx, JSValueConst this_val) { VrDeviceInfo* ptr = JS_GetOpaque2(ctx, this_val, js_VrDeviceInfo_class_id); float eyeToScreenDistance = ptr->eyeToScreenDistance; @@ -1989,7 +1975,6 @@ static const JSCFunctionListEntry js_VrDeviceInfo_proto_funcs[] = { JS_CGETSET_DEF("vResolution",js_VrDeviceInfo_get_vResolution,js_VrDeviceInfo_set_vResolution), JS_CGETSET_DEF("hScreenSize",js_VrDeviceInfo_get_hScreenSize,js_VrDeviceInfo_set_hScreenSize), JS_CGETSET_DEF("vScreenSize",js_VrDeviceInfo_get_vScreenSize,js_VrDeviceInfo_set_vScreenSize), - JS_CGETSET_DEF("vScreenCenter",js_VrDeviceInfo_get_vScreenCenter,js_VrDeviceInfo_set_vScreenCenter), JS_CGETSET_DEF("eyeToScreenDistance",js_VrDeviceInfo_get_eyeToScreenDistance,js_VrDeviceInfo_set_eyeToScreenDistance), JS_CGETSET_DEF("lensSeparationDistance",js_VrDeviceInfo_get_lensSeparationDistance,js_VrDeviceInfo_set_lensSeparationDistance), JS_CGETSET_DEF("interpupillaryDistance",js_VrDeviceInfo_get_interpupillaryDistance,js_VrDeviceInfo_set_interpupillaryDistance), @@ -2048,6 +2033,48 @@ static int js_declare_FilePathList(JSContext * ctx, JSModuleDef * m) { return 0; } +static void js_AutomationEvent_finalizer(JSRuntime * rt, JSValue val) { + AutomationEvent* ptr = JS_GetOpaque(val, js_AutomationEvent_class_id); + if(ptr) { + js_free_rt(rt, ptr); + } +} + +static const JSCFunctionListEntry js_AutomationEvent_proto_funcs[] = { + JS_PROP_STRING_DEF("[Symbol.toStringTag]","AutomationEvent", JS_PROP_CONFIGURABLE), +}; + +static int js_declare_AutomationEvent(JSContext * ctx, JSModuleDef * m) { + JS_NewClassID(&js_AutomationEvent_class_id); + JSClassDef js_AutomationEvent_def = { .class_name = "AutomationEvent", .finalizer = js_AutomationEvent_finalizer }; + JS_NewClass(JS_GetRuntime(ctx), js_AutomationEvent_class_id, &js_AutomationEvent_def); + JSValue proto = JS_NewObject(ctx); + JS_SetPropertyFunctionList(ctx, proto, js_AutomationEvent_proto_funcs, countof(js_AutomationEvent_proto_funcs)); + JS_SetClassProto(ctx, js_AutomationEvent_class_id, proto); + return 0; +} + +static void js_AutomationEventList_finalizer(JSRuntime * rt, JSValue val) { + AutomationEventList* ptr = JS_GetOpaque(val, js_AutomationEventList_class_id); + if(ptr) { + js_free_rt(rt, ptr); + } +} + +static const JSCFunctionListEntry js_AutomationEventList_proto_funcs[] = { + JS_PROP_STRING_DEF("[Symbol.toStringTag]","AutomationEventList", JS_PROP_CONFIGURABLE), +}; + +static int js_declare_AutomationEventList(JSContext * ctx, JSModuleDef * m) { + JS_NewClassID(&js_AutomationEventList_class_id); + JSClassDef js_AutomationEventList_def = { .class_name = "AutomationEventList", .finalizer = js_AutomationEventList_finalizer }; + JS_NewClass(JS_GetRuntime(ctx), js_AutomationEventList_class_id, &js_AutomationEventList_def); + JSValue proto = JS_NewObject(ctx); + JS_SetPropertyFunctionList(ctx, proto, js_AutomationEventList_proto_funcs, countof(js_AutomationEventList_proto_funcs)); + JS_SetClassProto(ctx, js_AutomationEventList_class_id, proto); + return 0; +} + static void js_Light_finalizer(JSRuntime * rt, JSValue val) { Light* ptr = JS_GetOpaque(val, js_Light_class_id); if(ptr) { @@ -2593,17 +2620,17 @@ static JSValue js_initWindow(JSContext * ctx, JSValueConst this_val, int argc, J return JS_UNDEFINED; } +static JSValue js_closeWindow(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + CloseWindow(); + return JS_UNDEFINED; +} + static JSValue js_windowShouldClose(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { bool returnVal = WindowShouldClose(); JSValue ret = JS_NewBool(ctx, returnVal); return ret; } -static JSValue js_closeWindow(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - CloseWindow(); - return JS_UNDEFINED; -} - static JSValue js_isWindowReady(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { bool returnVal = IsWindowReady(); JSValue ret = JS_NewBool(ctx, returnVal); @@ -2673,6 +2700,11 @@ static JSValue js_toggleFullscreen(JSContext * ctx, JSValueConst this_val, int a return JS_UNDEFINED; } +static JSValue js_toggleBorderlessWindowed(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + ToggleBorderlessWindowed(); + return JS_UNDEFINED; +} + static JSValue js_maximizeWindow(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { MaximizeWindow(); return JS_UNDEFINED; @@ -2728,6 +2760,15 @@ static JSValue js_setWindowMinSize(JSContext * ctx, JSValueConst this_val, int a return JS_UNDEFINED; } +static JSValue js_setWindowMaxSize(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + int width; + JS_ToInt32(ctx, &width, argv[0]); + int height; + JS_ToInt32(ctx, &height, argv[1]); + SetWindowMaxSize(width, height); + return JS_UNDEFINED; +} + static JSValue js_setWindowSize(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int width; JS_ToInt32(ctx, &width, argv[0]); @@ -2745,6 +2786,11 @@ static JSValue js_setWindowOpacity(JSContext * ctx, JSValueConst this_val, int a return JS_UNDEFINED; } +static JSValue js_setWindowFocused(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + SetWindowFocused(); + return JS_UNDEFINED; +} + static JSValue js_getScreenWidth(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int returnVal = GetScreenWidth(); JSValue ret = JS_NewInt32(ctx, returnVal); @@ -3195,14 +3241,14 @@ static JSValue js_unloadShader(JSContext * ctx, JSValueConst this_val, int argc, return JS_UNDEFINED; } -static JSValue js_getMouseRay(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { +static JSValue js_getScreenToWorldRay(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Vector2* mousePosition_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); if(mousePosition_ptr == NULL) return JS_EXCEPTION; Vector2 mousePosition = *mousePosition_ptr; Camera* camera_ptr = (Camera*)JS_GetOpaque2(ctx, argv[1], js_Camera3D_class_id); if(camera_ptr == NULL) return JS_EXCEPTION; Camera camera = *camera_ptr; - Ray returnVal = GetMouseRay(mousePosition, camera); + Ray returnVal = GetScreenToWorldRay(mousePosition, camera); Ray* ret_ptr = (Ray*)js_malloc(ctx, sizeof(Ray)); *ret_ptr = returnVal; JSValue ret = JS_NewObjectClass(ctx, js_Ray_class_id); @@ -3210,26 +3256,23 @@ static JSValue js_getMouseRay(JSContext * ctx, JSValueConst this_val, int argc, return ret; } -static JSValue js_getCameraMatrix(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Camera* camera_ptr = (Camera*)JS_GetOpaque2(ctx, argv[0], js_Camera3D_class_id); +static JSValue js_getScreenToWorldRayEx(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* mousePosition_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(mousePosition_ptr == NULL) return JS_EXCEPTION; + Vector2 mousePosition = *mousePosition_ptr; + Camera* camera_ptr = (Camera*)JS_GetOpaque2(ctx, argv[1], js_Camera3D_class_id); if(camera_ptr == NULL) return JS_EXCEPTION; Camera camera = *camera_ptr; - Matrix returnVal = GetCameraMatrix(camera); - Matrix* ret_ptr = (Matrix*)js_malloc(ctx, sizeof(Matrix)); + double _double_width; + JS_ToFloat64(ctx, &_double_width, argv[2]); + float width = (float)_double_width; + double _double_height; + JS_ToFloat64(ctx, &_double_height, argv[3]); + float height = (float)_double_height; + Ray returnVal = GetScreenToWorldRayEx(mousePosition, camera, width, height); + Ray* ret_ptr = (Ray*)js_malloc(ctx, sizeof(Ray)); *ret_ptr = returnVal; - JSValue ret = JS_NewObjectClass(ctx, js_Matrix_class_id); - JS_SetOpaque(ret, ret_ptr); - return ret; -} - -static JSValue js_getCameraMatrix2D(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Camera2D* camera_ptr = (Camera2D*)JS_GetOpaque2(ctx, argv[0], js_Camera2D_class_id); - if(camera_ptr == NULL) return JS_EXCEPTION; - Camera2D camera = *camera_ptr; - Matrix returnVal = GetCameraMatrix2D(camera); - Matrix* ret_ptr = (Matrix*)js_malloc(ctx, sizeof(Matrix)); - *ret_ptr = returnVal; - JSValue ret = JS_NewObjectClass(ctx, js_Matrix_class_id); + JSValue ret = JS_NewObjectClass(ctx, js_Ray_class_id); JS_SetOpaque(ret, ret_ptr); return ret; } @@ -3249,21 +3292,6 @@ static JSValue js_getWorldToScreen(JSContext * ctx, JSValueConst this_val, int a return ret; } -static JSValue js_getScreenToWorld2D(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Vector2* position_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); - if(position_ptr == NULL) return JS_EXCEPTION; - Vector2 position = *position_ptr; - Camera2D* camera_ptr = (Camera2D*)JS_GetOpaque2(ctx, argv[1], js_Camera2D_class_id); - if(camera_ptr == NULL) return JS_EXCEPTION; - Camera2D camera = *camera_ptr; - Vector2 returnVal = GetScreenToWorld2D(position, camera); - Vector2* ret_ptr = (Vector2*)js_malloc(ctx, sizeof(Vector2)); - *ret_ptr = returnVal; - JSValue ret = JS_NewObjectClass(ctx, js_Vector2_class_id); - JS_SetOpaque(ret, ret_ptr); - return ret; -} - static JSValue js_getWorldToScreenEx(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Vector3* position_ptr = (Vector3*)JS_GetOpaque2(ctx, argv[0], js_Vector3_class_id); if(position_ptr == NULL) return JS_EXCEPTION; @@ -3298,6 +3326,45 @@ static JSValue js_getWorldToScreen2D(JSContext * ctx, JSValueConst this_val, int return ret; } +static JSValue js_getScreenToWorld2D(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* position_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(position_ptr == NULL) return JS_EXCEPTION; + Vector2 position = *position_ptr; + Camera2D* camera_ptr = (Camera2D*)JS_GetOpaque2(ctx, argv[1], js_Camera2D_class_id); + if(camera_ptr == NULL) return JS_EXCEPTION; + Camera2D camera = *camera_ptr; + Vector2 returnVal = GetScreenToWorld2D(position, camera); + Vector2* ret_ptr = (Vector2*)js_malloc(ctx, sizeof(Vector2)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector2_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_getCameraMatrix(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Camera* camera_ptr = (Camera*)JS_GetOpaque2(ctx, argv[0], js_Camera3D_class_id); + if(camera_ptr == NULL) return JS_EXCEPTION; + Camera camera = *camera_ptr; + Matrix returnVal = GetCameraMatrix(camera); + Matrix* ret_ptr = (Matrix*)js_malloc(ctx, sizeof(Matrix)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Matrix_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_getCameraMatrix2D(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Camera2D* camera_ptr = (Camera2D*)JS_GetOpaque2(ctx, argv[0], js_Camera2D_class_id); + if(camera_ptr == NULL) return JS_EXCEPTION; + Camera2D camera = *camera_ptr; + Matrix returnVal = GetCameraMatrix2D(camera); + Matrix* ret_ptr = (Matrix*)js_malloc(ctx, sizeof(Matrix)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Matrix_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + static JSValue js_setTargetFPS(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int fps; JS_ToInt32(ctx, &fps, argv[0]); @@ -3305,12 +3372,6 @@ static JSValue js_setTargetFPS(JSContext * ctx, JSValueConst this_val, int argc, return JS_UNDEFINED; } -static JSValue js_getFPS(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - int returnVal = GetFPS(); - JSValue ret = JS_NewInt32(ctx, returnVal); - return ret; -} - static JSValue js_getFrameTime(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { float returnVal = GetFrameTime(); JSValue ret = JS_NewFloat64(ctx, returnVal); @@ -3323,6 +3384,19 @@ static JSValue js_getTime(JSContext * ctx, JSValueConst this_val, int argc, JSVa return ret; } +static JSValue js_getFPS(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + int returnVal = GetFPS(); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_setRandomSeed(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + unsigned int seed; + JS_ToUint32(ctx, &seed, argv[0]); + SetRandomSeed(seed); + return JS_UNDEFINED; +} + static JSValue js_getRandomValue(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int min; JS_ToInt32(ctx, &min, argv[0]); @@ -3333,10 +3407,27 @@ static JSValue js_getRandomValue(JSContext * ctx, JSValueConst this_val, int arg return ret; } -static JSValue js_setRandomSeed(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - unsigned int seed; - JS_ToUint32(ctx, &seed, argv[0]); - SetRandomSeed(seed); +static JSValue js_loadRandomSequence(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + unsigned int count; + JS_ToUint32(ctx, &count, argv[0]); + int min; + JS_ToInt32(ctx, &min, argv[1]); + int max; + JS_ToInt32(ctx, &max, argv[2]); + int * returnVal = LoadRandomSequence(count, min, max); + JSValue ret = JS_NewArrayBufferCopy(ctx, returnVal, sizeof(returnVal)); + return ret; +} + +static JSValue js_unloadRandomSequence(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + size_t sequence_size; + void * sequence_js = (void *)JS_GetArrayBuffer(ctx, &sequence_size, argv[0]); + if(sequence_js == NULL) { + return JS_EXCEPTION; + } + int * sequence = malloc(sequence_size); + memcpy((void *)sequence, (const void *)sequence_js, sequence_size); + UnloadRandomSequence(sequence); return JS_UNDEFINED; } @@ -3354,6 +3445,13 @@ static JSValue js_setConfigFlags(JSContext * ctx, JSValueConst this_val, int arg return JS_UNDEFINED; } +static JSValue js_openURL(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + const char * url = (JS_IsNull(argv[0]) || JS_IsUndefined(argv[0])) ? NULL : (const char *)JS_ToCString(ctx, argv[0]); + OpenURL(url); + JS_FreeCString(ctx, url); + return JS_UNDEFINED; +} + static JSValue js_traceLog(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int logLevel; JS_ToInt32(ctx, &logLevel, argv[0]); @@ -3370,13 +3468,6 @@ static JSValue js_setTraceLogLevel(JSContext * ctx, JSValueConst this_val, int a return JS_UNDEFINED; } -static JSValue js_openURL(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - const char * url = (JS_IsNull(argv[0]) || JS_IsUndefined(argv[0])) ? NULL : (const char *)JS_ToCString(ctx, argv[0]); - OpenURL(url); - JS_FreeCString(ctx, url); - return JS_UNDEFINED; -} - static JSValue js_loadFileData(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { const char * fileName = (JS_IsNull(argv[0]) || JS_IsUndefined(argv[0])) ? NULL : (const char *)JS_ToCString(ctx, argv[0]); unsigned int bytesRead; @@ -3395,9 +3486,9 @@ static JSValue js_saveFileData(JSContext * ctx, JSValueConst this_val, int argc, } void * data = malloc(data_size); memcpy((void *)data, (const void *)data_js, data_size); - unsigned int bytesToWrite; - JS_ToUint32(ctx, &bytesToWrite, argv[2]); - bool returnVal = SaveFileData(fileName, data, bytesToWrite); + int dataSize; + JS_ToInt32(ctx, &dataSize, argv[2]); + bool returnVal = SaveFileData(fileName, data, dataSize); JS_FreeCString(ctx, fileName); free((void *)data); JSValue ret = JS_NewBool(ctx, returnVal); @@ -3576,6 +3667,68 @@ static JSValue js_getFileModTime(JSContext * ctx, JSValueConst this_val, int arg return ret; } +static JSValue js_loadAutomationEventList(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + const char * fileName = (JS_IsNull(argv[0]) || JS_IsUndefined(argv[0])) ? NULL : (const char *)JS_ToCString(ctx, argv[0]); + AutomationEventList returnVal = LoadAutomationEventList(fileName); + JS_FreeCString(ctx, fileName); + AutomationEventList* ret_ptr = (AutomationEventList*)js_malloc(ctx, sizeof(AutomationEventList)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_AutomationEventList_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_unloadAutomationEventList(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + AutomationEventList* list_ptr = (AutomationEventList*)JS_GetOpaque2(ctx, argv[0], js_AutomationEventList_class_id); + if(list_ptr == NULL) return JS_EXCEPTION; + AutomationEventList list = *list_ptr; + UnloadAutomationEventList(list); + return JS_UNDEFINED; +} + +static JSValue js_exportAutomationEventList(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + AutomationEventList* list_ptr = (AutomationEventList*)JS_GetOpaque2(ctx, argv[0], js_AutomationEventList_class_id); + if(list_ptr == NULL) return JS_EXCEPTION; + AutomationEventList list = *list_ptr; + const char * fileName = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + bool returnVal = ExportAutomationEventList(list, fileName); + JS_FreeCString(ctx, fileName); + JSValue ret = JS_NewBool(ctx, returnVal); + return ret; +} + +static JSValue js_setAutomationEventList(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + AutomationEventList* list = (AutomationEventList*)JS_GetOpaque2(ctx, argv[0], js_AutomationEventList_class_id); + if(list == NULL) return JS_EXCEPTION; + SetAutomationEventList(list); + return JS_UNDEFINED; +} + +static JSValue js_setAutomationEventBaseFrame(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + int frame; + JS_ToInt32(ctx, &frame, argv[0]); + SetAutomationEventBaseFrame(frame); + return JS_UNDEFINED; +} + +static JSValue js_startAutomationEventRecording(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + StartAutomationEventRecording(); + return JS_UNDEFINED; +} + +static JSValue js_stopAutomationEventRecording(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + StopAutomationEventRecording(); + return JS_UNDEFINED; +} + +static JSValue js_playAutomationEvent(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + AutomationEvent* event_ptr = (AutomationEvent*)JS_GetOpaque2(ctx, argv[0], js_AutomationEvent_class_id); + if(event_ptr == NULL) return JS_EXCEPTION; + AutomationEvent event = *event_ptr; + PlayAutomationEvent(event); + return JS_UNDEFINED; +} + static JSValue js_isKeyPressed(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int key; JS_ToInt32(ctx, &key, argv[0]); @@ -3584,6 +3737,14 @@ static JSValue js_isKeyPressed(JSContext * ctx, JSValueConst this_val, int argc, return ret; } +static JSValue js_isKeyPressedRepeat(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + int key; + JS_ToInt32(ctx, &key, argv[0]); + bool returnVal = IsKeyPressedRepeat(key); + JSValue ret = JS_NewBool(ctx, returnVal); + return ret; +} + static JSValue js_isKeyDown(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int key; JS_ToInt32(ctx, &key, argv[0]); @@ -3608,13 +3769,6 @@ static JSValue js_isKeyUp(JSContext * ctx, JSValueConst this_val, int argc, JSVa return ret; } -static JSValue js_setExitKey(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - int key; - JS_ToInt32(ctx, &key, argv[0]); - SetExitKey(key); - return JS_UNDEFINED; -} - static JSValue js_getKeyPressed(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int returnVal = GetKeyPressed(); JSValue ret = JS_NewInt32(ctx, returnVal); @@ -3627,6 +3781,13 @@ static JSValue js_getCharPressed(JSContext * ctx, JSValueConst this_val, int arg return ret; } +static JSValue js_setExitKey(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + int key; + JS_ToInt32(ctx, &key, argv[0]); + SetExitKey(key); + return JS_UNDEFINED; +} + static JSValue js_isGamepadAvailable(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int gamepad; JS_ToInt32(ctx, &gamepad, argv[0]); @@ -3715,6 +3876,19 @@ static JSValue js_setGamepadMappings(JSContext * ctx, JSValueConst this_val, int return ret; } +static JSValue js_setGamepadVibration(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + int gamepad; + JS_ToInt32(ctx, &gamepad, argv[0]); + double _double_leftMotor; + JS_ToFloat64(ctx, &_double_leftMotor, argv[1]); + float leftMotor = (float)_double_leftMotor; + double _double_rightMotor; + JS_ToFloat64(ctx, &_double_rightMotor, argv[2]); + float rightMotor = (float)_double_rightMotor; + SetGamepadVibration(gamepad, leftMotor, rightMotor); + return JS_UNDEFINED; +} + static JSValue js_isMouseButtonPressed(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int button; JS_ToInt32(ctx, &button, argv[0]); @@ -3873,8 +4047,8 @@ static JSValue js_setGesturesEnabled(JSContext * ctx, JSValueConst this_val, int } static JSValue js_isGestureDetected(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - int gesture; - JS_ToInt32(ctx, &gesture, argv[0]); + unsigned int gesture; + JS_ToUint32(ctx, &gesture, argv[0]); bool returnVal = IsGestureDetected(gesture); JSValue ret = JS_NewBool(ctx, returnVal); return ret; @@ -3958,6 +4132,24 @@ static JSValue js_setShapesTexture(JSContext * ctx, JSValueConst this_val, int a return JS_UNDEFINED; } +static JSValue js_getShapesTexture(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Texture2D returnVal = GetShapesTexture(); + Texture2D* ret_ptr = (Texture2D*)js_malloc(ctx, sizeof(Texture2D)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Texture_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_getShapesTextureRectangle(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle returnVal = GetShapesTextureRectangle(); + Rectangle* ret_ptr = (Rectangle*)js_malloc(ctx, sizeof(Rectangle)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Rectangle_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + static JSValue js_drawPixel(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int posX; JS_ToInt32(ctx, &posX, argv[0]); @@ -4045,49 +4237,6 @@ static JSValue js_drawLineBezier(JSContext * ctx, JSValueConst this_val, int arg return JS_UNDEFINED; } -static JSValue js_drawLineBezierQuad(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Vector2* startPos_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); - if(startPos_ptr == NULL) return JS_EXCEPTION; - Vector2 startPos = *startPos_ptr; - Vector2* endPos_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); - if(endPos_ptr == NULL) return JS_EXCEPTION; - Vector2 endPos = *endPos_ptr; - Vector2* controlPos_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[2], js_Vector2_class_id); - if(controlPos_ptr == NULL) return JS_EXCEPTION; - Vector2 controlPos = *controlPos_ptr; - double _double_thick; - JS_ToFloat64(ctx, &_double_thick, argv[3]); - float thick = (float)_double_thick; - Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[4], js_Color_class_id); - if(color_ptr == NULL) return JS_EXCEPTION; - Color color = *color_ptr; - DrawLineBezierQuad(startPos, endPos, controlPos, thick, color); - return JS_UNDEFINED; -} - -static JSValue js_drawLineBezierCubic(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Vector2* startPos_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); - if(startPos_ptr == NULL) return JS_EXCEPTION; - Vector2 startPos = *startPos_ptr; - Vector2* endPos_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); - if(endPos_ptr == NULL) return JS_EXCEPTION; - Vector2 endPos = *endPos_ptr; - Vector2* startControlPos_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[2], js_Vector2_class_id); - if(startControlPos_ptr == NULL) return JS_EXCEPTION; - Vector2 startControlPos = *startControlPos_ptr; - Vector2* endControlPos_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[3], js_Vector2_class_id); - if(endControlPos_ptr == NULL) return JS_EXCEPTION; - Vector2 endControlPos = *endControlPos_ptr; - double _double_thick; - JS_ToFloat64(ctx, &_double_thick, argv[4]); - float thick = (float)_double_thick; - Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[5], js_Color_class_id); - if(color_ptr == NULL) return JS_EXCEPTION; - Color color = *color_ptr; - DrawLineBezierCubic(startPos, endPos, startControlPos, endControlPos, thick, color); - return JS_UNDEFINED; -} - static JSValue js_drawCircle(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int centerX; JS_ToInt32(ctx, ¢erX, argv[0]); @@ -4194,6 +4343,20 @@ static JSValue js_drawCircleLines(JSContext * ctx, JSValueConst this_val, int ar return JS_UNDEFINED; } +static JSValue js_drawCircleLinesV(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* center_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(center_ptr == NULL) return JS_EXCEPTION; + Vector2 center = *center_ptr; + double _double_radius; + JS_ToFloat64(ctx, &_double_radius, argv[1]); + float radius = (float)_double_radius; + Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[2], js_Color_class_id); + if(color_ptr == NULL) return JS_EXCEPTION; + Color color = *color_ptr; + DrawCircleLinesV(center, radius, color); + return JS_UNDEFINED; +} + static JSValue js_drawEllipse(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int centerX; JS_ToInt32(ctx, ¢erX, argv[0]); @@ -4555,6 +4718,298 @@ static JSValue js_drawPolyLinesEx(JSContext * ctx, JSValueConst this_val, int ar return JS_UNDEFINED; } +static JSValue js_drawSplineLinear(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* points = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(points == NULL) return JS_EXCEPTION; + int pointCount; + JS_ToInt32(ctx, &pointCount, argv[1]); + double _double_thick; + JS_ToFloat64(ctx, &_double_thick, argv[2]); + float thick = (float)_double_thick; + Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[3], js_Color_class_id); + if(color_ptr == NULL) return JS_EXCEPTION; + Color color = *color_ptr; + DrawSplineLinear(points, pointCount, thick, color); + return JS_UNDEFINED; +} + +static JSValue js_drawSplineBasis(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* points = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(points == NULL) return JS_EXCEPTION; + int pointCount; + JS_ToInt32(ctx, &pointCount, argv[1]); + double _double_thick; + JS_ToFloat64(ctx, &_double_thick, argv[2]); + float thick = (float)_double_thick; + Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[3], js_Color_class_id); + if(color_ptr == NULL) return JS_EXCEPTION; + Color color = *color_ptr; + DrawSplineBasis(points, pointCount, thick, color); + return JS_UNDEFINED; +} + +static JSValue js_drawSplineCatmullRom(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* points = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(points == NULL) return JS_EXCEPTION; + int pointCount; + JS_ToInt32(ctx, &pointCount, argv[1]); + double _double_thick; + JS_ToFloat64(ctx, &_double_thick, argv[2]); + float thick = (float)_double_thick; + Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[3], js_Color_class_id); + if(color_ptr == NULL) return JS_EXCEPTION; + Color color = *color_ptr; + DrawSplineCatmullRom(points, pointCount, thick, color); + return JS_UNDEFINED; +} + +static JSValue js_drawSplineBezierQuadratic(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* points = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(points == NULL) return JS_EXCEPTION; + int pointCount; + JS_ToInt32(ctx, &pointCount, argv[1]); + double _double_thick; + JS_ToFloat64(ctx, &_double_thick, argv[2]); + float thick = (float)_double_thick; + Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[3], js_Color_class_id); + if(color_ptr == NULL) return JS_EXCEPTION; + Color color = *color_ptr; + DrawSplineBezierQuadratic(points, pointCount, thick, color); + return JS_UNDEFINED; +} + +static JSValue js_drawSplineBezierCubic(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* points = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(points == NULL) return JS_EXCEPTION; + int pointCount; + JS_ToInt32(ctx, &pointCount, argv[1]); + double _double_thick; + JS_ToFloat64(ctx, &_double_thick, argv[2]); + float thick = (float)_double_thick; + Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[3], js_Color_class_id); + if(color_ptr == NULL) return JS_EXCEPTION; + Color color = *color_ptr; + DrawSplineBezierCubic(points, pointCount, thick, color); + return JS_UNDEFINED; +} + +static JSValue js_drawSplineSegmentLinear(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* p1_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(p1_ptr == NULL) return JS_EXCEPTION; + Vector2 p1 = *p1_ptr; + Vector2* p2_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(p2_ptr == NULL) return JS_EXCEPTION; + Vector2 p2 = *p2_ptr; + double _double_thick; + JS_ToFloat64(ctx, &_double_thick, argv[2]); + float thick = (float)_double_thick; + Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[3], js_Color_class_id); + if(color_ptr == NULL) return JS_EXCEPTION; + Color color = *color_ptr; + DrawSplineSegmentLinear(p1, p2, thick, color); + return JS_UNDEFINED; +} + +static JSValue js_drawSplineSegmentBasis(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* p1_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(p1_ptr == NULL) return JS_EXCEPTION; + Vector2 p1 = *p1_ptr; + Vector2* p2_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(p2_ptr == NULL) return JS_EXCEPTION; + Vector2 p2 = *p2_ptr; + Vector2* p3_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[2], js_Vector2_class_id); + if(p3_ptr == NULL) return JS_EXCEPTION; + Vector2 p3 = *p3_ptr; + Vector2* p4_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[3], js_Vector2_class_id); + if(p4_ptr == NULL) return JS_EXCEPTION; + Vector2 p4 = *p4_ptr; + double _double_thick; + JS_ToFloat64(ctx, &_double_thick, argv[4]); + float thick = (float)_double_thick; + Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[5], js_Color_class_id); + if(color_ptr == NULL) return JS_EXCEPTION; + Color color = *color_ptr; + DrawSplineSegmentBasis(p1, p2, p3, p4, thick, color); + return JS_UNDEFINED; +} + +static JSValue js_drawSplineSegmentCatmullRom(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* p1_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(p1_ptr == NULL) return JS_EXCEPTION; + Vector2 p1 = *p1_ptr; + Vector2* p2_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(p2_ptr == NULL) return JS_EXCEPTION; + Vector2 p2 = *p2_ptr; + Vector2* p3_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[2], js_Vector2_class_id); + if(p3_ptr == NULL) return JS_EXCEPTION; + Vector2 p3 = *p3_ptr; + Vector2* p4_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[3], js_Vector2_class_id); + if(p4_ptr == NULL) return JS_EXCEPTION; + Vector2 p4 = *p4_ptr; + double _double_thick; + JS_ToFloat64(ctx, &_double_thick, argv[4]); + float thick = (float)_double_thick; + Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[5], js_Color_class_id); + if(color_ptr == NULL) return JS_EXCEPTION; + Color color = *color_ptr; + DrawSplineSegmentCatmullRom(p1, p2, p3, p4, thick, color); + return JS_UNDEFINED; +} + +static JSValue js_drawSplineSegmentBezierQuadratic(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* p1_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(p1_ptr == NULL) return JS_EXCEPTION; + Vector2 p1 = *p1_ptr; + Vector2* c2_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(c2_ptr == NULL) return JS_EXCEPTION; + Vector2 c2 = *c2_ptr; + Vector2* p3_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[2], js_Vector2_class_id); + if(p3_ptr == NULL) return JS_EXCEPTION; + Vector2 p3 = *p3_ptr; + double _double_thick; + JS_ToFloat64(ctx, &_double_thick, argv[3]); + float thick = (float)_double_thick; + Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[4], js_Color_class_id); + if(color_ptr == NULL) return JS_EXCEPTION; + Color color = *color_ptr; + DrawSplineSegmentBezierQuadratic(p1, c2, p3, thick, color); + return JS_UNDEFINED; +} + +static JSValue js_drawSplineSegmentBezierCubic(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* p1_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(p1_ptr == NULL) return JS_EXCEPTION; + Vector2 p1 = *p1_ptr; + Vector2* c2_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(c2_ptr == NULL) return JS_EXCEPTION; + Vector2 c2 = *c2_ptr; + Vector2* c3_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[2], js_Vector2_class_id); + if(c3_ptr == NULL) return JS_EXCEPTION; + Vector2 c3 = *c3_ptr; + Vector2* p4_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[3], js_Vector2_class_id); + if(p4_ptr == NULL) return JS_EXCEPTION; + Vector2 p4 = *p4_ptr; + double _double_thick; + JS_ToFloat64(ctx, &_double_thick, argv[4]); + float thick = (float)_double_thick; + Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[5], js_Color_class_id); + if(color_ptr == NULL) return JS_EXCEPTION; + Color color = *color_ptr; + DrawSplineSegmentBezierCubic(p1, c2, c3, p4, thick, color); + return JS_UNDEFINED; +} + +static JSValue js_getSplinePointLinear(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* startPos_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(startPos_ptr == NULL) return JS_EXCEPTION; + Vector2 startPos = *startPos_ptr; + Vector2* endPos_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(endPos_ptr == NULL) return JS_EXCEPTION; + Vector2 endPos = *endPos_ptr; + double _double_t; + JS_ToFloat64(ctx, &_double_t, argv[2]); + float t = (float)_double_t; + Vector2 returnVal = GetSplinePointLinear(startPos, endPos, t); + Vector2* ret_ptr = (Vector2*)js_malloc(ctx, sizeof(Vector2)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector2_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_getSplinePointBasis(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* p1_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(p1_ptr == NULL) return JS_EXCEPTION; + Vector2 p1 = *p1_ptr; + Vector2* p2_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(p2_ptr == NULL) return JS_EXCEPTION; + Vector2 p2 = *p2_ptr; + Vector2* p3_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[2], js_Vector2_class_id); + if(p3_ptr == NULL) return JS_EXCEPTION; + Vector2 p3 = *p3_ptr; + Vector2* p4_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[3], js_Vector2_class_id); + if(p4_ptr == NULL) return JS_EXCEPTION; + Vector2 p4 = *p4_ptr; + double _double_t; + JS_ToFloat64(ctx, &_double_t, argv[4]); + float t = (float)_double_t; + Vector2 returnVal = GetSplinePointBasis(p1, p2, p3, p4, t); + Vector2* ret_ptr = (Vector2*)js_malloc(ctx, sizeof(Vector2)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector2_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_getSplinePointCatmullRom(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* p1_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(p1_ptr == NULL) return JS_EXCEPTION; + Vector2 p1 = *p1_ptr; + Vector2* p2_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(p2_ptr == NULL) return JS_EXCEPTION; + Vector2 p2 = *p2_ptr; + Vector2* p3_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[2], js_Vector2_class_id); + if(p3_ptr == NULL) return JS_EXCEPTION; + Vector2 p3 = *p3_ptr; + Vector2* p4_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[3], js_Vector2_class_id); + if(p4_ptr == NULL) return JS_EXCEPTION; + Vector2 p4 = *p4_ptr; + double _double_t; + JS_ToFloat64(ctx, &_double_t, argv[4]); + float t = (float)_double_t; + Vector2 returnVal = GetSplinePointCatmullRom(p1, p2, p3, p4, t); + Vector2* ret_ptr = (Vector2*)js_malloc(ctx, sizeof(Vector2)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector2_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_getSplinePointBezierQuad(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* p1_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(p1_ptr == NULL) return JS_EXCEPTION; + Vector2 p1 = *p1_ptr; + Vector2* c2_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(c2_ptr == NULL) return JS_EXCEPTION; + Vector2 c2 = *c2_ptr; + Vector2* p3_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[2], js_Vector2_class_id); + if(p3_ptr == NULL) return JS_EXCEPTION; + Vector2 p3 = *p3_ptr; + double _double_t; + JS_ToFloat64(ctx, &_double_t, argv[3]); + float t = (float)_double_t; + Vector2 returnVal = GetSplinePointBezierQuad(p1, c2, p3, t); + Vector2* ret_ptr = (Vector2*)js_malloc(ctx, sizeof(Vector2)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector2_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_getSplinePointBezierCubic(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* p1_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(p1_ptr == NULL) return JS_EXCEPTION; + Vector2 p1 = *p1_ptr; + Vector2* c2_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(c2_ptr == NULL) return JS_EXCEPTION; + Vector2 c2 = *c2_ptr; + Vector2* c3_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[2], js_Vector2_class_id); + if(c3_ptr == NULL) return JS_EXCEPTION; + Vector2 c3 = *c3_ptr; + Vector2* p4_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[3], js_Vector2_class_id); + if(p4_ptr == NULL) return JS_EXCEPTION; + Vector2 p4 = *p4_ptr; + double _double_t; + JS_ToFloat64(ctx, &_double_t, argv[4]); + float t = (float)_double_t; + Vector2 returnVal = GetSplinePointBezierCubic(p1, c2, c3, p4, t); + Vector2* ret_ptr = (Vector2*)js_malloc(ctx, sizeof(Vector2)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector2_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + static JSValue js_checkCollisionRecs(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Rectangle* rec1_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); if(rec1_ptr == NULL) return JS_EXCEPTION; @@ -4707,6 +5162,49 @@ static JSValue js_loadImageRaw(JSContext * ctx, JSValueConst this_val, int argc, return ret; } +static JSValue js_loadImageSvg(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + const char * fileNameOrString = (JS_IsNull(argv[0]) || JS_IsUndefined(argv[0])) ? NULL : (const char *)JS_ToCString(ctx, argv[0]); + int width; + JS_ToInt32(ctx, &width, argv[1]); + int height; + JS_ToInt32(ctx, &height, argv[2]); + Image returnVal = LoadImageSvg(fileNameOrString, width, height); + JS_FreeCString(ctx, fileNameOrString); + Image* ret_ptr = (Image*)js_malloc(ctx, sizeof(Image)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Image_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_loadImageAnimFromMemory(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + const char * fileType = (JS_IsNull(argv[0]) || JS_IsUndefined(argv[0])) ? NULL : (const char *)JS_ToCString(ctx, argv[0]); + size_t fileData_size; + void * fileData_js = (void *)JS_GetArrayBuffer(ctx, &fileData_size, argv[1]); + if(fileData_js == NULL) { + return JS_EXCEPTION; + } + const unsigned char * fileData = malloc(fileData_size); + memcpy((void *)fileData, (const void *)fileData_js, fileData_size); + int dataSize; + JS_ToInt32(ctx, &dataSize, argv[2]); + size_t frames_size; + void * frames_js = (void *)JS_GetArrayBuffer(ctx, &frames_size, argv[3]); + if(frames_js == NULL) { + return JS_EXCEPTION; + } + int * frames = malloc(frames_size); + memcpy((void *)frames, (const void *)frames_js, frames_size); + Image returnVal = LoadImageAnimFromMemory(fileType, fileData, dataSize, frames); + JS_FreeCString(ctx, fileType); + free((void *)fileData); + Image* ret_ptr = (Image*)js_malloc(ctx, sizeof(Image)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Image_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + static JSValue js_loadImageFromMemory(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { const char * fileType = (JS_IsNull(argv[0]) || JS_IsUndefined(argv[0])) ? NULL : (const char *)JS_ToCString(ctx, argv[0]); size_t fileData_size; @@ -4777,6 +5275,24 @@ static JSValue js_exportImage(JSContext * ctx, JSValueConst this_val, int argc, return ret; } +static JSValue js_exportImageToMemory(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Image* image_ptr = (Image*)JS_GetOpaque2(ctx, argv[0], js_Image_class_id); + if(image_ptr == NULL) return JS_EXCEPTION; + Image image = *image_ptr; + const char * fileType = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + size_t fileSize_size; + void * fileSize_js = (void *)JS_GetArrayBuffer(ctx, &fileSize_size, argv[2]); + if(fileSize_js == NULL) { + return JS_EXCEPTION; + } + int * fileSize = malloc(fileSize_size); + memcpy((void *)fileSize, (const void *)fileSize_js, fileSize_size); + unsigned char * returnVal = ExportImageToMemory(image, fileType, fileSize); + JS_FreeCString(ctx, fileType); + JSValue ret = JS_NewString(ctx, returnVal); + return ret; +} + static JSValue js_genImageColor(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int width; JS_ToInt32(ctx, &width, argv[0]); @@ -5091,6 +5607,22 @@ static JSValue js_imageBlurGaussian(JSContext * ctx, JSValueConst this_val, int return JS_UNDEFINED; } +static JSValue js_imageKernelConvolution(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Image* image = (Image*)JS_GetOpaque2(ctx, argv[0], js_Image_class_id); + if(image == NULL) return JS_EXCEPTION; + size_t kernel_size; + void * kernel_js = (void *)JS_GetArrayBuffer(ctx, &kernel_size, argv[1]); + if(kernel_js == NULL) { + return JS_EXCEPTION; + } + float* kernel = malloc(kernel_size); + memcpy((void *)kernel, (const void *)kernel_js, kernel_size); + int kernelSize; + JS_ToInt32(ctx, &kernelSize, argv[2]); + ImageKernelConvolution(image, kernel, kernelSize); + return JS_UNDEFINED; +} + static JSValue js_imageResize(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Image* image = (Image*)JS_GetOpaque2(ctx, argv[0], js_Image_class_id); if(image == NULL) return JS_EXCEPTION; @@ -5801,6 +6333,18 @@ static JSValue js_drawTextureNPatch(JSContext * ctx, JSValueConst this_val, int return JS_UNDEFINED; } +static JSValue js_colorIsEqual(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Color* col1_ptr = (Color*)JS_GetOpaque2(ctx, argv[0], js_Color_class_id); + if(col1_ptr == NULL) return JS_EXCEPTION; + Color col1 = *col1_ptr; + Color* col2_ptr = (Color*)JS_GetOpaque2(ctx, argv[1], js_Color_class_id); + if(col2_ptr == NULL) return JS_EXCEPTION; + Color col2 = *col2_ptr; + bool returnVal = ColorIsEqual(col1, col2); + JSValue ret = JS_NewBool(ctx, returnVal); + return ret; +} + static JSValue js_fade(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[0], js_Color_class_id); if(color_ptr == NULL) return JS_EXCEPTION; @@ -6141,6 +6685,13 @@ static JSValue js_drawTextCodepoint(JSContext * ctx, JSValueConst this_val, int return JS_UNDEFINED; } +static JSValue js_setTextLineSpacing(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + int spacing; + JS_ToInt32(ctx, &spacing, argv[0]); + SetTextLineSpacing(spacing); + return JS_UNDEFINED; +} + static JSValue js_measureText(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { const char * text = (JS_IsNull(argv[0]) || JS_IsUndefined(argv[0])) ? NULL : (const char *)JS_ToCString(ctx, argv[0]); int fontSize; @@ -6826,17 +7377,6 @@ static JSValue js_drawMeshInstanced(JSContext * ctx, JSValueConst this_val, int return JS_UNDEFINED; } -static JSValue js_exportMesh(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Mesh* mesh_ptr = (Mesh*)JS_GetOpaque2(ctx, argv[0], js_Mesh_class_id); - if(mesh_ptr == NULL) return JS_EXCEPTION; - Mesh mesh = *mesh_ptr; - const char * fileName = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - bool returnVal = ExportMesh(mesh, fileName); - JS_FreeCString(ctx, fileName); - JSValue ret = JS_NewBool(ctx, returnVal); - return ret; -} - static JSValue js_getMeshBoundingBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Mesh* mesh_ptr = (Mesh*)JS_GetOpaque2(ctx, argv[0], js_Mesh_class_id); if(mesh_ptr == NULL) return JS_EXCEPTION; @@ -6856,6 +7396,28 @@ static JSValue js_genMeshTangents(JSContext * ctx, JSValueConst this_val, int ar return JS_UNDEFINED; } +static JSValue js_exportMesh(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Mesh* mesh_ptr = (Mesh*)JS_GetOpaque2(ctx, argv[0], js_Mesh_class_id); + if(mesh_ptr == NULL) return JS_EXCEPTION; + Mesh mesh = *mesh_ptr; + const char * fileName = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + bool returnVal = ExportMesh(mesh, fileName); + JS_FreeCString(ctx, fileName); + JSValue ret = JS_NewBool(ctx, returnVal); + return ret; +} + +static JSValue js_exportMeshAsCode(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Mesh* mesh_ptr = (Mesh*)JS_GetOpaque2(ctx, argv[0], js_Mesh_class_id); + if(mesh_ptr == NULL) return JS_EXCEPTION; + Mesh mesh = *mesh_ptr; + const char * fileName = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + bool returnVal = ExportMeshAsCode(mesh, fileName); + JS_FreeCString(ctx, fileName); + JSValue ret = JS_NewBool(ctx, returnVal); + return ret; +} + static JSValue js_genMeshPoly(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int sides; JS_ToInt32(ctx, &sides, argv[0]); @@ -7255,6 +7817,12 @@ static JSValue js_setMasterVolume(JSContext * ctx, JSValueConst this_val, int ar return JS_UNDEFINED; } +static JSValue js_getMasterVolume(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + float returnVal = GetMasterVolume(); + JSValue ret = JS_NewFloat64(ctx, returnVal); + return ret; +} + static JSValue js_loadWave(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { const char * fileName = (JS_IsNull(argv[0]) || JS_IsUndefined(argv[0])) ? NULL : (const char *)JS_ToCString(ctx, argv[0]); Wave returnVal = LoadWave(fileName); @@ -7319,6 +7887,18 @@ static JSValue js_loadSoundFromWave(JSContext * ctx, JSValueConst this_val, int return ret; } +static JSValue js_loadSoundAlias(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Sound* source_ptr = (Sound*)JS_GetOpaque2(ctx, argv[0], js_Sound_class_id); + if(source_ptr == NULL) return JS_EXCEPTION; + Sound source = *source_ptr; + Sound returnVal = LoadSoundAlias(source); + Sound* ret_ptr = (Sound*)js_malloc(ctx, sizeof(Sound)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Sound_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + static JSValue js_isSoundReady(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Sound* sound_ptr = (Sound*)JS_GetOpaque2(ctx, argv[0], js_Sound_class_id); if(sound_ptr == NULL) return JS_EXCEPTION; @@ -7362,6 +7942,14 @@ static JSValue js_unloadSound(JSContext * ctx, JSValueConst this_val, int argc, return JS_UNDEFINED; } +static JSValue js_unloadSoundAlias(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Sound* alias_ptr = (Sound*)JS_GetOpaque2(ctx, argv[0], js_Sound_class_id); + if(alias_ptr == NULL) return JS_EXCEPTION; + Sound alias = *alias_ptr; + UnloadSoundAlias(alias); + return JS_UNDEFINED; +} + static JSValue js_exportWave(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Wave* wave_ptr = (Wave*)JS_GetOpaque2(ctx, argv[0], js_Wave_class_id); if(wave_ptr == NULL) return JS_EXCEPTION; @@ -7988,6 +8576,36 @@ static JSValue js_vector2Reflect(JSContext * ctx, JSValueConst this_val, int arg return ret; } +static JSValue js_vector2Min(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* v1_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(v1_ptr == NULL) return JS_EXCEPTION; + Vector2 v1 = *v1_ptr; + Vector2* v2_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(v2_ptr == NULL) return JS_EXCEPTION; + Vector2 v2 = *v2_ptr; + Vector2 returnVal = Vector2Min(v1, v2); + Vector2* ret_ptr = (Vector2*)js_malloc(ctx, sizeof(Vector2)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector2_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_vector2Max(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* v1_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(v1_ptr == NULL) return JS_EXCEPTION; + Vector2 v1 = *v1_ptr; + Vector2* v2_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(v2_ptr == NULL) return JS_EXCEPTION; + Vector2 v2 = *v2_ptr; + Vector2 returnVal = Vector2Max(v1, v2); + Vector2* ret_ptr = (Vector2*)js_malloc(ctx, sizeof(Vector2)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector2_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + static JSValue js_vector2Rotate(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Vector2* v_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); if(v_ptr == NULL) return JS_EXCEPTION; @@ -8081,6 +8699,24 @@ static JSValue js_vector2Equals(JSContext * ctx, JSValueConst this_val, int argc return ret; } +static JSValue js_vector2Refract(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector2* v_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[0], js_Vector2_class_id); + if(v_ptr == NULL) return JS_EXCEPTION; + Vector2 v = *v_ptr; + Vector2* n_ptr = (Vector2*)JS_GetOpaque2(ctx, argv[1], js_Vector2_class_id); + if(n_ptr == NULL) return JS_EXCEPTION; + Vector2 n = *n_ptr; + double _double_r; + JS_ToFloat64(ctx, &_double_r, argv[2]); + float r = (float)_double_r; + Vector2 returnVal = Vector2Refract(v, n, r); + Vector2* ret_ptr = (Vector2*)js_malloc(ctx, sizeof(Vector2)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector2_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + static JSValue js_vector3Zero(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Vector3 returnVal = Vector3Zero(); Vector3* ret_ptr = (Vector3*)js_malloc(ctx, sizeof(Vector3)); @@ -8321,6 +8957,36 @@ static JSValue js_vector3Normalize(JSContext * ctx, JSValueConst this_val, int a return ret; } +static JSValue js_vector3Project(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector3* v1_ptr = (Vector3*)JS_GetOpaque2(ctx, argv[0], js_Vector3_class_id); + if(v1_ptr == NULL) return JS_EXCEPTION; + Vector3 v1 = *v1_ptr; + Vector3* v2_ptr = (Vector3*)JS_GetOpaque2(ctx, argv[1], js_Vector3_class_id); + if(v2_ptr == NULL) return JS_EXCEPTION; + Vector3 v2 = *v2_ptr; + Vector3 returnVal = Vector3Project(v1, v2); + Vector3* ret_ptr = (Vector3*)js_malloc(ctx, sizeof(Vector3)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector3_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_vector3Reject(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector3* v1_ptr = (Vector3*)JS_GetOpaque2(ctx, argv[0], js_Vector3_class_id); + if(v1_ptr == NULL) return JS_EXCEPTION; + Vector3 v1 = *v1_ptr; + Vector3* v2_ptr = (Vector3*)JS_GetOpaque2(ctx, argv[1], js_Vector3_class_id); + if(v2_ptr == NULL) return JS_EXCEPTION; + Vector3 v2 = *v2_ptr; + Vector3 returnVal = Vector3Reject(v1, v2); + Vector3* ret_ptr = (Vector3*)js_malloc(ctx, sizeof(Vector3)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector3_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + static JSValue js_vector3Transform(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Vector3* v_ptr = (Vector3*)JS_GetOpaque2(ctx, argv[0], js_Vector3_class_id); if(v_ptr == NULL) return JS_EXCEPTION; @@ -8369,6 +9035,24 @@ static JSValue js_vector3RotateByAxisAngle(JSContext * ctx, JSValueConst this_va return ret; } +static JSValue js_vector3MoveTowards(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector3* v_ptr = (Vector3*)JS_GetOpaque2(ctx, argv[0], js_Vector3_class_id); + if(v_ptr == NULL) return JS_EXCEPTION; + Vector3 v = *v_ptr; + Vector3* target_ptr = (Vector3*)JS_GetOpaque2(ctx, argv[1], js_Vector3_class_id); + if(target_ptr == NULL) return JS_EXCEPTION; + Vector3 target = *target_ptr; + double _double_maxDistance; + JS_ToFloat64(ctx, &_double_maxDistance, argv[2]); + float maxDistance = (float)_double_maxDistance; + Vector3 returnVal = Vector3MoveTowards(v, target, maxDistance); + Vector3* ret_ptr = (Vector3*)js_malloc(ctx, sizeof(Vector3)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector3_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + static JSValue js_vector3Lerp(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Vector3* v1_ptr = (Vector3*)JS_GetOpaque2(ctx, argv[0], js_Vector3_class_id); if(v1_ptr == NULL) return JS_EXCEPTION; @@ -8549,6 +9233,174 @@ static JSValue js_vector3Refract(JSContext * ctx, JSValueConst this_val, int arg return ret; } +static JSValue js_vector4Distance(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* v1_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(v1_ptr == NULL) return JS_EXCEPTION; + Vector4 v1 = *v1_ptr; + Vector4* v2_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[1], js_Vector4_class_id); + if(v2_ptr == NULL) return JS_EXCEPTION; + Vector4 v2 = *v2_ptr; + float returnVal = Vector4Distance(v1, v2); + JSValue ret = JS_NewFloat64(ctx, returnVal); + return ret; +} + +static JSValue js_vector4DistanceSqr(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* v1_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(v1_ptr == NULL) return JS_EXCEPTION; + Vector4 v1 = *v1_ptr; + Vector4* v2_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[1], js_Vector4_class_id); + if(v2_ptr == NULL) return JS_EXCEPTION; + Vector4 v2 = *v2_ptr; + float returnVal = Vector4DistanceSqr(v1, v2); + JSValue ret = JS_NewFloat64(ctx, returnVal); + return ret; +} + +static JSValue js_vector4Multiply(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* v1_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(v1_ptr == NULL) return JS_EXCEPTION; + Vector4 v1 = *v1_ptr; + Vector4* v2_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[1], js_Vector4_class_id); + if(v2_ptr == NULL) return JS_EXCEPTION; + Vector4 v2 = *v2_ptr; + Vector4 returnVal = Vector4Multiply(v1, v2); + Vector4* ret_ptr = (Vector4*)js_malloc(ctx, sizeof(Vector4)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector4_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_vector4Negate(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* v_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(v_ptr == NULL) return JS_EXCEPTION; + Vector4 v = *v_ptr; + Vector4 returnVal = Vector4Negate(v); + Vector4* ret_ptr = (Vector4*)js_malloc(ctx, sizeof(Vector4)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector4_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_vector4Divide(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* v1_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(v1_ptr == NULL) return JS_EXCEPTION; + Vector4 v1 = *v1_ptr; + Vector4* v2_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[1], js_Vector4_class_id); + if(v2_ptr == NULL) return JS_EXCEPTION; + Vector4 v2 = *v2_ptr; + Vector4 returnVal = Vector4Divide(v1, v2); + Vector4* ret_ptr = (Vector4*)js_malloc(ctx, sizeof(Vector4)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector4_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_vector4Normalize(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* v_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(v_ptr == NULL) return JS_EXCEPTION; + Vector4 v = *v_ptr; + Vector4 returnVal = Vector4Normalize(v); + Vector4* ret_ptr = (Vector4*)js_malloc(ctx, sizeof(Vector4)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector4_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_vector4Min(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* v1_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(v1_ptr == NULL) return JS_EXCEPTION; + Vector4 v1 = *v1_ptr; + Vector4* v2_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[1], js_Vector4_class_id); + if(v2_ptr == NULL) return JS_EXCEPTION; + Vector4 v2 = *v2_ptr; + Vector4 returnVal = Vector4Min(v1, v2); + Vector4* ret_ptr = (Vector4*)js_malloc(ctx, sizeof(Vector4)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector4_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_vector4Max(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* v1_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(v1_ptr == NULL) return JS_EXCEPTION; + Vector4 v1 = *v1_ptr; + Vector4* v2_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[1], js_Vector4_class_id); + if(v2_ptr == NULL) return JS_EXCEPTION; + Vector4 v2 = *v2_ptr; + Vector4 returnVal = Vector4Max(v1, v2); + Vector4* ret_ptr = (Vector4*)js_malloc(ctx, sizeof(Vector4)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector4_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_vector4Lerp(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* v1_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(v1_ptr == NULL) return JS_EXCEPTION; + Vector4 v1 = *v1_ptr; + Vector4* v2_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[1], js_Vector4_class_id); + if(v2_ptr == NULL) return JS_EXCEPTION; + Vector4 v2 = *v2_ptr; + double _double_amount; + JS_ToFloat64(ctx, &_double_amount, argv[2]); + float amount = (float)_double_amount; + Vector4 returnVal = Vector4Lerp(v1, v2, amount); + Vector4* ret_ptr = (Vector4*)js_malloc(ctx, sizeof(Vector4)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector4_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_vector4MoveTowards(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* v_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(v_ptr == NULL) return JS_EXCEPTION; + Vector4 v = *v_ptr; + Vector4* target_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[1], js_Vector4_class_id); + if(target_ptr == NULL) return JS_EXCEPTION; + Vector4 target = *target_ptr; + double _double_maxDistance; + JS_ToFloat64(ctx, &_double_maxDistance, argv[2]); + float maxDistance = (float)_double_maxDistance; + Vector4 returnVal = Vector4MoveTowards(v, target, maxDistance); + Vector4* ret_ptr = (Vector4*)js_malloc(ctx, sizeof(Vector4)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector4_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_vector4Invert(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* v_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(v_ptr == NULL) return JS_EXCEPTION; + Vector4 v = *v_ptr; + Vector4 returnVal = Vector4Invert(v); + Vector4* ret_ptr = (Vector4*)js_malloc(ctx, sizeof(Vector4)); + *ret_ptr = returnVal; + JSValue ret = JS_NewObjectClass(ctx, js_Vector4_class_id); + JS_SetOpaque(ret, ret_ptr); + return ret; +} + +static JSValue js_vector4Equals(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Vector4* p_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[0], js_Vector4_class_id); + if(p_ptr == NULL) return JS_EXCEPTION; + Vector4 p = *p_ptr; + Vector4* q_ptr = (Vector4*)JS_GetOpaque2(ctx, argv[1], js_Vector4_class_id); + if(q_ptr == NULL) return JS_EXCEPTION; + Vector4 q = *q_ptr; + int returnVal = Vector4Equals(p, q); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + static JSValue js_matrixDeterminant(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { Matrix* mat_ptr = (Matrix*)JS_GetOpaque2(ctx, argv[0], js_Matrix_class_id); if(mat_ptr == NULL) return JS_EXCEPTION; @@ -9305,11 +10157,11 @@ static JSValue js_guiIsLocked(JSContext * ctx, JSValueConst this_val, int argc, return ret; } -static JSValue js_guiFade(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { +static JSValue js_guiSetAlpha(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { double _double_alpha; JS_ToFloat64(ctx, &_double_alpha, argv[0]); float alpha = (float)_double_alpha; - GuiFade(alpha); + GuiSetAlpha(alpha); return JS_UNDEFINED; } @@ -9364,480 +10216,6 @@ static JSValue js_guiGetStyle(JSContext * ctx, JSValueConst this_val, int argc, return ret; } -static JSValue js_guiWindowBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * title = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - bool returnVal = GuiWindowBox(bounds, title); - JS_FreeCString(ctx, title); - JSValue ret = JS_NewBool(ctx, returnVal); - return ret; -} - -static JSValue js_guiGroupBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - GuiGroupBox(bounds, text); - JS_FreeCString(ctx, text); - return JS_UNDEFINED; -} - -static JSValue js_guiLine(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - GuiLine(bounds, text); - JS_FreeCString(ctx, text); - return JS_UNDEFINED; -} - -static JSValue js_guiPanel(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - GuiPanel(bounds, text); - JS_FreeCString(ctx, text); - return JS_UNDEFINED; -} - -static JSValue js_guiScrollPanel(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - Rectangle* content_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[2], js_Rectangle_class_id); - if(content_ptr == NULL) return JS_EXCEPTION; - Rectangle content = *content_ptr; - Vector2* scroll = (Vector2*)JS_GetOpaque2(ctx, argv[3], js_Vector2_class_id); - if(scroll == NULL) return JS_EXCEPTION; - Rectangle returnVal = GuiScrollPanel(bounds, text, content, scroll); - JS_FreeCString(ctx, text); - Rectangle* ret_ptr = (Rectangle*)js_malloc(ctx, sizeof(Rectangle)); - *ret_ptr = returnVal; - JSValue ret = JS_NewObjectClass(ctx, js_Rectangle_class_id); - JS_SetOpaque(ret, ret_ptr); - return ret; -} - -static JSValue js_guiLabel(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - GuiLabel(bounds, text); - JS_FreeCString(ctx, text); - return JS_UNDEFINED; -} - -static JSValue js_guiButton(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - bool returnVal = GuiButton(bounds, text); - JS_FreeCString(ctx, text); - JSValue ret = JS_NewBool(ctx, returnVal); - return ret; -} - -static JSValue js_guiLabelButton(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - bool returnVal = GuiLabelButton(bounds, text); - JS_FreeCString(ctx, text); - JSValue ret = JS_NewBool(ctx, returnVal); - return ret; -} - -static JSValue js_guiToggle(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - bool active = JS_ToBool(ctx, argv[2]); - bool returnVal = GuiToggle(bounds, text, active); - JS_FreeCString(ctx, text); - JSValue ret = JS_NewBool(ctx, returnVal); - return ret; -} - -static JSValue js_guiToggleGroup(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - int active; - JS_ToInt32(ctx, &active, argv[2]); - int returnVal = GuiToggleGroup(bounds, text, active); - JS_FreeCString(ctx, text); - JSValue ret = JS_NewInt32(ctx, returnVal); - return ret; -} - -static JSValue js_guiCheckBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - bool checked = JS_ToBool(ctx, argv[2]); - bool returnVal = GuiCheckBox(bounds, text, checked); - JS_FreeCString(ctx, text); - JSValue ret = JS_NewBool(ctx, returnVal); - return ret; -} - -static JSValue js_guiComboBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - int active; - JS_ToInt32(ctx, &active, argv[2]); - int returnVal = GuiComboBox(bounds, text, active); - JS_FreeCString(ctx, text); - JSValue ret = JS_NewInt32(ctx, returnVal); - return ret; -} - -static JSValue js_guiDropdownBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - int * active = NULL; - int active_out; - if(!JS_IsNull(argv[2])) { - active = &active_out; - JSValue active_js = JS_GetPropertyStr(ctx, argv[2], "active"); - JS_ToInt32(ctx, active, active_js); - } - bool editMode = JS_ToBool(ctx, argv[3]); - bool returnVal = GuiDropdownBox(bounds, text, active, editMode); - JS_FreeCString(ctx, text); - if(!JS_IsNull(argv[2])) { - JS_SetPropertyStr(ctx, argv[2], "active", JS_NewInt32(ctx,active_out)); - } - JSValue ret = JS_NewBool(ctx, returnVal); - return ret; -} - -static JSValue js_guiSpinner(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - int * value = NULL; - int value_out; - if(!JS_IsNull(argv[2])) { - value = &value_out; - JSValue value_js = JS_GetPropertyStr(ctx, argv[2], "value"); - JS_ToInt32(ctx, value, value_js); - } - int minValue; - JS_ToInt32(ctx, &minValue, argv[3]); - int maxValue; - JS_ToInt32(ctx, &maxValue, argv[4]); - bool editMode = JS_ToBool(ctx, argv[5]); - bool returnVal = GuiSpinner(bounds, text, value, minValue, maxValue, editMode); - JS_FreeCString(ctx, text); - if(!JS_IsNull(argv[2])) { - JS_SetPropertyStr(ctx, argv[2], "value", JS_NewInt32(ctx,value_out)); - } - JSValue ret = JS_NewBool(ctx, returnVal); - return ret; -} - -static JSValue js_guiValueBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - int * value = NULL; - int value_out; - if(!JS_IsNull(argv[2])) { - value = &value_out; - JSValue value_js = JS_GetPropertyStr(ctx, argv[2], "value"); - JS_ToInt32(ctx, value, value_js); - } - int minValue; - JS_ToInt32(ctx, &minValue, argv[3]); - int maxValue; - JS_ToInt32(ctx, &maxValue, argv[4]); - bool editMode = JS_ToBool(ctx, argv[5]); - bool returnVal = GuiValueBox(bounds, text, value, minValue, maxValue, editMode); - JS_FreeCString(ctx, text); - if(!JS_IsNull(argv[2])) { - JS_SetPropertyStr(ctx, argv[2], "value", JS_NewInt32(ctx,value_out)); - } - JSValue ret = JS_NewBool(ctx, returnVal); - return ret; -} - -static JSValue js_guiTextBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - JSValue text_js = JS_GetPropertyStr(ctx, argv[1], "text"); - size_t text_len; - const char * text_val = JS_ToCStringLen(ctx, &text_len, text_js); - memcpy((void *)textbuffer, text_val, text_len); - textbuffer[text_len] = 0; - char * text = textbuffer; - int textSize = 4096; - bool editMode = JS_ToBool(ctx, argv[2]); - bool returnVal = GuiTextBox(bounds, text, textSize, editMode); - JS_FreeCString(ctx, text_val); - JS_SetPropertyStr(ctx, argv[1], "text", JS_NewString(ctx,text)); - JSValue ret = JS_NewBool(ctx, returnVal); - return ret; -} - -static JSValue js_guiSlider(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * textLeft = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - const char * textRight = (JS_IsNull(argv[2]) || JS_IsUndefined(argv[2])) ? NULL : (const char *)JS_ToCString(ctx, argv[2]); - double _double_value; - JS_ToFloat64(ctx, &_double_value, argv[3]); - float value = (float)_double_value; - double _double_minValue; - JS_ToFloat64(ctx, &_double_minValue, argv[4]); - float minValue = (float)_double_minValue; - double _double_maxValue; - JS_ToFloat64(ctx, &_double_maxValue, argv[5]); - float maxValue = (float)_double_maxValue; - float returnVal = GuiSlider(bounds, textLeft, textRight, value, minValue, maxValue); - JS_FreeCString(ctx, textLeft); - JS_FreeCString(ctx, textRight); - JSValue ret = JS_NewFloat64(ctx, returnVal); - return ret; -} - -static JSValue js_guiSliderBar(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * textLeft = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - const char * textRight = (JS_IsNull(argv[2]) || JS_IsUndefined(argv[2])) ? NULL : (const char *)JS_ToCString(ctx, argv[2]); - double _double_value; - JS_ToFloat64(ctx, &_double_value, argv[3]); - float value = (float)_double_value; - double _double_minValue; - JS_ToFloat64(ctx, &_double_minValue, argv[4]); - float minValue = (float)_double_minValue; - double _double_maxValue; - JS_ToFloat64(ctx, &_double_maxValue, argv[5]); - float maxValue = (float)_double_maxValue; - float returnVal = GuiSliderBar(bounds, textLeft, textRight, value, minValue, maxValue); - JS_FreeCString(ctx, textLeft); - JS_FreeCString(ctx, textRight); - JSValue ret = JS_NewFloat64(ctx, returnVal); - return ret; -} - -static JSValue js_guiProgressBar(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * textLeft = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - const char * textRight = (JS_IsNull(argv[2]) || JS_IsUndefined(argv[2])) ? NULL : (const char *)JS_ToCString(ctx, argv[2]); - double _double_value; - JS_ToFloat64(ctx, &_double_value, argv[3]); - float value = (float)_double_value; - double _double_minValue; - JS_ToFloat64(ctx, &_double_minValue, argv[4]); - float minValue = (float)_double_minValue; - double _double_maxValue; - JS_ToFloat64(ctx, &_double_maxValue, argv[5]); - float maxValue = (float)_double_maxValue; - float returnVal = GuiProgressBar(bounds, textLeft, textRight, value, minValue, maxValue); - JS_FreeCString(ctx, textLeft); - JS_FreeCString(ctx, textRight); - JSValue ret = JS_NewFloat64(ctx, returnVal); - return ret; -} - -static JSValue js_guiStatusBar(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - GuiStatusBar(bounds, text); - JS_FreeCString(ctx, text); - return JS_UNDEFINED; -} - -static JSValue js_guiDummyRec(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - GuiDummyRec(bounds, text); - JS_FreeCString(ctx, text); - return JS_UNDEFINED; -} - -static JSValue js_guiGrid(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - double _double_spacing; - JS_ToFloat64(ctx, &_double_spacing, argv[2]); - float spacing = (float)_double_spacing; - int subdivs; - JS_ToInt32(ctx, &subdivs, argv[3]); - Vector2 returnVal = GuiGrid(bounds, text, spacing, subdivs); - JS_FreeCString(ctx, text); - Vector2* ret_ptr = (Vector2*)js_malloc(ctx, sizeof(Vector2)); - *ret_ptr = returnVal; - JSValue ret = JS_NewObjectClass(ctx, js_Vector2_class_id); - JS_SetOpaque(ret, ret_ptr); - return ret; -} - -static JSValue js_guiListView(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - int * scrollIndex = NULL; - int scrollIndex_out; - if(!JS_IsNull(argv[2])) { - scrollIndex = &scrollIndex_out; - JSValue scrollIndex_js = JS_GetPropertyStr(ctx, argv[2], "scrollIndex"); - JS_ToInt32(ctx, scrollIndex, scrollIndex_js); - } - int active; - JS_ToInt32(ctx, &active, argv[3]); - int returnVal = GuiListView(bounds, text, scrollIndex, active); - JS_FreeCString(ctx, text); - if(!JS_IsNull(argv[2])) { - JS_SetPropertyStr(ctx, argv[2], "scrollIndex", JS_NewInt32(ctx,scrollIndex_out)); - } - JSValue ret = JS_NewInt32(ctx, returnVal); - return ret; -} - -static JSValue js_guiMessageBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * title = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - const char * message = (JS_IsNull(argv[2]) || JS_IsUndefined(argv[2])) ? NULL : (const char *)JS_ToCString(ctx, argv[2]); - const char * buttons = (JS_IsNull(argv[3]) || JS_IsUndefined(argv[3])) ? NULL : (const char *)JS_ToCString(ctx, argv[3]); - int returnVal = GuiMessageBox(bounds, title, message, buttons); - JS_FreeCString(ctx, title); - JS_FreeCString(ctx, message); - JS_FreeCString(ctx, buttons); - JSValue ret = JS_NewInt32(ctx, returnVal); - return ret; -} - -static JSValue js_guiTextInputBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * title = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - const char * message = (JS_IsNull(argv[2]) || JS_IsUndefined(argv[2])) ? NULL : (const char *)JS_ToCString(ctx, argv[2]); - const char * buttons = (JS_IsNull(argv[3]) || JS_IsUndefined(argv[3])) ? NULL : (const char *)JS_ToCString(ctx, argv[3]); - JSValue text_js = JS_GetPropertyStr(ctx, argv[4], "text"); - size_t text_len; - const char * text_val = JS_ToCStringLen(ctx, &text_len, text_js); - memcpy((void *)textbuffer, text_val, text_len); - textbuffer[text_len] = 0; - char * text = textbuffer; - int textMaxSize = 4096; - int * secretViewActive = NULL; - int secretViewActive_out; - if(!JS_IsNull(argv[5])) { - secretViewActive = &secretViewActive_out; - JSValue secretViewActive_js = JS_GetPropertyStr(ctx, argv[5], "secretViewActive"); - JS_ToInt32(ctx, secretViewActive, secretViewActive_js); - } - int returnVal = GuiTextInputBox(bounds, title, message, buttons, text, textMaxSize, secretViewActive); - JS_FreeCString(ctx, title); - JS_FreeCString(ctx, message); - JS_FreeCString(ctx, buttons); - JS_FreeCString(ctx, text_val); - JS_SetPropertyStr(ctx, argv[4], "text", JS_NewString(ctx,text)); - if(!JS_IsNull(argv[5])) { - JS_SetPropertyStr(ctx, argv[5], "secretViewActive", JS_NewInt32(ctx,secretViewActive_out)); - } - JSValue ret = JS_NewInt32(ctx, returnVal); - return ret; -} - -static JSValue js_guiColorPicker(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[2], js_Color_class_id); - if(color_ptr == NULL) return JS_EXCEPTION; - Color color = *color_ptr; - Color returnVal = GuiColorPicker(bounds, text, color); - JS_FreeCString(ctx, text); - Color* ret_ptr = (Color*)js_malloc(ctx, sizeof(Color)); - *ret_ptr = returnVal; - JSValue ret = JS_NewObjectClass(ctx, js_Color_class_id); - JS_SetOpaque(ret, ret_ptr); - return ret; -} - -static JSValue js_guiColorPanel(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - Color* color_ptr = (Color*)JS_GetOpaque2(ctx, argv[2], js_Color_class_id); - if(color_ptr == NULL) return JS_EXCEPTION; - Color color = *color_ptr; - Color returnVal = GuiColorPanel(bounds, text, color); - JS_FreeCString(ctx, text); - Color* ret_ptr = (Color*)js_malloc(ctx, sizeof(Color)); - *ret_ptr = returnVal; - JSValue ret = JS_NewObjectClass(ctx, js_Color_class_id); - JS_SetOpaque(ret, ret_ptr); - return ret; -} - -static JSValue js_guiColorBarAlpha(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - double _double_alpha; - JS_ToFloat64(ctx, &_double_alpha, argv[2]); - float alpha = (float)_double_alpha; - float returnVal = GuiColorBarAlpha(bounds, text, alpha); - JS_FreeCString(ctx, text); - JSValue ret = JS_NewFloat64(ctx, returnVal); - return ret; -} - -static JSValue js_guiColorBarHue(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { - Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); - if(bounds_ptr == NULL) return JS_EXCEPTION; - Rectangle bounds = *bounds_ptr; - const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); - double _double_value; - JS_ToFloat64(ctx, &_double_value, argv[2]); - float value = (float)_double_value; - float returnVal = GuiColorBarHue(bounds, text, value); - JS_FreeCString(ctx, text); - JSValue ret = JS_NewFloat64(ctx, returnVal); - return ret; -} - static JSValue js_guiLoadStyle(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { const char * fileName = (JS_IsNull(argv[0]) || JS_IsUndefined(argv[0])) ? NULL : (const char *)JS_ToCString(ctx, argv[0]); GuiLoadStyle(fileName); @@ -9900,6 +10278,572 @@ static JSValue js_guiDrawIcon(JSContext * ctx, JSValueConst this_val, int argc, return JS_UNDEFINED; } +static JSValue js_guiWindowBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * title = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int returnVal = GuiWindowBox(bounds, title); + JS_FreeCString(ctx, title); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiGroupBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int returnVal = GuiGroupBox(bounds, text); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiLine(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int returnVal = GuiLine(bounds, text); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiPanel(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int returnVal = GuiPanel(bounds, text); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiScrollPanel(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + Rectangle* content_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[2], js_Rectangle_class_id); + if(content_ptr == NULL) return JS_EXCEPTION; + Rectangle content = *content_ptr; + Vector2* scroll = (Vector2*)JS_GetOpaque2(ctx, argv[3], js_Vector2_class_id); + if(scroll == NULL) return JS_EXCEPTION; + Rectangle* view = (Rectangle*)JS_GetOpaque2(ctx, argv[4], js_Rectangle_class_id); + if(view == NULL) return JS_EXCEPTION; + int returnVal = GuiScrollPanel(bounds, text, content, scroll, view); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiLabel(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int returnVal = GuiLabel(bounds, text); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiButton(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int returnVal = GuiButton(bounds, text); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiLabelButton(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int returnVal = GuiLabelButton(bounds, text); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiToggle(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + size_t active_size; + void * active_js = (void *)JS_GetArrayBuffer(ctx, &active_size, argv[2]); + if(active_js == NULL) { + return JS_EXCEPTION; + } + bool * active = malloc(active_size); + memcpy((void *)active, (const void *)active_js, active_size); + int returnVal = GuiToggle(bounds, text, active); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiToggleGroup(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + size_t active_size; + void * active_js = (void *)JS_GetArrayBuffer(ctx, &active_size, argv[2]); + if(active_js == NULL) { + return JS_EXCEPTION; + } + int * active = malloc(active_size); + memcpy((void *)active, (const void *)active_js, active_size); + int returnVal = GuiToggleGroup(bounds, text, active); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiToggleSlider(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + size_t active_size; + void * active_js = (void *)JS_GetArrayBuffer(ctx, &active_size, argv[2]); + if(active_js == NULL) { + return JS_EXCEPTION; + } + int * active = malloc(active_size); + memcpy((void *)active, (const void *)active_js, active_size); + int returnVal = GuiToggleSlider(bounds, text, active); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiCheckBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + size_t checked_size; + void * checked_js = (void *)JS_GetArrayBuffer(ctx, &checked_size, argv[2]); + if(checked_js == NULL) { + return JS_EXCEPTION; + } + bool * checked = malloc(checked_size); + memcpy((void *)checked, (const void *)checked_js, checked_size); + int returnVal = GuiCheckBox(bounds, text, checked); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiComboBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + size_t active_size; + void * active_js = (void *)JS_GetArrayBuffer(ctx, &active_size, argv[2]); + if(active_js == NULL) { + return JS_EXCEPTION; + } + int * active = malloc(active_size); + memcpy((void *)active, (const void *)active_js, active_size); + int returnVal = GuiComboBox(bounds, text, active); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiDropdownBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int * active = NULL; + int active_out; + if(!JS_IsNull(argv[2])) { + active = &active_out; + JSValue active_js = JS_GetPropertyStr(ctx, argv[2], "active"); + JS_ToInt32(ctx, active, active_js); + } + bool editMode = JS_ToBool(ctx, argv[3]); + int returnVal = GuiDropdownBox(bounds, text, active, editMode); + JS_FreeCString(ctx, text); + if(!JS_IsNull(argv[2])) { + JS_SetPropertyStr(ctx, argv[2], "active", JS_NewInt32(ctx,active_out)); + } + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiSpinner(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int * value = NULL; + int value_out; + if(!JS_IsNull(argv[2])) { + value = &value_out; + JSValue value_js = JS_GetPropertyStr(ctx, argv[2], "value"); + JS_ToInt32(ctx, value, value_js); + } + int minValue; + JS_ToInt32(ctx, &minValue, argv[3]); + int maxValue; + JS_ToInt32(ctx, &maxValue, argv[4]); + bool editMode = JS_ToBool(ctx, argv[5]); + int returnVal = GuiSpinner(bounds, text, value, minValue, maxValue, editMode); + JS_FreeCString(ctx, text); + if(!JS_IsNull(argv[2])) { + JS_SetPropertyStr(ctx, argv[2], "value", JS_NewInt32(ctx,value_out)); + } + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiValueBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int * value = NULL; + int value_out; + if(!JS_IsNull(argv[2])) { + value = &value_out; + JSValue value_js = JS_GetPropertyStr(ctx, argv[2], "value"); + JS_ToInt32(ctx, value, value_js); + } + int minValue; + JS_ToInt32(ctx, &minValue, argv[3]); + int maxValue; + JS_ToInt32(ctx, &maxValue, argv[4]); + bool editMode = JS_ToBool(ctx, argv[5]); + int returnVal = GuiValueBox(bounds, text, value, minValue, maxValue, editMode); + JS_FreeCString(ctx, text); + if(!JS_IsNull(argv[2])) { + JS_SetPropertyStr(ctx, argv[2], "value", JS_NewInt32(ctx,value_out)); + } + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiTextBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + JSValue text_js = JS_GetPropertyStr(ctx, argv[1], "text"); + size_t text_len; + const char * text_val = JS_ToCStringLen(ctx, &text_len, text_js); + memcpy((void *)textbuffer, text_val, text_len); + textbuffer[text_len] = 0; + char * text = textbuffer; + int textSize = 4096; + bool editMode = JS_ToBool(ctx, argv[2]); + int returnVal = GuiTextBox(bounds, text, textSize, editMode); + JS_FreeCString(ctx, text_val); + JS_SetPropertyStr(ctx, argv[1], "text", JS_NewString(ctx,text)); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiSlider(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * textLeft = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + const char * textRight = (JS_IsNull(argv[2]) || JS_IsUndefined(argv[2])) ? NULL : (const char *)JS_ToCString(ctx, argv[2]); + size_t value_size; + void * value_js = (void *)JS_GetArrayBuffer(ctx, &value_size, argv[3]); + if(value_js == NULL) { + return JS_EXCEPTION; + } + float * value = malloc(value_size); + memcpy((void *)value, (const void *)value_js, value_size); + double _double_minValue; + JS_ToFloat64(ctx, &_double_minValue, argv[4]); + float minValue = (float)_double_minValue; + double _double_maxValue; + JS_ToFloat64(ctx, &_double_maxValue, argv[5]); + float maxValue = (float)_double_maxValue; + int returnVal = GuiSlider(bounds, textLeft, textRight, value, minValue, maxValue); + JS_FreeCString(ctx, textLeft); + JS_FreeCString(ctx, textRight); + free((void *)value); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiSliderBar(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * textLeft = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + const char * textRight = (JS_IsNull(argv[2]) || JS_IsUndefined(argv[2])) ? NULL : (const char *)JS_ToCString(ctx, argv[2]); + size_t value_size; + void * value_js = (void *)JS_GetArrayBuffer(ctx, &value_size, argv[3]); + if(value_js == NULL) { + return JS_EXCEPTION; + } + float * value = malloc(value_size); + memcpy((void *)value, (const void *)value_js, value_size); + double _double_minValue; + JS_ToFloat64(ctx, &_double_minValue, argv[4]); + float minValue = (float)_double_minValue; + double _double_maxValue; + JS_ToFloat64(ctx, &_double_maxValue, argv[5]); + float maxValue = (float)_double_maxValue; + int returnVal = GuiSliderBar(bounds, textLeft, textRight, value, minValue, maxValue); + JS_FreeCString(ctx, textLeft); + JS_FreeCString(ctx, textRight); + free((void *)value); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiProgressBar(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * textLeft = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + const char * textRight = (JS_IsNull(argv[2]) || JS_IsUndefined(argv[2])) ? NULL : (const char *)JS_ToCString(ctx, argv[2]); + size_t value_size; + void * value_js = (void *)JS_GetArrayBuffer(ctx, &value_size, argv[3]); + if(value_js == NULL) { + return JS_EXCEPTION; + } + float * value = malloc(value_size); + memcpy((void *)value, (const void *)value_js, value_size); + double _double_minValue; + JS_ToFloat64(ctx, &_double_minValue, argv[4]); + float minValue = (float)_double_minValue; + double _double_maxValue; + JS_ToFloat64(ctx, &_double_maxValue, argv[5]); + float maxValue = (float)_double_maxValue; + int returnVal = GuiProgressBar(bounds, textLeft, textRight, value, minValue, maxValue); + JS_FreeCString(ctx, textLeft); + JS_FreeCString(ctx, textRight); + free((void *)value); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiStatusBar(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int returnVal = GuiStatusBar(bounds, text); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiDummyRec(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int returnVal = GuiDummyRec(bounds, text); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiGrid(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + double _double_spacing; + JS_ToFloat64(ctx, &_double_spacing, argv[2]); + float spacing = (float)_double_spacing; + int subdivs; + JS_ToInt32(ctx, &subdivs, argv[3]); + Vector2* mouseCell = (Vector2*)JS_GetOpaque2(ctx, argv[4], js_Vector2_class_id); + if(mouseCell == NULL) return JS_EXCEPTION; + int returnVal = GuiGrid(bounds, text, spacing, subdivs, mouseCell); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiListView(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + int * scrollIndex = NULL; + int scrollIndex_out; + if(!JS_IsNull(argv[2])) { + scrollIndex = &scrollIndex_out; + JSValue scrollIndex_js = JS_GetPropertyStr(ctx, argv[2], "scrollIndex"); + JS_ToInt32(ctx, scrollIndex, scrollIndex_js); + } + size_t active_size; + void * active_js = (void *)JS_GetArrayBuffer(ctx, &active_size, argv[3]); + if(active_js == NULL) { + return JS_EXCEPTION; + } + int * active = malloc(active_size); + memcpy((void *)active, (const void *)active_js, active_size); + int returnVal = GuiListView(bounds, text, scrollIndex, active); + JS_FreeCString(ctx, text); + if(!JS_IsNull(argv[2])) { + JS_SetPropertyStr(ctx, argv[2], "scrollIndex", JS_NewInt32(ctx,scrollIndex_out)); + } + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiMessageBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * title = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + const char * message = (JS_IsNull(argv[2]) || JS_IsUndefined(argv[2])) ? NULL : (const char *)JS_ToCString(ctx, argv[2]); + const char * buttons = (JS_IsNull(argv[3]) || JS_IsUndefined(argv[3])) ? NULL : (const char *)JS_ToCString(ctx, argv[3]); + int returnVal = GuiMessageBox(bounds, title, message, buttons); + JS_FreeCString(ctx, title); + JS_FreeCString(ctx, message); + JS_FreeCString(ctx, buttons); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiTextInputBox(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * title = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + const char * message = (JS_IsNull(argv[2]) || JS_IsUndefined(argv[2])) ? NULL : (const char *)JS_ToCString(ctx, argv[2]); + const char * buttons = (JS_IsNull(argv[3]) || JS_IsUndefined(argv[3])) ? NULL : (const char *)JS_ToCString(ctx, argv[3]); + JSValue text_js = JS_GetPropertyStr(ctx, argv[4], "text"); + size_t text_len; + const char * text_val = JS_ToCStringLen(ctx, &text_len, text_js); + memcpy((void *)textbuffer, text_val, text_len); + textbuffer[text_len] = 0; + char * text = textbuffer; + int textMaxSize = 4096; + bool * secretViewActive = NULL; + bool secretViewActive_out; + if(!JS_IsNull(argv[5])) { + secretViewActive = &secretViewActive_out; + JSValue secretViewActive_js = JS_GetPropertyStr(ctx, argv[5], "secretViewActive"); + JS_ToInt32(ctx, secretViewActive, secretViewActive_js); + } + int returnVal = GuiTextInputBox(bounds, title, message, buttons, text, textMaxSize, secretViewActive); + JS_FreeCString(ctx, title); + JS_FreeCString(ctx, message); + JS_FreeCString(ctx, buttons); + JS_FreeCString(ctx, text_val); + JS_SetPropertyStr(ctx, argv[4], "text", JS_NewString(ctx,text)); + if(!JS_IsNull(argv[5])) { + JS_SetPropertyStr(ctx, argv[5], "secretViewActive", JS_NewInt32(ctx,secretViewActive_out)); + } + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiColorPicker(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + Color* color = (Color*)JS_GetOpaque2(ctx, argv[2], js_Color_class_id); + if(color == NULL) return JS_EXCEPTION; + int returnVal = GuiColorPicker(bounds, text, color); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiColorPanel(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + Color* color = (Color*)JS_GetOpaque2(ctx, argv[2], js_Color_class_id); + if(color == NULL) return JS_EXCEPTION; + int returnVal = GuiColorPanel(bounds, text, color); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiColorBarAlpha(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + size_t alpha_size; + void * alpha_js = (void *)JS_GetArrayBuffer(ctx, &alpha_size, argv[2]); + if(alpha_js == NULL) { + return JS_EXCEPTION; + } + float * alpha = malloc(alpha_size); + memcpy((void *)alpha, (const void *)alpha_js, alpha_size); + int returnVal = GuiColorBarAlpha(bounds, text, alpha); + JS_FreeCString(ctx, text); + free((void *)alpha); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiColorBarHue(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + size_t value_size; + void * value_js = (void *)JS_GetArrayBuffer(ctx, &value_size, argv[2]); + if(value_js == NULL) { + return JS_EXCEPTION; + } + float * value = malloc(value_size); + memcpy((void *)value, (const void *)value_js, value_size); + int returnVal = GuiColorBarHue(bounds, text, value); + JS_FreeCString(ctx, text); + free((void *)value); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiColorPickerHSV(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + Vector3* colorHsv = (Vector3*)JS_GetOpaque2(ctx, argv[2], js_Vector3_class_id); + if(colorHsv == NULL) return JS_EXCEPTION; + int returnVal = GuiColorPickerHSV(bounds, text, colorHsv); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + +static JSValue js_guiColorPanelHSV(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { + Rectangle* bounds_ptr = (Rectangle*)JS_GetOpaque2(ctx, argv[0], js_Rectangle_class_id); + if(bounds_ptr == NULL) return JS_EXCEPTION; + Rectangle bounds = *bounds_ptr; + const char * text = (JS_IsNull(argv[1]) || JS_IsUndefined(argv[1])) ? NULL : (const char *)JS_ToCString(ctx, argv[1]); + Vector3* colorHsv = (Vector3*)JS_GetOpaque2(ctx, argv[2], js_Vector3_class_id); + if(colorHsv == NULL) return JS_EXCEPTION; + int returnVal = GuiColorPanelHSV(bounds, text, colorHsv); + JS_FreeCString(ctx, text); + JSValue ret = JS_NewInt32(ctx, returnVal); + return ret; +} + static JSValue js_createLight(JSContext * ctx, JSValueConst this_val, int argc, JSValueConst * argv) { int type; JS_ToInt32(ctx, &type, argv[0]); @@ -10529,8 +11473,8 @@ static JSValue js_meshMerge(JSContext * ctx, JSValueConst this_val, int argc, JS static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("initWindow",3,js_initWindow), - JS_CFUNC_DEF("windowShouldClose",0,js_windowShouldClose), JS_CFUNC_DEF("closeWindow",0,js_closeWindow), + JS_CFUNC_DEF("windowShouldClose",0,js_windowShouldClose), JS_CFUNC_DEF("isWindowReady",0,js_isWindowReady), JS_CFUNC_DEF("isWindowFullscreen",0,js_isWindowFullscreen), JS_CFUNC_DEF("isWindowHidden",0,js_isWindowHidden), @@ -10542,6 +11486,7 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("setWindowState",1,js_setWindowState), JS_CFUNC_DEF("clearWindowState",1,js_clearWindowState), JS_CFUNC_DEF("toggleFullscreen",0,js_toggleFullscreen), + JS_CFUNC_DEF("toggleBorderlessWindowed",0,js_toggleBorderlessWindowed), JS_CFUNC_DEF("maximizeWindow",0,js_maximizeWindow), JS_CFUNC_DEF("minimizeWindow",0,js_minimizeWindow), JS_CFUNC_DEF("restoreWindow",0,js_restoreWindow), @@ -10550,8 +11495,10 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("setWindowPosition",2,js_setWindowPosition), JS_CFUNC_DEF("setWindowMonitor",1,js_setWindowMonitor), JS_CFUNC_DEF("setWindowMinSize",2,js_setWindowMinSize), + JS_CFUNC_DEF("setWindowMaxSize",2,js_setWindowMaxSize), JS_CFUNC_DEF("setWindowSize",2,js_setWindowSize), JS_CFUNC_DEF("setWindowOpacity",1,js_setWindowOpacity), + JS_CFUNC_DEF("setWindowFocused",0,js_setWindowFocused), JS_CFUNC_DEF("getScreenWidth",0,js_getScreenWidth), JS_CFUNC_DEF("getScreenHeight",0,js_getScreenHeight), JS_CFUNC_DEF("getRenderWidth",0,js_getRenderWidth), @@ -10605,24 +11552,27 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("setShaderValueMatrix",3,js_setShaderValueMatrix), JS_CFUNC_DEF("setShaderValueTexture",3,js_setShaderValueTexture), JS_CFUNC_DEF("unloadShader",1,js_unloadShader), - JS_CFUNC_DEF("getMouseRay",2,js_getMouseRay), - JS_CFUNC_DEF("getCameraMatrix",1,js_getCameraMatrix), - JS_CFUNC_DEF("getCameraMatrix2D",1,js_getCameraMatrix2D), + JS_CFUNC_DEF("getScreenToWorldRay",2,js_getScreenToWorldRay), + JS_CFUNC_DEF("getScreenToWorldRayEx",4,js_getScreenToWorldRayEx), JS_CFUNC_DEF("getWorldToScreen",2,js_getWorldToScreen), - JS_CFUNC_DEF("getScreenToWorld2D",2,js_getScreenToWorld2D), JS_CFUNC_DEF("getWorldToScreenEx",4,js_getWorldToScreenEx), JS_CFUNC_DEF("getWorldToScreen2D",2,js_getWorldToScreen2D), + JS_CFUNC_DEF("getScreenToWorld2D",2,js_getScreenToWorld2D), + JS_CFUNC_DEF("getCameraMatrix",1,js_getCameraMatrix), + JS_CFUNC_DEF("getCameraMatrix2D",1,js_getCameraMatrix2D), JS_CFUNC_DEF("setTargetFPS",1,js_setTargetFPS), - JS_CFUNC_DEF("getFPS",0,js_getFPS), JS_CFUNC_DEF("getFrameTime",0,js_getFrameTime), JS_CFUNC_DEF("getTime",0,js_getTime), - JS_CFUNC_DEF("getRandomValue",2,js_getRandomValue), + JS_CFUNC_DEF("getFPS",0,js_getFPS), JS_CFUNC_DEF("setRandomSeed",1,js_setRandomSeed), + JS_CFUNC_DEF("getRandomValue",2,js_getRandomValue), + JS_CFUNC_DEF("loadRandomSequence",3,js_loadRandomSequence), + JS_CFUNC_DEF("unloadRandomSequence",1,js_unloadRandomSequence), JS_CFUNC_DEF("takeScreenshot",1,js_takeScreenshot), JS_CFUNC_DEF("setConfigFlags",1,js_setConfigFlags), + JS_CFUNC_DEF("openURL",1,js_openURL), JS_CFUNC_DEF("traceLog",2,js_traceLog), JS_CFUNC_DEF("setTraceLogLevel",1,js_setTraceLogLevel), - JS_CFUNC_DEF("openURL",1,js_openURL), JS_CFUNC_DEF("loadFileData",1,js_loadFileData), JS_CFUNC_DEF("saveFileData",3,js_saveFileData), JS_CFUNC_DEF("loadFileText",1,js_loadFileText), @@ -10645,13 +11595,22 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("isFileDropped",0,js_isFileDropped), JS_CFUNC_DEF("loadDroppedFiles",0,js_loadDroppedFiles), JS_CFUNC_DEF("getFileModTime",1,js_getFileModTime), + JS_CFUNC_DEF("loadAutomationEventList",1,js_loadAutomationEventList), + JS_CFUNC_DEF("unloadAutomationEventList",1,js_unloadAutomationEventList), + JS_CFUNC_DEF("exportAutomationEventList",2,js_exportAutomationEventList), + JS_CFUNC_DEF("setAutomationEventList",1,js_setAutomationEventList), + JS_CFUNC_DEF("setAutomationEventBaseFrame",1,js_setAutomationEventBaseFrame), + JS_CFUNC_DEF("startAutomationEventRecording",0,js_startAutomationEventRecording), + JS_CFUNC_DEF("stopAutomationEventRecording",0,js_stopAutomationEventRecording), + JS_CFUNC_DEF("playAutomationEvent",1,js_playAutomationEvent), JS_CFUNC_DEF("isKeyPressed",1,js_isKeyPressed), + JS_CFUNC_DEF("isKeyPressedRepeat",1,js_isKeyPressedRepeat), JS_CFUNC_DEF("isKeyDown",1,js_isKeyDown), JS_CFUNC_DEF("isKeyReleased",1,js_isKeyReleased), JS_CFUNC_DEF("isKeyUp",1,js_isKeyUp), - JS_CFUNC_DEF("setExitKey",1,js_setExitKey), JS_CFUNC_DEF("getKeyPressed",0,js_getKeyPressed), JS_CFUNC_DEF("getCharPressed",0,js_getCharPressed), + JS_CFUNC_DEF("setExitKey",1,js_setExitKey), JS_CFUNC_DEF("isGamepadAvailable",1,js_isGamepadAvailable), JS_CFUNC_DEF("getGamepadName",1,js_getGamepadName), JS_CFUNC_DEF("isGamepadButtonPressed",2,js_isGamepadButtonPressed), @@ -10662,6 +11621,7 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("getGamepadAxisCount",1,js_getGamepadAxisCount), JS_CFUNC_DEF("getGamepadAxisMovement",2,js_getGamepadAxisMovement), JS_CFUNC_DEF("setGamepadMappings",1,js_setGamepadMappings), + JS_CFUNC_DEF("setGamepadVibration",3,js_setGamepadVibration), JS_CFUNC_DEF("isMouseButtonPressed",1,js_isMouseButtonPressed), JS_CFUNC_DEF("isMouseButtonDown",1,js_isMouseButtonDown), JS_CFUNC_DEF("isMouseButtonReleased",1,js_isMouseButtonReleased), @@ -10692,20 +11652,21 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("updateCamera",2,js_updateCamera), JS_CFUNC_DEF("updateCameraPro",4,js_updateCameraPro), JS_CFUNC_DEF("setShapesTexture",2,js_setShapesTexture), + JS_CFUNC_DEF("getShapesTexture",0,js_getShapesTexture), + JS_CFUNC_DEF("getShapesTextureRectangle",0,js_getShapesTextureRectangle), JS_CFUNC_DEF("drawPixel",3,js_drawPixel), JS_CFUNC_DEF("drawPixelV",2,js_drawPixelV), JS_CFUNC_DEF("drawLine",5,js_drawLine), JS_CFUNC_DEF("drawLineV",3,js_drawLineV), JS_CFUNC_DEF("drawLineEx",4,js_drawLineEx), JS_CFUNC_DEF("drawLineBezier",4,js_drawLineBezier), - JS_CFUNC_DEF("drawLineBezierQuad",5,js_drawLineBezierQuad), - JS_CFUNC_DEF("drawLineBezierCubic",6,js_drawLineBezierCubic), JS_CFUNC_DEF("drawCircle",4,js_drawCircle), JS_CFUNC_DEF("drawCircleSector",6,js_drawCircleSector), JS_CFUNC_DEF("drawCircleSectorLines",6,js_drawCircleSectorLines), JS_CFUNC_DEF("drawCircleGradient",5,js_drawCircleGradient), JS_CFUNC_DEF("drawCircleV",3,js_drawCircleV), JS_CFUNC_DEF("drawCircleLines",4,js_drawCircleLines), + JS_CFUNC_DEF("drawCircleLinesV",3,js_drawCircleLinesV), JS_CFUNC_DEF("drawEllipse",5,js_drawEllipse), JS_CFUNC_DEF("drawEllipseLines",5,js_drawEllipseLines), JS_CFUNC_DEF("drawRing",7,js_drawRing), @@ -10726,6 +11687,21 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("drawPoly",5,js_drawPoly), JS_CFUNC_DEF("drawPolyLines",5,js_drawPolyLines), JS_CFUNC_DEF("drawPolyLinesEx",6,js_drawPolyLinesEx), + JS_CFUNC_DEF("drawSplineLinear",4,js_drawSplineLinear), + JS_CFUNC_DEF("drawSplineBasis",4,js_drawSplineBasis), + JS_CFUNC_DEF("drawSplineCatmullRom",4,js_drawSplineCatmullRom), + JS_CFUNC_DEF("drawSplineBezierQuadratic",4,js_drawSplineBezierQuadratic), + JS_CFUNC_DEF("drawSplineBezierCubic",4,js_drawSplineBezierCubic), + JS_CFUNC_DEF("drawSplineSegmentLinear",4,js_drawSplineSegmentLinear), + JS_CFUNC_DEF("drawSplineSegmentBasis",6,js_drawSplineSegmentBasis), + JS_CFUNC_DEF("drawSplineSegmentCatmullRom",6,js_drawSplineSegmentCatmullRom), + JS_CFUNC_DEF("drawSplineSegmentBezierQuadratic",5,js_drawSplineSegmentBezierQuadratic), + JS_CFUNC_DEF("drawSplineSegmentBezierCubic",6,js_drawSplineSegmentBezierCubic), + JS_CFUNC_DEF("getSplinePointLinear",3,js_getSplinePointLinear), + JS_CFUNC_DEF("getSplinePointBasis",5,js_getSplinePointBasis), + JS_CFUNC_DEF("getSplinePointCatmullRom",5,js_getSplinePointCatmullRom), + JS_CFUNC_DEF("getSplinePointBezierQuad",4,js_getSplinePointBezierQuad), + JS_CFUNC_DEF("getSplinePointBezierCubic",5,js_getSplinePointBezierCubic), JS_CFUNC_DEF("checkCollisionRecs",2,js_checkCollisionRecs), JS_CFUNC_DEF("checkCollisionCircles",4,js_checkCollisionCircles), JS_CFUNC_DEF("checkCollisionCircleRec",3,js_checkCollisionCircleRec), @@ -10736,12 +11712,15 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("getCollisionRec",2,js_getCollisionRec), JS_CFUNC_DEF("loadImage",1,js_loadImage), JS_CFUNC_DEF("loadImageRaw",5,js_loadImageRaw), + JS_CFUNC_DEF("loadImageSvg",3,js_loadImageSvg), + JS_CFUNC_DEF("loadImageAnimFromMemory",4,js_loadImageAnimFromMemory), JS_CFUNC_DEF("loadImageFromMemory",3,js_loadImageFromMemory), JS_CFUNC_DEF("loadImageFromTexture",1,js_loadImageFromTexture), JS_CFUNC_DEF("loadImageFromScreen",0,js_loadImageFromScreen), JS_CFUNC_DEF("isImageReady",1,js_isImageReady), JS_CFUNC_DEF("unloadImage",1,js_unloadImage), JS_CFUNC_DEF("exportImage",2,js_exportImage), + JS_CFUNC_DEF("exportImageToMemory",3,js_exportImageToMemory), JS_CFUNC_DEF("genImageColor",3,js_genImageColor), JS_CFUNC_DEF("genImageGradientLinear",5,js_genImageGradientLinear), JS_CFUNC_DEF("genImageGradientRadial",5,js_genImageGradientRadial), @@ -10763,6 +11742,7 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("imageAlphaMask",2,js_imageAlphaMask), JS_CFUNC_DEF("imageAlphaPremultiply",1,js_imageAlphaPremultiply), JS_CFUNC_DEF("imageBlurGaussian",2,js_imageBlurGaussian), + JS_CFUNC_DEF("imageKernelConvolution",3,js_imageKernelConvolution), JS_CFUNC_DEF("imageResize",3,js_imageResize), JS_CFUNC_DEF("imageResizeNN",3,js_imageResizeNN), JS_CFUNC_DEF("imageResizeCanvas",6,js_imageResizeCanvas), @@ -10817,6 +11797,7 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("drawTextureRec",4,js_drawTextureRec), JS_CFUNC_DEF("drawTexturePro",6,js_drawTexturePro), JS_CFUNC_DEF("drawTextureNPatch",6,js_drawTextureNPatch), + JS_CFUNC_DEF("colorIsEqual",2,js_colorIsEqual), JS_CFUNC_DEF("fade",2,js_fade), JS_CFUNC_DEF("colorToInt",1,js_colorToInt), JS_CFUNC_DEF("colorNormalize",1,js_colorNormalize), @@ -10841,6 +11822,7 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("drawTextEx",6,js_drawTextEx), JS_CFUNC_DEF("drawTextPro",8,js_drawTextPro), JS_CFUNC_DEF("drawTextCodepoint",5,js_drawTextCodepoint), + JS_CFUNC_DEF("setTextLineSpacing",1,js_setTextLineSpacing), JS_CFUNC_DEF("measureText",2,js_measureText), JS_CFUNC_DEF("measureTextEx",4,js_measureTextEx), JS_CFUNC_DEF("getGlyphIndex",2,js_getGlyphIndex), @@ -10883,9 +11865,10 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("unloadMesh",1,js_unloadMesh), JS_CFUNC_DEF("drawMesh",3,js_drawMesh), JS_CFUNC_DEF("drawMeshInstanced",4,js_drawMeshInstanced), - JS_CFUNC_DEF("exportMesh",2,js_exportMesh), JS_CFUNC_DEF("getMeshBoundingBox",1,js_getMeshBoundingBox), JS_CFUNC_DEF("genMeshTangents",1,js_genMeshTangents), + JS_CFUNC_DEF("exportMesh",2,js_exportMesh), + JS_CFUNC_DEF("exportMeshAsCode",2,js_exportMeshAsCode), JS_CFUNC_DEF("genMeshPoly",2,js_genMeshPoly), JS_CFUNC_DEF("genMeshPlane",4,js_genMeshPlane), JS_CFUNC_DEF("genMeshCube",3,js_genMeshCube), @@ -10914,15 +11897,18 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("closeAudioDevice",0,js_closeAudioDevice), JS_CFUNC_DEF("isAudioDeviceReady",0,js_isAudioDeviceReady), JS_CFUNC_DEF("setMasterVolume",1,js_setMasterVolume), + JS_CFUNC_DEF("getMasterVolume",0,js_getMasterVolume), JS_CFUNC_DEF("loadWave",1,js_loadWave), JS_CFUNC_DEF("loadWaveFromMemory",3,js_loadWaveFromMemory), JS_CFUNC_DEF("isWaveReady",1,js_isWaveReady), JS_CFUNC_DEF("loadSound",1,js_loadSound), JS_CFUNC_DEF("loadSoundFromWave",1,js_loadSoundFromWave), + JS_CFUNC_DEF("loadSoundAlias",1,js_loadSoundAlias), JS_CFUNC_DEF("isSoundReady",1,js_isSoundReady), JS_CFUNC_DEF("updateSound",3,js_updateSound), JS_CFUNC_DEF("unloadWave",1,js_unloadWave), JS_CFUNC_DEF("unloadSound",1,js_unloadSound), + JS_CFUNC_DEF("unloadSoundAlias",1,js_unloadSoundAlias), JS_CFUNC_DEF("exportWave",2,js_exportWave), JS_CFUNC_DEF("playSound",1,js_playSound), JS_CFUNC_DEF("stopSound",1,js_stopSound), @@ -10977,12 +11963,15 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("vector2Transform",2,js_vector2Transform), JS_CFUNC_DEF("vector2Lerp",3,js_vector2Lerp), JS_CFUNC_DEF("vector2Reflect",2,js_vector2Reflect), + JS_CFUNC_DEF("vector2Min",2,js_vector2Min), + JS_CFUNC_DEF("vector2Max",2,js_vector2Max), JS_CFUNC_DEF("vector2Rotate",2,js_vector2Rotate), JS_CFUNC_DEF("vector2MoveTowards",3,js_vector2MoveTowards), JS_CFUNC_DEF("vector2Invert",1,js_vector2Invert), JS_CFUNC_DEF("vector2Clamp",3,js_vector2Clamp), JS_CFUNC_DEF("vector2ClampValue",3,js_vector2ClampValue), JS_CFUNC_DEF("vector2Equals",2,js_vector2Equals), + JS_CFUNC_DEF("vector2Refract",3,js_vector2Refract), JS_CFUNC_DEF("vector3Zero",0,js_vector3Zero), JS_CFUNC_DEF("vector3One",0,js_vector3One), JS_CFUNC_DEF("vector3Add",2,js_vector3Add), @@ -11002,9 +11991,12 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("vector3Negate",1,js_vector3Negate), JS_CFUNC_DEF("vector3Divide",2,js_vector3Divide), JS_CFUNC_DEF("vector3Normalize",1,js_vector3Normalize), + JS_CFUNC_DEF("vector3Project",2,js_vector3Project), + JS_CFUNC_DEF("vector3Reject",2,js_vector3Reject), JS_CFUNC_DEF("vector3Transform",2,js_vector3Transform), JS_CFUNC_DEF("vector3RotateByQuaternion",2,js_vector3RotateByQuaternion), JS_CFUNC_DEF("vector3RotateByAxisAngle",3,js_vector3RotateByAxisAngle), + JS_CFUNC_DEF("vector3MoveTowards",3,js_vector3MoveTowards), JS_CFUNC_DEF("vector3Lerp",3,js_vector3Lerp), JS_CFUNC_DEF("vector3Reflect",2,js_vector3Reflect), JS_CFUNC_DEF("vector3Min",2,js_vector3Min), @@ -11016,6 +12008,18 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("vector3ClampValue",3,js_vector3ClampValue), JS_CFUNC_DEF("vector3Equals",2,js_vector3Equals), JS_CFUNC_DEF("vector3Refract",3,js_vector3Refract), + JS_CFUNC_DEF("vector4Distance",2,js_vector4Distance), + JS_CFUNC_DEF("vector4DistanceSqr",2,js_vector4DistanceSqr), + JS_CFUNC_DEF("vector4Multiply",2,js_vector4Multiply), + JS_CFUNC_DEF("vector4Negate",1,js_vector4Negate), + JS_CFUNC_DEF("vector4Divide",2,js_vector4Divide), + JS_CFUNC_DEF("vector4Normalize",1,js_vector4Normalize), + JS_CFUNC_DEF("vector4Min",2,js_vector4Min), + JS_CFUNC_DEF("vector4Max",2,js_vector4Max), + JS_CFUNC_DEF("vector4Lerp",3,js_vector4Lerp), + JS_CFUNC_DEF("vector4MoveTowards",3,js_vector4MoveTowards), + JS_CFUNC_DEF("vector4Invert",1,js_vector4Invert), + JS_CFUNC_DEF("vector4Equals",2,js_vector4Equals), JS_CFUNC_DEF("matrixDeterminant",1,js_matrixDeterminant), JS_CFUNC_DEF("matrixTrace",1,js_matrixTrace), JS_CFUNC_DEF("matrixTranspose",1,js_matrixTranspose), @@ -11075,23 +12079,32 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("guiLock",0,js_guiLock), JS_CFUNC_DEF("guiUnlock",0,js_guiUnlock), JS_CFUNC_DEF("guiIsLocked",0,js_guiIsLocked), - JS_CFUNC_DEF("guiFade",1,js_guiFade), + JS_CFUNC_DEF("guiSetAlpha",1,js_guiSetAlpha), JS_CFUNC_DEF("guiSetState",1,js_guiSetState), JS_CFUNC_DEF("guiGetState",0,js_guiGetState), JS_CFUNC_DEF("guiSetFont",1,js_guiSetFont), JS_CFUNC_DEF("guiGetFont",0,js_guiGetFont), JS_CFUNC_DEF("guiSetStyle",3,js_guiSetStyle), JS_CFUNC_DEF("guiGetStyle",2,js_guiGetStyle), + JS_CFUNC_DEF("guiLoadStyle",1,js_guiLoadStyle), + JS_CFUNC_DEF("guiLoadStyleDefault",0,js_guiLoadStyleDefault), + JS_CFUNC_DEF("guiEnableTooltip",0,js_guiEnableTooltip), + JS_CFUNC_DEF("guiDisableTooltip",0,js_guiDisableTooltip), + JS_CFUNC_DEF("guiSetTooltip",1,js_guiSetTooltip), + JS_CFUNC_DEF("guiIconText",2,js_guiIconText), + JS_CFUNC_DEF("guiSetIconScale",1,js_guiSetIconScale), + JS_CFUNC_DEF("guiDrawIcon",5,js_guiDrawIcon), JS_CFUNC_DEF("guiWindowBox",2,js_guiWindowBox), JS_CFUNC_DEF("guiGroupBox",2,js_guiGroupBox), JS_CFUNC_DEF("guiLine",2,js_guiLine), JS_CFUNC_DEF("guiPanel",2,js_guiPanel), - JS_CFUNC_DEF("guiScrollPanel",4,js_guiScrollPanel), + JS_CFUNC_DEF("guiScrollPanel",5,js_guiScrollPanel), JS_CFUNC_DEF("guiLabel",2,js_guiLabel), JS_CFUNC_DEF("guiButton",2,js_guiButton), JS_CFUNC_DEF("guiLabelButton",2,js_guiLabelButton), JS_CFUNC_DEF("guiToggle",3,js_guiToggle), JS_CFUNC_DEF("guiToggleGroup",3,js_guiToggleGroup), + JS_CFUNC_DEF("guiToggleSlider",3,js_guiToggleSlider), JS_CFUNC_DEF("guiCheckBox",3,js_guiCheckBox), JS_CFUNC_DEF("guiComboBox",3,js_guiComboBox), JS_CFUNC_DEF("guiDropdownBox",4,js_guiDropdownBox), @@ -11103,7 +12116,7 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("guiProgressBar",6,js_guiProgressBar), JS_CFUNC_DEF("guiStatusBar",2,js_guiStatusBar), JS_CFUNC_DEF("guiDummyRec",2,js_guiDummyRec), - JS_CFUNC_DEF("guiGrid",4,js_guiGrid), + JS_CFUNC_DEF("guiGrid",5,js_guiGrid), JS_CFUNC_DEF("guiListView",4,js_guiListView), JS_CFUNC_DEF("guiMessageBox",4,js_guiMessageBox), JS_CFUNC_DEF("guiTextInputBox",6,js_guiTextInputBox), @@ -11111,14 +12124,8 @@ static const JSCFunctionListEntry js_raylib_core_funcs[] = { JS_CFUNC_DEF("guiColorPanel",3,js_guiColorPanel), JS_CFUNC_DEF("guiColorBarAlpha",3,js_guiColorBarAlpha), JS_CFUNC_DEF("guiColorBarHue",3,js_guiColorBarHue), - JS_CFUNC_DEF("guiLoadStyle",1,js_guiLoadStyle), - JS_CFUNC_DEF("guiLoadStyleDefault",0,js_guiLoadStyleDefault), - JS_CFUNC_DEF("guiEnableTooltip",0,js_guiEnableTooltip), - JS_CFUNC_DEF("guiDisableTooltip",0,js_guiDisableTooltip), - JS_CFUNC_DEF("guiSetTooltip",1,js_guiSetTooltip), - JS_CFUNC_DEF("guiIconText",2,js_guiIconText), - JS_CFUNC_DEF("guiSetIconScale",1,js_guiSetIconScale), - JS_CFUNC_DEF("guiDrawIcon",5,js_guiDrawIcon), + JS_CFUNC_DEF("guiColorPickerHSV",3,js_guiColorPickerHSV), + JS_CFUNC_DEF("guiColorPanelHSV",3,js_guiColorPanelHSV), JS_CFUNC_DEF("createLight",5,js_createLight), JS_CFUNC_DEF("updateLightValues",2,js_updateLightValues), JS_CFUNC_DEF("easeLinearNone",4,js_easeLinearNone), @@ -11220,10 +12227,12 @@ static int js_raylib_core_init(JSContext * ctx, JSModuleDef * m) { js_declare_Sound(ctx, m); js_declare_Music(ctx, m); js_declare_VrDeviceInfo(ctx, m); - JSValue VrDeviceInfo_constr = JS_NewCFunction2(ctx, js_VrDeviceInfo_constructor,"VrDeviceInfo)", 10, JS_CFUNC_constructor_or_func, 0); + JSValue VrDeviceInfo_constr = JS_NewCFunction2(ctx, js_VrDeviceInfo_constructor,"VrDeviceInfo)", 9, JS_CFUNC_constructor_or_func, 0); JS_SetModuleExport(ctx, m, "VrDeviceInfo", VrDeviceInfo_constr); js_declare_VrStereoConfig(ctx, m); js_declare_FilePathList(ctx, m); + js_declare_AutomationEvent(ctx, m); + js_declare_AutomationEventList(ctx, m); js_declare_Light(ctx, m); js_declare_Lightmapper(ctx, m); js_declare_LightmapperConfig(ctx, m); @@ -11396,6 +12405,7 @@ static int js_raylib_core_init(JSContext * ctx, JSModuleDef * m) { JS_SetModuleExport(ctx, m, "FLAG_WINDOW_TRANSPARENT", JS_NewInt32(ctx, FLAG_WINDOW_TRANSPARENT)); JS_SetModuleExport(ctx, m, "FLAG_WINDOW_HIGHDPI", JS_NewInt32(ctx, FLAG_WINDOW_HIGHDPI)); JS_SetModuleExport(ctx, m, "FLAG_WINDOW_MOUSE_PASSTHROUGH", JS_NewInt32(ctx, FLAG_WINDOW_MOUSE_PASSTHROUGH)); + JS_SetModuleExport(ctx, m, "FLAG_BORDERLESS_WINDOWED_MODE", JS_NewInt32(ctx, FLAG_BORDERLESS_WINDOWED_MODE)); JS_SetModuleExport(ctx, m, "FLAG_MSAA_4X_HINT", JS_NewInt32(ctx, FLAG_MSAA_4X_HINT)); JS_SetModuleExport(ctx, m, "FLAG_INTERLACED_HINT", JS_NewInt32(ctx, FLAG_INTERLACED_HINT)); JS_SetModuleExport(ctx, m, "LOG_ALL", JS_NewInt32(ctx, LOG_ALL)); @@ -11618,6 +12628,9 @@ static int js_raylib_core_init(JSContext * ctx, JSModuleDef * m) { JS_SetModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R32", JS_NewInt32(ctx, PIXELFORMAT_UNCOMPRESSED_R32)); JS_SetModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R32G32B32", JS_NewInt32(ctx, PIXELFORMAT_UNCOMPRESSED_R32G32B32)); JS_SetModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R32G32B32A32", JS_NewInt32(ctx, PIXELFORMAT_UNCOMPRESSED_R32G32B32A32)); + JS_SetModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R16", JS_NewInt32(ctx, PIXELFORMAT_UNCOMPRESSED_R16)); + JS_SetModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R16G16B16", JS_NewInt32(ctx, PIXELFORMAT_UNCOMPRESSED_R16G16B16)); + JS_SetModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R16G16B16A16", JS_NewInt32(ctx, PIXELFORMAT_UNCOMPRESSED_R16G16B16A16)); JS_SetModuleExport(ctx, m, "PIXELFORMAT_COMPRESSED_DXT1_RGB", JS_NewInt32(ctx, PIXELFORMAT_COMPRESSED_DXT1_RGB)); JS_SetModuleExport(ctx, m, "PIXELFORMAT_COMPRESSED_DXT1_RGBA", JS_NewInt32(ctx, PIXELFORMAT_COMPRESSED_DXT1_RGBA)); JS_SetModuleExport(ctx, m, "PIXELFORMAT_COMPRESSED_DXT3_RGBA", JS_NewInt32(ctx, PIXELFORMAT_COMPRESSED_DXT3_RGBA)); @@ -11684,6 +12697,12 @@ static int js_raylib_core_init(JSContext * ctx, JSModuleDef * m) { JS_SetModuleExport(ctx, m, "TEXT_ALIGN_LEFT", JS_NewInt32(ctx, TEXT_ALIGN_LEFT)); JS_SetModuleExport(ctx, m, "TEXT_ALIGN_CENTER", JS_NewInt32(ctx, TEXT_ALIGN_CENTER)); JS_SetModuleExport(ctx, m, "TEXT_ALIGN_RIGHT", JS_NewInt32(ctx, TEXT_ALIGN_RIGHT)); + JS_SetModuleExport(ctx, m, "TEXT_ALIGN_TOP", JS_NewInt32(ctx, TEXT_ALIGN_TOP)); + JS_SetModuleExport(ctx, m, "TEXT_ALIGN_MIDDLE", JS_NewInt32(ctx, TEXT_ALIGN_MIDDLE)); + JS_SetModuleExport(ctx, m, "TEXT_ALIGN_BOTTOM", JS_NewInt32(ctx, TEXT_ALIGN_BOTTOM)); + JS_SetModuleExport(ctx, m, "TEXT_WRAP_NONE", JS_NewInt32(ctx, TEXT_WRAP_NONE)); + JS_SetModuleExport(ctx, m, "TEXT_WRAP_CHAR", JS_NewInt32(ctx, TEXT_WRAP_CHAR)); + JS_SetModuleExport(ctx, m, "TEXT_WRAP_WORD", JS_NewInt32(ctx, TEXT_WRAP_WORD)); JS_SetModuleExport(ctx, m, "DEFAULT", JS_NewInt32(ctx, DEFAULT)); JS_SetModuleExport(ctx, m, "LABEL", JS_NewInt32(ctx, LABEL)); JS_SetModuleExport(ctx, m, "BUTTON", JS_NewInt32(ctx, BUTTON)); @@ -11715,11 +12734,13 @@ static int js_raylib_core_init(JSContext * ctx, JSModuleDef * m) { JS_SetModuleExport(ctx, m, "BORDER_WIDTH", JS_NewInt32(ctx, BORDER_WIDTH)); JS_SetModuleExport(ctx, m, "TEXT_PADDING", JS_NewInt32(ctx, TEXT_PADDING)); JS_SetModuleExport(ctx, m, "TEXT_ALIGNMENT", JS_NewInt32(ctx, TEXT_ALIGNMENT)); - JS_SetModuleExport(ctx, m, "RESERVED", JS_NewInt32(ctx, RESERVED)); JS_SetModuleExport(ctx, m, "TEXT_SIZE", JS_NewInt32(ctx, TEXT_SIZE)); JS_SetModuleExport(ctx, m, "TEXT_SPACING", JS_NewInt32(ctx, TEXT_SPACING)); JS_SetModuleExport(ctx, m, "LINE_COLOR", JS_NewInt32(ctx, LINE_COLOR)); JS_SetModuleExport(ctx, m, "BACKGROUND_COLOR", JS_NewInt32(ctx, BACKGROUND_COLOR)); + JS_SetModuleExport(ctx, m, "TEXT_LINE_SPACING", JS_NewInt32(ctx, TEXT_LINE_SPACING)); + JS_SetModuleExport(ctx, m, "TEXT_ALIGNMENT_VERTICAL", JS_NewInt32(ctx, TEXT_ALIGNMENT_VERTICAL)); + JS_SetModuleExport(ctx, m, "TEXT_WRAP_MODE", JS_NewInt32(ctx, TEXT_WRAP_MODE)); JS_SetModuleExport(ctx, m, "GROUP_PADDING", JS_NewInt32(ctx, GROUP_PADDING)); JS_SetModuleExport(ctx, m, "SLIDER_WIDTH", JS_NewInt32(ctx, SLIDER_WIDTH)); JS_SetModuleExport(ctx, m, "SLIDER_PADDING", JS_NewInt32(ctx, SLIDER_PADDING)); @@ -11735,11 +12756,7 @@ static int js_raylib_core_init(JSContext * ctx, JSModuleDef * m) { JS_SetModuleExport(ctx, m, "COMBO_BUTTON_SPACING", JS_NewInt32(ctx, COMBO_BUTTON_SPACING)); JS_SetModuleExport(ctx, m, "ARROW_PADDING", JS_NewInt32(ctx, ARROW_PADDING)); JS_SetModuleExport(ctx, m, "DROPDOWN_ITEMS_SPACING", JS_NewInt32(ctx, DROPDOWN_ITEMS_SPACING)); - JS_SetModuleExport(ctx, m, "TEXT_INNER_PADDING", JS_NewInt32(ctx, TEXT_INNER_PADDING)); - JS_SetModuleExport(ctx, m, "TEXT_LINES_SPACING", JS_NewInt32(ctx, TEXT_LINES_SPACING)); - JS_SetModuleExport(ctx, m, "TEXT_ALIGNMENT_VERTICAL", JS_NewInt32(ctx, TEXT_ALIGNMENT_VERTICAL)); - JS_SetModuleExport(ctx, m, "TEXT_MULTILINE", JS_NewInt32(ctx, TEXT_MULTILINE)); - JS_SetModuleExport(ctx, m, "TEXT_WRAP_MODE", JS_NewInt32(ctx, TEXT_WRAP_MODE)); + JS_SetModuleExport(ctx, m, "TEXT_READONLY", JS_NewInt32(ctx, TEXT_READONLY)); JS_SetModuleExport(ctx, m, "SPIN_BUTTON_WIDTH", JS_NewInt32(ctx, SPIN_BUTTON_WIDTH)); JS_SetModuleExport(ctx, m, "SPIN_BUTTON_SPACING", JS_NewInt32(ctx, SPIN_BUTTON_SPACING)); JS_SetModuleExport(ctx, m, "LIST_ITEMS_HEIGHT", JS_NewInt32(ctx, LIST_ITEMS_HEIGHT)); @@ -11971,9 +12988,9 @@ static int js_raylib_core_init(JSContext * ctx, JSModuleDef * m) { JS_SetModuleExport(ctx, m, "ICON_FOLDER", JS_NewInt32(ctx, ICON_FOLDER)); JS_SetModuleExport(ctx, m, "ICON_FILE", JS_NewInt32(ctx, ICON_FILE)); JS_SetModuleExport(ctx, m, "ICON_SAND_TIMER", JS_NewInt32(ctx, ICON_SAND_TIMER)); - JS_SetModuleExport(ctx, m, "ICON_220", JS_NewInt32(ctx, ICON_220)); - JS_SetModuleExport(ctx, m, "ICON_221", JS_NewInt32(ctx, ICON_221)); - JS_SetModuleExport(ctx, m, "ICON_222", JS_NewInt32(ctx, ICON_222)); + JS_SetModuleExport(ctx, m, "ICON_WARNING", JS_NewInt32(ctx, ICON_WARNING)); + JS_SetModuleExport(ctx, m, "ICON_HELP_BOX", JS_NewInt32(ctx, ICON_HELP_BOX)); + JS_SetModuleExport(ctx, m, "ICON_INFO_BOX", JS_NewInt32(ctx, ICON_INFO_BOX)); JS_SetModuleExport(ctx, m, "ICON_223", JS_NewInt32(ctx, ICON_223)); JS_SetModuleExport(ctx, m, "ICON_224", JS_NewInt32(ctx, ICON_224)); JS_SetModuleExport(ctx, m, "ICON_225", JS_NewInt32(ctx, ICON_225)); @@ -12073,6 +13090,7 @@ JSModuleDef * js_init_module_raylib_core(JSContext * ctx, const char * module_na JS_AddModuleExport(ctx, m, "FLAG_WINDOW_TRANSPARENT"); JS_AddModuleExport(ctx, m, "FLAG_WINDOW_HIGHDPI"); JS_AddModuleExport(ctx, m, "FLAG_WINDOW_MOUSE_PASSTHROUGH"); + JS_AddModuleExport(ctx, m, "FLAG_BORDERLESS_WINDOWED_MODE"); JS_AddModuleExport(ctx, m, "FLAG_MSAA_4X_HINT"); JS_AddModuleExport(ctx, m, "FLAG_INTERLACED_HINT"); JS_AddModuleExport(ctx, m, "LOG_ALL"); @@ -12295,6 +13313,9 @@ JSModuleDef * js_init_module_raylib_core(JSContext * ctx, const char * module_na JS_AddModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R32"); JS_AddModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R32G32B32"); JS_AddModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R32G32B32A32"); + JS_AddModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R16"); + JS_AddModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R16G16B16"); + JS_AddModuleExport(ctx, m, "PIXELFORMAT_UNCOMPRESSED_R16G16B16A16"); JS_AddModuleExport(ctx, m, "PIXELFORMAT_COMPRESSED_DXT1_RGB"); JS_AddModuleExport(ctx, m, "PIXELFORMAT_COMPRESSED_DXT1_RGBA"); JS_AddModuleExport(ctx, m, "PIXELFORMAT_COMPRESSED_DXT3_RGBA"); @@ -12361,6 +13382,12 @@ JSModuleDef * js_init_module_raylib_core(JSContext * ctx, const char * module_na JS_AddModuleExport(ctx, m, "TEXT_ALIGN_LEFT"); JS_AddModuleExport(ctx, m, "TEXT_ALIGN_CENTER"); JS_AddModuleExport(ctx, m, "TEXT_ALIGN_RIGHT"); + JS_AddModuleExport(ctx, m, "TEXT_ALIGN_TOP"); + JS_AddModuleExport(ctx, m, "TEXT_ALIGN_MIDDLE"); + JS_AddModuleExport(ctx, m, "TEXT_ALIGN_BOTTOM"); + JS_AddModuleExport(ctx, m, "TEXT_WRAP_NONE"); + JS_AddModuleExport(ctx, m, "TEXT_WRAP_CHAR"); + JS_AddModuleExport(ctx, m, "TEXT_WRAP_WORD"); JS_AddModuleExport(ctx, m, "DEFAULT"); JS_AddModuleExport(ctx, m, "LABEL"); JS_AddModuleExport(ctx, m, "BUTTON"); @@ -12392,11 +13419,13 @@ JSModuleDef * js_init_module_raylib_core(JSContext * ctx, const char * module_na JS_AddModuleExport(ctx, m, "BORDER_WIDTH"); JS_AddModuleExport(ctx, m, "TEXT_PADDING"); JS_AddModuleExport(ctx, m, "TEXT_ALIGNMENT"); - JS_AddModuleExport(ctx, m, "RESERVED"); JS_AddModuleExport(ctx, m, "TEXT_SIZE"); JS_AddModuleExport(ctx, m, "TEXT_SPACING"); JS_AddModuleExport(ctx, m, "LINE_COLOR"); JS_AddModuleExport(ctx, m, "BACKGROUND_COLOR"); + JS_AddModuleExport(ctx, m, "TEXT_LINE_SPACING"); + JS_AddModuleExport(ctx, m, "TEXT_ALIGNMENT_VERTICAL"); + JS_AddModuleExport(ctx, m, "TEXT_WRAP_MODE"); JS_AddModuleExport(ctx, m, "GROUP_PADDING"); JS_AddModuleExport(ctx, m, "SLIDER_WIDTH"); JS_AddModuleExport(ctx, m, "SLIDER_PADDING"); @@ -12412,11 +13441,7 @@ JSModuleDef * js_init_module_raylib_core(JSContext * ctx, const char * module_na JS_AddModuleExport(ctx, m, "COMBO_BUTTON_SPACING"); JS_AddModuleExport(ctx, m, "ARROW_PADDING"); JS_AddModuleExport(ctx, m, "DROPDOWN_ITEMS_SPACING"); - JS_AddModuleExport(ctx, m, "TEXT_INNER_PADDING"); - JS_AddModuleExport(ctx, m, "TEXT_LINES_SPACING"); - JS_AddModuleExport(ctx, m, "TEXT_ALIGNMENT_VERTICAL"); - JS_AddModuleExport(ctx, m, "TEXT_MULTILINE"); - JS_AddModuleExport(ctx, m, "TEXT_WRAP_MODE"); + JS_AddModuleExport(ctx, m, "TEXT_READONLY"); JS_AddModuleExport(ctx, m, "SPIN_BUTTON_WIDTH"); JS_AddModuleExport(ctx, m, "SPIN_BUTTON_SPACING"); JS_AddModuleExport(ctx, m, "LIST_ITEMS_HEIGHT"); @@ -12648,9 +13673,9 @@ JSModuleDef * js_init_module_raylib_core(JSContext * ctx, const char * module_na JS_AddModuleExport(ctx, m, "ICON_FOLDER"); JS_AddModuleExport(ctx, m, "ICON_FILE"); JS_AddModuleExport(ctx, m, "ICON_SAND_TIMER"); - JS_AddModuleExport(ctx, m, "ICON_220"); - JS_AddModuleExport(ctx, m, "ICON_221"); - JS_AddModuleExport(ctx, m, "ICON_222"); + JS_AddModuleExport(ctx, m, "ICON_WARNING"); + JS_AddModuleExport(ctx, m, "ICON_HELP_BOX"); + JS_AddModuleExport(ctx, m, "ICON_INFO_BOX"); JS_AddModuleExport(ctx, m, "ICON_223"); JS_AddModuleExport(ctx, m, "ICON_224"); JS_AddModuleExport(ctx, m, "ICON_225"); diff --git a/thirdparty/quickjs b/thirdparty/quickjs index 2788d71..6a89d7c 160000 --- a/thirdparty/quickjs +++ b/thirdparty/quickjs @@ -1 +1 @@ -Subproject commit 2788d71e823b522b178db3b3660ce93689534e6d +Subproject commit 6a89d7c27099be84e5312a7ec73205d6a7abe1b4 diff --git a/thirdparty/raygui b/thirdparty/raygui index aa81c16..82ba2b1 160000 --- a/thirdparty/raygui +++ b/thirdparty/raygui @@ -1 +1 @@ -Subproject commit aa81c167f10707ea173ea1190eda18e57d841b8f +Subproject commit 82ba2b1a783208d6a1f80d8977d796635260c161 diff --git a/thirdparty/raylib b/thirdparty/raylib index d3ea649..9a8d73e 160000 --- a/thirdparty/raylib +++ b/thirdparty/raylib @@ -1 +1 @@ -Subproject commit d3ea64983212f7451a9cfbf644da8a5c43dbc706 +Subproject commit 9a8d73e6c32514275a0ba53fe528bcb7c2693e27