From af9c9d214e85057edc1fd6a3b8c60d83a327fb85 Mon Sep 17 00:00:00 2001 From: v4rgas <66626747+v4rgas@users.noreply.github.com> Date: Mon, 24 Feb 2025 23:08:48 -0300 Subject: [PATCH 1/6] chore: update dependencies and change multilspy source to local path --- poetry.lock | 8 +++----- pyproject.toml | 5 +++-- vendor/multilspy | 1 + 3 files changed, 7 insertions(+), 7 deletions(-) create mode 160000 vendor/multilspy diff --git a/poetry.lock b/poetry.lock index 8d1c3879..9cfb48ff 100644 --- a/poetry.lock +++ b/poetry.lock @@ -316,10 +316,8 @@ pydantic = ">=1.10.5,<2" requests = "2.32.3" [package.source] -type = "git" -url = "https://github.com/blarApp/multilspy.git" -reference = "HEAD" -resolved_reference = "048bbeca841b6ae2e8891e6addfcc2328fc56219" +type = "directory" +url = "vendor/multilspy" [[package]] name = "neo4j" @@ -821,4 +819,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = ">=3.10,<=3.14" -content-hash = "06565b2c28596ebb4359a4c55aae0ec1a9d06478d8399bc12164fe9ab8b832c8" +content-hash = "6f76f68e463ad7691184a6993568a3e8e95de3d41a384423a21c7a1ff766a5cd" diff --git a/pyproject.toml b/pyproject.toml index fa9b5a5c..e8852894 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "A simple graph builder based on LSP calls" authors = ["Juan Vargas ", "Benjamín Errazuriz "] readme = "README.md" homepage = "https://blar.io" -repository = "https://github.com/blarApp/code-base-agent" +repository = "https://github.com/blarApp/blarify" license = "MIT" packages = [{include = "blarify"}] @@ -21,9 +21,10 @@ tree-sitter-ruby = "^0.23.0" tree-sitter-javascript = "^0.23.0" tree-sitter-typescript = "^0.23.2" tree-sitter-c-sharp = "^0.23.1" -multilspy = {git = "https://github.com/blarApp/multilspy.git"} tree-sitter-go = "^0.23.4" falkordb = "^1.0.10" +requests = "^2.32.3" +multilspy = {path = "vendor/multilspy"} [build-system] diff --git a/vendor/multilspy b/vendor/multilspy new file mode 160000 index 00000000..048bbeca --- /dev/null +++ b/vendor/multilspy @@ -0,0 +1 @@ +Subproject commit 048bbeca841b6ae2e8891e6addfcc2328fc56219 From 8c0d383d416a6f71c7edb371bca745f7c980d7e9 Mon Sep 17 00:00:00 2001 From: v4rgas <66626747+v4rgas@users.noreply.github.com> Date: Tue, 25 Feb 2025 09:44:06 -0300 Subject: [PATCH 2/6] chore: add multilspy as a vendor dependency and update import paths --- blarify/code_references/lsp_helper.py | 7 +- poetry.lock | 265 +------------------------- pyproject.toml | 5 +- requirements-vendor.txt | 1 + vendor/multilspy.pyi | 1 + 5 files changed, 11 insertions(+), 268 deletions(-) create mode 100644 requirements-vendor.txt create mode 100644 vendor/multilspy.pyi diff --git a/blarify/code_references/lsp_helper.py b/blarify/code_references/lsp_helper.py index 74f63cb8..69875c27 100644 --- a/blarify/code_references/lsp_helper.py +++ b/blarify/code_references/lsp_helper.py @@ -1,6 +1,6 @@ from typing import Optional -from multilspy import SyncLanguageServer +from vendor.multilspy import SyncLanguageServer from blarify.utils.path_calculator import PathCalculator @@ -16,8 +16,9 @@ GoDefinitions, ) -from multilspy.multilspy_config import MultilspyConfig -from multilspy.multilspy_logger import MultilspyLogger +from vendor.multilspy.multilspy_config import MultilspyConfig +from vendor.multilspy.multilspy_logger import MultilspyLogger + import logging diff --git a/poetry.lock b/poetry.lock index 9cfb48ff..bff913d6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -27,53 +27,6 @@ files = [ {file = "asyncio-3.4.3.tar.gz", hash = "sha256:83360ff8bc97980e4ff25c964c7bd3923d333d177aa4f7fb736b019f26c7cb41"}, ] -[[package]] -name = "attrs" -version = "25.1.0" -description = "Classes Without Boilerplate" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "attrs-25.1.0-py3-none-any.whl", hash = "sha256:c75a69e28a550a7e93789579c22aa26b0f5b83b75dc4e08fe092980051e1090a"}, - {file = "attrs-25.1.0.tar.gz", hash = "sha256:1c97078a80c814273a76b2a298a932eb681c87415c11dee0a6921de7f1b02c3e"}, -] - -[package.extras] -benchmark = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] -cov = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] -dev = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pre-commit-uv", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] -docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"] -tests = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] -tests-mypy = ["mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\""] - -[[package]] -name = "cattrs" -version = "24.1.2" -description = "Composable complex class support for attrs and dataclasses." -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "cattrs-24.1.2-py3-none-any.whl", hash = "sha256:67c7495b760168d931a10233f979b28dc04daf853b30752246f4f8471c6d68d0"}, - {file = "cattrs-24.1.2.tar.gz", hash = "sha256:8028cfe1ff5382df59dd36474a86e02d817b06eaf8af84555441bac915d2ef85"}, -] - -[package.dependencies] -attrs = ">=23.1.0" -exceptiongroup = {version = ">=1.1.1", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.1.0,<4.6.3 || >4.6.3", markers = "python_version < \"3.11\""} - -[package.extras] -bson = ["pymongo (>=4.4.0)"] -cbor2 = ["cbor2 (>=5.4.6)"] -msgpack = ["msgpack (>=1.0.5)"] -msgspec = ["msgspec (>=0.18.5) ; implementation_name == \"cpython\""] -orjson = ["orjson (>=3.9.2) ; implementation_name == \"cpython\""] -pyyaml = ["pyyaml (>=6.0)"] -tomlkit = ["tomlkit (>=0.11.8)"] -ujson = ["ujson (>=5.7.0)"] - [[package]] name = "certifi" version = "2025.1.31" @@ -188,34 +141,6 @@ files = [ {file = "charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3"}, ] -[[package]] -name = "docstring-to-markdown" -version = "0.15" -description = "On the fly conversion of Python docstrings to markdown" -optional = false -python-versions = ">=3.6" -groups = ["main"] -files = [ - {file = "docstring-to-markdown-0.15.tar.gz", hash = "sha256:e146114d9c50c181b1d25505054a8d0f7a476837f0da2c19f07e06eaed52b73d"}, - {file = "docstring_to_markdown-0.15-py3-none-any.whl", hash = "sha256:27afb3faedba81e34c33521c32bbd258d7fbb79eedf7d29bc4e81080e854aec0"}, -] - -[[package]] -name = "exceptiongroup" -version = "1.2.2" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -groups = ["main"] -markers = "python_version < \"3.11\"" -files = [ - {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, - {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, -] - -[package.extras] -test = ["pytest (>=6)"] - [[package]] name = "falkordb" version = "1.0.10" @@ -245,80 +170,6 @@ files = [ [package.extras] all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] -[[package]] -name = "jedi" -version = "0.19.2" -description = "An autocompletion tool for Python that can be used for text editors." -optional = false -python-versions = ">=3.6" -groups = ["main"] -files = [ - {file = "jedi-0.19.2-py2.py3-none-any.whl", hash = "sha256:a8ef22bde8490f57fe5c7681a3c83cb58874daf72b4784de3cce5b6ef6edb5b9"}, - {file = "jedi-0.19.2.tar.gz", hash = "sha256:4770dc3de41bde3966b02eb84fbcf557fb33cce26ad23da12c742fb50ecb11f0"}, -] - -[package.dependencies] -parso = ">=0.8.4,<0.9.0" - -[package.extras] -docs = ["Jinja2 (==2.11.3)", "MarkupSafe (==1.1.1)", "Pygments (==2.8.1)", "alabaster (==0.7.12)", "babel (==2.9.1)", "chardet (==4.0.0)", "commonmark (==0.8.1)", "docutils (==0.17.1)", "future (==0.18.2)", "idna (==2.10)", "imagesize (==1.2.0)", "mock (==1.0.1)", "packaging (==20.9)", "pyparsing (==2.4.7)", "pytz (==2021.1)", "readthedocs-sphinx-ext (==2.1.4)", "recommonmark (==0.5.0)", "requests (==2.25.1)", "six (==1.15.0)", "snowballstemmer (==2.1.0)", "sphinx (==1.8.5)", "sphinx-rtd-theme (==0.4.3)", "sphinxcontrib-serializinghtml (==1.1.4)", "sphinxcontrib-websupport (==1.2.4)", "urllib3 (==1.26.4)"] -qa = ["flake8 (==5.0.4)", "mypy (==0.971)", "types-setuptools (==67.2.0.1)"] -testing = ["Django", "attrs", "colorama", "docopt", "pytest (<9.0.0)"] - -[[package]] -name = "jedi-language-server" -version = "0.41.1" -description = "A language server for Jedi!" -optional = false -python-versions = ">=3.8,<4.0" -groups = ["main"] -files = [ - {file = "jedi_language_server-0.41.1-py3-none-any.whl", hash = "sha256:ca9b3e7f48b70f0988d85ffde4f01dd1ab94c8e0f69e8c6424e6657117b44f91"}, - {file = "jedi_language_server-0.41.1.tar.gz", hash = "sha256:3f15ca5cc28e728564f7d63583e171b418025582447ce023512e3f2b2d71ebae"}, -] - -[package.dependencies] -cattrs = ">=23.1.2" -docstring-to-markdown = "==0.*" -jedi = ">=0.19.0,<0.20.0" -lsprotocol = ">=2022.0.0a9" -pygls = ">=1.0.1,<2.0.0" - -[[package]] -name = "lsprotocol" -version = "2023.0.1" -description = "Python implementation of the Language Server Protocol." -optional = false -python-versions = ">=3.7" -groups = ["main"] -files = [ - {file = "lsprotocol-2023.0.1-py3-none-any.whl", hash = "sha256:c75223c9e4af2f24272b14c6375787438279369236cd568f596d4951052a60f2"}, - {file = "lsprotocol-2023.0.1.tar.gz", hash = "sha256:cc5c15130d2403c18b734304339e51242d3018a05c4f7d0f198ad6e0cd21861d"}, -] - -[package.dependencies] -attrs = ">=21.3.0" -cattrs = "!=23.2.1" - -[[package]] -name = "multilspy" -version = "0.0.12" -description = "A language-agnostic LSP client in Python, with a library interface. Intended to be used to build applications around language servers. Currently multilspy supports language servers for Python, Rust, Java, Go, JavaScript, Ruby and C#. Originally appeared as part of Monitor-Guided Decoding (https://github.com/microsoft/monitors4codegen)" -optional = false -python-versions = ">=3.7" -groups = ["main"] -files = [] -develop = false - -[package.dependencies] -jedi-language-server = "0.41.1" -pydantic = ">=1.10.5,<2" -requests = "2.32.3" - -[package.source] -type = "directory" -url = "vendor/multilspy" - [[package]] name = "neo4j" version = "5.28.1" @@ -339,108 +190,6 @@ numpy = ["numpy (>=1.7.0,<3.0.0)"] pandas = ["numpy (>=1.7.0,<3.0.0)", "pandas (>=1.1.0,<3.0.0)"] pyarrow = ["pyarrow (>=1.0.0)"] -[[package]] -name = "parso" -version = "0.8.4" -description = "A Python Parser" -optional = false -python-versions = ">=3.6" -groups = ["main"] -files = [ - {file = "parso-0.8.4-py2.py3-none-any.whl", hash = "sha256:a418670a20291dacd2dddc80c377c5c3791378ee1e8d12bffc35420643d43f18"}, - {file = "parso-0.8.4.tar.gz", hash = "sha256:eb3a7b58240fb99099a345571deecc0f9540ea5f4dd2fe14c2a99d6b281ab92d"}, -] - -[package.extras] -qa = ["flake8 (==5.0.4)", "mypy (==0.971)", "types-setuptools (==67.2.0.1)"] -testing = ["docopt", "pytest"] - -[[package]] -name = "pydantic" -version = "1.10.21" -description = "Data validation and settings management using python type hints" -optional = false -python-versions = ">=3.7" -groups = ["main"] -files = [ - {file = "pydantic-1.10.21-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:245e486e0fec53ec2366df9cf1cba36e0bbf066af7cd9c974bbbd9ba10e1e586"}, - {file = "pydantic-1.10.21-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6c54f8d4c151c1de784c5b93dfbb872067e3414619e10e21e695f7bb84d1d1fd"}, - {file = "pydantic-1.10.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b64708009cfabd9c2211295144ff455ec7ceb4c4fb45a07a804309598f36187"}, - {file = "pydantic-1.10.21-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8a148410fa0e971ba333358d11a6dea7b48e063de127c2b09ece9d1c1137dde4"}, - {file = "pydantic-1.10.21-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:36ceadef055af06e7756eb4b871cdc9e5a27bdc06a45c820cd94b443de019bbf"}, - {file = "pydantic-1.10.21-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c0501e1d12df6ab1211b8cad52d2f7b2cd81f8e8e776d39aa5e71e2998d0379f"}, - {file = "pydantic-1.10.21-cp310-cp310-win_amd64.whl", hash = "sha256:c261127c275d7bce50b26b26c7d8427dcb5c4803e840e913f8d9df3f99dca55f"}, - {file = "pydantic-1.10.21-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8b6350b68566bb6b164fb06a3772e878887f3c857c46c0c534788081cb48adf4"}, - {file = "pydantic-1.10.21-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:935b19fdcde236f4fbf691959fa5c3e2b6951fff132964e869e57c70f2ad1ba3"}, - {file = "pydantic-1.10.21-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2b6a04efdcd25486b27f24c1648d5adc1633ad8b4506d0e96e5367f075ed2e0b"}, - {file = "pydantic-1.10.21-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c1ba253eb5af8d89864073e6ce8e6c8dec5f49920cff61f38f5c3383e38b1c9f"}, - {file = "pydantic-1.10.21-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:57f0101e6c97b411f287a0b7cf5ebc4e5d3b18254bf926f45a11615d29475793"}, - {file = "pydantic-1.10.21-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:90e85834f0370d737c77a386ce505c21b06bfe7086c1c568b70e15a568d9670d"}, - {file = "pydantic-1.10.21-cp311-cp311-win_amd64.whl", hash = "sha256:6a497bc66b3374b7d105763d1d3de76d949287bf28969bff4656206ab8a53aa9"}, - {file = "pydantic-1.10.21-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2ed4a5f13cf160d64aa331ab9017af81f3481cd9fd0e49f1d707b57fe1b9f3ae"}, - {file = "pydantic-1.10.21-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3b7693bb6ed3fbe250e222f9415abb73111bb09b73ab90d2d4d53f6390e0ccc1"}, - {file = "pydantic-1.10.21-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:185d5f1dff1fead51766da9b2de4f3dc3b8fca39e59383c273f34a6ae254e3e2"}, - {file = "pydantic-1.10.21-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:38e6d35cf7cd1727822c79e324fa0677e1a08c88a34f56695101f5ad4d5e20e5"}, - {file = "pydantic-1.10.21-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:1d7c332685eafacb64a1a7645b409a166eb7537f23142d26895746f628a3149b"}, - {file = "pydantic-1.10.21-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2c9b782db6f993a36092480eeaab8ba0609f786041b01f39c7c52252bda6d85f"}, - {file = "pydantic-1.10.21-cp312-cp312-win_amd64.whl", hash = "sha256:7ce64d23d4e71d9698492479505674c5c5b92cda02b07c91dfc13633b2eef805"}, - {file = "pydantic-1.10.21-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0067935d35044950be781933ab91b9a708eaff124bf860fa2f70aeb1c4be7212"}, - {file = "pydantic-1.10.21-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5e8148c2ce4894ce7e5a4925d9d3fdce429fb0e821b5a8783573f3611933a251"}, - {file = "pydantic-1.10.21-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4973232c98b9b44c78b1233693e5e1938add5af18042f031737e1214455f9b8"}, - {file = "pydantic-1.10.21-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:662bf5ce3c9b1cef32a32a2f4debe00d2f4839fefbebe1d6956e681122a9c839"}, - {file = "pydantic-1.10.21-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:98737c3ab5a2f8a85f2326eebcd214510f898881a290a7939a45ec294743c875"}, - {file = "pydantic-1.10.21-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0bb58bbe65a43483d49f66b6c8474424d551a3fbe8a7796c42da314bac712738"}, - {file = "pydantic-1.10.21-cp313-cp313-win_amd64.whl", hash = "sha256:e622314542fb48542c09c7bd1ac51d71c5632dd3c92dc82ede6da233f55f4848"}, - {file = "pydantic-1.10.21-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d356aa5b18ef5a24d8081f5c5beb67c0a2a6ff2a953ee38d65a2aa96526b274f"}, - {file = "pydantic-1.10.21-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:08caa8c0468172d27c669abfe9e7d96a8b1655ec0833753e117061febaaadef5"}, - {file = "pydantic-1.10.21-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c677aa39ec737fec932feb68e4a2abe142682f2885558402602cd9746a1c92e8"}, - {file = "pydantic-1.10.21-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:79577cc045d3442c4e845df53df9f9202546e2ba54954c057d253fc17cd16cb1"}, - {file = "pydantic-1.10.21-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:b6b73ab347284719f818acb14f7cd80696c6fdf1bd34feee1955d7a72d2e64ce"}, - {file = "pydantic-1.10.21-cp37-cp37m-win_amd64.whl", hash = "sha256:46cffa24891b06269e12f7e1ec50b73f0c9ab4ce71c2caa4ccf1fb36845e1ff7"}, - {file = "pydantic-1.10.21-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:298d6f765e3c9825dfa78f24c1efd29af91c3ab1b763e1fd26ae4d9e1749e5c8"}, - {file = "pydantic-1.10.21-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f2f4a2305f15eff68f874766d982114ac89468f1c2c0b97640e719cf1a078374"}, - {file = "pydantic-1.10.21-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:35b263b60c519354afb3a60107d20470dd5250b3ce54c08753f6975c406d949b"}, - {file = "pydantic-1.10.21-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e23a97a6c2f2db88995496db9387cd1727acdacc85835ba8619dce826c0b11a6"}, - {file = "pydantic-1.10.21-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:3c96fed246ccc1acb2df032ff642459e4ae18b315ecbab4d95c95cfa292e8517"}, - {file = "pydantic-1.10.21-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:b92893ebefc0151474f682e7debb6ab38552ce56a90e39a8834734c81f37c8a9"}, - {file = "pydantic-1.10.21-cp38-cp38-win_amd64.whl", hash = "sha256:b8460bc256bf0de821839aea6794bb38a4c0fbd48f949ea51093f6edce0be459"}, - {file = "pydantic-1.10.21-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5d387940f0f1a0adb3c44481aa379122d06df8486cc8f652a7b3b0caf08435f7"}, - {file = "pydantic-1.10.21-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:266ecfc384861d7b0b9c214788ddff75a2ea123aa756bcca6b2a1175edeca0fe"}, - {file = "pydantic-1.10.21-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61da798c05a06a362a2f8c5e3ff0341743e2818d0f530eaac0d6898f1b187f1f"}, - {file = "pydantic-1.10.21-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a621742da75ce272d64ea57bd7651ee2a115fa67c0f11d66d9dcfc18c2f1b106"}, - {file = "pydantic-1.10.21-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:9e3e4000cd54ef455694b8be9111ea20f66a686fc155feda1ecacf2322b115da"}, - {file = "pydantic-1.10.21-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:f198c8206640f4c0ef5a76b779241efb1380a300d88b1bce9bfe95a6362e674d"}, - {file = "pydantic-1.10.21-cp39-cp39-win_amd64.whl", hash = "sha256:e7f0cda108b36a30c8fc882e4fc5b7eec8ef584aa43aa43694c6a7b274fb2b56"}, - {file = "pydantic-1.10.21-py3-none-any.whl", hash = "sha256:db70c920cba9d05c69ad4a9e7f8e9e83011abb2c6490e561de9ae24aee44925c"}, - {file = "pydantic-1.10.21.tar.gz", hash = "sha256:64b48e2b609a6c22178a56c408ee1215a7206077ecb8a193e2fda31858b2362a"}, -] - -[package.dependencies] -typing-extensions = ">=4.2.0" - -[package.extras] -dotenv = ["python-dotenv (>=0.10.4)"] -email = ["email-validator (>=1.0.3)"] - -[[package]] -name = "pygls" -version = "1.3.1" -description = "A pythonic generic language server (pronounced like 'pie glass')" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "pygls-1.3.1-py3-none-any.whl", hash = "sha256:6e00f11efc56321bdeb6eac04f6d86131f654c7d49124344a9ebb968da3dd91e"}, - {file = "pygls-1.3.1.tar.gz", hash = "sha256:140edceefa0da0e9b3c533547c892a42a7d2fd9217ae848c330c53d266a55018"}, -] - -[package.dependencies] -cattrs = ">=23.1.2" -lsprotocol = "2023.0.1" - -[package.extras] -ws = ["websockets (>=11.0.3)"] - [[package]] name = "python-dotenv" version = "1.0.1" @@ -690,18 +439,6 @@ files = [ [package.extras] core = ["tree-sitter (>=0.23,<1.0)"] -[[package]] -name = "typing-extensions" -version = "4.12.2" -description = "Backported and Experimental Type Hints for Python 3.8+" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, - {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, -] - [[package]] name = "urllib3" version = "2.3.0" @@ -819,4 +556,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = ">=3.10,<=3.14" -content-hash = "6f76f68e463ad7691184a6993568a3e8e95de3d41a384423a21c7a1ff766a5cd" +content-hash = "54553d9aa66b5d708b75fe36d11a4f99213b286ccbcc9ee3dd178cb4a34c91b4" diff --git a/pyproject.toml b/pyproject.toml index e8852894..638251f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,11 @@ tree-sitter-c-sharp = "^0.23.1" tree-sitter-go = "^0.23.4" falkordb = "^1.0.10" requests = "^2.32.3" -multilspy = {path = "vendor/multilspy"} +[tool.vendoring] +destination = "vendor" +namespace = "vendor" +requirements = "requirements-vendor.txt" [build-system] requires = ["poetry-core"] diff --git a/requirements-vendor.txt b/requirements-vendor.txt new file mode 100644 index 00000000..f939cd12 --- /dev/null +++ b/requirements-vendor.txt @@ -0,0 +1 @@ +git+https://github.com/blarApp/multilspy.git \ No newline at end of file diff --git a/vendor/multilspy.pyi b/vendor/multilspy.pyi new file mode 100644 index 00000000..166a1201 --- /dev/null +++ b/vendor/multilspy.pyi @@ -0,0 +1 @@ +from multilspy import * \ No newline at end of file From e45a22778ec0ddb8e7a0a74f5d47e1afaf5a0ed7 Mon Sep 17 00:00:00 2001 From: v4rgas <66626747+v4rgas@users.noreply.github.com> Date: Tue, 25 Feb 2025 09:47:51 -0300 Subject: [PATCH 3/6] feat: restructure multilspy integration and update import paths --- blarify/code_references/lsp_helper.py | 6 +- {vendor => blarify/vendor}/multilspy.pyi | 0 blarify/vendor/multilspy/LICENSE | 21 + blarify/vendor/multilspy/__init__.py | 8 + blarify/vendor/multilspy/language_server.py | 941 + .../eclipse_jdtls/eclipse_jdtls.py | 405 + .../multilspy/language_servers/gopls/gopls.py | 151 + .../jedi_language_server/jedi_server.py | 120 + .../language_servers/omnisharp/omnisharp.py | 403 + .../rust_analyzer/rust_analyzer.py | 182 + .../language_servers/solargraph/solargraph.py | 193 + .../static/ts-lsp/node_modules/.bin/tsc | 1 + .../static/ts-lsp/node_modules/.bin/tsserver | 1 + .../.bin/typescript-language-server | 1 + .../typescript-language-server/CHANGELOG.md | 626 + .../typescript-language-server/LICENSE | 240 + .../typescript-language-server/README.md | 307 + .../typescript-language-server/lib/cli.mjs | 23535 ++ .../lib/cli.mjs.map | 1 + .../node_modules/typescript/LICENSE.txt | 55 + .../ts-lsp/node_modules/typescript/README.md | 50 + .../node_modules/typescript/SECURITY.md | 41 + .../typescript/ThirdPartyNoticeText.txt | 193 + .../ts-lsp/node_modules/typescript/bin/tsc | 2 + .../node_modules/typescript/bin/tsserver | 2 + .../typescript/lib/cancellationToken.js | 90 + .../node_modules/typescript/lib/lib.d.ts | 22 + .../typescript/lib/lib.decorators.d.ts | 386 + .../typescript/lib/lib.decorators.legacy.d.ts | 22 + .../typescript/lib/lib.dom.asynciterable.d.ts | 33 + .../node_modules/typescript/lib/lib.dom.d.ts | 28596 +++ .../typescript/lib/lib.dom.iterable.d.ts | 475 + .../typescript/lib/lib.es2015.collection.d.ts | 147 + .../typescript/lib/lib.es2015.core.d.ts | 597 + .../typescript/lib/lib.es2015.d.ts | 28 + .../typescript/lib/lib.es2015.generator.d.ts | 77 + .../typescript/lib/lib.es2015.iterable.d.ts | 495 + .../typescript/lib/lib.es2015.promise.d.ts | 81 + .../typescript/lib/lib.es2015.proxy.d.ts | 128 + .../typescript/lib/lib.es2015.reflect.d.ts | 144 + .../typescript/lib/lib.es2015.symbol.d.ts | 46 + .../lib/lib.es2015.symbol.wellknown.d.ts | 326 + .../lib/lib.es2016.array.include.d.ts | 116 + .../typescript/lib/lib.es2016.d.ts | 21 + .../typescript/lib/lib.es2016.full.d.ts | 23 + .../typescript/lib/lib.es2016.intl.d.ts | 31 + .../typescript/lib/lib.es2017.d.ts | 25 + .../typescript/lib/lib.es2017.date.d.ts | 31 + .../typescript/lib/lib.es2017.full.d.ts | 23 + .../typescript/lib/lib.es2017.intl.d.ts | 44 + .../typescript/lib/lib.es2017.object.d.ts | 49 + .../lib/lib.es2017.sharedmemory.d.ts | 135 + .../typescript/lib/lib.es2017.string.d.ts | 45 + .../lib/lib.es2017.typedarrays.d.ts | 53 + .../lib/lib.es2018.asyncgenerator.d.ts | 77 + .../lib/lib.es2018.asynciterable.d.ts | 43 + .../typescript/lib/lib.es2018.d.ts | 24 + .../typescript/lib/lib.es2018.full.d.ts | 24 + .../typescript/lib/lib.es2018.intl.d.ts | 83 + .../typescript/lib/lib.es2018.promise.d.ts | 30 + .../typescript/lib/lib.es2018.regexp.d.ts | 37 + .../typescript/lib/lib.es2019.array.d.ts | 79 + .../typescript/lib/lib.es2019.d.ts | 24 + .../typescript/lib/lib.es2019.full.d.ts | 24 + .../typescript/lib/lib.es2019.intl.d.ts | 23 + .../typescript/lib/lib.es2019.object.d.ts | 33 + .../typescript/lib/lib.es2019.string.d.ts | 37 + .../typescript/lib/lib.es2019.symbol.d.ts | 24 + .../typescript/lib/lib.es2020.bigint.d.ts | 727 + .../typescript/lib/lib.es2020.d.ts | 27 + .../typescript/lib/lib.es2020.date.d.ts | 42 + .../typescript/lib/lib.es2020.full.d.ts | 24 + .../typescript/lib/lib.es2020.intl.d.ts | 474 + .../typescript/lib/lib.es2020.number.d.ts | 28 + .../typescript/lib/lib.es2020.promise.d.ts | 47 + .../lib/lib.es2020.sharedmemory.d.ts | 97 + .../typescript/lib/lib.es2020.string.d.ts | 42 + .../lib/lib.es2020.symbol.wellknown.d.ts | 37 + .../typescript/lib/lib.es2021.d.ts | 23 + .../typescript/lib/lib.es2021.full.d.ts | 24 + .../typescript/lib/lib.es2021.intl.d.ts | 166 + .../typescript/lib/lib.es2021.promise.d.ts | 48 + .../typescript/lib/lib.es2021.string.d.ts | 33 + .../typescript/lib/lib.es2021.weakref.d.ts | 76 + .../typescript/lib/lib.es2022.array.d.ts | 121 + .../typescript/lib/lib.es2022.d.ts | 26 + .../typescript/lib/lib.es2022.error.d.ts | 73 + .../typescript/lib/lib.es2022.full.d.ts | 24 + .../typescript/lib/lib.es2022.intl.d.ts | 117 + .../typescript/lib/lib.es2022.object.d.ts | 26 + .../typescript/lib/lib.es2022.regexp.d.ts | 39 + .../lib/lib.es2022.sharedmemory.d.ts | 39 + .../typescript/lib/lib.es2022.string.d.ts | 25 + .../typescript/lib/lib.es2023.array.d.ts | 924 + .../typescript/lib/lib.es2023.collection.d.ts | 21 + .../typescript/lib/lib.es2023.d.ts | 22 + .../typescript/lib/lib.es2023.full.d.ts | 24 + .../typescript/lib/lib.es2023.intl.d.ts | 56 + .../node_modules/typescript/lib/lib.es5.d.ts | 4585 + .../node_modules/typescript/lib/lib.es6.d.ts | 23 + .../typescript/lib/lib.esnext.array.d.ts | 35 + .../typescript/lib/lib.esnext.collection.d.ts | 106 + .../typescript/lib/lib.esnext.d.ts | 28 + .../typescript/lib/lib.esnext.decorators.d.ts | 28 + .../typescript/lib/lib.esnext.disposable.d.ts | 185 + .../typescript/lib/lib.esnext.full.d.ts | 24 + .../typescript/lib/lib.esnext.intl.d.ts | 21 + .../typescript/lib/lib.esnext.object.d.ts | 29 + .../typescript/lib/lib.esnext.promise.d.ts | 35 + .../typescript/lib/lib.esnext.regexp.d.ts | 25 + .../typescript/lib/lib.esnext.string.d.ts | 29 + .../typescript/lib/lib.scripthost.d.ts | 322 + .../lib/lib.webworker.asynciterable.d.ts | 33 + .../typescript/lib/lib.webworker.d.ts | 9431 + .../lib/lib.webworker.importscripts.d.ts | 23 + .../lib/lib.webworker.iterable.d.ts | 276 + .../ts-lsp/node_modules/typescript/lib/tsc.js | 129810 ++++++++++ .../node_modules/typescript/lib/tsserver.js | 621 + .../typescript/lib/tsserverlibrary.d.ts | 17 + .../typescript/lib/tsserverlibrary.js | 21 + .../typescript/lib/typescript.d.ts | 11240 + .../node_modules/typescript/lib/typescript.js | 195005 +++++++++++++++ .../typescript/lib/typingsInstaller.js | 236 + .../node_modules/typescript/lib/watchGuard.js | 53 + .../typescript_language_server.py | 186 + .../lsp_protocol_handler/lsp_constants.py | 59 + .../lsp_protocol_handler/lsp_requests.py | 615 + .../lsp_protocol_handler/lsp_types.py | 5905 + .../multilspy/lsp_protocol_handler/server.py | 474 + blarify/vendor/multilspy/multilspy_config.py | 42 + .../vendor/multilspy/multilspy_exceptions.py | 14 + blarify/vendor/multilspy/multilspy_logger.py | 58 + .../vendor/multilspy/multilspy_settings.py | 26 + blarify/vendor/multilspy/multilspy_types.py | 283 + blarify/vendor/multilspy/multilspy_utils.py | 248 + blarify/vendor/multilspy/type_helpers.py | 25 + pyproject.toml | 6 +- vendor/multilspy | 1 - 138 files changed, 423964 insertions(+), 7 deletions(-) rename {vendor => blarify/vendor}/multilspy.pyi (100%) create mode 100644 blarify/vendor/multilspy/LICENSE create mode 100644 blarify/vendor/multilspy/__init__.py create mode 100644 blarify/vendor/multilspy/language_server.py create mode 100644 blarify/vendor/multilspy/language_servers/eclipse_jdtls/eclipse_jdtls.py create mode 100644 blarify/vendor/multilspy/language_servers/gopls/gopls.py create mode 100644 blarify/vendor/multilspy/language_servers/jedi_language_server/jedi_server.py create mode 100644 blarify/vendor/multilspy/language_servers/omnisharp/omnisharp.py create mode 100644 blarify/vendor/multilspy/language_servers/rust_analyzer/rust_analyzer.py create mode 100644 blarify/vendor/multilspy/language_servers/solargraph/solargraph.py create mode 120000 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/tsc create mode 120000 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/tsserver create mode 120000 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/typescript-language-server create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/CHANGELOG.md create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/LICENSE create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/README.md create mode 100755 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/lib/cli.mjs create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/lib/cli.mjs.map create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/LICENSE.txt create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/README.md create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/SECURITY.md create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/ThirdPartyNoticeText.txt create mode 100755 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/bin/tsc create mode 100755 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/bin/tsserver create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/cancellationToken.js create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.decorators.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.decorators.legacy.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.dom.asynciterable.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.dom.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.dom.iterable.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2015.collection.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2015.core.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2015.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2015.generator.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2015.iterable.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2015.promise.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2015.proxy.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2015.reflect.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2015.symbol.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2016.array.include.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2016.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2016.full.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2016.intl.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2017.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2017.date.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2017.full.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2017.intl.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2017.object.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2017.string.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2018.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2018.full.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2018.intl.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2018.promise.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2018.regexp.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2019.array.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2019.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2019.full.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2019.intl.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2019.object.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2019.string.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2019.symbol.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2020.bigint.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2020.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2020.date.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2020.full.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2020.intl.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2020.number.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2020.promise.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2020.string.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2021.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2021.full.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2021.intl.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2021.promise.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2021.string.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2021.weakref.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2022.array.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2022.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2022.error.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2022.full.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2022.intl.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2022.object.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2022.regexp.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2022.string.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2023.array.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2023.collection.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2023.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2023.full.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es2023.intl.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es5.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.es6.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.esnext.array.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.esnext.collection.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.esnext.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.esnext.decorators.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.esnext.disposable.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.esnext.full.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.esnext.intl.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.esnext.object.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.esnext.promise.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.esnext.regexp.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.esnext.string.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.scripthost.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.webworker.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.webworker.importscripts.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.webworker.iterable.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/tsc.js create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/tsserver.js create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/tsserverlibrary.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/tsserverlibrary.js create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/typescript.d.ts create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/typescript.js create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/typingsInstaller.js create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/watchGuard.js create mode 100644 blarify/vendor/multilspy/language_servers/typescript_language_server/typescript_language_server.py create mode 100644 blarify/vendor/multilspy/lsp_protocol_handler/lsp_constants.py create mode 100644 blarify/vendor/multilspy/lsp_protocol_handler/lsp_requests.py create mode 100644 blarify/vendor/multilspy/lsp_protocol_handler/lsp_types.py create mode 100644 blarify/vendor/multilspy/lsp_protocol_handler/server.py create mode 100644 blarify/vendor/multilspy/multilspy_config.py create mode 100644 blarify/vendor/multilspy/multilspy_exceptions.py create mode 100644 blarify/vendor/multilspy/multilspy_logger.py create mode 100644 blarify/vendor/multilspy/multilspy_settings.py create mode 100644 blarify/vendor/multilspy/multilspy_types.py create mode 100644 blarify/vendor/multilspy/multilspy_utils.py create mode 100644 blarify/vendor/multilspy/type_helpers.py delete mode 160000 vendor/multilspy diff --git a/blarify/code_references/lsp_helper.py b/blarify/code_references/lsp_helper.py index 69875c27..cc6f10ac 100644 --- a/blarify/code_references/lsp_helper.py +++ b/blarify/code_references/lsp_helper.py @@ -1,6 +1,6 @@ from typing import Optional -from vendor.multilspy import SyncLanguageServer +from blarify.vendor.multilspy import SyncLanguageServer from blarify.utils.path_calculator import PathCalculator @@ -16,8 +16,8 @@ GoDefinitions, ) -from vendor.multilspy.multilspy_config import MultilspyConfig -from vendor.multilspy.multilspy_logger import MultilspyLogger +from blarify.vendor.multilspy.multilspy_config import MultilspyConfig +from blarify.vendor.multilspy.multilspy_logger import MultilspyLogger import logging diff --git a/vendor/multilspy.pyi b/blarify/vendor/multilspy.pyi similarity index 100% rename from vendor/multilspy.pyi rename to blarify/vendor/multilspy.pyi diff --git a/blarify/vendor/multilspy/LICENSE b/blarify/vendor/multilspy/LICENSE new file mode 100644 index 00000000..9e841e7a --- /dev/null +++ b/blarify/vendor/multilspy/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/blarify/vendor/multilspy/__init__.py b/blarify/vendor/multilspy/__init__.py new file mode 100644 index 00000000..a8229e9f --- /dev/null +++ b/blarify/vendor/multilspy/__init__.py @@ -0,0 +1,8 @@ +""" +This module contains the multilspy API +""" + +from . import multilspy_types as Types +from .language_server import LanguageServer, SyncLanguageServer + +__all__ = ["LanguageServer", "Types", "SyncLanguageServer"] diff --git a/blarify/vendor/multilspy/language_server.py b/blarify/vendor/multilspy/language_server.py new file mode 100644 index 00000000..3cf4443d --- /dev/null +++ b/blarify/vendor/multilspy/language_server.py @@ -0,0 +1,941 @@ +""" +This file contains the main interface and the public API for multilspy. +The abstract class LanguageServer provides a factory method, creator that is +intended for creating instantiations of language specific clients. +The details of Language Specific configuration are not exposed to the user. +""" + +import asyncio +import dataclasses +import json +import time +import logging +import os +import pathlib +import threading +from contextlib import asynccontextmanager, contextmanager +from .lsp_protocol_handler.lsp_constants import LSPConstants +from .lsp_protocol_handler import lsp_types as LSPTypes + +from . import multilspy_types +from .multilspy_logger import MultilspyLogger +from .lsp_protocol_handler.server import ( + LanguageServerHandler, + ProcessLaunchInfo, +) +from .multilspy_config import MultilspyConfig, Language +from .multilspy_exceptions import MultilspyException +from .multilspy_utils import PathUtils, FileUtils, TextUtils +from pathlib import PurePath +from typing import AsyncIterator, Iterator, List, Dict, Union, Tuple +from .type_helpers import ensure_all_methods_implemented + + +@dataclasses.dataclass +class LSPFileBuffer: + """ + This class is used to store the contents of an open LSP file in memory. + """ + + # uri of the file + uri: str + + # The contents of the file + contents: str + + # The version of the file + version: int + + # The language id of the file + language_id: str + + # reference count of the file + ref_count: int + + +class LanguageServer: + """ + The LanguageServer class provides a language agnostic interface to the Language Server Protocol. + It is used to communicate with Language Servers of different programming languages. + """ + + @classmethod + def create( + cls, config: MultilspyConfig, logger: MultilspyLogger, repository_root_path: str + ) -> "LanguageServer": + """ + Creates a language specific LanguageServer instance based on the given configuration, and appropriate settings for the programming language. + + If language is Java, then ensure that jdk-17.0.6 or higher is installed, `java` is in PATH, and JAVA_HOME is set to the installation directory. + If language is JS/TS, then ensure that node (v18.16.0 or higher) is installed and in PATH. + + :param repository_root_path: The root path of the repository. + :param config: The Multilspy configuration. + :param logger: The logger to use. + + :return LanguageServer: A language specific LanguageServer instance. + """ + if config.code_language == Language.PYTHON: + from blarify.vendor.multilspy.language_servers.jedi_language_server.jedi_server import ( + JediServer, + ) + + return JediServer(config, logger, repository_root_path) + elif config.code_language == Language.JAVA: + from blarify.vendor.multilspy.language_servers.eclipse_jdtls.eclipse_jdtls import ( + EclipseJDTLS, + ) + + return EclipseJDTLS(config, logger, repository_root_path) + elif config.code_language == Language.RUST: + from blarify.vendor.multilspy.language_servers.rust_analyzer.rust_analyzer import ( + RustAnalyzer, + ) + + return RustAnalyzer(config, logger, repository_root_path) + elif config.code_language == Language.CSHARP: + from blarify.vendor.multilspy.language_servers.omnisharp.omnisharp import OmniSharp + + return OmniSharp(config, logger, repository_root_path) + elif config.code_language in [Language.TYPESCRIPT, Language.JAVASCRIPT]: + from blarify.vendor.multilspy.language_servers.typescript_language_server.typescript_language_server import ( + TypeScriptLanguageServer, + ) + + return TypeScriptLanguageServer(config, logger, repository_root_path) + elif config.code_language == Language.GO: + from blarify.vendor.multilspy.language_servers.gopls.gopls import Gopls + + return Gopls(config, logger, repository_root_path) + elif config.code_language == Language.RUBY: + from blarify.vendor.multilspy.language_servers.solargraph.solargraph import Solargraph + + return Solargraph(config, logger, repository_root_path) + else: + logger.log( + f"Language {config.code_language} is not supported", logging.ERROR + ) + raise MultilspyException( + f"Language {config.code_language} is not supported" + ) + + def __init__( + self, + config: MultilspyConfig, + logger: MultilspyLogger, + repository_root_path: str, + process_launch_info: ProcessLaunchInfo, + language_id: str, + ): + """ + Initializes a LanguageServer instance. + + Do not instantiate this class directly. Use `LanguageServer.create` method instead. + + :param config: The Multilspy configuration. + :param logger: The logger to use. + :param repository_root_path: The root path of the repository. + :param cmd: Each language server has a specific command used to start the server. + This parameter is the command to launch the language server process. + The command must pass appropriate flags to the binary, so that it runs in the stdio mode, + as opposed to HTTP, TCP modes supported by some language servers. + """ + if type(self) == LanguageServer: + raise MultilspyException( + "LanguageServer is an abstract class and cannot be instantiated directly. Use LanguageServer.create method instead." + ) + + self.logger = logger + self.server_started = False + self.repository_root_path: str = repository_root_path + self.completions_available = asyncio.Event() + + if config.trace_lsp_communication: + + def logging_fn(source, target, msg): + self.logger.log(f"LSP: {source} -> {target}: {str(msg)}", logging.DEBUG) + + else: + + def logging_fn(source, target, msg): + pass + + # cmd is obtained from the child classes, which provide the language specific command to start the language server + # LanguageServerHandler provides the functionality to start the language server and communicate with it + self.server: LanguageServerHandler = LanguageServerHandler( + process_launch_info, logger=logging_fn + ) + + self.language_id = language_id + self.open_file_buffers: Dict[str, LSPFileBuffer] = {} + + @asynccontextmanager + async def start_server(self) -> AsyncIterator["LanguageServer"]: + """ + Starts the Language Server and yields the LanguageServer instance. + + Usage: + ``` + async with lsp.start_server(): + # LanguageServer has been initialized and ready to serve requests + await lsp.request_definition(...) + await lsp.request_references(...) + # Shutdown the LanguageServer on exit from scope + # LanguageServer has been shutdown + ``` + """ + self.server_started = True + yield self + self.server_started = False + + # TODO: Add support for more LSP features + + @contextmanager + def open_file(self, relative_file_path: str) -> Iterator[None]: + """ + Open a file in the Language Server. This is required before making any requests to the Language Server. + + :param relative_file_path: The relative path of the file to open. + """ + if not self.server_started: + self.logger.log( + "open_file called before Language Server started", + logging.ERROR, + ) + raise MultilspyException("Language Server not started") + + absolute_file_path = str( + PurePath(self.repository_root_path, relative_file_path) + ) + uri = pathlib.Path(absolute_file_path).as_uri() + + if uri in self.open_file_buffers: + assert self.open_file_buffers[uri].uri == uri + assert self.open_file_buffers[uri].ref_count >= 1 + + self.open_file_buffers[uri].ref_count += 1 + yield + self.open_file_buffers[uri].ref_count -= 1 + else: + contents = FileUtils.read_file(self.logger, absolute_file_path) + + version = 0 + self.open_file_buffers[uri] = LSPFileBuffer( + uri, contents, version, self.language_id, 1 + ) + + self.server.notify.did_open_text_document( + { + LSPConstants.TEXT_DOCUMENT: { + LSPConstants.URI: uri, + LSPConstants.LANGUAGE_ID: self.language_id, + LSPConstants.VERSION: 0, + LSPConstants.TEXT: contents, + } + } + ) + yield + self.open_file_buffers[uri].ref_count -= 1 + + if self.open_file_buffers[uri].ref_count == 0: + self.server.notify.did_close_text_document( + { + LSPConstants.TEXT_DOCUMENT: { + LSPConstants.URI: uri, + } + } + ) + del self.open_file_buffers[uri] + + def insert_text_at_position( + self, relative_file_path: str, line: int, column: int, text_to_be_inserted: str + ) -> multilspy_types.Position: + """ + Insert text at the given line and column in the given file and return + the updated cursor position after inserting the text. + + :param relative_file_path: The relative path of the file to open. + :param line: The line number at which text should be inserted. + :param column: The column number at which text should be inserted. + :param text_to_be_inserted: The text to insert. + """ + if not self.server_started: + self.logger.log( + "insert_text_at_position called before Language Server started", + logging.ERROR, + ) + raise MultilspyException("Language Server not started") + + absolute_file_path = str( + PurePath(self.repository_root_path, relative_file_path) + ) + uri = pathlib.Path(absolute_file_path).as_uri() + + # Ensure the file is open + assert uri in self.open_file_buffers + + file_buffer = self.open_file_buffers[uri] + file_buffer.version += 1 + change_index = TextUtils.get_index_from_line_col( + file_buffer.contents, line, column + ) + file_buffer.contents = ( + file_buffer.contents[:change_index] + + text_to_be_inserted + + file_buffer.contents[change_index:] + ) + self.server.notify.did_change_text_document( + { + LSPConstants.TEXT_DOCUMENT: { + LSPConstants.VERSION: file_buffer.version, + LSPConstants.URI: file_buffer.uri, + }, + LSPConstants.CONTENT_CHANGES: [ + { + LSPConstants.RANGE: { + "start": {"line": line, "character": column}, + "end": {"line": line, "character": column}, + }, + "text": text_to_be_inserted, + } + ], + } + ) + new_l, new_c = TextUtils.get_updated_position_from_line_and_column_and_edit( + line, column, text_to_be_inserted + ) + return multilspy_types.Position(line=new_l, character=new_c) + + def delete_text_between_positions( + self, + relative_file_path: str, + start: multilspy_types.Position, + end: multilspy_types.Position, + ) -> str: + """ + Delete text between the given start and end positions in the given file and return the deleted text. + """ + if not self.server_started: + self.logger.log( + "insert_text_at_position called before Language Server started", + logging.ERROR, + ) + raise MultilspyException("Language Server not started") + + absolute_file_path = str( + PurePath(self.repository_root_path, relative_file_path) + ) + uri = pathlib.Path(absolute_file_path).as_uri() + + # Ensure the file is open + assert uri in self.open_file_buffers + + file_buffer = self.open_file_buffers[uri] + file_buffer.version += 1 + del_start_idx = TextUtils.get_index_from_line_col( + file_buffer.contents, start["line"], start["character"] + ) + del_end_idx = TextUtils.get_index_from_line_col( + file_buffer.contents, end["line"], end["character"] + ) + deleted_text = file_buffer.contents[del_start_idx:del_end_idx] + file_buffer.contents = ( + file_buffer.contents[:del_start_idx] + file_buffer.contents[del_end_idx:] + ) + self.server.notify.did_change_text_document( + { + LSPConstants.TEXT_DOCUMENT: { + LSPConstants.VERSION: file_buffer.version, + LSPConstants.URI: file_buffer.uri, + }, + LSPConstants.CONTENT_CHANGES: [ + {LSPConstants.RANGE: {"start": start, "end": end}, "text": ""} + ], + } + ) + return deleted_text + + def get_open_file_text(self, relative_file_path: str) -> str: + """ + Get the contents of the given opened file as per the Language Server. + + :param relative_file_path: The relative path of the file to open. + """ + if not self.server_started: + self.logger.log( + "get_open_file_text called before Language Server started", + logging.ERROR, + ) + raise MultilspyException("Language Server not started") + + absolute_file_path = str( + PurePath(self.repository_root_path, relative_file_path) + ) + uri = pathlib.Path(absolute_file_path).as_uri() + + # Ensure the file is open + assert uri in self.open_file_buffers + + file_buffer = self.open_file_buffers[uri] + return file_buffer.contents + + async def request_definition( + self, relative_file_path: str, line: int, column: int + ) -> List[multilspy_types.Location]: + """ + Raise a [textDocument/definition](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_definition) request to the Language Server + for the symbol at the given line and column in the given file. Wait for the response and return the result. + + :param relative_file_path: The relative path of the file that has the symbol for which definition should be looked up + :param line: The line number of the symbol + :param column: The column number of the symbol + + :return List[multilspy_types.Location]: A list of locations where the symbol is defined + """ + + if not self.server_started: + self.logger.log( + "find_function_definition called before Language Server started", + logging.ERROR, + ) + raise MultilspyException("Language Server not started") + + with self.open_file(relative_file_path): + # sending request to the language server and waiting for response + response = await self.server.send.definition( + { + LSPConstants.TEXT_DOCUMENT: { + LSPConstants.URI: pathlib.Path( + str(PurePath(self.repository_root_path, relative_file_path)) + ).as_uri() + }, + LSPConstants.POSITION: { + LSPConstants.LINE: line, + LSPConstants.CHARACTER: column, + }, + } + ) + + if not response: + self.logger.log( + "Empty response received from Language Server for definitions, defaulting to empty list", + logging.INFO, + ) + response = [] + + ret: List[multilspy_types.Location] = [] + if isinstance(response, list): + # response is either of type Location[] or LocationLink[] + for item in response: + assert isinstance(item, dict) + if LSPConstants.URI in item and LSPConstants.RANGE in item: + new_item: multilspy_types.Location = {} + new_item.update(item) + new_item["absolutePath"] = PathUtils.uri_to_path(new_item["uri"]) + new_item["relativePath"] = str( + PurePath( + os.path.relpath( + new_item["absolutePath"], self.repository_root_path + ) + ) + ) + ret.append(multilspy_types.Location(new_item)) + elif ( + LSPConstants.ORIGIN_SELECTION_RANGE in item + and LSPConstants.TARGET_URI in item + and LSPConstants.TARGET_RANGE in item + and LSPConstants.TARGET_SELECTION_RANGE in item + ): + new_item: multilspy_types.Location = {} + new_item["uri"] = item[LSPConstants.TARGET_URI] + new_item["absolutePath"] = PathUtils.uri_to_path(new_item["uri"]) + new_item["relativePath"] = str( + PurePath( + os.path.relpath( + new_item["absolutePath"], self.repository_root_path + ) + ) + ) + new_item["range"] = item[LSPConstants.TARGET_SELECTION_RANGE] + ret.append(multilspy_types.Location(**new_item)) + else: + assert False, f"Unexpected response from Language Server: {item}" + elif isinstance(response, dict): + # response is of type Location + assert LSPConstants.URI in response + assert LSPConstants.RANGE in response + + new_item: multilspy_types.Location = {} + new_item.update(response) + new_item["absolutePath"] = PathUtils.uri_to_path(new_item["uri"]) + new_item["relativePath"] = str( + PurePath( + os.path.relpath(new_item["absolutePath"], self.repository_root_path) + ) + ) + ret.append(multilspy_types.Location(**new_item)) + else: + assert False, f"Unexpected response from Language Server: {response}" + + return ret + + async def request_references( + self, relative_file_path: str, line: int, column: int + ) -> List[multilspy_types.Location]: + """ + Raise a [textDocument/references](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_references) request to the Language Server + to find references to the symbol at the given line and column in the given file. Wait for the response and return the result. + + :param relative_file_path: The relative path of the file that has the symbol for which references should be looked up + :param line: The line number of the symbol + :param column: The column number of the symbol + + :return List[multilspy_types.Location]: A list of locations where the symbol is referenced + """ + + if not self.server_started: + self.logger.log( + "find_all_callers_of_function called before Language Server started", + logging.ERROR, + ) + raise MultilspyException("Language Server not started") + + with self.open_file(relative_file_path): + # sending request to the language server and waiting for response + response = await self.server.send.references( + { + "context": {"includeDeclaration": False}, + "textDocument": { + "uri": pathlib.Path( + os.path.join(self.repository_root_path, relative_file_path) + ).as_uri() + }, + "position": {"line": line, "character": column}, + } + ) + + ret: List[multilspy_types.Location] = [] + + if not response: + self.logger.log( + "Empty response received from Language Server for references, defaulting to empty list", + logging.INFO, + ) + response = [] + + assert isinstance(response, list) + for item in response: + assert isinstance(item, dict) + assert LSPConstants.URI in item + assert LSPConstants.RANGE in item + + new_item: multilspy_types.Location = {} + new_item.update(item) + new_item["absolutePath"] = PathUtils.uri_to_path(new_item["uri"]) + new_item["relativePath"] = str( + PurePath( + os.path.relpath(new_item["absolutePath"], self.repository_root_path) + ) + ) + ret.append(multilspy_types.Location(**new_item)) + + return ret + + async def request_completions( + self, + relative_file_path: str, + line: int, + column: int, + allow_incomplete: bool = False, + ) -> List[multilspy_types.CompletionItem]: + """ + Raise a [textDocument/completion](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_completion) request to the Language Server + to find completions at the given line and column in the given file. Wait for the response and return the result. + + :param relative_file_path: The relative path of the file that has the symbol for which completions should be looked up + :param line: The line number of the symbol + :param column: The column number of the symbol + + :return List[multilspy_types.CompletionItem]: A list of completions + """ + with self.open_file(relative_file_path): + open_file_buffer = self.open_file_buffers[ + pathlib.Path( + os.path.join(self.repository_root_path, relative_file_path) + ).as_uri() + ] + completion_params: LSPTypes.CompletionParams = { + "position": {"line": line, "character": column}, + "textDocument": {"uri": open_file_buffer.uri}, + "context": {"triggerKind": LSPTypes.CompletionTriggerKind.Invoked}, + } + response: Union[ + List[LSPTypes.CompletionItem], LSPTypes.CompletionList, None + ] = None + + num_retries = 0 + while response is None or (response["isIncomplete"] and num_retries < 30): + await self.completions_available.wait() + response: Union[ + List[LSPTypes.CompletionItem], LSPTypes.CompletionList, None + ] = await self.server.send.completion(completion_params) + if isinstance(response, list): + response = {"items": response, "isIncomplete": False} + num_retries += 1 + + # TODO: Understand how to appropriately handle `isIncomplete` + if response is None or ( + response["isIncomplete"] and not (allow_incomplete) + ): + return [] + + if "items" in response: + response = response["items"] + + response: List[LSPTypes.CompletionItem] = response + + # TODO: Handle the case when the completion is a keyword + items = [ + item + for item in response + if item["kind"] != LSPTypes.CompletionItemKind.Keyword + ] + + completions_list: List[multilspy_types.CompletionItem] = [] + + for item in items: + assert "insertText" in item or "textEdit" in item + assert "kind" in item + completion_item = {} + if "detail" in item: + completion_item["detail"] = item["detail"] + + if "label" in item: + completion_item["completionText"] = item["label"] + completion_item["kind"] = item["kind"] + elif "insertText" in item: + completion_item["completionText"] = item["insertText"] + completion_item["kind"] = item["kind"] + elif "textEdit" in item and "newText" in item["textEdit"]: + completion_item["completionText"] = item["textEdit"]["newText"] + completion_item["kind"] = item["kind"] + elif "textEdit" in item and "range" in item["textEdit"]: + new_dot_lineno, new_dot_colno = ( + completion_params["position"]["line"], + completion_params["position"]["character"], + ) + assert all( + ( + item["textEdit"]["range"]["start"]["line"] + == new_dot_lineno, + item["textEdit"]["range"]["start"]["character"] + == new_dot_colno, + item["textEdit"]["range"]["start"]["line"] + == item["textEdit"]["range"]["end"]["line"], + item["textEdit"]["range"]["start"]["character"] + == item["textEdit"]["range"]["end"]["character"], + ) + ) + + completion_item["completionText"] = item["textEdit"]["newText"] + completion_item["kind"] = item["kind"] + elif "textEdit" in item and "insert" in item["textEdit"]: + assert False + else: + assert False + + completion_item = multilspy_types.CompletionItem(**completion_item) + completions_list.append(completion_item) + + return [ + json.loads(json_repr) + for json_repr in set( + [json.dumps(item, sort_keys=True) for item in completions_list] + ) + ] + + async def request_document_symbols( + self, relative_file_path: str + ) -> Tuple[ + List[multilspy_types.UnifiedSymbolInformation], + Union[List[multilspy_types.TreeRepr], None], + ]: + """ + Raise a [textDocument/documentSymbol](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentSymbol) request to the Language Server + to find symbols in the given file. Wait for the response and return the result. + + :param relative_file_path: The relative path of the file that has the symbols + + :return Tuple[List[multilspy_types.UnifiedSymbolInformation], Union[List[multilspy_types.TreeRepr], None]]: A list of symbols in the file, and the tree representation of the symbols + """ + with self.open_file(relative_file_path): + response = await self.server.send.document_symbol( + { + "textDocument": { + "uri": pathlib.Path( + os.path.join(self.repository_root_path, relative_file_path) + ).as_uri() + } + } + ) + + ret: List[multilspy_types.UnifiedSymbolInformation] = [] + l_tree = None + assert isinstance(response, list) + for item in response: + assert isinstance(item, dict) + assert LSPConstants.NAME in item + assert LSPConstants.KIND in item + + if LSPConstants.CHILDREN in item: + # TODO: l_tree should be a list of TreeRepr. Define the following function to return TreeRepr as well + + def visit_tree_nodes_and_build_tree_repr( + tree: LSPTypes.DocumentSymbol, + ) -> List[multilspy_types.UnifiedSymbolInformation]: + l: List[multilspy_types.UnifiedSymbolInformation] = [] + children = tree["children"] if "children" in tree else [] + if "children" in tree: + del tree["children"] + l.append(multilspy_types.UnifiedSymbolInformation(**tree)) + for child in children: + l.extend(visit_tree_nodes_and_build_tree_repr(child)) + return l + + ret.extend(visit_tree_nodes_and_build_tree_repr(item)) + else: + ret.append(multilspy_types.UnifiedSymbolInformation(**item)) + + return ret, l_tree + + async def request_hover( + self, relative_file_path: str, line: int, column: int + ) -> Union[multilspy_types.Hover, None]: + """ + Raise a [textDocument/hover](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_hover) request to the Language Server + to find the hover information at the given line and column in the given file. Wait for the response and return the result. + + :param relative_file_path: The relative path of the file that has the hover information + :param line: The line number of the symbol + :param column: The column number of the symbol + + :return None + """ + with self.open_file(relative_file_path): + response = await self.server.send.hover( + { + "textDocument": { + "uri": pathlib.Path( + os.path.join(self.repository_root_path, relative_file_path) + ).as_uri() + }, + "position": { + "line": line, + "character": column, + }, + } + ) + + if response is None: + return None + + assert isinstance(response, dict) + + return multilspy_types.Hover(**response) + + +@ensure_all_methods_implemented(LanguageServer) +class SyncLanguageServer: + """ + The SyncLanguageServer class provides a language agnostic interface to the Language Server Protocol. + It is used to communicate with Language Servers of different programming languages. + """ + + def __init__(self, language_server: LanguageServer) -> None: + self.language_server = language_server + self.loop = None + self.loop_thread = None + + @classmethod + def create( + cls, config: MultilspyConfig, logger: MultilspyLogger, repository_root_path: str + ) -> "SyncLanguageServer": + """ + Creates a language specific LanguageServer instance based on the given configuration, and appropriate settings for the programming language. + + If language is Java, then ensure that jdk-17.0.6 or higher is installed, `java` is in PATH, and JAVA_HOME is set to the installation directory. + + :param repository_root_path: The root path of the repository. + :param config: The Multilspy configuration. + :param logger: The logger to use. + + :return SyncLanguageServer: A language specific LanguageServer instance. + """ + return SyncLanguageServer( + LanguageServer.create(config, logger, repository_root_path) + ) + + @contextmanager + def open_file(self, relative_file_path: str) -> Iterator[None]: + """ + Open a file in the Language Server. This is required before making any requests to the Language Server. + + :param relative_file_path: The relative path of the file to open. + """ + with self.language_server.open_file(relative_file_path): + yield + + def insert_text_at_position( + self, relative_file_path: str, line: int, column: int, text_to_be_inserted: str + ) -> multilspy_types.Position: + """ + Insert text at the given line and column in the given file and return + the updated cursor position after inserting the text. + + :param relative_file_path: The relative path of the file to open. + :param line: The line number at which text should be inserted. + :param column: The column number at which text should be inserted. + :param text_to_be_inserted: The text to insert. + """ + return self.language_server.insert_text_at_position( + relative_file_path, line, column, text_to_be_inserted + ) + + def delete_text_between_positions( + self, + relative_file_path: str, + start: multilspy_types.Position, + end: multilspy_types.Position, + ) -> str: + """ + Delete text between the given start and end positions in the given file and return the deleted text. + """ + return self.language_server.delete_text_between_positions( + relative_file_path, start, end + ) + + def get_open_file_text(self, relative_file_path: str) -> str: + """ + Get the contents of the given opened file as per the Language Server. + + :param relative_file_path: The relative path of the file to open. + """ + return self.language_server.get_open_file_text(relative_file_path) + + @contextmanager + def start_server(self) -> Iterator["SyncLanguageServer"]: + """ + Starts the language server process and connects to it. + + :return: None + """ + self.loop = asyncio.new_event_loop() + loop_thread = threading.Thread(target=self.loop.run_forever, daemon=True) + loop_thread.start() + ctx = self.language_server.start_server() + asyncio.run_coroutine_threadsafe(ctx.__aenter__(), loop=self.loop).result() + yield self + asyncio.run_coroutine_threadsafe( + ctx.__aexit__(None, None, None), loop=self.loop + ).result() + self.loop.call_soon_threadsafe(self.loop.stop) + loop_thread.join() + + def request_definition( + self, file_path: str, line: int, column: int + ) -> List[multilspy_types.Location]: + """ + Raise a [textDocument/definition](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_definition) request to the Language Server + for the symbol at the given line and column in the given file. Wait for the response and return the result. + + :param relative_file_path: The relative path of the file that has the symbol for which definition should be looked up + :param line: The line number of the symbol + :param column: The column number of the symbol + + :return List[multilspy_types.Location]: A list of locations where the symbol is defined + """ + result = asyncio.run_coroutine_threadsafe( + self.language_server.request_definition(file_path, line, column), self.loop + ).result() + return result + + def request_references( + self, file_path: str, line: int, column: int + ) -> List[multilspy_types.Location]: + """ + Raise a [textDocument/references](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_references) request to the Language Server + to find references to the symbol at the given line and column in the given file. Wait for the response and return the result. + + :param relative_file_path: The relative path of the file that has the symbol for which references should be looked up + :param line: The line number of the symbol + :param column: The column number of the symbol + + :return List[multilspy_types.Location]: A list of locations where the symbol is referenced + """ + result = asyncio.run_coroutine_threadsafe( + self.language_server.request_references(file_path, line, column), self.loop + ).result(timeout=15) + return result + + def request_completions( + self, + relative_file_path: str, + line: int, + column: int, + allow_incomplete: bool = False, + ) -> List[multilspy_types.CompletionItem]: + """ + Raise a [textDocument/completion](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_completion) request to the Language Server + to find completions at the given line and column in the given file. Wait for the response and return the result. + + :param relative_file_path: The relative path of the file that has the symbol for which completions should be looked up + :param line: The line number of the symbol + :param column: The column number of the symbol + + :return List[multilspy_types.CompletionItem]: A list of completions + """ + result = asyncio.run_coroutine_threadsafe( + self.language_server.request_completions( + relative_file_path, line, column, allow_incomplete + ), + self.loop, + ).result() + return result + + def request_document_symbols( + self, relative_file_path: str + ) -> Tuple[ + List[multilspy_types.UnifiedSymbolInformation], + Union[List[multilspy_types.TreeRepr], None], + ]: + """ + Raise a [textDocument/documentSymbol](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentSymbol) request to the Language Server + to find symbols in the given file. Wait for the response and return the result. + + :param relative_file_path: The relative path of the file that has the symbols + + :return Tuple[List[multilspy_types.UnifiedSymbolInformation], Union[List[multilspy_types.TreeRepr], None]]: A list of symbols in the file, and the tree representation of the symbols + """ + result = asyncio.run_coroutine_threadsafe( + self.language_server.request_document_symbols(relative_file_path), self.loop + ).result() + return result + + def request_hover( + self, relative_file_path: str, line: int, column: int + ) -> Union[multilspy_types.Hover, None]: + """ + Raise a [textDocument/hover](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_hover) request to the Language Server + to find the hover information at the given line and column in the given file. Wait for the response and return the result. + + :param relative_file_path: The relative path of the file that has the hover information + :param line: The line number of the symbol + :param column: The column number of the symbol + + :return None + """ + result = asyncio.run_coroutine_threadsafe( + self.language_server.request_hover(relative_file_path, line, column), + self.loop, + ).result() + return result diff --git a/blarify/vendor/multilspy/language_servers/eclipse_jdtls/eclipse_jdtls.py b/blarify/vendor/multilspy/language_servers/eclipse_jdtls/eclipse_jdtls.py new file mode 100644 index 00000000..edecb8a4 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/eclipse_jdtls/eclipse_jdtls.py @@ -0,0 +1,405 @@ +""" +Provides Java specific instantiation of the LanguageServer class. Contains various configurations and settings specific to Java. +""" + +import asyncio +import dataclasses +import json +import logging +import os +import pathlib +import shutil +import stat +import uuid +from contextlib import asynccontextmanager +from typing import AsyncIterator + +from blarify.vendor.multilspy.multilspy_logger import MultilspyLogger +from blarify.vendor.multilspy.language_server import LanguageServer +from blarify.vendor.multilspy.lsp_protocol_handler.server import ProcessLaunchInfo +from blarify.vendor.multilspy.lsp_protocol_handler.lsp_types import InitializeParams +from blarify.vendor.multilspy.multilspy_config import MultilspyConfig +from blarify.vendor.multilspy.multilspy_settings import MultilspySettings +from blarify.vendor.multilspy.multilspy_utils import FileUtils +from blarify.vendor.multilspy.multilspy_utils import PlatformUtils +from pathlib import PurePath + + +@dataclasses.dataclass +class RuntimeDependencyPaths: + """ + Stores the paths to the runtime dependencies of EclipseJDTLS + """ + + gradle_path: str + lombok_jar_path: str + jre_path: str + jre_home_path: str + jdtls_launcher_jar_path: str + jdtls_readonly_config_path: str + intellicode_jar_path: str + intellisense_members_path: str + + +class EclipseJDTLS(LanguageServer): + """ + The EclipseJDTLS class provides a Java specific implementation of the LanguageServer class + """ + + def __init__(self, config: MultilspyConfig, logger: MultilspyLogger, repository_root_path: str): + """ + Creates a new EclipseJDTLS instance initializing the language server settings appropriately. + This class is not meant to be instantiated directly. Use LanguageServer.create() instead. + """ + + runtime_dependency_paths = self.setupRuntimeDependencies(logger, config) + self.runtime_dependency_paths = runtime_dependency_paths + + # ws_dir is the workspace directory for the EclipseJDTLS server + ws_dir = str( + PurePath( + MultilspySettings.get_language_server_directory(), + "EclipseJDTLS", + "workspaces", + uuid.uuid4().hex, + ) + ) + + # shared_cache_location is the global cache used by Eclipse JDTLS across all workspaces + shared_cache_location = str( + PurePath(MultilspySettings.get_global_cache_directory(), "lsp", "EclipseJDTLS", "sharedIndex") + ) + + jre_path = self.runtime_dependency_paths.jre_path + lombok_jar_path = self.runtime_dependency_paths.lombok_jar_path + + jdtls_launcher_jar = self.runtime_dependency_paths.jdtls_launcher_jar_path + + os.makedirs(ws_dir, exist_ok=True) + + data_dir = str(PurePath(ws_dir, "data_dir")) + jdtls_config_path = str(PurePath(ws_dir, "config_path")) + + jdtls_readonly_config_path = self.runtime_dependency_paths.jdtls_readonly_config_path + + if not os.path.exists(jdtls_config_path): + shutil.copytree(jdtls_readonly_config_path, jdtls_config_path) + + for static_path in [ + jre_path, + lombok_jar_path, + jdtls_launcher_jar, + jdtls_config_path, + jdtls_readonly_config_path, + ]: + assert os.path.exists(static_path), static_path + + # TODO: Add "self.runtime_dependency_paths.jre_home_path"/bin to $PATH as well + proc_env = {"syntaxserver": "false", "JAVA_HOME": self.runtime_dependency_paths.jre_home_path} + proc_cwd = repository_root_path + cmd = " ".join( + [ + jre_path, + "--add-modules=ALL-SYSTEM", + "--add-opens", + "java.base/java.util=ALL-UNNAMED", + "--add-opens", + "java.base/java.lang=ALL-UNNAMED", + "--add-opens", + "java.base/sun.nio.fs=ALL-UNNAMED", + "-Declipse.application=org.eclipse.jdt.ls.core.id1", + "-Dosgi.bundles.defaultStartLevel=4", + "-Declipse.product=org.eclipse.jdt.ls.core.product", + "-Djava.import.generatesMetadataFilesAtProjectRoot=false", + "-Dfile.encoding=utf8", + "-noverify", + "-XX:+UseParallelGC", + "-XX:GCTimeRatio=4", + "-XX:AdaptiveSizePolicyWeight=90", + "-Dsun.zip.disableMemoryMapping=true", + "-Djava.lsp.joinOnCompletion=true", + "-Xmx3G", + "-Xms100m", + "-Xlog:disable", + "-Dlog.level=ALL", + f"-javaagent:{lombok_jar_path}", + f"-Djdt.core.sharedIndexLocation={shared_cache_location}", + "-jar", + jdtls_launcher_jar, + "-configuration", + jdtls_config_path, + "-data", + data_dir, + ] + ) + + self.service_ready_event = asyncio.Event() + self.intellicode_enable_command_available = asyncio.Event() + self.initialize_searcher_command_available = asyncio.Event() + + super().__init__(config, logger, repository_root_path, ProcessLaunchInfo(cmd, proc_env, proc_cwd), "java") + + def setupRuntimeDependencies(self, logger: MultilspyLogger, config: MultilspyConfig) -> RuntimeDependencyPaths: + """ + Setup runtime dependencies for EclipseJDTLS. + """ + platformId = PlatformUtils.get_platform_id() + + with open(str(PurePath(os.path.dirname(__file__), "runtime_dependencies.json")), "r") as f: + runtimeDependencies = json.load(f) + del runtimeDependencies["_description"] + + os.makedirs(str(PurePath(os.path.abspath(os.path.dirname(__file__)), "static")), exist_ok=True) + + # assert platformId.value in [ + # "linux-x64", + # "win-x64", + # ], "Only linux-x64 platform is supported for in multilspy at the moment" + + gradle_path = str( + PurePath( + os.path.abspath(os.path.dirname(__file__)), + "static/gradle-7.3.3", + ) + ) + + if not os.path.exists(gradle_path): + FileUtils.download_and_extract_archive( + logger, + runtimeDependencies["gradle"]["platform-agnostic"]["url"], + str(PurePath(gradle_path).parent), + runtimeDependencies["gradle"]["platform-agnostic"]["archiveType"], + ) + + assert os.path.exists(gradle_path) + + dependency = runtimeDependencies["vscode-java"][platformId.value] + vscode_java_path = str( + PurePath(os.path.abspath(os.path.dirname(__file__)), "static", dependency["relative_extraction_path"]) + ) + os.makedirs(vscode_java_path, exist_ok=True) + jre_home_path = str(PurePath(vscode_java_path, dependency["jre_home_path"])) + jre_path = str(PurePath(vscode_java_path, dependency["jre_path"])) + lombok_jar_path = str(PurePath(vscode_java_path, dependency["lombok_jar_path"])) + jdtls_launcher_jar_path = str(PurePath(vscode_java_path, dependency["jdtls_launcher_jar_path"])) + jdtls_readonly_config_path = str(PurePath(vscode_java_path, dependency["jdtls_readonly_config_path"])) + if not all( + [ + os.path.exists(vscode_java_path), + os.path.exists(jre_home_path), + os.path.exists(jre_path), + os.path.exists(lombok_jar_path), + os.path.exists(jdtls_launcher_jar_path), + os.path.exists(jdtls_readonly_config_path), + ] + ): + FileUtils.download_and_extract_archive( + logger, dependency["url"], vscode_java_path, dependency["archiveType"] + ) + + os.chmod(jre_path, stat.S_IEXEC) + + assert os.path.exists(vscode_java_path) + assert os.path.exists(jre_home_path) + assert os.path.exists(jre_path) + assert os.path.exists(lombok_jar_path) + assert os.path.exists(jdtls_launcher_jar_path) + assert os.path.exists(jdtls_readonly_config_path) + + dependency = runtimeDependencies["intellicode"]["platform-agnostic"] + intellicode_directory_path = str( + PurePath(os.path.abspath(os.path.dirname(__file__)), "static", dependency["relative_extraction_path"]) + ) + os.makedirs(intellicode_directory_path, exist_ok=True) + intellicode_jar_path = str(PurePath(intellicode_directory_path, dependency["intellicode_jar_path"])) + intellisense_members_path = str(PurePath(intellicode_directory_path, dependency["intellisense_members_path"])) + if not all( + [ + os.path.exists(intellicode_directory_path), + os.path.exists(intellicode_jar_path), + os.path.exists(intellisense_members_path), + ] + ): + FileUtils.download_and_extract_archive( + logger, dependency["url"], intellicode_directory_path, dependency["archiveType"] + ) + + assert os.path.exists(intellicode_directory_path) + assert os.path.exists(intellicode_jar_path) + assert os.path.exists(intellisense_members_path) + + return RuntimeDependencyPaths( + gradle_path=gradle_path, + lombok_jar_path=lombok_jar_path, + jre_path=jre_path, + jre_home_path=jre_home_path, + jdtls_launcher_jar_path=jdtls_launcher_jar_path, + jdtls_readonly_config_path=jdtls_readonly_config_path, + intellicode_jar_path=intellicode_jar_path, + intellisense_members_path=intellisense_members_path, + ) + + def _get_initialize_params(self, repository_absolute_path: str) -> InitializeParams: + """ + Returns the initialize parameters for the EclipseJDTLS server. + """ + # Look into https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java to understand all the options available + with open(str(PurePath(os.path.dirname(__file__), "initialize_params.json")), "r") as f: + d: InitializeParams = json.load(f) + + del d["_description"] + + if not os.path.isabs(repository_absolute_path): + repository_absolute_path = os.path.abspath(repository_absolute_path) + + assert d["processId"] == "os.getpid()" + d["processId"] = os.getpid() + + assert d["rootPath"] == "repository_absolute_path" + d["rootPath"] = repository_absolute_path + + assert d["rootUri"] == "pathlib.Path(repository_absolute_path).as_uri()" + d["rootUri"] = pathlib.Path(repository_absolute_path).as_uri() + + assert d["initializationOptions"]["workspaceFolders"] == "[pathlib.Path(repository_absolute_path).as_uri()]" + d["initializationOptions"]["workspaceFolders"] = [pathlib.Path(repository_absolute_path).as_uri()] + + assert ( + d["workspaceFolders"] + == '[\n {\n "uri": pathlib.Path(repository_absolute_path).as_uri(),\n "name": os.path.basename(repository_absolute_path),\n }\n ]' + ) + d["workspaceFolders"] = [ + { + "uri": pathlib.Path(repository_absolute_path).as_uri(), + "name": os.path.basename(repository_absolute_path), + } + ] + + assert d["initializationOptions"]["bundles"] == ["intellicode-core.jar"] + bundles = [self.runtime_dependency_paths.intellicode_jar_path] + d["initializationOptions"]["bundles"] = bundles + + assert d["initializationOptions"]["settings"]["java"]["configuration"]["runtimes"] == [ + {"name": "JavaSE-17", "path": "static/vscode-java/extension/jre/17.0.8.1-linux-x86_64", "default": True} + ] + d["initializationOptions"]["settings"]["java"]["configuration"]["runtimes"] = [ + {"name": "JavaSE-17", "path": self.runtime_dependency_paths.jre_home_path, "default": True} + ] + + for runtime in d["initializationOptions"]["settings"]["java"]["configuration"]["runtimes"]: + assert "name" in runtime + assert "path" in runtime + assert os.path.exists( + runtime["path"] + ), f"Runtime required for eclipse_jdtls at path {runtime['path']} does not exist" + + assert d["initializationOptions"]["settings"]["java"]["import"]["gradle"]["home"] == "abs(static/gradle-7.3.3)" + d["initializationOptions"]["settings"]["java"]["import"]["gradle"][ + "home" + ] = self.runtime_dependency_paths.gradle_path + + d["initializationOptions"]["settings"]["java"]["import"]["gradle"]["java"][ + "home" + ] = self.runtime_dependency_paths.jre_path + + return d + + @asynccontextmanager + async def start_server(self) -> AsyncIterator["EclipseJDTLS"]: + """ + Starts the Eclipse JDTLS Language Server, waits for the server to be ready and yields the LanguageServer instance. + + Usage: + ``` + async with lsp.start_server(): + # LanguageServer has been initialized and ready to serve requests + await lsp.request_definition(...) + await lsp.request_references(...) + # Shutdown the LanguageServer on exit from scope + # LanguageServer has been shutdown + ``` + """ + + async def register_capability_handler(params): + assert "registrations" in params + for registration in params["registrations"]: + if registration["method"] == "textDocument/completion": + assert registration["registerOptions"]["resolveProvider"] == True + assert registration["registerOptions"]["triggerCharacters"] == [ + ".", + "@", + "#", + "*", + " ", + ] + self.completions_available.set() + if registration["method"] == "workspace/executeCommand": + if "java.intellicode.enable" in registration["registerOptions"]["commands"]: + self.intellicode_enable_command_available.set() + return + + async def lang_status_handler(params): + # TODO: Should we wait for + # server -> client: {'jsonrpc': '2.0', 'method': 'language/status', 'params': {'type': 'ProjectStatus', 'message': 'OK'}} + # Before proceeding? + if params["type"] == "ServiceReady" and params["message"] == "ServiceReady": + self.service_ready_event.set() + + async def execute_client_command_handler(params): + assert params["command"] == "_java.reloadBundles.command" + assert params["arguments"] == [] + return [] + + async def window_log_message(msg): + self.logger.log(f"LSP: window/logMessage: {msg}", logging.INFO) + + async def do_nothing(params): + return + + self.server.on_request("client/registerCapability", register_capability_handler) + self.server.on_notification("language/status", lang_status_handler) + self.server.on_notification("window/logMessage", window_log_message) + self.server.on_request("workspace/executeClientCommand", execute_client_command_handler) + self.server.on_notification("$/progress", do_nothing) + self.server.on_notification("textDocument/publishDiagnostics", do_nothing) + self.server.on_notification("language/actionableNotification", do_nothing) + + async with super().start_server(): + self.logger.log("Starting EclipseJDTLS server process", logging.INFO) + await self.server.start() + initialize_params = self._get_initialize_params(self.repository_root_path) + + self.logger.log( + "Sending initialize request from LSP client to LSP server and awaiting response", + logging.INFO, + ) + init_response = await self.server.send.initialize(initialize_params) + assert init_response["capabilities"]["textDocumentSync"]["change"] == 2 + assert "completionProvider" not in init_response["capabilities"] + assert "executeCommandProvider" not in init_response["capabilities"] + + self.server.notify.initialized({}) + + self.server.notify.workspace_did_change_configuration( + {"settings": initialize_params["initializationOptions"]["settings"]} + ) + + await self.intellicode_enable_command_available.wait() + + java_intellisense_members_path = self.runtime_dependency_paths.intellisense_members_path + assert os.path.exists(java_intellisense_members_path) + intellicode_enable_result = await self.server.send.execute_command( + { + "command": "java.intellicode.enable", + "arguments": [True, java_intellisense_members_path], + } + ) + assert intellicode_enable_result + + # TODO: Add comments about why we wait here, and how this can be optimized + await self.service_ready_event.wait() + + yield self + + await self.server.shutdown() + await self.server.stop() diff --git a/blarify/vendor/multilspy/language_servers/gopls/gopls.py b/blarify/vendor/multilspy/language_servers/gopls/gopls.py new file mode 100644 index 00000000..86b0d333 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/gopls/gopls.py @@ -0,0 +1,151 @@ +import asyncio +import json +import logging +import os +import pathlib +import subprocess +from contextlib import asynccontextmanager +from typing import AsyncIterator + +from blarify.vendor.multilspy.multilspy_logger import MultilspyLogger +from blarify.vendor.multilspy.language_server import LanguageServer +from blarify.vendor.multilspy.lsp_protocol_handler.server import ProcessLaunchInfo +from blarify.vendor.multilspy.lsp_protocol_handler.lsp_types import InitializeParams +from blarify.vendor.multilspy.multilspy_config import MultilspyConfig + + +class Gopls(LanguageServer): + """ + Provides Go specific instantiation of the LanguageServer class using gopls. + """ + + @staticmethod + def _get_go_version(): + """Get the installed Go version or None if not found.""" + try: + result = subprocess.run(['go', 'version'], capture_output=True, text=True) + if result.returncode == 0: + return result.stdout.strip() + except FileNotFoundError: + return None + return None + + @staticmethod + def _get_gopls_version(): + """Get the installed gopls version or None if not found.""" + try: + result = subprocess.run(['gopls', 'version'], capture_output=True, text=True) + if result.returncode == 0: + return result.stdout.strip() + except FileNotFoundError: + return None + return None + + @classmethod + def setup_runtime_dependency(cls): + """ + Check if required Go runtime dependencies are available. + Raises RuntimeError with helpful message if dependencies are missing. + """ + missing_deps = [] + + # Check for Go installation + go_version = cls._get_go_version() + if not go_version: + missing_deps.append(("Go", "https://golang.org/doc/install")) + + # Check for gopls + gopls_version = cls._get_gopls_version() + if not gopls_version: + missing_deps.append(("gopls", "https://pkg.go.dev/golang.org/x/tools/gopls#section-readme")) + + if missing_deps: + error_msg = "Missing required dependencies:\n" + for dep, install_url in missing_deps: + error_msg += f"- {dep}: Please install from {install_url}\n" + raise RuntimeError(error_msg) + + return True + + def __init__(self, config: MultilspyConfig, logger: MultilspyLogger, repository_root_path: str): + # Check runtime dependencies before initializing + self.setup_runtime_dependency() + + super().__init__( + config, + logger, + repository_root_path, + ProcessLaunchInfo(cmd="gopls", cwd=repository_root_path), + "go", + ) + self.server_ready = asyncio.Event() + self.request_id = 0 + + def _get_initialize_params(self, repository_absolute_path: str) -> InitializeParams: + """ + Returns the initialize params for the TypeScript Language Server. + """ + with open(os.path.join(os.path.dirname(__file__), "initialize_params.json"), "r") as f: + d = json.load(f) + + del d["_description"] + + d["processId"] = os.getpid() + assert d["rootPath"] == "$rootPath" + d["rootPath"] = repository_absolute_path + + assert d["rootUri"] == "$rootUri" + d["rootUri"] = pathlib.Path(repository_absolute_path).as_uri() + + assert d["workspaceFolders"][0]["uri"] == "$uri" + d["workspaceFolders"][0]["uri"] = pathlib.Path(repository_absolute_path).as_uri() + + assert d["workspaceFolders"][0]["name"] == "$name" + d["workspaceFolders"][0]["name"] = os.path.basename(repository_absolute_path) + + return d + + @asynccontextmanager + async def start_server(self) -> AsyncIterator["Gopls"]: + """Start gopls server process""" + async def register_capability_handler(params): + return + + async def window_log_message(msg): + self.logger.log(f"LSP: window/logMessage: {msg}", logging.INFO) + + async def do_nothing(params): + return + + self.server.on_request("client/registerCapability", register_capability_handler) + self.server.on_notification("window/logMessage", window_log_message) + self.server.on_notification("$/progress", do_nothing) + self.server.on_notification("textDocument/publishDiagnostics", do_nothing) + + async with super().start_server(): + self.logger.log("Starting gopls server process", logging.INFO) + await self.server.start() + initialize_params = self._get_initialize_params(self.repository_root_path) + + self.logger.log( + "Sending initialize request from LSP client to LSP server and awaiting response", + logging.INFO, + ) + init_response = await self.server.send.initialize(initialize_params) + + # Verify server capabilities + assert "textDocumentSync" in init_response["capabilities"] + assert "completionProvider" in init_response["capabilities"] + assert "definitionProvider" in init_response["capabilities"] + + self.server.notify.initialized({}) + self.completions_available.set() + + # gopls server is typically ready immediately after initialization + self.server_ready.set() + await self.server_ready.wait() + + yield self + + await self.server.shutdown() + await self.server.stop() diff --git a/blarify/vendor/multilspy/language_servers/jedi_language_server/jedi_server.py b/blarify/vendor/multilspy/language_servers/jedi_language_server/jedi_server.py new file mode 100644 index 00000000..09dc9a99 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/jedi_language_server/jedi_server.py @@ -0,0 +1,120 @@ +""" +Provides Python specific instantiation of the LanguageServer class. Contains various configurations and settings specific to Python. +""" + +import json +import logging +import os +import pathlib +from contextlib import asynccontextmanager +from typing import AsyncIterator + +from blarify.vendor.multilspy.multilspy_logger import MultilspyLogger +from blarify.vendor.multilspy.language_server import LanguageServer +from blarify.vendor.multilspy.lsp_protocol_handler.server import ProcessLaunchInfo +from blarify.vendor.multilspy.lsp_protocol_handler.lsp_types import InitializeParams +from blarify.vendor.multilspy.multilspy_config import MultilspyConfig + + +class JediServer(LanguageServer): + """ + Provides Python specific instantiation of the LanguageServer class. Contains various configurations and settings specific to Python. + """ + + def __init__(self, config: MultilspyConfig, logger: MultilspyLogger, repository_root_path: str): + """ + Creates a JediServer instance. This class is not meant to be instantiated directly. Use LanguageServer.create() instead. + """ + super().__init__( + config, + logger, + repository_root_path, + ProcessLaunchInfo(cmd="jedi-language-server", cwd=repository_root_path), + "python", + ) + + def _get_initialize_params(self, repository_absolute_path: str) -> InitializeParams: + """ + Returns the initialize params for the Jedi Language Server. + """ + with open(os.path.join(os.path.dirname(__file__), "initialize_params.json"), "r") as f: + d = json.load(f) + + del d["_description"] + + d["processId"] = os.getpid() + assert d["rootPath"] == "$rootPath" + d["rootPath"] = repository_absolute_path + + assert d["rootUri"] == "$rootUri" + d["rootUri"] = pathlib.Path(repository_absolute_path).as_uri() + + assert d["workspaceFolders"][0]["uri"] == "$uri" + d["workspaceFolders"][0]["uri"] = pathlib.Path(repository_absolute_path).as_uri() + + assert d["workspaceFolders"][0]["name"] == "$name" + d["workspaceFolders"][0]["name"] = os.path.basename(repository_absolute_path) + + return d + + @asynccontextmanager + async def start_server(self) -> AsyncIterator["JediServer"]: + """ + Starts the JEDI Language Server, waits for the server to be ready and yields the LanguageServer instance. + + Usage: + ``` + async with lsp.start_server(): + # LanguageServer has been initialized and ready to serve requests + await lsp.request_definition(...) + await lsp.request_references(...) + # Shutdown the LanguageServer on exit from scope + # LanguageServer has been shutdown + ``` + """ + + async def execute_client_command_handler(params): + return [] + + async def do_nothing(params): + return + + async def check_experimental_status(params): + if params["quiescent"] == True: + self.completions_available.set() + + async def window_log_message(msg): + self.logger.log(f"LSP: window/logMessage: {msg}", logging.INFO) + + self.server.on_request("client/registerCapability", do_nothing) + self.server.on_notification("language/status", do_nothing) + self.server.on_notification("window/logMessage", window_log_message) + self.server.on_request("workspace/executeClientCommand", execute_client_command_handler) + self.server.on_notification("$/progress", do_nothing) + self.server.on_notification("textDocument/publishDiagnostics", do_nothing) + self.server.on_notification("language/actionableNotification", do_nothing) + self.server.on_notification("experimental/serverStatus", check_experimental_status) + + async with super().start_server(): + self.logger.log("Starting jedi-language-server server process", logging.INFO) + await self.server.start() + initialize_params = self._get_initialize_params(self.repository_root_path) + + self.logger.log( + "Sending initialize request from LSP client to LSP server and awaiting response", + logging.INFO, + ) + init_response = await self.server.send.initialize(initialize_params) + assert init_response["capabilities"]["textDocumentSync"]["change"] == 2 + assert "completionProvider" in init_response["capabilities"] + assert init_response["capabilities"]["completionProvider"] == { + "triggerCharacters": [".", "'", '"'], + "resolveProvider": True, + } + + self.server.notify.initialized({}) + + yield self + + await self.server.shutdown() + await self.server.stop() diff --git a/blarify/vendor/multilspy/language_servers/omnisharp/omnisharp.py b/blarify/vendor/multilspy/language_servers/omnisharp/omnisharp.py new file mode 100644 index 00000000..d0add133 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/omnisharp/omnisharp.py @@ -0,0 +1,403 @@ +""" +Provides C# specific instantiation of the LanguageServer class. Contains various configurations and settings specific to C#. +""" + +import asyncio +import json +import logging +import os +import pathlib +import stat +from contextlib import asynccontextmanager +from typing import AsyncIterator, Iterable + +from blarify.vendor.multilspy.multilspy_logger import MultilspyLogger +from blarify.vendor.multilspy.language_server import LanguageServer +from blarify.vendor.multilspy.lsp_protocol_handler.server import ProcessLaunchInfo +from blarify.vendor.multilspy.lsp_protocol_handler.lsp_types import InitializeParams +from blarify.vendor.multilspy.multilspy_config import MultilspyConfig +from blarify.vendor.multilspy.multilspy_exceptions import MultilspyException +from blarify.vendor.multilspy.multilspy_utils import FileUtils, PlatformUtils, PlatformId, DotnetVersion + + +def breadth_first_file_scan(root) -> Iterable[str]: + """ + This function was obtained from https://stackoverflow.com/questions/49654234/is-there-a-breadth-first-search-option-available-in-os-walk-or-equivalent-py + It traverses the directory tree in breadth first order. + """ + dirs = [root] + # while we has dirs to scan + while len(dirs): + next_dirs = [] + for parent in dirs: + # scan each dir + for f in os.listdir(parent): + # if there is a dir, then save for next ittr + # if it is a file then yield it (we'll return later) + ff = os.path.join(parent, f) + if os.path.isdir(ff): + next_dirs.append(ff) + else: + yield ff + + # once we've done all the current dirs then + # we set up the next itter as the child dirs + # from the current itter. + dirs = next_dirs + + +def find_least_depth_sln_file(root_dir) -> str: + for filename in breadth_first_file_scan(root_dir): + if filename.endswith(".sln"): + return filename + return None + + +class OmniSharp(LanguageServer): + """ + Provides C# specific instantiation of the LanguageServer class. Contains various configurations and settings specific to C#. + """ + + def __init__(self, config: MultilspyConfig, logger: MultilspyLogger, repository_root_path: str): + """ + Creates an OmniSharp instance. This class is not meant to be instantiated directly. Use LanguageServer.create() instead. + """ + omnisharp_executable_path, dll_path = self.setupRuntimeDependencies(logger, config) + + slnfilename = find_least_depth_sln_file(repository_root_path) + if slnfilename is None: + logger.log("No *.sln file found in repository", logging.ERROR) + raise MultilspyException("No SLN file found in repository") + + cmd = " ".join( + [ + omnisharp_executable_path, + "-lsp", + "--encoding", + "ascii", + "-z", + "-s", + slnfilename, + "--hostPID", + str(os.getpid()), + "DotNet:enablePackageRestore=false", + "--loglevel", + "trace", + "--plugin", + dll_path, + "FileOptions:SystemExcludeSearchPatterns:0=**/.git", + "FileOptions:SystemExcludeSearchPatterns:1=**/.svn", + "FileOptions:SystemExcludeSearchPatterns:2=**/.hg", + "FileOptions:SystemExcludeSearchPatterns:3=**/CVS", + "FileOptions:SystemExcludeSearchPatterns:4=**/.DS_Store", + "FileOptions:SystemExcludeSearchPatterns:5=**/Thumbs.db", + "RoslynExtensionsOptions:EnableAnalyzersSupport=true", + "FormattingOptions:EnableEditorConfigSupport=true", + "RoslynExtensionsOptions:EnableImportCompletion=true", + "Sdk:IncludePrereleases=true", + "RoslynExtensionsOptions:AnalyzeOpenDocumentsOnly=true", + "formattingOptions:useTabs=false", + "formattingOptions:tabSize=4", + "formattingOptions:indentationSize=4", + ] + ) + super().__init__( + config, logger, repository_root_path, ProcessLaunchInfo(cmd=cmd, cwd=repository_root_path), "csharp" + ) + + self.definition_available = asyncio.Event() + self.references_available = asyncio.Event() + + def _get_initialize_params(self, repository_absolute_path: str) -> InitializeParams: + """ + Returns the initialize params for the Omnisharp Language Server. + """ + with open(os.path.join(os.path.dirname(__file__), "initialize_params.json"), "r") as f: + d = json.load(f) + + del d["_description"] + + d["processId"] = os.getpid() + assert d["rootPath"] == "$rootPath" + d["rootPath"] = repository_absolute_path + + assert d["rootUri"] == "$rootUri" + d["rootUri"] = pathlib.Path(repository_absolute_path).as_uri() + + assert d["workspaceFolders"][0]["uri"] == "$uri" + d["workspaceFolders"][0]["uri"] = pathlib.Path(repository_absolute_path).as_uri() + + assert d["workspaceFolders"][0]["name"] == "$name" + d["workspaceFolders"][0]["name"] = os.path.basename(repository_absolute_path) + + return d + + def setupRuntimeDependencies(self, logger: MultilspyLogger, config: MultilspyConfig) -> tuple[str, str]: + """ + Setup runtime dependencies for OmniSharp. + """ + platform_id = PlatformUtils.get_platform_id() + dotnet_version = PlatformUtils.get_dotnet_version() + + with open(os.path.join(os.path.dirname(__file__), "runtime_dependencies.json"), "r") as f: + d = json.load(f) + del d["_description"] + + assert platform_id in [ + PlatformId.LINUX_x64, + PlatformId.WIN_x64, + ], "Only linux-x64 and win-x64 platform is supported for in multilspy at the moment" + assert dotnet_version in [ + DotnetVersion.V6, + DotnetVersion.V7, + DotnetVersion.V8 + ], "Only dotnet version 6 and 7 are supported in multilspy at the moment" + + # TODO: Do away with this assumption + # Currently, runtime binaries are not available for .Net 7 and .Net 8. Hence, we assume .Net 6 runtime binaries to be compatible with .Net 7, .Net 8 + if dotnet_version in [DotnetVersion.V7, DotnetVersion.V8]: + dotnet_version = DotnetVersion.V6 + + runtime_dependencies = d["runtimeDependencies"] + runtime_dependencies = [ + dependency for dependency in runtime_dependencies if dependency["platformId"] == platform_id.value + ] + runtime_dependencies = [ + dependency + for dependency in runtime_dependencies + if not ("dotnet_version" in dependency) or dependency["dotnet_version"] == dotnet_version.value + ] + assert len(runtime_dependencies) == 2 + runtime_dependencies = { + runtime_dependencies[0]["id"]: runtime_dependencies[0], + runtime_dependencies[1]["id"]: runtime_dependencies[1], + } + + assert "OmniSharp" in runtime_dependencies + assert "RazorOmnisharp" in runtime_dependencies + + omnisharp_ls_dir = os.path.join(os.path.dirname(__file__), "static", "OmniSharp") + if not os.path.exists(omnisharp_ls_dir): + os.makedirs(omnisharp_ls_dir) + FileUtils.download_and_extract_archive( + logger, runtime_dependencies["OmniSharp"]["url"], omnisharp_ls_dir, "zip" + ) + omnisharp_executable_path = os.path.join(omnisharp_ls_dir, runtime_dependencies["OmniSharp"]["binaryName"]) + assert os.path.exists(omnisharp_executable_path) + os.chmod(omnisharp_executable_path, stat.S_IEXEC) + + razor_omnisharp_ls_dir = os.path.join(os.path.dirname(__file__), "static", "RazorOmnisharp") + if not os.path.exists(razor_omnisharp_ls_dir): + os.makedirs(razor_omnisharp_ls_dir) + FileUtils.download_and_extract_archive( + logger, runtime_dependencies["RazorOmnisharp"]["url"], razor_omnisharp_ls_dir, "zip" + ) + razor_omnisharp_dll_path = os.path.join( + razor_omnisharp_ls_dir, runtime_dependencies["RazorOmnisharp"]["dll_path"] + ) + assert os.path.exists(razor_omnisharp_dll_path) + + return omnisharp_executable_path, razor_omnisharp_dll_path + + @asynccontextmanager + async def start_server(self) -> AsyncIterator["OmniSharp"]: + """ + Starts the Omnisharp Language Server, waits for the server to be ready and yields the LanguageServer instance. + + Usage: + ``` + async with lsp.start_server(): + # LanguageServer has been initialized and ready to serve requests + await lsp.request_definition(...) + await lsp.request_references(...) + # Shutdown the LanguageServer on exit from scope + # LanguageServer has been shutdown + """ + + async def register_capability_handler(params): + assert "registrations" in params + for registration in params["registrations"]: + if registration["method"] == "textDocument/definition": + self.definition_available.set() + if registration["method"] == "textDocument/references": + self.references_available.set() + if registration["method"] == "textDocument/completion": + self.completions_available.set() + + async def lang_status_handler(params): + # TODO: Should we wait for + # server -> client: {'jsonrpc': '2.0', 'method': 'language/status', 'params': {'type': 'ProjectStatus', 'message': 'OK'}} + # Before proceeding? + # if params["type"] == "ServiceReady" and params["message"] == "ServiceReady": + # self.service_ready_event.set() + pass + + async def execute_client_command_handler(params): + return [] + + async def do_nothing(params): + return + + async def check_experimental_status(params): + if params["quiescent"] == True: + self.server_ready.set() + + async def window_log_message(msg): + self.logger.log(f"LSP: window/logMessage: {msg}", logging.INFO) + + async def workspace_configuration_handler(params): + # TODO: We do not know the appropriate way to handle this request. Should ideally contact the OmniSharp dev team + return [ + { + "RoslynExtensionsOptions": { + "EnableDecompilationSupport": False, + "EnableAnalyzersSupport": True, + "EnableImportCompletion": True, + "EnableAsyncCompletion": False, + "DocumentAnalysisTimeoutMs": 30000, + "DiagnosticWorkersThreadCount": 18, + "AnalyzeOpenDocumentsOnly": True, + "InlayHintsOptions": { + "EnableForParameters": False, + "ForLiteralParameters": False, + "ForIndexerParameters": False, + "ForObjectCreationParameters": False, + "ForOtherParameters": False, + "SuppressForParametersThatDifferOnlyBySuffix": False, + "SuppressForParametersThatMatchMethodIntent": False, + "SuppressForParametersThatMatchArgumentName": False, + "EnableForTypes": False, + "ForImplicitVariableTypes": False, + "ForLambdaParameterTypes": False, + "ForImplicitObjectCreation": False, + }, + "LocationPaths": None, + }, + "FormattingOptions": { + "OrganizeImports": False, + "EnableEditorConfigSupport": True, + "NewLine": "\n", + "UseTabs": False, + "TabSize": 4, + "IndentationSize": 4, + "SpacingAfterMethodDeclarationName": False, + "SeparateImportDirectiveGroups": False, + "SpaceWithinMethodDeclarationParenthesis": False, + "SpaceBetweenEmptyMethodDeclarationParentheses": False, + "SpaceAfterMethodCallName": False, + "SpaceWithinMethodCallParentheses": False, + "SpaceBetweenEmptyMethodCallParentheses": False, + "SpaceAfterControlFlowStatementKeyword": True, + "SpaceWithinExpressionParentheses": False, + "SpaceWithinCastParentheses": False, + "SpaceWithinOtherParentheses": False, + "SpaceAfterCast": False, + "SpaceBeforeOpenSquareBracket": False, + "SpaceBetweenEmptySquareBrackets": False, + "SpaceWithinSquareBrackets": False, + "SpaceAfterColonInBaseTypeDeclaration": True, + "SpaceAfterComma": True, + "SpaceAfterDot": False, + "SpaceAfterSemicolonsInForStatement": True, + "SpaceBeforeColonInBaseTypeDeclaration": True, + "SpaceBeforeComma": False, + "SpaceBeforeDot": False, + "SpaceBeforeSemicolonsInForStatement": False, + "SpacingAroundBinaryOperator": "single", + "IndentBraces": False, + "IndentBlock": True, + "IndentSwitchSection": True, + "IndentSwitchCaseSection": True, + "IndentSwitchCaseSectionWhenBlock": True, + "LabelPositioning": "oneLess", + "WrappingPreserveSingleLine": True, + "WrappingKeepStatementsOnSingleLine": True, + "NewLinesForBracesInTypes": True, + "NewLinesForBracesInMethods": True, + "NewLinesForBracesInProperties": True, + "NewLinesForBracesInAccessors": True, + "NewLinesForBracesInAnonymousMethods": True, + "NewLinesForBracesInControlBlocks": True, + "NewLinesForBracesInAnonymousTypes": True, + "NewLinesForBracesInObjectCollectionArrayInitializers": True, + "NewLinesForBracesInLambdaExpressionBody": True, + "NewLineForElse": True, + "NewLineForCatch": True, + "NewLineForFinally": True, + "NewLineForMembersInObjectInit": True, + "NewLineForMembersInAnonymousTypes": True, + "NewLineForClausesInQuery": True, + }, + "FileOptions": { + "SystemExcludeSearchPatterns": [ + "**/node_modules/**/*", + "**/bin/**/*", + "**/obj/**/*", + "**/.git/**/*", + "**/.git", + "**/.svn", + "**/.hg", + "**/CVS", + "**/.DS_Store", + "**/Thumbs.db", + ], + "ExcludeSearchPatterns": [], + }, + "RenameOptions": { + "RenameOverloads": False, + "RenameInStrings": False, + "RenameInComments": False, + }, + "ImplementTypeOptions": { + "InsertionBehavior": 0, + "PropertyGenerationBehavior": 0, + }, + "DotNetCliOptions": {"LocationPaths": None}, + "Plugins": {"LocationPaths": None}, + } + ] + + self.server.on_request("client/registerCapability", register_capability_handler) + self.server.on_notification("language/status", lang_status_handler) + self.server.on_notification("window/logMessage", window_log_message) + self.server.on_request("workspace/executeClientCommand", execute_client_command_handler) + self.server.on_notification("$/progress", do_nothing) + self.server.on_notification("textDocument/publishDiagnostics", do_nothing) + self.server.on_notification("language/actionableNotification", do_nothing) + self.server.on_notification("experimental/serverStatus", check_experimental_status) + self.server.on_request("workspace/configuration", workspace_configuration_handler) + + async with super().start_server(): + self.logger.log("Starting OmniSharp server process", logging.INFO) + await self.server.start() + initialize_params = self._get_initialize_params(self.repository_root_path) + + self.logger.log( + "Sending initialize request from LSP client to LSP server and awaiting response", + logging.INFO, + ) + init_response = await self.server.send.initialize(initialize_params) + self.server.notify.initialized({}) + with open(os.path.join(os.path.dirname(__file__), "workspace_did_change_configuration.json"), "r") as f: + self.server.notify.workspace_did_change_configuration({ + "settings": json.load(f) + }) + assert "capabilities" in init_response + if ( + "definitionProvider" in init_response["capabilities"] + and init_response["capabilities"]["definitionProvider"] + ): + self.definition_available.set() + if ( + "referencesProvider" in init_response["capabilities"] + and init_response["capabilities"]["referencesProvider"] + ): + self.references_available.set() + + await self.definition_available.wait() + await self.references_available.wait() + + yield self + + await self.server.shutdown() + await self.server.stop() diff --git a/blarify/vendor/multilspy/language_servers/rust_analyzer/rust_analyzer.py b/blarify/vendor/multilspy/language_servers/rust_analyzer/rust_analyzer.py new file mode 100644 index 00000000..59e6b990 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/rust_analyzer/rust_analyzer.py @@ -0,0 +1,182 @@ +""" +Provides Rust specific instantiation of the LanguageServer class. Contains various configurations and settings specific to Rust. +""" + +import asyncio +import json +import logging +import os +import stat +import pathlib +from contextlib import asynccontextmanager +from typing import AsyncIterator + +from blarify.vendor.multilspy.multilspy_logger import MultilspyLogger +from blarify.vendor.multilspy.language_server import LanguageServer +from blarify.vendor.multilspy.lsp_protocol_handler.server import ProcessLaunchInfo +from blarify.vendor.multilspy.lsp_protocol_handler.lsp_types import InitializeParams +from blarify.vendor.multilspy.multilspy_config import MultilspyConfig +from blarify.vendor.multilspy.multilspy_utils import FileUtils +from blarify.vendor.multilspy.multilspy_utils import PlatformUtils + + +class RustAnalyzer(LanguageServer): + """ + Provides Rust specific instantiation of the LanguageServer class. Contains various configurations and settings specific to Rust. + """ + + def __init__(self, config: MultilspyConfig, logger: MultilspyLogger, repository_root_path: str): + """ + Creates a RustAnalyzer instance. This class is not meant to be instantiated directly. Use LanguageServer.create() instead. + """ + rustanalyzer_executable_path = self.setup_runtime_dependencies(logger, config) + super().__init__( + config, + logger, + repository_root_path, + ProcessLaunchInfo(cmd=rustanalyzer_executable_path, cwd=repository_root_path), + "rust", + ) + self.server_ready = asyncio.Event() + + def setup_runtime_dependencies(self, logger: MultilspyLogger, config: MultilspyConfig) -> str: + """ + Setup runtime dependencies for rust_analyzer. + """ + platform_id = PlatformUtils.get_platform_id() + + with open(os.path.join(os.path.dirname(__file__), "runtime_dependencies.json"), "r") as f: + d = json.load(f) + del d["_description"] + + # assert platform_id.value in [ + # "linux-x64", + # "win-x64", + # ], "Only linux-x64 and win-x64 platform is supported for in multilspy at the moment" + + runtime_dependencies = d["runtimeDependencies"] + runtime_dependencies = [ + dependency for dependency in runtime_dependencies if dependency["platformId"] == platform_id.value + ] + assert len(runtime_dependencies) == 1 + dependency = runtime_dependencies[0] + + rustanalyzer_ls_dir = os.path.join(os.path.dirname(__file__), "static", "RustAnalyzer") + rustanalyzer_executable_path = os.path.join(rustanalyzer_ls_dir, dependency["binaryName"]) + if not os.path.exists(rustanalyzer_ls_dir): + os.makedirs(rustanalyzer_ls_dir) + if dependency["archiveType"] == "gz": + FileUtils.download_and_extract_archive( + logger, dependency["url"], rustanalyzer_executable_path, dependency["archiveType"] + ) + else: + FileUtils.download_and_extract_archive( + logger, dependency["url"], rustanalyzer_ls_dir, dependency["archiveType"] + ) + assert os.path.exists(rustanalyzer_executable_path) + os.chmod(rustanalyzer_executable_path, stat.S_IEXEC) + + return rustanalyzer_executable_path + + def _get_initialize_params(self, repository_absolute_path: str) -> InitializeParams: + """ + Returns the initialize params for the Rust Analyzer Language Server. + """ + with open(os.path.join(os.path.dirname(__file__), "initialize_params.json"), "r") as f: + d = json.load(f) + + del d["_description"] + + d["processId"] = os.getpid() + assert d["rootPath"] == "$rootPath" + d["rootPath"] = repository_absolute_path + + assert d["rootUri"] == "$rootUri" + d["rootUri"] = pathlib.Path(repository_absolute_path).as_uri() + + assert d["workspaceFolders"][0]["uri"] == "$uri" + d["workspaceFolders"][0]["uri"] = pathlib.Path(repository_absolute_path).as_uri() + + assert d["workspaceFolders"][0]["name"] == "$name" + d["workspaceFolders"][0]["name"] = os.path.basename(repository_absolute_path) + + return d + + @asynccontextmanager + async def start_server(self) -> AsyncIterator["RustAnalyzer"]: + """ + Starts the Rust Analyzer Language Server, waits for the server to be ready and yields the LanguageServer instance. + + Usage: + ``` + async with lsp.start_server(): + # LanguageServer has been initialized and ready to serve requests + await lsp.request_definition(...) + await lsp.request_references(...) + # Shutdown the LanguageServer on exit from scope + # LanguageServer has been shutdown + """ + + async def register_capability_handler(params): + assert "registrations" in params + for registration in params["registrations"]: + if registration["method"] == "workspace/executeCommand": + self.initialize_searcher_command_available.set() + self.resolve_main_method_available.set() + return + + async def lang_status_handler(params): + # TODO: Should we wait for + # server -> client: {'jsonrpc': '2.0', 'method': 'language/status', 'params': {'type': 'ProjectStatus', 'message': 'OK'}} + # Before proceeding? + if params["type"] == "ServiceReady" and params["message"] == "ServiceReady": + self.service_ready_event.set() + + async def execute_client_command_handler(params): + return [] + + async def do_nothing(params): + return + + async def check_experimental_status(params): + if params["quiescent"] == True: + self.server_ready.set() + + async def window_log_message(msg): + self.logger.log(f"LSP: window/logMessage: {msg}", logging.INFO) + + self.server.on_request("client/registerCapability", register_capability_handler) + self.server.on_notification("language/status", lang_status_handler) + self.server.on_notification("window/logMessage", window_log_message) + self.server.on_request("workspace/executeClientCommand", execute_client_command_handler) + self.server.on_notification("$/progress", do_nothing) + self.server.on_notification("textDocument/publishDiagnostics", do_nothing) + self.server.on_notification("language/actionableNotification", do_nothing) + self.server.on_notification("experimental/serverStatus", check_experimental_status) + + async with super().start_server(): + self.logger.log("Starting RustAnalyzer server process", logging.INFO) + await self.server.start() + initialize_params = self._get_initialize_params(self.repository_root_path) + + self.logger.log( + "Sending initialize request from LSP client to LSP server and awaiting response", + logging.INFO, + ) + init_response = await self.server.send.initialize(initialize_params) + assert init_response["capabilities"]["textDocumentSync"]["change"] == 2 + assert "completionProvider" in init_response["capabilities"] + assert init_response["capabilities"]["completionProvider"] == { + "resolveProvider": True, + "triggerCharacters": [":", ".", "'", "("], + "completionItem": {"labelDetailsSupport": True}, + } + self.server.notify.initialized({}) + self.completions_available.set() + + await self.server_ready.wait() + + yield self + + await self.server.shutdown() + await self.server.stop() diff --git a/blarify/vendor/multilspy/language_servers/solargraph/solargraph.py b/blarify/vendor/multilspy/language_servers/solargraph/solargraph.py new file mode 100644 index 00000000..c508d028 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/solargraph/solargraph.py @@ -0,0 +1,193 @@ +""" +Provides Ruby specific instantiation of the LanguageServer class using Solargraph. +Contains various configurations and settings specific to Ruby. +""" + +import asyncio +import json +import logging +import os +import stat +import subprocess +import pathlib +from contextlib import asynccontextmanager +from typing import AsyncIterator + +from blarify.vendor.multilspy.multilspy_logger import MultilspyLogger +from blarify.vendor.multilspy.language_server import LanguageServer +from blarify.vendor.multilspy.lsp_protocol_handler.server import ProcessLaunchInfo +from blarify.vendor.multilspy.lsp_protocol_handler.lsp_types import InitializeParams +from blarify.vendor.multilspy.multilspy_config import MultilspyConfig +from blarify.vendor.multilspy.multilspy_utils import FileUtils +from blarify.vendor.multilspy.multilspy_utils import PlatformUtils, PlatformId + + +class Solargraph(LanguageServer): + """ + Provides Ruby specific instantiation of the LanguageServer class using Solargraph. + Contains various configurations and settings specific to Ruby. + """ + + def __init__(self, config: MultilspyConfig, logger: MultilspyLogger, repository_root_path: str): + """ + Creates a Solargraph instance. This class is not meant to be instantiated directly. + Use LanguageServer.create() instead. + """ + solargraph_executable_path = self.setup_runtime_dependencies(logger, config, repository_root_path) + super().__init__( + config, + logger, + repository_root_path, + ProcessLaunchInfo(cmd=f"{solargraph_executable_path} stdio", cwd=repository_root_path), + "ruby", + ) + self.server_ready = asyncio.Event() + + def setup_runtime_dependencies(self, logger: MultilspyLogger, config: MultilspyConfig, repository_root_path: str) -> str: + """ + Setup runtime dependencies for Solargraph. + """ + platform_id = PlatformUtils.get_platform_id() + which_cmd = "which" + if platform_id in [PlatformId.WIN_x64, PlatformId.WIN_arm64, PlatformId.WIN_x86]: + which_cmd = "where" + + with open(os.path.join(os.path.dirname(__file__), "runtime_dependencies.json"), "r") as f: + d = json.load(f) + del d["_description"] + + dependency = d["runtimeDependencies"][0] + + # Check if Ruby is installed + try: + result = subprocess.run(["ruby", "--version"], check=True, capture_output=True, cwd=repository_root_path) + ruby_version = result.stdout.strip() + logger.log(f"Ruby version: {ruby_version}", logging.INFO) + except subprocess.CalledProcessError as e: + raise RuntimeError(f"Error checking for Ruby installation: {e.stderr}") + except FileNotFoundError: + raise RuntimeError("Ruby is not installed. Please install Ruby before continuing.") + + # Check if solargraph is installed + try: + result = subprocess.run(["gem", "list", "^solargraph$", "-i"], check=False, capture_output=True, text=True, cwd=repository_root_path) + if result.stdout.strip() == "false": + logger.log("Installing Solargraph...", logging.INFO) + subprocess.run(dependency["installCommand"].split(), check=True, capture_output=True, cwd=repository_root_path) + except subprocess.CalledProcessError as e: + raise RuntimeError(f"Failed to check or install Solargraph. {e.stderr}") + + # Get the solargraph executable path + try: + result = subprocess.run([which_cmd, "solargraph"], check=True, capture_output=True, text=True, cwd=repository_root_path) + executeable_path = result.stdout.strip() + + if not os.path.exists(executeable_path): + raise RuntimeError(f"Solargraph executable not found at {executeable_path}") + + # Ensure the executable has the right permissions + os.chmod(executeable_path, os.stat(executeable_path).st_mode | stat.S_IEXEC) + + return executeable_path + except subprocess.CalledProcessError: + raise RuntimeError("Failed to locate Solargraph executable.") + + def _get_initialize_params(self, repository_absolute_path: str) -> InitializeParams: + """ + Returns the initialize params for the Solargraph Language Server. + """ + with open(os.path.join(os.path.dirname(__file__), "initialize_params.json"), "r") as f: + d = json.load(f) + + del d["_description"] + + d["processId"] = os.getpid() + assert d["rootPath"] == "$rootPath" + d["rootPath"] = repository_absolute_path + + assert d["rootUri"] == "$rootUri" + d["rootUri"] = pathlib.Path(repository_absolute_path).as_uri() + + assert d["workspaceFolders"][0]["uri"] == "$uri" + d["workspaceFolders"][0]["uri"] = pathlib.Path(repository_absolute_path).as_uri() + + assert d["workspaceFolders"][0]["name"] == "$name" + d["workspaceFolders"][0]["name"] = os.path.basename(repository_absolute_path) + + return d + + @asynccontextmanager + async def start_server(self) -> AsyncIterator["Solargraph"]: + """ + Starts the Solargraph Language Server for Ruby, waits for the server to be ready and yields the LanguageServer instance. + + Usage: + ``` + async with lsp.start_server(): + # LanguageServer has been initialized and ready to serve requests + await lsp.request_definition(...) + await lsp.request_references(...) + # Shutdown the LanguageServer on exit from scope + # LanguageServer has been shutdown + """ + + async def register_capability_handler(params): + assert "registrations" in params + for registration in params["registrations"]: + if registration["method"] == "workspace/executeCommand": + self.initialize_searcher_command_available.set() + self.resolve_main_method_available.set() + return + + async def lang_status_handler(params): + # TODO: Should we wait for + # server -> client: {'jsonrpc': '2.0', 'method': 'language/status', 'params': {'type': 'ProjectStatus', 'message': 'OK'}} + # Before proceeding? + if params["type"] == "ServiceReady" and params["message"] == "ServiceReady": + self.service_ready_event.set() + + async def execute_client_command_handler(params): + return [] + + async def do_nothing(params): + return + + async def window_log_message(msg): + self.logger.log(f"LSP: window/logMessage: {msg}", logging.INFO) + + self.server.on_request("client/registerCapability", register_capability_handler) + self.server.on_notification("language/status", lang_status_handler) + self.server.on_notification("window/logMessage", window_log_message) + self.server.on_request("workspace/executeClientCommand", execute_client_command_handler) + self.server.on_notification("$/progress", do_nothing) + self.server.on_notification("textDocument/publishDiagnostics", do_nothing) + self.server.on_notification("language/actionableNotification", do_nothing) + + async with super().start_server(): + self.logger.log("Starting solargraph server process", logging.INFO) + await self.server.start() + initialize_params = self._get_initialize_params(self.repository_root_path) + + self.logger.log( + "Sending initialize request from LSP client to LSP server and awaiting response", + logging.INFO, + ) + self.logger.log(f"Sending init params: {json.dumps(initialize_params, indent=4)}", logging.INFO) + init_response = await self.server.send.initialize(initialize_params) + self.logger.log(f"Received init response: {init_response}", logging.INFO) + assert init_response["capabilities"]["textDocumentSync"] == 2 + assert "completionProvider" in init_response["capabilities"] + assert init_response["capabilities"]["completionProvider"] == { + "resolveProvider": True, + "triggerCharacters": [".", ":", "@"], + } + self.server.notify.initialized({}) + self.completions_available.set() + + self.server_ready.set() + await self.server_ready.wait() + + yield self + + await self.server.shutdown() + await self.server.stop() diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/tsc b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/tsc new file mode 120000 index 00000000..0863208a --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/tsc @@ -0,0 +1 @@ +../typescript/bin/tsc \ No newline at end of file diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/tsserver b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/tsserver new file mode 120000 index 00000000..f8f8f1a0 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/tsserver @@ -0,0 +1 @@ +../typescript/bin/tsserver \ No newline at end of file diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/typescript-language-server b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/typescript-language-server new file mode 120000 index 00000000..3293d8de --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/.bin/typescript-language-server @@ -0,0 +1 @@ +../typescript-language-server/lib/cli.mjs \ No newline at end of file diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/CHANGELOG.md b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/CHANGELOG.md new file mode 100644 index 00000000..cec44072 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/CHANGELOG.md @@ -0,0 +1,626 @@ +# Changelog +All notable changes to this project will be documented in this file. + +## [4.3.3](https://github.com/typescript-language-server/typescript-language-server/compare/v4.3.2...v4.3.3) (2024-02-09) + + +### Performance Improvements + +* skip diagnostic update event on no changes ([#867](https://github.com/typescript-language-server/typescript-language-server/issues/867)) ([185c3a8](https://github.com/typescript-language-server/typescript-language-server/commit/185c3a8609808af2e9d763cd4763548a3db82de7)) + +## [4.3.2](https://github.com/typescript-language-server/typescript-language-server/compare/v4.3.1...v4.3.2) (2024-02-02) + + +### Bug Fixes + +* restore handling of zipfile: schema for neovim + yarn berry ([#862](https://github.com/typescript-language-server/typescript-language-server/issues/862)) ([caca007](https://github.com/typescript-language-server/typescript-language-server/commit/caca0071095557ecc43d8695d922a4cf5e38a2ad)) + +## [4.3.1](https://github.com/typescript-language-server/typescript-language-server/compare/v4.3.0...v4.3.1) (2024-01-12) + + +### Bug Fixes + +* out of date diagnostics after closing and re-opening a file ([#851](https://github.com/typescript-language-server/typescript-language-server/issues/851)) ([f395cd6](https://github.com/typescript-language-server/typescript-language-server/commit/f395cd67fc0fefb06e301eecb3b0af492c6672da)) + +## [4.3.0](https://github.com/typescript-language-server/typescript-language-server/compare/v4.2.0...v4.3.0) (2024-01-08) + + +### Features + +* support specifying language IDs in plugins ([#834](https://github.com/typescript-language-server/typescript-language-server/issues/834)) ([e9c0b11](https://github.com/typescript-language-server/typescript-language-server/commit/e9c0b117a9a5e273eb517dc0d337ecdf973f3dac)) + + +### Bug Fixes + +* avoid sending window/workDoneProgress/create before init ([#846](https://github.com/typescript-language-server/typescript-language-server/issues/846)) ([625048f](https://github.com/typescript-language-server/typescript-language-server/commit/625048fac8533bccdeda82ee140d4f7792d9fb04)) + +## [4.2.0](https://github.com/typescript-language-server/typescript-language-server/compare/v4.1.3...v4.2.0) (2023-12-09) + + +### Features + +* add tsserver.fallbackPath to initialization options ([#831](https://github.com/typescript-language-server/typescript-language-server/issues/831)) ([9253dd8](https://github.com/typescript-language-server/typescript-language-server/commit/9253dd8eb9ba8b0d8dcfb5fbe1533e7609c040d4)) + + +### Bug Fixes + +* **deps:** update devdependency typescript to ^5.3.3 ([#832](https://github.com/typescript-language-server/typescript-language-server/issues/832)) ([9e1744c](https://github.com/typescript-language-server/typescript-language-server/commit/9e1744c1dea0493ce76b8cce8a55e2d514b9250b)) + +## [4.1.3](https://github.com/typescript-language-server/typescript-language-server/compare/v4.1.2...v4.1.3) (2023-11-27) + + +### Bug Fixes + +* add folder filter in server capabilities for `willRename` ([#814](https://github.com/typescript-language-server/typescript-language-server/issues/814)) ([fe3d21b](https://github.com/typescript-language-server/typescript-language-server/commit/fe3d21b159dfa0204da7f94aac04459b1bd4ea88)) +* **deps:** update devdependency typescript to ^5.3.2 ([#820](https://github.com/typescript-language-server/typescript-language-server/issues/820)) ([5eeb20c](https://github.com/typescript-language-server/typescript-language-server/commit/5eeb20c78b676c527c3b558bfbaa60e4de1db83f)) + +## [4.1.2](https://github.com/typescript-language-server/typescript-language-server/compare/v4.1.1...v4.1.2) (2023-11-14) + + +### Bug Fixes + +* avoid triggering unhandled exception when tsserver crashes ([#805](https://github.com/typescript-language-server/typescript-language-server/issues/805)) ([d537b08](https://github.com/typescript-language-server/typescript-language-server/commit/d537b08597d3d1b4e5b78e0e39bf0ba22f9a9dd1)) +* revert to `Node` value for `moduleResolution` in implicit config ([#804](https://github.com/typescript-language-server/typescript-language-server/issues/804)) ([97c1794](https://github.com/typescript-language-server/typescript-language-server/commit/97c1794be311a2b327f07801119c76d616802ab5)) + +## [4.1.1](https://github.com/typescript-language-server/typescript-language-server/compare/v4.1.0...v4.1.1) (2023-11-13) + + +### Bug Fixes + +* try to infer languageId from extension when invalid provided ([#799](https://github.com/typescript-language-server/typescript-language-server/issues/799)) ([994186e](https://github.com/typescript-language-server/typescript-language-server/commit/994186e629494545f855d0859f5a058529e64c95)) + +## [4.1.0](https://github.com/typescript-language-server/typescript-language-server/compare/v4.0.0...v4.1.0) (2023-11-08) + + +### Features + +* support code lens for references and implementations ([#785](https://github.com/typescript-language-server/typescript-language-server/issues/785)) ([ae058c2](https://github.com/typescript-language-server/typescript-language-server/commit/ae058c22a4900913e9516c0e3c0c46bbd741760c)) + + +### Refactors + +* port ITypeScriptServiceClient ([#782](https://github.com/typescript-language-server/typescript-language-server/issues/782)) ([ab22e52](https://github.com/typescript-language-server/typescript-language-server/commit/ab22e521615a455026625bad179298087149ccb4)) +* remove deprecated CLI options ([#790](https://github.com/typescript-language-server/typescript-language-server/issues/790)) ([cadf374](https://github.com/typescript-language-server/typescript-language-server/commit/cadf3748a8e0de7655260ddeb1ffb30888723aaf)) + +## [4.0.0](https://github.com/typescript-language-server/typescript-language-server/compare/v3.3.2...v4.0.0) (2023-10-20) + + +### ⚠ BREAKING CHANGES + +* require node 18+ + +### Features + +* add support for textDocument/linkedEditingRange ([#732](https://github.com/typescript-language-server/typescript-language-server/issues/732)) ([983a692](https://github.com/typescript-language-server/typescript-language-server/commit/983a6923114c39d638e0c7d419ae16e8bca8985c)) + + +### Bug Fixes + +* **deps:** update devdependency typescript to ^5.1.3 ([#727](https://github.com/typescript-language-server/typescript-language-server/issues/727)) ([af477a2](https://github.com/typescript-language-server/typescript-language-server/commit/af477a2acacced85b52ca1fdb967f17228496c30)) +* **deps:** update devdependency typescript to ^5.2.2 ([#737](https://github.com/typescript-language-server/typescript-language-server/issues/737)) ([0fff121](https://github.com/typescript-language-server/typescript-language-server/commit/0fff121490f255c42c4f78d6c3cdb7d37668cbed)) +* **perf:** cache completion data on the server to avoid serialization ([#768](https://github.com/typescript-language-server/typescript-language-server/issues/768)) ([d7b4c77](https://github.com/typescript-language-server/typescript-language-server/commit/d7b4c77b6d71e81210623d17a80c0838681de3ca)) + + +### Refactors + +* require node 18+ ([1df5a28](https://github.com/typescript-language-server/typescript-language-server/commit/1df5a283e3803e6f2e60579dff0fd4289543b2b2)) + +## [3.3.2](https://github.com/typescript-language-server/typescript-language-server/compare/v3.3.1...v3.3.2) (2023-04-17) + + +### Bug Fixes + +* formatting fails to provide edit at the end of the document ([#718](https://github.com/typescript-language-server/typescript-language-server/issues/718)) ([01e24a2](https://github.com/typescript-language-server/typescript-language-server/commit/01e24a2cba1b0faf9c65474449265b944e64abd6)) +* verbosity of the "Using Typescript version" message ([#716](https://github.com/typescript-language-server/typescript-language-server/issues/716)) ([448d3f1](https://github.com/typescript-language-server/typescript-language-server/commit/448d3f15d881e2594e1e60f71539b3a5d7e9fce2)) + +## [3.3.1](https://github.com/typescript-language-server/typescript-language-server/compare/v3.3.0...v3.3.1) (2023-03-27) + + +### Bug Fixes + +* don't report InternalError on tsserver error response ([#709](https://github.com/typescript-language-server/typescript-language-server/issues/709)) ([3e63165](https://github.com/typescript-language-server/typescript-language-server/commit/3e6316546eb5c8b6fd2fb8c26c88b7b6a6331472)) + +## [3.3.0](https://github.com/typescript-language-server/typescript-language-server/compare/v3.2.0...v3.3.0) (2023-02-20) + + +### Features + +* start separate tsServer instance for semantic requests ([#688](https://github.com/typescript-language-server/typescript-language-server/issues/688)) ([fa65b84](https://github.com/typescript-language-server/typescript-language-server/commit/fa65b847f4a87672cc28302f38fd86e8f56d6112)) + + +### Bug Fixes + +* **completions:** include `filterText` property by default ([#693](https://github.com/typescript-language-server/typescript-language-server/issues/693)) ([c07426a](https://github.com/typescript-language-server/typescript-language-server/commit/c07426adc8b079273c267e18d11993d53d482886)) + +## [3.2.0](https://github.com/typescript-language-server/typescript-language-server/compare/v3.1.0...v3.2.0) (2023-02-14) + + +### Features + +* `source.removeUnusedImports.ts` and `source.sortImports.ts` actions ([#681](https://github.com/typescript-language-server/typescript-language-server/issues/681)) ([a43b2df](https://github.com/typescript-language-server/typescript-language-server/commit/a43b2df471572ca2e25b12899f65fca77853af35)) +* provide filterText property in completions ([#678](https://github.com/typescript-language-server/typescript-language-server/issues/678)) ([af44f8b](https://github.com/typescript-language-server/typescript-language-server/commit/af44f8b1b5a252ca9ba019691ad81dc2e5006468)) +* support `workspace/willRenameFiles` request ([#685](https://github.com/typescript-language-server/typescript-language-server/issues/685)) ([c3f3529](https://github.com/typescript-language-server/typescript-language-server/commit/c3f3529be45a1630fe7903a5af9e732855f2c664)) + + +### Bug Fixes + +* **completions:** don't set `filterText` after all ([#686](https://github.com/typescript-language-server/typescript-language-server/issues/686)) ([4c5d295](https://github.com/typescript-language-server/typescript-language-server/commit/4c5d295d4f71f6b5d8f2c58e908d5cc79cb9e3d2)) +* **completions:** don't set commitCharacters unless client supports those ([#684](https://github.com/typescript-language-server/typescript-language-server/issues/684)) ([af10a97](https://github.com/typescript-language-server/typescript-language-server/commit/af10a977f38626797dbadca935c71f92556fdb39)) +* **deps:** update devdependency typescript to ^4.9.5 ([#677](https://github.com/typescript-language-server/typescript-language-server/issues/677)) ([916c326](https://github.com/typescript-language-server/typescript-language-server/commit/916c326d576b9f13a05563495dffa27b4d02ee6e)) +* line offset off by one when at the last line ([#683](https://github.com/typescript-language-server/typescript-language-server/issues/683)) ([0db9a5f](https://github.com/typescript-language-server/typescript-language-server/commit/0db9a5faa4bc03560506ffd030e795a35e45e3f8)) + +## [3.1.0](https://github.com/typescript-language-server/typescript-language-server/compare/v3.0.3...v3.1.0) (2023-01-30) + + +### Features + +* send `$/typescriptVersion` notification with TypeScript version ([#674](https://github.com/typescript-language-server/typescript-language-server/issues/674)) ([b081112](https://github.com/typescript-language-server/typescript-language-server/commit/b081112f12a35fa70aae3a134191dea025de64da)) +* support for canceling LSP requests ([#672](https://github.com/typescript-language-server/typescript-language-server/issues/672)) ([1daf209](https://github.com/typescript-language-server/typescript-language-server/commit/1daf209121fc20bbc0a64ec0491cd40582cb9a4b)) + +## [3.0.3](https://github.com/typescript-language-server/typescript-language-server/compare/v3.0.2...v3.0.3) (2023-01-23) + + +### Bug Fixes + +* restore tsserver version logging on initialization ([#669](https://github.com/typescript-language-server/typescript-language-server/issues/669)) ([232219c](https://github.com/typescript-language-server/typescript-language-server/commit/232219cd0fe138558ed98e22aa7314e0941e4f10)) + +## [3.0.2](https://github.com/typescript-language-server/typescript-language-server/compare/v3.0.1...v3.0.2) (2023-01-14) + + +### Bug Fixes + +* remove hard dependency on typescript ([#661](https://github.com/typescript-language-server/typescript-language-server/issues/661)) ([9a2e2c8](https://github.com/typescript-language-server/typescript-language-server/commit/9a2e2c83d4992cd90cebc706618a9af604fcf1a9)) + + +### Refactors + +* bundle with rollup and switch to jest for testing ([#663](https://github.com/typescript-language-server/typescript-language-server/issues/663)) ([2c9eb63](https://github.com/typescript-language-server/typescript-language-server/commit/2c9eb632659a3bb9995095576afe88e84833bbdd)) + +## [3.0.1](https://github.com/typescript-language-server/typescript-language-server/compare/v3.0.0...v3.0.1) (2022-12-30) + + +### Bug Fixes + +* cancel pending geterr request before triggering new ([#651](https://github.com/typescript-language-server/typescript-language-server/issues/651)) ([95b92e5](https://github.com/typescript-language-server/typescript-language-server/commit/95b92e5d15f47eea77e08765a1e378dbcd90d1f0)) + +## [3.0.0](https://github.com/typescript-language-server/typescript-language-server/compare/v2.3.0...v3.0.0) (2022-12-29) + + +### ⚠ BREAKING CHANGES + +* Remove experimental and legacy implementations of inlay hints and call hierarchy. Use to the official `textDocument/inlayHint` and `textDocument/prepareCallHierarchy` implementations instead. + +### Features + +* drop experimental `textDocument/calls`, `typescript/inlayHints` ([#647](https://github.com/typescript-language-server/typescript-language-server/issues/647)) ([b15f8a7](https://github.com/typescript-language-server/typescript-language-server/commit/b15f8a7cca8470b0ef9e9878e94fba95e278d372)) +* implement support for spec version of Call Hierarchy ([#649](https://github.com/typescript-language-server/typescript-language-server/issues/649)) ([3ce0e17](https://github.com/typescript-language-server/typescript-language-server/commit/3ce0e17e72f32913739c9d67d3dfb6092f09a2aa)) + +## [2.3.0](https://github.com/typescript-language-server/typescript-language-server/compare/v2.2.0...v2.3.0) (2022-12-27) + + +### Features + +* implement `textDocument/selectionRange` request ([#642](https://github.com/typescript-language-server/typescript-language-server/issues/642)) ([a5598c6](https://github.com/typescript-language-server/typescript-language-server/commit/a5598c68aac961cbd6294133a9235e4db5b95929)) + + +### Bug Fixes + +* **completions:** don't insert call snippet if already a call ([#646](https://github.com/typescript-language-server/typescript-language-server/issues/646)) ([5d34de5](https://github.com/typescript-language-server/typescript-language-server/commit/5d34de5fd38ce5a9dcafc4a385ccb39b0a89f2b0)) + +## [2.2.0](https://github.com/typescript-language-server/typescript-language-server/compare/v2.1.0...v2.2.0) (2022-12-09) + + +### Features + +* communicate with tsserver >=4.9.0 using IPC ([#630](https://github.com/typescript-language-server/typescript-language-server/issues/630)) ([06abfde](https://github.com/typescript-language-server/typescript-language-server/commit/06abfdeb133127f4567efb77a2bf725549e9d957)) +* support `textDocument/prepareRename` request ([#628](https://github.com/typescript-language-server/typescript-language-server/issues/628)) ([9c66794](https://github.com/typescript-language-server/typescript-language-server/commit/9c6679438d6190b72a15f32c0eb83cacd7780213)) +* update typescript to 4.9.3 ([#629](https://github.com/typescript-language-server/typescript-language-server/issues/629)) ([0005648](https://github.com/typescript-language-server/typescript-language-server/commit/00056483da3f1089a3a426f08bc66651178c3665)) + + +### Bug Fixes + +* **deps:** update devdependency typescript to ^4.9.4 ([#637](https://github.com/typescript-language-server/typescript-language-server/issues/637)) ([d2b18b6](https://github.com/typescript-language-server/typescript-language-server/commit/d2b18b6d318c4b441e42f4f977ba6bd4eca36d58)) +* surface stderr output from the tsserver process ([#624](https://github.com/typescript-language-server/typescript-language-server/issues/624)) ([adf2689](https://github.com/typescript-language-server/typescript-language-server/commit/adf268927a2f4b5e689572be9bedc349573aadd5)) + +## [2.1.0](https://github.com/typescript-language-server/typescript-language-server/compare/v2.0.1...v2.1.0) (2022-10-17) + + +### Features + +* add `_typescript.configurePlugin` workspace command ([#607](https://github.com/typescript-language-server/typescript-language-server/issues/607)) ([59a5217](https://github.com/typescript-language-server/typescript-language-server/commit/59a52174148f3dc95fa2969971a1f95c6e432812)) +* add `tsserver.logVerbosity` and `tsserver.path` to `initializationOptions` ([#611](https://github.com/typescript-language-server/typescript-language-server/issues/611)) ([a03eab5](https://github.com/typescript-language-server/typescript-language-server/commit/a03eab5f1442ad68745d6bec464191a66ab85fc7)) +* add support for `[@link](https://github.com/link)` references in JSDoc ([#612](https://github.com/typescript-language-server/typescript-language-server/issues/612)) ([3722b51](https://github.com/typescript-language-server/typescript-language-server/commit/3722b51c0ad8e758c4e42f622bbe25ae981071e1)) +* add workspace implicit project defaults configuration ([#605](https://github.com/typescript-language-server/typescript-language-server/issues/605)) ([c6b3947](https://github.com/typescript-language-server/typescript-language-server/commit/c6b39473ed5343f99434506ee034fd0d45a5364d)) + + +### Bug Fixes + +* loading progress sometimes getting stuck ([#603](https://github.com/typescript-language-server/typescript-language-server/issues/603)) ([8cf4381](https://github.com/typescript-language-server/typescript-language-server/commit/8cf43810e0ff7a32d3499afc6da2344939b2d6de)) +* respect user-provided tsserver.js path from `--tsserver-path` ([#610](https://github.com/typescript-language-server/typescript-language-server/issues/610)) ([417339f](https://github.com/typescript-language-server/typescript-language-server/commit/417339fa66bc1910c80888c3f909e3d059da8ee5)) + +## [2.0.1](https://github.com/typescript-language-server/typescript-language-server/compare/v2.0.0...v2.0.1) (2022-10-07) + + +### Bug Fixes + +* disable IPC communication until TypeScript bug is fixed ([#600](https://github.com/typescript-language-server/typescript-language-server/issues/600)) ([a6153a6](https://github.com/typescript-language-server/typescript-language-server/commit/a6153a66e88bed52704761f92dd4168605ef9a45)) + +## [2.0.0](https://github.com/typescript-language-server/typescript-language-server/compare/v1.2.0...v2.0.0) (2022-09-28) + + +### ⚠ BREAKING CHANGES + +* Replace the CLI argument `--tsserver-log-file` with `tsserver.logDirectory` option provided through `initializationOptions` of the `initialize` request. + +### Features + +* add `tsserver.logDirectory` to `initializationOptions` ([#588](https://github.com/typescript-language-server/typescript-language-server/issues/588)) ([114d430](https://github.com/typescript-language-server/typescript-language-server/commit/114d4309cb1450585f991604118d3eff3690237c)) +* add `tsserver.trace` init option for tracing tsserver ([#586](https://github.com/typescript-language-server/typescript-language-server/issues/586)) ([e3e8930](https://github.com/typescript-language-server/typescript-language-server/commit/e3e893094e501e3d6a72148e05f11286d688d2bd)) + + +### Bug Fixes + +* **completions:** don't create snippet kind without `completeFunctionCalls` ([#595](https://github.com/typescript-language-server/typescript-language-server/issues/595)) ([7f69c27](https://github.com/typescript-language-server/typescript-language-server/commit/7f69c27eb8cce71d3db006623757a74f93d76dd3)) +* **completions:** remove filterText override for bracket accessor ([#593](https://github.com/typescript-language-server/typescript-language-server/issues/593)) ([1ed4e2e](https://github.com/typescript-language-server/typescript-language-server/commit/1ed4e2eccf0b52e10204b5c2617d4944ae513afd)) +* wrong import completion when insert/replace supported ([#592](https://github.com/typescript-language-server/typescript-language-server/issues/592)) ([4fe902a](https://github.com/typescript-language-server/typescript-language-server/commit/4fe902a9e28ec4c3ccc14a9e75488efeb8079544)) + +## [1.2.0](https://github.com/typescript-language-server/typescript-language-server/compare/v1.1.2...v1.2.0) (2022-09-12) + + +### Features + +* Add insert replace support for completions ([#583](https://github.com/typescript-language-server/typescript-language-server/issues/583)) ([fdf9d11](https://github.com/typescript-language-server/typescript-language-server/commit/fdf9d11200c49a160ed3c3bd523e4792bc98e99d)) +* add support for new features from TypeScript 4.8 ([#576](https://github.com/typescript-language-server/typescript-language-server/issues/576)) ([7e88db3](https://github.com/typescript-language-server/typescript-language-server/commit/7e88db301a56d6d2dcd0fc1872d6baa386210497)) +* include "triggerReason" and "kind" in code action requests ([#579](https://github.com/typescript-language-server/typescript-language-server/issues/579)) ([f872078](https://github.com/typescript-language-server/typescript-language-server/commit/f872078fa3b40d8b9b90f737fec7a4c808f1ccc7)) +* support communicating with tsserver using IPC ([#585](https://github.com/typescript-language-server/typescript-language-server/issues/585)) ([8725b9b](https://github.com/typescript-language-server/typescript-language-server/commit/8725b9bee4432b7520ebd9adc67f4c65303b2c8c)) +* support for codeAction disabledSupport client capability ([#578](https://github.com/typescript-language-server/typescript-language-server/issues/578)) ([f93b849](https://github.com/typescript-language-server/typescript-language-server/commit/f93b8493eeafda32c865c93e99025c8ca11c3226)) + + +### Bug Fixes + +* only use optionalReplacementSpan if client supports InsertReplace ([#584](https://github.com/typescript-language-server/typescript-language-server/issues/584)) ([899ba6b](https://github.com/typescript-language-server/typescript-language-server/commit/899ba6b5c5f13faac8eec6478ced4d9f8d90836d)) + +## [1.1.2](https://github.com/typescript-language-server/typescript-language-server/compare/v1.1.1...v1.1.2) (2022-08-25) + + +### Bug Fixes + +* definition request crashing on getting span ([#574](https://github.com/typescript-language-server/typescript-language-server/issues/574)) ([4e1c82b](https://github.com/typescript-language-server/typescript-language-server/commit/4e1c82b82878316a12ff6b524d7dd5ab54b86acd)) + +## [1.1.1](https://github.com/typescript-language-server/typescript-language-server/compare/v1.1.0...v1.1.1) (2022-08-22) + + +### Bug Fixes + +* move deepmerge to dependencies ([06109d4](https://github.com/typescript-language-server/typescript-language-server/commit/06109d4646d94bdf1bbeb2768e18f1323ae1b630)) + +## [1.1.0](https://github.com/typescript-language-server/typescript-language-server/compare/v1.0.0...v1.1.0) (2022-08-21) + + +### Features + +* add "Go To Source Definition" command ([#560](https://github.com/typescript-language-server/typescript-language-server/issues/560)) ([9bcdaf2](https://github.com/typescript-language-server/typescript-language-server/commit/9bcdaf2b0b09da9aa4d7e6ed79bdcd742b3cfc17)) +* support `textDocument/inlayHint` request from 3.17.0 spec ([#566](https://github.com/typescript-language-server/typescript-language-server/issues/566)) ([9a2fd4e](https://github.com/typescript-language-server/typescript-language-server/commit/9a2fd4e34b6c50c57b974f617018dcefdb469788)) +* support LocationLink[] for textDocument/definition response ([#563](https://github.com/typescript-language-server/typescript-language-server/issues/563)) ([196f328](https://github.com/typescript-language-server/typescript-language-server/commit/196f328cd9fd7a06998151d59bed0b945cc68b40)) + + +### Bug Fixes + +* don't trigger error on empty Source Definition response ([#568](https://github.com/typescript-language-server/typescript-language-server/issues/568)) ([146a6ba](https://github.com/typescript-language-server/typescript-language-server/commit/146a6ba97f0792701ff8afcc431d3a1dfdb978a6)) +* make wording in the typescript lookup error more generic ([585a05e](https://github.com/typescript-language-server/typescript-language-server/commit/585a05e43a0b530f10e488aed634fac0436109ae)), closes [#554](https://github.com/typescript-language-server/typescript-language-server/issues/554) +* snippet completions returned to clients that don't support them ([#556](https://github.com/typescript-language-server/typescript-language-server/issues/556)) ([050d335](https://github.com/typescript-language-server/typescript-language-server/commit/050d3350e16fe78b7c60d7443ed3ad6d2cc4730d)) +* update signature help feature to v3.15.0 LSP spec ([#555](https://github.com/typescript-language-server/typescript-language-server/issues/555)) ([da074a6](https://github.com/typescript-language-server/typescript-language-server/commit/da074a618ca6c29819834a0344682094d6ff08f6)) + +## [1.0.0](https://github.com/typescript-language-server/typescript-language-server/compare/v0.11.2...v1.0.0) (2022-08-06) + + +### ⚠ BREAKING CHANGES + +* Ship as an ES module. Might be breaking for programmatic users of this server. Read more about consuming ES module packages at gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c +* **deps:** LSP libraries updated to match the 3.17 version of the LSP spec. Requires minimum Node 14. + +### Features + +* add support for CompletionItem.labelDetails ([#534](https://github.com/typescript-language-server/typescript-language-server/issues/534)) ([3c140d9](https://github.com/typescript-language-server/typescript-language-server/commit/3c140d958507300d7d186adb84f5b0baa549edb2)) + + +### Bug Fixes + +* declare quickfix/refactor CodeAction capabilities ([#553](https://github.com/typescript-language-server/typescript-language-server/issues/553)) ([e76fc64](https://github.com/typescript-language-server/typescript-language-server/commit/e76fc6493295649d6ada83c8a5f6d88abe2a6167)) +* handle shutdown lifecycle properly ([#536](https://github.com/typescript-language-server/typescript-language-server/issues/536)) ([ac8536b](https://github.com/typescript-language-server/typescript-language-server/commit/ac8536bf8eb805bfc28e484a8f4827b5375d6824)) + + +### Miscellaneous Chores + +* **deps:** update LSP libraries to match 3.17 spec ([#532](https://github.com/typescript-language-server/typescript-language-server/issues/532)) ([bdbdd83](https://github.com/typescript-language-server/typescript-language-server/commit/bdbdd8379815583aa28d2a770034253050ba24de)) + + +### Code Refactoring + +* ship as an ES module ([#547](https://github.com/typescript-language-server/typescript-language-server/issues/547)) ([0dfd411](https://github.com/typescript-language-server/typescript-language-server/commit/0dfd41125c04868b547a3893334bb0bb822e0517)) + +## [0.11.2](https://github.com/typescript-language-server/typescript-language-server/compare/v0.11.1...v0.11.2) (2022-06-24) + + +### Bug Fixes + +* apply refactoring returns -1 positions in ranges ([#502](https://github.com/typescript-language-server/typescript-language-server/issues/502)) ([5f52db0](https://github.com/typescript-language-server/typescript-language-server/commit/5f52db0383d6c326cd321c13fc969ab9d3958011)) + +## [0.11.1](https://github.com/typescript-language-server/typescript-language-server/compare/v0.11.0...v0.11.1) (2022-06-13) + + +### Bug Fixes + +* completion for strings with trigger character ([#492](https://github.com/typescript-language-server/typescript-language-server/issues/492)) ([76bf9a4](https://github.com/typescript-language-server/typescript-language-server/commit/76bf9a4817ffa1e340422cfd5177dbcb96528ddb)) + +## [0.11.0](https://github.com/typescript-language-server/typescript-language-server/compare/v0.10.1...v0.11.0) (2022-06-06) + + +### Features + +* add support for rename prefixText and suffixText on rename ([#478](https://github.com/typescript-language-server/typescript-language-server/issues/478)) ([b3c8535](https://github.com/typescript-language-server/typescript-language-server/commit/b3c85354c71dc36e1d4775bf61d7064a6b85e958)) + +### [0.10.1](https://github.com/typescript-language-server/typescript-language-server/compare/v0.10.0...v0.10.1) (2022-05-18) + + +### Bug Fixes + +* pin old version of LSP libraries for node <14 compatibility ([#467](https://github.com/typescript-language-server/typescript-language-server/issues/467)) ([55600e1](https://github.com/typescript-language-server/typescript-language-server/commit/55600e12635c01d5a531b776b33d10f9e622a7a6)) + +## [0.10.0](https://github.com/typescript-language-server/typescript-language-server/compare/v0.9.7...v0.10.0) (2022-05-11) + + +### Features + +* add support for locale option ([#461](https://github.com/typescript-language-server/typescript-language-server/issues/461)) ([be6a95d](https://github.com/typescript-language-server/typescript-language-server/commit/be6a95ddf6abf8cb68689a6995e3e55858eacb23)) + +### [0.9.7](https://github.com/typescript-language-server/typescript-language-server/compare/v0.9.6...v0.9.7) (2022-02-27) + + +### Bug Fixes + +* add more logging for resolving user-specified tsserver ([#412](https://github.com/typescript-language-server/typescript-language-server/issues/412)) ([7139a32](https://github.com/typescript-language-server/typescript-language-server/commit/7139a32da05b6e3dfcd3252bde934dc499412d3d)) +* help users resolve no valid tsserver version error ([#337](https://github.com/typescript-language-server/typescript-language-server/issues/337)) ([d835543](https://github.com/typescript-language-server/typescript-language-server/commit/d835543e455a51ec159457a1479a550712574099)) + +## [0.9.6] - 2022-02-02 + + - **fix**: don't transform zipfile URIs from Vim (#386) + +## [0.9.5] - 2022-01-27 + + - **fix**: don't transform Yarn zipfile URIs (#384) + +## [0.9.4] - 2022-01-19 + + - **fix**: call configure before completion resolve (#377) + +## [0.9.3] - 2022-01-16 + + - **fix**: wait for tsserver configuration requests to finish (#372) + +## [0.9.2] - 2022-01-14 + + - **fix**: use correct name for the addMissingImports code action (#371) + +## [0.9.1] - 2022-01-07 + + - **fix**: don't use the postinstall script + +## [0.9.0] - 2022-01-07 + + - **feat**: implement additional code actions for handling auto-fixing (#318) + + - **feat**: report progress when loading the project (#326) + + - **feat**: add new preferences from typescript 4.5.3 (#304) + + - **fix**: correct matching of "only" kinds provided by the client (#334) + + - **fix**: pass format options for organizing import (#348) + + - **fix**: use snippet type for jsx attribute completions (#362) + +## [0.8.1] - 2021-11-25 + + - **fix**: lookup workspace typescript in dirs higher up the tree also (#314) + +## [0.8.0] - 2021-11-21 + + - **feat**: implement semantic tokens support (#290) + + - **feat**: add support for snippet completions for methods/functions (#303) + + - **feat**: ability to ignore diagnostics by code (#272) + Adds new `diagnostics.ignoredCodes` workspace setting to ignore specific diagnostics. + + - **feat**: add `npmLocation` option to specify NPM location (#293) + + - **fix**: don't announce support for codeActionKinds (#289) + + - **fix**: mark import completions as snippets (#291) + + - **fix**: specify minimum node version to be v12 (#301) + + - **fix**: ensure that the `tsserver` subprocess uses forked node instance (#292) + Potentially **BREAKING**. The lookup of `tsserver` was refactored to never use `spawn` logic but instead always `fork` the current node instance. See more info in the PR. + + - **fix**: exit the server if tsserver process crashes (#305) + + - **fix**: respect "includeDeclaration" for references request (#306) + +## [0.7.1] - 2021-11-10 + + - fix: add missing `semver` dependency (#288) + +## [0.7.0] - 2021-11-09 + +### Breaking + +Changes to default options sent to tsserver could affect behavior (hopefully for the better). Read changes below for more details. + +### Changes + +- **feat**: include import specifier for import completions (#281) + For completions that import from another package, the completions will include a "detail" field with the name of the module. + + Also aligned some other logic with the typescript language services used in VSCode: + * annotate the completions with the local name of the import when completing a path in import foo from '...' + * update completion "sortText" regardless if the completion "isRecommended" + +- **feat**: allow skip destructive actions on running OrganizeImports (#228) + Add support for the new skipDestructiveCodeActions argument to TypeScript's organize imports feature - [1] to support [2]. + + Support is added in two places: + * Automatically inferring the proper value based on diagnostics for the file when returning code actions. + * Supporting sending it when manually executing the organize imports action. + + Also added documentation to the readme about the supported commands that can be manually executed. + + [1] https://github.com/microsoft/TypeScript/issues/43051 + [2] https://github.com/apexskier/nova-typescript/issues/273 + +- **feat**: support running server on files without root workspace (#286) + The tsserver seems to be good at inferring the project configuration when opening single files without a workspace so don't crash on missing `rootPath`. + +- **feat**: add `disableAutomaticTypingAcquisition` option to disable automatic type acquisition (#285) +- **feat**: update default tsserver options (#284) + Set the following additional options by default: + ``` + allowRenameOfImportPath: true, + displayPartsForJSDoc: true, + generateReturnInDocTemplate: true, + includeAutomaticOptionalChainCompletions: true, + includeCompletionsForImportStatements: true, + includeCompletionsWithSnippetText: true, + ``` + This aligns more with the default options of the typescript language services in VSCode. +- **feat**: announce support for "source.organizeImports.ts-ls" action (#283) + Announcing support for that code action allows editors that support + running code actions on save to automatically run the code action if + the user has configured the editor with settings like + + ```js + "codeActionsOnSave": { + "source.organizeImports": true, + // or + "source.organizeImports.ts-ls": true, + }, + ``` + - **chore**: change default log level from "warn" to "info" (#287) + +## [0.6.5] - 2021-11-03 + + - fix: normalize client and tsserver paths (#275) + This should ensure consistent behavior regradless of the platform. Previously some functionality could be malfunctioning on Windows depending on the LSP client used due to using non-normalized file paths. + - Handle the `APPLY_COMPLETION_CODE_ACTION` command internally (#270) + This means that the clients that have implemented a custom handling for the `_typescript.applyCompletionCodeAction` command can remove that code. + Without removing the custom handling everything should work as before but some edge cases might work better when custom handling is removed. + - fix: ignore empty code blocks in content returned from `textDocument/hover` (#276) + - fix: remove unsupported --node-ipc and --socket options (#278) + +## [0.6.4] - 2021-10-12 + + - Fix broken logging (#267) + - Add support for `workspace/didChangeConfiguration` and setting formatting options per language (#268) + - Add option to set inlayHints preferences by language (#266) + +## [0.6.3] - 2021-10-27 + + - Implement experimental inlay hints (#259) ([documentation](https://github.com/typescript-language-server/typescript-language-server#typescriptinlayhints-experimental-supported-from-typescript-v442)) + - Send diagnostics even to clients that don't signal support (#261) (reverts #229) + +## [0.6.2] - 2021-08-16 + + - Mark completion items as deprecated if JSDoc says so (#227) + - Add a `maxTsServerMemory` option (#252) + - (chore) Add Windows and Mac CI runner (#248) + +## [0.6.1] - 2021-08-16 + +- Fix Windows path regression introduced in #220 (#249) + +## [0.6.0] - 2021-08-12 + +- Refactor code actions to better support filtering against "only" (#170) +- Support Yarn PnP (#220) +- Update internal Typescript dependency from 3.9.0 to 4.3.4 (#226) +- Only publish diagnostics if client supports the capability (#229) +- Add support for "unnecessary" and "deprecated" diagnostic tags (#230) +- Upgrade vscode-languageserver (#231) +- Lookup tsserver using direct path rather than through .bin alias (#234) +- Don't pass deprecated options to Completion request + +## [0.5.4] - 2021-07-01 + +- Remove hardcoded request timeouts +- Forward user preferences in `initializationOptions` +- Use `require.resolve` for module resolution (#195) + +## [0.5.0] - 2021-01-16 + +- Fix empty documentHighlight results due to inconsistent path delimiters +- Update command line option `tssserver-log-verbosity` to support `off` +- Call compilerOptionsForInferredProjects during initialization (set good defaults when tsconfig.json missing) +- Remove warnings from LSP completion results +- Add support for formatting range (textDocument/rangeFormatting) +- Ensure TSP request cancellation cancels timeout handling + +## [0.4.0] - 2019-08-28 + +- Upgraded to LSP 5.3.0 and Monaco 0.17.0. [#115](https://github.com/theia-ide/typescript-language-server/pull/115) + +## [0.3.7] - 2018-11-18 + +- Let documentSymbol return the correct results when mergeable elements are used [#77](https://github.com/theia-ide/typescript-language-server/pull/77) +- Return correct ranges for hierarchical document symbol [#79](https://github.com/theia-ide/typescript-language-server/pull/79) +- Return null when resolving completion request at an invalid location [#81](https://github.com/theia-ide/typescript-language-server/pull/81) +- Initial call hierarchy support [#85](https://github.com/theia-ide/typescript-language-server/pull/85) +- Allowing starting tsserver as a module using cp.fork [#88](https://github.com/theia-ide/typescript-language-server/pull/88) + +Thanks to [@AlexTugarev](https://github.com/AlexTugarev) and [@keyboardDrummer](https://github.com/keyboardDrummer) + +## [0.3.6] - 2018-09-18 + +- Respect URIs received from clients [#75](https://github.com/theia-ide/typescript-language-server/pull/75) + +## [0.3.5] - 2018-09-14 +- Fixed publishing diagnostics for all opened documents [#71](https://github.com/theia-ide/typescript-language-server/pull/71) - thanks to [@keyboardDrummer](https://github.com/keyboardDrummer) +- Support global tsserver plugins [#73](https://github.com/theia-ide/typescript-language-server/pull/73) +- Configure a tsserver log file via `TSSERVER_LOG_FILE` env variable [#73](https://github.com/theia-ide/typescript-language-server/pull/73) + +## [0.3.4] - 2018-09-12 +- Restore containerName for non-hierarchical symbols [#69](https://github.com/theia-ide/typescript-language-server/pull/69) + +## [0.3.3] - 2018-09-11 +- Fix updating documents on `didChange` notification [#65](https://github.com/theia-ide/typescript-language-server/pull/65) +- Debounce triggering diagnostics if a client is spamming with edits [#65](https://github.com/theia-ide/typescript-language-server/pull/65) + +## [0.3.2] - 2018-09-06 +- Hierarchical document symbols support [#62](https://github.com/theia-ide/typescript-language-server/pull/62) + +## [0.3.1] - 2018-09-04 + +- Allow a client to enable tsserver logging [#59](https://github.com/theia-ide/typescript-language-server/pull/59) + +## [0.3.0] - 2018-08-23 + +- Setup the monorepo with yarn workspaces and ts project references [#48](https://github.com/theia-ide/typescript-language-server/pull/48) +- Added a Monaco based example [#48](https://github.com/theia-ide/typescript-language-server/pull/48) +- Aligned `completion/completionResolve` with VS Code behaviour [#50](https://github.com/theia-ide/typescript-language-server/pull/50) +- Interrupt diagnostics to improve response time for other requests, as completion and signature help [#51](https://github.com/theia-ide/typescript-language-server/pull/51) +- Applied refactorings support [#51](https://github.com/theia-ide/typescript-language-server/pull/51) +- Suggest diagnostics support [#51](https://github.com/theia-ide/typescript-language-server/pull/51) +- Diagnostics buffering [#51](https://github.com/theia-ide/typescript-language-server/pull/51) +- Tolerating non-file URIs [#51](https://github.com/theia-ide/typescript-language-server/pull/51) +- Organize imports support [#51](https://github.com/theia-ide/typescript-language-server/pull/51) +- Added `Apply Rename File` command [#56](https://github.com/theia-ide/typescript-language-server/pull/56) + +[0.4.0]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.7...v0.4.0 +[0.3.7]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.6...v0.3.7 +[0.3.6]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.5...v0.3.6 +[0.3.5]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.4...v0.3.5 +[0.3.4]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.3...v0.3.4 +[0.3.3]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.2...v0.3.3 +[0.3.2]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.1...v0.3.2 +[0.3.1]: https://github.com/theia-ide/typescript-language-server/compare/961d937f3ee3ea6b68cb98a6c235c6beea5f2fa5...v0.3.1 +[0.3.0]: https://github.com/theia-ide/typescript-language-server/compare/v0.2.0...961d937f3ee3ea6b68cb98a6c235c6beea5f2fa5 diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/LICENSE b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/LICENSE new file mode 100644 index 00000000..671b6d79 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/LICENSE @@ -0,0 +1,240 @@ +Parts of the code copied from the https://github.com/microsoft/vscode repository are licensed under the following license: + +BEGIN LICENSE ---------------------------------------------------------------- + +MIT License + +Copyright (c) 2015 - present Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +END LICESE ------------------------------------------------------------------- + +This applies to files that include the following license header: + +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +The rest of the code licensed under: + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/README.md b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/README.md new file mode 100644 index 00000000..75f0de49 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/README.md @@ -0,0 +1,307 @@ +[![Discord][discord-src]][discord-href] +[![npm version][npm-version-src]][npm-version-href] +[![npm downloads][npm-downloads-src]][npm-downloads-href] + +# TypeScript Language Server + +[Language Server Protocol](https://github.com/Microsoft/language-server-protocol) implementation for TypeScript wrapping `tsserver`. + +Based on concepts and ideas from https://github.com/prabirshrestha/typescript-language-server and originally maintained by [TypeFox](https://typefox.io). + +Maintained by a [community of contributors](https://github.com/typescript-language-server/typescript-language-server/graphs/contributors) like you. + + + +- [Installing](#installing) +- [Running the language server](#running-the-language-server) +- [CLI Options](#cli-options) +- [Configuration](#configuration) +- [Features](#features) + - [Code actions on save](#code-actions-on-save) + - [Workspace commands \(`workspace/executeCommand`\)](#workspace-commands-workspaceexecutecommand) + - [Go to Source Definition](#go-to-source-definition) + - [Apply Workspace Edits](#apply-workspace-edits) + - [Apply Code Action](#apply-code-action) + - [Apply Refactoring](#apply-refactoring) + - [Organize Imports](#organize-imports) + - [Rename File](#rename-file) + - [Configure plugin](#configure-plugin) + - [Code Lenses \(`textDocument/codeLens`\)](#code-lenses-textdocumentcodelens) + - [Inlay hints \(`textDocument/inlayHint`\)](#inlay-hints-textdocumentinlayhint) + - [TypeScript Version Notification](#typescript-version-notification) +- [Development](#development) + - [Build](#build) + - [Dev](#dev) + - [Test](#test) + - [Publishing](#publishing) + + + +## Installing + +```sh +npm install -g typescript-language-server typescript +``` + +## Running the language server + +``` +typescript-language-server --stdio +``` + +## CLI Options + +``` + Usage: typescript-language-server [options] + + + Options: + + -V, --version output the version number + --stdio use stdio (required option) + --log-level A number indicating the log level (4 = log, 3 = info, 2 = warn, 1 = error). Defaults to `3`. + -h, --help output usage information +``` + +## Configuration + +See [configuration documentation](./docs/configuration.md). + +## Features + +### Code actions on save + +Server announces support for the following code action kinds: + + - `source.fixAll.ts` - despite the name, fixes a couple of specific issues: unreachable code, await in non-async functions, incorrectly implemented interface + - `source.removeUnused.ts` - removes declared but unused variables + - `source.addMissingImports.ts` - adds imports for used but not imported symbols + - `source.removeUnusedImports.ts` - removes unused imports + - `source.sortImports.ts` - sorts imports + - `source.organizeImports.ts` - organizes and removes unused imports + +This allows editors that support running code actions on save to automatically run fixes associated with those kinds. + +Those code actions, if they apply in the current code, should also be presented in the list of "Source Actions" if the editor exposes those. + +The user can enable it with a setting similar to (can vary per-editor): + +```js +"codeActionsOnSave": { + "source.organizeImports.ts": true, + // or just + "source.organizeImports": true, +} +``` + +### Workspace commands (`workspace/executeCommand`) + +See [LSP specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_executeCommand). + +Most of the time, you'll execute commands with arguments retrieved from another request like `textDocument/codeAction`. There are some use cases for calling them manually. + +`lsp` refers to the language server protocol types, `tsp` refers to the typescript server protocol types. + +#### Go to Source Definition + +- Request: + ```ts + { + command: `_typescript.goToSourceDefinition` + arguments: [ + lsp.DocumentUri, // String URI of the document + lsp.Position, // Line and character position (zero-based) + ] + } + ``` +- Response: + ```ts + lsp.Location[] | null + ``` + +(This command is supported from Typescript 4.7.) + +#### Apply Workspace Edits + +- Request: + ```ts + { + command: `_typescript.applyWorkspaceEdit` + arguments: [lsp.WorkspaceEdit] + } + ``` +- Response: + ```ts + lsp.ApplyWorkspaceEditResult + ``` + +#### Apply Code Action + +- Request: + ```ts + { + command: `_typescript.applyCodeAction` + arguments: [ + tsp.CodeAction, // TypeScript Code Action object + ] + } + ``` +- Response: + ```ts + void + ``` + +#### Apply Refactoring + +- Request: + ```ts + { + command: `_typescript.applyRefactoring` + arguments: [ + tsp.GetEditsForRefactorRequestArgs, + ] + } + ``` +- Response: + ```ts + void + ``` + +#### Organize Imports + +- Request: + ```ts + { + command: `_typescript.organizeImports` + arguments: [ + // The "skipDestructiveCodeActions" argument is supported from Typescript 4.4+ + [string] | [string, { skipDestructiveCodeActions?: boolean }], + ] + } + ``` +- Response: + ```ts + void + ``` + +#### Rename File + +- Request: + ```ts + { + command: `_typescript.applyRenameFile` + arguments: [ + { sourceUri: string; targetUri: string; }, + ] + } + ``` +- Response: + ```ts + void + ``` + +#### Configure plugin + +- Request: + ```ts + { + command: `_typescript.configurePlugin` + arguments: [pluginName: string, configuration: any] + } + ``` +- Response: + ```ts + void + ``` + +### Code Lenses (`textDocument/codeLens`) + +Code lenses can be enabled using the `implementationsCodeLens` and `referencesCodeLens` [workspace configuration options](/docs/configuration.md/#workspacedidchangeconfiguration). + +Code lenses provide a count of **references** and/or **implemenations** for symbols in the document. For clients that support it it's also possible to click on those to navigate to the relevant locations in the the project. Do note that clicking those trigger a `editor.action.showReferences` command which is something that client needs to have explicit support for. Many do by default but some don't. An example command will look like this: + +```ts +command: { + title: '1 reference', + command: 'editor.action.showReferences', + arguments: [ + 'file://project/foo.ts', // URI + { line: 1, character: 1 }, // Position + [ // A list of Location objects. + { + uri: 'file://project/bar.ts', + range: { + start: { + line: 7, + character: 24, + }, + end: { + line: 7, + character: 28, + }, + }, + }, + ], + ], +} +``` + +### Inlay hints (`textDocument/inlayHint`) + +For the request to return any results, some or all of the following options need to be enabled through `preferences`: + +```ts +export interface InlayHintsOptions extends UserPreferences { + includeInlayParameterNameHints: 'none' | 'literals' | 'all'; + includeInlayParameterNameHintsWhenArgumentMatchesName: boolean; + includeInlayFunctionParameterTypeHints: boolean; + includeInlayVariableTypeHints: boolean; + includeInlayVariableTypeHintsWhenTypeMatchesName: boolean; + includeInlayPropertyDeclarationTypeHints: boolean; + includeInlayFunctionLikeReturnTypeHints: boolean; + includeInlayEnumMemberValueHints: boolean; +} +``` + +### TypeScript Version Notification + +Right after initializing, the server sends a custom `$/typescriptVersion` notification that carries information about the version of TypeScript that is utilized by the server. The editor can then display that information in the UI. + +The `$/typescriptVersion` notification params include two properties: + + - `version` - a semantic version (for example `4.8.4`) + - `source` - a string specifying whether used TypeScript version comes from the local workspace (`workspace`), is explicitly specified through a `initializationOptions.tsserver.path` setting (`user-setting`) or was bundled with the server (`bundled`) + +## Development + +### Build + +```sh +yarn build +``` + +### Dev + +Build and rebuild on change. + +```sh +yarn dev +``` + +### Test + + - `yarn test` - run all tests in watch mode for developing + - `yarn test:commit` - run all tests once + +By default only console logs of level `warning` and higher are printed to the console. You can override the `CONSOLE_LOG_LEVEL` level in `package.json` to either `log`, `info`, `warning` or `error` to log other levels. + +### Publishing + +The project uses https://github.com/google-github-actions/release-please-action Github action to automatically release new version on merging a release PR. + +[npm-version-src]: https://img.shields.io/npm/dt/typescript-language-server.svg?style=flat-square +[npm-version-href]: https://npmjs.com/package/typescript-language-server +[npm-downloads-src]: https://img.shields.io/npm/v/typescript-language-server/latest.svg?style=flat-square +[npm-downloads-href]: https://npmjs.com/package/typescript-language-server +[discord-src]: https://img.shields.io/discord/873659987413573634?style=flat-square +[discord-href]: https://discord.gg/AC7Vs6hwFa diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/lib/cli.mjs b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/lib/cli.mjs new file mode 100755 index 00000000..166b203b --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/lib/cli.mjs @@ -0,0 +1,23535 @@ +#!/usr/bin/env node +import fs$l, { promises, statSync, existsSync, readFileSync as readFileSync$1 } from 'node:fs'; + +import require$$0 from 'events'; + +import require$$1 from 'child_process'; + +import require$$1$1 from 'path'; + +import require$$0$1 from 'fs'; + +import require$$4 from 'process'; + +import require$$0$4, { promisify as promisify$1 } from 'node:util'; + +import require$$0$2, { promisify } from 'util'; + +import require$$2 from 'os'; + +import crypto from 'crypto'; + +import require$$4$1 from 'net'; + +import require$$0$3 from 'url'; + +import * as path$e from 'node:path'; + +import path__default, { extname, resolve as resolve$1 } from 'node:path'; + +import require$$0$5 from 'constants'; + +import require$$0$6 from 'stream'; + +import require$$5 from 'assert'; + +import os from 'node:os'; + +import 'node:fs/promises'; + +import stream from 'node:stream'; + +import ChildProcess from 'node:child_process'; + +import { createRequire } from 'node:module'; + +import require$$1$2 from 'fs/promises'; + +import { fileURLToPath } from 'node:url'; + +import process$2 from 'node:process'; + +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function getDefaultExportFromCjs(x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +var commander = {}; + +var argument = {}; + +var error$2 = {}; + +let CommanderError$3 = class CommanderError extends Error { + constructor(exitCode, code, message) { + super(message); + Error.captureStackTrace(this, this.constructor); + this.name = this.constructor.name; + this.code = code; + this.exitCode = exitCode; + this.nestedError = undefined; + } +}; + +let InvalidArgumentError$4 = class InvalidArgumentError extends CommanderError$3 { + constructor(message) { + super(1, 'commander.invalidArgument', message); + Error.captureStackTrace(this, this.constructor); + this.name = this.constructor.name; + } +}; + +error$2.CommanderError = CommanderError$3; + +error$2.InvalidArgumentError = InvalidArgumentError$4; + +const {InvalidArgumentError: InvalidArgumentError$3} = error$2; + +let Argument$3 = class Argument { + constructor(name, description) { + this.description = description || ''; + this.variadic = false; + this.parseArg = undefined; + this.defaultValue = undefined; + this.defaultValueDescription = undefined; + this.argChoices = undefined; + switch (name[0]) { + case '<': + this.required = true; + this._name = name.slice(1, -1); + break; + + case '[': + this.required = false; + this._name = name.slice(1, -1); + break; + + default: + this.required = true; + this._name = name; + break; + } + if (this._name.length > 3 && this._name.slice(-3) === '...') { + this.variadic = true; + this._name = this._name.slice(0, -3); + } + } + name() { + return this._name; + } + _concatValue(value, previous) { + if (previous === this.defaultValue || !Array.isArray(previous)) { + return [ value ]; + } + return previous.concat(value); + } + default(value, description) { + this.defaultValue = value; + this.defaultValueDescription = description; + return this; + } + argParser(fn) { + this.parseArg = fn; + return this; + } + choices(values) { + this.argChoices = values.slice(); + this.parseArg = (arg, previous) => { + if (!this.argChoices.includes(arg)) { + throw new InvalidArgumentError$3(`Allowed choices are ${this.argChoices.join(', ')}.`); + } + if (this.variadic) { + return this._concatValue(arg, previous); + } + return arg; + }; + return this; + } + argRequired() { + this.required = true; + return this; + } + argOptional() { + this.required = false; + return this; + } +}; + +function humanReadableArgName$2(arg) { + const nameOutput = arg.name() + (arg.variadic === true ? '...' : ''); + return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']'; +} + +argument.Argument = Argument$3; + +argument.humanReadableArgName = humanReadableArgName$2; + +var command = {}; + +var help = {}; + +const {humanReadableArgName: humanReadableArgName$1} = argument; + +let Help$3 = class Help { + constructor() { + this.helpWidth = undefined; + this.sortSubcommands = false; + this.sortOptions = false; + this.showGlobalOptions = false; + } + visibleCommands(cmd) { + const visibleCommands = cmd.commands.filter((cmd => !cmd._hidden)); + const helpCommand = cmd._getHelpCommand(); + if (helpCommand && !helpCommand._hidden) { + visibleCommands.push(helpCommand); + } + if (this.sortSubcommands) { + visibleCommands.sort(((a, b) => a.name().localeCompare(b.name()))); + } + return visibleCommands; + } + compareOptions(a, b) { + const getSortKey = option => option.short ? option.short.replace(/^-/, '') : option.long.replace(/^--/, ''); + return getSortKey(a).localeCompare(getSortKey(b)); + } + visibleOptions(cmd) { + const visibleOptions = cmd.options.filter((option => !option.hidden)); + const helpOption = cmd._getHelpOption(); + if (helpOption && !helpOption.hidden) { + const removeShort = helpOption.short && cmd._findOption(helpOption.short); + const removeLong = helpOption.long && cmd._findOption(helpOption.long); + if (!removeShort && !removeLong) { + visibleOptions.push(helpOption); + } else if (helpOption.long && !removeLong) { + visibleOptions.push(cmd.createOption(helpOption.long, helpOption.description)); + } else if (helpOption.short && !removeShort) { + visibleOptions.push(cmd.createOption(helpOption.short, helpOption.description)); + } + } + if (this.sortOptions) { + visibleOptions.sort(this.compareOptions); + } + return visibleOptions; + } + visibleGlobalOptions(cmd) { + if (!this.showGlobalOptions) return []; + const globalOptions = []; + for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) { + const visibleOptions = ancestorCmd.options.filter((option => !option.hidden)); + globalOptions.push(...visibleOptions); + } + if (this.sortOptions) { + globalOptions.sort(this.compareOptions); + } + return globalOptions; + } + visibleArguments(cmd) { + if (cmd._argsDescription) { + cmd.registeredArguments.forEach((argument => { + argument.description = argument.description || cmd._argsDescription[argument.name()] || ''; + })); + } + if (cmd.registeredArguments.find((argument => argument.description))) { + return cmd.registeredArguments; + } + return []; + } + subcommandTerm(cmd) { + const args = cmd.registeredArguments.map((arg => humanReadableArgName$1(arg))).join(' '); + return cmd._name + (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') + (cmd.options.length ? ' [options]' : '') + (args ? ' ' + args : ''); + } + optionTerm(option) { + return option.flags; + } + argumentTerm(argument) { + return argument.name(); + } + longestSubcommandTermLength(cmd, helper) { + return helper.visibleCommands(cmd).reduce(((max, command) => Math.max(max, helper.subcommandTerm(command).length)), 0); + } + longestOptionTermLength(cmd, helper) { + return helper.visibleOptions(cmd).reduce(((max, option) => Math.max(max, helper.optionTerm(option).length)), 0); + } + longestGlobalOptionTermLength(cmd, helper) { + return helper.visibleGlobalOptions(cmd).reduce(((max, option) => Math.max(max, helper.optionTerm(option).length)), 0); + } + longestArgumentTermLength(cmd, helper) { + return helper.visibleArguments(cmd).reduce(((max, argument) => Math.max(max, helper.argumentTerm(argument).length)), 0); + } + commandUsage(cmd) { + let cmdName = cmd._name; + if (cmd._aliases[0]) { + cmdName = cmdName + '|' + cmd._aliases[0]; + } + let ancestorCmdNames = ''; + for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) { + ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames; + } + return ancestorCmdNames + cmdName + ' ' + cmd.usage(); + } + commandDescription(cmd) { + return cmd.description(); + } + subcommandDescription(cmd) { + return cmd.summary() || cmd.description(); + } + optionDescription(option) { + const extraInfo = []; + if (option.argChoices) { + extraInfo.push(`choices: ${option.argChoices.map((choice => JSON.stringify(choice))).join(', ')}`); + } + if (option.defaultValue !== undefined) { + const showDefault = option.required || option.optional || option.isBoolean() && typeof option.defaultValue === 'boolean'; + if (showDefault) { + extraInfo.push(`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`); + } + } + if (option.presetArg !== undefined && option.optional) { + extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`); + } + if (option.envVar !== undefined) { + extraInfo.push(`env: ${option.envVar}`); + } + if (extraInfo.length > 0) { + return `${option.description} (${extraInfo.join(', ')})`; + } + return option.description; + } + argumentDescription(argument) { + const extraInfo = []; + if (argument.argChoices) { + extraInfo.push(`choices: ${argument.argChoices.map((choice => JSON.stringify(choice))).join(', ')}`); + } + if (argument.defaultValue !== undefined) { + extraInfo.push(`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`); + } + if (extraInfo.length > 0) { + const extraDescripton = `(${extraInfo.join(', ')})`; + if (argument.description) { + return `${argument.description} ${extraDescripton}`; + } + return extraDescripton; + } + return argument.description; + } + formatHelp(cmd, helper) { + const termWidth = helper.padWidth(cmd, helper); + const helpWidth = helper.helpWidth || 80; + const itemIndentWidth = 2; + const itemSeparatorWidth = 2; + function formatItem(term, description) { + if (description) { + const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`; + return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth); + } + return term; + } + function formatList(textArray) { + return textArray.join('\n').replace(/^/gm, ' '.repeat(itemIndentWidth)); + } + let output = [ `Usage: ${helper.commandUsage(cmd)}`, '' ]; + const commandDescription = helper.commandDescription(cmd); + if (commandDescription.length > 0) { + output = output.concat([ helper.wrap(commandDescription, helpWidth, 0), '' ]); + } + const argumentList = helper.visibleArguments(cmd).map((argument => formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument)))); + if (argumentList.length > 0) { + output = output.concat([ 'Arguments:', formatList(argumentList), '' ]); + } + const optionList = helper.visibleOptions(cmd).map((option => formatItem(helper.optionTerm(option), helper.optionDescription(option)))); + if (optionList.length > 0) { + output = output.concat([ 'Options:', formatList(optionList), '' ]); + } + if (this.showGlobalOptions) { + const globalOptionList = helper.visibleGlobalOptions(cmd).map((option => formatItem(helper.optionTerm(option), helper.optionDescription(option)))); + if (globalOptionList.length > 0) { + output = output.concat([ 'Global Options:', formatList(globalOptionList), '' ]); + } + } + const commandList = helper.visibleCommands(cmd).map((cmd => formatItem(helper.subcommandTerm(cmd), helper.subcommandDescription(cmd)))); + if (commandList.length > 0) { + output = output.concat([ 'Commands:', formatList(commandList), '' ]); + } + return output.join('\n'); + } + padWidth(cmd, helper) { + return Math.max(helper.longestOptionTermLength(cmd, helper), helper.longestGlobalOptionTermLength(cmd, helper), helper.longestSubcommandTermLength(cmd, helper), helper.longestArgumentTermLength(cmd, helper)); + } + wrap(str, width, indent, minColumnWidth = 40) { + const indents = ' \\f\\t\\v   -    \ufeff'; + const manualIndent = new RegExp(`[\\n][${indents}]+`); + if (str.match(manualIndent)) return str; + const columnWidth = width - indent; + if (columnWidth < minColumnWidth) return str; + const leadingStr = str.slice(0, indent); + const columnText = str.slice(indent).replace('\r\n', '\n'); + const indentString = ' '.repeat(indent); + const zeroWidthSpace = '​'; + const breaks = `\\s${zeroWidthSpace}`; + const regex = new RegExp(`\n|.{1,${columnWidth - 1}}([${breaks}]|$)|[^${breaks}]+?([${breaks}]|$)`, 'g'); + const lines = columnText.match(regex) || []; + return leadingStr + lines.map(((line, i) => { + if (line === '\n') return ''; + return (i > 0 ? indentString : '') + line.trimEnd(); + })).join('\n'); + } +}; + +help.Help = Help$3; + +var option = {}; + +const {InvalidArgumentError: InvalidArgumentError$2} = error$2; + +let Option$3 = class Option { + constructor(flags, description) { + this.flags = flags; + this.description = description || ''; + this.required = flags.includes('<'); + this.optional = flags.includes('['); + this.variadic = /\w\.\.\.[>\]]$/.test(flags); + this.mandatory = false; + const optionFlags = splitOptionFlags(flags); + this.short = optionFlags.shortFlag; + this.long = optionFlags.longFlag; + this.negate = false; + if (this.long) { + this.negate = this.long.startsWith('--no-'); + } + this.defaultValue = undefined; + this.defaultValueDescription = undefined; + this.presetArg = undefined; + this.envVar = undefined; + this.parseArg = undefined; + this.hidden = false; + this.argChoices = undefined; + this.conflictsWith = []; + this.implied = undefined; + } + default(value, description) { + this.defaultValue = value; + this.defaultValueDescription = description; + return this; + } + preset(arg) { + this.presetArg = arg; + return this; + } + conflicts(names) { + this.conflictsWith = this.conflictsWith.concat(names); + return this; + } + implies(impliedOptionValues) { + let newImplied = impliedOptionValues; + if (typeof impliedOptionValues === 'string') { + newImplied = { + [impliedOptionValues]: true + }; + } + this.implied = Object.assign(this.implied || {}, newImplied); + return this; + } + env(name) { + this.envVar = name; + return this; + } + argParser(fn) { + this.parseArg = fn; + return this; + } + makeOptionMandatory(mandatory = true) { + this.mandatory = !!mandatory; + return this; + } + hideHelp(hide = true) { + this.hidden = !!hide; + return this; + } + _concatValue(value, previous) { + if (previous === this.defaultValue || !Array.isArray(previous)) { + return [ value ]; + } + return previous.concat(value); + } + choices(values) { + this.argChoices = values.slice(); + this.parseArg = (arg, previous) => { + if (!this.argChoices.includes(arg)) { + throw new InvalidArgumentError$2(`Allowed choices are ${this.argChoices.join(', ')}.`); + } + if (this.variadic) { + return this._concatValue(arg, previous); + } + return arg; + }; + return this; + } + name() { + if (this.long) { + return this.long.replace(/^--/, ''); + } + return this.short.replace(/^-/, ''); + } + attributeName() { + return camelcase(this.name().replace(/^no-/, '')); + } + is(arg) { + return this.short === arg || this.long === arg; + } + isBoolean() { + return !this.required && !this.optional && !this.negate; + } +}; + +let DualOptions$1 = class DualOptions { + constructor(options) { + this.positiveOptions = new Map; + this.negativeOptions = new Map; + this.dualOptions = new Set; + options.forEach((option => { + if (option.negate) { + this.negativeOptions.set(option.attributeName(), option); + } else { + this.positiveOptions.set(option.attributeName(), option); + } + })); + this.negativeOptions.forEach(((value, key) => { + if (this.positiveOptions.has(key)) { + this.dualOptions.add(key); + } + })); + } + valueFromOption(value, option) { + const optionKey = option.attributeName(); + if (!this.dualOptions.has(optionKey)) return true; + const preset = this.negativeOptions.get(optionKey).presetArg; + const negativeValue = preset !== undefined ? preset : false; + return option.negate === (negativeValue === value); + } +}; + +function camelcase(str) { + return str.split('-').reduce(((str, word) => str + word[0].toUpperCase() + word.slice(1))); +} + +function splitOptionFlags(flags) { + let shortFlag; + let longFlag; + const flagParts = flags.split(/[ |,]+/); + if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) shortFlag = flagParts.shift(); + longFlag = flagParts.shift(); + if (!shortFlag && /^-[^-]$/.test(longFlag)) { + shortFlag = longFlag; + longFlag = undefined; + } + return { + shortFlag: shortFlag, + longFlag: longFlag + }; +} + +option.Option = Option$3; + +option.DualOptions = DualOptions$1; + +var suggestSimilar$2 = {}; + +const maxDistance = 3; + +function editDistance(a, b) { + if (Math.abs(a.length - b.length) > maxDistance) return Math.max(a.length, b.length); + const d = []; + for (let i = 0; i <= a.length; i++) { + d[i] = [ i ]; + } + for (let j = 0; j <= b.length; j++) { + d[0][j] = j; + } + for (let j = 1; j <= b.length; j++) { + for (let i = 1; i <= a.length; i++) { + let cost = 1; + if (a[i - 1] === b[j - 1]) { + cost = 0; + } else { + cost = 1; + } + d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost); + if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { + d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1); + } + } + } + return d[a.length][b.length]; +} + +function suggestSimilar$1(word, candidates) { + if (!candidates || candidates.length === 0) return ''; + candidates = Array.from(new Set(candidates)); + const searchingOptions = word.startsWith('--'); + if (searchingOptions) { + word = word.slice(2); + candidates = candidates.map((candidate => candidate.slice(2))); + } + let similar = []; + let bestDistance = maxDistance; + const minSimilarity = .4; + candidates.forEach((candidate => { + if (candidate.length <= 1) return; + const distance = editDistance(word, candidate); + const length = Math.max(word.length, candidate.length); + const similarity = (length - distance) / length; + if (similarity > minSimilarity) { + if (distance < bestDistance) { + bestDistance = distance; + similar = [ candidate ]; + } else if (distance === bestDistance) { + similar.push(candidate); + } + } + })); + similar.sort(((a, b) => a.localeCompare(b))); + if (searchingOptions) { + similar = similar.map((candidate => `--${candidate}`)); + } + if (similar.length > 1) { + return `\n(Did you mean one of ${similar.join(', ')}?)`; + } + if (similar.length === 1) { + return `\n(Did you mean ${similar[0]}?)`; + } + return ''; +} + +suggestSimilar$2.suggestSimilar = suggestSimilar$1; + +const EventEmitter = require$$0.EventEmitter; + +const childProcess = require$$1; + +const path$d = require$$1$1; + +const fs$k = require$$0$1; + +const process$1 = require$$4; + +const {Argument: Argument$2, humanReadableArgName: humanReadableArgName} = argument; + +const {CommanderError: CommanderError$2} = error$2; + +const {Help: Help$2} = help; + +const {Option: Option$2, DualOptions: DualOptions} = option; + +const {suggestSimilar: suggestSimilar} = suggestSimilar$2; + +let Command$2 = class Command extends EventEmitter { + constructor(name) { + super(); + this.commands = []; + this.options = []; + this.parent = null; + this._allowUnknownOption = false; + this._allowExcessArguments = true; + this.registeredArguments = []; + this._args = this.registeredArguments; + this.args = []; + this.rawArgs = []; + this.processedArgs = []; + this._scriptPath = null; + this._name = name || ''; + this._optionValues = {}; + this._optionValueSources = {}; + this._storeOptionsAsProperties = false; + this._actionHandler = null; + this._executableHandler = false; + this._executableFile = null; + this._executableDir = null; + this._defaultCommandName = null; + this._exitCallback = null; + this._aliases = []; + this._combineFlagAndOptionalValue = true; + this._description = ''; + this._summary = ''; + this._argsDescription = undefined; + this._enablePositionalOptions = false; + this._passThroughOptions = false; + this._lifeCycleHooks = {}; + this._showHelpAfterError = false; + this._showSuggestionAfterError = true; + this._outputConfiguration = { + writeOut: str => process$1.stdout.write(str), + writeErr: str => process$1.stderr.write(str), + getOutHelpWidth: () => process$1.stdout.isTTY ? process$1.stdout.columns : undefined, + getErrHelpWidth: () => process$1.stderr.isTTY ? process$1.stderr.columns : undefined, + outputError: (str, write) => write(str) + }; + this._hidden = false; + this._helpOption = undefined; + this._addImplicitHelpCommand = undefined; + this._helpCommand = undefined; + this._helpConfiguration = {}; + } + copyInheritedSettings(sourceCommand) { + this._outputConfiguration = sourceCommand._outputConfiguration; + this._helpOption = sourceCommand._helpOption; + this._helpCommand = sourceCommand._helpCommand; + this._helpConfiguration = sourceCommand._helpConfiguration; + this._exitCallback = sourceCommand._exitCallback; + this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties; + this._combineFlagAndOptionalValue = sourceCommand._combineFlagAndOptionalValue; + this._allowExcessArguments = sourceCommand._allowExcessArguments; + this._enablePositionalOptions = sourceCommand._enablePositionalOptions; + this._showHelpAfterError = sourceCommand._showHelpAfterError; + this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError; + return this; + } + _getCommandAndAncestors() { + const result = []; + for (let command = this; command; command = command.parent) { + result.push(command); + } + return result; + } + command(nameAndArgs, actionOptsOrExecDesc, execOpts) { + let desc = actionOptsOrExecDesc; + let opts = execOpts; + if (typeof desc === 'object' && desc !== null) { + opts = desc; + desc = null; + } + opts = opts || {}; + const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/); + const cmd = this.createCommand(name); + if (desc) { + cmd.description(desc); + cmd._executableHandler = true; + } + if (opts.isDefault) this._defaultCommandName = cmd._name; + cmd._hidden = !!(opts.noHelp || opts.hidden); + cmd._executableFile = opts.executableFile || null; + if (args) cmd.arguments(args); + this._registerCommand(cmd); + cmd.parent = this; + cmd.copyInheritedSettings(this); + if (desc) return this; + return cmd; + } + createCommand(name) { + return new Command(name); + } + createHelp() { + return Object.assign(new Help$2, this.configureHelp()); + } + configureHelp(configuration) { + if (configuration === undefined) return this._helpConfiguration; + this._helpConfiguration = configuration; + return this; + } + configureOutput(configuration) { + if (configuration === undefined) return this._outputConfiguration; + Object.assign(this._outputConfiguration, configuration); + return this; + } + showHelpAfterError(displayHelp = true) { + if (typeof displayHelp !== 'string') displayHelp = !!displayHelp; + this._showHelpAfterError = displayHelp; + return this; + } + showSuggestionAfterError(displaySuggestion = true) { + this._showSuggestionAfterError = !!displaySuggestion; + return this; + } + addCommand(cmd, opts) { + if (!cmd._name) { + throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`); + } + opts = opts || {}; + if (opts.isDefault) this._defaultCommandName = cmd._name; + if (opts.noHelp || opts.hidden) cmd._hidden = true; + this._registerCommand(cmd); + cmd.parent = this; + cmd._checkForBrokenPassThrough(); + return this; + } + createArgument(name, description) { + return new Argument$2(name, description); + } + argument(name, description, fn, defaultValue) { + const argument = this.createArgument(name, description); + if (typeof fn === 'function') { + argument.default(defaultValue).argParser(fn); + } else { + argument.default(fn); + } + this.addArgument(argument); + return this; + } + arguments(names) { + names.trim().split(/ +/).forEach((detail => { + this.argument(detail); + })); + return this; + } + addArgument(argument) { + const previousArgument = this.registeredArguments.slice(-1)[0]; + if (previousArgument && previousArgument.variadic) { + throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`); + } + if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) { + throw new Error(`a default value for a required argument is never used: '${argument.name()}'`); + } + this.registeredArguments.push(argument); + return this; + } + helpCommand(enableOrNameAndArgs, description) { + if (typeof enableOrNameAndArgs === 'boolean') { + this._addImplicitHelpCommand = enableOrNameAndArgs; + return this; + } + enableOrNameAndArgs = enableOrNameAndArgs ?? 'help [command]'; + const [, helpName, helpArgs] = enableOrNameAndArgs.match(/([^ ]+) *(.*)/); + const helpDescription = description ?? 'display help for command'; + const helpCommand = this.createCommand(helpName); + helpCommand.helpOption(false); + if (helpArgs) helpCommand.arguments(helpArgs); + if (helpDescription) helpCommand.description(helpDescription); + this._addImplicitHelpCommand = true; + this._helpCommand = helpCommand; + return this; + } + addHelpCommand(helpCommand, deprecatedDescription) { + if (typeof helpCommand !== 'object') { + this.helpCommand(helpCommand, deprecatedDescription); + return this; + } + this._addImplicitHelpCommand = true; + this._helpCommand = helpCommand; + return this; + } + _getHelpCommand() { + const hasImplicitHelpCommand = this._addImplicitHelpCommand ?? (this.commands.length && !this._actionHandler && !this._findCommand('help')); + if (hasImplicitHelpCommand) { + if (this._helpCommand === undefined) { + this.helpCommand(undefined, undefined); + } + return this._helpCommand; + } + return null; + } + hook(event, listener) { + const allowedValues = [ 'preSubcommand', 'preAction', 'postAction' ]; + if (!allowedValues.includes(event)) { + throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join('\', \'')}'`); + } + if (this._lifeCycleHooks[event]) { + this._lifeCycleHooks[event].push(listener); + } else { + this._lifeCycleHooks[event] = [ listener ]; + } + return this; + } + exitOverride(fn) { + if (fn) { + this._exitCallback = fn; + } else { + this._exitCallback = err => { + if (err.code !== 'commander.executeSubCommandAsync') { + throw err; + } + }; + } + return this; + } + _exit(exitCode, code, message) { + if (this._exitCallback) { + this._exitCallback(new CommanderError$2(exitCode, code, message)); + } + process$1.exit(exitCode); + } + action(fn) { + const listener = args => { + const expectedArgsCount = this.registeredArguments.length; + const actionArgs = args.slice(0, expectedArgsCount); + if (this._storeOptionsAsProperties) { + actionArgs[expectedArgsCount] = this; + } else { + actionArgs[expectedArgsCount] = this.opts(); + } + actionArgs.push(this); + return fn.apply(this, actionArgs); + }; + this._actionHandler = listener; + return this; + } + createOption(flags, description) { + return new Option$2(flags, description); + } + _callParseArg(target, value, previous, invalidArgumentMessage) { + try { + return target.parseArg(value, previous); + } catch (err) { + if (err.code === 'commander.invalidArgument') { + const message = `${invalidArgumentMessage} ${err.message}`; + this.error(message, { + exitCode: err.exitCode, + code: err.code + }); + } + throw err; + } + } + _registerOption(option) { + const matchingOption = option.short && this._findOption(option.short) || option.long && this._findOption(option.long); + if (matchingOption) { + const matchingFlag = option.long && this._findOption(option.long) ? option.long : option.short; + throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`); + } + this.options.push(option); + } + _registerCommand(command) { + const knownBy = cmd => [ cmd.name() ].concat(cmd.aliases()); + const alreadyUsed = knownBy(command).find((name => this._findCommand(name))); + if (alreadyUsed) { + const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|'); + const newCmd = knownBy(command).join('|'); + throw new Error(`cannot add command '${newCmd}' as already have command '${existingCmd}'`); + } + this.commands.push(command); + } + addOption(option) { + this._registerOption(option); + const oname = option.name(); + const name = option.attributeName(); + if (option.negate) { + const positiveLongFlag = option.long.replace(/^--no-/, '--'); + if (!this._findOption(positiveLongFlag)) { + this.setOptionValueWithSource(name, option.defaultValue === undefined ? true : option.defaultValue, 'default'); + } + } else if (option.defaultValue !== undefined) { + this.setOptionValueWithSource(name, option.defaultValue, 'default'); + } + const handleOptionValue = (val, invalidValueMessage, valueSource) => { + if (val == null && option.presetArg !== undefined) { + val = option.presetArg; + } + const oldValue = this.getOptionValue(name); + if (val !== null && option.parseArg) { + val = this._callParseArg(option, val, oldValue, invalidValueMessage); + } else if (val !== null && option.variadic) { + val = option._concatValue(val, oldValue); + } + if (val == null) { + if (option.negate) { + val = false; + } else if (option.isBoolean() || option.optional) { + val = true; + } else { + val = ''; + } + } + this.setOptionValueWithSource(name, val, valueSource); + }; + this.on('option:' + oname, (val => { + const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`; + handleOptionValue(val, invalidValueMessage, 'cli'); + })); + if (option.envVar) { + this.on('optionEnv:' + oname, (val => { + const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`; + handleOptionValue(val, invalidValueMessage, 'env'); + })); + } + return this; + } + _optionEx(config, flags, description, fn, defaultValue) { + if (typeof flags === 'object' && flags instanceof Option$2) { + throw new Error('To add an Option object use addOption() instead of option() or requiredOption()'); + } + const option = this.createOption(flags, description); + option.makeOptionMandatory(!!config.mandatory); + if (typeof fn === 'function') { + option.default(defaultValue).argParser(fn); + } else if (fn instanceof RegExp) { + const regex = fn; + fn = (val, def) => { + const m = regex.exec(val); + return m ? m[0] : def; + }; + option.default(defaultValue).argParser(fn); + } else { + option.default(fn); + } + return this.addOption(option); + } + option(flags, description, parseArg, defaultValue) { + return this._optionEx({}, flags, description, parseArg, defaultValue); + } + requiredOption(flags, description, parseArg, defaultValue) { + return this._optionEx({ + mandatory: true + }, flags, description, parseArg, defaultValue); + } + combineFlagAndOptionalValue(combine = true) { + this._combineFlagAndOptionalValue = !!combine; + return this; + } + allowUnknownOption(allowUnknown = true) { + this._allowUnknownOption = !!allowUnknown; + return this; + } + allowExcessArguments(allowExcess = true) { + this._allowExcessArguments = !!allowExcess; + return this; + } + enablePositionalOptions(positional = true) { + this._enablePositionalOptions = !!positional; + return this; + } + passThroughOptions(passThrough = true) { + this._passThroughOptions = !!passThrough; + this._checkForBrokenPassThrough(); + return this; + } + _checkForBrokenPassThrough() { + if (this.parent && this._passThroughOptions && !this.parent._enablePositionalOptions) { + throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`); + } + } + storeOptionsAsProperties(storeAsProperties = true) { + if (this.options.length) { + throw new Error('call .storeOptionsAsProperties() before adding options'); + } + if (Object.keys(this._optionValues).length) { + throw new Error('call .storeOptionsAsProperties() before setting option values'); + } + this._storeOptionsAsProperties = !!storeAsProperties; + return this; + } + getOptionValue(key) { + if (this._storeOptionsAsProperties) { + return this[key]; + } + return this._optionValues[key]; + } + setOptionValue(key, value) { + return this.setOptionValueWithSource(key, value, undefined); + } + setOptionValueWithSource(key, value, source) { + if (this._storeOptionsAsProperties) { + this[key] = value; + } else { + this._optionValues[key] = value; + } + this._optionValueSources[key] = source; + return this; + } + getOptionValueSource(key) { + return this._optionValueSources[key]; + } + getOptionValueSourceWithGlobals(key) { + let source; + this._getCommandAndAncestors().forEach((cmd => { + if (cmd.getOptionValueSource(key) !== undefined) { + source = cmd.getOptionValueSource(key); + } + })); + return source; + } + _prepareUserArgs(argv, parseOptions) { + if (argv !== undefined && !Array.isArray(argv)) { + throw new Error('first parameter to parse must be array or undefined'); + } + parseOptions = parseOptions || {}; + if (argv === undefined) { + argv = process$1.argv; + if (process$1.versions && process$1.versions.electron) { + parseOptions.from = 'electron'; + } + } + this.rawArgs = argv.slice(); + let userArgs; + switch (parseOptions.from) { + case undefined: + case 'node': + this._scriptPath = argv[1]; + userArgs = argv.slice(2); + break; + + case 'electron': + if (process$1.defaultApp) { + this._scriptPath = argv[1]; + userArgs = argv.slice(2); + } else { + userArgs = argv.slice(1); + } + break; + + case 'user': + userArgs = argv.slice(0); + break; + + default: + throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`); + } + if (!this._name && this._scriptPath) this.nameFromFilename(this._scriptPath); + this._name = this._name || 'program'; + return userArgs; + } + parse(argv, parseOptions) { + const userArgs = this._prepareUserArgs(argv, parseOptions); + this._parseCommand([], userArgs); + return this; + } + async parseAsync(argv, parseOptions) { + const userArgs = this._prepareUserArgs(argv, parseOptions); + await this._parseCommand([], userArgs); + return this; + } + _executeSubCommand(subcommand, args) { + args = args.slice(); + let launchWithNode = false; + const sourceExt = [ '.js', '.ts', '.tsx', '.mjs', '.cjs' ]; + function findFile(baseDir, baseName) { + const localBin = path$d.resolve(baseDir, baseName); + if (fs$k.existsSync(localBin)) return localBin; + if (sourceExt.includes(path$d.extname(baseName))) return undefined; + const foundExt = sourceExt.find((ext => fs$k.existsSync(`${localBin}${ext}`))); + if (foundExt) return `${localBin}${foundExt}`; + return undefined; + } + this._checkForMissingMandatoryOptions(); + this._checkForConflictingOptions(); + let executableFile = subcommand._executableFile || `${this._name}-${subcommand._name}`; + let executableDir = this._executableDir || ''; + if (this._scriptPath) { + let resolvedScriptPath; + try { + resolvedScriptPath = fs$k.realpathSync(this._scriptPath); + } catch (err) { + resolvedScriptPath = this._scriptPath; + } + executableDir = path$d.resolve(path$d.dirname(resolvedScriptPath), executableDir); + } + if (executableDir) { + let localFile = findFile(executableDir, executableFile); + if (!localFile && !subcommand._executableFile && this._scriptPath) { + const legacyName = path$d.basename(this._scriptPath, path$d.extname(this._scriptPath)); + if (legacyName !== this._name) { + localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`); + } + } + executableFile = localFile || executableFile; + } + launchWithNode = sourceExt.includes(path$d.extname(executableFile)); + let proc; + if (process$1.platform !== 'win32') { + if (launchWithNode) { + args.unshift(executableFile); + args = incrementNodeInspectorPort(process$1.execArgv).concat(args); + proc = childProcess.spawn(process$1.argv[0], args, { + stdio: 'inherit' + }); + } else { + proc = childProcess.spawn(executableFile, args, { + stdio: 'inherit' + }); + } + } else { + args.unshift(executableFile); + args = incrementNodeInspectorPort(process$1.execArgv).concat(args); + proc = childProcess.spawn(process$1.execPath, args, { + stdio: 'inherit' + }); + } + if (!proc.killed) { + const signals = [ 'SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP' ]; + signals.forEach((signal => { + process$1.on(signal, (() => { + if (proc.killed === false && proc.exitCode === null) { + proc.kill(signal); + } + })); + })); + } + const exitCallback = this._exitCallback; + proc.on('close', ((code, _signal) => { + code = code ?? 1; + if (!exitCallback) { + process$1.exit(code); + } else { + exitCallback(new CommanderError$2(code, 'commander.executeSubCommandAsync', '(close)')); + } + })); + proc.on('error', (err => { + if (err.code === 'ENOENT') { + const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : 'no directory for search for local subcommand, use .executableDir() to supply a custom directory'; + const executableMissing = `'${executableFile}' does not exist\n - if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${executableDirMessage}`; + throw new Error(executableMissing); + } else if (err.code === 'EACCES') { + throw new Error(`'${executableFile}' not executable`); + } + if (!exitCallback) { + process$1.exit(1); + } else { + const wrappedError = new CommanderError$2(1, 'commander.executeSubCommandAsync', '(error)'); + wrappedError.nestedError = err; + exitCallback(wrappedError); + } + })); + this.runningCommand = proc; + } + _dispatchSubcommand(commandName, operands, unknown) { + const subCommand = this._findCommand(commandName); + if (!subCommand) this.help({ + error: true + }); + let promiseChain; + promiseChain = this._chainOrCallSubCommandHook(promiseChain, subCommand, 'preSubcommand'); + promiseChain = this._chainOrCall(promiseChain, (() => { + if (subCommand._executableHandler) { + this._executeSubCommand(subCommand, operands.concat(unknown)); + } else { + return subCommand._parseCommand(operands, unknown); + } + })); + return promiseChain; + } + _dispatchHelpCommand(subcommandName) { + if (!subcommandName) { + this.help(); + } + const subCommand = this._findCommand(subcommandName); + if (subCommand && !subCommand._executableHandler) { + subCommand.help(); + } + return this._dispatchSubcommand(subcommandName, [], [ this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help' ]); + } + _checkNumberOfArguments() { + this.registeredArguments.forEach(((arg, i) => { + if (arg.required && this.args[i] == null) { + this.missingArgument(arg.name()); + } + })); + if (this.registeredArguments.length > 0 && this.registeredArguments[this.registeredArguments.length - 1].variadic) { + return; + } + if (this.args.length > this.registeredArguments.length) { + this._excessArguments(this.args); + } + } + _processArguments() { + const myParseArg = (argument, value, previous) => { + let parsedValue = value; + if (value !== null && argument.parseArg) { + const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`; + parsedValue = this._callParseArg(argument, value, previous, invalidValueMessage); + } + return parsedValue; + }; + this._checkNumberOfArguments(); + const processedArgs = []; + this.registeredArguments.forEach(((declaredArg, index) => { + let value = declaredArg.defaultValue; + if (declaredArg.variadic) { + if (index < this.args.length) { + value = this.args.slice(index); + if (declaredArg.parseArg) { + value = value.reduce(((processed, v) => myParseArg(declaredArg, v, processed)), declaredArg.defaultValue); + } + } else if (value === undefined) { + value = []; + } + } else if (index < this.args.length) { + value = this.args[index]; + if (declaredArg.parseArg) { + value = myParseArg(declaredArg, value, declaredArg.defaultValue); + } + } + processedArgs[index] = value; + })); + this.processedArgs = processedArgs; + } + _chainOrCall(promise, fn) { + if (promise && promise.then && typeof promise.then === 'function') { + return promise.then((() => fn())); + } + return fn(); + } + _chainOrCallHooks(promise, event) { + let result = promise; + const hooks = []; + this._getCommandAndAncestors().reverse().filter((cmd => cmd._lifeCycleHooks[event] !== undefined)).forEach((hookedCommand => { + hookedCommand._lifeCycleHooks[event].forEach((callback => { + hooks.push({ + hookedCommand: hookedCommand, + callback: callback + }); + })); + })); + if (event === 'postAction') { + hooks.reverse(); + } + hooks.forEach((hookDetail => { + result = this._chainOrCall(result, (() => hookDetail.callback(hookDetail.hookedCommand, this))); + })); + return result; + } + _chainOrCallSubCommandHook(promise, subCommand, event) { + let result = promise; + if (this._lifeCycleHooks[event] !== undefined) { + this._lifeCycleHooks[event].forEach((hook => { + result = this._chainOrCall(result, (() => hook(this, subCommand))); + })); + } + return result; + } + _parseCommand(operands, unknown) { + const parsed = this.parseOptions(unknown); + this._parseOptionsEnv(); + this._parseOptionsImplied(); + operands = operands.concat(parsed.operands); + unknown = parsed.unknown; + this.args = operands.concat(unknown); + if (operands && this._findCommand(operands[0])) { + return this._dispatchSubcommand(operands[0], operands.slice(1), unknown); + } + if (this._getHelpCommand() && operands[0] === this._getHelpCommand().name()) { + return this._dispatchHelpCommand(operands[1]); + } + if (this._defaultCommandName) { + this._outputHelpIfRequested(unknown); + return this._dispatchSubcommand(this._defaultCommandName, operands, unknown); + } + if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) { + this.help({ + error: true + }); + } + this._outputHelpIfRequested(parsed.unknown); + this._checkForMissingMandatoryOptions(); + this._checkForConflictingOptions(); + const checkForUnknownOptions = () => { + if (parsed.unknown.length > 0) { + this.unknownOption(parsed.unknown[0]); + } + }; + const commandEvent = `command:${this.name()}`; + if (this._actionHandler) { + checkForUnknownOptions(); + this._processArguments(); + let promiseChain; + promiseChain = this._chainOrCallHooks(promiseChain, 'preAction'); + promiseChain = this._chainOrCall(promiseChain, (() => this._actionHandler(this.processedArgs))); + if (this.parent) { + promiseChain = this._chainOrCall(promiseChain, (() => { + this.parent.emit(commandEvent, operands, unknown); + })); + } + promiseChain = this._chainOrCallHooks(promiseChain, 'postAction'); + return promiseChain; + } + if (this.parent && this.parent.listenerCount(commandEvent)) { + checkForUnknownOptions(); + this._processArguments(); + this.parent.emit(commandEvent, operands, unknown); + } else if (operands.length) { + if (this._findCommand('*')) { + return this._dispatchSubcommand('*', operands, unknown); + } + if (this.listenerCount('command:*')) { + this.emit('command:*', operands, unknown); + } else if (this.commands.length) { + this.unknownCommand(); + } else { + checkForUnknownOptions(); + this._processArguments(); + } + } else if (this.commands.length) { + checkForUnknownOptions(); + this.help({ + error: true + }); + } else { + checkForUnknownOptions(); + this._processArguments(); + } + } + _findCommand(name) { + if (!name) return undefined; + return this.commands.find((cmd => cmd._name === name || cmd._aliases.includes(name))); + } + _findOption(arg) { + return this.options.find((option => option.is(arg))); + } + _checkForMissingMandatoryOptions() { + this._getCommandAndAncestors().forEach((cmd => { + cmd.options.forEach((anOption => { + if (anOption.mandatory && cmd.getOptionValue(anOption.attributeName()) === undefined) { + cmd.missingMandatoryOptionValue(anOption); + } + })); + })); + } + _checkForConflictingLocalOptions() { + const definedNonDefaultOptions = this.options.filter((option => { + const optionKey = option.attributeName(); + if (this.getOptionValue(optionKey) === undefined) { + return false; + } + return this.getOptionValueSource(optionKey) !== 'default'; + })); + const optionsWithConflicting = definedNonDefaultOptions.filter((option => option.conflictsWith.length > 0)); + optionsWithConflicting.forEach((option => { + const conflictingAndDefined = definedNonDefaultOptions.find((defined => option.conflictsWith.includes(defined.attributeName()))); + if (conflictingAndDefined) { + this._conflictingOption(option, conflictingAndDefined); + } + })); + } + _checkForConflictingOptions() { + this._getCommandAndAncestors().forEach((cmd => { + cmd._checkForConflictingLocalOptions(); + })); + } + parseOptions(argv) { + const operands = []; + const unknown = []; + let dest = operands; + const args = argv.slice(); + function maybeOption(arg) { + return arg.length > 1 && arg[0] === '-'; + } + let activeVariadicOption = null; + while (args.length) { + const arg = args.shift(); + if (arg === '--') { + if (dest === unknown) dest.push(arg); + dest.push(...args); + break; + } + if (activeVariadicOption && !maybeOption(arg)) { + this.emit(`option:${activeVariadicOption.name()}`, arg); + continue; + } + activeVariadicOption = null; + if (maybeOption(arg)) { + const option = this._findOption(arg); + if (option) { + if (option.required) { + const value = args.shift(); + if (value === undefined) this.optionMissingArgument(option); + this.emit(`option:${option.name()}`, value); + } else if (option.optional) { + let value = null; + if (args.length > 0 && !maybeOption(args[0])) { + value = args.shift(); + } + this.emit(`option:${option.name()}`, value); + } else { + this.emit(`option:${option.name()}`); + } + activeVariadicOption = option.variadic ? option : null; + continue; + } + } + if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') { + const option = this._findOption(`-${arg[1]}`); + if (option) { + if (option.required || option.optional && this._combineFlagAndOptionalValue) { + this.emit(`option:${option.name()}`, arg.slice(2)); + } else { + this.emit(`option:${option.name()}`); + args.unshift(`-${arg.slice(2)}`); + } + continue; + } + } + if (/^--[^=]+=/.test(arg)) { + const index = arg.indexOf('='); + const option = this._findOption(arg.slice(0, index)); + if (option && (option.required || option.optional)) { + this.emit(`option:${option.name()}`, arg.slice(index + 1)); + continue; + } + } + if (maybeOption(arg)) { + dest = unknown; + } + if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) { + if (this._findCommand(arg)) { + operands.push(arg); + if (args.length > 0) unknown.push(...args); + break; + } else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) { + operands.push(arg); + if (args.length > 0) operands.push(...args); + break; + } else if (this._defaultCommandName) { + unknown.push(arg); + if (args.length > 0) unknown.push(...args); + break; + } + } + if (this._passThroughOptions) { + dest.push(arg); + if (args.length > 0) dest.push(...args); + break; + } + dest.push(arg); + } + return { + operands: operands, + unknown: unknown + }; + } + opts() { + if (this._storeOptionsAsProperties) { + const result = {}; + const len = this.options.length; + for (let i = 0; i < len; i++) { + const key = this.options[i].attributeName(); + result[key] = key === this._versionOptionName ? this._version : this[key]; + } + return result; + } + return this._optionValues; + } + optsWithGlobals() { + return this._getCommandAndAncestors().reduce(((combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts())), {}); + } + error(message, errorOptions) { + this._outputConfiguration.outputError(`${message}\n`, this._outputConfiguration.writeErr); + if (typeof this._showHelpAfterError === 'string') { + this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`); + } else if (this._showHelpAfterError) { + this._outputConfiguration.writeErr('\n'); + this.outputHelp({ + error: true + }); + } + const config = errorOptions || {}; + const exitCode = config.exitCode || 1; + const code = config.code || 'commander.error'; + this._exit(exitCode, code, message); + } + _parseOptionsEnv() { + this.options.forEach((option => { + if (option.envVar && option.envVar in process$1.env) { + const optionKey = option.attributeName(); + if (this.getOptionValue(optionKey) === undefined || [ 'default', 'config', 'env' ].includes(this.getOptionValueSource(optionKey))) { + if (option.required || option.optional) { + this.emit(`optionEnv:${option.name()}`, process$1.env[option.envVar]); + } else { + this.emit(`optionEnv:${option.name()}`); + } + } + } + })); + } + _parseOptionsImplied() { + const dualHelper = new DualOptions(this.options); + const hasCustomOptionValue = optionKey => this.getOptionValue(optionKey) !== undefined && ![ 'default', 'implied' ].includes(this.getOptionValueSource(optionKey)); + this.options.filter((option => option.implied !== undefined && hasCustomOptionValue(option.attributeName()) && dualHelper.valueFromOption(this.getOptionValue(option.attributeName()), option))).forEach((option => { + Object.keys(option.implied).filter((impliedKey => !hasCustomOptionValue(impliedKey))).forEach((impliedKey => { + this.setOptionValueWithSource(impliedKey, option.implied[impliedKey], 'implied'); + })); + })); + } + missingArgument(name) { + const message = `error: missing required argument '${name}'`; + this.error(message, { + code: 'commander.missingArgument' + }); + } + optionMissingArgument(option) { + const message = `error: option '${option.flags}' argument missing`; + this.error(message, { + code: 'commander.optionMissingArgument' + }); + } + missingMandatoryOptionValue(option) { + const message = `error: required option '${option.flags}' not specified`; + this.error(message, { + code: 'commander.missingMandatoryOptionValue' + }); + } + _conflictingOption(option, conflictingOption) { + const findBestOptionFromValue = option => { + const optionKey = option.attributeName(); + const optionValue = this.getOptionValue(optionKey); + const negativeOption = this.options.find((target => target.negate && optionKey === target.attributeName())); + const positiveOption = this.options.find((target => !target.negate && optionKey === target.attributeName())); + if (negativeOption && (negativeOption.presetArg === undefined && optionValue === false || negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)) { + return negativeOption; + } + return positiveOption || option; + }; + const getErrorMessage = option => { + const bestOption = findBestOptionFromValue(option); + const optionKey = bestOption.attributeName(); + const source = this.getOptionValueSource(optionKey); + if (source === 'env') { + return `environment variable '${bestOption.envVar}'`; + } + return `option '${bestOption.flags}'`; + }; + const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`; + this.error(message, { + code: 'commander.conflictingOption' + }); + } + unknownOption(flag) { + if (this._allowUnknownOption) return; + let suggestion = ''; + if (flag.startsWith('--') && this._showSuggestionAfterError) { + let candidateFlags = []; + let command = this; + do { + const moreFlags = command.createHelp().visibleOptions(command).filter((option => option.long)).map((option => option.long)); + candidateFlags = candidateFlags.concat(moreFlags); + command = command.parent; + } while (command && !command._enablePositionalOptions); + suggestion = suggestSimilar(flag, candidateFlags); + } + const message = `error: unknown option '${flag}'${suggestion}`; + this.error(message, { + code: 'commander.unknownOption' + }); + } + _excessArguments(receivedArgs) { + if (this._allowExcessArguments) return; + const expected = this.registeredArguments.length; + const s = expected === 1 ? '' : 's'; + const forSubcommand = this.parent ? ` for '${this.name()}'` : ''; + const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`; + this.error(message, { + code: 'commander.excessArguments' + }); + } + unknownCommand() { + const unknownName = this.args[0]; + let suggestion = ''; + if (this._showSuggestionAfterError) { + const candidateNames = []; + this.createHelp().visibleCommands(this).forEach((command => { + candidateNames.push(command.name()); + if (command.alias()) candidateNames.push(command.alias()); + })); + suggestion = suggestSimilar(unknownName, candidateNames); + } + const message = `error: unknown command '${unknownName}'${suggestion}`; + this.error(message, { + code: 'commander.unknownCommand' + }); + } + version(str, flags, description) { + if (str === undefined) return this._version; + this._version = str; + flags = flags || '-V, --version'; + description = description || 'output the version number'; + const versionOption = this.createOption(flags, description); + this._versionOptionName = versionOption.attributeName(); + this._registerOption(versionOption); + this.on('option:' + versionOption.name(), (() => { + this._outputConfiguration.writeOut(`${str}\n`); + this._exit(0, 'commander.version', str); + })); + return this; + } + description(str, argsDescription) { + if (str === undefined && argsDescription === undefined) return this._description; + this._description = str; + if (argsDescription) { + this._argsDescription = argsDescription; + } + return this; + } + summary(str) { + if (str === undefined) return this._summary; + this._summary = str; + return this; + } + alias(alias) { + if (alias === undefined) return this._aliases[0]; + let command = this; + if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) { + command = this.commands[this.commands.length - 1]; + } + if (alias === command._name) throw new Error('Command alias can\'t be the same as its name'); + const matchingCommand = this.parent?._findCommand(alias); + if (matchingCommand) { + const existingCmd = [ matchingCommand.name() ].concat(matchingCommand.aliases()).join('|'); + throw new Error(`cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`); + } + command._aliases.push(alias); + return this; + } + aliases(aliases) { + if (aliases === undefined) return this._aliases; + aliases.forEach((alias => this.alias(alias))); + return this; + } + usage(str) { + if (str === undefined) { + if (this._usage) return this._usage; + const args = this.registeredArguments.map((arg => humanReadableArgName(arg))); + return [].concat(this.options.length || this._helpOption !== null ? '[options]' : [], this.commands.length ? '[command]' : [], this.registeredArguments.length ? args : []).join(' '); + } + this._usage = str; + return this; + } + name(str) { + if (str === undefined) return this._name; + this._name = str; + return this; + } + nameFromFilename(filename) { + this._name = path$d.basename(filename, path$d.extname(filename)); + return this; + } + executableDir(path) { + if (path === undefined) return this._executableDir; + this._executableDir = path; + return this; + } + helpInformation(contextOptions) { + const helper = this.createHelp(); + if (helper.helpWidth === undefined) { + helper.helpWidth = contextOptions && contextOptions.error ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth(); + } + return helper.formatHelp(this, helper); + } + _getHelpContext(contextOptions) { + contextOptions = contextOptions || {}; + const context = { + error: !!contextOptions.error + }; + let write; + if (context.error) { + write = arg => this._outputConfiguration.writeErr(arg); + } else { + write = arg => this._outputConfiguration.writeOut(arg); + } + context.write = contextOptions.write || write; + context.command = this; + return context; + } + outputHelp(contextOptions) { + let deprecatedCallback; + if (typeof contextOptions === 'function') { + deprecatedCallback = contextOptions; + contextOptions = undefined; + } + const context = this._getHelpContext(contextOptions); + this._getCommandAndAncestors().reverse().forEach((command => command.emit('beforeAllHelp', context))); + this.emit('beforeHelp', context); + let helpInformation = this.helpInformation(context); + if (deprecatedCallback) { + helpInformation = deprecatedCallback(helpInformation); + if (typeof helpInformation !== 'string' && !Buffer.isBuffer(helpInformation)) { + throw new Error('outputHelp callback must return a string or a Buffer'); + } + } + context.write(helpInformation); + if (this._getHelpOption()?.long) { + this.emit(this._getHelpOption().long); + } + this.emit('afterHelp', context); + this._getCommandAndAncestors().forEach((command => command.emit('afterAllHelp', context))); + } + helpOption(flags, description) { + if (typeof flags === 'boolean') { + if (flags) { + this._helpOption = this._helpOption ?? undefined; + } else { + this._helpOption = null; + } + return this; + } + flags = flags ?? '-h, --help'; + description = description ?? 'display help for command'; + this._helpOption = this.createOption(flags, description); + return this; + } + _getHelpOption() { + if (this._helpOption === undefined) { + this.helpOption(undefined, undefined); + } + return this._helpOption; + } + addHelpOption(option) { + this._helpOption = option; + return this; + } + help(contextOptions) { + this.outputHelp(contextOptions); + let exitCode = process$1.exitCode || 0; + if (exitCode === 0 && contextOptions && typeof contextOptions !== 'function' && contextOptions.error) { + exitCode = 1; + } + this._exit(exitCode, 'commander.help', '(outputHelp)'); + } + addHelpText(position, text) { + const allowedValues = [ 'beforeAll', 'before', 'after', 'afterAll' ]; + if (!allowedValues.includes(position)) { + throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join('\', \'')}'`); + } + const helpEvent = `${position}Help`; + this.on(helpEvent, (context => { + let helpStr; + if (typeof text === 'function') { + helpStr = text({ + error: context.error, + command: context.command + }); + } else { + helpStr = text; + } + if (helpStr) { + context.write(`${helpStr}\n`); + } + })); + return this; + } + _outputHelpIfRequested(args) { + const helpOption = this._getHelpOption(); + const helpRequested = helpOption && args.find((arg => helpOption.is(arg))); + if (helpRequested) { + this.outputHelp(); + this._exit(0, 'commander.helpDisplayed', '(outputHelp)'); + } + } +}; + +function incrementNodeInspectorPort(args) { + return args.map((arg => { + if (!arg.startsWith('--inspect')) { + return arg; + } + let debugOption; + let debugHost = '127.0.0.1'; + let debugPort = '9229'; + let match; + if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) { + debugOption = match[1]; + } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) { + debugOption = match[1]; + if (/^\d+$/.test(match[3])) { + debugPort = match[3]; + } else { + debugHost = match[3]; + } + } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) { + debugOption = match[1]; + debugHost = match[3]; + debugPort = match[4]; + } + if (debugOption && debugPort !== '0') { + return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`; + } + return arg; + })); +} + +command.Command = Command$2; + +const {Argument: Argument$1} = argument; + +const {Command: Command$1} = command; + +const {CommanderError: CommanderError$1, InvalidArgumentError: InvalidArgumentError$1} = error$2; + +const {Help: Help$1} = help; + +const {Option: Option$1} = option; + +commander.program = new Command$1; + +commander.createCommand = name => new Command$1(name); + +commander.createOption = (flags, description) => new Option$1(flags, description); + +commander.createArgument = (name, description) => new Argument$1(name, description); + +commander.Command = Command$1; + +commander.Option = Option$1; + +commander.Argument = Argument$1; + +commander.Help = Help$1; + +commander.CommanderError = CommanderError$1; + +commander.InvalidArgumentError = InvalidArgumentError$1; + +commander.InvalidOptionArgumentError = InvalidArgumentError$1; + +const {program: program$1, createCommand: createCommand, createArgument: createArgument, createOption: createOption, CommanderError: CommanderError, InvalidArgumentError: InvalidArgumentError, InvalidOptionArgumentError: InvalidOptionArgumentError, Command: Command, Argument: Argument, Option: Option, Help: Help} = commander; + +var main$3 = {}; + +var is$2 = {}; + +Object.defineProperty(is$2, '__esModule', { + value: true +}); + +is$2.thenable = is$2.typedArray = is$2.stringArray = is$2.array = is$2.func = is$2.error = is$2.number = is$2.string = is$2.boolean = void 0; + +function boolean$1(value) { + return value === true || value === false; +} + +is$2.boolean = boolean$1; + +function string$1(value) { + return typeof value === 'string' || value instanceof String; +} + +is$2.string = string$1; + +function number$1(value) { + return typeof value === 'number' || value instanceof Number; +} + +is$2.number = number$1; + +function error$1(value) { + return value instanceof Error; +} + +is$2.error = error$1; + +function func$1(value) { + return typeof value === 'function'; +} + +is$2.func = func$1; + +function array$1(value) { + return Array.isArray(value); +} + +is$2.array = array$1; + +function stringArray$1(value) { + return array$1(value) && value.every((elem => string$1(elem))); +} + +is$2.stringArray = stringArray$1; + +function typedArray$1(value, check) { + return Array.isArray(value) && value.every(check); +} + +is$2.typedArray = typedArray$1; + +function thenable(value) { + return value && func$1(value.then); +} + +is$2.thenable = thenable; + +var server = {}; + +var main$2 = {}; + +var main$1 = {}; + +var ril = {}; + +var api$2 = {}; + +var messages$1 = {}; + +var is$1 = {}; + +var hasRequiredIs; + +function requireIs() { + if (hasRequiredIs) return is$1; + hasRequiredIs = 1; + Object.defineProperty(is$1, '__esModule', { + value: true + }); + is$1.stringArray = is$1.array = is$1.func = is$1.error = is$1.number = is$1.string = is$1.boolean = void 0; + function boolean(value) { + return value === true || value === false; + } + is$1.boolean = boolean; + function string(value) { + return typeof value === 'string' || value instanceof String; + } + is$1.string = string; + function number(value) { + return typeof value === 'number' || value instanceof Number; + } + is$1.number = number; + function error(value) { + return value instanceof Error; + } + is$1.error = error; + function func(value) { + return typeof value === 'function'; + } + is$1.func = func; + function array(value) { + return Array.isArray(value); + } + is$1.array = array; + function stringArray(value) { + return array(value) && value.every((elem => string(elem))); + } + is$1.stringArray = stringArray; + return is$1; +} + +var hasRequiredMessages; + +function requireMessages() { + if (hasRequiredMessages) return messages$1; + hasRequiredMessages = 1; + Object.defineProperty(messages$1, '__esModule', { + value: true + }); + messages$1.Message = messages$1.NotificationType9 = messages$1.NotificationType8 = messages$1.NotificationType7 = messages$1.NotificationType6 = messages$1.NotificationType5 = messages$1.NotificationType4 = messages$1.NotificationType3 = messages$1.NotificationType2 = messages$1.NotificationType1 = messages$1.NotificationType0 = messages$1.NotificationType = messages$1.RequestType9 = messages$1.RequestType8 = messages$1.RequestType7 = messages$1.RequestType6 = messages$1.RequestType5 = messages$1.RequestType4 = messages$1.RequestType3 = messages$1.RequestType2 = messages$1.RequestType1 = messages$1.RequestType = messages$1.RequestType0 = messages$1.AbstractMessageSignature = messages$1.ParameterStructures = messages$1.ResponseError = messages$1.ErrorCodes = void 0; + const is = requireIs(); + var ErrorCodes; + (function(ErrorCodes) { + ErrorCodes.ParseError = -32700; + ErrorCodes.InvalidRequest = -32600; + ErrorCodes.MethodNotFound = -32601; + ErrorCodes.InvalidParams = -32602; + ErrorCodes.InternalError = -32603; + ErrorCodes.jsonrpcReservedErrorRangeStart = -32099; + ErrorCodes.serverErrorStart = -32099; + ErrorCodes.MessageWriteError = -32099; + ErrorCodes.MessageReadError = -32098; + ErrorCodes.PendingResponseRejected = -32097; + ErrorCodes.ConnectionInactive = -32096; + ErrorCodes.ServerNotInitialized = -32002; + ErrorCodes.UnknownErrorCode = -32001; + ErrorCodes.jsonrpcReservedErrorRangeEnd = -32e3; + ErrorCodes.serverErrorEnd = -32e3; + })(ErrorCodes || (messages$1.ErrorCodes = ErrorCodes = {})); + class ResponseError extends Error { + constructor(code, message, data) { + super(message); + this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode; + this.data = data; + Object.setPrototypeOf(this, ResponseError.prototype); + } + toJson() { + const result = { + code: this.code, + message: this.message + }; + if (this.data !== undefined) { + result.data = this.data; + } + return result; + } + } + messages$1.ResponseError = ResponseError; + class ParameterStructures { + constructor(kind) { + this.kind = kind; + } + static is(value) { + return value === ParameterStructures.auto || value === ParameterStructures.byName || value === ParameterStructures.byPosition; + } + toString() { + return this.kind; + } + } + messages$1.ParameterStructures = ParameterStructures; + ParameterStructures.auto = new ParameterStructures('auto'); + ParameterStructures.byPosition = new ParameterStructures('byPosition'); + ParameterStructures.byName = new ParameterStructures('byName'); + class AbstractMessageSignature { + constructor(method, numberOfParams) { + this.method = method; + this.numberOfParams = numberOfParams; + } + get parameterStructures() { + return ParameterStructures.auto; + } + } + messages$1.AbstractMessageSignature = AbstractMessageSignature; + class RequestType0 extends AbstractMessageSignature { + constructor(method) { + super(method, 0); + } + } + messages$1.RequestType0 = RequestType0; + class RequestType extends AbstractMessageSignature { + constructor(method, _parameterStructures = ParameterStructures.auto) { + super(method, 1); + this._parameterStructures = _parameterStructures; + } + get parameterStructures() { + return this._parameterStructures; + } + } + messages$1.RequestType = RequestType; + class RequestType1 extends AbstractMessageSignature { + constructor(method, _parameterStructures = ParameterStructures.auto) { + super(method, 1); + this._parameterStructures = _parameterStructures; + } + get parameterStructures() { + return this._parameterStructures; + } + } + messages$1.RequestType1 = RequestType1; + class RequestType2 extends AbstractMessageSignature { + constructor(method) { + super(method, 2); + } + } + messages$1.RequestType2 = RequestType2; + class RequestType3 extends AbstractMessageSignature { + constructor(method) { + super(method, 3); + } + } + messages$1.RequestType3 = RequestType3; + class RequestType4 extends AbstractMessageSignature { + constructor(method) { + super(method, 4); + } + } + messages$1.RequestType4 = RequestType4; + class RequestType5 extends AbstractMessageSignature { + constructor(method) { + super(method, 5); + } + } + messages$1.RequestType5 = RequestType5; + class RequestType6 extends AbstractMessageSignature { + constructor(method) { + super(method, 6); + } + } + messages$1.RequestType6 = RequestType6; + class RequestType7 extends AbstractMessageSignature { + constructor(method) { + super(method, 7); + } + } + messages$1.RequestType7 = RequestType7; + class RequestType8 extends AbstractMessageSignature { + constructor(method) { + super(method, 8); + } + } + messages$1.RequestType8 = RequestType8; + class RequestType9 extends AbstractMessageSignature { + constructor(method) { + super(method, 9); + } + } + messages$1.RequestType9 = RequestType9; + class NotificationType extends AbstractMessageSignature { + constructor(method, _parameterStructures = ParameterStructures.auto) { + super(method, 1); + this._parameterStructures = _parameterStructures; + } + get parameterStructures() { + return this._parameterStructures; + } + } + messages$1.NotificationType = NotificationType; + class NotificationType0 extends AbstractMessageSignature { + constructor(method) { + super(method, 0); + } + } + messages$1.NotificationType0 = NotificationType0; + class NotificationType1 extends AbstractMessageSignature { + constructor(method, _parameterStructures = ParameterStructures.auto) { + super(method, 1); + this._parameterStructures = _parameterStructures; + } + get parameterStructures() { + return this._parameterStructures; + } + } + messages$1.NotificationType1 = NotificationType1; + class NotificationType2 extends AbstractMessageSignature { + constructor(method) { + super(method, 2); + } + } + messages$1.NotificationType2 = NotificationType2; + class NotificationType3 extends AbstractMessageSignature { + constructor(method) { + super(method, 3); + } + } + messages$1.NotificationType3 = NotificationType3; + class NotificationType4 extends AbstractMessageSignature { + constructor(method) { + super(method, 4); + } + } + messages$1.NotificationType4 = NotificationType4; + class NotificationType5 extends AbstractMessageSignature { + constructor(method) { + super(method, 5); + } + } + messages$1.NotificationType5 = NotificationType5; + class NotificationType6 extends AbstractMessageSignature { + constructor(method) { + super(method, 6); + } + } + messages$1.NotificationType6 = NotificationType6; + class NotificationType7 extends AbstractMessageSignature { + constructor(method) { + super(method, 7); + } + } + messages$1.NotificationType7 = NotificationType7; + class NotificationType8 extends AbstractMessageSignature { + constructor(method) { + super(method, 8); + } + } + messages$1.NotificationType8 = NotificationType8; + class NotificationType9 extends AbstractMessageSignature { + constructor(method) { + super(method, 9); + } + } + messages$1.NotificationType9 = NotificationType9; + var Message; + (function(Message) { + function isRequest(message) { + const candidate = message; + return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id)); + } + Message.isRequest = isRequest; + function isNotification(message) { + const candidate = message; + return candidate && is.string(candidate.method) && message.id === void 0; + } + Message.isNotification = isNotification; + function isResponse(message) { + const candidate = message; + return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null); + } + Message.isResponse = isResponse; + })(Message || (messages$1.Message = Message = {})); + return messages$1; +} + +var linkedMap = {}; + +var hasRequiredLinkedMap; + +function requireLinkedMap() { + if (hasRequiredLinkedMap) return linkedMap; + hasRequiredLinkedMap = 1; + var _a; + Object.defineProperty(linkedMap, '__esModule', { + value: true + }); + linkedMap.LRUCache = linkedMap.LinkedMap = linkedMap.Touch = void 0; + var Touch; + (function(Touch) { + Touch.None = 0; + Touch.First = 1; + Touch.AsOld = Touch.First; + Touch.Last = 2; + Touch.AsNew = Touch.Last; + })(Touch || (linkedMap.Touch = Touch = {})); + class LinkedMap { + constructor() { + this[_a] = 'LinkedMap'; + this._map = new Map; + this._head = undefined; + this._tail = undefined; + this._size = 0; + this._state = 0; + } + clear() { + this._map.clear(); + this._head = undefined; + this._tail = undefined; + this._size = 0; + this._state++; + } + isEmpty() { + return !this._head && !this._tail; + } + get size() { + return this._size; + } + get first() { + return this._head?.value; + } + get last() { + return this._tail?.value; + } + has(key) { + return this._map.has(key); + } + get(key, touch = Touch.None) { + const item = this._map.get(key); + if (!item) { + return undefined; + } + if (touch !== Touch.None) { + this.touch(item, touch); + } + return item.value; + } + set(key, value, touch = Touch.None) { + let item = this._map.get(key); + if (item) { + item.value = value; + if (touch !== Touch.None) { + this.touch(item, touch); + } + } else { + item = { + key: key, + value: value, + next: undefined, + previous: undefined + }; + switch (touch) { + case Touch.None: + this.addItemLast(item); + break; + + case Touch.First: + this.addItemFirst(item); + break; + + case Touch.Last: + this.addItemLast(item); + break; + + default: + this.addItemLast(item); + break; + } + this._map.set(key, item); + this._size++; + } + return this; + } + delete(key) { + return !!this.remove(key); + } + remove(key) { + const item = this._map.get(key); + if (!item) { + return undefined; + } + this._map.delete(key); + this.removeItem(item); + this._size--; + return item.value; + } + shift() { + if (!this._head && !this._tail) { + return undefined; + } + if (!this._head || !this._tail) { + throw new Error('Invalid list'); + } + const item = this._head; + this._map.delete(item.key); + this.removeItem(item); + this._size--; + return item.value; + } + forEach(callbackfn, thisArg) { + const state = this._state; + let current = this._head; + while (current) { + if (thisArg) { + callbackfn.bind(thisArg)(current.value, current.key, this); + } else { + callbackfn(current.value, current.key, this); + } + if (this._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + current = current.next; + } + } + keys() { + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]: () => iterator, + next: () => { + if (this._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { + value: current.key, + done: false + }; + current = current.next; + return result; + } else { + return { + value: undefined, + done: true + }; + } + } + }; + return iterator; + } + values() { + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]: () => iterator, + next: () => { + if (this._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { + value: current.value, + done: false + }; + current = current.next; + return result; + } else { + return { + value: undefined, + done: true + }; + } + } + }; + return iterator; + } + entries() { + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]: () => iterator, + next: () => { + if (this._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { + value: [ current.key, current.value ], + done: false + }; + current = current.next; + return result; + } else { + return { + value: undefined, + done: true + }; + } + } + }; + return iterator; + } + [(_a = Symbol.toStringTag, Symbol.iterator)]() { + return this.entries(); + } + trimOld(newSize) { + if (newSize >= this.size) { + return; + } + if (newSize === 0) { + this.clear(); + return; + } + let current = this._head; + let currentSize = this.size; + while (current && currentSize > newSize) { + this._map.delete(current.key); + current = current.next; + currentSize--; + } + this._head = current; + this._size = currentSize; + if (current) { + current.previous = undefined; + } + this._state++; + } + addItemFirst(item) { + if (!this._head && !this._tail) { + this._tail = item; + } else if (!this._head) { + throw new Error('Invalid list'); + } else { + item.next = this._head; + this._head.previous = item; + } + this._head = item; + this._state++; + } + addItemLast(item) { + if (!this._head && !this._tail) { + this._head = item; + } else if (!this._tail) { + throw new Error('Invalid list'); + } else { + item.previous = this._tail; + this._tail.next = item; + } + this._tail = item; + this._state++; + } + removeItem(item) { + if (item === this._head && item === this._tail) { + this._head = undefined; + this._tail = undefined; + } else if (item === this._head) { + if (!item.next) { + throw new Error('Invalid list'); + } + item.next.previous = undefined; + this._head = item.next; + } else if (item === this._tail) { + if (!item.previous) { + throw new Error('Invalid list'); + } + item.previous.next = undefined; + this._tail = item.previous; + } else { + const next = item.next; + const previous = item.previous; + if (!next || !previous) { + throw new Error('Invalid list'); + } + next.previous = previous; + previous.next = next; + } + item.next = undefined; + item.previous = undefined; + this._state++; + } + touch(item, touch) { + if (!this._head || !this._tail) { + throw new Error('Invalid list'); + } + if (touch !== Touch.First && touch !== Touch.Last) { + return; + } + if (touch === Touch.First) { + if (item === this._head) { + return; + } + const next = item.next; + const previous = item.previous; + if (item === this._tail) { + previous.next = undefined; + this._tail = previous; + } else { + next.previous = previous; + previous.next = next; + } + item.previous = undefined; + item.next = this._head; + this._head.previous = item; + this._head = item; + this._state++; + } else if (touch === Touch.Last) { + if (item === this._tail) { + return; + } + const next = item.next; + const previous = item.previous; + if (item === this._head) { + next.previous = undefined; + this._head = next; + } else { + next.previous = previous; + previous.next = next; + } + item.next = undefined; + item.previous = this._tail; + this._tail.next = item; + this._tail = item; + this._state++; + } + } + toJSON() { + const data = []; + this.forEach(((value, key) => { + data.push([ key, value ]); + })); + return data; + } + fromJSON(data) { + this.clear(); + for (const [key, value] of data) { + this.set(key, value); + } + } + } + linkedMap.LinkedMap = LinkedMap; + class LRUCache extends LinkedMap { + constructor(limit, ratio = 1) { + super(); + this._limit = limit; + this._ratio = Math.min(Math.max(0, ratio), 1); + } + get limit() { + return this._limit; + } + set limit(limit) { + this._limit = limit; + this.checkTrim(); + } + get ratio() { + return this._ratio; + } + set ratio(ratio) { + this._ratio = Math.min(Math.max(0, ratio), 1); + this.checkTrim(); + } + get(key, touch = Touch.AsNew) { + return super.get(key, touch); + } + peek(key) { + return super.get(key, Touch.None); + } + set(key, value) { + super.set(key, value, Touch.Last); + this.checkTrim(); + return this; + } + checkTrim() { + if (this.size > this._limit) { + this.trimOld(Math.round(this._limit * this._ratio)); + } + } + } + linkedMap.LRUCache = LRUCache; + return linkedMap; +} + +var disposable = {}; + +var hasRequiredDisposable; + +function requireDisposable() { + if (hasRequiredDisposable) return disposable; + hasRequiredDisposable = 1; + Object.defineProperty(disposable, '__esModule', { + value: true + }); + disposable.Disposable = void 0; + var Disposable; + (function(Disposable) { + function create(func) { + return { + dispose: func + }; + } + Disposable.create = create; + })(Disposable || (disposable.Disposable = Disposable = {})); + return disposable; +} + +var events = {}; + +var ral = {}; + +var hasRequiredRal; + +function requireRal() { + if (hasRequiredRal) return ral; + hasRequiredRal = 1; + Object.defineProperty(ral, '__esModule', { + value: true + }); + let _ral; + function RAL() { + if (_ral === undefined) { + throw new Error(`No runtime abstraction layer installed`); + } + return _ral; + } + (function(RAL) { + function install(ral) { + if (ral === undefined) { + throw new Error(`No runtime abstraction layer provided`); + } + _ral = ral; + } + RAL.install = install; + })(RAL || (RAL = {})); + ral.default = RAL; + return ral; +} + +var hasRequiredEvents; + +function requireEvents() { + if (hasRequiredEvents) return events; + hasRequiredEvents = 1; + Object.defineProperty(events, '__esModule', { + value: true + }); + events.Emitter = events.Event = void 0; + const ral_1 = requireRal(); + var Event; + (function(Event) { + const _disposable = { + dispose() {} + }; + Event.None = function() { + return _disposable; + }; + })(Event || (events.Event = Event = {})); + class CallbackList { + add(callback, context = null, bucket) { + if (!this._callbacks) { + this._callbacks = []; + this._contexts = []; + } + this._callbacks.push(callback); + this._contexts.push(context); + if (Array.isArray(bucket)) { + bucket.push({ + dispose: () => this.remove(callback, context) + }); + } + } + remove(callback, context = null) { + if (!this._callbacks) { + return; + } + let foundCallbackWithDifferentContext = false; + for (let i = 0, len = this._callbacks.length; i < len; i++) { + if (this._callbacks[i] === callback) { + if (this._contexts[i] === context) { + this._callbacks.splice(i, 1); + this._contexts.splice(i, 1); + return; + } else { + foundCallbackWithDifferentContext = true; + } + } + } + if (foundCallbackWithDifferentContext) { + throw new Error('When adding a listener with a context, you should remove it with the same context'); + } + } + invoke(...args) { + if (!this._callbacks) { + return []; + } + const ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0); + for (let i = 0, len = callbacks.length; i < len; i++) { + try { + ret.push(callbacks[i].apply(contexts[i], args)); + } catch (e) { + (0, ral_1.default)().console.error(e); + } + } + return ret; + } + isEmpty() { + return !this._callbacks || this._callbacks.length === 0; + } + dispose() { + this._callbacks = undefined; + this._contexts = undefined; + } + } + class Emitter { + constructor(_options) { + this._options = _options; + } + get event() { + if (!this._event) { + this._event = (listener, thisArgs, disposables) => { + if (!this._callbacks) { + this._callbacks = new CallbackList; + } + if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) { + this._options.onFirstListenerAdd(this); + } + this._callbacks.add(listener, thisArgs); + const result = { + dispose: () => { + if (!this._callbacks) { + return; + } + this._callbacks.remove(listener, thisArgs); + result.dispose = Emitter._noop; + if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) { + this._options.onLastListenerRemove(this); + } + } + }; + if (Array.isArray(disposables)) { + disposables.push(result); + } + return result; + }; + } + return this._event; + } + fire(event) { + if (this._callbacks) { + this._callbacks.invoke.call(this._callbacks, event); + } + } + dispose() { + if (this._callbacks) { + this._callbacks.dispose(); + this._callbacks = undefined; + } + } + } + events.Emitter = Emitter; + Emitter._noop = function() {}; + return events; +} + +var cancellation = {}; + +var hasRequiredCancellation; + +function requireCancellation() { + if (hasRequiredCancellation) return cancellation; + hasRequiredCancellation = 1; + Object.defineProperty(cancellation, '__esModule', { + value: true + }); + cancellation.CancellationTokenSource = cancellation.CancellationToken = void 0; + const ral_1 = requireRal(); + const Is = requireIs(); + const events_1 = requireEvents(); + var CancellationToken; + (function(CancellationToken) { + CancellationToken.None = Object.freeze({ + isCancellationRequested: false, + onCancellationRequested: events_1.Event.None + }); + CancellationToken.Cancelled = Object.freeze({ + isCancellationRequested: true, + onCancellationRequested: events_1.Event.None + }); + function is(value) { + const candidate = value; + return candidate && (candidate === CancellationToken.None || candidate === CancellationToken.Cancelled || Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested); + } + CancellationToken.is = is; + })(CancellationToken || (cancellation.CancellationToken = CancellationToken = {})); + const shortcutEvent = Object.freeze((function(callback, context) { + const handle = (0, ral_1.default)().timer.setTimeout(callback.bind(context), 0); + return { + dispose() { + handle.dispose(); + } + }; + })); + class MutableToken { + constructor() { + this._isCancelled = false; + } + cancel() { + if (!this._isCancelled) { + this._isCancelled = true; + if (this._emitter) { + this._emitter.fire(undefined); + this.dispose(); + } + } + } + get isCancellationRequested() { + return this._isCancelled; + } + get onCancellationRequested() { + if (this._isCancelled) { + return shortcutEvent; + } + if (!this._emitter) { + this._emitter = new events_1.Emitter; + } + return this._emitter.event; + } + dispose() { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = undefined; + } + } + } + class CancellationTokenSource { + get token() { + if (!this._token) { + this._token = new MutableToken; + } + return this._token; + } + cancel() { + if (!this._token) { + this._token = CancellationToken.Cancelled; + } else { + this._token.cancel(); + } + } + dispose() { + if (!this._token) { + this._token = CancellationToken.None; + } else if (this._token instanceof MutableToken) { + this._token.dispose(); + } + } + } + cancellation.CancellationTokenSource = CancellationTokenSource; + return cancellation; +} + +var sharedArrayCancellation = {}; + +var hasRequiredSharedArrayCancellation; + +function requireSharedArrayCancellation() { + if (hasRequiredSharedArrayCancellation) return sharedArrayCancellation; + hasRequiredSharedArrayCancellation = 1; + Object.defineProperty(sharedArrayCancellation, '__esModule', { + value: true + }); + sharedArrayCancellation.SharedArrayReceiverStrategy = sharedArrayCancellation.SharedArraySenderStrategy = void 0; + const cancellation_1 = requireCancellation(); + var CancellationState; + (function(CancellationState) { + CancellationState.Continue = 0; + CancellationState.Cancelled = 1; + })(CancellationState || (CancellationState = {})); + class SharedArraySenderStrategy { + constructor() { + this.buffers = new Map; + } + enableCancellation(request) { + if (request.id === null) { + return; + } + const buffer = new SharedArrayBuffer(4); + const data = new Int32Array(buffer, 0, 1); + data[0] = CancellationState.Continue; + this.buffers.set(request.id, buffer); + request.$cancellationData = buffer; + } + async sendCancellation(_conn, id) { + const buffer = this.buffers.get(id); + if (buffer === undefined) { + return; + } + const data = new Int32Array(buffer, 0, 1); + Atomics.store(data, 0, CancellationState.Cancelled); + } + cleanup(id) { + this.buffers.delete(id); + } + dispose() { + this.buffers.clear(); + } + } + sharedArrayCancellation.SharedArraySenderStrategy = SharedArraySenderStrategy; + class SharedArrayBufferCancellationToken { + constructor(buffer) { + this.data = new Int32Array(buffer, 0, 1); + } + get isCancellationRequested() { + return Atomics.load(this.data, 0) === CancellationState.Cancelled; + } + get onCancellationRequested() { + throw new Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`); + } + } + class SharedArrayBufferCancellationTokenSource { + constructor(buffer) { + this.token = new SharedArrayBufferCancellationToken(buffer); + } + cancel() {} + dispose() {} + } + class SharedArrayReceiverStrategy { + constructor() { + this.kind = 'request'; + } + createCancellationTokenSource(request) { + const buffer = request.$cancellationData; + if (buffer === undefined) { + return new cancellation_1.CancellationTokenSource; + } + return new SharedArrayBufferCancellationTokenSource(buffer); + } + } + sharedArrayCancellation.SharedArrayReceiverStrategy = SharedArrayReceiverStrategy; + return sharedArrayCancellation; +} + +var messageReader = {}; + +var semaphore = {}; + +var hasRequiredSemaphore; + +function requireSemaphore() { + if (hasRequiredSemaphore) return semaphore; + hasRequiredSemaphore = 1; + Object.defineProperty(semaphore, '__esModule', { + value: true + }); + semaphore.Semaphore = void 0; + const ral_1 = requireRal(); + class Semaphore { + constructor(capacity = 1) { + if (capacity <= 0) { + throw new Error('Capacity must be greater than 0'); + } + this._capacity = capacity; + this._active = 0; + this._waiting = []; + } + lock(thunk) { + return new Promise(((resolve, reject) => { + this._waiting.push({ + thunk: thunk, + resolve: resolve, + reject: reject + }); + this.runNext(); + })); + } + get active() { + return this._active; + } + runNext() { + if (this._waiting.length === 0 || this._active === this._capacity) { + return; + } + (0, ral_1.default)().timer.setImmediate((() => this.doRunNext())); + } + doRunNext() { + if (this._waiting.length === 0 || this._active === this._capacity) { + return; + } + const next = this._waiting.shift(); + this._active++; + if (this._active > this._capacity) { + throw new Error(`To many thunks active`); + } + try { + const result = next.thunk(); + if (result instanceof Promise) { + result.then((value => { + this._active--; + next.resolve(value); + this.runNext(); + }), (err => { + this._active--; + next.reject(err); + this.runNext(); + })); + } else { + this._active--; + next.resolve(result); + this.runNext(); + } + } catch (err) { + this._active--; + next.reject(err); + this.runNext(); + } + } + } + semaphore.Semaphore = Semaphore; + return semaphore; +} + +var hasRequiredMessageReader; + +function requireMessageReader() { + if (hasRequiredMessageReader) return messageReader; + hasRequiredMessageReader = 1; + Object.defineProperty(messageReader, '__esModule', { + value: true + }); + messageReader.ReadableStreamMessageReader = messageReader.AbstractMessageReader = messageReader.MessageReader = void 0; + const ral_1 = requireRal(); + const Is = requireIs(); + const events_1 = requireEvents(); + const semaphore_1 = requireSemaphore(); + var MessageReader; + (function(MessageReader) { + function is(value) { + let candidate = value; + return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) && Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage); + } + MessageReader.is = is; + })(MessageReader || (messageReader.MessageReader = MessageReader = {})); + class AbstractMessageReader { + constructor() { + this.errorEmitter = new events_1.Emitter; + this.closeEmitter = new events_1.Emitter; + this.partialMessageEmitter = new events_1.Emitter; + } + dispose() { + this.errorEmitter.dispose(); + this.closeEmitter.dispose(); + } + get onError() { + return this.errorEmitter.event; + } + fireError(error) { + this.errorEmitter.fire(this.asError(error)); + } + get onClose() { + return this.closeEmitter.event; + } + fireClose() { + this.closeEmitter.fire(undefined); + } + get onPartialMessage() { + return this.partialMessageEmitter.event; + } + firePartialMessage(info) { + this.partialMessageEmitter.fire(info); + } + asError(error) { + if (error instanceof Error) { + return error; + } else { + return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); + } + } + } + messageReader.AbstractMessageReader = AbstractMessageReader; + var ResolvedMessageReaderOptions; + (function(ResolvedMessageReaderOptions) { + function fromOptions(options) { + let charset; + let contentDecoder; + const contentDecoders = new Map; + let contentTypeDecoder; + const contentTypeDecoders = new Map; + if (options === undefined || typeof options === 'string') { + charset = options ?? 'utf-8'; + } else { + charset = options.charset ?? 'utf-8'; + if (options.contentDecoder !== undefined) { + contentDecoder = options.contentDecoder; + contentDecoders.set(contentDecoder.name, contentDecoder); + } + if (options.contentDecoders !== undefined) { + for (const decoder of options.contentDecoders) { + contentDecoders.set(decoder.name, decoder); + } + } + if (options.contentTypeDecoder !== undefined) { + contentTypeDecoder = options.contentTypeDecoder; + contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder); + } + if (options.contentTypeDecoders !== undefined) { + for (const decoder of options.contentTypeDecoders) { + contentTypeDecoders.set(decoder.name, decoder); + } + } + } + if (contentTypeDecoder === undefined) { + contentTypeDecoder = (0, ral_1.default)().applicationJson.decoder; + contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder); + } + return { + charset: charset, + contentDecoder: contentDecoder, + contentDecoders: contentDecoders, + contentTypeDecoder: contentTypeDecoder, + contentTypeDecoders: contentTypeDecoders + }; + } + ResolvedMessageReaderOptions.fromOptions = fromOptions; + })(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {})); + class ReadableStreamMessageReader extends AbstractMessageReader { + constructor(readable, options) { + super(); + this.readable = readable; + this.options = ResolvedMessageReaderOptions.fromOptions(options); + this.buffer = (0, ral_1.default)().messageBuffer.create(this.options.charset); + this._partialMessageTimeout = 1e4; + this.nextMessageLength = -1; + this.messageToken = 0; + this.readSemaphore = new semaphore_1.Semaphore(1); + } + set partialMessageTimeout(timeout) { + this._partialMessageTimeout = timeout; + } + get partialMessageTimeout() { + return this._partialMessageTimeout; + } + listen(callback) { + this.nextMessageLength = -1; + this.messageToken = 0; + this.partialMessageTimer = undefined; + this.callback = callback; + const result = this.readable.onData((data => { + this.onData(data); + })); + this.readable.onError((error => this.fireError(error))); + this.readable.onClose((() => this.fireClose())); + return result; + } + onData(data) { + try { + this.buffer.append(data); + while (true) { + if (this.nextMessageLength === -1) { + const headers = this.buffer.tryReadHeaders(true); + if (!headers) { + return; + } + const contentLength = headers.get('content-length'); + if (!contentLength) { + this.fireError(new Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(headers))}`)); + return; + } + const length = parseInt(contentLength); + if (isNaN(length)) { + this.fireError(new Error(`Content-Length value must be a number. Got ${contentLength}`)); + return; + } + this.nextMessageLength = length; + } + const body = this.buffer.tryReadBody(this.nextMessageLength); + if (body === undefined) { + this.setPartialMessageTimer(); + return; + } + this.clearPartialMessageTimer(); + this.nextMessageLength = -1; + this.readSemaphore.lock((async () => { + const bytes = this.options.contentDecoder !== undefined ? await this.options.contentDecoder.decode(body) : body; + const message = await this.options.contentTypeDecoder.decode(bytes, this.options); + this.callback(message); + })).catch((error => { + this.fireError(error); + })); + } + } catch (error) { + this.fireError(error); + } + } + clearPartialMessageTimer() { + if (this.partialMessageTimer) { + this.partialMessageTimer.dispose(); + this.partialMessageTimer = undefined; + } + } + setPartialMessageTimer() { + this.clearPartialMessageTimer(); + if (this._partialMessageTimeout <= 0) { + return; + } + this.partialMessageTimer = (0, ral_1.default)().timer.setTimeout(((token, timeout) => { + this.partialMessageTimer = undefined; + if (token === this.messageToken) { + this.firePartialMessage({ + messageToken: token, + waitingTime: timeout + }); + this.setPartialMessageTimer(); + } + }), this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout); + } + } + messageReader.ReadableStreamMessageReader = ReadableStreamMessageReader; + return messageReader; +} + +var messageWriter = {}; + +var hasRequiredMessageWriter; + +function requireMessageWriter() { + if (hasRequiredMessageWriter) return messageWriter; + hasRequiredMessageWriter = 1; + Object.defineProperty(messageWriter, '__esModule', { + value: true + }); + messageWriter.WriteableStreamMessageWriter = messageWriter.AbstractMessageWriter = messageWriter.MessageWriter = void 0; + const ral_1 = requireRal(); + const Is = requireIs(); + const semaphore_1 = requireSemaphore(); + const events_1 = requireEvents(); + const ContentLength = 'Content-Length: '; + const CRLF = '\r\n'; + var MessageWriter; + (function(MessageWriter) { + function is(value) { + let candidate = value; + return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) && Is.func(candidate.onError) && Is.func(candidate.write); + } + MessageWriter.is = is; + })(MessageWriter || (messageWriter.MessageWriter = MessageWriter = {})); + class AbstractMessageWriter { + constructor() { + this.errorEmitter = new events_1.Emitter; + this.closeEmitter = new events_1.Emitter; + } + dispose() { + this.errorEmitter.dispose(); + this.closeEmitter.dispose(); + } + get onError() { + return this.errorEmitter.event; + } + fireError(error, message, count) { + this.errorEmitter.fire([ this.asError(error), message, count ]); + } + get onClose() { + return this.closeEmitter.event; + } + fireClose() { + this.closeEmitter.fire(undefined); + } + asError(error) { + if (error instanceof Error) { + return error; + } else { + return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); + } + } + } + messageWriter.AbstractMessageWriter = AbstractMessageWriter; + var ResolvedMessageWriterOptions; + (function(ResolvedMessageWriterOptions) { + function fromOptions(options) { + if (options === undefined || typeof options === 'string') { + return { + charset: options ?? 'utf-8', + contentTypeEncoder: (0, ral_1.default)().applicationJson.encoder + }; + } else { + return { + charset: options.charset ?? 'utf-8', + contentEncoder: options.contentEncoder, + contentTypeEncoder: options.contentTypeEncoder ?? (0, ral_1.default)().applicationJson.encoder + }; + } + } + ResolvedMessageWriterOptions.fromOptions = fromOptions; + })(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {})); + class WriteableStreamMessageWriter extends AbstractMessageWriter { + constructor(writable, options) { + super(); + this.writable = writable; + this.options = ResolvedMessageWriterOptions.fromOptions(options); + this.errorCount = 0; + this.writeSemaphore = new semaphore_1.Semaphore(1); + this.writable.onError((error => this.fireError(error))); + this.writable.onClose((() => this.fireClose())); + } + async write(msg) { + return this.writeSemaphore.lock((async () => { + const payload = this.options.contentTypeEncoder.encode(msg, this.options).then((buffer => { + if (this.options.contentEncoder !== undefined) { + return this.options.contentEncoder.encode(buffer); + } else { + return buffer; + } + })); + return payload.then((buffer => { + const headers = []; + headers.push(ContentLength, buffer.byteLength.toString(), CRLF); + headers.push(CRLF); + return this.doWrite(msg, headers, buffer); + }), (error => { + this.fireError(error); + throw error; + })); + })); + } + async doWrite(msg, headers, data) { + try { + await this.writable.write(headers.join(''), 'ascii'); + return this.writable.write(data); + } catch (error) { + this.handleError(error, msg); + return Promise.reject(error); + } + } + handleError(error, msg) { + this.errorCount++; + this.fireError(error, msg, this.errorCount); + } + end() { + this.writable.end(); + } + } + messageWriter.WriteableStreamMessageWriter = WriteableStreamMessageWriter; + return messageWriter; +} + +var messageBuffer = {}; + +var hasRequiredMessageBuffer; + +function requireMessageBuffer() { + if (hasRequiredMessageBuffer) return messageBuffer; + hasRequiredMessageBuffer = 1; + Object.defineProperty(messageBuffer, '__esModule', { + value: true + }); + messageBuffer.AbstractMessageBuffer = void 0; + const CR = 13; + const LF = 10; + const CRLF = '\r\n'; + class AbstractMessageBuffer { + constructor(encoding = 'utf-8') { + this._encoding = encoding; + this._chunks = []; + this._totalLength = 0; + } + get encoding() { + return this._encoding; + } + append(chunk) { + const toAppend = typeof chunk === 'string' ? this.fromString(chunk, this._encoding) : chunk; + this._chunks.push(toAppend); + this._totalLength += toAppend.byteLength; + } + tryReadHeaders(lowerCaseKeys = false) { + if (this._chunks.length === 0) { + return undefined; + } + let state = 0; + let chunkIndex = 0; + let offset = 0; + let chunkBytesRead = 0; + row: while (chunkIndex < this._chunks.length) { + const chunk = this._chunks[chunkIndex]; + offset = 0; + while (offset < chunk.length) { + const value = chunk[offset]; + switch (value) { + case CR: + switch (state) { + case 0: + state = 1; + break; + + case 2: + state = 3; + break; + + default: + state = 0; + } + break; + + case LF: + switch (state) { + case 1: + state = 2; + break; + + case 3: + state = 4; + offset++; + break row; + + default: + state = 0; + } + break; + + default: + state = 0; + } + offset++; + } + chunkBytesRead += chunk.byteLength; + chunkIndex++; + } + if (state !== 4) { + return undefined; + } + const buffer = this._read(chunkBytesRead + offset); + const result = new Map; + const headers = this.toString(buffer, 'ascii').split(CRLF); + if (headers.length < 2) { + return result; + } + for (let i = 0; i < headers.length - 2; i++) { + const header = headers[i]; + const index = header.indexOf(':'); + if (index === -1) { + throw new Error(`Message header must separate key and value using ':'\n${header}`); + } + const key = header.substr(0, index); + const value = header.substr(index + 1).trim(); + result.set(lowerCaseKeys ? key.toLowerCase() : key, value); + } + return result; + } + tryReadBody(length) { + if (this._totalLength < length) { + return undefined; + } + return this._read(length); + } + get numberOfBytes() { + return this._totalLength; + } + _read(byteCount) { + if (byteCount === 0) { + return this.emptyBuffer(); + } + if (byteCount > this._totalLength) { + throw new Error(`Cannot read so many bytes!`); + } + if (this._chunks[0].byteLength === byteCount) { + const chunk = this._chunks[0]; + this._chunks.shift(); + this._totalLength -= byteCount; + return this.asNative(chunk); + } + if (this._chunks[0].byteLength > byteCount) { + const chunk = this._chunks[0]; + const result = this.asNative(chunk, byteCount); + this._chunks[0] = chunk.slice(byteCount); + this._totalLength -= byteCount; + return result; + } + const result = this.allocNative(byteCount); + let resultOffset = 0; + let chunkIndex = 0; + while (byteCount > 0) { + const chunk = this._chunks[chunkIndex]; + if (chunk.byteLength > byteCount) { + const chunkPart = chunk.slice(0, byteCount); + result.set(chunkPart, resultOffset); + resultOffset += byteCount; + this._chunks[chunkIndex] = chunk.slice(byteCount); + this._totalLength -= byteCount; + byteCount -= byteCount; + } else { + result.set(chunk, resultOffset); + resultOffset += chunk.byteLength; + this._chunks.shift(); + this._totalLength -= chunk.byteLength; + byteCount -= chunk.byteLength; + } + } + return result; + } + } + messageBuffer.AbstractMessageBuffer = AbstractMessageBuffer; + return messageBuffer; +} + +var connection$1 = {}; + +var hasRequiredConnection; + +function requireConnection() { + if (hasRequiredConnection) return connection$1; + hasRequiredConnection = 1; + (function(exports) { + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.createMessageConnection = exports.ConnectionOptions = exports.MessageStrategy = exports.CancellationStrategy = exports.CancellationSenderStrategy = exports.CancellationReceiverStrategy = exports.RequestCancellationReceiverStrategy = exports.IdCancellationReceiverStrategy = exports.ConnectionStrategy = exports.ConnectionError = exports.ConnectionErrors = exports.LogTraceNotification = exports.SetTraceNotification = exports.TraceFormat = exports.TraceValues = exports.Trace = exports.NullLogger = exports.ProgressType = exports.ProgressToken = void 0; + const ral_1 = requireRal(); + const Is = requireIs(); + const messages_1 = requireMessages(); + const linkedMap_1 = requireLinkedMap(); + const events_1 = requireEvents(); + const cancellation_1 = requireCancellation(); + var CancelNotification; + (function(CancelNotification) { + CancelNotification.type = new messages_1.NotificationType('$/cancelRequest'); + })(CancelNotification || (CancelNotification = {})); + var ProgressToken; + (function(ProgressToken) { + function is(value) { + return typeof value === 'string' || typeof value === 'number'; + } + ProgressToken.is = is; + })(ProgressToken || (exports.ProgressToken = ProgressToken = {})); + var ProgressNotification; + (function(ProgressNotification) { + ProgressNotification.type = new messages_1.NotificationType('$/progress'); + })(ProgressNotification || (ProgressNotification = {})); + class ProgressType { + constructor() {} + } + exports.ProgressType = ProgressType; + var StarRequestHandler; + (function(StarRequestHandler) { + function is(value) { + return Is.func(value); + } + StarRequestHandler.is = is; + })(StarRequestHandler || (StarRequestHandler = {})); + exports.NullLogger = Object.freeze({ + error: () => {}, + warn: () => {}, + info: () => {}, + log: () => {} + }); + var Trace; + (function(Trace) { + Trace[Trace['Off'] = 0] = 'Off'; + Trace[Trace['Messages'] = 1] = 'Messages'; + Trace[Trace['Compact'] = 2] = 'Compact'; + Trace[Trace['Verbose'] = 3] = 'Verbose'; + })(Trace || (exports.Trace = Trace = {})); + var TraceValues; + (function(TraceValues) { + TraceValues.Off = 'off'; + TraceValues.Messages = 'messages'; + TraceValues.Compact = 'compact'; + TraceValues.Verbose = 'verbose'; + })(TraceValues || (exports.TraceValues = TraceValues = {})); + (function(Trace) { + function fromString(value) { + if (!Is.string(value)) { + return Trace.Off; + } + value = value.toLowerCase(); + switch (value) { + case 'off': + return Trace.Off; + + case 'messages': + return Trace.Messages; + + case 'compact': + return Trace.Compact; + + case 'verbose': + return Trace.Verbose; + + default: + return Trace.Off; + } + } + Trace.fromString = fromString; + function toString(value) { + switch (value) { + case Trace.Off: + return 'off'; + + case Trace.Messages: + return 'messages'; + + case Trace.Compact: + return 'compact'; + + case Trace.Verbose: + return 'verbose'; + + default: + return 'off'; + } + } + Trace.toString = toString; + })(Trace || (exports.Trace = Trace = {})); + var TraceFormat; + (function(TraceFormat) { + TraceFormat['Text'] = 'text'; + TraceFormat['JSON'] = 'json'; + })(TraceFormat || (exports.TraceFormat = TraceFormat = {})); + (function(TraceFormat) { + function fromString(value) { + if (!Is.string(value)) { + return TraceFormat.Text; + } + value = value.toLowerCase(); + if (value === 'json') { + return TraceFormat.JSON; + } else { + return TraceFormat.Text; + } + } + TraceFormat.fromString = fromString; + })(TraceFormat || (exports.TraceFormat = TraceFormat = {})); + var SetTraceNotification; + (function(SetTraceNotification) { + SetTraceNotification.type = new messages_1.NotificationType('$/setTrace'); + })(SetTraceNotification || (exports.SetTraceNotification = SetTraceNotification = {})); + var LogTraceNotification; + (function(LogTraceNotification) { + LogTraceNotification.type = new messages_1.NotificationType('$/logTrace'); + })(LogTraceNotification || (exports.LogTraceNotification = LogTraceNotification = {})); + var ConnectionErrors; + (function(ConnectionErrors) { + ConnectionErrors[ConnectionErrors['Closed'] = 1] = 'Closed'; + ConnectionErrors[ConnectionErrors['Disposed'] = 2] = 'Disposed'; + ConnectionErrors[ConnectionErrors['AlreadyListening'] = 3] = 'AlreadyListening'; + })(ConnectionErrors || (exports.ConnectionErrors = ConnectionErrors = {})); + class ConnectionError extends Error { + constructor(code, message) { + super(message); + this.code = code; + Object.setPrototypeOf(this, ConnectionError.prototype); + } + } + exports.ConnectionError = ConnectionError; + var ConnectionStrategy; + (function(ConnectionStrategy) { + function is(value) { + const candidate = value; + return candidate && Is.func(candidate.cancelUndispatched); + } + ConnectionStrategy.is = is; + })(ConnectionStrategy || (exports.ConnectionStrategy = ConnectionStrategy = {})); + var IdCancellationReceiverStrategy; + (function(IdCancellationReceiverStrategy) { + function is(value) { + const candidate = value; + return candidate && (candidate.kind === undefined || candidate.kind === 'id') && Is.func(candidate.createCancellationTokenSource) && (candidate.dispose === undefined || Is.func(candidate.dispose)); + } + IdCancellationReceiverStrategy.is = is; + })(IdCancellationReceiverStrategy || (exports.IdCancellationReceiverStrategy = IdCancellationReceiverStrategy = {})); + var RequestCancellationReceiverStrategy; + (function(RequestCancellationReceiverStrategy) { + function is(value) { + const candidate = value; + return candidate && candidate.kind === 'request' && Is.func(candidate.createCancellationTokenSource) && (candidate.dispose === undefined || Is.func(candidate.dispose)); + } + RequestCancellationReceiverStrategy.is = is; + })(RequestCancellationReceiverStrategy || (exports.RequestCancellationReceiverStrategy = RequestCancellationReceiverStrategy = {})); + var CancellationReceiverStrategy; + (function(CancellationReceiverStrategy) { + CancellationReceiverStrategy.Message = Object.freeze({ + createCancellationTokenSource(_) { + return new cancellation_1.CancellationTokenSource; + } + }); + function is(value) { + return IdCancellationReceiverStrategy.is(value) || RequestCancellationReceiverStrategy.is(value); + } + CancellationReceiverStrategy.is = is; + })(CancellationReceiverStrategy || (exports.CancellationReceiverStrategy = CancellationReceiverStrategy = {})); + var CancellationSenderStrategy; + (function(CancellationSenderStrategy) { + CancellationSenderStrategy.Message = Object.freeze({ + sendCancellation(conn, id) { + return conn.sendNotification(CancelNotification.type, { + id: id + }); + }, + cleanup(_) {} + }); + function is(value) { + const candidate = value; + return candidate && Is.func(candidate.sendCancellation) && Is.func(candidate.cleanup); + } + CancellationSenderStrategy.is = is; + })(CancellationSenderStrategy || (exports.CancellationSenderStrategy = CancellationSenderStrategy = {})); + var CancellationStrategy; + (function(CancellationStrategy) { + CancellationStrategy.Message = Object.freeze({ + receiver: CancellationReceiverStrategy.Message, + sender: CancellationSenderStrategy.Message + }); + function is(value) { + const candidate = value; + return candidate && CancellationReceiverStrategy.is(candidate.receiver) && CancellationSenderStrategy.is(candidate.sender); + } + CancellationStrategy.is = is; + })(CancellationStrategy || (exports.CancellationStrategy = CancellationStrategy = {})); + var MessageStrategy; + (function(MessageStrategy) { + function is(value) { + const candidate = value; + return candidate && Is.func(candidate.handleMessage); + } + MessageStrategy.is = is; + })(MessageStrategy || (exports.MessageStrategy = MessageStrategy = {})); + var ConnectionOptions; + (function(ConnectionOptions) { + function is(value) { + const candidate = value; + return candidate && (CancellationStrategy.is(candidate.cancellationStrategy) || ConnectionStrategy.is(candidate.connectionStrategy) || MessageStrategy.is(candidate.messageStrategy)); + } + ConnectionOptions.is = is; + })(ConnectionOptions || (exports.ConnectionOptions = ConnectionOptions = {})); + var ConnectionState; + (function(ConnectionState) { + ConnectionState[ConnectionState['New'] = 1] = 'New'; + ConnectionState[ConnectionState['Listening'] = 2] = 'Listening'; + ConnectionState[ConnectionState['Closed'] = 3] = 'Closed'; + ConnectionState[ConnectionState['Disposed'] = 4] = 'Disposed'; + })(ConnectionState || (ConnectionState = {})); + function createMessageConnection(messageReader, messageWriter, _logger, options) { + const logger = _logger !== undefined ? _logger : exports.NullLogger; + let sequenceNumber = 0; + let notificationSequenceNumber = 0; + let unknownResponseSequenceNumber = 0; + const version = '2.0'; + let starRequestHandler = undefined; + const requestHandlers = new Map; + let starNotificationHandler = undefined; + const notificationHandlers = new Map; + const progressHandlers = new Map; + let timer; + let messageQueue = new linkedMap_1.LinkedMap; + let responsePromises = new Map; + let knownCanceledRequests = new Set; + let requestTokens = new Map; + let trace = Trace.Off; + let traceFormat = TraceFormat.Text; + let tracer; + let state = ConnectionState.New; + const errorEmitter = new events_1.Emitter; + const closeEmitter = new events_1.Emitter; + const unhandledNotificationEmitter = new events_1.Emitter; + const unhandledProgressEmitter = new events_1.Emitter; + const disposeEmitter = new events_1.Emitter; + const cancellationStrategy = options && options.cancellationStrategy ? options.cancellationStrategy : CancellationStrategy.Message; + function createRequestQueueKey(id) { + if (id === null) { + throw new Error(`Can't send requests with id null since the response can't be correlated.`); + } + return 'req-' + id.toString(); + } + function createResponseQueueKey(id) { + if (id === null) { + return 'res-unknown-' + (++unknownResponseSequenceNumber).toString(); + } else { + return 'res-' + id.toString(); + } + } + function createNotificationQueueKey() { + return 'not-' + (++notificationSequenceNumber).toString(); + } + function addMessageToQueue(queue, message) { + if (messages_1.Message.isRequest(message)) { + queue.set(createRequestQueueKey(message.id), message); + } else if (messages_1.Message.isResponse(message)) { + queue.set(createResponseQueueKey(message.id), message); + } else { + queue.set(createNotificationQueueKey(), message); + } + } + function cancelUndispatched(_message) { + return undefined; + } + function isListening() { + return state === ConnectionState.Listening; + } + function isClosed() { + return state === ConnectionState.Closed; + } + function isDisposed() { + return state === ConnectionState.Disposed; + } + function closeHandler() { + if (state === ConnectionState.New || state === ConnectionState.Listening) { + state = ConnectionState.Closed; + closeEmitter.fire(undefined); + } + } + function readErrorHandler(error) { + errorEmitter.fire([ error, undefined, undefined ]); + } + function writeErrorHandler(data) { + errorEmitter.fire(data); + } + messageReader.onClose(closeHandler); + messageReader.onError(readErrorHandler); + messageWriter.onClose(closeHandler); + messageWriter.onError(writeErrorHandler); + function triggerMessageQueue() { + if (timer || messageQueue.size === 0) { + return; + } + timer = (0, ral_1.default)().timer.setImmediate((() => { + timer = undefined; + processMessageQueue(); + })); + } + function handleMessage(message) { + if (messages_1.Message.isRequest(message)) { + handleRequest(message); + } else if (messages_1.Message.isNotification(message)) { + handleNotification(message); + } else if (messages_1.Message.isResponse(message)) { + handleResponse(message); + } else { + handleInvalidMessage(message); + } + } + function processMessageQueue() { + if (messageQueue.size === 0) { + return; + } + const message = messageQueue.shift(); + try { + const messageStrategy = options?.messageStrategy; + if (MessageStrategy.is(messageStrategy)) { + messageStrategy.handleMessage(message, handleMessage); + } else { + handleMessage(message); + } + } finally { + triggerMessageQueue(); + } + } + const callback = message => { + try { + if (messages_1.Message.isNotification(message) && message.method === CancelNotification.type.method) { + const cancelId = message.params.id; + const key = createRequestQueueKey(cancelId); + const toCancel = messageQueue.get(key); + if (messages_1.Message.isRequest(toCancel)) { + const strategy = options?.connectionStrategy; + const response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel); + if (response && (response.error !== undefined || response.result !== undefined)) { + messageQueue.delete(key); + requestTokens.delete(cancelId); + response.id = toCancel.id; + traceSendingResponse(response, message.method, Date.now()); + messageWriter.write(response).catch((() => logger.error(`Sending response for canceled message failed.`))); + return; + } + } + const cancellationToken = requestTokens.get(cancelId); + if (cancellationToken !== undefined) { + cancellationToken.cancel(); + traceReceivedNotification(message); + return; + } else { + knownCanceledRequests.add(cancelId); + } + } + addMessageToQueue(messageQueue, message); + } finally { + triggerMessageQueue(); + } + }; + function handleRequest(requestMessage) { + if (isDisposed()) { + return; + } + function reply(resultOrError, method, startTime) { + const message = { + jsonrpc: version, + id: requestMessage.id + }; + if (resultOrError instanceof messages_1.ResponseError) { + message.error = resultOrError.toJson(); + } else { + message.result = resultOrError === undefined ? null : resultOrError; + } + traceSendingResponse(message, method, startTime); + messageWriter.write(message).catch((() => logger.error(`Sending response failed.`))); + } + function replyError(error, method, startTime) { + const message = { + jsonrpc: version, + id: requestMessage.id, + error: error.toJson() + }; + traceSendingResponse(message, method, startTime); + messageWriter.write(message).catch((() => logger.error(`Sending response failed.`))); + } + function replySuccess(result, method, startTime) { + if (result === undefined) { + result = null; + } + const message = { + jsonrpc: version, + id: requestMessage.id, + result: result + }; + traceSendingResponse(message, method, startTime); + messageWriter.write(message).catch((() => logger.error(`Sending response failed.`))); + } + traceReceivedRequest(requestMessage); + const element = requestHandlers.get(requestMessage.method); + let type; + let requestHandler; + if (element) { + type = element.type; + requestHandler = element.handler; + } + const startTime = Date.now(); + if (requestHandler || starRequestHandler) { + const tokenKey = requestMessage.id ?? String(Date.now()); + const cancellationSource = IdCancellationReceiverStrategy.is(cancellationStrategy.receiver) ? cancellationStrategy.receiver.createCancellationTokenSource(tokenKey) : cancellationStrategy.receiver.createCancellationTokenSource(requestMessage); + if (requestMessage.id !== null && knownCanceledRequests.has(requestMessage.id)) { + cancellationSource.cancel(); + } + if (requestMessage.id !== null) { + requestTokens.set(tokenKey, cancellationSource); + } + try { + let handlerResult; + if (requestHandler) { + if (requestMessage.params === undefined) { + if (type !== undefined && type.numberOfParams !== 0) { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines ${type.numberOfParams} params but received none.`), requestMessage.method, startTime); + return; + } + handlerResult = requestHandler(cancellationSource.token); + } else if (Array.isArray(requestMessage.params)) { + if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byName) { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by name but received parameters by position`), requestMessage.method, startTime); + return; + } + handlerResult = requestHandler(...requestMessage.params, cancellationSource.token); + } else { + if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byPosition) { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by position but received parameters by name`), requestMessage.method, startTime); + return; + } + handlerResult = requestHandler(requestMessage.params, cancellationSource.token); + } + } else if (starRequestHandler) { + handlerResult = starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token); + } + const promise = handlerResult; + if (!handlerResult) { + requestTokens.delete(tokenKey); + replySuccess(handlerResult, requestMessage.method, startTime); + } else if (promise.then) { + promise.then((resultOrError => { + requestTokens.delete(tokenKey); + reply(resultOrError, requestMessage.method, startTime); + }), (error => { + requestTokens.delete(tokenKey); + if (error instanceof messages_1.ResponseError) { + replyError(error, requestMessage.method, startTime); + } else if (error && Is.string(error.message)) { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime); + } else { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); + } + })); + } else { + requestTokens.delete(tokenKey); + reply(handlerResult, requestMessage.method, startTime); + } + } catch (error) { + requestTokens.delete(tokenKey); + if (error instanceof messages_1.ResponseError) { + reply(error, requestMessage.method, startTime); + } else if (error && Is.string(error.message)) { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime); + } else { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); + } + } + } else { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime); + } + } + function handleResponse(responseMessage) { + if (isDisposed()) { + return; + } + if (responseMessage.id === null) { + if (responseMessage.error) { + logger.error(`Received response message without id: Error is: \n${JSON.stringify(responseMessage.error, undefined, 4)}`); + } else { + logger.error(`Received response message without id. No further error information provided.`); + } + } else { + const key = responseMessage.id; + const responsePromise = responsePromises.get(key); + traceReceivedResponse(responseMessage, responsePromise); + if (responsePromise !== undefined) { + responsePromises.delete(key); + try { + if (responseMessage.error) { + const error = responseMessage.error; + responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data)); + } else if (responseMessage.result !== undefined) { + responsePromise.resolve(responseMessage.result); + } else { + throw new Error('Should never happen.'); + } + } catch (error) { + if (error.message) { + logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`); + } else { + logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`); + } + } + } + } + } + function handleNotification(message) { + if (isDisposed()) { + return; + } + let type = undefined; + let notificationHandler; + if (message.method === CancelNotification.type.method) { + const cancelId = message.params.id; + knownCanceledRequests.delete(cancelId); + traceReceivedNotification(message); + return; + } else { + const element = notificationHandlers.get(message.method); + if (element) { + notificationHandler = element.handler; + type = element.type; + } + } + if (notificationHandler || starNotificationHandler) { + try { + traceReceivedNotification(message); + if (notificationHandler) { + if (message.params === undefined) { + if (type !== undefined) { + if (type.numberOfParams !== 0 && type.parameterStructures !== messages_1.ParameterStructures.byName) { + logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received none.`); + } + } + notificationHandler(); + } else if (Array.isArray(message.params)) { + const params = message.params; + if (message.method === ProgressNotification.type.method && params.length === 2 && ProgressToken.is(params[0])) { + notificationHandler({ + token: params[0], + value: params[1] + }); + } else { + if (type !== undefined) { + if (type.parameterStructures === messages_1.ParameterStructures.byName) { + logger.error(`Notification ${message.method} defines parameters by name but received parameters by position`); + } + if (type.numberOfParams !== message.params.length) { + logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received ${params.length} arguments`); + } + } + notificationHandler(...params); + } + } else { + if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byPosition) { + logger.error(`Notification ${message.method} defines parameters by position but received parameters by name`); + } + notificationHandler(message.params); + } + } else if (starNotificationHandler) { + starNotificationHandler(message.method, message.params); + } + } catch (error) { + if (error.message) { + logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`); + } else { + logger.error(`Notification handler '${message.method}' failed unexpectedly.`); + } + } + } else { + unhandledNotificationEmitter.fire(message); + } + } + function handleInvalidMessage(message) { + if (!message) { + logger.error('Received empty message.'); + return; + } + logger.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(message, null, 4)}`); + const responseMessage = message; + if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) { + const key = responseMessage.id; + const responseHandler = responsePromises.get(key); + if (responseHandler) { + responseHandler.reject(new Error('The received response has neither a result nor an error property.')); + } + } + } + function stringifyTrace(params) { + if (params === undefined || params === null) { + return undefined; + } + switch (trace) { + case Trace.Verbose: + return JSON.stringify(params, null, 4); + + case Trace.Compact: + return JSON.stringify(params); + + default: + return undefined; + } + } + function traceSendingRequest(message) { + if (trace === Trace.Off || !tracer) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if ((trace === Trace.Verbose || trace === Trace.Compact) && message.params) { + data = `Params: ${stringifyTrace(message.params)}\n\n`; + } + tracer.log(`Sending request '${message.method} - (${message.id})'.`, data); + } else { + logLSPMessage('send-request', message); + } + } + function traceSendingNotification(message) { + if (trace === Trace.Off || !tracer) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if (trace === Trace.Verbose || trace === Trace.Compact) { + if (message.params) { + data = `Params: ${stringifyTrace(message.params)}\n\n`; + } else { + data = 'No parameters provided.\n\n'; + } + } + tracer.log(`Sending notification '${message.method}'.`, data); + } else { + logLSPMessage('send-notification', message); + } + } + function traceSendingResponse(message, method, startTime) { + if (trace === Trace.Off || !tracer) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if (trace === Trace.Verbose || trace === Trace.Compact) { + if (message.error && message.error.data) { + data = `Error data: ${stringifyTrace(message.error.data)}\n\n`; + } else { + if (message.result) { + data = `Result: ${stringifyTrace(message.result)}\n\n`; + } else if (message.error === undefined) { + data = 'No result returned.\n\n'; + } + } + } + tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data); + } else { + logLSPMessage('send-response', message); + } + } + function traceReceivedRequest(message) { + if (trace === Trace.Off || !tracer) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if ((trace === Trace.Verbose || trace === Trace.Compact) && message.params) { + data = `Params: ${stringifyTrace(message.params)}\n\n`; + } + tracer.log(`Received request '${message.method} - (${message.id})'.`, data); + } else { + logLSPMessage('receive-request', message); + } + } + function traceReceivedNotification(message) { + if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if (trace === Trace.Verbose || trace === Trace.Compact) { + if (message.params) { + data = `Params: ${stringifyTrace(message.params)}\n\n`; + } else { + data = 'No parameters provided.\n\n'; + } + } + tracer.log(`Received notification '${message.method}'.`, data); + } else { + logLSPMessage('receive-notification', message); + } + } + function traceReceivedResponse(message, responsePromise) { + if (trace === Trace.Off || !tracer) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if (trace === Trace.Verbose || trace === Trace.Compact) { + if (message.error && message.error.data) { + data = `Error data: ${stringifyTrace(message.error.data)}\n\n`; + } else { + if (message.result) { + data = `Result: ${stringifyTrace(message.result)}\n\n`; + } else if (message.error === undefined) { + data = 'No result returned.\n\n'; + } + } + } + if (responsePromise) { + const error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : ''; + tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data); + } else { + tracer.log(`Received response ${message.id} without active response promise.`, data); + } + } else { + logLSPMessage('receive-response', message); + } + } + function logLSPMessage(type, message) { + if (!tracer || trace === Trace.Off) { + return; + } + const lspMessage = { + isLSPMessage: true, + type: type, + message: message, + timestamp: Date.now() + }; + tracer.log(lspMessage); + } + function throwIfClosedOrDisposed() { + if (isClosed()) { + throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.'); + } + if (isDisposed()) { + throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.'); + } + } + function throwIfListening() { + if (isListening()) { + throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening'); + } + } + function throwIfNotListening() { + if (!isListening()) { + throw new Error('Call listen() first.'); + } + } + function undefinedToNull(param) { + if (param === undefined) { + return null; + } else { + return param; + } + } + function nullToUndefined(param) { + if (param === null) { + return undefined; + } else { + return param; + } + } + function isNamedParam(param) { + return param !== undefined && param !== null && !Array.isArray(param) && typeof param === 'object'; + } + function computeSingleParam(parameterStructures, param) { + switch (parameterStructures) { + case messages_1.ParameterStructures.auto: + if (isNamedParam(param)) { + return nullToUndefined(param); + } else { + return [ undefinedToNull(param) ]; + } + + case messages_1.ParameterStructures.byName: + if (!isNamedParam(param)) { + throw new Error(`Received parameters by name but param is not an object literal.`); + } + return nullToUndefined(param); + + case messages_1.ParameterStructures.byPosition: + return [ undefinedToNull(param) ]; + + default: + throw new Error(`Unknown parameter structure ${parameterStructures.toString()}`); + } + } + function computeMessageParams(type, params) { + let result; + const numberOfParams = type.numberOfParams; + switch (numberOfParams) { + case 0: + result = undefined; + break; + + case 1: + result = computeSingleParam(type.parameterStructures, params[0]); + break; + + default: + result = []; + for (let i = 0; i < params.length && i < numberOfParams; i++) { + result.push(undefinedToNull(params[i])); + } + if (params.length < numberOfParams) { + for (let i = params.length; i < numberOfParams; i++) { + result.push(null); + } + } + break; + } + return result; + } + const connection = { + sendNotification: (type, ...args) => { + throwIfClosedOrDisposed(); + let method; + let messageParams; + if (Is.string(type)) { + method = type; + const first = args[0]; + let paramStart = 0; + let parameterStructures = messages_1.ParameterStructures.auto; + if (messages_1.ParameterStructures.is(first)) { + paramStart = 1; + parameterStructures = first; + } + let paramEnd = args.length; + const numberOfParams = paramEnd - paramStart; + switch (numberOfParams) { + case 0: + messageParams = undefined; + break; + + case 1: + messageParams = computeSingleParam(parameterStructures, args[paramStart]); + break; + + default: + if (parameterStructures === messages_1.ParameterStructures.byName) { + throw new Error(`Received ${numberOfParams} parameters for 'by Name' notification parameter structure.`); + } + messageParams = args.slice(paramStart, paramEnd).map((value => undefinedToNull(value))); + break; + } + } else { + const params = args; + method = type.method; + messageParams = computeMessageParams(type, params); + } + const notificationMessage = { + jsonrpc: version, + method: method, + params: messageParams + }; + traceSendingNotification(notificationMessage); + return messageWriter.write(notificationMessage).catch((error => { + logger.error(`Sending notification failed.`); + throw error; + })); + }, + onNotification: (type, handler) => { + throwIfClosedOrDisposed(); + let method; + if (Is.func(type)) { + starNotificationHandler = type; + } else if (handler) { + if (Is.string(type)) { + method = type; + notificationHandlers.set(type, { + type: undefined, + handler: handler + }); + } else { + method = type.method; + notificationHandlers.set(type.method, { + type: type, + handler: handler + }); + } + } + return { + dispose: () => { + if (method !== undefined) { + notificationHandlers.delete(method); + } else { + starNotificationHandler = undefined; + } + } + }; + }, + onProgress: (_type, token, handler) => { + if (progressHandlers.has(token)) { + throw new Error(`Progress handler for token ${token} already registered`); + } + progressHandlers.set(token, handler); + return { + dispose: () => { + progressHandlers.delete(token); + } + }; + }, + sendProgress: (_type, token, value) => connection.sendNotification(ProgressNotification.type, { + token: token, + value: value + }), + onUnhandledProgress: unhandledProgressEmitter.event, + sendRequest: (type, ...args) => { + throwIfClosedOrDisposed(); + throwIfNotListening(); + let method; + let messageParams; + let token = undefined; + if (Is.string(type)) { + method = type; + const first = args[0]; + const last = args[args.length - 1]; + let paramStart = 0; + let parameterStructures = messages_1.ParameterStructures.auto; + if (messages_1.ParameterStructures.is(first)) { + paramStart = 1; + parameterStructures = first; + } + let paramEnd = args.length; + if (cancellation_1.CancellationToken.is(last)) { + paramEnd = paramEnd - 1; + token = last; + } + const numberOfParams = paramEnd - paramStart; + switch (numberOfParams) { + case 0: + messageParams = undefined; + break; + + case 1: + messageParams = computeSingleParam(parameterStructures, args[paramStart]); + break; + + default: + if (parameterStructures === messages_1.ParameterStructures.byName) { + throw new Error(`Received ${numberOfParams} parameters for 'by Name' request parameter structure.`); + } + messageParams = args.slice(paramStart, paramEnd).map((value => undefinedToNull(value))); + break; + } + } else { + const params = args; + method = type.method; + messageParams = computeMessageParams(type, params); + const numberOfParams = type.numberOfParams; + token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined; + } + const id = sequenceNumber++; + let disposable; + if (token) { + disposable = token.onCancellationRequested((() => { + const p = cancellationStrategy.sender.sendCancellation(connection, id); + if (p === undefined) { + logger.log(`Received no promise from cancellation strategy when cancelling id ${id}`); + return Promise.resolve(); + } else { + return p.catch((() => { + logger.log(`Sending cancellation messages for id ${id} failed`); + })); + } + })); + } + const requestMessage = { + jsonrpc: version, + id: id, + method: method, + params: messageParams + }; + traceSendingRequest(requestMessage); + if (typeof cancellationStrategy.sender.enableCancellation === 'function') { + cancellationStrategy.sender.enableCancellation(requestMessage); + } + return new Promise((async (resolve, reject) => { + const resolveWithCleanup = r => { + resolve(r); + cancellationStrategy.sender.cleanup(id); + disposable?.dispose(); + }; + const rejectWithCleanup = r => { + reject(r); + cancellationStrategy.sender.cleanup(id); + disposable?.dispose(); + }; + const responsePromise = { + method: method, + timerStart: Date.now(), + resolve: resolveWithCleanup, + reject: rejectWithCleanup + }; + try { + await messageWriter.write(requestMessage); + responsePromises.set(id, responsePromise); + } catch (error) { + logger.error(`Sending request failed.`); + responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, error.message ? error.message : 'Unknown reason')); + throw error; + } + })); + }, + onRequest: (type, handler) => { + throwIfClosedOrDisposed(); + let method = null; + if (StarRequestHandler.is(type)) { + method = undefined; + starRequestHandler = type; + } else if (Is.string(type)) { + method = null; + if (handler !== undefined) { + method = type; + requestHandlers.set(type, { + handler: handler, + type: undefined + }); + } + } else { + if (handler !== undefined) { + method = type.method; + requestHandlers.set(type.method, { + type: type, + handler: handler + }); + } + } + return { + dispose: () => { + if (method === null) { + return; + } + if (method !== undefined) { + requestHandlers.delete(method); + } else { + starRequestHandler = undefined; + } + } + }; + }, + hasPendingResponse: () => responsePromises.size > 0, + trace: async (_value, _tracer, sendNotificationOrTraceOptions) => { + let _sendNotification = false; + let _traceFormat = TraceFormat.Text; + if (sendNotificationOrTraceOptions !== undefined) { + if (Is.boolean(sendNotificationOrTraceOptions)) { + _sendNotification = sendNotificationOrTraceOptions; + } else { + _sendNotification = sendNotificationOrTraceOptions.sendNotification || false; + _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text; + } + } + trace = _value; + traceFormat = _traceFormat; + if (trace === Trace.Off) { + tracer = undefined; + } else { + tracer = _tracer; + } + if (_sendNotification && !isClosed() && !isDisposed()) { + await connection.sendNotification(SetTraceNotification.type, { + value: Trace.toString(_value) + }); + } + }, + onError: errorEmitter.event, + onClose: closeEmitter.event, + onUnhandledNotification: unhandledNotificationEmitter.event, + onDispose: disposeEmitter.event, + end: () => { + messageWriter.end(); + }, + dispose: () => { + if (isDisposed()) { + return; + } + state = ConnectionState.Disposed; + disposeEmitter.fire(undefined); + const error = new messages_1.ResponseError(messages_1.ErrorCodes.PendingResponseRejected, 'Pending response rejected since connection got disposed'); + for (const promise of responsePromises.values()) { + promise.reject(error); + } + responsePromises = new Map; + requestTokens = new Map; + knownCanceledRequests = new Set; + messageQueue = new linkedMap_1.LinkedMap; + if (Is.func(messageWriter.dispose)) { + messageWriter.dispose(); + } + if (Is.func(messageReader.dispose)) { + messageReader.dispose(); + } + }, + listen: () => { + throwIfClosedOrDisposed(); + throwIfListening(); + state = ConnectionState.Listening; + messageReader.listen(callback); + }, + inspect: () => { + (0, ral_1.default)().console.log('inspect'); + } + }; + connection.onNotification(LogTraceNotification.type, (params => { + if (trace === Trace.Off || !tracer) { + return; + } + const verbose = trace === Trace.Verbose || trace === Trace.Compact; + tracer.log(params.message, verbose ? params.verbose : undefined); + })); + connection.onNotification(ProgressNotification.type, (params => { + const handler = progressHandlers.get(params.token); + if (handler) { + handler(params.value); + } else { + unhandledProgressEmitter.fire(params); + } + })); + return connection; + } + exports.createMessageConnection = createMessageConnection; + })(connection$1); + return connection$1; +} + +var hasRequiredApi; + +function requireApi() { + if (hasRequiredApi) return api$2; + hasRequiredApi = 1; + (function(exports) { + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.ProgressType = exports.ProgressToken = exports.createMessageConnection = exports.NullLogger = exports.ConnectionOptions = exports.ConnectionStrategy = exports.AbstractMessageBuffer = exports.WriteableStreamMessageWriter = exports.AbstractMessageWriter = exports.MessageWriter = exports.ReadableStreamMessageReader = exports.AbstractMessageReader = exports.MessageReader = exports.SharedArrayReceiverStrategy = exports.SharedArraySenderStrategy = exports.CancellationToken = exports.CancellationTokenSource = exports.Emitter = exports.Event = exports.Disposable = exports.LRUCache = exports.Touch = exports.LinkedMap = exports.ParameterStructures = exports.NotificationType9 = exports.NotificationType8 = exports.NotificationType7 = exports.NotificationType6 = exports.NotificationType5 = exports.NotificationType4 = exports.NotificationType3 = exports.NotificationType2 = exports.NotificationType1 = exports.NotificationType0 = exports.NotificationType = exports.ErrorCodes = exports.ResponseError = exports.RequestType9 = exports.RequestType8 = exports.RequestType7 = exports.RequestType6 = exports.RequestType5 = exports.RequestType4 = exports.RequestType3 = exports.RequestType2 = exports.RequestType1 = exports.RequestType0 = exports.RequestType = exports.Message = exports.RAL = void 0; + exports.MessageStrategy = exports.CancellationStrategy = exports.CancellationSenderStrategy = exports.CancellationReceiverStrategy = exports.ConnectionError = exports.ConnectionErrors = exports.LogTraceNotification = exports.SetTraceNotification = exports.TraceFormat = exports.TraceValues = exports.Trace = void 0; + const messages_1 = requireMessages(); + Object.defineProperty(exports, 'Message', { + enumerable: true, + get: function() { + return messages_1.Message; + } + }); + Object.defineProperty(exports, 'RequestType', { + enumerable: true, + get: function() { + return messages_1.RequestType; + } + }); + Object.defineProperty(exports, 'RequestType0', { + enumerable: true, + get: function() { + return messages_1.RequestType0; + } + }); + Object.defineProperty(exports, 'RequestType1', { + enumerable: true, + get: function() { + return messages_1.RequestType1; + } + }); + Object.defineProperty(exports, 'RequestType2', { + enumerable: true, + get: function() { + return messages_1.RequestType2; + } + }); + Object.defineProperty(exports, 'RequestType3', { + enumerable: true, + get: function() { + return messages_1.RequestType3; + } + }); + Object.defineProperty(exports, 'RequestType4', { + enumerable: true, + get: function() { + return messages_1.RequestType4; + } + }); + Object.defineProperty(exports, 'RequestType5', { + enumerable: true, + get: function() { + return messages_1.RequestType5; + } + }); + Object.defineProperty(exports, 'RequestType6', { + enumerable: true, + get: function() { + return messages_1.RequestType6; + } + }); + Object.defineProperty(exports, 'RequestType7', { + enumerable: true, + get: function() { + return messages_1.RequestType7; + } + }); + Object.defineProperty(exports, 'RequestType8', { + enumerable: true, + get: function() { + return messages_1.RequestType8; + } + }); + Object.defineProperty(exports, 'RequestType9', { + enumerable: true, + get: function() { + return messages_1.RequestType9; + } + }); + Object.defineProperty(exports, 'ResponseError', { + enumerable: true, + get: function() { + return messages_1.ResponseError; + } + }); + Object.defineProperty(exports, 'ErrorCodes', { + enumerable: true, + get: function() { + return messages_1.ErrorCodes; + } + }); + Object.defineProperty(exports, 'NotificationType', { + enumerable: true, + get: function() { + return messages_1.NotificationType; + } + }); + Object.defineProperty(exports, 'NotificationType0', { + enumerable: true, + get: function() { + return messages_1.NotificationType0; + } + }); + Object.defineProperty(exports, 'NotificationType1', { + enumerable: true, + get: function() { + return messages_1.NotificationType1; + } + }); + Object.defineProperty(exports, 'NotificationType2', { + enumerable: true, + get: function() { + return messages_1.NotificationType2; + } + }); + Object.defineProperty(exports, 'NotificationType3', { + enumerable: true, + get: function() { + return messages_1.NotificationType3; + } + }); + Object.defineProperty(exports, 'NotificationType4', { + enumerable: true, + get: function() { + return messages_1.NotificationType4; + } + }); + Object.defineProperty(exports, 'NotificationType5', { + enumerable: true, + get: function() { + return messages_1.NotificationType5; + } + }); + Object.defineProperty(exports, 'NotificationType6', { + enumerable: true, + get: function() { + return messages_1.NotificationType6; + } + }); + Object.defineProperty(exports, 'NotificationType7', { + enumerable: true, + get: function() { + return messages_1.NotificationType7; + } + }); + Object.defineProperty(exports, 'NotificationType8', { + enumerable: true, + get: function() { + return messages_1.NotificationType8; + } + }); + Object.defineProperty(exports, 'NotificationType9', { + enumerable: true, + get: function() { + return messages_1.NotificationType9; + } + }); + Object.defineProperty(exports, 'ParameterStructures', { + enumerable: true, + get: function() { + return messages_1.ParameterStructures; + } + }); + const linkedMap_1 = requireLinkedMap(); + Object.defineProperty(exports, 'LinkedMap', { + enumerable: true, + get: function() { + return linkedMap_1.LinkedMap; + } + }); + Object.defineProperty(exports, 'LRUCache', { + enumerable: true, + get: function() { + return linkedMap_1.LRUCache; + } + }); + Object.defineProperty(exports, 'Touch', { + enumerable: true, + get: function() { + return linkedMap_1.Touch; + } + }); + const disposable_1 = requireDisposable(); + Object.defineProperty(exports, 'Disposable', { + enumerable: true, + get: function() { + return disposable_1.Disposable; + } + }); + const events_1 = requireEvents(); + Object.defineProperty(exports, 'Event', { + enumerable: true, + get: function() { + return events_1.Event; + } + }); + Object.defineProperty(exports, 'Emitter', { + enumerable: true, + get: function() { + return events_1.Emitter; + } + }); + const cancellation_1 = requireCancellation(); + Object.defineProperty(exports, 'CancellationTokenSource', { + enumerable: true, + get: function() { + return cancellation_1.CancellationTokenSource; + } + }); + Object.defineProperty(exports, 'CancellationToken', { + enumerable: true, + get: function() { + return cancellation_1.CancellationToken; + } + }); + const sharedArrayCancellation_1 = requireSharedArrayCancellation(); + Object.defineProperty(exports, 'SharedArraySenderStrategy', { + enumerable: true, + get: function() { + return sharedArrayCancellation_1.SharedArraySenderStrategy; + } + }); + Object.defineProperty(exports, 'SharedArrayReceiverStrategy', { + enumerable: true, + get: function() { + return sharedArrayCancellation_1.SharedArrayReceiverStrategy; + } + }); + const messageReader_1 = requireMessageReader(); + Object.defineProperty(exports, 'MessageReader', { + enumerable: true, + get: function() { + return messageReader_1.MessageReader; + } + }); + Object.defineProperty(exports, 'AbstractMessageReader', { + enumerable: true, + get: function() { + return messageReader_1.AbstractMessageReader; + } + }); + Object.defineProperty(exports, 'ReadableStreamMessageReader', { + enumerable: true, + get: function() { + return messageReader_1.ReadableStreamMessageReader; + } + }); + const messageWriter_1 = requireMessageWriter(); + Object.defineProperty(exports, 'MessageWriter', { + enumerable: true, + get: function() { + return messageWriter_1.MessageWriter; + } + }); + Object.defineProperty(exports, 'AbstractMessageWriter', { + enumerable: true, + get: function() { + return messageWriter_1.AbstractMessageWriter; + } + }); + Object.defineProperty(exports, 'WriteableStreamMessageWriter', { + enumerable: true, + get: function() { + return messageWriter_1.WriteableStreamMessageWriter; + } + }); + const messageBuffer_1 = requireMessageBuffer(); + Object.defineProperty(exports, 'AbstractMessageBuffer', { + enumerable: true, + get: function() { + return messageBuffer_1.AbstractMessageBuffer; + } + }); + const connection_1 = requireConnection(); + Object.defineProperty(exports, 'ConnectionStrategy', { + enumerable: true, + get: function() { + return connection_1.ConnectionStrategy; + } + }); + Object.defineProperty(exports, 'ConnectionOptions', { + enumerable: true, + get: function() { + return connection_1.ConnectionOptions; + } + }); + Object.defineProperty(exports, 'NullLogger', { + enumerable: true, + get: function() { + return connection_1.NullLogger; + } + }); + Object.defineProperty(exports, 'createMessageConnection', { + enumerable: true, + get: function() { + return connection_1.createMessageConnection; + } + }); + Object.defineProperty(exports, 'ProgressToken', { + enumerable: true, + get: function() { + return connection_1.ProgressToken; + } + }); + Object.defineProperty(exports, 'ProgressType', { + enumerable: true, + get: function() { + return connection_1.ProgressType; + } + }); + Object.defineProperty(exports, 'Trace', { + enumerable: true, + get: function() { + return connection_1.Trace; + } + }); + Object.defineProperty(exports, 'TraceValues', { + enumerable: true, + get: function() { + return connection_1.TraceValues; + } + }); + Object.defineProperty(exports, 'TraceFormat', { + enumerable: true, + get: function() { + return connection_1.TraceFormat; + } + }); + Object.defineProperty(exports, 'SetTraceNotification', { + enumerable: true, + get: function() { + return connection_1.SetTraceNotification; + } + }); + Object.defineProperty(exports, 'LogTraceNotification', { + enumerable: true, + get: function() { + return connection_1.LogTraceNotification; + } + }); + Object.defineProperty(exports, 'ConnectionErrors', { + enumerable: true, + get: function() { + return connection_1.ConnectionErrors; + } + }); + Object.defineProperty(exports, 'ConnectionError', { + enumerable: true, + get: function() { + return connection_1.ConnectionError; + } + }); + Object.defineProperty(exports, 'CancellationReceiverStrategy', { + enumerable: true, + get: function() { + return connection_1.CancellationReceiverStrategy; + } + }); + Object.defineProperty(exports, 'CancellationSenderStrategy', { + enumerable: true, + get: function() { + return connection_1.CancellationSenderStrategy; + } + }); + Object.defineProperty(exports, 'CancellationStrategy', { + enumerable: true, + get: function() { + return connection_1.CancellationStrategy; + } + }); + Object.defineProperty(exports, 'MessageStrategy', { + enumerable: true, + get: function() { + return connection_1.MessageStrategy; + } + }); + const ral_1 = requireRal(); + exports.RAL = ral_1.default; + })(api$2); + return api$2; +} + +Object.defineProperty(ril, '__esModule', { + value: true +}); + +const util_1 = require$$0$2; + +const api_1 = requireApi(); + +class MessageBuffer extends api_1.AbstractMessageBuffer { + constructor(encoding = 'utf-8') { + super(encoding); + } + emptyBuffer() { + return MessageBuffer.emptyBuffer; + } + fromString(value, encoding) { + return Buffer.from(value, encoding); + } + toString(value, encoding) { + if (value instanceof Buffer) { + return value.toString(encoding); + } else { + return new util_1.TextDecoder(encoding).decode(value); + } + } + asNative(buffer, length) { + if (length === undefined) { + return buffer instanceof Buffer ? buffer : Buffer.from(buffer); + } else { + return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer, 0, length); + } + } + allocNative(length) { + return Buffer.allocUnsafe(length); + } +} + +MessageBuffer.emptyBuffer = Buffer.allocUnsafe(0); + +class ReadableStreamWrapper { + constructor(stream) { + this.stream = stream; + } + onClose(listener) { + this.stream.on('close', listener); + return api_1.Disposable.create((() => this.stream.off('close', listener))); + } + onError(listener) { + this.stream.on('error', listener); + return api_1.Disposable.create((() => this.stream.off('error', listener))); + } + onEnd(listener) { + this.stream.on('end', listener); + return api_1.Disposable.create((() => this.stream.off('end', listener))); + } + onData(listener) { + this.stream.on('data', listener); + return api_1.Disposable.create((() => this.stream.off('data', listener))); + } +} + +class WritableStreamWrapper { + constructor(stream) { + this.stream = stream; + } + onClose(listener) { + this.stream.on('close', listener); + return api_1.Disposable.create((() => this.stream.off('close', listener))); + } + onError(listener) { + this.stream.on('error', listener); + return api_1.Disposable.create((() => this.stream.off('error', listener))); + } + onEnd(listener) { + this.stream.on('end', listener); + return api_1.Disposable.create((() => this.stream.off('end', listener))); + } + write(data, encoding) { + return new Promise(((resolve, reject) => { + const callback = error => { + if (error === undefined || error === null) { + resolve(); + } else { + reject(error); + } + }; + if (typeof data === 'string') { + this.stream.write(data, encoding, callback); + } else { + this.stream.write(data, callback); + } + })); + } + end() { + this.stream.end(); + } +} + +const _ril = Object.freeze({ + messageBuffer: Object.freeze({ + create: encoding => new MessageBuffer(encoding) + }), + applicationJson: Object.freeze({ + encoder: Object.freeze({ + name: 'application/json', + encode: (msg, options) => { + try { + return Promise.resolve(Buffer.from(JSON.stringify(msg, undefined, 0), options.charset)); + } catch (err) { + return Promise.reject(err); + } + } + }), + decoder: Object.freeze({ + name: 'application/json', + decode: (buffer, options) => { + try { + if (buffer instanceof Buffer) { + return Promise.resolve(JSON.parse(buffer.toString(options.charset))); + } else { + return Promise.resolve(JSON.parse(new util_1.TextDecoder(options.charset).decode(buffer))); + } + } catch (err) { + return Promise.reject(err); + } + } + }) + }), + stream: Object.freeze({ + asReadableStream: stream => new ReadableStreamWrapper(stream), + asWritableStream: stream => new WritableStreamWrapper(stream) + }), + console: console, + timer: Object.freeze({ + setTimeout(callback, ms, ...args) { + const handle = setTimeout(callback, ms, ...args); + return { + dispose: () => clearTimeout(handle) + }; + }, + setImmediate(callback, ...args) { + const handle = setImmediate(callback, ...args); + return { + dispose: () => clearImmediate(handle) + }; + }, + setInterval(callback, ms, ...args) { + const handle = setInterval(callback, ms, ...args); + return { + dispose: () => clearInterval(handle) + }; + } + }) +}); + +function RIL() { + return _ril; +} + +(function(RIL) { + function install() { + api_1.RAL.install(_ril); + } + RIL.install = install; +})(RIL || (RIL = {})); + +ril.default = RIL; + +(function(exports) { + var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function() { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(m, exports) { + for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); + }; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.createMessageConnection = exports.createServerSocketTransport = exports.createClientSocketTransport = exports.createServerPipeTransport = exports.createClientPipeTransport = exports.generateRandomPipeName = exports.StreamMessageWriter = exports.StreamMessageReader = exports.SocketMessageWriter = exports.SocketMessageReader = exports.PortMessageWriter = exports.PortMessageReader = exports.IPCMessageWriter = exports.IPCMessageReader = void 0; + const ril_1 = ril; + ril_1.default.install(); + const path = require$$1$1; + const os = require$$2; + const crypto_1 = crypto; + const net_1 = require$$4$1; + const api_1 = requireApi(); + __exportStar(requireApi(), exports); + class IPCMessageReader extends api_1.AbstractMessageReader { + constructor(process) { + super(); + this.process = process; + let eventEmitter = this.process; + eventEmitter.on('error', (error => this.fireError(error))); + eventEmitter.on('close', (() => this.fireClose())); + } + listen(callback) { + this.process.on('message', callback); + return api_1.Disposable.create((() => this.process.off('message', callback))); + } + } + exports.IPCMessageReader = IPCMessageReader; + class IPCMessageWriter extends api_1.AbstractMessageWriter { + constructor(process) { + super(); + this.process = process; + this.errorCount = 0; + const eventEmitter = this.process; + eventEmitter.on('error', (error => this.fireError(error))); + eventEmitter.on('close', (() => this.fireClose)); + } + write(msg) { + try { + if (typeof this.process.send === 'function') { + this.process.send(msg, undefined, undefined, (error => { + if (error) { + this.errorCount++; + this.handleError(error, msg); + } else { + this.errorCount = 0; + } + })); + } + return Promise.resolve(); + } catch (error) { + this.handleError(error, msg); + return Promise.reject(error); + } + } + handleError(error, msg) { + this.errorCount++; + this.fireError(error, msg, this.errorCount); + } + end() {} + } + exports.IPCMessageWriter = IPCMessageWriter; + class PortMessageReader extends api_1.AbstractMessageReader { + constructor(port) { + super(); + this.onData = new api_1.Emitter; + port.on('close', (() => this.fireClose)); + port.on('error', (error => this.fireError(error))); + port.on('message', (message => { + this.onData.fire(message); + })); + } + listen(callback) { + return this.onData.event(callback); + } + } + exports.PortMessageReader = PortMessageReader; + class PortMessageWriter extends api_1.AbstractMessageWriter { + constructor(port) { + super(); + this.port = port; + this.errorCount = 0; + port.on('close', (() => this.fireClose())); + port.on('error', (error => this.fireError(error))); + } + write(msg) { + try { + this.port.postMessage(msg); + return Promise.resolve(); + } catch (error) { + this.handleError(error, msg); + return Promise.reject(error); + } + } + handleError(error, msg) { + this.errorCount++; + this.fireError(error, msg, this.errorCount); + } + end() {} + } + exports.PortMessageWriter = PortMessageWriter; + class SocketMessageReader extends api_1.ReadableStreamMessageReader { + constructor(socket, encoding = 'utf-8') { + super((0, ril_1.default)().stream.asReadableStream(socket), encoding); + } + } + exports.SocketMessageReader = SocketMessageReader; + class SocketMessageWriter extends api_1.WriteableStreamMessageWriter { + constructor(socket, options) { + super((0, ril_1.default)().stream.asWritableStream(socket), options); + this.socket = socket; + } + dispose() { + super.dispose(); + this.socket.destroy(); + } + } + exports.SocketMessageWriter = SocketMessageWriter; + class StreamMessageReader extends api_1.ReadableStreamMessageReader { + constructor(readable, encoding) { + super((0, ril_1.default)().stream.asReadableStream(readable), encoding); + } + } + exports.StreamMessageReader = StreamMessageReader; + class StreamMessageWriter extends api_1.WriteableStreamMessageWriter { + constructor(writable, options) { + super((0, ril_1.default)().stream.asWritableStream(writable), options); + } + } + exports.StreamMessageWriter = StreamMessageWriter; + const XDG_RUNTIME_DIR = process.env['XDG_RUNTIME_DIR']; + const safeIpcPathLengths = new Map([ [ 'linux', 107 ], [ 'darwin', 103 ] ]); + function generateRandomPipeName() { + const randomSuffix = (0, crypto_1.randomBytes)(21).toString('hex'); + if (process.platform === 'win32') { + return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`; + } + let result; + if (XDG_RUNTIME_DIR) { + result = path.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`); + } else { + result = path.join(os.tmpdir(), `vscode-${randomSuffix}.sock`); + } + const limit = safeIpcPathLengths.get(process.platform); + if (limit !== undefined && result.length > limit) { + (0, ril_1.default)().console.warn(`WARNING: IPC handle "${result}" is longer than ${limit} characters.`); + } + return result; + } + exports.generateRandomPipeName = generateRandomPipeName; + function createClientPipeTransport(pipeName, encoding = 'utf-8') { + let connectResolve; + const connected = new Promise(((resolve, _reject) => { + connectResolve = resolve; + })); + return new Promise(((resolve, reject) => { + let server = (0, net_1.createServer)((socket => { + server.close(); + connectResolve([ new SocketMessageReader(socket, encoding), new SocketMessageWriter(socket, encoding) ]); + })); + server.on('error', reject); + server.listen(pipeName, (() => { + server.removeListener('error', reject); + resolve({ + onConnected: () => connected + }); + })); + })); + } + exports.createClientPipeTransport = createClientPipeTransport; + function createServerPipeTransport(pipeName, encoding = 'utf-8') { + const socket = (0, net_1.createConnection)(pipeName); + return [ new SocketMessageReader(socket, encoding), new SocketMessageWriter(socket, encoding) ]; + } + exports.createServerPipeTransport = createServerPipeTransport; + function createClientSocketTransport(port, encoding = 'utf-8') { + let connectResolve; + const connected = new Promise(((resolve, _reject) => { + connectResolve = resolve; + })); + return new Promise(((resolve, reject) => { + const server = (0, net_1.createServer)((socket => { + server.close(); + connectResolve([ new SocketMessageReader(socket, encoding), new SocketMessageWriter(socket, encoding) ]); + })); + server.on('error', reject); + server.listen(port, '127.0.0.1', (() => { + server.removeListener('error', reject); + resolve({ + onConnected: () => connected + }); + })); + })); + } + exports.createClientSocketTransport = createClientSocketTransport; + function createServerSocketTransport(port, encoding = 'utf-8') { + const socket = (0, net_1.createConnection)(port, '127.0.0.1'); + return [ new SocketMessageReader(socket, encoding), new SocketMessageWriter(socket, encoding) ]; + } + exports.createServerSocketTransport = createServerSocketTransport; + function isReadableStream(value) { + const candidate = value; + return candidate.read !== undefined && candidate.addListener !== undefined; + } + function isWritableStream(value) { + const candidate = value; + return candidate.write !== undefined && candidate.addListener !== undefined; + } + function createMessageConnection(input, output, logger, options) { + if (!logger) { + logger = api_1.NullLogger; + } + const reader = isReadableStream(input) ? new StreamMessageReader(input) : input; + const writer = isWritableStream(output) ? new StreamMessageWriter(output) : output; + if (api_1.ConnectionStrategy.is(options)) { + options = { + connectionStrategy: options + }; + } + return (0, api_1.createMessageConnection)(reader, writer, logger, options); + } + exports.createMessageConnection = createMessageConnection; +})(main$1); + +var node$2 = main$1; + +var api$1 = {}; + +function commonjsRequire(path) { + throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); +} + +var main = { + exports: {} +}; + +(function(module, exports) { + (function(factory) { + { + var v = factory(commonjsRequire, exports); + if (v !== undefined) module.exports = v; + } + })((function(require, exports) { + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.TextDocument = exports.EOL = exports.WorkspaceFolder = exports.InlineCompletionContext = exports.SelectedCompletionInfo = exports.InlineCompletionTriggerKind = exports.InlineCompletionList = exports.InlineCompletionItem = exports.StringValue = exports.InlayHint = exports.InlayHintLabelPart = exports.InlayHintKind = exports.InlineValueContext = exports.InlineValueEvaluatableExpression = exports.InlineValueVariableLookup = exports.InlineValueText = exports.SemanticTokens = exports.SemanticTokenModifiers = exports.SemanticTokenTypes = exports.SelectionRange = exports.DocumentLink = exports.FormattingOptions = exports.CodeLens = exports.CodeAction = exports.CodeActionContext = exports.CodeActionTriggerKind = exports.CodeActionKind = exports.DocumentSymbol = exports.WorkspaceSymbol = exports.SymbolInformation = exports.SymbolTag = exports.SymbolKind = exports.DocumentHighlight = exports.DocumentHighlightKind = exports.SignatureInformation = exports.ParameterInformation = exports.Hover = exports.MarkedString = exports.CompletionList = exports.CompletionItem = exports.CompletionItemLabelDetails = exports.InsertTextMode = exports.InsertReplaceEdit = exports.CompletionItemTag = exports.InsertTextFormat = exports.CompletionItemKind = exports.MarkupContent = exports.MarkupKind = exports.TextDocumentItem = exports.OptionalVersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier = exports.TextDocumentIdentifier = exports.WorkspaceChange = exports.WorkspaceEdit = exports.DeleteFile = exports.RenameFile = exports.CreateFile = exports.TextDocumentEdit = exports.AnnotatedTextEdit = exports.ChangeAnnotationIdentifier = exports.ChangeAnnotation = exports.TextEdit = exports.Command = exports.Diagnostic = exports.CodeDescription = exports.DiagnosticTag = exports.DiagnosticSeverity = exports.DiagnosticRelatedInformation = exports.FoldingRange = exports.FoldingRangeKind = exports.ColorPresentation = exports.ColorInformation = exports.Color = exports.LocationLink = exports.Location = exports.Range = exports.Position = exports.uinteger = exports.integer = exports.URI = exports.DocumentUri = void 0; + var DocumentUri; + (function(DocumentUri) { + function is(value) { + return typeof value === 'string'; + } + DocumentUri.is = is; + })(DocumentUri || (exports.DocumentUri = DocumentUri = {})); + var URI; + (function(URI) { + function is(value) { + return typeof value === 'string'; + } + URI.is = is; + })(URI || (exports.URI = URI = {})); + var integer; + (function(integer) { + integer.MIN_VALUE = -2147483648; + integer.MAX_VALUE = 2147483647; + function is(value) { + return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE; + } + integer.is = is; + })(integer || (exports.integer = integer = {})); + var uinteger; + (function(uinteger) { + uinteger.MIN_VALUE = 0; + uinteger.MAX_VALUE = 2147483647; + function is(value) { + return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE; + } + uinteger.is = is; + })(uinteger || (exports.uinteger = uinteger = {})); + var Position; + (function(Position) { + function create(line, character) { + if (line === Number.MAX_VALUE) { + line = uinteger.MAX_VALUE; + } + if (character === Number.MAX_VALUE) { + character = uinteger.MAX_VALUE; + } + return { + line: line, + character: character + }; + } + Position.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character); + } + Position.is = is; + })(Position || (exports.Position = Position = {})); + var Range; + (function(Range) { + function create(one, two, three, four) { + if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) { + return { + start: Position.create(one, two), + end: Position.create(three, four) + }; + } else if (Position.is(one) && Position.is(two)) { + return { + start: one, + end: two + }; + } else { + throw new Error('Range#create called with invalid arguments['.concat(one, ', ').concat(two, ', ').concat(three, ', ').concat(four, ']')); + } + } + Range.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); + } + Range.is = is; + })(Range || (exports.Range = Range = {})); + var Location; + (function(Location) { + function create(uri, range) { + return { + uri: uri, + range: range + }; + } + Location.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); + } + Location.is = is; + })(Location || (exports.Location = Location = {})); + var LocationLink; + (function(LocationLink) { + function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { + return { + targetUri: targetUri, + targetRange: targetRange, + targetSelectionRange: targetSelectionRange, + originSelectionRange: originSelectionRange + }; + } + LocationLink.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); + } + LocationLink.is = is; + })(LocationLink || (exports.LocationLink = LocationLink = {})); + var Color; + (function(Color) { + function create(red, green, blue, alpha) { + return { + red: red, + green: green, + blue: blue, + alpha: alpha + }; + } + Color.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1); + } + Color.is = is; + })(Color || (exports.Color = Color = {})); + var ColorInformation; + (function(ColorInformation) { + function create(range, color) { + return { + range: range, + color: color + }; + } + ColorInformation.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color); + } + ColorInformation.is = is; + })(ColorInformation || (exports.ColorInformation = ColorInformation = {})); + var ColorPresentation; + (function(ColorPresentation) { + function create(label, textEdit, additionalTextEdits) { + return { + label: label, + textEdit: textEdit, + additionalTextEdits: additionalTextEdits + }; + } + ColorPresentation.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); + } + ColorPresentation.is = is; + })(ColorPresentation || (exports.ColorPresentation = ColorPresentation = {})); + var FoldingRangeKind; + (function(FoldingRangeKind) { + FoldingRangeKind.Comment = 'comment'; + FoldingRangeKind.Imports = 'imports'; + FoldingRangeKind.Region = 'region'; + })(FoldingRangeKind || (exports.FoldingRangeKind = FoldingRangeKind = {})); + var FoldingRange; + (function(FoldingRange) { + function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) { + var result = { + startLine: startLine, + endLine: endLine + }; + if (Is.defined(startCharacter)) { + result.startCharacter = startCharacter; + } + if (Is.defined(endCharacter)) { + result.endCharacter = endCharacter; + } + if (Is.defined(kind)) { + result.kind = kind; + } + if (Is.defined(collapsedText)) { + result.collapsedText = collapsedText; + } + return result; + } + FoldingRange.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); + } + FoldingRange.is = is; + })(FoldingRange || (exports.FoldingRange = FoldingRange = {})); + var DiagnosticRelatedInformation; + (function(DiagnosticRelatedInformation) { + function create(location, message) { + return { + location: location, + message: message + }; + } + DiagnosticRelatedInformation.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); + } + DiagnosticRelatedInformation.is = is; + })(DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = DiagnosticRelatedInformation = {})); + var DiagnosticSeverity; + (function(DiagnosticSeverity) { + DiagnosticSeverity.Error = 1; + DiagnosticSeverity.Warning = 2; + DiagnosticSeverity.Information = 3; + DiagnosticSeverity.Hint = 4; + })(DiagnosticSeverity || (exports.DiagnosticSeverity = DiagnosticSeverity = {})); + var DiagnosticTag; + (function(DiagnosticTag) { + DiagnosticTag.Unnecessary = 1; + DiagnosticTag.Deprecated = 2; + })(DiagnosticTag || (exports.DiagnosticTag = DiagnosticTag = {})); + var CodeDescription; + (function(CodeDescription) { + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.href); + } + CodeDescription.is = is; + })(CodeDescription || (exports.CodeDescription = CodeDescription = {})); + var Diagnostic; + (function(Diagnostic) { + function create(range, message, severity, code, source, relatedInformation) { + var result = { + range: range, + message: message + }; + if (Is.defined(severity)) { + result.severity = severity; + } + if (Is.defined(code)) { + result.code = code; + } + if (Is.defined(source)) { + result.source = source; + } + if (Is.defined(relatedInformation)) { + result.relatedInformation = relatedInformation; + } + return result; + } + Diagnostic.create = create; + function is(value) { + var _a; + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); + } + Diagnostic.is = is; + })(Diagnostic || (exports.Diagnostic = Diagnostic = {})); + var Command; + (function(Command) { + function create(title, command) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var result = { + title: title, + command: command + }; + if (Is.defined(args) && args.length > 0) { + result.arguments = args; + } + return result; + } + Command.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); + } + Command.is = is; + })(Command || (exports.Command = Command = {})); + var TextEdit; + (function(TextEdit) { + function replace(range, newText) { + return { + range: range, + newText: newText + }; + } + TextEdit.replace = replace; + function insert(position, newText) { + return { + range: { + start: position, + end: position + }, + newText: newText + }; + } + TextEdit.insert = insert; + function del(range) { + return { + range: range, + newText: '' + }; + } + TextEdit.del = del; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range); + } + TextEdit.is = is; + })(TextEdit || (exports.TextEdit = TextEdit = {})); + var ChangeAnnotation; + (function(ChangeAnnotation) { + function create(label, needsConfirmation, description) { + var result = { + label: label + }; + if (needsConfirmation !== undefined) { + result.needsConfirmation = needsConfirmation; + } + if (description !== undefined) { + result.description = description; + } + return result; + } + ChangeAnnotation.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) && (Is.string(candidate.description) || candidate.description === undefined); + } + ChangeAnnotation.is = is; + })(ChangeAnnotation || (exports.ChangeAnnotation = ChangeAnnotation = {})); + var ChangeAnnotationIdentifier; + (function(ChangeAnnotationIdentifier) { + function is(value) { + var candidate = value; + return Is.string(candidate); + } + ChangeAnnotationIdentifier.is = is; + })(ChangeAnnotationIdentifier || (exports.ChangeAnnotationIdentifier = ChangeAnnotationIdentifier = {})); + var AnnotatedTextEdit; + (function(AnnotatedTextEdit) { + function replace(range, newText, annotation) { + return { + range: range, + newText: newText, + annotationId: annotation + }; + } + AnnotatedTextEdit.replace = replace; + function insert(position, newText, annotation) { + return { + range: { + start: position, + end: position + }, + newText: newText, + annotationId: annotation + }; + } + AnnotatedTextEdit.insert = insert; + function del(range, annotation) { + return { + range: range, + newText: '', + annotationId: annotation + }; + } + AnnotatedTextEdit.del = del; + function is(value) { + var candidate = value; + return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + AnnotatedTextEdit.is = is; + })(AnnotatedTextEdit || (exports.AnnotatedTextEdit = AnnotatedTextEdit = {})); + var TextDocumentEdit; + (function(TextDocumentEdit) { + function create(textDocument, edits) { + return { + textDocument: textDocument, + edits: edits + }; + } + TextDocumentEdit.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits); + } + TextDocumentEdit.is = is; + })(TextDocumentEdit || (exports.TextDocumentEdit = TextDocumentEdit = {})); + var CreateFile; + (function(CreateFile) { + function create(uri, options, annotation) { + var result = { + kind: 'create', + uri: uri + }; + if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) { + result.options = options; + } + if (annotation !== undefined) { + result.annotationId = annotation; + } + return result; + } + CreateFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined || (candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + CreateFile.is = is; + })(CreateFile || (exports.CreateFile = CreateFile = {})); + var RenameFile; + (function(RenameFile) { + function create(oldUri, newUri, options, annotation) { + var result = { + kind: 'rename', + oldUri: oldUri, + newUri: newUri + }; + if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) { + result.options = options; + } + if (annotation !== undefined) { + result.annotationId = annotation; + } + return result; + } + RenameFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined || (candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + RenameFile.is = is; + })(RenameFile || (exports.RenameFile = RenameFile = {})); + var DeleteFile; + (function(DeleteFile) { + function create(uri, options, annotation) { + var result = { + kind: 'delete', + uri: uri + }; + if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) { + result.options = options; + } + if (annotation !== undefined) { + result.annotationId = annotation; + } + return result; + } + DeleteFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined || (candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId)); + } + DeleteFile.is = is; + })(DeleteFile || (exports.DeleteFile = DeleteFile = {})); + var WorkspaceEdit; + (function(WorkspaceEdit) { + function is(value) { + var candidate = value; + return candidate && (candidate.changes !== undefined || candidate.documentChanges !== undefined) && (candidate.documentChanges === undefined || candidate.documentChanges.every((function(change) { + if (Is.string(change.kind)) { + return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); + } else { + return TextDocumentEdit.is(change); + } + }))); + } + WorkspaceEdit.is = is; + })(WorkspaceEdit || (exports.WorkspaceEdit = WorkspaceEdit = {})); + var TextEditChangeImpl = function() { + function TextEditChangeImpl(edits, changeAnnotations) { + this.edits = edits; + this.changeAnnotations = changeAnnotations; + } + TextEditChangeImpl.prototype.insert = function(position, newText, annotation) { + var edit; + var id; + if (annotation === undefined) { + edit = TextEdit.insert(position, newText); + } else if (ChangeAnnotationIdentifier.is(annotation)) { + id = annotation; + edit = AnnotatedTextEdit.insert(position, newText, annotation); + } else { + this.assertChangeAnnotations(this.changeAnnotations); + id = this.changeAnnotations.manage(annotation); + edit = AnnotatedTextEdit.insert(position, newText, id); + } + this.edits.push(edit); + if (id !== undefined) { + return id; + } + }; + TextEditChangeImpl.prototype.replace = function(range, newText, annotation) { + var edit; + var id; + if (annotation === undefined) { + edit = TextEdit.replace(range, newText); + } else if (ChangeAnnotationIdentifier.is(annotation)) { + id = annotation; + edit = AnnotatedTextEdit.replace(range, newText, annotation); + } else { + this.assertChangeAnnotations(this.changeAnnotations); + id = this.changeAnnotations.manage(annotation); + edit = AnnotatedTextEdit.replace(range, newText, id); + } + this.edits.push(edit); + if (id !== undefined) { + return id; + } + }; + TextEditChangeImpl.prototype.delete = function(range, annotation) { + var edit; + var id; + if (annotation === undefined) { + edit = TextEdit.del(range); + } else if (ChangeAnnotationIdentifier.is(annotation)) { + id = annotation; + edit = AnnotatedTextEdit.del(range, annotation); + } else { + this.assertChangeAnnotations(this.changeAnnotations); + id = this.changeAnnotations.manage(annotation); + edit = AnnotatedTextEdit.del(range, id); + } + this.edits.push(edit); + if (id !== undefined) { + return id; + } + }; + TextEditChangeImpl.prototype.add = function(edit) { + this.edits.push(edit); + }; + TextEditChangeImpl.prototype.all = function() { + return this.edits; + }; + TextEditChangeImpl.prototype.clear = function() { + this.edits.splice(0, this.edits.length); + }; + TextEditChangeImpl.prototype.assertChangeAnnotations = function(value) { + if (value === undefined) { + throw new Error('Text edit change is not configured to manage change annotations.'); + } + }; + return TextEditChangeImpl; + }(); + var ChangeAnnotations = function() { + function ChangeAnnotations(annotations) { + this._annotations = annotations === undefined ? Object.create(null) : annotations; + this._counter = 0; + this._size = 0; + } + ChangeAnnotations.prototype.all = function() { + return this._annotations; + }; + Object.defineProperty(ChangeAnnotations.prototype, 'size', { + get: function() { + return this._size; + }, + enumerable: false, + configurable: true + }); + ChangeAnnotations.prototype.manage = function(idOrAnnotation, annotation) { + var id; + if (ChangeAnnotationIdentifier.is(idOrAnnotation)) { + id = idOrAnnotation; + } else { + id = this.nextId(); + annotation = idOrAnnotation; + } + if (this._annotations[id] !== undefined) { + throw new Error('Id '.concat(id, ' is already in use.')); + } + if (annotation === undefined) { + throw new Error('No annotation provided for id '.concat(id)); + } + this._annotations[id] = annotation; + this._size++; + return id; + }; + ChangeAnnotations.prototype.nextId = function() { + this._counter++; + return this._counter.toString(); + }; + return ChangeAnnotations; + }(); + var WorkspaceChange = function() { + function WorkspaceChange(workspaceEdit) { + var _this = this; + this._textEditChanges = Object.create(null); + if (workspaceEdit !== undefined) { + this._workspaceEdit = workspaceEdit; + if (workspaceEdit.documentChanges) { + this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations); + workspaceEdit.changeAnnotations = this._changeAnnotations.all(); + workspaceEdit.documentChanges.forEach((function(change) { + if (TextDocumentEdit.is(change)) { + var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations); + _this._textEditChanges[change.textDocument.uri] = textEditChange; + } + })); + } else if (workspaceEdit.changes) { + Object.keys(workspaceEdit.changes).forEach((function(key) { + var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); + _this._textEditChanges[key] = textEditChange; + })); + } + } else { + this._workspaceEdit = {}; + } + } + Object.defineProperty(WorkspaceChange.prototype, 'edit', { + get: function() { + this.initDocumentChanges(); + if (this._changeAnnotations !== undefined) { + if (this._changeAnnotations.size === 0) { + this._workspaceEdit.changeAnnotations = undefined; + } else { + this._workspaceEdit.changeAnnotations = this._changeAnnotations.all(); + } + } + return this._workspaceEdit; + }, + enumerable: false, + configurable: true + }); + WorkspaceChange.prototype.getTextEditChange = function(key) { + if (OptionalVersionedTextDocumentIdentifier.is(key)) { + this.initDocumentChanges(); + if (this._workspaceEdit.documentChanges === undefined) { + throw new Error('Workspace edit is not configured for document changes.'); + } + var textDocument = { + uri: key.uri, + version: key.version + }; + var result = this._textEditChanges[textDocument.uri]; + if (!result) { + var edits = []; + var textDocumentEdit = { + textDocument: textDocument, + edits: edits + }; + this._workspaceEdit.documentChanges.push(textDocumentEdit); + result = new TextEditChangeImpl(edits, this._changeAnnotations); + this._textEditChanges[textDocument.uri] = result; + } + return result; + } else { + this.initChanges(); + if (this._workspaceEdit.changes === undefined) { + throw new Error('Workspace edit is not configured for normal text edit changes.'); + } + var result = this._textEditChanges[key]; + if (!result) { + var edits = []; + this._workspaceEdit.changes[key] = edits; + result = new TextEditChangeImpl(edits); + this._textEditChanges[key] = result; + } + return result; + } + }; + WorkspaceChange.prototype.initDocumentChanges = function() { + if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) { + this._changeAnnotations = new ChangeAnnotations; + this._workspaceEdit.documentChanges = []; + this._workspaceEdit.changeAnnotations = this._changeAnnotations.all(); + } + }; + WorkspaceChange.prototype.initChanges = function() { + if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) { + this._workspaceEdit.changes = Object.create(null); + } + }; + WorkspaceChange.prototype.createFile = function(uri, optionsOrAnnotation, options) { + this.initDocumentChanges(); + if (this._workspaceEdit.documentChanges === undefined) { + throw new Error('Workspace edit is not configured for document changes.'); + } + var annotation; + if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { + annotation = optionsOrAnnotation; + } else { + options = optionsOrAnnotation; + } + var operation; + var id; + if (annotation === undefined) { + operation = CreateFile.create(uri, options); + } else { + id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); + operation = CreateFile.create(uri, options, id); + } + this._workspaceEdit.documentChanges.push(operation); + if (id !== undefined) { + return id; + } + }; + WorkspaceChange.prototype.renameFile = function(oldUri, newUri, optionsOrAnnotation, options) { + this.initDocumentChanges(); + if (this._workspaceEdit.documentChanges === undefined) { + throw new Error('Workspace edit is not configured for document changes.'); + } + var annotation; + if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { + annotation = optionsOrAnnotation; + } else { + options = optionsOrAnnotation; + } + var operation; + var id; + if (annotation === undefined) { + operation = RenameFile.create(oldUri, newUri, options); + } else { + id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); + operation = RenameFile.create(oldUri, newUri, options, id); + } + this._workspaceEdit.documentChanges.push(operation); + if (id !== undefined) { + return id; + } + }; + WorkspaceChange.prototype.deleteFile = function(uri, optionsOrAnnotation, options) { + this.initDocumentChanges(); + if (this._workspaceEdit.documentChanges === undefined) { + throw new Error('Workspace edit is not configured for document changes.'); + } + var annotation; + if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { + annotation = optionsOrAnnotation; + } else { + options = optionsOrAnnotation; + } + var operation; + var id; + if (annotation === undefined) { + operation = DeleteFile.create(uri, options); + } else { + id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); + operation = DeleteFile.create(uri, options, id); + } + this._workspaceEdit.documentChanges.push(operation); + if (id !== undefined) { + return id; + } + }; + return WorkspaceChange; + }(); + exports.WorkspaceChange = WorkspaceChange; + var TextDocumentIdentifier; + (function(TextDocumentIdentifier) { + function create(uri) { + return { + uri: uri + }; + } + TextDocumentIdentifier.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri); + } + TextDocumentIdentifier.is = is; + })(TextDocumentIdentifier || (exports.TextDocumentIdentifier = TextDocumentIdentifier = {})); + var VersionedTextDocumentIdentifier; + (function(VersionedTextDocumentIdentifier) { + function create(uri, version) { + return { + uri: uri, + version: version + }; + } + VersionedTextDocumentIdentifier.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version); + } + VersionedTextDocumentIdentifier.is = is; + })(VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = VersionedTextDocumentIdentifier = {})); + var OptionalVersionedTextDocumentIdentifier; + (function(OptionalVersionedTextDocumentIdentifier) { + function create(uri, version) { + return { + uri: uri, + version: version + }; + } + OptionalVersionedTextDocumentIdentifier.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version)); + } + OptionalVersionedTextDocumentIdentifier.is = is; + })(OptionalVersionedTextDocumentIdentifier || (exports.OptionalVersionedTextDocumentIdentifier = OptionalVersionedTextDocumentIdentifier = {})); + var TextDocumentItem; + (function(TextDocumentItem) { + function create(uri, languageId, version, text) { + return { + uri: uri, + languageId: languageId, + version: version, + text: text + }; + } + TextDocumentItem.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text); + } + TextDocumentItem.is = is; + })(TextDocumentItem || (exports.TextDocumentItem = TextDocumentItem = {})); + var MarkupKind; + (function(MarkupKind) { + MarkupKind.PlainText = 'plaintext'; + MarkupKind.Markdown = 'markdown'; + function is(value) { + var candidate = value; + return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; + } + MarkupKind.is = is; + })(MarkupKind || (exports.MarkupKind = MarkupKind = {})); + var MarkupContent; + (function(MarkupContent) { + function is(value) { + var candidate = value; + return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); + } + MarkupContent.is = is; + })(MarkupContent || (exports.MarkupContent = MarkupContent = {})); + var CompletionItemKind; + (function(CompletionItemKind) { + CompletionItemKind.Text = 1; + CompletionItemKind.Method = 2; + CompletionItemKind.Function = 3; + CompletionItemKind.Constructor = 4; + CompletionItemKind.Field = 5; + CompletionItemKind.Variable = 6; + CompletionItemKind.Class = 7; + CompletionItemKind.Interface = 8; + CompletionItemKind.Module = 9; + CompletionItemKind.Property = 10; + CompletionItemKind.Unit = 11; + CompletionItemKind.Value = 12; + CompletionItemKind.Enum = 13; + CompletionItemKind.Keyword = 14; + CompletionItemKind.Snippet = 15; + CompletionItemKind.Color = 16; + CompletionItemKind.File = 17; + CompletionItemKind.Reference = 18; + CompletionItemKind.Folder = 19; + CompletionItemKind.EnumMember = 20; + CompletionItemKind.Constant = 21; + CompletionItemKind.Struct = 22; + CompletionItemKind.Event = 23; + CompletionItemKind.Operator = 24; + CompletionItemKind.TypeParameter = 25; + })(CompletionItemKind || (exports.CompletionItemKind = CompletionItemKind = {})); + var InsertTextFormat; + (function(InsertTextFormat) { + InsertTextFormat.PlainText = 1; + InsertTextFormat.Snippet = 2; + })(InsertTextFormat || (exports.InsertTextFormat = InsertTextFormat = {})); + var CompletionItemTag; + (function(CompletionItemTag) { + CompletionItemTag.Deprecated = 1; + })(CompletionItemTag || (exports.CompletionItemTag = CompletionItemTag = {})); + var InsertReplaceEdit; + (function(InsertReplaceEdit) { + function create(newText, insert, replace) { + return { + newText: newText, + insert: insert, + replace: replace + }; + } + InsertReplaceEdit.create = create; + function is(value) { + var candidate = value; + return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace); + } + InsertReplaceEdit.is = is; + })(InsertReplaceEdit || (exports.InsertReplaceEdit = InsertReplaceEdit = {})); + var InsertTextMode; + (function(InsertTextMode) { + InsertTextMode.asIs = 1; + InsertTextMode.adjustIndentation = 2; + })(InsertTextMode || (exports.InsertTextMode = InsertTextMode = {})); + var CompletionItemLabelDetails; + (function(CompletionItemLabelDetails) { + function is(value) { + var candidate = value; + return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) && (Is.string(candidate.description) || candidate.description === undefined); + } + CompletionItemLabelDetails.is = is; + })(CompletionItemLabelDetails || (exports.CompletionItemLabelDetails = CompletionItemLabelDetails = {})); + var CompletionItem; + (function(CompletionItem) { + function create(label) { + return { + label: label + }; + } + CompletionItem.create = create; + })(CompletionItem || (exports.CompletionItem = CompletionItem = {})); + var CompletionList; + (function(CompletionList) { + function create(items, isIncomplete) { + return { + items: items ? items : [], + isIncomplete: !!isIncomplete + }; + } + CompletionList.create = create; + })(CompletionList || (exports.CompletionList = CompletionList = {})); + var MarkedString; + (function(MarkedString) { + function fromPlainText(plainText) { + return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); + } + MarkedString.fromPlainText = fromPlainText; + function is(value) { + var candidate = value; + return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value); + } + MarkedString.is = is; + })(MarkedString || (exports.MarkedString = MarkedString = {})); + var Hover; + (function(Hover) { + function is(value) { + var candidate = value; + return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range)); + } + Hover.is = is; + })(Hover || (exports.Hover = Hover = {})); + var ParameterInformation; + (function(ParameterInformation) { + function create(label, documentation) { + return documentation ? { + label: label, + documentation: documentation + } : { + label: label + }; + } + ParameterInformation.create = create; + })(ParameterInformation || (exports.ParameterInformation = ParameterInformation = {})); + var SignatureInformation; + (function(SignatureInformation) { + function create(label, documentation) { + var parameters = []; + for (var _i = 2; _i < arguments.length; _i++) { + parameters[_i - 2] = arguments[_i]; + } + var result = { + label: label + }; + if (Is.defined(documentation)) { + result.documentation = documentation; + } + if (Is.defined(parameters)) { + result.parameters = parameters; + } else { + result.parameters = []; + } + return result; + } + SignatureInformation.create = create; + })(SignatureInformation || (exports.SignatureInformation = SignatureInformation = {})); + var DocumentHighlightKind; + (function(DocumentHighlightKind) { + DocumentHighlightKind.Text = 1; + DocumentHighlightKind.Read = 2; + DocumentHighlightKind.Write = 3; + })(DocumentHighlightKind || (exports.DocumentHighlightKind = DocumentHighlightKind = {})); + var DocumentHighlight; + (function(DocumentHighlight) { + function create(range, kind) { + var result = { + range: range + }; + if (Is.number(kind)) { + result.kind = kind; + } + return result; + } + DocumentHighlight.create = create; + })(DocumentHighlight || (exports.DocumentHighlight = DocumentHighlight = {})); + var SymbolKind; + (function(SymbolKind) { + SymbolKind.File = 1; + SymbolKind.Module = 2; + SymbolKind.Namespace = 3; + SymbolKind.Package = 4; + SymbolKind.Class = 5; + SymbolKind.Method = 6; + SymbolKind.Property = 7; + SymbolKind.Field = 8; + SymbolKind.Constructor = 9; + SymbolKind.Enum = 10; + SymbolKind.Interface = 11; + SymbolKind.Function = 12; + SymbolKind.Variable = 13; + SymbolKind.Constant = 14; + SymbolKind.String = 15; + SymbolKind.Number = 16; + SymbolKind.Boolean = 17; + SymbolKind.Array = 18; + SymbolKind.Object = 19; + SymbolKind.Key = 20; + SymbolKind.Null = 21; + SymbolKind.EnumMember = 22; + SymbolKind.Struct = 23; + SymbolKind.Event = 24; + SymbolKind.Operator = 25; + SymbolKind.TypeParameter = 26; + })(SymbolKind || (exports.SymbolKind = SymbolKind = {})); + var SymbolTag; + (function(SymbolTag) { + SymbolTag.Deprecated = 1; + })(SymbolTag || (exports.SymbolTag = SymbolTag = {})); + var SymbolInformation; + (function(SymbolInformation) { + function create(name, kind, range, uri, containerName) { + var result = { + name: name, + kind: kind, + location: { + uri: uri, + range: range + } + }; + if (containerName) { + result.containerName = containerName; + } + return result; + } + SymbolInformation.create = create; + })(SymbolInformation || (exports.SymbolInformation = SymbolInformation = {})); + var WorkspaceSymbol; + (function(WorkspaceSymbol) { + function create(name, kind, uri, range) { + return range !== undefined ? { + name: name, + kind: kind, + location: { + uri: uri, + range: range + } + } : { + name: name, + kind: kind, + location: { + uri: uri + } + }; + } + WorkspaceSymbol.create = create; + })(WorkspaceSymbol || (exports.WorkspaceSymbol = WorkspaceSymbol = {})); + var DocumentSymbol; + (function(DocumentSymbol) { + function create(name, detail, kind, range, selectionRange, children) { + var result = { + name: name, + detail: detail, + kind: kind, + range: range, + selectionRange: selectionRange + }; + if (children !== undefined) { + result.children = children; + } + return result; + } + DocumentSymbol.create = create; + function is(value) { + var candidate = value; + return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === undefined || Is.string(candidate.detail)) && (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) && (candidate.children === undefined || Array.isArray(candidate.children)) && (candidate.tags === undefined || Array.isArray(candidate.tags)); + } + DocumentSymbol.is = is; + })(DocumentSymbol || (exports.DocumentSymbol = DocumentSymbol = {})); + var CodeActionKind; + (function(CodeActionKind) { + CodeActionKind.Empty = ''; + CodeActionKind.QuickFix = 'quickfix'; + CodeActionKind.Refactor = 'refactor'; + CodeActionKind.RefactorExtract = 'refactor.extract'; + CodeActionKind.RefactorInline = 'refactor.inline'; + CodeActionKind.RefactorRewrite = 'refactor.rewrite'; + CodeActionKind.Source = 'source'; + CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; + CodeActionKind.SourceFixAll = 'source.fixAll'; + })(CodeActionKind || (exports.CodeActionKind = CodeActionKind = {})); + var CodeActionTriggerKind; + (function(CodeActionTriggerKind) { + CodeActionTriggerKind.Invoked = 1; + CodeActionTriggerKind.Automatic = 2; + })(CodeActionTriggerKind || (exports.CodeActionTriggerKind = CodeActionTriggerKind = {})); + var CodeActionContext; + (function(CodeActionContext) { + function create(diagnostics, only, triggerKind) { + var result = { + diagnostics: diagnostics + }; + if (only !== undefined && only !== null) { + result.only = only; + } + if (triggerKind !== undefined && triggerKind !== null) { + result.triggerKind = triggerKind; + } + return result; + } + CodeActionContext.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic); + } + CodeActionContext.is = is; + })(CodeActionContext || (exports.CodeActionContext = CodeActionContext = {})); + var CodeAction; + (function(CodeAction) { + function create(title, kindOrCommandOrEdit, kind) { + var result = { + title: title + }; + var checkKind = true; + if (typeof kindOrCommandOrEdit === 'string') { + checkKind = false; + result.kind = kindOrCommandOrEdit; + } else if (Command.is(kindOrCommandOrEdit)) { + result.command = kindOrCommandOrEdit; + } else { + result.edit = kindOrCommandOrEdit; + } + if (checkKind && kind !== undefined) { + result.kind = kind; + } + return result; + } + CodeAction.create = create; + function is(value) { + var candidate = value; + return candidate && Is.string(candidate.title) && (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === undefined || Is.string(candidate.kind)) && (candidate.edit !== undefined || candidate.command !== undefined) && (candidate.command === undefined || Command.is(candidate.command)) && (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) && (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit)); + } + CodeAction.is = is; + })(CodeAction || (exports.CodeAction = CodeAction = {})); + var CodeLens; + (function(CodeLens) { + function create(range, data) { + var result = { + range: range + }; + if (Is.defined(data)) { + result.data = data; + } + return result; + } + CodeLens.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); + } + CodeLens.is = is; + })(CodeLens || (exports.CodeLens = CodeLens = {})); + var FormattingOptions; + (function(FormattingOptions) { + function create(tabSize, insertSpaces) { + return { + tabSize: tabSize, + insertSpaces: insertSpaces + }; + } + FormattingOptions.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces); + } + FormattingOptions.is = is; + })(FormattingOptions || (exports.FormattingOptions = FormattingOptions = {})); + var DocumentLink; + (function(DocumentLink) { + function create(range, target, data) { + return { + range: range, + target: target, + data: data + }; + } + DocumentLink.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + } + DocumentLink.is = is; + })(DocumentLink || (exports.DocumentLink = DocumentLink = {})); + var SelectionRange; + (function(SelectionRange) { + function create(range, parent) { + return { + range: range, + parent: parent + }; + } + SelectionRange.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); + } + SelectionRange.is = is; + })(SelectionRange || (exports.SelectionRange = SelectionRange = {})); + var SemanticTokenTypes; + (function(SemanticTokenTypes) { + SemanticTokenTypes['namespace'] = 'namespace'; + SemanticTokenTypes['type'] = 'type'; + SemanticTokenTypes['class'] = 'class'; + SemanticTokenTypes['enum'] = 'enum'; + SemanticTokenTypes['interface'] = 'interface'; + SemanticTokenTypes['struct'] = 'struct'; + SemanticTokenTypes['typeParameter'] = 'typeParameter'; + SemanticTokenTypes['parameter'] = 'parameter'; + SemanticTokenTypes['variable'] = 'variable'; + SemanticTokenTypes['property'] = 'property'; + SemanticTokenTypes['enumMember'] = 'enumMember'; + SemanticTokenTypes['event'] = 'event'; + SemanticTokenTypes['function'] = 'function'; + SemanticTokenTypes['method'] = 'method'; + SemanticTokenTypes['macro'] = 'macro'; + SemanticTokenTypes['keyword'] = 'keyword'; + SemanticTokenTypes['modifier'] = 'modifier'; + SemanticTokenTypes['comment'] = 'comment'; + SemanticTokenTypes['string'] = 'string'; + SemanticTokenTypes['number'] = 'number'; + SemanticTokenTypes['regexp'] = 'regexp'; + SemanticTokenTypes['operator'] = 'operator'; + SemanticTokenTypes['decorator'] = 'decorator'; + })(SemanticTokenTypes || (exports.SemanticTokenTypes = SemanticTokenTypes = {})); + var SemanticTokenModifiers; + (function(SemanticTokenModifiers) { + SemanticTokenModifiers['declaration'] = 'declaration'; + SemanticTokenModifiers['definition'] = 'definition'; + SemanticTokenModifiers['readonly'] = 'readonly'; + SemanticTokenModifiers['static'] = 'static'; + SemanticTokenModifiers['deprecated'] = 'deprecated'; + SemanticTokenModifiers['abstract'] = 'abstract'; + SemanticTokenModifiers['async'] = 'async'; + SemanticTokenModifiers['modification'] = 'modification'; + SemanticTokenModifiers['documentation'] = 'documentation'; + SemanticTokenModifiers['defaultLibrary'] = 'defaultLibrary'; + })(SemanticTokenModifiers || (exports.SemanticTokenModifiers = SemanticTokenModifiers = {})); + var SemanticTokens; + (function(SemanticTokens) { + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number'); + } + SemanticTokens.is = is; + })(SemanticTokens || (exports.SemanticTokens = SemanticTokens = {})); + var InlineValueText; + (function(InlineValueText) { + function create(range, text) { + return { + range: range, + text: text + }; + } + InlineValueText.create = create; + function is(value) { + var candidate = value; + return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text); + } + InlineValueText.is = is; + })(InlineValueText || (exports.InlineValueText = InlineValueText = {})); + var InlineValueVariableLookup; + (function(InlineValueVariableLookup) { + function create(range, variableName, caseSensitiveLookup) { + return { + range: range, + variableName: variableName, + caseSensitiveLookup: caseSensitiveLookup + }; + } + InlineValueVariableLookup.create = create; + function is(value) { + var candidate = value; + return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === undefined); + } + InlineValueVariableLookup.is = is; + })(InlineValueVariableLookup || (exports.InlineValueVariableLookup = InlineValueVariableLookup = {})); + var InlineValueEvaluatableExpression; + (function(InlineValueEvaluatableExpression) { + function create(range, expression) { + return { + range: range, + expression: expression + }; + } + InlineValueEvaluatableExpression.create = create; + function is(value) { + var candidate = value; + return candidate !== undefined && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === undefined); + } + InlineValueEvaluatableExpression.is = is; + })(InlineValueEvaluatableExpression || (exports.InlineValueEvaluatableExpression = InlineValueEvaluatableExpression = {})); + var InlineValueContext; + (function(InlineValueContext) { + function create(frameId, stoppedLocation) { + return { + frameId: frameId, + stoppedLocation: stoppedLocation + }; + } + InlineValueContext.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(value.stoppedLocation); + } + InlineValueContext.is = is; + })(InlineValueContext || (exports.InlineValueContext = InlineValueContext = {})); + var InlayHintKind; + (function(InlayHintKind) { + InlayHintKind.Type = 1; + InlayHintKind.Parameter = 2; + function is(value) { + return value === 1 || value === 2; + } + InlayHintKind.is = is; + })(InlayHintKind || (exports.InlayHintKind = InlayHintKind = {})); + var InlayHintLabelPart; + (function(InlayHintLabelPart) { + function create(value) { + return { + value: value + }; + } + InlayHintLabelPart.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === undefined || Location.is(candidate.location)) && (candidate.command === undefined || Command.is(candidate.command)); + } + InlayHintLabelPart.is = is; + })(InlayHintLabelPart || (exports.InlayHintLabelPart = InlayHintLabelPart = {})); + var InlayHint; + (function(InlayHint) { + function create(position, label, kind) { + var result = { + position: position, + label: label + }; + if (kind !== undefined) { + result.kind = kind; + } + return result; + } + InlayHint.create = create; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === undefined || InlayHintKind.is(candidate.kind)) && candidate.textEdits === undefined || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight)); + } + InlayHint.is = is; + })(InlayHint || (exports.InlayHint = InlayHint = {})); + var StringValue; + (function(StringValue) { + function createSnippet(value) { + return { + kind: 'snippet', + value: value + }; + } + StringValue.createSnippet = createSnippet; + })(StringValue || (exports.StringValue = StringValue = {})); + var InlineCompletionItem; + (function(InlineCompletionItem) { + function create(insertText, filterText, range, command) { + return { + insertText: insertText, + filterText: filterText, + range: range, + command: command + }; + } + InlineCompletionItem.create = create; + })(InlineCompletionItem || (exports.InlineCompletionItem = InlineCompletionItem = {})); + var InlineCompletionList; + (function(InlineCompletionList) { + function create(items) { + return { + items: items + }; + } + InlineCompletionList.create = create; + })(InlineCompletionList || (exports.InlineCompletionList = InlineCompletionList = {})); + var InlineCompletionTriggerKind; + (function(InlineCompletionTriggerKind) { + InlineCompletionTriggerKind.Invoked = 0; + InlineCompletionTriggerKind.Automatic = 1; + })(InlineCompletionTriggerKind || (exports.InlineCompletionTriggerKind = InlineCompletionTriggerKind = {})); + var SelectedCompletionInfo; + (function(SelectedCompletionInfo) { + function create(range, text) { + return { + range: range, + text: text + }; + } + SelectedCompletionInfo.create = create; + })(SelectedCompletionInfo || (exports.SelectedCompletionInfo = SelectedCompletionInfo = {})); + var InlineCompletionContext; + (function(InlineCompletionContext) { + function create(triggerKind, selectedCompletionInfo) { + return { + triggerKind: triggerKind, + selectedCompletionInfo: selectedCompletionInfo + }; + } + InlineCompletionContext.create = create; + })(InlineCompletionContext || (exports.InlineCompletionContext = InlineCompletionContext = {})); + var WorkspaceFolder; + (function(WorkspaceFolder) { + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name); + } + WorkspaceFolder.is = is; + })(WorkspaceFolder || (exports.WorkspaceFolder = WorkspaceFolder = {})); + exports.EOL = [ '\n', '\r\n', '\r' ]; + var TextDocument; + (function(TextDocument) { + function create(uri, languageId, version, content) { + return new FullTextDocument(uri, languageId, version, content); + } + TextDocument.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; + } + TextDocument.is = is; + function applyEdits(document, edits) { + var text = document.getText(); + var sortedEdits = mergeSort(edits, (function(a, b) { + var diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + })); + var lastModifiedOffset = text.length; + for (var i = sortedEdits.length - 1; i >= 0; i--) { + var e = sortedEdits[i]; + var startOffset = document.offsetAt(e.range.start); + var endOffset = document.offsetAt(e.range.end); + if (endOffset <= lastModifiedOffset) { + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); + } else { + throw new Error('Overlapping edit'); + } + lastModifiedOffset = startOffset; + } + return text; + } + TextDocument.applyEdits = applyEdits; + function mergeSort(data, compare) { + if (data.length <= 1) { + return data; + } + var p = data.length / 2 | 0; + var left = data.slice(0, p); + var right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + var leftIdx = 0; + var rightIdx = 0; + var i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + var ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + data[i++] = left[leftIdx++]; + } else { + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; + } + })(TextDocument || (exports.TextDocument = TextDocument = {})); + var FullTextDocument = function() { + function FullTextDocument(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = undefined; + } + Object.defineProperty(FullTextDocument.prototype, 'uri', { + get: function() { + return this._uri; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, 'languageId', { + get: function() { + return this._languageId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, 'version', { + get: function() { + return this._version; + }, + enumerable: false, + configurable: true + }); + FullTextDocument.prototype.getText = function(range) { + if (range) { + var start = this.offsetAt(range.start); + var end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + }; + FullTextDocument.prototype.update = function(event, version) { + this._content = event.text; + this._version = version; + this._lineOffsets = undefined; + }; + FullTextDocument.prototype.getLineOffsets = function() { + if (this._lineOffsets === undefined) { + var lineOffsets = []; + var text = this._content; + var isLineStart = true; + for (var i = 0; i < text.length; i++) { + if (isLineStart) { + lineOffsets.push(i); + isLineStart = false; + } + var ch = text.charAt(i); + isLineStart = ch === '\r' || ch === '\n'; + if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { + i++; + } + } + if (isLineStart && text.length > 0) { + lineOffsets.push(text.length); + } + this._lineOffsets = lineOffsets; + } + return this._lineOffsets; + }; + FullTextDocument.prototype.positionAt = function(offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + var lineOffsets = this.getLineOffsets(); + var low = 0, high = lineOffsets.length; + if (high === 0) { + return Position.create(0, offset); + } + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } else { + low = mid + 1; + } + } + var line = low - 1; + return Position.create(line, offset - lineOffsets[line]); + }; + FullTextDocument.prototype.offsetAt = function(position) { + var lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } else if (position.line < 0) { + return 0; + } + var lineOffset = lineOffsets[position.line]; + var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + }; + Object.defineProperty(FullTextDocument.prototype, 'lineCount', { + get: function() { + return this.getLineOffsets().length; + }, + enumerable: false, + configurable: true + }); + return FullTextDocument; + }(); + var Is; + (function(Is) { + var toString = Object.prototype.toString; + function defined(value) { + return typeof value !== 'undefined'; + } + Is.defined = defined; + function undefined$1(value) { + return typeof value === 'undefined'; + } + Is.undefined = undefined$1; + function boolean(value) { + return value === true || value === false; + } + Is.boolean = boolean; + function string(value) { + return toString.call(value) === '[object String]'; + } + Is.string = string; + function number(value) { + return toString.call(value) === '[object Number]'; + } + Is.number = number; + function numberRange(value, min, max) { + return toString.call(value) === '[object Number]' && min <= value && value <= max; + } + Is.numberRange = numberRange; + function integer(value) { + return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647; + } + Is.integer = integer; + function uinteger(value) { + return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647; + } + Is.uinteger = uinteger; + function func(value) { + return toString.call(value) === '[object Function]'; + } + Is.func = func; + function objectLiteral(value) { + return value !== null && typeof value === 'object'; + } + Is.objectLiteral = objectLiteral; + function typedArray(value, check) { + return Array.isArray(value) && value.every(check); + } + Is.typedArray = typedArray; + })(Is || (Is = {})); + })); +})(main, main.exports); + +var mainExports = main.exports; + +var messages = {}; + +Object.defineProperty(messages, '__esModule', { + value: true +}); + +messages.ProtocolNotificationType = messages.ProtocolNotificationType0 = messages.ProtocolRequestType = messages.ProtocolRequestType0 = messages.RegistrationType = messages.MessageDirection = void 0; + +const vscode_jsonrpc_1$3 = main$1; + +var MessageDirection; + +(function(MessageDirection) { + MessageDirection['clientToServer'] = 'clientToServer'; + MessageDirection['serverToClient'] = 'serverToClient'; + MessageDirection['both'] = 'both'; +})(MessageDirection || (messages.MessageDirection = MessageDirection = {})); + +class RegistrationType { + constructor(method) { + this.method = method; + } +} + +messages.RegistrationType = RegistrationType; + +class ProtocolRequestType0 extends vscode_jsonrpc_1$3.RequestType0 { + constructor(method) { + super(method); + } +} + +messages.ProtocolRequestType0 = ProtocolRequestType0; + +class ProtocolRequestType extends vscode_jsonrpc_1$3.RequestType { + constructor(method) { + super(method, vscode_jsonrpc_1$3.ParameterStructures.byName); + } +} + +messages.ProtocolRequestType = ProtocolRequestType; + +class ProtocolNotificationType0 extends vscode_jsonrpc_1$3.NotificationType0 { + constructor(method) { + super(method); + } +} + +messages.ProtocolNotificationType0 = ProtocolNotificationType0; + +class ProtocolNotificationType extends vscode_jsonrpc_1$3.NotificationType { + constructor(method) { + super(method, vscode_jsonrpc_1$3.ParameterStructures.byName); + } +} + +messages.ProtocolNotificationType = ProtocolNotificationType; + +var protocol = {}; + +var is = {}; + +Object.defineProperty(is, '__esModule', { + value: true +}); + +is.objectLiteral = is.typedArray = is.stringArray = is.array = is.func = is.error = is.number = is.string = is.boolean = void 0; + +function boolean(value) { + return value === true || value === false; +} + +is.boolean = boolean; + +function string(value) { + return typeof value === 'string' || value instanceof String; +} + +is.string = string; + +function number(value) { + return typeof value === 'number' || value instanceof Number; +} + +is.number = number; + +function error(value) { + return value instanceof Error; +} + +is.error = error; + +function func(value) { + return typeof value === 'function'; +} + +is.func = func; + +function array(value) { + return Array.isArray(value); +} + +is.array = array; + +function stringArray(value) { + return array(value) && value.every((elem => string(elem))); +} + +is.stringArray = stringArray; + +function typedArray(value, check) { + return Array.isArray(value) && value.every(check); +} + +is.typedArray = typedArray; + +function objectLiteral(value) { + return value !== null && typeof value === 'object'; +} + +is.objectLiteral = objectLiteral; + +var protocol_implementation = {}; + +Object.defineProperty(protocol_implementation, '__esModule', { + value: true +}); + +protocol_implementation.ImplementationRequest = void 0; + +const messages_1$k = messages; + +var ImplementationRequest; + +(function(ImplementationRequest) { + ImplementationRequest.method = 'textDocument/implementation'; + ImplementationRequest.messageDirection = messages_1$k.MessageDirection.clientToServer; + ImplementationRequest.type = new messages_1$k.ProtocolRequestType(ImplementationRequest.method); +})(ImplementationRequest || (protocol_implementation.ImplementationRequest = ImplementationRequest = {})); + +var protocol_typeDefinition = {}; + +Object.defineProperty(protocol_typeDefinition, '__esModule', { + value: true +}); + +protocol_typeDefinition.TypeDefinitionRequest = void 0; + +const messages_1$j = messages; + +var TypeDefinitionRequest; + +(function(TypeDefinitionRequest) { + TypeDefinitionRequest.method = 'textDocument/typeDefinition'; + TypeDefinitionRequest.messageDirection = messages_1$j.MessageDirection.clientToServer; + TypeDefinitionRequest.type = new messages_1$j.ProtocolRequestType(TypeDefinitionRequest.method); +})(TypeDefinitionRequest || (protocol_typeDefinition.TypeDefinitionRequest = TypeDefinitionRequest = {})); + +var protocol_workspaceFolder = {}; + +Object.defineProperty(protocol_workspaceFolder, '__esModule', { + value: true +}); + +protocol_workspaceFolder.DidChangeWorkspaceFoldersNotification = protocol_workspaceFolder.WorkspaceFoldersRequest = void 0; + +const messages_1$i = messages; + +var WorkspaceFoldersRequest; + +(function(WorkspaceFoldersRequest) { + WorkspaceFoldersRequest.method = 'workspace/workspaceFolders'; + WorkspaceFoldersRequest.messageDirection = messages_1$i.MessageDirection.serverToClient; + WorkspaceFoldersRequest.type = new messages_1$i.ProtocolRequestType0(WorkspaceFoldersRequest.method); +})(WorkspaceFoldersRequest || (protocol_workspaceFolder.WorkspaceFoldersRequest = WorkspaceFoldersRequest = {})); + +var DidChangeWorkspaceFoldersNotification; + +(function(DidChangeWorkspaceFoldersNotification) { + DidChangeWorkspaceFoldersNotification.method = 'workspace/didChangeWorkspaceFolders'; + DidChangeWorkspaceFoldersNotification.messageDirection = messages_1$i.MessageDirection.clientToServer; + DidChangeWorkspaceFoldersNotification.type = new messages_1$i.ProtocolNotificationType(DidChangeWorkspaceFoldersNotification.method); +})(DidChangeWorkspaceFoldersNotification || (protocol_workspaceFolder.DidChangeWorkspaceFoldersNotification = DidChangeWorkspaceFoldersNotification = {})); + +var protocol_configuration = {}; + +Object.defineProperty(protocol_configuration, '__esModule', { + value: true +}); + +protocol_configuration.ConfigurationRequest = void 0; + +const messages_1$h = messages; + +var ConfigurationRequest; + +(function(ConfigurationRequest) { + ConfigurationRequest.method = 'workspace/configuration'; + ConfigurationRequest.messageDirection = messages_1$h.MessageDirection.serverToClient; + ConfigurationRequest.type = new messages_1$h.ProtocolRequestType(ConfigurationRequest.method); +})(ConfigurationRequest || (protocol_configuration.ConfigurationRequest = ConfigurationRequest = {})); + +var protocol_colorProvider = {}; + +Object.defineProperty(protocol_colorProvider, '__esModule', { + value: true +}); + +protocol_colorProvider.ColorPresentationRequest = protocol_colorProvider.DocumentColorRequest = void 0; + +const messages_1$g = messages; + +var DocumentColorRequest; + +(function(DocumentColorRequest) { + DocumentColorRequest.method = 'textDocument/documentColor'; + DocumentColorRequest.messageDirection = messages_1$g.MessageDirection.clientToServer; + DocumentColorRequest.type = new messages_1$g.ProtocolRequestType(DocumentColorRequest.method); +})(DocumentColorRequest || (protocol_colorProvider.DocumentColorRequest = DocumentColorRequest = {})); + +var ColorPresentationRequest; + +(function(ColorPresentationRequest) { + ColorPresentationRequest.method = 'textDocument/colorPresentation'; + ColorPresentationRequest.messageDirection = messages_1$g.MessageDirection.clientToServer; + ColorPresentationRequest.type = new messages_1$g.ProtocolRequestType(ColorPresentationRequest.method); +})(ColorPresentationRequest || (protocol_colorProvider.ColorPresentationRequest = ColorPresentationRequest = {})); + +var protocol_foldingRange = {}; + +Object.defineProperty(protocol_foldingRange, '__esModule', { + value: true +}); + +protocol_foldingRange.FoldingRangeRefreshRequest = protocol_foldingRange.FoldingRangeRequest = void 0; + +const messages_1$f = messages; + +var FoldingRangeRequest; + +(function(FoldingRangeRequest) { + FoldingRangeRequest.method = 'textDocument/foldingRange'; + FoldingRangeRequest.messageDirection = messages_1$f.MessageDirection.clientToServer; + FoldingRangeRequest.type = new messages_1$f.ProtocolRequestType(FoldingRangeRequest.method); +})(FoldingRangeRequest || (protocol_foldingRange.FoldingRangeRequest = FoldingRangeRequest = {})); + +var FoldingRangeRefreshRequest; + +(function(FoldingRangeRefreshRequest) { + FoldingRangeRefreshRequest.method = `workspace/foldingRange/refresh`; + FoldingRangeRefreshRequest.messageDirection = messages_1$f.MessageDirection.serverToClient; + FoldingRangeRefreshRequest.type = new messages_1$f.ProtocolRequestType0(FoldingRangeRefreshRequest.method); +})(FoldingRangeRefreshRequest || (protocol_foldingRange.FoldingRangeRefreshRequest = FoldingRangeRefreshRequest = {})); + +var protocol_declaration = {}; + +Object.defineProperty(protocol_declaration, '__esModule', { + value: true +}); + +protocol_declaration.DeclarationRequest = void 0; + +const messages_1$e = messages; + +var DeclarationRequest; + +(function(DeclarationRequest) { + DeclarationRequest.method = 'textDocument/declaration'; + DeclarationRequest.messageDirection = messages_1$e.MessageDirection.clientToServer; + DeclarationRequest.type = new messages_1$e.ProtocolRequestType(DeclarationRequest.method); +})(DeclarationRequest || (protocol_declaration.DeclarationRequest = DeclarationRequest = {})); + +var protocol_selectionRange = {}; + +Object.defineProperty(protocol_selectionRange, '__esModule', { + value: true +}); + +protocol_selectionRange.SelectionRangeRequest = void 0; + +const messages_1$d = messages; + +var SelectionRangeRequest; + +(function(SelectionRangeRequest) { + SelectionRangeRequest.method = 'textDocument/selectionRange'; + SelectionRangeRequest.messageDirection = messages_1$d.MessageDirection.clientToServer; + SelectionRangeRequest.type = new messages_1$d.ProtocolRequestType(SelectionRangeRequest.method); +})(SelectionRangeRequest || (protocol_selectionRange.SelectionRangeRequest = SelectionRangeRequest = {})); + +var protocol_progress = {}; + +Object.defineProperty(protocol_progress, '__esModule', { + value: true +}); + +protocol_progress.WorkDoneProgressCancelNotification = protocol_progress.WorkDoneProgressCreateRequest = protocol_progress.WorkDoneProgress = void 0; + +const vscode_jsonrpc_1$2 = main$1; + +const messages_1$c = messages; + +var WorkDoneProgress; + +(function(WorkDoneProgress) { + WorkDoneProgress.type = new vscode_jsonrpc_1$2.ProgressType; + function is(value) { + return value === WorkDoneProgress.type; + } + WorkDoneProgress.is = is; +})(WorkDoneProgress || (protocol_progress.WorkDoneProgress = WorkDoneProgress = {})); + +var WorkDoneProgressCreateRequest; + +(function(WorkDoneProgressCreateRequest) { + WorkDoneProgressCreateRequest.method = 'window/workDoneProgress/create'; + WorkDoneProgressCreateRequest.messageDirection = messages_1$c.MessageDirection.serverToClient; + WorkDoneProgressCreateRequest.type = new messages_1$c.ProtocolRequestType(WorkDoneProgressCreateRequest.method); +})(WorkDoneProgressCreateRequest || (protocol_progress.WorkDoneProgressCreateRequest = WorkDoneProgressCreateRequest = {})); + +var WorkDoneProgressCancelNotification; + +(function(WorkDoneProgressCancelNotification) { + WorkDoneProgressCancelNotification.method = 'window/workDoneProgress/cancel'; + WorkDoneProgressCancelNotification.messageDirection = messages_1$c.MessageDirection.clientToServer; + WorkDoneProgressCancelNotification.type = new messages_1$c.ProtocolNotificationType(WorkDoneProgressCancelNotification.method); +})(WorkDoneProgressCancelNotification || (protocol_progress.WorkDoneProgressCancelNotification = WorkDoneProgressCancelNotification = {})); + +var protocol_callHierarchy = {}; + +Object.defineProperty(protocol_callHierarchy, '__esModule', { + value: true +}); + +protocol_callHierarchy.CallHierarchyOutgoingCallsRequest = protocol_callHierarchy.CallHierarchyIncomingCallsRequest = protocol_callHierarchy.CallHierarchyPrepareRequest = void 0; + +const messages_1$b = messages; + +var CallHierarchyPrepareRequest; + +(function(CallHierarchyPrepareRequest) { + CallHierarchyPrepareRequest.method = 'textDocument/prepareCallHierarchy'; + CallHierarchyPrepareRequest.messageDirection = messages_1$b.MessageDirection.clientToServer; + CallHierarchyPrepareRequest.type = new messages_1$b.ProtocolRequestType(CallHierarchyPrepareRequest.method); +})(CallHierarchyPrepareRequest || (protocol_callHierarchy.CallHierarchyPrepareRequest = CallHierarchyPrepareRequest = {})); + +var CallHierarchyIncomingCallsRequest; + +(function(CallHierarchyIncomingCallsRequest) { + CallHierarchyIncomingCallsRequest.method = 'callHierarchy/incomingCalls'; + CallHierarchyIncomingCallsRequest.messageDirection = messages_1$b.MessageDirection.clientToServer; + CallHierarchyIncomingCallsRequest.type = new messages_1$b.ProtocolRequestType(CallHierarchyIncomingCallsRequest.method); +})(CallHierarchyIncomingCallsRequest || (protocol_callHierarchy.CallHierarchyIncomingCallsRequest = CallHierarchyIncomingCallsRequest = {})); + +var CallHierarchyOutgoingCallsRequest; + +(function(CallHierarchyOutgoingCallsRequest) { + CallHierarchyOutgoingCallsRequest.method = 'callHierarchy/outgoingCalls'; + CallHierarchyOutgoingCallsRequest.messageDirection = messages_1$b.MessageDirection.clientToServer; + CallHierarchyOutgoingCallsRequest.type = new messages_1$b.ProtocolRequestType(CallHierarchyOutgoingCallsRequest.method); +})(CallHierarchyOutgoingCallsRequest || (protocol_callHierarchy.CallHierarchyOutgoingCallsRequest = CallHierarchyOutgoingCallsRequest = {})); + +var protocol_semanticTokens = {}; + +Object.defineProperty(protocol_semanticTokens, '__esModule', { + value: true +}); + +protocol_semanticTokens.SemanticTokensRefreshRequest = protocol_semanticTokens.SemanticTokensRangeRequest = protocol_semanticTokens.SemanticTokensDeltaRequest = protocol_semanticTokens.SemanticTokensRequest = protocol_semanticTokens.SemanticTokensRegistrationType = protocol_semanticTokens.TokenFormat = void 0; + +const messages_1$a = messages; + +var TokenFormat; + +(function(TokenFormat) { + TokenFormat.Relative = 'relative'; +})(TokenFormat || (protocol_semanticTokens.TokenFormat = TokenFormat = {})); + +var SemanticTokensRegistrationType; + +(function(SemanticTokensRegistrationType) { + SemanticTokensRegistrationType.method = 'textDocument/semanticTokens'; + SemanticTokensRegistrationType.type = new messages_1$a.RegistrationType(SemanticTokensRegistrationType.method); +})(SemanticTokensRegistrationType || (protocol_semanticTokens.SemanticTokensRegistrationType = SemanticTokensRegistrationType = {})); + +var SemanticTokensRequest; + +(function(SemanticTokensRequest) { + SemanticTokensRequest.method = 'textDocument/semanticTokens/full'; + SemanticTokensRequest.messageDirection = messages_1$a.MessageDirection.clientToServer; + SemanticTokensRequest.type = new messages_1$a.ProtocolRequestType(SemanticTokensRequest.method); + SemanticTokensRequest.registrationMethod = SemanticTokensRegistrationType.method; +})(SemanticTokensRequest || (protocol_semanticTokens.SemanticTokensRequest = SemanticTokensRequest = {})); + +var SemanticTokensDeltaRequest; + +(function(SemanticTokensDeltaRequest) { + SemanticTokensDeltaRequest.method = 'textDocument/semanticTokens/full/delta'; + SemanticTokensDeltaRequest.messageDirection = messages_1$a.MessageDirection.clientToServer; + SemanticTokensDeltaRequest.type = new messages_1$a.ProtocolRequestType(SemanticTokensDeltaRequest.method); + SemanticTokensDeltaRequest.registrationMethod = SemanticTokensRegistrationType.method; +})(SemanticTokensDeltaRequest || (protocol_semanticTokens.SemanticTokensDeltaRequest = SemanticTokensDeltaRequest = {})); + +var SemanticTokensRangeRequest; + +(function(SemanticTokensRangeRequest) { + SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range'; + SemanticTokensRangeRequest.messageDirection = messages_1$a.MessageDirection.clientToServer; + SemanticTokensRangeRequest.type = new messages_1$a.ProtocolRequestType(SemanticTokensRangeRequest.method); + SemanticTokensRangeRequest.registrationMethod = SemanticTokensRegistrationType.method; +})(SemanticTokensRangeRequest || (protocol_semanticTokens.SemanticTokensRangeRequest = SemanticTokensRangeRequest = {})); + +var SemanticTokensRefreshRequest; + +(function(SemanticTokensRefreshRequest) { + SemanticTokensRefreshRequest.method = `workspace/semanticTokens/refresh`; + SemanticTokensRefreshRequest.messageDirection = messages_1$a.MessageDirection.serverToClient; + SemanticTokensRefreshRequest.type = new messages_1$a.ProtocolRequestType0(SemanticTokensRefreshRequest.method); +})(SemanticTokensRefreshRequest || (protocol_semanticTokens.SemanticTokensRefreshRequest = SemanticTokensRefreshRequest = {})); + +var protocol_showDocument = {}; + +Object.defineProperty(protocol_showDocument, '__esModule', { + value: true +}); + +protocol_showDocument.ShowDocumentRequest = void 0; + +const messages_1$9 = messages; + +var ShowDocumentRequest; + +(function(ShowDocumentRequest) { + ShowDocumentRequest.method = 'window/showDocument'; + ShowDocumentRequest.messageDirection = messages_1$9.MessageDirection.serverToClient; + ShowDocumentRequest.type = new messages_1$9.ProtocolRequestType(ShowDocumentRequest.method); +})(ShowDocumentRequest || (protocol_showDocument.ShowDocumentRequest = ShowDocumentRequest = {})); + +var protocol_linkedEditingRange = {}; + +Object.defineProperty(protocol_linkedEditingRange, '__esModule', { + value: true +}); + +protocol_linkedEditingRange.LinkedEditingRangeRequest = void 0; + +const messages_1$8 = messages; + +var LinkedEditingRangeRequest; + +(function(LinkedEditingRangeRequest) { + LinkedEditingRangeRequest.method = 'textDocument/linkedEditingRange'; + LinkedEditingRangeRequest.messageDirection = messages_1$8.MessageDirection.clientToServer; + LinkedEditingRangeRequest.type = new messages_1$8.ProtocolRequestType(LinkedEditingRangeRequest.method); +})(LinkedEditingRangeRequest || (protocol_linkedEditingRange.LinkedEditingRangeRequest = LinkedEditingRangeRequest = {})); + +var protocol_fileOperations = {}; + +Object.defineProperty(protocol_fileOperations, '__esModule', { + value: true +}); + +protocol_fileOperations.WillDeleteFilesRequest = protocol_fileOperations.DidDeleteFilesNotification = protocol_fileOperations.DidRenameFilesNotification = protocol_fileOperations.WillRenameFilesRequest = protocol_fileOperations.DidCreateFilesNotification = protocol_fileOperations.WillCreateFilesRequest = protocol_fileOperations.FileOperationPatternKind = void 0; + +const messages_1$7 = messages; + +var FileOperationPatternKind; + +(function(FileOperationPatternKind) { + FileOperationPatternKind.file = 'file'; + FileOperationPatternKind.folder = 'folder'; +})(FileOperationPatternKind || (protocol_fileOperations.FileOperationPatternKind = FileOperationPatternKind = {})); + +var WillCreateFilesRequest; + +(function(WillCreateFilesRequest) { + WillCreateFilesRequest.method = 'workspace/willCreateFiles'; + WillCreateFilesRequest.messageDirection = messages_1$7.MessageDirection.clientToServer; + WillCreateFilesRequest.type = new messages_1$7.ProtocolRequestType(WillCreateFilesRequest.method); +})(WillCreateFilesRequest || (protocol_fileOperations.WillCreateFilesRequest = WillCreateFilesRequest = {})); + +var DidCreateFilesNotification; + +(function(DidCreateFilesNotification) { + DidCreateFilesNotification.method = 'workspace/didCreateFiles'; + DidCreateFilesNotification.messageDirection = messages_1$7.MessageDirection.clientToServer; + DidCreateFilesNotification.type = new messages_1$7.ProtocolNotificationType(DidCreateFilesNotification.method); +})(DidCreateFilesNotification || (protocol_fileOperations.DidCreateFilesNotification = DidCreateFilesNotification = {})); + +var WillRenameFilesRequest; + +(function(WillRenameFilesRequest) { + WillRenameFilesRequest.method = 'workspace/willRenameFiles'; + WillRenameFilesRequest.messageDirection = messages_1$7.MessageDirection.clientToServer; + WillRenameFilesRequest.type = new messages_1$7.ProtocolRequestType(WillRenameFilesRequest.method); +})(WillRenameFilesRequest || (protocol_fileOperations.WillRenameFilesRequest = WillRenameFilesRequest = {})); + +var DidRenameFilesNotification; + +(function(DidRenameFilesNotification) { + DidRenameFilesNotification.method = 'workspace/didRenameFiles'; + DidRenameFilesNotification.messageDirection = messages_1$7.MessageDirection.clientToServer; + DidRenameFilesNotification.type = new messages_1$7.ProtocolNotificationType(DidRenameFilesNotification.method); +})(DidRenameFilesNotification || (protocol_fileOperations.DidRenameFilesNotification = DidRenameFilesNotification = {})); + +var DidDeleteFilesNotification; + +(function(DidDeleteFilesNotification) { + DidDeleteFilesNotification.method = 'workspace/didDeleteFiles'; + DidDeleteFilesNotification.messageDirection = messages_1$7.MessageDirection.clientToServer; + DidDeleteFilesNotification.type = new messages_1$7.ProtocolNotificationType(DidDeleteFilesNotification.method); +})(DidDeleteFilesNotification || (protocol_fileOperations.DidDeleteFilesNotification = DidDeleteFilesNotification = {})); + +var WillDeleteFilesRequest; + +(function(WillDeleteFilesRequest) { + WillDeleteFilesRequest.method = 'workspace/willDeleteFiles'; + WillDeleteFilesRequest.messageDirection = messages_1$7.MessageDirection.clientToServer; + WillDeleteFilesRequest.type = new messages_1$7.ProtocolRequestType(WillDeleteFilesRequest.method); +})(WillDeleteFilesRequest || (protocol_fileOperations.WillDeleteFilesRequest = WillDeleteFilesRequest = {})); + +var protocol_moniker = {}; + +Object.defineProperty(protocol_moniker, '__esModule', { + value: true +}); + +protocol_moniker.MonikerRequest = protocol_moniker.MonikerKind = protocol_moniker.UniquenessLevel = void 0; + +const messages_1$6 = messages; + +var UniquenessLevel; + +(function(UniquenessLevel) { + UniquenessLevel.document = 'document'; + UniquenessLevel.project = 'project'; + UniquenessLevel.group = 'group'; + UniquenessLevel.scheme = 'scheme'; + UniquenessLevel.global = 'global'; +})(UniquenessLevel || (protocol_moniker.UniquenessLevel = UniquenessLevel = {})); + +var MonikerKind; + +(function(MonikerKind) { + MonikerKind.$import = 'import'; + MonikerKind.$export = 'export'; + MonikerKind.local = 'local'; +})(MonikerKind || (protocol_moniker.MonikerKind = MonikerKind = {})); + +var MonikerRequest; + +(function(MonikerRequest) { + MonikerRequest.method = 'textDocument/moniker'; + MonikerRequest.messageDirection = messages_1$6.MessageDirection.clientToServer; + MonikerRequest.type = new messages_1$6.ProtocolRequestType(MonikerRequest.method); +})(MonikerRequest || (protocol_moniker.MonikerRequest = MonikerRequest = {})); + +var protocol_typeHierarchy = {}; + +Object.defineProperty(protocol_typeHierarchy, '__esModule', { + value: true +}); + +protocol_typeHierarchy.TypeHierarchySubtypesRequest = protocol_typeHierarchy.TypeHierarchySupertypesRequest = protocol_typeHierarchy.TypeHierarchyPrepareRequest = void 0; + +const messages_1$5 = messages; + +var TypeHierarchyPrepareRequest; + +(function(TypeHierarchyPrepareRequest) { + TypeHierarchyPrepareRequest.method = 'textDocument/prepareTypeHierarchy'; + TypeHierarchyPrepareRequest.messageDirection = messages_1$5.MessageDirection.clientToServer; + TypeHierarchyPrepareRequest.type = new messages_1$5.ProtocolRequestType(TypeHierarchyPrepareRequest.method); +})(TypeHierarchyPrepareRequest || (protocol_typeHierarchy.TypeHierarchyPrepareRequest = TypeHierarchyPrepareRequest = {})); + +var TypeHierarchySupertypesRequest; + +(function(TypeHierarchySupertypesRequest) { + TypeHierarchySupertypesRequest.method = 'typeHierarchy/supertypes'; + TypeHierarchySupertypesRequest.messageDirection = messages_1$5.MessageDirection.clientToServer; + TypeHierarchySupertypesRequest.type = new messages_1$5.ProtocolRequestType(TypeHierarchySupertypesRequest.method); +})(TypeHierarchySupertypesRequest || (protocol_typeHierarchy.TypeHierarchySupertypesRequest = TypeHierarchySupertypesRequest = {})); + +var TypeHierarchySubtypesRequest; + +(function(TypeHierarchySubtypesRequest) { + TypeHierarchySubtypesRequest.method = 'typeHierarchy/subtypes'; + TypeHierarchySubtypesRequest.messageDirection = messages_1$5.MessageDirection.clientToServer; + TypeHierarchySubtypesRequest.type = new messages_1$5.ProtocolRequestType(TypeHierarchySubtypesRequest.method); +})(TypeHierarchySubtypesRequest || (protocol_typeHierarchy.TypeHierarchySubtypesRequest = TypeHierarchySubtypesRequest = {})); + +var protocol_inlineValue = {}; + +Object.defineProperty(protocol_inlineValue, '__esModule', { + value: true +}); + +protocol_inlineValue.InlineValueRefreshRequest = protocol_inlineValue.InlineValueRequest = void 0; + +const messages_1$4 = messages; + +var InlineValueRequest; + +(function(InlineValueRequest) { + InlineValueRequest.method = 'textDocument/inlineValue'; + InlineValueRequest.messageDirection = messages_1$4.MessageDirection.clientToServer; + InlineValueRequest.type = new messages_1$4.ProtocolRequestType(InlineValueRequest.method); +})(InlineValueRequest || (protocol_inlineValue.InlineValueRequest = InlineValueRequest = {})); + +var InlineValueRefreshRequest; + +(function(InlineValueRefreshRequest) { + InlineValueRefreshRequest.method = `workspace/inlineValue/refresh`; + InlineValueRefreshRequest.messageDirection = messages_1$4.MessageDirection.serverToClient; + InlineValueRefreshRequest.type = new messages_1$4.ProtocolRequestType0(InlineValueRefreshRequest.method); +})(InlineValueRefreshRequest || (protocol_inlineValue.InlineValueRefreshRequest = InlineValueRefreshRequest = {})); + +var protocol_inlayHint = {}; + +Object.defineProperty(protocol_inlayHint, '__esModule', { + value: true +}); + +protocol_inlayHint.InlayHintRefreshRequest = protocol_inlayHint.InlayHintResolveRequest = protocol_inlayHint.InlayHintRequest = void 0; + +const messages_1$3 = messages; + +var InlayHintRequest; + +(function(InlayHintRequest) { + InlayHintRequest.method = 'textDocument/inlayHint'; + InlayHintRequest.messageDirection = messages_1$3.MessageDirection.clientToServer; + InlayHintRequest.type = new messages_1$3.ProtocolRequestType(InlayHintRequest.method); +})(InlayHintRequest || (protocol_inlayHint.InlayHintRequest = InlayHintRequest = {})); + +var InlayHintResolveRequest; + +(function(InlayHintResolveRequest) { + InlayHintResolveRequest.method = 'inlayHint/resolve'; + InlayHintResolveRequest.messageDirection = messages_1$3.MessageDirection.clientToServer; + InlayHintResolveRequest.type = new messages_1$3.ProtocolRequestType(InlayHintResolveRequest.method); +})(InlayHintResolveRequest || (protocol_inlayHint.InlayHintResolveRequest = InlayHintResolveRequest = {})); + +var InlayHintRefreshRequest; + +(function(InlayHintRefreshRequest) { + InlayHintRefreshRequest.method = `workspace/inlayHint/refresh`; + InlayHintRefreshRequest.messageDirection = messages_1$3.MessageDirection.serverToClient; + InlayHintRefreshRequest.type = new messages_1$3.ProtocolRequestType0(InlayHintRefreshRequest.method); +})(InlayHintRefreshRequest || (protocol_inlayHint.InlayHintRefreshRequest = InlayHintRefreshRequest = {})); + +var protocol_diagnostic = {}; + +Object.defineProperty(protocol_diagnostic, '__esModule', { + value: true +}); + +protocol_diagnostic.DiagnosticRefreshRequest = protocol_diagnostic.WorkspaceDiagnosticRequest = protocol_diagnostic.DocumentDiagnosticRequest = protocol_diagnostic.DocumentDiagnosticReportKind = protocol_diagnostic.DiagnosticServerCancellationData = void 0; + +const vscode_jsonrpc_1$1 = main$1; + +const Is$3 = is; + +const messages_1$2 = messages; + +var DiagnosticServerCancellationData; + +(function(DiagnosticServerCancellationData) { + function is(value) { + const candidate = value; + return candidate && Is$3.boolean(candidate.retriggerRequest); + } + DiagnosticServerCancellationData.is = is; +})(DiagnosticServerCancellationData || (protocol_diagnostic.DiagnosticServerCancellationData = DiagnosticServerCancellationData = {})); + +var DocumentDiagnosticReportKind; + +(function(DocumentDiagnosticReportKind) { + DocumentDiagnosticReportKind.Full = 'full'; + DocumentDiagnosticReportKind.Unchanged = 'unchanged'; +})(DocumentDiagnosticReportKind || (protocol_diagnostic.DocumentDiagnosticReportKind = DocumentDiagnosticReportKind = {})); + +var DocumentDiagnosticRequest; + +(function(DocumentDiagnosticRequest) { + DocumentDiagnosticRequest.method = 'textDocument/diagnostic'; + DocumentDiagnosticRequest.messageDirection = messages_1$2.MessageDirection.clientToServer; + DocumentDiagnosticRequest.type = new messages_1$2.ProtocolRequestType(DocumentDiagnosticRequest.method); + DocumentDiagnosticRequest.partialResult = new vscode_jsonrpc_1$1.ProgressType; +})(DocumentDiagnosticRequest || (protocol_diagnostic.DocumentDiagnosticRequest = DocumentDiagnosticRequest = {})); + +var WorkspaceDiagnosticRequest; + +(function(WorkspaceDiagnosticRequest) { + WorkspaceDiagnosticRequest.method = 'workspace/diagnostic'; + WorkspaceDiagnosticRequest.messageDirection = messages_1$2.MessageDirection.clientToServer; + WorkspaceDiagnosticRequest.type = new messages_1$2.ProtocolRequestType(WorkspaceDiagnosticRequest.method); + WorkspaceDiagnosticRequest.partialResult = new vscode_jsonrpc_1$1.ProgressType; +})(WorkspaceDiagnosticRequest || (protocol_diagnostic.WorkspaceDiagnosticRequest = WorkspaceDiagnosticRequest = {})); + +var DiagnosticRefreshRequest; + +(function(DiagnosticRefreshRequest) { + DiagnosticRefreshRequest.method = `workspace/diagnostic/refresh`; + DiagnosticRefreshRequest.messageDirection = messages_1$2.MessageDirection.serverToClient; + DiagnosticRefreshRequest.type = new messages_1$2.ProtocolRequestType0(DiagnosticRefreshRequest.method); +})(DiagnosticRefreshRequest || (protocol_diagnostic.DiagnosticRefreshRequest = DiagnosticRefreshRequest = {})); + +var protocol_notebook = {}; + +Object.defineProperty(protocol_notebook, '__esModule', { + value: true +}); + +protocol_notebook.DidCloseNotebookDocumentNotification = protocol_notebook.DidSaveNotebookDocumentNotification = protocol_notebook.DidChangeNotebookDocumentNotification = protocol_notebook.NotebookCellArrayChange = protocol_notebook.DidOpenNotebookDocumentNotification = protocol_notebook.NotebookDocumentSyncRegistrationType = protocol_notebook.NotebookDocument = protocol_notebook.NotebookCell = protocol_notebook.ExecutionSummary = protocol_notebook.NotebookCellKind = void 0; + +const vscode_languageserver_types_1 = mainExports; + +const Is$2 = is; + +const messages_1$1 = messages; + +var NotebookCellKind; + +(function(NotebookCellKind) { + NotebookCellKind.Markup = 1; + NotebookCellKind.Code = 2; + function is(value) { + return value === 1 || value === 2; + } + NotebookCellKind.is = is; +})(NotebookCellKind || (protocol_notebook.NotebookCellKind = NotebookCellKind = {})); + +var ExecutionSummary; + +(function(ExecutionSummary) { + function create(executionOrder, success) { + const result = { + executionOrder: executionOrder + }; + if (success === true || success === false) { + result.success = success; + } + return result; + } + ExecutionSummary.create = create; + function is(value) { + const candidate = value; + return Is$2.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.executionOrder) && (candidate.success === undefined || Is$2.boolean(candidate.success)); + } + ExecutionSummary.is = is; + function equals(one, other) { + if (one === other) { + return true; + } + if (one === null || one === undefined || other === null || other === undefined) { + return false; + } + return one.executionOrder === other.executionOrder && one.success === other.success; + } + ExecutionSummary.equals = equals; +})(ExecutionSummary || (protocol_notebook.ExecutionSummary = ExecutionSummary = {})); + +var NotebookCell; + +(function(NotebookCell) { + function create(kind, document) { + return { + kind: kind, + document: document + }; + } + NotebookCell.create = create; + function is(value) { + const candidate = value; + return Is$2.objectLiteral(candidate) && NotebookCellKind.is(candidate.kind) && vscode_languageserver_types_1.DocumentUri.is(candidate.document) && (candidate.metadata === undefined || Is$2.objectLiteral(candidate.metadata)); + } + NotebookCell.is = is; + function diff(one, two) { + const result = new Set; + if (one.document !== two.document) { + result.add('document'); + } + if (one.kind !== two.kind) { + result.add('kind'); + } + if (one.executionSummary !== two.executionSummary) { + result.add('executionSummary'); + } + if ((one.metadata !== undefined || two.metadata !== undefined) && !equalsMetadata(one.metadata, two.metadata)) { + result.add('metadata'); + } + if ((one.executionSummary !== undefined || two.executionSummary !== undefined) && !ExecutionSummary.equals(one.executionSummary, two.executionSummary)) { + result.add('executionSummary'); + } + return result; + } + NotebookCell.diff = diff; + function equalsMetadata(one, other) { + if (one === other) { + return true; + } + if (one === null || one === undefined || other === null || other === undefined) { + return false; + } + if (typeof one !== typeof other) { + return false; + } + if (typeof one !== 'object') { + return false; + } + const oneArray = Array.isArray(one); + const otherArray = Array.isArray(other); + if (oneArray !== otherArray) { + return false; + } + if (oneArray && otherArray) { + if (one.length !== other.length) { + return false; + } + for (let i = 0; i < one.length; i++) { + if (!equalsMetadata(one[i], other[i])) { + return false; + } + } + } + if (Is$2.objectLiteral(one) && Is$2.objectLiteral(other)) { + const oneKeys = Object.keys(one); + const otherKeys = Object.keys(other); + if (oneKeys.length !== otherKeys.length) { + return false; + } + oneKeys.sort(); + otherKeys.sort(); + if (!equalsMetadata(oneKeys, otherKeys)) { + return false; + } + for (let i = 0; i < oneKeys.length; i++) { + const prop = oneKeys[i]; + if (!equalsMetadata(one[prop], other[prop])) { + return false; + } + } + } + return true; + } +})(NotebookCell || (protocol_notebook.NotebookCell = NotebookCell = {})); + +var NotebookDocument; + +(function(NotebookDocument) { + function create(uri, notebookType, version, cells) { + return { + uri: uri, + notebookType: notebookType, + version: version, + cells: cells + }; + } + NotebookDocument.create = create; + function is(value) { + const candidate = value; + return Is$2.objectLiteral(candidate) && Is$2.string(candidate.uri) && vscode_languageserver_types_1.integer.is(candidate.version) && Is$2.typedArray(candidate.cells, NotebookCell.is); + } + NotebookDocument.is = is; +})(NotebookDocument || (protocol_notebook.NotebookDocument = NotebookDocument = {})); + +var NotebookDocumentSyncRegistrationType; + +(function(NotebookDocumentSyncRegistrationType) { + NotebookDocumentSyncRegistrationType.method = 'notebookDocument/sync'; + NotebookDocumentSyncRegistrationType.messageDirection = messages_1$1.MessageDirection.clientToServer; + NotebookDocumentSyncRegistrationType.type = new messages_1$1.RegistrationType(NotebookDocumentSyncRegistrationType.method); +})(NotebookDocumentSyncRegistrationType || (protocol_notebook.NotebookDocumentSyncRegistrationType = NotebookDocumentSyncRegistrationType = {})); + +var DidOpenNotebookDocumentNotification; + +(function(DidOpenNotebookDocumentNotification) { + DidOpenNotebookDocumentNotification.method = 'notebookDocument/didOpen'; + DidOpenNotebookDocumentNotification.messageDirection = messages_1$1.MessageDirection.clientToServer; + DidOpenNotebookDocumentNotification.type = new messages_1$1.ProtocolNotificationType(DidOpenNotebookDocumentNotification.method); + DidOpenNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method; +})(DidOpenNotebookDocumentNotification || (protocol_notebook.DidOpenNotebookDocumentNotification = DidOpenNotebookDocumentNotification = {})); + +var NotebookCellArrayChange; + +(function(NotebookCellArrayChange) { + function is(value) { + const candidate = value; + return Is$2.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.start) && vscode_languageserver_types_1.uinteger.is(candidate.deleteCount) && (candidate.cells === undefined || Is$2.typedArray(candidate.cells, NotebookCell.is)); + } + NotebookCellArrayChange.is = is; + function create(start, deleteCount, cells) { + const result = { + start: start, + deleteCount: deleteCount + }; + if (cells !== undefined) { + result.cells = cells; + } + return result; + } + NotebookCellArrayChange.create = create; +})(NotebookCellArrayChange || (protocol_notebook.NotebookCellArrayChange = NotebookCellArrayChange = {})); + +var DidChangeNotebookDocumentNotification; + +(function(DidChangeNotebookDocumentNotification) { + DidChangeNotebookDocumentNotification.method = 'notebookDocument/didChange'; + DidChangeNotebookDocumentNotification.messageDirection = messages_1$1.MessageDirection.clientToServer; + DidChangeNotebookDocumentNotification.type = new messages_1$1.ProtocolNotificationType(DidChangeNotebookDocumentNotification.method); + DidChangeNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method; +})(DidChangeNotebookDocumentNotification || (protocol_notebook.DidChangeNotebookDocumentNotification = DidChangeNotebookDocumentNotification = {})); + +var DidSaveNotebookDocumentNotification; + +(function(DidSaveNotebookDocumentNotification) { + DidSaveNotebookDocumentNotification.method = 'notebookDocument/didSave'; + DidSaveNotebookDocumentNotification.messageDirection = messages_1$1.MessageDirection.clientToServer; + DidSaveNotebookDocumentNotification.type = new messages_1$1.ProtocolNotificationType(DidSaveNotebookDocumentNotification.method); + DidSaveNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method; +})(DidSaveNotebookDocumentNotification || (protocol_notebook.DidSaveNotebookDocumentNotification = DidSaveNotebookDocumentNotification = {})); + +var DidCloseNotebookDocumentNotification; + +(function(DidCloseNotebookDocumentNotification) { + DidCloseNotebookDocumentNotification.method = 'notebookDocument/didClose'; + DidCloseNotebookDocumentNotification.messageDirection = messages_1$1.MessageDirection.clientToServer; + DidCloseNotebookDocumentNotification.type = new messages_1$1.ProtocolNotificationType(DidCloseNotebookDocumentNotification.method); + DidCloseNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method; +})(DidCloseNotebookDocumentNotification || (protocol_notebook.DidCloseNotebookDocumentNotification = DidCloseNotebookDocumentNotification = {})); + +var protocol_inlineCompletion = {}; + +Object.defineProperty(protocol_inlineCompletion, '__esModule', { + value: true +}); + +protocol_inlineCompletion.InlineCompletionRequest = void 0; + +const messages_1 = messages; + +var InlineCompletionRequest; + +(function(InlineCompletionRequest) { + InlineCompletionRequest.method = 'textDocument/inlineCompletion'; + InlineCompletionRequest.messageDirection = messages_1.MessageDirection.clientToServer; + InlineCompletionRequest.type = new messages_1.ProtocolRequestType(InlineCompletionRequest.method); +})(InlineCompletionRequest || (protocol_inlineCompletion.InlineCompletionRequest = InlineCompletionRequest = {})); + +(function(exports) { + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.WorkspaceSymbolRequest = exports.CodeActionResolveRequest = exports.CodeActionRequest = exports.DocumentSymbolRequest = exports.DocumentHighlightRequest = exports.ReferencesRequest = exports.DefinitionRequest = exports.SignatureHelpRequest = exports.SignatureHelpTriggerKind = exports.HoverRequest = exports.CompletionResolveRequest = exports.CompletionRequest = exports.CompletionTriggerKind = exports.PublishDiagnosticsNotification = exports.WatchKind = exports.RelativePattern = exports.FileChangeType = exports.DidChangeWatchedFilesNotification = exports.WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentNotification = exports.TextDocumentSaveReason = exports.DidSaveTextDocumentNotification = exports.DidCloseTextDocumentNotification = exports.DidChangeTextDocumentNotification = exports.TextDocumentContentChangeEvent = exports.DidOpenTextDocumentNotification = exports.TextDocumentSyncKind = exports.TelemetryEventNotification = exports.LogMessageNotification = exports.ShowMessageRequest = exports.ShowMessageNotification = exports.MessageType = exports.DidChangeConfigurationNotification = exports.ExitNotification = exports.ShutdownRequest = exports.InitializedNotification = exports.InitializeErrorCodes = exports.InitializeRequest = exports.WorkDoneProgressOptions = exports.TextDocumentRegistrationOptions = exports.StaticRegistrationOptions = exports.PositionEncodingKind = exports.FailureHandlingKind = exports.ResourceOperationKind = exports.UnregistrationRequest = exports.RegistrationRequest = exports.DocumentSelector = exports.NotebookCellTextDocumentFilter = exports.NotebookDocumentFilter = exports.TextDocumentFilter = void 0; + exports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = exports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.WillRenameFilesRequest = exports.DidRenameFilesNotification = exports.WillCreateFilesRequest = exports.DidCreateFilesNotification = exports.FileOperationPatternKind = exports.LinkedEditingRangeRequest = exports.ShowDocumentRequest = exports.SemanticTokensRegistrationType = exports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.TokenFormat = exports.CallHierarchyPrepareRequest = exports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = exports.SelectionRangeRequest = exports.DeclarationRequest = exports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = exports.ColorPresentationRequest = exports.DocumentColorRequest = exports.ConfigurationRequest = exports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = exports.TypeDefinitionRequest = exports.ImplementationRequest = exports.ApplyWorkspaceEditRequest = exports.ExecuteCommandRequest = exports.PrepareRenameRequest = exports.RenameRequest = exports.PrepareSupportDefaultBehavior = exports.DocumentOnTypeFormattingRequest = exports.DocumentRangesFormattingRequest = exports.DocumentRangeFormattingRequest = exports.DocumentFormattingRequest = exports.DocumentLinkResolveRequest = exports.DocumentLinkRequest = exports.CodeLensRefreshRequest = exports.CodeLensResolveRequest = exports.CodeLensRequest = exports.WorkspaceSymbolResolveRequest = void 0; + exports.InlineCompletionRequest = exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = exports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = exports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = exports.InlineValueRefreshRequest = exports.InlineValueRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchySubtypesRequest = exports.TypeHierarchyPrepareRequest = void 0; + const messages_1 = messages; + const vscode_languageserver_types_1 = mainExports; + const Is = is; + const protocol_implementation_1 = protocol_implementation; + Object.defineProperty(exports, 'ImplementationRequest', { + enumerable: true, + get: function() { + return protocol_implementation_1.ImplementationRequest; + } + }); + const protocol_typeDefinition_1 = protocol_typeDefinition; + Object.defineProperty(exports, 'TypeDefinitionRequest', { + enumerable: true, + get: function() { + return protocol_typeDefinition_1.TypeDefinitionRequest; + } + }); + const protocol_workspaceFolder_1 = protocol_workspaceFolder; + Object.defineProperty(exports, 'WorkspaceFoldersRequest', { + enumerable: true, + get: function() { + return protocol_workspaceFolder_1.WorkspaceFoldersRequest; + } + }); + Object.defineProperty(exports, 'DidChangeWorkspaceFoldersNotification', { + enumerable: true, + get: function() { + return protocol_workspaceFolder_1.DidChangeWorkspaceFoldersNotification; + } + }); + const protocol_configuration_1 = protocol_configuration; + Object.defineProperty(exports, 'ConfigurationRequest', { + enumerable: true, + get: function() { + return protocol_configuration_1.ConfigurationRequest; + } + }); + const protocol_colorProvider_1 = protocol_colorProvider; + Object.defineProperty(exports, 'DocumentColorRequest', { + enumerable: true, + get: function() { + return protocol_colorProvider_1.DocumentColorRequest; + } + }); + Object.defineProperty(exports, 'ColorPresentationRequest', { + enumerable: true, + get: function() { + return protocol_colorProvider_1.ColorPresentationRequest; + } + }); + const protocol_foldingRange_1 = protocol_foldingRange; + Object.defineProperty(exports, 'FoldingRangeRequest', { + enumerable: true, + get: function() { + return protocol_foldingRange_1.FoldingRangeRequest; + } + }); + Object.defineProperty(exports, 'FoldingRangeRefreshRequest', { + enumerable: true, + get: function() { + return protocol_foldingRange_1.FoldingRangeRefreshRequest; + } + }); + const protocol_declaration_1 = protocol_declaration; + Object.defineProperty(exports, 'DeclarationRequest', { + enumerable: true, + get: function() { + return protocol_declaration_1.DeclarationRequest; + } + }); + const protocol_selectionRange_1 = protocol_selectionRange; + Object.defineProperty(exports, 'SelectionRangeRequest', { + enumerable: true, + get: function() { + return protocol_selectionRange_1.SelectionRangeRequest; + } + }); + const protocol_progress_1 = protocol_progress; + Object.defineProperty(exports, 'WorkDoneProgress', { + enumerable: true, + get: function() { + return protocol_progress_1.WorkDoneProgress; + } + }); + Object.defineProperty(exports, 'WorkDoneProgressCreateRequest', { + enumerable: true, + get: function() { + return protocol_progress_1.WorkDoneProgressCreateRequest; + } + }); + Object.defineProperty(exports, 'WorkDoneProgressCancelNotification', { + enumerable: true, + get: function() { + return protocol_progress_1.WorkDoneProgressCancelNotification; + } + }); + const protocol_callHierarchy_1 = protocol_callHierarchy; + Object.defineProperty(exports, 'CallHierarchyIncomingCallsRequest', { + enumerable: true, + get: function() { + return protocol_callHierarchy_1.CallHierarchyIncomingCallsRequest; + } + }); + Object.defineProperty(exports, 'CallHierarchyOutgoingCallsRequest', { + enumerable: true, + get: function() { + return protocol_callHierarchy_1.CallHierarchyOutgoingCallsRequest; + } + }); + Object.defineProperty(exports, 'CallHierarchyPrepareRequest', { + enumerable: true, + get: function() { + return protocol_callHierarchy_1.CallHierarchyPrepareRequest; + } + }); + const protocol_semanticTokens_1 = protocol_semanticTokens; + Object.defineProperty(exports, 'TokenFormat', { + enumerable: true, + get: function() { + return protocol_semanticTokens_1.TokenFormat; + } + }); + Object.defineProperty(exports, 'SemanticTokensRequest', { + enumerable: true, + get: function() { + return protocol_semanticTokens_1.SemanticTokensRequest; + } + }); + Object.defineProperty(exports, 'SemanticTokensDeltaRequest', { + enumerable: true, + get: function() { + return protocol_semanticTokens_1.SemanticTokensDeltaRequest; + } + }); + Object.defineProperty(exports, 'SemanticTokensRangeRequest', { + enumerable: true, + get: function() { + return protocol_semanticTokens_1.SemanticTokensRangeRequest; + } + }); + Object.defineProperty(exports, 'SemanticTokensRefreshRequest', { + enumerable: true, + get: function() { + return protocol_semanticTokens_1.SemanticTokensRefreshRequest; + } + }); + Object.defineProperty(exports, 'SemanticTokensRegistrationType', { + enumerable: true, + get: function() { + return protocol_semanticTokens_1.SemanticTokensRegistrationType; + } + }); + const protocol_showDocument_1 = protocol_showDocument; + Object.defineProperty(exports, 'ShowDocumentRequest', { + enumerable: true, + get: function() { + return protocol_showDocument_1.ShowDocumentRequest; + } + }); + const protocol_linkedEditingRange_1 = protocol_linkedEditingRange; + Object.defineProperty(exports, 'LinkedEditingRangeRequest', { + enumerable: true, + get: function() { + return protocol_linkedEditingRange_1.LinkedEditingRangeRequest; + } + }); + const protocol_fileOperations_1 = protocol_fileOperations; + Object.defineProperty(exports, 'FileOperationPatternKind', { + enumerable: true, + get: function() { + return protocol_fileOperations_1.FileOperationPatternKind; + } + }); + Object.defineProperty(exports, 'DidCreateFilesNotification', { + enumerable: true, + get: function() { + return protocol_fileOperations_1.DidCreateFilesNotification; + } + }); + Object.defineProperty(exports, 'WillCreateFilesRequest', { + enumerable: true, + get: function() { + return protocol_fileOperations_1.WillCreateFilesRequest; + } + }); + Object.defineProperty(exports, 'DidRenameFilesNotification', { + enumerable: true, + get: function() { + return protocol_fileOperations_1.DidRenameFilesNotification; + } + }); + Object.defineProperty(exports, 'WillRenameFilesRequest', { + enumerable: true, + get: function() { + return protocol_fileOperations_1.WillRenameFilesRequest; + } + }); + Object.defineProperty(exports, 'DidDeleteFilesNotification', { + enumerable: true, + get: function() { + return protocol_fileOperations_1.DidDeleteFilesNotification; + } + }); + Object.defineProperty(exports, 'WillDeleteFilesRequest', { + enumerable: true, + get: function() { + return protocol_fileOperations_1.WillDeleteFilesRequest; + } + }); + const protocol_moniker_1 = protocol_moniker; + Object.defineProperty(exports, 'UniquenessLevel', { + enumerable: true, + get: function() { + return protocol_moniker_1.UniquenessLevel; + } + }); + Object.defineProperty(exports, 'MonikerKind', { + enumerable: true, + get: function() { + return protocol_moniker_1.MonikerKind; + } + }); + Object.defineProperty(exports, 'MonikerRequest', { + enumerable: true, + get: function() { + return protocol_moniker_1.MonikerRequest; + } + }); + const protocol_typeHierarchy_1 = protocol_typeHierarchy; + Object.defineProperty(exports, 'TypeHierarchyPrepareRequest', { + enumerable: true, + get: function() { + return protocol_typeHierarchy_1.TypeHierarchyPrepareRequest; + } + }); + Object.defineProperty(exports, 'TypeHierarchySubtypesRequest', { + enumerable: true, + get: function() { + return protocol_typeHierarchy_1.TypeHierarchySubtypesRequest; + } + }); + Object.defineProperty(exports, 'TypeHierarchySupertypesRequest', { + enumerable: true, + get: function() { + return protocol_typeHierarchy_1.TypeHierarchySupertypesRequest; + } + }); + const protocol_inlineValue_1 = protocol_inlineValue; + Object.defineProperty(exports, 'InlineValueRequest', { + enumerable: true, + get: function() { + return protocol_inlineValue_1.InlineValueRequest; + } + }); + Object.defineProperty(exports, 'InlineValueRefreshRequest', { + enumerable: true, + get: function() { + return protocol_inlineValue_1.InlineValueRefreshRequest; + } + }); + const protocol_inlayHint_1 = protocol_inlayHint; + Object.defineProperty(exports, 'InlayHintRequest', { + enumerable: true, + get: function() { + return protocol_inlayHint_1.InlayHintRequest; + } + }); + Object.defineProperty(exports, 'InlayHintResolveRequest', { + enumerable: true, + get: function() { + return protocol_inlayHint_1.InlayHintResolveRequest; + } + }); + Object.defineProperty(exports, 'InlayHintRefreshRequest', { + enumerable: true, + get: function() { + return protocol_inlayHint_1.InlayHintRefreshRequest; + } + }); + const protocol_diagnostic_1 = protocol_diagnostic; + Object.defineProperty(exports, 'DiagnosticServerCancellationData', { + enumerable: true, + get: function() { + return protocol_diagnostic_1.DiagnosticServerCancellationData; + } + }); + Object.defineProperty(exports, 'DocumentDiagnosticReportKind', { + enumerable: true, + get: function() { + return protocol_diagnostic_1.DocumentDiagnosticReportKind; + } + }); + Object.defineProperty(exports, 'DocumentDiagnosticRequest', { + enumerable: true, + get: function() { + return protocol_diagnostic_1.DocumentDiagnosticRequest; + } + }); + Object.defineProperty(exports, 'WorkspaceDiagnosticRequest', { + enumerable: true, + get: function() { + return protocol_diagnostic_1.WorkspaceDiagnosticRequest; + } + }); + Object.defineProperty(exports, 'DiagnosticRefreshRequest', { + enumerable: true, + get: function() { + return protocol_diagnostic_1.DiagnosticRefreshRequest; + } + }); + const protocol_notebook_1 = protocol_notebook; + Object.defineProperty(exports, 'NotebookCellKind', { + enumerable: true, + get: function() { + return protocol_notebook_1.NotebookCellKind; + } + }); + Object.defineProperty(exports, 'ExecutionSummary', { + enumerable: true, + get: function() { + return protocol_notebook_1.ExecutionSummary; + } + }); + Object.defineProperty(exports, 'NotebookCell', { + enumerable: true, + get: function() { + return protocol_notebook_1.NotebookCell; + } + }); + Object.defineProperty(exports, 'NotebookDocument', { + enumerable: true, + get: function() { + return protocol_notebook_1.NotebookDocument; + } + }); + Object.defineProperty(exports, 'NotebookDocumentSyncRegistrationType', { + enumerable: true, + get: function() { + return protocol_notebook_1.NotebookDocumentSyncRegistrationType; + } + }); + Object.defineProperty(exports, 'DidOpenNotebookDocumentNotification', { + enumerable: true, + get: function() { + return protocol_notebook_1.DidOpenNotebookDocumentNotification; + } + }); + Object.defineProperty(exports, 'NotebookCellArrayChange', { + enumerable: true, + get: function() { + return protocol_notebook_1.NotebookCellArrayChange; + } + }); + Object.defineProperty(exports, 'DidChangeNotebookDocumentNotification', { + enumerable: true, + get: function() { + return protocol_notebook_1.DidChangeNotebookDocumentNotification; + } + }); + Object.defineProperty(exports, 'DidSaveNotebookDocumentNotification', { + enumerable: true, + get: function() { + return protocol_notebook_1.DidSaveNotebookDocumentNotification; + } + }); + Object.defineProperty(exports, 'DidCloseNotebookDocumentNotification', { + enumerable: true, + get: function() { + return protocol_notebook_1.DidCloseNotebookDocumentNotification; + } + }); + const protocol_inlineCompletion_1 = protocol_inlineCompletion; + Object.defineProperty(exports, 'InlineCompletionRequest', { + enumerable: true, + get: function() { + return protocol_inlineCompletion_1.InlineCompletionRequest; + } + }); + var TextDocumentFilter; + (function(TextDocumentFilter) { + function is(value) { + const candidate = value; + return Is.string(candidate) || (Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern)); + } + TextDocumentFilter.is = is; + })(TextDocumentFilter || (exports.TextDocumentFilter = TextDocumentFilter = {})); + var NotebookDocumentFilter; + (function(NotebookDocumentFilter) { + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && (Is.string(candidate.notebookType) || Is.string(candidate.scheme) || Is.string(candidate.pattern)); + } + NotebookDocumentFilter.is = is; + })(NotebookDocumentFilter || (exports.NotebookDocumentFilter = NotebookDocumentFilter = {})); + var NotebookCellTextDocumentFilter; + (function(NotebookCellTextDocumentFilter) { + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && (Is.string(candidate.notebook) || NotebookDocumentFilter.is(candidate.notebook)) && (candidate.language === undefined || Is.string(candidate.language)); + } + NotebookCellTextDocumentFilter.is = is; + })(NotebookCellTextDocumentFilter || (exports.NotebookCellTextDocumentFilter = NotebookCellTextDocumentFilter = {})); + var DocumentSelector; + (function(DocumentSelector) { + function is(value) { + if (!Array.isArray(value)) { + return false; + } + for (let elem of value) { + if (!Is.string(elem) && !TextDocumentFilter.is(elem) && !NotebookCellTextDocumentFilter.is(elem)) { + return false; + } + } + return true; + } + DocumentSelector.is = is; + })(DocumentSelector || (exports.DocumentSelector = DocumentSelector = {})); + var RegistrationRequest; + (function(RegistrationRequest) { + RegistrationRequest.method = 'client/registerCapability'; + RegistrationRequest.messageDirection = messages_1.MessageDirection.serverToClient; + RegistrationRequest.type = new messages_1.ProtocolRequestType(RegistrationRequest.method); + })(RegistrationRequest || (exports.RegistrationRequest = RegistrationRequest = {})); + var UnregistrationRequest; + (function(UnregistrationRequest) { + UnregistrationRequest.method = 'client/unregisterCapability'; + UnregistrationRequest.messageDirection = messages_1.MessageDirection.serverToClient; + UnregistrationRequest.type = new messages_1.ProtocolRequestType(UnregistrationRequest.method); + })(UnregistrationRequest || (exports.UnregistrationRequest = UnregistrationRequest = {})); + var ResourceOperationKind; + (function(ResourceOperationKind) { + ResourceOperationKind.Create = 'create'; + ResourceOperationKind.Rename = 'rename'; + ResourceOperationKind.Delete = 'delete'; + })(ResourceOperationKind || (exports.ResourceOperationKind = ResourceOperationKind = {})); + var FailureHandlingKind; + (function(FailureHandlingKind) { + FailureHandlingKind.Abort = 'abort'; + FailureHandlingKind.Transactional = 'transactional'; + FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional'; + FailureHandlingKind.Undo = 'undo'; + })(FailureHandlingKind || (exports.FailureHandlingKind = FailureHandlingKind = {})); + var PositionEncodingKind; + (function(PositionEncodingKind) { + PositionEncodingKind.UTF8 = 'utf-8'; + PositionEncodingKind.UTF16 = 'utf-16'; + PositionEncodingKind.UTF32 = 'utf-32'; + })(PositionEncodingKind || (exports.PositionEncodingKind = PositionEncodingKind = {})); + var StaticRegistrationOptions; + (function(StaticRegistrationOptions) { + function hasId(value) { + const candidate = value; + return candidate && Is.string(candidate.id) && candidate.id.length > 0; + } + StaticRegistrationOptions.hasId = hasId; + })(StaticRegistrationOptions || (exports.StaticRegistrationOptions = StaticRegistrationOptions = {})); + var TextDocumentRegistrationOptions; + (function(TextDocumentRegistrationOptions) { + function is(value) { + const candidate = value; + return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector)); + } + TextDocumentRegistrationOptions.is = is; + })(TextDocumentRegistrationOptions || (exports.TextDocumentRegistrationOptions = TextDocumentRegistrationOptions = {})); + var WorkDoneProgressOptions; + (function(WorkDoneProgressOptions) { + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && (candidate.workDoneProgress === undefined || Is.boolean(candidate.workDoneProgress)); + } + WorkDoneProgressOptions.is = is; + function hasWorkDoneProgress(value) { + const candidate = value; + return candidate && Is.boolean(candidate.workDoneProgress); + } + WorkDoneProgressOptions.hasWorkDoneProgress = hasWorkDoneProgress; + })(WorkDoneProgressOptions || (exports.WorkDoneProgressOptions = WorkDoneProgressOptions = {})); + var InitializeRequest; + (function(InitializeRequest) { + InitializeRequest.method = 'initialize'; + InitializeRequest.messageDirection = messages_1.MessageDirection.clientToServer; + InitializeRequest.type = new messages_1.ProtocolRequestType(InitializeRequest.method); + })(InitializeRequest || (exports.InitializeRequest = InitializeRequest = {})); + var InitializeErrorCodes; + (function(InitializeErrorCodes) { + InitializeErrorCodes.unknownProtocolVersion = 1; + })(InitializeErrorCodes || (exports.InitializeErrorCodes = InitializeErrorCodes = {})); + var InitializedNotification; + (function(InitializedNotification) { + InitializedNotification.method = 'initialized'; + InitializedNotification.messageDirection = messages_1.MessageDirection.clientToServer; + InitializedNotification.type = new messages_1.ProtocolNotificationType(InitializedNotification.method); + })(InitializedNotification || (exports.InitializedNotification = InitializedNotification = {})); + var ShutdownRequest; + (function(ShutdownRequest) { + ShutdownRequest.method = 'shutdown'; + ShutdownRequest.messageDirection = messages_1.MessageDirection.clientToServer; + ShutdownRequest.type = new messages_1.ProtocolRequestType0(ShutdownRequest.method); + })(ShutdownRequest || (exports.ShutdownRequest = ShutdownRequest = {})); + var ExitNotification; + (function(ExitNotification) { + ExitNotification.method = 'exit'; + ExitNotification.messageDirection = messages_1.MessageDirection.clientToServer; + ExitNotification.type = new messages_1.ProtocolNotificationType0(ExitNotification.method); + })(ExitNotification || (exports.ExitNotification = ExitNotification = {})); + var DidChangeConfigurationNotification; + (function(DidChangeConfigurationNotification) { + DidChangeConfigurationNotification.method = 'workspace/didChangeConfiguration'; + DidChangeConfigurationNotification.messageDirection = messages_1.MessageDirection.clientToServer; + DidChangeConfigurationNotification.type = new messages_1.ProtocolNotificationType(DidChangeConfigurationNotification.method); + })(DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = DidChangeConfigurationNotification = {})); + var MessageType; + (function(MessageType) { + MessageType.Error = 1; + MessageType.Warning = 2; + MessageType.Info = 3; + MessageType.Log = 4; + MessageType.Debug = 5; + })(MessageType || (exports.MessageType = MessageType = {})); + var ShowMessageNotification; + (function(ShowMessageNotification) { + ShowMessageNotification.method = 'window/showMessage'; + ShowMessageNotification.messageDirection = messages_1.MessageDirection.serverToClient; + ShowMessageNotification.type = new messages_1.ProtocolNotificationType(ShowMessageNotification.method); + })(ShowMessageNotification || (exports.ShowMessageNotification = ShowMessageNotification = {})); + var ShowMessageRequest; + (function(ShowMessageRequest) { + ShowMessageRequest.method = 'window/showMessageRequest'; + ShowMessageRequest.messageDirection = messages_1.MessageDirection.serverToClient; + ShowMessageRequest.type = new messages_1.ProtocolRequestType(ShowMessageRequest.method); + })(ShowMessageRequest || (exports.ShowMessageRequest = ShowMessageRequest = {})); + var LogMessageNotification; + (function(LogMessageNotification) { + LogMessageNotification.method = 'window/logMessage'; + LogMessageNotification.messageDirection = messages_1.MessageDirection.serverToClient; + LogMessageNotification.type = new messages_1.ProtocolNotificationType(LogMessageNotification.method); + })(LogMessageNotification || (exports.LogMessageNotification = LogMessageNotification = {})); + var TelemetryEventNotification; + (function(TelemetryEventNotification) { + TelemetryEventNotification.method = 'telemetry/event'; + TelemetryEventNotification.messageDirection = messages_1.MessageDirection.serverToClient; + TelemetryEventNotification.type = new messages_1.ProtocolNotificationType(TelemetryEventNotification.method); + })(TelemetryEventNotification || (exports.TelemetryEventNotification = TelemetryEventNotification = {})); + var TextDocumentSyncKind; + (function(TextDocumentSyncKind) { + TextDocumentSyncKind.None = 0; + TextDocumentSyncKind.Full = 1; + TextDocumentSyncKind.Incremental = 2; + })(TextDocumentSyncKind || (exports.TextDocumentSyncKind = TextDocumentSyncKind = {})); + var DidOpenTextDocumentNotification; + (function(DidOpenTextDocumentNotification) { + DidOpenTextDocumentNotification.method = 'textDocument/didOpen'; + DidOpenTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer; + DidOpenTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification.method); + })(DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = DidOpenTextDocumentNotification = {})); + var TextDocumentContentChangeEvent; + (function(TextDocumentContentChangeEvent) { + function isIncremental(event) { + let candidate = event; + return candidate !== undefined && candidate !== null && typeof candidate.text === 'string' && candidate.range !== undefined && (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number'); + } + TextDocumentContentChangeEvent.isIncremental = isIncremental; + function isFull(event) { + let candidate = event; + return candidate !== undefined && candidate !== null && typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined; + } + TextDocumentContentChangeEvent.isFull = isFull; + })(TextDocumentContentChangeEvent || (exports.TextDocumentContentChangeEvent = TextDocumentContentChangeEvent = {})); + var DidChangeTextDocumentNotification; + (function(DidChangeTextDocumentNotification) { + DidChangeTextDocumentNotification.method = 'textDocument/didChange'; + DidChangeTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer; + DidChangeTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification.method); + })(DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = DidChangeTextDocumentNotification = {})); + var DidCloseTextDocumentNotification; + (function(DidCloseTextDocumentNotification) { + DidCloseTextDocumentNotification.method = 'textDocument/didClose'; + DidCloseTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer; + DidCloseTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification.method); + })(DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = DidCloseTextDocumentNotification = {})); + var DidSaveTextDocumentNotification; + (function(DidSaveTextDocumentNotification) { + DidSaveTextDocumentNotification.method = 'textDocument/didSave'; + DidSaveTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer; + DidSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification.method); + })(DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = DidSaveTextDocumentNotification = {})); + var TextDocumentSaveReason; + (function(TextDocumentSaveReason) { + TextDocumentSaveReason.Manual = 1; + TextDocumentSaveReason.AfterDelay = 2; + TextDocumentSaveReason.FocusOut = 3; + })(TextDocumentSaveReason || (exports.TextDocumentSaveReason = TextDocumentSaveReason = {})); + var WillSaveTextDocumentNotification; + (function(WillSaveTextDocumentNotification) { + WillSaveTextDocumentNotification.method = 'textDocument/willSave'; + WillSaveTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer; + WillSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification.method); + })(WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = WillSaveTextDocumentNotification = {})); + var WillSaveTextDocumentWaitUntilRequest; + (function(WillSaveTextDocumentWaitUntilRequest) { + WillSaveTextDocumentWaitUntilRequest.method = 'textDocument/willSaveWaitUntil'; + WillSaveTextDocumentWaitUntilRequest.messageDirection = messages_1.MessageDirection.clientToServer; + WillSaveTextDocumentWaitUntilRequest.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest.method); + })(WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = WillSaveTextDocumentWaitUntilRequest = {})); + var DidChangeWatchedFilesNotification; + (function(DidChangeWatchedFilesNotification) { + DidChangeWatchedFilesNotification.method = 'workspace/didChangeWatchedFiles'; + DidChangeWatchedFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer; + DidChangeWatchedFilesNotification.type = new messages_1.ProtocolNotificationType(DidChangeWatchedFilesNotification.method); + })(DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = DidChangeWatchedFilesNotification = {})); + var FileChangeType; + (function(FileChangeType) { + FileChangeType.Created = 1; + FileChangeType.Changed = 2; + FileChangeType.Deleted = 3; + })(FileChangeType || (exports.FileChangeType = FileChangeType = {})); + var RelativePattern; + (function(RelativePattern) { + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && (vscode_languageserver_types_1.URI.is(candidate.baseUri) || vscode_languageserver_types_1.WorkspaceFolder.is(candidate.baseUri)) && Is.string(candidate.pattern); + } + RelativePattern.is = is; + })(RelativePattern || (exports.RelativePattern = RelativePattern = {})); + var WatchKind; + (function(WatchKind) { + WatchKind.Create = 1; + WatchKind.Change = 2; + WatchKind.Delete = 4; + })(WatchKind || (exports.WatchKind = WatchKind = {})); + var PublishDiagnosticsNotification; + (function(PublishDiagnosticsNotification) { + PublishDiagnosticsNotification.method = 'textDocument/publishDiagnostics'; + PublishDiagnosticsNotification.messageDirection = messages_1.MessageDirection.serverToClient; + PublishDiagnosticsNotification.type = new messages_1.ProtocolNotificationType(PublishDiagnosticsNotification.method); + })(PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = PublishDiagnosticsNotification = {})); + var CompletionTriggerKind; + (function(CompletionTriggerKind) { + CompletionTriggerKind.Invoked = 1; + CompletionTriggerKind.TriggerCharacter = 2; + CompletionTriggerKind.TriggerForIncompleteCompletions = 3; + })(CompletionTriggerKind || (exports.CompletionTriggerKind = CompletionTriggerKind = {})); + var CompletionRequest; + (function(CompletionRequest) { + CompletionRequest.method = 'textDocument/completion'; + CompletionRequest.messageDirection = messages_1.MessageDirection.clientToServer; + CompletionRequest.type = new messages_1.ProtocolRequestType(CompletionRequest.method); + })(CompletionRequest || (exports.CompletionRequest = CompletionRequest = {})); + var CompletionResolveRequest; + (function(CompletionResolveRequest) { + CompletionResolveRequest.method = 'completionItem/resolve'; + CompletionResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer; + CompletionResolveRequest.type = new messages_1.ProtocolRequestType(CompletionResolveRequest.method); + })(CompletionResolveRequest || (exports.CompletionResolveRequest = CompletionResolveRequest = {})); + var HoverRequest; + (function(HoverRequest) { + HoverRequest.method = 'textDocument/hover'; + HoverRequest.messageDirection = messages_1.MessageDirection.clientToServer; + HoverRequest.type = new messages_1.ProtocolRequestType(HoverRequest.method); + })(HoverRequest || (exports.HoverRequest = HoverRequest = {})); + var SignatureHelpTriggerKind; + (function(SignatureHelpTriggerKind) { + SignatureHelpTriggerKind.Invoked = 1; + SignatureHelpTriggerKind.TriggerCharacter = 2; + SignatureHelpTriggerKind.ContentChange = 3; + })(SignatureHelpTriggerKind || (exports.SignatureHelpTriggerKind = SignatureHelpTriggerKind = {})); + var SignatureHelpRequest; + (function(SignatureHelpRequest) { + SignatureHelpRequest.method = 'textDocument/signatureHelp'; + SignatureHelpRequest.messageDirection = messages_1.MessageDirection.clientToServer; + SignatureHelpRequest.type = new messages_1.ProtocolRequestType(SignatureHelpRequest.method); + })(SignatureHelpRequest || (exports.SignatureHelpRequest = SignatureHelpRequest = {})); + var DefinitionRequest; + (function(DefinitionRequest) { + DefinitionRequest.method = 'textDocument/definition'; + DefinitionRequest.messageDirection = messages_1.MessageDirection.clientToServer; + DefinitionRequest.type = new messages_1.ProtocolRequestType(DefinitionRequest.method); + })(DefinitionRequest || (exports.DefinitionRequest = DefinitionRequest = {})); + var ReferencesRequest; + (function(ReferencesRequest) { + ReferencesRequest.method = 'textDocument/references'; + ReferencesRequest.messageDirection = messages_1.MessageDirection.clientToServer; + ReferencesRequest.type = new messages_1.ProtocolRequestType(ReferencesRequest.method); + })(ReferencesRequest || (exports.ReferencesRequest = ReferencesRequest = {})); + var DocumentHighlightRequest; + (function(DocumentHighlightRequest) { + DocumentHighlightRequest.method = 'textDocument/documentHighlight'; + DocumentHighlightRequest.messageDirection = messages_1.MessageDirection.clientToServer; + DocumentHighlightRequest.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest.method); + })(DocumentHighlightRequest || (exports.DocumentHighlightRequest = DocumentHighlightRequest = {})); + var DocumentSymbolRequest; + (function(DocumentSymbolRequest) { + DocumentSymbolRequest.method = 'textDocument/documentSymbol'; + DocumentSymbolRequest.messageDirection = messages_1.MessageDirection.clientToServer; + DocumentSymbolRequest.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest.method); + })(DocumentSymbolRequest || (exports.DocumentSymbolRequest = DocumentSymbolRequest = {})); + var CodeActionRequest; + (function(CodeActionRequest) { + CodeActionRequest.method = 'textDocument/codeAction'; + CodeActionRequest.messageDirection = messages_1.MessageDirection.clientToServer; + CodeActionRequest.type = new messages_1.ProtocolRequestType(CodeActionRequest.method); + })(CodeActionRequest || (exports.CodeActionRequest = CodeActionRequest = {})); + var CodeActionResolveRequest; + (function(CodeActionResolveRequest) { + CodeActionResolveRequest.method = 'codeAction/resolve'; + CodeActionResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer; + CodeActionResolveRequest.type = new messages_1.ProtocolRequestType(CodeActionResolveRequest.method); + })(CodeActionResolveRequest || (exports.CodeActionResolveRequest = CodeActionResolveRequest = {})); + var WorkspaceSymbolRequest; + (function(WorkspaceSymbolRequest) { + WorkspaceSymbolRequest.method = 'workspace/symbol'; + WorkspaceSymbolRequest.messageDirection = messages_1.MessageDirection.clientToServer; + WorkspaceSymbolRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest.method); + })(WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = WorkspaceSymbolRequest = {})); + var WorkspaceSymbolResolveRequest; + (function(WorkspaceSymbolResolveRequest) { + WorkspaceSymbolResolveRequest.method = 'workspaceSymbol/resolve'; + WorkspaceSymbolResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer; + WorkspaceSymbolResolveRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolResolveRequest.method); + })(WorkspaceSymbolResolveRequest || (exports.WorkspaceSymbolResolveRequest = WorkspaceSymbolResolveRequest = {})); + var CodeLensRequest; + (function(CodeLensRequest) { + CodeLensRequest.method = 'textDocument/codeLens'; + CodeLensRequest.messageDirection = messages_1.MessageDirection.clientToServer; + CodeLensRequest.type = new messages_1.ProtocolRequestType(CodeLensRequest.method); + })(CodeLensRequest || (exports.CodeLensRequest = CodeLensRequest = {})); + var CodeLensResolveRequest; + (function(CodeLensResolveRequest) { + CodeLensResolveRequest.method = 'codeLens/resolve'; + CodeLensResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer; + CodeLensResolveRequest.type = new messages_1.ProtocolRequestType(CodeLensResolveRequest.method); + })(CodeLensResolveRequest || (exports.CodeLensResolveRequest = CodeLensResolveRequest = {})); + var CodeLensRefreshRequest; + (function(CodeLensRefreshRequest) { + CodeLensRefreshRequest.method = `workspace/codeLens/refresh`; + CodeLensRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient; + CodeLensRefreshRequest.type = new messages_1.ProtocolRequestType0(CodeLensRefreshRequest.method); + })(CodeLensRefreshRequest || (exports.CodeLensRefreshRequest = CodeLensRefreshRequest = {})); + var DocumentLinkRequest; + (function(DocumentLinkRequest) { + DocumentLinkRequest.method = 'textDocument/documentLink'; + DocumentLinkRequest.messageDirection = messages_1.MessageDirection.clientToServer; + DocumentLinkRequest.type = new messages_1.ProtocolRequestType(DocumentLinkRequest.method); + })(DocumentLinkRequest || (exports.DocumentLinkRequest = DocumentLinkRequest = {})); + var DocumentLinkResolveRequest; + (function(DocumentLinkResolveRequest) { + DocumentLinkResolveRequest.method = 'documentLink/resolve'; + DocumentLinkResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer; + DocumentLinkResolveRequest.type = new messages_1.ProtocolRequestType(DocumentLinkResolveRequest.method); + })(DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = DocumentLinkResolveRequest = {})); + var DocumentFormattingRequest; + (function(DocumentFormattingRequest) { + DocumentFormattingRequest.method = 'textDocument/formatting'; + DocumentFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer; + DocumentFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest.method); + })(DocumentFormattingRequest || (exports.DocumentFormattingRequest = DocumentFormattingRequest = {})); + var DocumentRangeFormattingRequest; + (function(DocumentRangeFormattingRequest) { + DocumentRangeFormattingRequest.method = 'textDocument/rangeFormatting'; + DocumentRangeFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer; + DocumentRangeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest.method); + })(DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = DocumentRangeFormattingRequest = {})); + var DocumentRangesFormattingRequest; + (function(DocumentRangesFormattingRequest) { + DocumentRangesFormattingRequest.method = 'textDocument/rangesFormatting'; + DocumentRangesFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer; + DocumentRangesFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangesFormattingRequest.method); + })(DocumentRangesFormattingRequest || (exports.DocumentRangesFormattingRequest = DocumentRangesFormattingRequest = {})); + var DocumentOnTypeFormattingRequest; + (function(DocumentOnTypeFormattingRequest) { + DocumentOnTypeFormattingRequest.method = 'textDocument/onTypeFormatting'; + DocumentOnTypeFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer; + DocumentOnTypeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest.method); + })(DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = DocumentOnTypeFormattingRequest = {})); + var PrepareSupportDefaultBehavior; + (function(PrepareSupportDefaultBehavior) { + PrepareSupportDefaultBehavior.Identifier = 1; + })(PrepareSupportDefaultBehavior || (exports.PrepareSupportDefaultBehavior = PrepareSupportDefaultBehavior = {})); + var RenameRequest; + (function(RenameRequest) { + RenameRequest.method = 'textDocument/rename'; + RenameRequest.messageDirection = messages_1.MessageDirection.clientToServer; + RenameRequest.type = new messages_1.ProtocolRequestType(RenameRequest.method); + })(RenameRequest || (exports.RenameRequest = RenameRequest = {})); + var PrepareRenameRequest; + (function(PrepareRenameRequest) { + PrepareRenameRequest.method = 'textDocument/prepareRename'; + PrepareRenameRequest.messageDirection = messages_1.MessageDirection.clientToServer; + PrepareRenameRequest.type = new messages_1.ProtocolRequestType(PrepareRenameRequest.method); + })(PrepareRenameRequest || (exports.PrepareRenameRequest = PrepareRenameRequest = {})); + var ExecuteCommandRequest; + (function(ExecuteCommandRequest) { + ExecuteCommandRequest.method = 'workspace/executeCommand'; + ExecuteCommandRequest.messageDirection = messages_1.MessageDirection.clientToServer; + ExecuteCommandRequest.type = new messages_1.ProtocolRequestType(ExecuteCommandRequest.method); + })(ExecuteCommandRequest || (exports.ExecuteCommandRequest = ExecuteCommandRequest = {})); + var ApplyWorkspaceEditRequest; + (function(ApplyWorkspaceEditRequest) { + ApplyWorkspaceEditRequest.method = 'workspace/applyEdit'; + ApplyWorkspaceEditRequest.messageDirection = messages_1.MessageDirection.serverToClient; + ApplyWorkspaceEditRequest.type = new messages_1.ProtocolRequestType('workspace/applyEdit'); + })(ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = ApplyWorkspaceEditRequest = {})); +})(protocol); + +var connection = {}; + +Object.defineProperty(connection, '__esModule', { + value: true +}); + +connection.createProtocolConnection = void 0; + +const vscode_jsonrpc_1 = main$1; + +function createProtocolConnection(input, output, logger, options) { + if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) { + options = { + connectionStrategy: options + }; + } + return (0, vscode_jsonrpc_1.createMessageConnection)(input, output, logger, options); +} + +connection.createProtocolConnection = createProtocolConnection; + +(function(exports) { + var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function() { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(m, exports) { + for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); + }; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.LSPErrorCodes = exports.createProtocolConnection = void 0; + __exportStar(main$1, exports); + __exportStar(mainExports, exports); + __exportStar(messages, exports); + __exportStar(protocol, exports); + var connection_1 = connection; + Object.defineProperty(exports, 'createProtocolConnection', { + enumerable: true, + get: function() { + return connection_1.createProtocolConnection; + } + }); + var LSPErrorCodes; + (function(LSPErrorCodes) { + LSPErrorCodes.lspReservedErrorRangeStart = -32899; + LSPErrorCodes.RequestFailed = -32803; + LSPErrorCodes.ServerCancelled = -32802; + LSPErrorCodes.ContentModified = -32801; + LSPErrorCodes.RequestCancelled = -32800; + LSPErrorCodes.lspReservedErrorRangeEnd = -32800; + })(LSPErrorCodes || (exports.LSPErrorCodes = LSPErrorCodes = {})); +})(api$1); + +(function(exports) { + var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function() { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(m, exports) { + for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); + }; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.createProtocolConnection = void 0; + const node_1 = node$2; + __exportStar(node$2, exports); + __exportStar(api$1, exports); + function createProtocolConnection(input, output, logger, options) { + return (0, node_1.createMessageConnection)(input, output, logger, options); + } + exports.createProtocolConnection = createProtocolConnection; +})(main$2); + +var uuid = {}; + +Object.defineProperty(uuid, '__esModule', { + value: true +}); + +uuid.generateUuid = uuid.parse = uuid.isUUID = uuid.v4 = uuid.empty = void 0; + +class ValueUUID { + constructor(_value) { + this._value = _value; + } + asHex() { + return this._value; + } + equals(other) { + return this.asHex() === other.asHex(); + } +} + +class V4UUID extends ValueUUID { + static _oneOf(array) { + return array[Math.floor(array.length * Math.random())]; + } + static _randomHex() { + return V4UUID._oneOf(V4UUID._chars); + } + constructor() { + super([ V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', '4', V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', V4UUID._oneOf(V4UUID._timeHighBits), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex() ].join('')); + } +} + +V4UUID._chars = [ '0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' ]; + +V4UUID._timeHighBits = [ '8', '9', 'a', 'b' ]; + +uuid.empty = new ValueUUID('00000000-0000-0000-0000-000000000000'); + +function v4() { + return new V4UUID; +} + +uuid.v4 = v4; + +const _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; + +function isUUID(value) { + return _UUIDPattern.test(value); +} + +uuid.isUUID = isUUID; + +function parse$7(value) { + if (!isUUID(value)) { + throw new Error('invalid uuid'); + } + return new ValueUUID(value); +} + +uuid.parse = parse$7; + +function generateUuid() { + return v4().asHex(); +} + +uuid.generateUuid = generateUuid; + +var progress = {}; + +Object.defineProperty(progress, '__esModule', { + value: true +}); + +progress.attachPartialResult = progress.ProgressFeature = attachWorkDone_1 = progress.attachWorkDone = void 0; + +const vscode_languageserver_protocol_1$h = main$2; + +const uuid_1 = uuid; + +class WorkDoneProgressReporterImpl { + constructor(_connection, _token) { + this._connection = _connection; + this._token = _token; + WorkDoneProgressReporterImpl.Instances.set(this._token, this); + } + begin(title, percentage, message, cancellable) { + let param = { + kind: 'begin', + title: title, + percentage: percentage, + message: message, + cancellable: cancellable + }; + this._connection.sendProgress(vscode_languageserver_protocol_1$h.WorkDoneProgress.type, this._token, param); + } + report(arg0, arg1) { + let param = { + kind: 'report' + }; + if (typeof arg0 === 'number') { + param.percentage = arg0; + if (arg1 !== undefined) { + param.message = arg1; + } + } else { + param.message = arg0; + } + this._connection.sendProgress(vscode_languageserver_protocol_1$h.WorkDoneProgress.type, this._token, param); + } + done() { + WorkDoneProgressReporterImpl.Instances.delete(this._token); + this._connection.sendProgress(vscode_languageserver_protocol_1$h.WorkDoneProgress.type, this._token, { + kind: 'end' + }); + } +} + +WorkDoneProgressReporterImpl.Instances = new Map; + +class WorkDoneProgressServerReporterImpl extends WorkDoneProgressReporterImpl { + constructor(connection, token) { + super(connection, token); + this._source = new vscode_languageserver_protocol_1$h.CancellationTokenSource; + } + get token() { + return this._source.token; + } + done() { + this._source.dispose(); + super.done(); + } + cancel() { + this._source.cancel(); + } +} + +class NullProgressReporter { + constructor() {} + begin() {} + report() {} + done() {} +} + +class NullProgressServerReporter extends NullProgressReporter { + constructor() { + super(); + this._source = new vscode_languageserver_protocol_1$h.CancellationTokenSource; + } + get token() { + return this._source.token; + } + done() { + this._source.dispose(); + } + cancel() { + this._source.cancel(); + } +} + +function attachWorkDone(connection, params) { + if (params === undefined || params.workDoneToken === undefined) { + return new NullProgressReporter; + } + const token = params.workDoneToken; + delete params.workDoneToken; + return new WorkDoneProgressReporterImpl(connection, token); +} + +var attachWorkDone_1 = progress.attachWorkDone = attachWorkDone; + +const ProgressFeature = Base => class extends Base { + constructor() { + super(); + this._progressSupported = false; + } + initialize(capabilities) { + super.initialize(capabilities); + if (capabilities?.window?.workDoneProgress === true) { + this._progressSupported = true; + this.connection.onNotification(vscode_languageserver_protocol_1$h.WorkDoneProgressCancelNotification.type, (params => { + let progress = WorkDoneProgressReporterImpl.Instances.get(params.token); + if (progress instanceof WorkDoneProgressServerReporterImpl || progress instanceof NullProgressServerReporter) { + progress.cancel(); + } + })); + } + } + attachWorkDoneProgress(token) { + if (token === undefined) { + return new NullProgressReporter; + } else { + return new WorkDoneProgressReporterImpl(this.connection, token); + } + } + createWorkDoneProgress() { + if (this._progressSupported) { + const token = (0, uuid_1.generateUuid)(); + return this.connection.sendRequest(vscode_languageserver_protocol_1$h.WorkDoneProgressCreateRequest.type, { + token: token + }).then((() => { + const result = new WorkDoneProgressServerReporterImpl(this.connection, token); + return result; + })); + } else { + return Promise.resolve(new NullProgressServerReporter); + } + } +}; + +progress.ProgressFeature = ProgressFeature; + +var ResultProgress; + +(function(ResultProgress) { + ResultProgress.type = new vscode_languageserver_protocol_1$h.ProgressType; +})(ResultProgress || (ResultProgress = {})); + +class ResultProgressReporterImpl { + constructor(_connection, _token) { + this._connection = _connection; + this._token = _token; + } + report(data) { + this._connection.sendProgress(ResultProgress.type, this._token, data); + } +} + +function attachPartialResult(connection, params) { + if (params === undefined || params.partialResultToken === undefined) { + return undefined; + } + const token = params.partialResultToken; + delete params.partialResultToken; + return new ResultProgressReporterImpl(connection, token); +} + +progress.attachPartialResult = attachPartialResult; + +var configuration = {}; + +Object.defineProperty(configuration, '__esModule', { + value: true +}); + +configuration.ConfigurationFeature = void 0; + +const vscode_languageserver_protocol_1$g = main$2; + +const Is$1 = is$2; + +const ConfigurationFeature = Base => class extends Base { + getConfiguration(arg) { + if (!arg) { + return this._getConfiguration({}); + } else if (Is$1.string(arg)) { + return this._getConfiguration({ + section: arg + }); + } else { + return this._getConfiguration(arg); + } + } + _getConfiguration(arg) { + let params = { + items: Array.isArray(arg) ? arg : [ arg ] + }; + return this.connection.sendRequest(vscode_languageserver_protocol_1$g.ConfigurationRequest.type, params).then((result => { + if (Array.isArray(result)) { + return Array.isArray(arg) ? result : result[0]; + } else { + return Array.isArray(arg) ? [] : null; + } + })); + } +}; + +configuration.ConfigurationFeature = ConfigurationFeature; + +var workspaceFolder = {}; + +Object.defineProperty(workspaceFolder, '__esModule', { + value: true +}); + +workspaceFolder.WorkspaceFoldersFeature = void 0; + +const vscode_languageserver_protocol_1$f = main$2; + +const WorkspaceFoldersFeature = Base => class extends Base { + constructor() { + super(); + this._notificationIsAutoRegistered = false; + } + initialize(capabilities) { + super.initialize(capabilities); + let workspaceCapabilities = capabilities.workspace; + if (workspaceCapabilities && workspaceCapabilities.workspaceFolders) { + this._onDidChangeWorkspaceFolders = new vscode_languageserver_protocol_1$f.Emitter; + this.connection.onNotification(vscode_languageserver_protocol_1$f.DidChangeWorkspaceFoldersNotification.type, (params => { + this._onDidChangeWorkspaceFolders.fire(params.event); + })); + } + } + fillServerCapabilities(capabilities) { + super.fillServerCapabilities(capabilities); + const changeNotifications = capabilities.workspace?.workspaceFolders?.changeNotifications; + this._notificationIsAutoRegistered = changeNotifications === true || typeof changeNotifications === 'string'; + } + getWorkspaceFolders() { + return this.connection.sendRequest(vscode_languageserver_protocol_1$f.WorkspaceFoldersRequest.type); + } + get onDidChangeWorkspaceFolders() { + if (!this._onDidChangeWorkspaceFolders) { + throw new Error('Client doesn\'t support sending workspace folder change events.'); + } + if (!this._notificationIsAutoRegistered && !this._unregistration) { + this._unregistration = this.connection.client.register(vscode_languageserver_protocol_1$f.DidChangeWorkspaceFoldersNotification.type); + } + return this._onDidChangeWorkspaceFolders.event; + } +}; + +workspaceFolder.WorkspaceFoldersFeature = WorkspaceFoldersFeature; + +var callHierarchy = {}; + +Object.defineProperty(callHierarchy, '__esModule', { + value: true +}); + +callHierarchy.CallHierarchyFeature = void 0; + +const vscode_languageserver_protocol_1$e = main$2; + +const CallHierarchyFeature = Base => class extends Base { + get callHierarchy() { + return { + onPrepare: handler => this.connection.onRequest(vscode_languageserver_protocol_1$e.CallHierarchyPrepareRequest.type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), undefined))), + onIncomingCalls: handler => { + const type = vscode_languageserver_protocol_1$e.CallHierarchyIncomingCallsRequest.type; + return this.connection.onRequest(type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params)))); + }, + onOutgoingCalls: handler => { + const type = vscode_languageserver_protocol_1$e.CallHierarchyOutgoingCallsRequest.type; + return this.connection.onRequest(type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params)))); + } + }; + } +}; + +callHierarchy.CallHierarchyFeature = CallHierarchyFeature; + +var semanticTokens = {}; + +Object.defineProperty(semanticTokens, '__esModule', { + value: true +}); + +semanticTokens.SemanticTokensBuilder = semanticTokens.SemanticTokensDiff = semanticTokens.SemanticTokensFeature = void 0; + +const vscode_languageserver_protocol_1$d = main$2; + +const SemanticTokensFeature = Base => class extends Base { + get semanticTokens() { + return { + refresh: () => this.connection.sendRequest(vscode_languageserver_protocol_1$d.SemanticTokensRefreshRequest.type), + on: handler => { + const type = vscode_languageserver_protocol_1$d.SemanticTokensRequest.type; + return this.connection.onRequest(type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params)))); + }, + onDelta: handler => { + const type = vscode_languageserver_protocol_1$d.SemanticTokensDeltaRequest.type; + return this.connection.onRequest(type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params)))); + }, + onRange: handler => { + const type = vscode_languageserver_protocol_1$d.SemanticTokensRangeRequest.type; + return this.connection.onRequest(type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params)))); + } + }; + } +}; + +semanticTokens.SemanticTokensFeature = SemanticTokensFeature; + +class SemanticTokensDiff { + constructor(originalSequence, modifiedSequence) { + this.originalSequence = originalSequence; + this.modifiedSequence = modifiedSequence; + } + computeDiff() { + const originalLength = this.originalSequence.length; + const modifiedLength = this.modifiedSequence.length; + let startIndex = 0; + while (startIndex < modifiedLength && startIndex < originalLength && this.originalSequence[startIndex] === this.modifiedSequence[startIndex]) { + startIndex++; + } + if (startIndex < modifiedLength && startIndex < originalLength) { + let originalEndIndex = originalLength - 1; + let modifiedEndIndex = modifiedLength - 1; + while (originalEndIndex >= startIndex && modifiedEndIndex >= startIndex && this.originalSequence[originalEndIndex] === this.modifiedSequence[modifiedEndIndex]) { + originalEndIndex--; + modifiedEndIndex--; + } + if (originalEndIndex < startIndex || modifiedEndIndex < startIndex) { + originalEndIndex++; + modifiedEndIndex++; + } + const deleteCount = originalEndIndex - startIndex + 1; + const newData = this.modifiedSequence.slice(startIndex, modifiedEndIndex + 1); + if (newData.length === 1 && newData[0] === this.originalSequence[originalEndIndex]) { + return [ { + start: startIndex, + deleteCount: deleteCount - 1 + } ]; + } else { + return [ { + start: startIndex, + deleteCount: deleteCount, + data: newData + } ]; + } + } else if (startIndex < modifiedLength) { + return [ { + start: startIndex, + deleteCount: 0, + data: this.modifiedSequence.slice(startIndex) + } ]; + } else if (startIndex < originalLength) { + return [ { + start: startIndex, + deleteCount: originalLength - startIndex + } ]; + } else { + return []; + } + } +} + +semanticTokens.SemanticTokensDiff = SemanticTokensDiff; + +class SemanticTokensBuilder { + constructor() { + this._prevData = undefined; + this.initialize(); + } + initialize() { + this._id = Date.now(); + this._prevLine = 0; + this._prevChar = 0; + this._data = []; + this._dataLen = 0; + } + push(line, char, length, tokenType, tokenModifiers) { + let pushLine = line; + let pushChar = char; + if (this._dataLen > 0) { + pushLine -= this._prevLine; + if (pushLine === 0) { + pushChar -= this._prevChar; + } + } + this._data[this._dataLen++] = pushLine; + this._data[this._dataLen++] = pushChar; + this._data[this._dataLen++] = length; + this._data[this._dataLen++] = tokenType; + this._data[this._dataLen++] = tokenModifiers; + this._prevLine = line; + this._prevChar = char; + } + get id() { + return this._id.toString(); + } + previousResult(id) { + if (this.id === id) { + this._prevData = this._data; + } + this.initialize(); + } + build() { + this._prevData = undefined; + return { + resultId: this.id, + data: this._data + }; + } + canBuildEdits() { + return this._prevData !== undefined; + } + buildEdits() { + if (this._prevData !== undefined) { + return { + resultId: this.id, + edits: new SemanticTokensDiff(this._prevData, this._data).computeDiff() + }; + } else { + return this.build(); + } + } +} + +semanticTokens.SemanticTokensBuilder = SemanticTokensBuilder; + +var showDocument = {}; + +Object.defineProperty(showDocument, '__esModule', { + value: true +}); + +showDocument.ShowDocumentFeature = void 0; + +const vscode_languageserver_protocol_1$c = main$2; + +const ShowDocumentFeature = Base => class extends Base { + showDocument(params) { + return this.connection.sendRequest(vscode_languageserver_protocol_1$c.ShowDocumentRequest.type, params); + } +}; + +showDocument.ShowDocumentFeature = ShowDocumentFeature; + +var fileOperations = {}; + +Object.defineProperty(fileOperations, '__esModule', { + value: true +}); + +fileOperations.FileOperationsFeature = void 0; + +const vscode_languageserver_protocol_1$b = main$2; + +const FileOperationsFeature = Base => class extends Base { + onDidCreateFiles(handler) { + return this.connection.onNotification(vscode_languageserver_protocol_1$b.DidCreateFilesNotification.type, (params => { + handler(params); + })); + } + onDidRenameFiles(handler) { + return this.connection.onNotification(vscode_languageserver_protocol_1$b.DidRenameFilesNotification.type, (params => { + handler(params); + })); + } + onDidDeleteFiles(handler) { + return this.connection.onNotification(vscode_languageserver_protocol_1$b.DidDeleteFilesNotification.type, (params => { + handler(params); + })); + } + onWillCreateFiles(handler) { + return this.connection.onRequest(vscode_languageserver_protocol_1$b.WillCreateFilesRequest.type, ((params, cancel) => handler(params, cancel))); + } + onWillRenameFiles(handler) { + return this.connection.onRequest(vscode_languageserver_protocol_1$b.WillRenameFilesRequest.type, ((params, cancel) => handler(params, cancel))); + } + onWillDeleteFiles(handler) { + return this.connection.onRequest(vscode_languageserver_protocol_1$b.WillDeleteFilesRequest.type, ((params, cancel) => handler(params, cancel))); + } +}; + +fileOperations.FileOperationsFeature = FileOperationsFeature; + +var linkedEditingRange = {}; + +Object.defineProperty(linkedEditingRange, '__esModule', { + value: true +}); + +linkedEditingRange.LinkedEditingRangeFeature = void 0; + +const vscode_languageserver_protocol_1$a = main$2; + +const LinkedEditingRangeFeature = Base => class extends Base { + onLinkedEditingRange(handler) { + return this.connection.onRequest(vscode_languageserver_protocol_1$a.LinkedEditingRangeRequest.type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), undefined))); + } +}; + +linkedEditingRange.LinkedEditingRangeFeature = LinkedEditingRangeFeature; + +var typeHierarchy = {}; + +Object.defineProperty(typeHierarchy, '__esModule', { + value: true +}); + +typeHierarchy.TypeHierarchyFeature = void 0; + +const vscode_languageserver_protocol_1$9 = main$2; + +const TypeHierarchyFeature = Base => class extends Base { + get typeHierarchy() { + return { + onPrepare: handler => this.connection.onRequest(vscode_languageserver_protocol_1$9.TypeHierarchyPrepareRequest.type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), undefined))), + onSupertypes: handler => { + const type = vscode_languageserver_protocol_1$9.TypeHierarchySupertypesRequest.type; + return this.connection.onRequest(type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params)))); + }, + onSubtypes: handler => { + const type = vscode_languageserver_protocol_1$9.TypeHierarchySubtypesRequest.type; + return this.connection.onRequest(type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params)))); + } + }; + } +}; + +typeHierarchy.TypeHierarchyFeature = TypeHierarchyFeature; + +var inlineValue = {}; + +Object.defineProperty(inlineValue, '__esModule', { + value: true +}); + +inlineValue.InlineValueFeature = void 0; + +const vscode_languageserver_protocol_1$8 = main$2; + +const InlineValueFeature = Base => class extends Base { + get inlineValue() { + return { + refresh: () => this.connection.sendRequest(vscode_languageserver_protocol_1$8.InlineValueRefreshRequest.type), + on: handler => this.connection.onRequest(vscode_languageserver_protocol_1$8.InlineValueRequest.type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params)))) + }; + } +}; + +inlineValue.InlineValueFeature = InlineValueFeature; + +var foldingRange = {}; + +Object.defineProperty(foldingRange, '__esModule', { + value: true +}); + +foldingRange.FoldingRangeFeature = void 0; + +const vscode_languageserver_protocol_1$7 = main$2; + +const FoldingRangeFeature = Base => class extends Base { + get foldingRange() { + return { + refresh: () => this.connection.sendRequest(vscode_languageserver_protocol_1$7.FoldingRangeRefreshRequest.type), + on: handler => { + const type = vscode_languageserver_protocol_1$7.FoldingRangeRequest.type; + return this.connection.onRequest(type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params)))); + } + }; + } +}; + +foldingRange.FoldingRangeFeature = FoldingRangeFeature; + +var inlayHint = {}; + +Object.defineProperty(inlayHint, '__esModule', { + value: true +}); + +inlayHint.InlayHintFeature = void 0; + +const vscode_languageserver_protocol_1$6 = main$2; + +const InlayHintFeature = Base => class extends Base { + get inlayHint() { + return { + refresh: () => this.connection.sendRequest(vscode_languageserver_protocol_1$6.InlayHintRefreshRequest.type), + on: handler => this.connection.onRequest(vscode_languageserver_protocol_1$6.InlayHintRequest.type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params)))), + resolve: handler => this.connection.onRequest(vscode_languageserver_protocol_1$6.InlayHintResolveRequest.type, ((params, cancel) => handler(params, cancel))) + }; + } +}; + +inlayHint.InlayHintFeature = InlayHintFeature; + +var diagnostic = {}; + +Object.defineProperty(diagnostic, '__esModule', { + value: true +}); + +diagnostic.DiagnosticFeature = void 0; + +const vscode_languageserver_protocol_1$5 = main$2; + +const DiagnosticFeature = Base => class extends Base { + get diagnostics() { + return { + refresh: () => this.connection.sendRequest(vscode_languageserver_protocol_1$5.DiagnosticRefreshRequest.type), + on: handler => this.connection.onRequest(vscode_languageserver_protocol_1$5.DocumentDiagnosticRequest.type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(vscode_languageserver_protocol_1$5.DocumentDiagnosticRequest.partialResult, params)))), + onWorkspace: handler => this.connection.onRequest(vscode_languageserver_protocol_1$5.WorkspaceDiagnosticRequest.type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(vscode_languageserver_protocol_1$5.WorkspaceDiagnosticRequest.partialResult, params)))) + }; + } +}; + +diagnostic.DiagnosticFeature = DiagnosticFeature; + +var notebook = {}; + +var textDocuments = {}; + +Object.defineProperty(textDocuments, '__esModule', { + value: true +}); + +textDocuments.TextDocuments = void 0; + +const vscode_languageserver_protocol_1$4 = main$2; + +class TextDocuments { + constructor(configuration) { + this._configuration = configuration; + this._syncedDocuments = new Map; + this._onDidChangeContent = new vscode_languageserver_protocol_1$4.Emitter; + this._onDidOpen = new vscode_languageserver_protocol_1$4.Emitter; + this._onDidClose = new vscode_languageserver_protocol_1$4.Emitter; + this._onDidSave = new vscode_languageserver_protocol_1$4.Emitter; + this._onWillSave = new vscode_languageserver_protocol_1$4.Emitter; + } + get onDidOpen() { + return this._onDidOpen.event; + } + get onDidChangeContent() { + return this._onDidChangeContent.event; + } + get onWillSave() { + return this._onWillSave.event; + } + onWillSaveWaitUntil(handler) { + this._willSaveWaitUntil = handler; + } + get onDidSave() { + return this._onDidSave.event; + } + get onDidClose() { + return this._onDidClose.event; + } + get(uri) { + return this._syncedDocuments.get(uri); + } + all() { + return Array.from(this._syncedDocuments.values()); + } + keys() { + return Array.from(this._syncedDocuments.keys()); + } + listen(connection) { + connection.__textDocumentSync = vscode_languageserver_protocol_1$4.TextDocumentSyncKind.Incremental; + const disposables = []; + disposables.push(connection.onDidOpenTextDocument((event => { + const td = event.textDocument; + const document = this._configuration.create(td.uri, td.languageId, td.version, td.text); + this._syncedDocuments.set(td.uri, document); + const toFire = Object.freeze({ + document: document + }); + this._onDidOpen.fire(toFire); + this._onDidChangeContent.fire(toFire); + }))); + disposables.push(connection.onDidChangeTextDocument((event => { + const td = event.textDocument; + const changes = event.contentChanges; + if (changes.length === 0) { + return; + } + const {version: version} = td; + if (version === null || version === undefined) { + throw new Error(`Received document change event for ${td.uri} without valid version identifier`); + } + let syncedDocument = this._syncedDocuments.get(td.uri); + if (syncedDocument !== undefined) { + syncedDocument = this._configuration.update(syncedDocument, changes, version); + this._syncedDocuments.set(td.uri, syncedDocument); + this._onDidChangeContent.fire(Object.freeze({ + document: syncedDocument + })); + } + }))); + disposables.push(connection.onDidCloseTextDocument((event => { + let syncedDocument = this._syncedDocuments.get(event.textDocument.uri); + if (syncedDocument !== undefined) { + this._syncedDocuments.delete(event.textDocument.uri); + this._onDidClose.fire(Object.freeze({ + document: syncedDocument + })); + } + }))); + disposables.push(connection.onWillSaveTextDocument((event => { + let syncedDocument = this._syncedDocuments.get(event.textDocument.uri); + if (syncedDocument !== undefined) { + this._onWillSave.fire(Object.freeze({ + document: syncedDocument, + reason: event.reason + })); + } + }))); + disposables.push(connection.onWillSaveTextDocumentWaitUntil(((event, token) => { + let syncedDocument = this._syncedDocuments.get(event.textDocument.uri); + if (syncedDocument !== undefined && this._willSaveWaitUntil) { + return this._willSaveWaitUntil(Object.freeze({ + document: syncedDocument, + reason: event.reason + }), token); + } else { + return []; + } + }))); + disposables.push(connection.onDidSaveTextDocument((event => { + let syncedDocument = this._syncedDocuments.get(event.textDocument.uri); + if (syncedDocument !== undefined) { + this._onDidSave.fire(Object.freeze({ + document: syncedDocument + })); + } + }))); + return vscode_languageserver_protocol_1$4.Disposable.create((() => { + disposables.forEach((disposable => disposable.dispose())); + })); + } +} + +textDocuments.TextDocuments = TextDocuments; + +Object.defineProperty(notebook, '__esModule', { + value: true +}); + +notebook.NotebookDocuments = notebook.NotebookSyncFeature = void 0; + +const vscode_languageserver_protocol_1$3 = main$2; + +const textDocuments_1 = textDocuments; + +const NotebookSyncFeature = Base => class extends Base { + get synchronization() { + return { + onDidOpenNotebookDocument: handler => this.connection.onNotification(vscode_languageserver_protocol_1$3.DidOpenNotebookDocumentNotification.type, (params => { + handler(params); + })), + onDidChangeNotebookDocument: handler => this.connection.onNotification(vscode_languageserver_protocol_1$3.DidChangeNotebookDocumentNotification.type, (params => { + handler(params); + })), + onDidSaveNotebookDocument: handler => this.connection.onNotification(vscode_languageserver_protocol_1$3.DidSaveNotebookDocumentNotification.type, (params => { + handler(params); + })), + onDidCloseNotebookDocument: handler => this.connection.onNotification(vscode_languageserver_protocol_1$3.DidCloseNotebookDocumentNotification.type, (params => { + handler(params); + })) + }; + } +}; + +notebook.NotebookSyncFeature = NotebookSyncFeature; + +class CellTextDocumentConnection { + onDidOpenTextDocument(handler) { + this.openHandler = handler; + return vscode_languageserver_protocol_1$3.Disposable.create((() => { + this.openHandler = undefined; + })); + } + openTextDocument(params) { + this.openHandler && this.openHandler(params); + } + onDidChangeTextDocument(handler) { + this.changeHandler = handler; + return vscode_languageserver_protocol_1$3.Disposable.create((() => { + this.changeHandler = handler; + })); + } + changeTextDocument(params) { + this.changeHandler && this.changeHandler(params); + } + onDidCloseTextDocument(handler) { + this.closeHandler = handler; + return vscode_languageserver_protocol_1$3.Disposable.create((() => { + this.closeHandler = undefined; + })); + } + closeTextDocument(params) { + this.closeHandler && this.closeHandler(params); + } + onWillSaveTextDocument() { + return CellTextDocumentConnection.NULL_DISPOSE; + } + onWillSaveTextDocumentWaitUntil() { + return CellTextDocumentConnection.NULL_DISPOSE; + } + onDidSaveTextDocument() { + return CellTextDocumentConnection.NULL_DISPOSE; + } +} + +CellTextDocumentConnection.NULL_DISPOSE = Object.freeze({ + dispose: () => {} +}); + +class NotebookDocuments { + constructor(configurationOrTextDocuments) { + if (configurationOrTextDocuments instanceof textDocuments_1.TextDocuments) { + this._cellTextDocuments = configurationOrTextDocuments; + } else { + this._cellTextDocuments = new textDocuments_1.TextDocuments(configurationOrTextDocuments); + } + this.notebookDocuments = new Map; + this.notebookCellMap = new Map; + this._onDidOpen = new vscode_languageserver_protocol_1$3.Emitter; + this._onDidChange = new vscode_languageserver_protocol_1$3.Emitter; + this._onDidSave = new vscode_languageserver_protocol_1$3.Emitter; + this._onDidClose = new vscode_languageserver_protocol_1$3.Emitter; + } + get cellTextDocuments() { + return this._cellTextDocuments; + } + getCellTextDocument(cell) { + return this._cellTextDocuments.get(cell.document); + } + getNotebookDocument(uri) { + return this.notebookDocuments.get(uri); + } + getNotebookCell(uri) { + const value = this.notebookCellMap.get(uri); + return value && value[0]; + } + findNotebookDocumentForCell(cell) { + const key = typeof cell === 'string' ? cell : cell.document; + const value = this.notebookCellMap.get(key); + return value && value[1]; + } + get onDidOpen() { + return this._onDidOpen.event; + } + get onDidSave() { + return this._onDidSave.event; + } + get onDidChange() { + return this._onDidChange.event; + } + get onDidClose() { + return this._onDidClose.event; + } + listen(connection) { + const cellTextDocumentConnection = new CellTextDocumentConnection; + const disposables = []; + disposables.push(this.cellTextDocuments.listen(cellTextDocumentConnection)); + disposables.push(connection.notebooks.synchronization.onDidOpenNotebookDocument((params => { + this.notebookDocuments.set(params.notebookDocument.uri, params.notebookDocument); + for (const cellTextDocument of params.cellTextDocuments) { + cellTextDocumentConnection.openTextDocument({ + textDocument: cellTextDocument + }); + } + this.updateCellMap(params.notebookDocument); + this._onDidOpen.fire(params.notebookDocument); + }))); + disposables.push(connection.notebooks.synchronization.onDidChangeNotebookDocument((params => { + const notebookDocument = this.notebookDocuments.get(params.notebookDocument.uri); + if (notebookDocument === undefined) { + return; + } + notebookDocument.version = params.notebookDocument.version; + const oldMetadata = notebookDocument.metadata; + let metadataChanged = false; + const change = params.change; + if (change.metadata !== undefined) { + metadataChanged = true; + notebookDocument.metadata = change.metadata; + } + const opened = []; + const closed = []; + const data = []; + const text = []; + if (change.cells !== undefined) { + const changedCells = change.cells; + if (changedCells.structure !== undefined) { + const array = changedCells.structure.array; + notebookDocument.cells.splice(array.start, array.deleteCount, ...array.cells !== undefined ? array.cells : []); + if (changedCells.structure.didOpen !== undefined) { + for (const open of changedCells.structure.didOpen) { + cellTextDocumentConnection.openTextDocument({ + textDocument: open + }); + opened.push(open.uri); + } + } + if (changedCells.structure.didClose) { + for (const close of changedCells.structure.didClose) { + cellTextDocumentConnection.closeTextDocument({ + textDocument: close + }); + closed.push(close.uri); + } + } + } + if (changedCells.data !== undefined) { + const cellUpdates = new Map(changedCells.data.map((cell => [ cell.document, cell ]))); + for (let i = 0; i <= notebookDocument.cells.length; i++) { + const change = cellUpdates.get(notebookDocument.cells[i].document); + if (change !== undefined) { + const old = notebookDocument.cells.splice(i, 1, change); + data.push({ + old: old[0], + new: change + }); + cellUpdates.delete(change.document); + if (cellUpdates.size === 0) { + break; + } + } + } + } + if (changedCells.textContent !== undefined) { + for (const cellTextDocument of changedCells.textContent) { + cellTextDocumentConnection.changeTextDocument({ + textDocument: cellTextDocument.document, + contentChanges: cellTextDocument.changes + }); + text.push(cellTextDocument.document.uri); + } + } + } + this.updateCellMap(notebookDocument); + const changeEvent = { + notebookDocument: notebookDocument + }; + if (metadataChanged) { + changeEvent.metadata = { + old: oldMetadata, + new: notebookDocument.metadata + }; + } + const added = []; + for (const open of opened) { + added.push(this.getNotebookCell(open)); + } + const removed = []; + for (const close of closed) { + removed.push(this.getNotebookCell(close)); + } + const textContent = []; + for (const change of text) { + textContent.push(this.getNotebookCell(change)); + } + if (added.length > 0 || removed.length > 0 || data.length > 0 || textContent.length > 0) { + changeEvent.cells = { + added: added, + removed: removed, + changed: { + data: data, + textContent: textContent + } + }; + } + if (changeEvent.metadata !== undefined || changeEvent.cells !== undefined) { + this._onDidChange.fire(changeEvent); + } + }))); + disposables.push(connection.notebooks.synchronization.onDidSaveNotebookDocument((params => { + const notebookDocument = this.notebookDocuments.get(params.notebookDocument.uri); + if (notebookDocument === undefined) { + return; + } + this._onDidSave.fire(notebookDocument); + }))); + disposables.push(connection.notebooks.synchronization.onDidCloseNotebookDocument((params => { + const notebookDocument = this.notebookDocuments.get(params.notebookDocument.uri); + if (notebookDocument === undefined) { + return; + } + this._onDidClose.fire(notebookDocument); + for (const cellTextDocument of params.cellTextDocuments) { + cellTextDocumentConnection.closeTextDocument({ + textDocument: cellTextDocument + }); + } + this.notebookDocuments.delete(params.notebookDocument.uri); + for (const cell of notebookDocument.cells) { + this.notebookCellMap.delete(cell.document); + } + }))); + return vscode_languageserver_protocol_1$3.Disposable.create((() => { + disposables.forEach((disposable => disposable.dispose())); + })); + } + updateCellMap(notebookDocument) { + for (const cell of notebookDocument.cells) { + this.notebookCellMap.set(cell.document, [ cell, notebookDocument ]); + } + } +} + +notebook.NotebookDocuments = NotebookDocuments; + +var moniker = {}; + +Object.defineProperty(moniker, '__esModule', { + value: true +}); + +moniker.MonikerFeature = void 0; + +const vscode_languageserver_protocol_1$2 = main$2; + +const MonikerFeature = Base => class extends Base { + get moniker() { + return { + on: handler => { + const type = vscode_languageserver_protocol_1$2.MonikerRequest.type; + return this.connection.onRequest(type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params)))); + } + }; + } +}; + +moniker.MonikerFeature = MonikerFeature; + +Object.defineProperty(server, '__esModule', { + value: true +}); + +server.createConnection = server.combineFeatures = server.combineNotebooksFeatures = server.combineLanguagesFeatures = server.combineWorkspaceFeatures = server.combineWindowFeatures = server.combineClientFeatures = server.combineTracerFeatures = server.combineTelemetryFeatures = server.combineConsoleFeatures = server._NotebooksImpl = server._LanguagesImpl = server.BulkUnregistration = server.BulkRegistration = server.ErrorMessageTracker = void 0; + +const vscode_languageserver_protocol_1$1 = main$2; + +const Is = is$2; + +const UUID = uuid; + +const progress_1 = progress; + +const configuration_1 = configuration; + +const workspaceFolder_1 = workspaceFolder; + +const callHierarchy_1 = callHierarchy; + +const semanticTokens_1 = semanticTokens; + +const showDocument_1 = showDocument; + +const fileOperations_1 = fileOperations; + +const linkedEditingRange_1 = linkedEditingRange; + +const typeHierarchy_1 = typeHierarchy; + +const inlineValue_1 = inlineValue; + +const foldingRange_1 = foldingRange; + +const inlayHint_1 = inlayHint; + +const diagnostic_1 = diagnostic; + +const notebook_1 = notebook; + +const moniker_1 = moniker; + +function null2Undefined(value) { + if (value === null) { + return undefined; + } + return value; +} + +class ErrorMessageTracker { + constructor() { + this._messages = Object.create(null); + } + add(message) { + let count = this._messages[message]; + if (!count) { + count = 0; + } + count++; + this._messages[message] = count; + } + sendErrors(connection) { + Object.keys(this._messages).forEach((message => { + connection.window.showErrorMessage(message); + })); + } +} + +server.ErrorMessageTracker = ErrorMessageTracker; + +class RemoteConsoleImpl { + constructor() {} + rawAttach(connection) { + this._rawConnection = connection; + } + attach(connection) { + this._connection = connection; + } + get connection() { + if (!this._connection) { + throw new Error('Remote is not attached to a connection yet.'); + } + return this._connection; + } + fillServerCapabilities(_capabilities) {} + initialize(_capabilities) {} + error(message) { + this.send(vscode_languageserver_protocol_1$1.MessageType.Error, message); + } + warn(message) { + this.send(vscode_languageserver_protocol_1$1.MessageType.Warning, message); + } + info(message) { + this.send(vscode_languageserver_protocol_1$1.MessageType.Info, message); + } + log(message) { + this.send(vscode_languageserver_protocol_1$1.MessageType.Log, message); + } + debug(message) { + this.send(vscode_languageserver_protocol_1$1.MessageType.Debug, message); + } + send(type, message) { + if (this._rawConnection) { + this._rawConnection.sendNotification(vscode_languageserver_protocol_1$1.LogMessageNotification.type, { + type: type, + message: message + }).catch((() => { + (0, vscode_languageserver_protocol_1$1.RAL)().console.error(`Sending log message failed`); + })); + } + } +} + +class _RemoteWindowImpl { + constructor() {} + attach(connection) { + this._connection = connection; + } + get connection() { + if (!this._connection) { + throw new Error('Remote is not attached to a connection yet.'); + } + return this._connection; + } + initialize(_capabilities) {} + fillServerCapabilities(_capabilities) {} + showErrorMessage(message, ...actions) { + let params = { + type: vscode_languageserver_protocol_1$1.MessageType.Error, + message: message, + actions: actions + }; + return this.connection.sendRequest(vscode_languageserver_protocol_1$1.ShowMessageRequest.type, params).then(null2Undefined); + } + showWarningMessage(message, ...actions) { + let params = { + type: vscode_languageserver_protocol_1$1.MessageType.Warning, + message: message, + actions: actions + }; + return this.connection.sendRequest(vscode_languageserver_protocol_1$1.ShowMessageRequest.type, params).then(null2Undefined); + } + showInformationMessage(message, ...actions) { + let params = { + type: vscode_languageserver_protocol_1$1.MessageType.Info, + message: message, + actions: actions + }; + return this.connection.sendRequest(vscode_languageserver_protocol_1$1.ShowMessageRequest.type, params).then(null2Undefined); + } +} + +const RemoteWindowImpl = (0, showDocument_1.ShowDocumentFeature)((0, progress_1.ProgressFeature)(_RemoteWindowImpl)); + +var BulkRegistration; + +(function(BulkRegistration) { + function create() { + return new BulkRegistrationImpl; + } + BulkRegistration.create = create; +})(BulkRegistration || (server.BulkRegistration = BulkRegistration = {})); + +class BulkRegistrationImpl { + constructor() { + this._registrations = []; + this._registered = new Set; + } + add(type, registerOptions) { + const method = Is.string(type) ? type : type.method; + if (this._registered.has(method)) { + throw new Error(`${method} is already added to this registration`); + } + const id = UUID.generateUuid(); + this._registrations.push({ + id: id, + method: method, + registerOptions: registerOptions || {} + }); + this._registered.add(method); + } + asRegistrationParams() { + return { + registrations: this._registrations + }; + } +} + +var BulkUnregistration; + +(function(BulkUnregistration) { + function create() { + return new BulkUnregistrationImpl(undefined, []); + } + BulkUnregistration.create = create; +})(BulkUnregistration || (server.BulkUnregistration = BulkUnregistration = {})); + +class BulkUnregistrationImpl { + constructor(_connection, unregistrations) { + this._connection = _connection; + this._unregistrations = new Map; + unregistrations.forEach((unregistration => { + this._unregistrations.set(unregistration.method, unregistration); + })); + } + get isAttached() { + return !!this._connection; + } + attach(connection) { + this._connection = connection; + } + add(unregistration) { + this._unregistrations.set(unregistration.method, unregistration); + } + dispose() { + let unregistrations = []; + for (let unregistration of this._unregistrations.values()) { + unregistrations.push(unregistration); + } + let params = { + unregisterations: unregistrations + }; + this._connection.sendRequest(vscode_languageserver_protocol_1$1.UnregistrationRequest.type, params).catch((() => { + this._connection.console.info(`Bulk unregistration failed.`); + })); + } + disposeSingle(arg) { + const method = Is.string(arg) ? arg : arg.method; + const unregistration = this._unregistrations.get(method); + if (!unregistration) { + return false; + } + let params = { + unregisterations: [ unregistration ] + }; + this._connection.sendRequest(vscode_languageserver_protocol_1$1.UnregistrationRequest.type, params).then((() => { + this._unregistrations.delete(method); + }), (_error => { + this._connection.console.info(`Un-registering request handler for ${unregistration.id} failed.`); + })); + return true; + } +} + +class RemoteClientImpl { + attach(connection) { + this._connection = connection; + } + get connection() { + if (!this._connection) { + throw new Error('Remote is not attached to a connection yet.'); + } + return this._connection; + } + initialize(_capabilities) {} + fillServerCapabilities(_capabilities) {} + register(typeOrRegistrations, registerOptionsOrType, registerOptions) { + if (typeOrRegistrations instanceof BulkRegistrationImpl) { + return this.registerMany(typeOrRegistrations); + } else if (typeOrRegistrations instanceof BulkUnregistrationImpl) { + return this.registerSingle1(typeOrRegistrations, registerOptionsOrType, registerOptions); + } else { + return this.registerSingle2(typeOrRegistrations, registerOptionsOrType); + } + } + registerSingle1(unregistration, type, registerOptions) { + const method = Is.string(type) ? type : type.method; + const id = UUID.generateUuid(); + let params = { + registrations: [ { + id: id, + method: method, + registerOptions: registerOptions || {} + } ] + }; + if (!unregistration.isAttached) { + unregistration.attach(this.connection); + } + return this.connection.sendRequest(vscode_languageserver_protocol_1$1.RegistrationRequest.type, params).then((_result => { + unregistration.add({ + id: id, + method: method + }); + return unregistration; + }), (_error => { + this.connection.console.info(`Registering request handler for ${method} failed.`); + return Promise.reject(_error); + })); + } + registerSingle2(type, registerOptions) { + const method = Is.string(type) ? type : type.method; + const id = UUID.generateUuid(); + let params = { + registrations: [ { + id: id, + method: method, + registerOptions: registerOptions || {} + } ] + }; + return this.connection.sendRequest(vscode_languageserver_protocol_1$1.RegistrationRequest.type, params).then((_result => vscode_languageserver_protocol_1$1.Disposable.create((() => { + this.unregisterSingle(id, method).catch((() => { + this.connection.console.info(`Un-registering capability with id ${id} failed.`); + })); + }))), (_error => { + this.connection.console.info(`Registering request handler for ${method} failed.`); + return Promise.reject(_error); + })); + } + unregisterSingle(id, method) { + let params = { + unregisterations: [ { + id: id, + method: method + } ] + }; + return this.connection.sendRequest(vscode_languageserver_protocol_1$1.UnregistrationRequest.type, params).catch((() => { + this.connection.console.info(`Un-registering request handler for ${id} failed.`); + })); + } + registerMany(registrations) { + let params = registrations.asRegistrationParams(); + return this.connection.sendRequest(vscode_languageserver_protocol_1$1.RegistrationRequest.type, params).then((() => new BulkUnregistrationImpl(this._connection, params.registrations.map((registration => ({ + id: registration.id, + method: registration.method + }))))), (_error => { + this.connection.console.info(`Bulk registration failed.`); + return Promise.reject(_error); + })); + } +} + +class _RemoteWorkspaceImpl { + constructor() {} + attach(connection) { + this._connection = connection; + } + get connection() { + if (!this._connection) { + throw new Error('Remote is not attached to a connection yet.'); + } + return this._connection; + } + initialize(_capabilities) {} + fillServerCapabilities(_capabilities) {} + applyEdit(paramOrEdit) { + function isApplyWorkspaceEditParams(value) { + return value && !!value.edit; + } + let params = isApplyWorkspaceEditParams(paramOrEdit) ? paramOrEdit : { + edit: paramOrEdit + }; + return this.connection.sendRequest(vscode_languageserver_protocol_1$1.ApplyWorkspaceEditRequest.type, params); + } +} + +const RemoteWorkspaceImpl = (0, fileOperations_1.FileOperationsFeature)((0, workspaceFolder_1.WorkspaceFoldersFeature)((0, +configuration_1.ConfigurationFeature)(_RemoteWorkspaceImpl))); + +class TracerImpl { + constructor() { + this._trace = vscode_languageserver_protocol_1$1.Trace.Off; + } + attach(connection) { + this._connection = connection; + } + get connection() { + if (!this._connection) { + throw new Error('Remote is not attached to a connection yet.'); + } + return this._connection; + } + initialize(_capabilities) {} + fillServerCapabilities(_capabilities) {} + set trace(value) { + this._trace = value; + } + log(message, verbose) { + if (this._trace === vscode_languageserver_protocol_1$1.Trace.Off) { + return; + } + this.connection.sendNotification(vscode_languageserver_protocol_1$1.LogTraceNotification.type, { + message: message, + verbose: this._trace === vscode_languageserver_protocol_1$1.Trace.Verbose ? verbose : undefined + }).catch((() => {})); + } +} + +class TelemetryImpl { + constructor() {} + attach(connection) { + this._connection = connection; + } + get connection() { + if (!this._connection) { + throw new Error('Remote is not attached to a connection yet.'); + } + return this._connection; + } + initialize(_capabilities) {} + fillServerCapabilities(_capabilities) {} + logEvent(data) { + this.connection.sendNotification(vscode_languageserver_protocol_1$1.TelemetryEventNotification.type, data).catch((() => { + this.connection.console.log(`Sending TelemetryEventNotification failed`); + })); + } +} + +class _LanguagesImpl { + constructor() {} + attach(connection) { + this._connection = connection; + } + get connection() { + if (!this._connection) { + throw new Error('Remote is not attached to a connection yet.'); + } + return this._connection; + } + initialize(_capabilities) {} + fillServerCapabilities(_capabilities) {} + attachWorkDoneProgress(params) { + return (0, progress_1.attachWorkDone)(this.connection, params); + } + attachPartialResultProgress(_type, params) { + return (0, progress_1.attachPartialResult)(this.connection, params); + } +} + +server._LanguagesImpl = _LanguagesImpl; + +const LanguagesImpl = (0, foldingRange_1.FoldingRangeFeature)((0, moniker_1.MonikerFeature)((0, +diagnostic_1.DiagnosticFeature)((0, inlayHint_1.InlayHintFeature)((0, inlineValue_1.InlineValueFeature)((0, +typeHierarchy_1.TypeHierarchyFeature)((0, linkedEditingRange_1.LinkedEditingRangeFeature)((0, +semanticTokens_1.SemanticTokensFeature)((0, callHierarchy_1.CallHierarchyFeature)(_LanguagesImpl))))))))); + +class _NotebooksImpl { + constructor() {} + attach(connection) { + this._connection = connection; + } + get connection() { + if (!this._connection) { + throw new Error('Remote is not attached to a connection yet.'); + } + return this._connection; + } + initialize(_capabilities) {} + fillServerCapabilities(_capabilities) {} + attachWorkDoneProgress(params) { + return (0, progress_1.attachWorkDone)(this.connection, params); + } + attachPartialResultProgress(_type, params) { + return (0, progress_1.attachPartialResult)(this.connection, params); + } +} + +server._NotebooksImpl = _NotebooksImpl; + +const NotebooksImpl = (0, notebook_1.NotebookSyncFeature)(_NotebooksImpl); + +function combineConsoleFeatures(one, two) { + return function(Base) { + return two(one(Base)); + }; +} + +server.combineConsoleFeatures = combineConsoleFeatures; + +function combineTelemetryFeatures(one, two) { + return function(Base) { + return two(one(Base)); + }; +} + +server.combineTelemetryFeatures = combineTelemetryFeatures; + +function combineTracerFeatures(one, two) { + return function(Base) { + return two(one(Base)); + }; +} + +server.combineTracerFeatures = combineTracerFeatures; + +function combineClientFeatures(one, two) { + return function(Base) { + return two(one(Base)); + }; +} + +server.combineClientFeatures = combineClientFeatures; + +function combineWindowFeatures(one, two) { + return function(Base) { + return two(one(Base)); + }; +} + +server.combineWindowFeatures = combineWindowFeatures; + +function combineWorkspaceFeatures(one, two) { + return function(Base) { + return two(one(Base)); + }; +} + +server.combineWorkspaceFeatures = combineWorkspaceFeatures; + +function combineLanguagesFeatures(one, two) { + return function(Base) { + return two(one(Base)); + }; +} + +server.combineLanguagesFeatures = combineLanguagesFeatures; + +function combineNotebooksFeatures(one, two) { + return function(Base) { + return two(one(Base)); + }; +} + +server.combineNotebooksFeatures = combineNotebooksFeatures; + +function combineFeatures(one, two) { + function combine(one, two, func) { + if (one && two) { + return func(one, two); + } else if (one) { + return one; + } else { + return two; + } + } + let result = { + __brand: 'features', + console: combine(one.console, two.console, combineConsoleFeatures), + tracer: combine(one.tracer, two.tracer, combineTracerFeatures), + telemetry: combine(one.telemetry, two.telemetry, combineTelemetryFeatures), + client: combine(one.client, two.client, combineClientFeatures), + window: combine(one.window, two.window, combineWindowFeatures), + workspace: combine(one.workspace, two.workspace, combineWorkspaceFeatures), + languages: combine(one.languages, two.languages, combineLanguagesFeatures), + notebooks: combine(one.notebooks, two.notebooks, combineNotebooksFeatures) + }; + return result; +} + +server.combineFeatures = combineFeatures; + +function createConnection(connectionFactory, watchDog, factories) { + const logger = factories && factories.console ? new (factories.console(RemoteConsoleImpl)) : new RemoteConsoleImpl; + const connection = connectionFactory(logger); + logger.rawAttach(connection); + const tracer = factories && factories.tracer ? new (factories.tracer(TracerImpl)) : new TracerImpl; + const telemetry = factories && factories.telemetry ? new (factories.telemetry(TelemetryImpl)) : new TelemetryImpl; + const client = factories && factories.client ? new (factories.client(RemoteClientImpl)) : new RemoteClientImpl; + const remoteWindow = factories && factories.window ? new (factories.window(RemoteWindowImpl)) : new RemoteWindowImpl; + const workspace = factories && factories.workspace ? new (factories.workspace(RemoteWorkspaceImpl)) : new RemoteWorkspaceImpl; + const languages = factories && factories.languages ? new (factories.languages(LanguagesImpl)) : new LanguagesImpl; + const notebooks = factories && factories.notebooks ? new (factories.notebooks(NotebooksImpl)) : new NotebooksImpl; + const allRemotes = [ logger, tracer, telemetry, client, remoteWindow, workspace, languages, notebooks ]; + function asPromise(value) { + if (value instanceof Promise) { + return value; + } else if (Is.thenable(value)) { + return new Promise(((resolve, reject) => { + value.then((resolved => resolve(resolved)), (error => reject(error))); + })); + } else { + return Promise.resolve(value); + } + } + let shutdownHandler = undefined; + let initializeHandler = undefined; + let exitHandler = undefined; + let protocolConnection = { + listen: () => connection.listen(), + sendRequest: (type, ...params) => connection.sendRequest(Is.string(type) ? type : type.method, ...params), + onRequest: (type, handler) => connection.onRequest(type, handler), + sendNotification: (type, param) => { + const method = Is.string(type) ? type : type.method; + return connection.sendNotification(method, param); + }, + onNotification: (type, handler) => connection.onNotification(type, handler), + onProgress: connection.onProgress, + sendProgress: connection.sendProgress, + onInitialize: handler => { + initializeHandler = handler; + return { + dispose: () => { + initializeHandler = undefined; + } + }; + }, + onInitialized: handler => connection.onNotification(vscode_languageserver_protocol_1$1.InitializedNotification.type, handler), + onShutdown: handler => { + shutdownHandler = handler; + return { + dispose: () => { + shutdownHandler = undefined; + } + }; + }, + onExit: handler => { + exitHandler = handler; + return { + dispose: () => { + exitHandler = undefined; + } + }; + }, + get console() { + return logger; + }, + get telemetry() { + return telemetry; + }, + get tracer() { + return tracer; + }, + get client() { + return client; + }, + get window() { + return remoteWindow; + }, + get workspace() { + return workspace; + }, + get languages() { + return languages; + }, + get notebooks() { + return notebooks; + }, + onDidChangeConfiguration: handler => connection.onNotification(vscode_languageserver_protocol_1$1.DidChangeConfigurationNotification.type, handler), + onDidChangeWatchedFiles: handler => connection.onNotification(vscode_languageserver_protocol_1$1.DidChangeWatchedFilesNotification.type, handler), + __textDocumentSync: undefined, + onDidOpenTextDocument: handler => connection.onNotification(vscode_languageserver_protocol_1$1.DidOpenTextDocumentNotification.type, handler), + onDidChangeTextDocument: handler => connection.onNotification(vscode_languageserver_protocol_1$1.DidChangeTextDocumentNotification.type, handler), + onDidCloseTextDocument: handler => connection.onNotification(vscode_languageserver_protocol_1$1.DidCloseTextDocumentNotification.type, handler), + onWillSaveTextDocument: handler => connection.onNotification(vscode_languageserver_protocol_1$1.WillSaveTextDocumentNotification.type, handler), + onWillSaveTextDocumentWaitUntil: handler => connection.onRequest(vscode_languageserver_protocol_1$1.WillSaveTextDocumentWaitUntilRequest.type, handler), + onDidSaveTextDocument: handler => connection.onNotification(vscode_languageserver_protocol_1$1.DidSaveTextDocumentNotification.type, handler), + sendDiagnostics: params => connection.sendNotification(vscode_languageserver_protocol_1$1.PublishDiagnosticsNotification.type, params), + onHover: handler => connection.onRequest(vscode_languageserver_protocol_1$1.HoverRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), undefined))), + onCompletion: handler => connection.onRequest(vscode_languageserver_protocol_1$1.CompletionRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onCompletionResolve: handler => connection.onRequest(vscode_languageserver_protocol_1$1.CompletionResolveRequest.type, handler), + onSignatureHelp: handler => connection.onRequest(vscode_languageserver_protocol_1$1.SignatureHelpRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), undefined))), + onDeclaration: handler => connection.onRequest(vscode_languageserver_protocol_1$1.DeclarationRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onDefinition: handler => connection.onRequest(vscode_languageserver_protocol_1$1.DefinitionRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onTypeDefinition: handler => connection.onRequest(vscode_languageserver_protocol_1$1.TypeDefinitionRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onImplementation: handler => connection.onRequest(vscode_languageserver_protocol_1$1.ImplementationRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onReferences: handler => connection.onRequest(vscode_languageserver_protocol_1$1.ReferencesRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onDocumentHighlight: handler => connection.onRequest(vscode_languageserver_protocol_1$1.DocumentHighlightRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onDocumentSymbol: handler => connection.onRequest(vscode_languageserver_protocol_1$1.DocumentSymbolRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onWorkspaceSymbol: handler => connection.onRequest(vscode_languageserver_protocol_1$1.WorkspaceSymbolRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onWorkspaceSymbolResolve: handler => connection.onRequest(vscode_languageserver_protocol_1$1.WorkspaceSymbolResolveRequest.type, handler), + onCodeAction: handler => connection.onRequest(vscode_languageserver_protocol_1$1.CodeActionRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onCodeActionResolve: handler => connection.onRequest(vscode_languageserver_protocol_1$1.CodeActionResolveRequest.type, ((params, cancel) => handler(params, cancel))), + onCodeLens: handler => connection.onRequest(vscode_languageserver_protocol_1$1.CodeLensRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onCodeLensResolve: handler => connection.onRequest(vscode_languageserver_protocol_1$1.CodeLensResolveRequest.type, ((params, cancel) => handler(params, cancel))), + onDocumentFormatting: handler => connection.onRequest(vscode_languageserver_protocol_1$1.DocumentFormattingRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), undefined))), + onDocumentRangeFormatting: handler => connection.onRequest(vscode_languageserver_protocol_1$1.DocumentRangeFormattingRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), undefined))), + onDocumentOnTypeFormatting: handler => connection.onRequest(vscode_languageserver_protocol_1$1.DocumentOnTypeFormattingRequest.type, ((params, cancel) => handler(params, cancel))), + onRenameRequest: handler => connection.onRequest(vscode_languageserver_protocol_1$1.RenameRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), undefined))), + onPrepareRename: handler => connection.onRequest(vscode_languageserver_protocol_1$1.PrepareRenameRequest.type, ((params, cancel) => handler(params, cancel))), + onDocumentLinks: handler => connection.onRequest(vscode_languageserver_protocol_1$1.DocumentLinkRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onDocumentLinkResolve: handler => connection.onRequest(vscode_languageserver_protocol_1$1.DocumentLinkResolveRequest.type, ((params, cancel) => handler(params, cancel))), + onDocumentColor: handler => connection.onRequest(vscode_languageserver_protocol_1$1.DocumentColorRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onColorPresentation: handler => connection.onRequest(vscode_languageserver_protocol_1$1.ColorPresentationRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onFoldingRanges: handler => connection.onRequest(vscode_languageserver_protocol_1$1.FoldingRangeRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onSelectionRanges: handler => connection.onRequest(vscode_languageserver_protocol_1$1.SelectionRangeRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params)))), + onExecuteCommand: handler => connection.onRequest(vscode_languageserver_protocol_1$1.ExecuteCommandRequest.type, ((params, cancel) => handler(params, cancel, (0, + progress_1.attachWorkDone)(connection, params), undefined))), + dispose: () => connection.dispose() + }; + for (let remote of allRemotes) { + remote.attach(protocolConnection); + } + connection.onRequest(vscode_languageserver_protocol_1$1.InitializeRequest.type, (params => { + watchDog.initialize(params); + if (Is.string(params.trace)) { + tracer.trace = vscode_languageserver_protocol_1$1.Trace.fromString(params.trace); + } + for (let remote of allRemotes) { + remote.initialize(params.capabilities); + } + if (initializeHandler) { + let result = initializeHandler(params, (new vscode_languageserver_protocol_1$1.CancellationTokenSource).token, (0, + progress_1.attachWorkDone)(connection, params), undefined); + return asPromise(result).then((value => { + if (value instanceof vscode_languageserver_protocol_1$1.ResponseError) { + return value; + } + let result = value; + if (!result) { + result = { + capabilities: {} + }; + } + let capabilities = result.capabilities; + if (!capabilities) { + capabilities = {}; + result.capabilities = capabilities; + } + if (capabilities.textDocumentSync === undefined || capabilities.textDocumentSync === null) { + capabilities.textDocumentSync = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1$1.TextDocumentSyncKind.None; + } else if (!Is.number(capabilities.textDocumentSync) && !Is.number(capabilities.textDocumentSync.change)) { + capabilities.textDocumentSync.change = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1$1.TextDocumentSyncKind.None; + } + for (let remote of allRemotes) { + remote.fillServerCapabilities(capabilities); + } + return result; + })); + } else { + let result = { + capabilities: { + textDocumentSync: vscode_languageserver_protocol_1$1.TextDocumentSyncKind.None + } + }; + for (let remote of allRemotes) { + remote.fillServerCapabilities(result.capabilities); + } + return result; + } + })); + connection.onRequest(vscode_languageserver_protocol_1$1.ShutdownRequest.type, (() => { + watchDog.shutdownReceived = true; + if (shutdownHandler) { + return shutdownHandler((new vscode_languageserver_protocol_1$1.CancellationTokenSource).token); + } else { + return undefined; + } + })); + connection.onNotification(vscode_languageserver_protocol_1$1.ExitNotification.type, (() => { + try { + if (exitHandler) { + exitHandler(); + } + } finally { + if (watchDog.shutdownReceived) { + watchDog.exit(0); + } else { + watchDog.exit(1); + } + } + })); + connection.onNotification(vscode_languageserver_protocol_1$1.SetTraceNotification.type, (params => { + tracer.trace = vscode_languageserver_protocol_1$1.Trace.fromString(params.value); + })); + return protocolConnection; +} + +server.createConnection = createConnection; + +var files = {}; + +Object.defineProperty(files, '__esModule', { + value: true +}); + +files.resolveModulePath = files.FileSystem = files.resolveGlobalYarnPath = files.resolveGlobalNodePath = files.resolve = files.uriToFilePath = void 0; + +const url = require$$0$3; + +const path$c = require$$1$1; + +const fs$j = require$$0$1; + +const child_process_1 = require$$1; + +function uriToFilePath(uri) { + let parsed = url.parse(uri); + if (parsed.protocol !== 'file:' || !parsed.path) { + return undefined; + } + let segments = parsed.path.split('/'); + for (var i = 0, len = segments.length; i < len; i++) { + segments[i] = decodeURIComponent(segments[i]); + } + if (process.platform === 'win32' && segments.length > 1) { + let first = segments[0]; + let second = segments[1]; + if (first.length === 0 && second.length > 1 && second[1] === ':') { + segments.shift(); + } + } + return path$c.normalize(segments.join('/')); +} + +files.uriToFilePath = uriToFilePath; + +function isWindows$1() { + return process.platform === 'win32'; +} + +function resolve(moduleName, nodePath, cwd, tracer) { + const nodePathKey = 'NODE_PATH'; + const app = [ 'var p = process;', 'p.on(\'message\',function(m){', 'if(m.c===\'e\'){', 'p.exit(0);', '}', 'else if(m.c===\'rs\'){', 'try{', 'var r=require.resolve(m.a);', 'p.send({c:\'r\',s:true,r:r});', '}', 'catch(err){', 'p.send({c:\'r\',s:false});', '}', '}', '});' ].join(''); + return new Promise(((resolve, reject) => { + let env = process.env; + let newEnv = Object.create(null); + Object.keys(env).forEach((key => newEnv[key] = env[key])); + if (nodePath && fs$j.existsSync(nodePath)) { + if (newEnv[nodePathKey]) { + newEnv[nodePathKey] = nodePath + path$c.delimiter + newEnv[nodePathKey]; + } else { + newEnv[nodePathKey] = nodePath; + } + if (tracer) { + tracer(`NODE_PATH value is: ${newEnv[nodePathKey]}`); + } + } + newEnv['ELECTRON_RUN_AS_NODE'] = '1'; + try { + let cp = (0, child_process_1.fork)('', [], { + cwd: cwd, + env: newEnv, + execArgv: [ '-e', app ] + }); + if (cp.pid === void 0) { + reject(new Error(`Starting process to resolve node module ${moduleName} failed`)); + return; + } + cp.on('error', (error => { + reject(error); + })); + cp.on('message', (message => { + if (message.c === 'r') { + cp.send({ + c: 'e' + }); + if (message.s) { + resolve(message.r); + } else { + reject(new Error(`Failed to resolve module: ${moduleName}`)); + } + } + })); + let message = { + c: 'rs', + a: moduleName + }; + cp.send(message); + } catch (error) { + reject(error); + } + })); +} + +files.resolve = resolve; + +function resolveGlobalNodePath(tracer) { + let npmCommand = 'npm'; + const env = Object.create(null); + Object.keys(process.env).forEach((key => env[key] = process.env[key])); + env['NO_UPDATE_NOTIFIER'] = 'true'; + const options = { + encoding: 'utf8', + env: env + }; + if (isWindows$1()) { + npmCommand = 'npm.cmd'; + options.shell = true; + } + let handler = () => {}; + try { + process.on('SIGPIPE', handler); + let stdout = (0, child_process_1.spawnSync)(npmCommand, [ 'config', 'get', 'prefix' ], options).stdout; + if (!stdout) { + if (tracer) { + tracer(`'npm config get prefix' didn't return a value.`); + } + return undefined; + } + let prefix = stdout.trim(); + if (tracer) { + tracer(`'npm config get prefix' value is: ${prefix}`); + } + if (prefix.length > 0) { + if (isWindows$1()) { + return path$c.join(prefix, 'node_modules'); + } else { + return path$c.join(prefix, 'lib', 'node_modules'); + } + } + return undefined; + } catch (err) { + return undefined; + } finally { + process.removeListener('SIGPIPE', handler); + } +} + +files.resolveGlobalNodePath = resolveGlobalNodePath; + +function resolveGlobalYarnPath(tracer) { + let yarnCommand = 'yarn'; + let options = { + encoding: 'utf8' + }; + if (isWindows$1()) { + yarnCommand = 'yarn.cmd'; + options.shell = true; + } + let handler = () => {}; + try { + process.on('SIGPIPE', handler); + let results = (0, child_process_1.spawnSync)(yarnCommand, [ 'global', 'dir', '--json' ], options); + let stdout = results.stdout; + if (!stdout) { + if (tracer) { + tracer(`'yarn global dir' didn't return a value.`); + if (results.stderr) { + tracer(results.stderr); + } + } + return undefined; + } + let lines = stdout.trim().split(/\r?\n/); + for (let line of lines) { + try { + let yarn = JSON.parse(line); + if (yarn.type === 'log') { + return path$c.join(yarn.data, 'node_modules'); + } + } catch (e) {} + } + return undefined; + } catch (err) { + return undefined; + } finally { + process.removeListener('SIGPIPE', handler); + } +} + +files.resolveGlobalYarnPath = resolveGlobalYarnPath; + +var FileSystem; + +(function(FileSystem) { + let _isCaseSensitive = undefined; + function isCaseSensitive() { + if (_isCaseSensitive !== void 0) { + return _isCaseSensitive; + } + if (process.platform === 'win32') { + _isCaseSensitive = false; + } else { + _isCaseSensitive = !fs$j.existsSync(__filename.toUpperCase()) || !fs$j.existsSync(__filename.toLowerCase()); + } + return _isCaseSensitive; + } + FileSystem.isCaseSensitive = isCaseSensitive; + function isParent(parent, child) { + if (isCaseSensitive()) { + return path$c.normalize(child).indexOf(path$c.normalize(parent)) === 0; + } else { + return path$c.normalize(child).toLowerCase().indexOf(path$c.normalize(parent).toLowerCase()) === 0; + } + } + FileSystem.isParent = isParent; +})(FileSystem || (files.FileSystem = FileSystem = {})); + +function resolveModulePath(workspaceRoot, moduleName, nodePath, tracer) { + if (nodePath) { + if (!path$c.isAbsolute(nodePath)) { + nodePath = path$c.join(workspaceRoot, nodePath); + } + return resolve(moduleName, nodePath, nodePath, tracer).then((value => { + if (FileSystem.isParent(nodePath, value)) { + return value; + } else { + return Promise.reject(new Error(`Failed to load ${moduleName} from node path location.`)); + } + })).then(undefined, (_error => resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer))); + } else { + return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer); + } +} + +files.resolveModulePath = resolveModulePath; + +var node$1 = main$2; + +var api = {}; + +var inlineCompletion_proposed = {}; + +Object.defineProperty(inlineCompletion_proposed, '__esModule', { + value: true +}); + +inlineCompletion_proposed.InlineCompletionFeature = void 0; + +const vscode_languageserver_protocol_1 = main$2; + +const InlineCompletionFeature = Base => class extends Base { + get inlineCompletion() { + return { + on: handler => this.connection.onRequest(vscode_languageserver_protocol_1.InlineCompletionRequest.type, ((params, cancel) => handler(params, cancel, this.attachWorkDoneProgress(params)))) + }; + } +}; + +inlineCompletion_proposed.InlineCompletionFeature = InlineCompletionFeature; + +(function(exports) { + var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function() { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(m, exports) { + for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); + }; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.ProposedFeatures = exports.NotebookDocuments = exports.TextDocuments = exports.SemanticTokensBuilder = void 0; + const semanticTokens_1 = semanticTokens; + Object.defineProperty(exports, 'SemanticTokensBuilder', { + enumerable: true, + get: function() { + return semanticTokens_1.SemanticTokensBuilder; + } + }); + const ic = inlineCompletion_proposed; + __exportStar(main$2, exports); + const textDocuments_1 = textDocuments; + Object.defineProperty(exports, 'TextDocuments', { + enumerable: true, + get: function() { + return textDocuments_1.TextDocuments; + } + }); + const notebook_1 = notebook; + Object.defineProperty(exports, 'NotebookDocuments', { + enumerable: true, + get: function() { + return notebook_1.NotebookDocuments; + } + }); + __exportStar(server, exports); + var ProposedFeatures; + (function(ProposedFeatures) { + ProposedFeatures.all = { + __brand: 'features', + languages: ic.InlineCompletionFeature + }; + })(ProposedFeatures || (exports.ProposedFeatures = ProposedFeatures = {})); +})(api); + +(function(exports) { + var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function() { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(m, exports) { + for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); + }; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.createConnection = exports.Files = void 0; + const node_util_1 = require$$0$4; + const Is = is$2; + const server_1 = server; + const fm = files; + const node_1 = node$1; + __exportStar(node$1, exports); + __exportStar(api, exports); + var Files; + (function(Files) { + Files.uriToFilePath = fm.uriToFilePath; + Files.resolveGlobalNodePath = fm.resolveGlobalNodePath; + Files.resolveGlobalYarnPath = fm.resolveGlobalYarnPath; + Files.resolve = fm.resolve; + Files.resolveModulePath = fm.resolveModulePath; + })(Files || (exports.Files = Files = {})); + function endProtocolConnection() { + { + return; + } + } + let _shutdownReceived = false; + let exitTimer = undefined; + function setupExitTimer() { + const argName = '--clientProcessId'; + function runTimer(value) { + try { + let processId = parseInt(value); + if (!isNaN(processId)) { + exitTimer = setInterval((() => { + try { + process.kill(processId, 0); + } catch (ex) { + endProtocolConnection(); + process.exit(_shutdownReceived ? 0 : 1); + } + }), 3e3); + } + } catch (e) {} + } + for (let i = 2; i < process.argv.length; i++) { + let arg = process.argv[i]; + if (arg === argName && i + 1 < process.argv.length) { + runTimer(process.argv[i + 1]); + return; + } else { + let args = arg.split('='); + if (args[0] === argName) { + runTimer(args[1]); + } + } + } + } + setupExitTimer(); + const watchDog = { + initialize: params => { + const processId = params.processId; + if (Is.number(processId) && exitTimer === undefined) { + setInterval((() => { + try { + process.kill(processId, 0); + } catch (ex) { + process.exit(_shutdownReceived ? 0 : 1); + } + }), 3e3); + } + }, + get shutdownReceived() { + return _shutdownReceived; + }, + set shutdownReceived(value) { + _shutdownReceived = value; + }, + exit: code => { + process.exit(code); + } + }; + function createConnection(arg1, arg2, arg3, arg4) { + let factories; + let input; + let output; + let options; + if (arg1 !== void 0 && arg1.__brand === 'features') { + factories = arg1; + arg1 = arg2; + arg2 = arg3; + arg3 = arg4; + } + if (node_1.ConnectionStrategy.is(arg1) || node_1.ConnectionOptions.is(arg1)) { + options = arg1; + } else { + input = arg1; + output = arg2; + options = arg3; + } + return _createConnection(input, output, options, factories); + } + exports.createConnection = createConnection; + function _createConnection(input, output, options, factories) { + let stdio = false; + if (!input && !output && process.argv.length > 2) { + let port = void 0; + let pipeName = void 0; + let argv = process.argv.slice(2); + for (let i = 0; i < argv.length; i++) { + let arg = argv[i]; + if (arg === '--node-ipc') { + input = new node_1.IPCMessageReader(process); + output = new node_1.IPCMessageWriter(process); + break; + } else if (arg === '--stdio') { + stdio = true; + input = process.stdin; + output = process.stdout; + break; + } else if (arg === '--socket') { + port = parseInt(argv[i + 1]); + break; + } else if (arg === '--pipe') { + pipeName = argv[i + 1]; + break; + } else { + var args = arg.split('='); + if (args[0] === '--socket') { + port = parseInt(args[1]); + break; + } else if (args[0] === '--pipe') { + pipeName = args[1]; + break; + } + } + } + if (port) { + let transport = (0, node_1.createServerSocketTransport)(port); + input = transport[0]; + output = transport[1]; + } else if (pipeName) { + let transport = (0, node_1.createServerPipeTransport)(pipeName); + input = transport[0]; + output = transport[1]; + } + } + var commandLineMessage = 'Use arguments of createConnection or set command line parameters: \'--node-ipc\', \'--stdio\' or \'--socket={number}\''; + if (!input) { + throw new Error('Connection input stream is not set. ' + commandLineMessage); + } + if (!output) { + throw new Error('Connection output stream is not set. ' + commandLineMessage); + } + if (Is.func(input.read) && Is.func(input.on)) { + let inputStream = input; + inputStream.on('end', (() => { + process.exit(_shutdownReceived ? 0 : 1); + })); + inputStream.on('close', (() => { + process.exit(_shutdownReceived ? 0 : 1); + })); + } + const connectionFactory = logger => { + const result = (0, node_1.createProtocolConnection)(input, output, logger, options); + if (stdio) { + patchConsole(logger); + } + return result; + }; + return (0, server_1.createConnection)(connectionFactory, watchDog, factories); + } + function patchConsole(logger) { + function serialize(args) { + return args.map((arg => typeof arg === 'string' ? arg : (0, node_util_1.inspect)(arg))).join(' '); + } + const counters = new Map; + console.assert = function assert(assertion, ...args) { + if (assertion) { + return; + } + if (args.length === 0) { + logger.error('Assertion failed'); + } else { + const [message, ...rest] = args; + logger.error(`Assertion failed: ${message} ${serialize(rest)}`); + } + }; + console.count = function count(label = 'default') { + const message = String(label); + let counter = counters.get(message) ?? 0; + counter += 1; + counters.set(message, counter); + logger.log(`${message}: ${message}`); + }; + console.countReset = function countReset(label) { + if (label === undefined) { + counters.clear(); + } else { + counters.delete(String(label)); + } + }; + console.debug = function debug(...args) { + logger.log(serialize(args)); + }; + console.dir = function dir(arg, options) { + logger.log((0, node_util_1.inspect)(arg, options)); + }; + console.log = function log(...args) { + logger.log(serialize(args)); + }; + console.error = function error(...args) { + logger.error(serialize(args)); + }; + console.trace = function trace(...args) { + const stack = (new Error).stack.replace(/(.+\n){2}/, ''); + let message = 'Trace'; + if (args.length !== 0) { + message += `: ${serialize(args)}`; + } + logger.log(`${message}\n${stack}`); + }; + console.warn = function warn(...args) { + logger.warn(serialize(args)); + }; + } +})(main$3); + +const lsp$1 = getDefaultExportFromCjs(main$3); + +var node = main$3; + +const lsp = getDefaultExportFromCjs(node); + +var LogLevel; + +(function(LogLevel) { + LogLevel[LogLevel['Error'] = 0] = 'Error'; + LogLevel[LogLevel['Warning'] = 1] = 'Warning'; + LogLevel[LogLevel['Info'] = 2] = 'Info'; + LogLevel[LogLevel['Log'] = 3] = 'Log'; +})(LogLevel || (LogLevel = {})); + +(function(LogLevel) { + function fromString(value) { + switch (value?.toLowerCase()) { + case 'log': + return LogLevel.Log; + + case 'info': + return LogLevel.Info; + + case 'warning': + return LogLevel.Warning; + + case 'error': + default: + return LogLevel.Error; + } + } + LogLevel.fromString = fromString; + function toString(level) { + switch (level) { + case LogLevel.Error: + return 'error'; + + case LogLevel.Warning: + return 'warning'; + + case LogLevel.Info: + return 'info'; + + case LogLevel.Log: + return 'log'; + } + } + LogLevel.toString = toString; +})(LogLevel || (LogLevel = {})); + +class LspClientLogger { + constructor(client, level) { + this.client = client; + this.level = level; + } + sendMessage(severity, messageObjects, options) { + if (this.level >= severity || options?.overrideLevel) { + const message = messageObjects.map((p => { + if (typeof p === 'object') { + return JSON.stringify(p, null, 2); + } else { + return p; + } + })).join(' '); + this.client.logMessage({ + type: severity, + message: message + }); + } + } + logLevelToLspMessageType(level) { + switch (level) { + case LogLevel.Log: + return lsp$1.MessageType.Log; + + case LogLevel.Info: + return lsp$1.MessageType.Info; + + case LogLevel.Warning: + return lsp$1.MessageType.Warning; + + case LogLevel.Error: + return lsp$1.MessageType.Error; + } + } + error(...args) { + this.sendMessage(lsp$1.MessageType.Error, args); + } + warn(...args) { + this.sendMessage(lsp$1.MessageType.Warning, args); + } + info(...args) { + this.sendMessage(lsp$1.MessageType.Info, args); + } + log(...args) { + this.sendMessage(lsp$1.MessageType.Log, args); + } + logIgnoringVerbosity(level, ...args) { + this.sendMessage(this.logLevelToLspMessageType(level), args, { + overrideLevel: true + }); + } + trace(level, message, data) { + this.logIgnoringVerbosity(LogLevel.Log, `[${level} - ${now()}] ${message}`); + if (data) { + this.logIgnoringVerbosity(LogLevel.Log, data2String(data)); + } + } +} + +class PrefixingLogger { + constructor(logger, prefix) { + this.logger = logger; + this.prefix = prefix; + } + error(...args) { + this.logger.error(this.prefix, ...args); + } + warn(...args) { + this.logger.warn(this.prefix, ...args); + } + info(...args) { + this.logger.info(this.prefix, ...args); + } + log(...args) { + this.logger.log(this.prefix, ...args); + } + logIgnoringVerbosity(level, ...args) { + this.logger.logIgnoringVerbosity(level, this.prefix, ...args); + } + trace(level, message, data) { + this.logIgnoringVerbosity(LogLevel.Log, this.prefix, `[${level} - ${now()}] ${message}`); + if (data) { + this.logIgnoringVerbosity(LogLevel.Log, this.prefix, data2String(data)); + } + } +} + +function now() { + const now = new Date; + return `${padLeft(`${now.getUTCHours()}`, 2, '0')}:${padLeft(`${now.getMinutes()}`, 2, '0')}:${padLeft(`${now.getUTCSeconds()}`, 2, '0')}.${now.getMilliseconds()}`; +} + +function padLeft(s, n, pad = ' ') { + return pad.repeat(Math.max(0, n - s.length)) + s; +} + +function data2String(data) { + if (data instanceof Error) { + return data.stack || data.message; + } + if (data.success === false && data.message) { + return data.message; + } + return data.toString(); +} + +var fs$i = {}; + +var universalify$1 = {}; + +universalify$1.fromCallback = function(fn) { + return Object.defineProperty((function(...args) { + if (typeof args[args.length - 1] === 'function') fn.apply(this, args); else { + return new Promise(((resolve, reject) => { + args.push(((err, res) => err != null ? reject(err) : resolve(res))); + fn.apply(this, args); + })); + } + }), 'name', { + value: fn.name + }); +}; + +universalify$1.fromPromise = function(fn) { + return Object.defineProperty((function(...args) { + const cb = args[args.length - 1]; + if (typeof cb !== 'function') return fn.apply(this, args); else { + args.pop(); + fn.apply(this, args).then((r => cb(null, r)), cb); + } + }), 'name', { + value: fn.name + }); +}; + +var constants$2 = require$$0$5; + +var origCwd = process.cwd; + +var cwd = null; + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform; + +process.cwd = function() { + if (!cwd) cwd = origCwd.call(process); + return cwd; +}; + +try { + process.cwd(); +} catch (er) {} + +if (typeof process.chdir === 'function') { + var chdir = process.chdir; + process.chdir = function(d) { + cwd = null; + chdir.call(process, d); + }; + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir); +} + +var polyfills$1 = patch$3; + +function patch$3(fs) { + if (constants$2.hasOwnProperty('O_SYMLINK') && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs); + } + if (!fs.lutimes) { + patchLutimes(fs); + } + fs.chown = chownFix(fs.chown); + fs.fchown = chownFix(fs.fchown); + fs.lchown = chownFix(fs.lchown); + fs.chmod = chmodFix(fs.chmod); + fs.fchmod = chmodFix(fs.fchmod); + fs.lchmod = chmodFix(fs.lchmod); + fs.chownSync = chownFixSync(fs.chownSync); + fs.fchownSync = chownFixSync(fs.fchownSync); + fs.lchownSync = chownFixSync(fs.lchownSync); + fs.chmodSync = chmodFixSync(fs.chmodSync); + fs.fchmodSync = chmodFixSync(fs.fchmodSync); + fs.lchmodSync = chmodFixSync(fs.lchmodSync); + fs.stat = statFix(fs.stat); + fs.fstat = statFix(fs.fstat); + fs.lstat = statFix(fs.lstat); + fs.statSync = statFixSync(fs.statSync); + fs.fstatSync = statFixSync(fs.fstatSync); + fs.lstatSync = statFixSync(fs.lstatSync); + if (fs.chmod && !fs.lchmod) { + fs.lchmod = function(path, mode, cb) { + if (cb) process.nextTick(cb); + }; + fs.lchmodSync = function() {}; + } + if (fs.chown && !fs.lchown) { + fs.lchown = function(path, uid, gid, cb) { + if (cb) process.nextTick(cb); + }; + fs.lchownSync = function() {}; + } + if (platform === 'win32') { + fs.rename = typeof fs.rename !== 'function' ? fs.rename : function(fs$rename) { + function rename(from, to, cb) { + var start = Date.now(); + var backoff = 0; + fs$rename(from, to, (function CB(er) { + if (er && (er.code === 'EACCES' || er.code === 'EPERM' || er.code === 'EBUSY') && Date.now() - start < 6e4) { + setTimeout((function() { + fs.stat(to, (function(stater, st) { + if (stater && stater.code === 'ENOENT') fs$rename(from, to, CB); else cb(er); + })); + }), backoff); + if (backoff < 100) backoff += 10; + return; + } + if (cb) cb(er); + })); + } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); + return rename; + }(fs.rename); + } + fs.read = typeof fs.read !== 'function' ? fs.read : function(fs$read) { + function read(fd, buffer, offset, length, position, callback_) { + var callback; + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0; + callback = function(er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter++; + return fs$read.call(fs, fd, buffer, offset, length, position, callback); + } + callback_.apply(this, arguments); + }; + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback); + } + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); + return read; + }(fs.read); + fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync : function(fs$readSync) { + return function(fd, buffer, offset, length, position) { + var eagCounter = 0; + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position); + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter++; + continue; + } + throw er; + } + } + }; + }(fs.readSync); + function patchLchmod(fs) { + fs.lchmod = function(path, mode, callback) { + fs.open(path, constants$2.O_WRONLY | constants$2.O_SYMLINK, mode, (function(err, fd) { + if (err) { + if (callback) callback(err); + return; + } + fs.fchmod(fd, mode, (function(err) { + fs.close(fd, (function(err2) { + if (callback) callback(err || err2); + })); + })); + })); + }; + fs.lchmodSync = function(path, mode) { + var fd = fs.openSync(path, constants$2.O_WRONLY | constants$2.O_SYMLINK, mode); + var threw = true; + var ret; + try { + ret = fs.fchmodSync(fd, mode); + threw = false; + } finally { + if (threw) { + try { + fs.closeSync(fd); + } catch (er) {} + } else { + fs.closeSync(fd); + } + } + return ret; + }; + } + function patchLutimes(fs) { + if (constants$2.hasOwnProperty('O_SYMLINK') && fs.futimes) { + fs.lutimes = function(path, at, mt, cb) { + fs.open(path, constants$2.O_SYMLINK, (function(er, fd) { + if (er) { + if (cb) cb(er); + return; + } + fs.futimes(fd, at, mt, (function(er) { + fs.close(fd, (function(er2) { + if (cb) cb(er || er2); + })); + })); + })); + }; + fs.lutimesSync = function(path, at, mt) { + var fd = fs.openSync(path, constants$2.O_SYMLINK); + var ret; + var threw = true; + try { + ret = fs.futimesSync(fd, at, mt); + threw = false; + } finally { + if (threw) { + try { + fs.closeSync(fd); + } catch (er) {} + } else { + fs.closeSync(fd); + } + } + return ret; + }; + } else if (fs.futimes) { + fs.lutimes = function(_a, _b, _c, cb) { + if (cb) process.nextTick(cb); + }; + fs.lutimesSync = function() {}; + } + } + function chmodFix(orig) { + if (!orig) return orig; + return function(target, mode, cb) { + return orig.call(fs, target, mode, (function(er) { + if (chownErOk(er)) er = null; + if (cb) cb.apply(this, arguments); + })); + }; + } + function chmodFixSync(orig) { + if (!orig) return orig; + return function(target, mode) { + try { + return orig.call(fs, target, mode); + } catch (er) { + if (!chownErOk(er)) throw er; + } + }; + } + function chownFix(orig) { + if (!orig) return orig; + return function(target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, (function(er) { + if (chownErOk(er)) er = null; + if (cb) cb.apply(this, arguments); + })); + }; + } + function chownFixSync(orig) { + if (!orig) return orig; + return function(target, uid, gid) { + try { + return orig.call(fs, target, uid, gid); + } catch (er) { + if (!chownErOk(er)) throw er; + } + }; + } + function statFix(orig) { + if (!orig) return orig; + return function(target, options, cb) { + if (typeof options === 'function') { + cb = options; + options = null; + } + function callback(er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 4294967296; + if (stats.gid < 0) stats.gid += 4294967296; + } + if (cb) cb.apply(this, arguments); + } + return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback); + }; + } + function statFixSync(orig) { + if (!orig) return orig; + return function(target, options) { + var stats = options ? orig.call(fs, target, options) : orig.call(fs, target); + if (stats) { + if (stats.uid < 0) stats.uid += 4294967296; + if (stats.gid < 0) stats.gid += 4294967296; + } + return stats; + }; + } + function chownErOk(er) { + if (!er) return true; + if (er.code === 'ENOSYS') return true; + var nonroot = !process.getuid || process.getuid() !== 0; + if (nonroot) { + if (er.code === 'EINVAL' || er.code === 'EPERM') return true; + } + return false; + } +} + +var Stream = require$$0$6.Stream; + +var legacyStreams = legacy$1; + +function legacy$1(fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + }; + function ReadStream(path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + Stream.call(this); + var self = this; + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + this.flags = 'r'; + this.mode = 438; + this.bufferSize = 64 * 1024; + options = options || {}; + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + if (this.encoding) this.setEncoding(this.encoding); + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + this.pos = this.start; + } + if (this.fd !== null) { + process.nextTick((function() { + self._read(); + })); + return; + } + fs.open(this.path, this.flags, this.mode, (function(err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + self.fd = fd; + self.emit('open', fd); + self._read(); + })); + } + function WriteStream(path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + Stream.call(this); + this.path = path; + this.fd = null; + this.writable = true; + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; + this.bytesWritten = 0; + options = options || {}; + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + this.pos = this.start; + } + this.busy = false; + this._queue = []; + if (this.fd === null) { + this._open = fs.open; + this._queue.push([ this._open, this.path, this.flags, this.mode, undefined ]); + this.flush(); + } + } +} + +var clone_1 = clone$1; + +var getPrototypeOf = Object.getPrototypeOf || function(obj) { + return obj.__proto__; +}; + +function clone$1(obj) { + if (obj === null || typeof obj !== 'object') return obj; + if (obj instanceof Object) var copy = { + __proto__: getPrototypeOf(obj) + }; else var copy = Object.create(null); + Object.getOwnPropertyNames(obj).forEach((function(key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); + })); + return copy; +} + +var fs$h = require$$0$1; + +var polyfills = polyfills$1; + +var legacy = legacyStreams; + +var clone = clone_1; + +var util = require$$0$2; + +var gracefulQueue; + +var previousSymbol; + +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue'); + previousSymbol = Symbol.for('graceful-fs.previous'); +} else { + gracefulQueue = '___graceful-fs.queue'; + previousSymbol = '___graceful-fs.previous'; +} + +function noop() {} + +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue; + } + }); +} + +var debug$2 = noop; + +if (util.debuglog) debug$2 = util.debuglog('gfs4'); else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) debug$2 = function() { + var m = util.format.apply(util, arguments); + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: '); + console.error(m); +}; + +if (!fs$h[gracefulQueue]) { + var queue = commonjsGlobal[gracefulQueue] || []; + publishQueue(fs$h, queue); + fs$h.close = function(fs$close) { + function close(fd, cb) { + return fs$close.call(fs$h, fd, (function(err) { + if (!err) { + resetQueue(); + } + if (typeof cb === 'function') cb.apply(this, arguments); + })); + } + Object.defineProperty(close, previousSymbol, { + value: fs$close + }); + return close; + }(fs$h.close); + fs$h.closeSync = function(fs$closeSync) { + function closeSync(fd) { + fs$closeSync.apply(fs$h, arguments); + resetQueue(); + } + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }); + return closeSync; + }(fs$h.closeSync); + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', (function() { + debug$2(fs$h[gracefulQueue]); + require$$5.equal(fs$h[gracefulQueue].length, 0); + })); + } +} + +if (!commonjsGlobal[gracefulQueue]) { + publishQueue(commonjsGlobal, fs$h[gracefulQueue]); +} + +var gracefulFs = patch$2(clone(fs$h)); + +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$h.__patched) { + gracefulFs = patch$2(fs$h); + fs$h.__patched = true; +} + +function patch$2(fs) { + polyfills(fs); + fs.gracefulify = patch$2; + fs.createReadStream = createReadStream; + fs.createWriteStream = createWriteStream; + var fs$readFile = fs.readFile; + fs.readFile = readFile; + function readFile(path, options, cb) { + if (typeof options === 'function') cb = options, options = null; + return go$readFile(path, options, cb); + function go$readFile(path, options, cb, startTime) { + return fs$readFile(path, options, (function(err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([ go$readFile, [ path, options, cb ], err, startTime || Date.now(), Date.now() ]); else { + if (typeof cb === 'function') cb.apply(this, arguments); + } + })); + } + } + var fs$writeFile = fs.writeFile; + fs.writeFile = writeFile; + function writeFile(path, data, options, cb) { + if (typeof options === 'function') cb = options, options = null; + return go$writeFile(path, data, options, cb); + function go$writeFile(path, data, options, cb, startTime) { + return fs$writeFile(path, data, options, (function(err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([ go$writeFile, [ path, data, options, cb ], err, startTime || Date.now(), Date.now() ]); else { + if (typeof cb === 'function') cb.apply(this, arguments); + } + })); + } + } + var fs$appendFile = fs.appendFile; + if (fs$appendFile) fs.appendFile = appendFile; + function appendFile(path, data, options, cb) { + if (typeof options === 'function') cb = options, options = null; + return go$appendFile(path, data, options, cb); + function go$appendFile(path, data, options, cb, startTime) { + return fs$appendFile(path, data, options, (function(err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([ go$appendFile, [ path, data, options, cb ], err, startTime || Date.now(), Date.now() ]); else { + if (typeof cb === 'function') cb.apply(this, arguments); + } + })); + } + } + var fs$copyFile = fs.copyFile; + if (fs$copyFile) fs.copyFile = copyFile; + function copyFile(src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags; + flags = 0; + } + return go$copyFile(src, dest, flags, cb); + function go$copyFile(src, dest, flags, cb, startTime) { + return fs$copyFile(src, dest, flags, (function(err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([ go$copyFile, [ src, dest, flags, cb ], err, startTime || Date.now(), Date.now() ]); else { + if (typeof cb === 'function') cb.apply(this, arguments); + } + })); + } + } + var fs$readdir = fs.readdir; + fs.readdir = readdir; + var noReaddirOptionVersions = /^v[0-5]\./; + function readdir(path, options, cb) { + if (typeof options === 'function') cb = options, options = null; + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir(path, options, cb, startTime) { + return fs$readdir(path, fs$readdirCallback(path, options, cb, startTime)); + } : function go$readdir(path, options, cb, startTime) { + return fs$readdir(path, options, fs$readdirCallback(path, options, cb, startTime)); + }; + return go$readdir(path, options, cb); + function fs$readdirCallback(path, options, cb, startTime) { + return function(err, files) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([ go$readdir, [ path, options, cb ], err, startTime || Date.now(), Date.now() ]); else { + if (files && files.sort) files.sort(); + if (typeof cb === 'function') cb.call(this, err, files); + } + }; + } + } + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs); + ReadStream = legStreams.ReadStream; + WriteStream = legStreams.WriteStream; + } + var fs$ReadStream = fs.ReadStream; + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype); + ReadStream.prototype.open = ReadStream$open; + } + var fs$WriteStream = fs.WriteStream; + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype); + WriteStream.prototype.open = WriteStream$open; + } + Object.defineProperty(fs, 'ReadStream', { + get: function() { + return ReadStream; + }, + set: function(val) { + ReadStream = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(fs, 'WriteStream', { + get: function() { + return WriteStream; + }, + set: function(val) { + WriteStream = val; + }, + enumerable: true, + configurable: true + }); + var FileReadStream = ReadStream; + Object.defineProperty(fs, 'FileReadStream', { + get: function() { + return FileReadStream; + }, + set: function(val) { + FileReadStream = val; + }, + enumerable: true, + configurable: true + }); + var FileWriteStream = WriteStream; + Object.defineProperty(fs, 'FileWriteStream', { + get: function() { + return FileWriteStream; + }, + set: function(val) { + FileWriteStream = val; + }, + enumerable: true, + configurable: true + }); + function ReadStream(path, options) { + if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this; else return ReadStream.apply(Object.create(ReadStream.prototype), arguments); + } + function ReadStream$open() { + var that = this; + open(that.path, that.flags, that.mode, (function(err, fd) { + if (err) { + if (that.autoClose) that.destroy(); + that.emit('error', err); + } else { + that.fd = fd; + that.emit('open', fd); + that.read(); + } + })); + } + function WriteStream(path, options) { + if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this; else return WriteStream.apply(Object.create(WriteStream.prototype), arguments); + } + function WriteStream$open() { + var that = this; + open(that.path, that.flags, that.mode, (function(err, fd) { + if (err) { + that.destroy(); + that.emit('error', err); + } else { + that.fd = fd; + that.emit('open', fd); + } + })); + } + function createReadStream(path, options) { + return new fs.ReadStream(path, options); + } + function createWriteStream(path, options) { + return new fs.WriteStream(path, options); + } + var fs$open = fs.open; + fs.open = open; + function open(path, flags, mode, cb) { + if (typeof mode === 'function') cb = mode, mode = null; + return go$open(path, flags, mode, cb); + function go$open(path, flags, mode, cb, startTime) { + return fs$open(path, flags, mode, (function(err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([ go$open, [ path, flags, mode, cb ], err, startTime || Date.now(), Date.now() ]); else { + if (typeof cb === 'function') cb.apply(this, arguments); + } + })); + } + } + return fs; +} + +function enqueue(elem) { + debug$2('ENQUEUE', elem[0].name, elem[1]); + fs$h[gracefulQueue].push(elem); + retry(); +} + +var retryTimer; + +function resetQueue() { + var now = Date.now(); + for (var i = 0; i < fs$h[gracefulQueue].length; ++i) { + if (fs$h[gracefulQueue][i].length > 2) { + fs$h[gracefulQueue][i][3] = now; + fs$h[gracefulQueue][i][4] = now; + } + } + retry(); +} + +function retry() { + clearTimeout(retryTimer); + retryTimer = undefined; + if (fs$h[gracefulQueue].length === 0) return; + var elem = fs$h[gracefulQueue].shift(); + var fn = elem[0]; + var args = elem[1]; + var err = elem[2]; + var startTime = elem[3]; + var lastTime = elem[4]; + if (startTime === undefined) { + debug$2('RETRY', fn.name, args); + fn.apply(null, args); + } else if (Date.now() - startTime >= 6e4) { + debug$2('TIMEOUT', fn.name, args); + var cb = args.pop(); + if (typeof cb === 'function') cb.call(null, err); + } else { + var sinceAttempt = Date.now() - lastTime; + var sinceStart = Math.max(lastTime - startTime, 1); + var desiredDelay = Math.min(sinceStart * 1.2, 100); + if (sinceAttempt >= desiredDelay) { + debug$2('RETRY', fn.name, args); + fn.apply(null, args.concat([ startTime ])); + } else { + fs$h[gracefulQueue].push(elem); + } + } + if (retryTimer === undefined) { + retryTimer = setTimeout(retry, 0); + } +} + +(function(exports) { + const u = universalify$1.fromCallback; + const fs = gracefulFs; + const api = [ 'access', 'appendFile', 'chmod', 'chown', 'close', 'copyFile', 'fchmod', 'fchown', 'fdatasync', 'fstat', 'fsync', 'ftruncate', 'futimes', 'lchmod', 'lchown', 'link', 'lstat', 'mkdir', 'mkdtemp', 'open', 'opendir', 'readdir', 'readFile', 'readlink', 'realpath', 'rename', 'rm', 'rmdir', 'stat', 'symlink', 'truncate', 'unlink', 'utimes', 'writeFile' ].filter((key => typeof fs[key] === 'function')); + Object.assign(exports, fs); + api.forEach((method => { + exports[method] = u(fs[method]); + })); + exports.exists = function(filename, callback) { + if (typeof callback === 'function') { + return fs.exists(filename, callback); + } + return new Promise((resolve => fs.exists(filename, resolve))); + }; + exports.read = function(fd, buffer, offset, length, position, callback) { + if (typeof callback === 'function') { + return fs.read(fd, buffer, offset, length, position, callback); + } + return new Promise(((resolve, reject) => { + fs.read(fd, buffer, offset, length, position, ((err, bytesRead, buffer) => { + if (err) return reject(err); + resolve({ + bytesRead: bytesRead, + buffer: buffer + }); + })); + })); + }; + exports.write = function(fd, buffer, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.write(fd, buffer, ...args); + } + return new Promise(((resolve, reject) => { + fs.write(fd, buffer, ...args, ((err, bytesWritten, buffer) => { + if (err) return reject(err); + resolve({ + bytesWritten: bytesWritten, + buffer: buffer + }); + })); + })); + }; + exports.readv = function(fd, buffers, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.readv(fd, buffers, ...args); + } + return new Promise(((resolve, reject) => { + fs.readv(fd, buffers, ...args, ((err, bytesRead, buffers) => { + if (err) return reject(err); + resolve({ + bytesRead: bytesRead, + buffers: buffers + }); + })); + })); + }; + exports.writev = function(fd, buffers, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.writev(fd, buffers, ...args); + } + return new Promise(((resolve, reject) => { + fs.writev(fd, buffers, ...args, ((err, bytesWritten, buffers) => { + if (err) return reject(err); + resolve({ + bytesWritten: bytesWritten, + buffers: buffers + }); + })); + })); + }; + if (typeof fs.realpath.native === 'function') { + exports.realpath.native = u(fs.realpath.native); + } else { + process.emitWarning('fs.realpath.native is not a function. Is fs being monkey-patched?', 'Warning', 'fs-extra-WARN0003'); + } +})(fs$i); + +var makeDir$1 = {}; + +var utils$1 = {}; + +const path$b = require$$1$1; + +utils$1.checkPath = function checkPath(pth) { + if (process.platform === 'win32') { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path$b.parse(pth).root, '')); + if (pathHasInvalidWinCharacters) { + const error = new Error(`Path contains invalid characters: ${pth}`); + error.code = 'EINVAL'; + throw error; + } + } +}; + +const fs$g = fs$i; + +const {checkPath: checkPath} = utils$1; + +const getMode = options => { + const defaults = { + mode: 511 + }; + if (typeof options === 'number') return options; + return { + ...defaults, + ...options + }.mode; +}; + +makeDir$1.makeDir = async (dir, options) => { + checkPath(dir); + return fs$g.mkdir(dir, { + mode: getMode(options), + recursive: true + }); +}; + +makeDir$1.makeDirSync = (dir, options) => { + checkPath(dir); + return fs$g.mkdirSync(dir, { + mode: getMode(options), + recursive: true + }); +}; + +const u$e = universalify$1.fromPromise; + +const {makeDir: _makeDir, makeDirSync: makeDirSync} = makeDir$1; + +const makeDir = u$e(_makeDir); + +var mkdirs$2 = { + mkdirs: makeDir, + mkdirsSync: makeDirSync, + mkdirp: makeDir, + mkdirpSync: makeDirSync, + ensureDir: makeDir, + ensureDirSync: makeDirSync +}; + +const u$d = universalify$1.fromPromise; + +const fs$f = fs$i; + +function pathExists$6(path) { + return fs$f.access(path).then((() => true)).catch((() => false)); +} + +var pathExists_1 = { + pathExists: u$d(pathExists$6), + pathExistsSync: fs$f.existsSync +}; + +const fs$e = fs$i; + +const u$c = universalify$1.fromPromise; + +async function utimesMillis$1(path, atime, mtime) { + const fd = await fs$e.open(path, 'r+'); + let closeErr = null; + try { + await fs$e.futimes(fd, atime, mtime); + } finally { + try { + await fs$e.close(fd); + } catch (e) { + closeErr = e; + } + } + if (closeErr) { + throw closeErr; + } +} + +function utimesMillisSync$1(path, atime, mtime) { + const fd = fs$e.openSync(path, 'r+'); + fs$e.futimesSync(fd, atime, mtime); + return fs$e.closeSync(fd); +} + +var utimes = { + utimesMillis: u$c(utimesMillis$1), + utimesMillisSync: utimesMillisSync$1 +}; + +const fs$d = fs$i; + +const path$a = require$$1$1; + +const u$b = universalify$1.fromPromise; + +function getStats$1(src, dest, opts) { + const statFunc = opts.dereference ? file => fs$d.stat(file, { + bigint: true + }) : file => fs$d.lstat(file, { + bigint: true + }); + return Promise.all([ statFunc(src), statFunc(dest).catch((err => { + if (err.code === 'ENOENT') return null; + throw err; + })) ]).then((([srcStat, destStat]) => ({ + srcStat: srcStat, + destStat: destStat + }))); +} + +function getStatsSync(src, dest, opts) { + let destStat; + const statFunc = opts.dereference ? file => fs$d.statSync(file, { + bigint: true + }) : file => fs$d.lstatSync(file, { + bigint: true + }); + const srcStat = statFunc(src); + try { + destStat = statFunc(dest); + } catch (err) { + if (err.code === 'ENOENT') return { + srcStat: srcStat, + destStat: null + }; + throw err; + } + return { + srcStat: srcStat, + destStat: destStat + }; +} + +async function checkPaths(src, dest, funcName, opts) { + const {srcStat: srcStat, destStat: destStat} = await getStats$1(src, dest, opts); + if (destStat) { + if (areIdentical$2(srcStat, destStat)) { + const srcBaseName = path$a.basename(src); + const destBaseName = path$a.basename(dest); + if (funcName === 'move' && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { + return { + srcStat: srcStat, + destStat: destStat, + isChangingCase: true + }; + } + throw new Error('Source and destination must not be the same.'); + } + if (srcStat.isDirectory() && !destStat.isDirectory()) { + throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`); + } + if (!srcStat.isDirectory() && destStat.isDirectory()) { + throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`); + } + } + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + throw new Error(errMsg(src, dest, funcName)); + } + return { + srcStat: srcStat, + destStat: destStat + }; +} + +function checkPathsSync(src, dest, funcName, opts) { + const {srcStat: srcStat, destStat: destStat} = getStatsSync(src, dest, opts); + if (destStat) { + if (areIdentical$2(srcStat, destStat)) { + const srcBaseName = path$a.basename(src); + const destBaseName = path$a.basename(dest); + if (funcName === 'move' && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { + return { + srcStat: srcStat, + destStat: destStat, + isChangingCase: true + }; + } + throw new Error('Source and destination must not be the same.'); + } + if (srcStat.isDirectory() && !destStat.isDirectory()) { + throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`); + } + if (!srcStat.isDirectory() && destStat.isDirectory()) { + throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`); + } + } + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + throw new Error(errMsg(src, dest, funcName)); + } + return { + srcStat: srcStat, + destStat: destStat + }; +} + +async function checkParentPaths(src, srcStat, dest, funcName) { + const srcParent = path$a.resolve(path$a.dirname(src)); + const destParent = path$a.resolve(path$a.dirname(dest)); + if (destParent === srcParent || destParent === path$a.parse(destParent).root) return; + let destStat; + try { + destStat = await fs$d.stat(destParent, { + bigint: true + }); + } catch (err) { + if (err.code === 'ENOENT') return; + throw err; + } + if (areIdentical$2(srcStat, destStat)) { + throw new Error(errMsg(src, dest, funcName)); + } + return checkParentPaths(src, srcStat, destParent, funcName); +} + +function checkParentPathsSync(src, srcStat, dest, funcName) { + const srcParent = path$a.resolve(path$a.dirname(src)); + const destParent = path$a.resolve(path$a.dirname(dest)); + if (destParent === srcParent || destParent === path$a.parse(destParent).root) return; + let destStat; + try { + destStat = fs$d.statSync(destParent, { + bigint: true + }); + } catch (err) { + if (err.code === 'ENOENT') return; + throw err; + } + if (areIdentical$2(srcStat, destStat)) { + throw new Error(errMsg(src, dest, funcName)); + } + return checkParentPathsSync(src, srcStat, destParent, funcName); +} + +function areIdentical$2(srcStat, destStat) { + return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev; +} + +function isSrcSubdir(src, dest) { + const srcArr = path$a.resolve(src).split(path$a.sep).filter((i => i)); + const destArr = path$a.resolve(dest).split(path$a.sep).filter((i => i)); + return srcArr.every(((cur, i) => destArr[i] === cur)); +} + +function errMsg(src, dest, funcName) { + return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`; +} + +var stat$4 = { + checkPaths: u$b(checkPaths), + checkPathsSync: checkPathsSync, + checkParentPaths: u$b(checkParentPaths), + checkParentPathsSync: checkParentPathsSync, + isSrcSubdir: isSrcSubdir, + areIdentical: areIdentical$2 +}; + +const fs$c = fs$i; + +const path$9 = require$$1$1; + +const {mkdirs: mkdirs$1} = mkdirs$2; + +const {pathExists: pathExists$5} = pathExists_1; + +const {utimesMillis: utimesMillis} = utimes; + +const stat$3 = stat$4; + +async function copy$2(src, dest, opts = {}) { + if (typeof opts === 'function') { + opts = { + filter: opts + }; + } + opts.clobber = 'clobber' in opts ? !!opts.clobber : true; + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber; + if (opts.preserveTimestamps && process.arch === 'ia32') { + process.emitWarning('Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', 'Warning', 'fs-extra-WARN0001'); + } + const {srcStat: srcStat, destStat: destStat} = await stat$3.checkPaths(src, dest, 'copy', opts); + await stat$3.checkParentPaths(src, srcStat, dest, 'copy'); + const include = await runFilter(src, dest, opts); + if (!include) return; + const destParent = path$9.dirname(dest); + const dirExists = await pathExists$5(destParent); + if (!dirExists) { + await mkdirs$1(destParent); + } + await getStatsAndPerformCopy(destStat, src, dest, opts); +} + +async function runFilter(src, dest, opts) { + if (!opts.filter) return true; + return opts.filter(src, dest); +} + +async function getStatsAndPerformCopy(destStat, src, dest, opts) { + const statFn = opts.dereference ? fs$c.stat : fs$c.lstat; + const srcStat = await statFn(src); + if (srcStat.isDirectory()) return onDir$1(srcStat, destStat, src, dest, opts); + if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile$1(srcStat, destStat, src, dest, opts); + if (srcStat.isSymbolicLink()) return onLink$1(destStat, src, dest, opts); + if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`); + if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`); + throw new Error(`Unknown file: ${src}`); +} + +async function onFile$1(srcStat, destStat, src, dest, opts) { + if (!destStat) return copyFile$1(srcStat, src, dest, opts); + if (opts.overwrite) { + await fs$c.unlink(dest); + return copyFile$1(srcStat, src, dest, opts); + } + if (opts.errorOnExist) { + throw new Error(`'${dest}' already exists`); + } +} + +async function copyFile$1(srcStat, src, dest, opts) { + await fs$c.copyFile(src, dest); + if (opts.preserveTimestamps) { + if (fileIsNotWritable$1(srcStat.mode)) { + await makeFileWritable$1(dest, srcStat.mode); + } + const updatedSrcStat = await fs$c.stat(src); + await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime); + } + return fs$c.chmod(dest, srcStat.mode); +} + +function fileIsNotWritable$1(srcMode) { + return (srcMode & 128) === 0; +} + +function makeFileWritable$1(dest, srcMode) { + return fs$c.chmod(dest, srcMode | 128); +} + +async function onDir$1(srcStat, destStat, src, dest, opts) { + if (!destStat) { + await fs$c.mkdir(dest); + } + const items = await fs$c.readdir(src); + await Promise.all(items.map((async item => { + const srcItem = path$9.join(src, item); + const destItem = path$9.join(dest, item); + const include = await runFilter(srcItem, destItem, opts); + if (!include) return; + const {destStat: destStat} = await stat$3.checkPaths(srcItem, destItem, 'copy', opts); + return getStatsAndPerformCopy(destStat, srcItem, destItem, opts); + }))); + if (!destStat) { + await fs$c.chmod(dest, srcStat.mode); + } +} + +async function onLink$1(destStat, src, dest, opts) { + let resolvedSrc = await fs$c.readlink(src); + if (opts.dereference) { + resolvedSrc = path$9.resolve(process.cwd(), resolvedSrc); + } + if (!destStat) { + return fs$c.symlink(resolvedSrc, dest); + } + let resolvedDest = null; + try { + resolvedDest = await fs$c.readlink(dest); + } catch (e) { + if (e.code === 'EINVAL' || e.code === 'UNKNOWN') return fs$c.symlink(resolvedSrc, dest); + throw e; + } + if (opts.dereference) { + resolvedDest = path$9.resolve(process.cwd(), resolvedDest); + } + if (stat$3.isSrcSubdir(resolvedSrc, resolvedDest)) { + throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`); + } + if (stat$3.isSrcSubdir(resolvedDest, resolvedSrc)) { + throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`); + } + await fs$c.unlink(dest); + return fs$c.symlink(resolvedSrc, dest); +} + +var copy_1 = copy$2; + +const fs$b = gracefulFs; + +const path$8 = require$$1$1; + +const mkdirsSync$1 = mkdirs$2.mkdirsSync; + +const utimesMillisSync = utimes.utimesMillisSync; + +const stat$2 = stat$4; + +function copySync$1(src, dest, opts) { + if (typeof opts === 'function') { + opts = { + filter: opts + }; + } + opts = opts || {}; + opts.clobber = 'clobber' in opts ? !!opts.clobber : true; + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber; + if (opts.preserveTimestamps && process.arch === 'ia32') { + process.emitWarning('Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', 'Warning', 'fs-extra-WARN0002'); + } + const {srcStat: srcStat, destStat: destStat} = stat$2.checkPathsSync(src, dest, 'copy', opts); + stat$2.checkParentPathsSync(src, srcStat, dest, 'copy'); + if (opts.filter && !opts.filter(src, dest)) return; + const destParent = path$8.dirname(dest); + if (!fs$b.existsSync(destParent)) mkdirsSync$1(destParent); + return getStats(destStat, src, dest, opts); +} + +function getStats(destStat, src, dest, opts) { + const statSync = opts.dereference ? fs$b.statSync : fs$b.lstatSync; + const srcStat = statSync(src); + if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts); else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts); else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts); else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`); else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`); + throw new Error(`Unknown file: ${src}`); +} + +function onFile(srcStat, destStat, src, dest, opts) { + if (!destStat) return copyFile(srcStat, src, dest, opts); + return mayCopyFile(srcStat, src, dest, opts); +} + +function mayCopyFile(srcStat, src, dest, opts) { + if (opts.overwrite) { + fs$b.unlinkSync(dest); + return copyFile(srcStat, src, dest, opts); + } else if (opts.errorOnExist) { + throw new Error(`'${dest}' already exists`); + } +} + +function copyFile(srcStat, src, dest, opts) { + fs$b.copyFileSync(src, dest); + if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest); + return setDestMode(dest, srcStat.mode); +} + +function handleTimestamps(srcMode, src, dest) { + if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode); + return setDestTimestamps(src, dest); +} + +function fileIsNotWritable(srcMode) { + return (srcMode & 128) === 0; +} + +function makeFileWritable(dest, srcMode) { + return setDestMode(dest, srcMode | 128); +} + +function setDestMode(dest, srcMode) { + return fs$b.chmodSync(dest, srcMode); +} + +function setDestTimestamps(src, dest) { + const updatedSrcStat = fs$b.statSync(src); + return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime); +} + +function onDir(srcStat, destStat, src, dest, opts) { + if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts); + return copyDir(src, dest, opts); +} + +function mkDirAndCopy(srcMode, src, dest, opts) { + fs$b.mkdirSync(dest); + copyDir(src, dest, opts); + return setDestMode(dest, srcMode); +} + +function copyDir(src, dest, opts) { + fs$b.readdirSync(src).forEach((item => copyDirItem(item, src, dest, opts))); +} + +function copyDirItem(item, src, dest, opts) { + const srcItem = path$8.join(src, item); + const destItem = path$8.join(dest, item); + if (opts.filter && !opts.filter(srcItem, destItem)) return; + const {destStat: destStat} = stat$2.checkPathsSync(srcItem, destItem, 'copy', opts); + return getStats(destStat, srcItem, destItem, opts); +} + +function onLink(destStat, src, dest, opts) { + let resolvedSrc = fs$b.readlinkSync(src); + if (opts.dereference) { + resolvedSrc = path$8.resolve(process.cwd(), resolvedSrc); + } + if (!destStat) { + return fs$b.symlinkSync(resolvedSrc, dest); + } else { + let resolvedDest; + try { + resolvedDest = fs$b.readlinkSync(dest); + } catch (err) { + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs$b.symlinkSync(resolvedSrc, dest); + throw err; + } + if (opts.dereference) { + resolvedDest = path$8.resolve(process.cwd(), resolvedDest); + } + if (stat$2.isSrcSubdir(resolvedSrc, resolvedDest)) { + throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`); + } + if (stat$2.isSrcSubdir(resolvedDest, resolvedSrc)) { + throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`); + } + return copyLink(resolvedSrc, dest); + } +} + +function copyLink(resolvedSrc, dest) { + fs$b.unlinkSync(dest); + return fs$b.symlinkSync(resolvedSrc, dest); +} + +var copySync_1 = copySync$1; + +const u$a = universalify$1.fromPromise; + +var copy$1 = { + copy: u$a(copy_1), + copySync: copySync_1 +}; + +const fs$a = gracefulFs; + +const u$9 = universalify$1.fromCallback; + +function remove$2(path, callback) { + fs$a.rm(path, { + recursive: true, + force: true + }, callback); +} + +function removeSync$1(path) { + fs$a.rmSync(path, { + recursive: true, + force: true + }); +} + +var remove_1 = { + remove: u$9(remove$2), + removeSync: removeSync$1 +}; + +const u$8 = universalify$1.fromPromise; + +const fs$9 = fs$i; + +const path$7 = require$$1$1; + +const mkdir$3 = mkdirs$2; + +const remove$1 = remove_1; + +const emptyDir = u$8((async function emptyDir(dir) { + let items; + try { + items = await fs$9.readdir(dir); + } catch { + return mkdir$3.mkdirs(dir); + } + return Promise.all(items.map((item => remove$1.remove(path$7.join(dir, item))))); +})); + +function emptyDirSync(dir) { + let items; + try { + items = fs$9.readdirSync(dir); + } catch { + return mkdir$3.mkdirsSync(dir); + } + items.forEach((item => { + item = path$7.join(dir, item); + remove$1.removeSync(item); + })); +} + +var empty = { + emptyDirSync: emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir: emptyDir, + emptydir: emptyDir +}; + +const u$7 = universalify$1.fromPromise; + +const path$6 = require$$1$1; + +const fs$8 = fs$i; + +const mkdir$2 = mkdirs$2; + +async function createFile$1(file) { + let stats; + try { + stats = await fs$8.stat(file); + } catch {} + if (stats && stats.isFile()) return; + const dir = path$6.dirname(file); + let dirStats = null; + try { + dirStats = await fs$8.stat(dir); + } catch (err) { + if (err.code === 'ENOENT') { + await mkdir$2.mkdirs(dir); + await fs$8.writeFile(file, ''); + return; + } else { + throw err; + } + } + if (dirStats.isDirectory()) { + await fs$8.writeFile(file, ''); + } else { + await fs$8.readdir(dir); + } +} + +function createFileSync$1(file) { + let stats; + try { + stats = fs$8.statSync(file); + } catch {} + if (stats && stats.isFile()) return; + const dir = path$6.dirname(file); + try { + if (!fs$8.statSync(dir).isDirectory()) { + fs$8.readdirSync(dir); + } + } catch (err) { + if (err && err.code === 'ENOENT') mkdir$2.mkdirsSync(dir); else throw err; + } + fs$8.writeFileSync(file, ''); +} + +var file$1 = { + createFile: u$7(createFile$1), + createFileSync: createFileSync$1 +}; + +const u$6 = universalify$1.fromPromise; + +const path$5 = require$$1$1; + +const fs$7 = fs$i; + +const mkdir$1 = mkdirs$2; + +const {pathExists: pathExists$4} = pathExists_1; + +const {areIdentical: areIdentical$1} = stat$4; + +async function createLink$1(srcpath, dstpath) { + let dstStat; + try { + dstStat = await fs$7.lstat(dstpath); + } catch {} + let srcStat; + try { + srcStat = await fs$7.lstat(srcpath); + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink'); + throw err; + } + if (dstStat && areIdentical$1(srcStat, dstStat)) return; + const dir = path$5.dirname(dstpath); + const dirExists = await pathExists$4(dir); + if (!dirExists) { + await mkdir$1.mkdirs(dir); + } + await fs$7.link(srcpath, dstpath); +} + +function createLinkSync$1(srcpath, dstpath) { + let dstStat; + try { + dstStat = fs$7.lstatSync(dstpath); + } catch {} + try { + const srcStat = fs$7.lstatSync(srcpath); + if (dstStat && areIdentical$1(srcStat, dstStat)) return; + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink'); + throw err; + } + const dir = path$5.dirname(dstpath); + const dirExists = fs$7.existsSync(dir); + if (dirExists) return fs$7.linkSync(srcpath, dstpath); + mkdir$1.mkdirsSync(dir); + return fs$7.linkSync(srcpath, dstpath); +} + +var link = { + createLink: u$6(createLink$1), + createLinkSync: createLinkSync$1 +}; + +const path$4 = require$$1$1; + +const fs$6 = fs$i; + +const {pathExists: pathExists$3} = pathExists_1; + +const u$5 = universalify$1.fromPromise; + +async function symlinkPaths$1(srcpath, dstpath) { + if (path$4.isAbsolute(srcpath)) { + try { + await fs$6.lstat(srcpath); + } catch (err) { + err.message = err.message.replace('lstat', 'ensureSymlink'); + throw err; + } + return { + toCwd: srcpath, + toDst: srcpath + }; + } + const dstdir = path$4.dirname(dstpath); + const relativeToDst = path$4.join(dstdir, srcpath); + const exists = await pathExists$3(relativeToDst); + if (exists) { + return { + toCwd: relativeToDst, + toDst: srcpath + }; + } + try { + await fs$6.lstat(srcpath); + } catch (err) { + err.message = err.message.replace('lstat', 'ensureSymlink'); + throw err; + } + return { + toCwd: srcpath, + toDst: path$4.relative(dstdir, srcpath) + }; +} + +function symlinkPathsSync$1(srcpath, dstpath) { + if (path$4.isAbsolute(srcpath)) { + const exists = fs$6.existsSync(srcpath); + if (!exists) throw new Error('absolute srcpath does not exist'); + return { + toCwd: srcpath, + toDst: srcpath + }; + } + const dstdir = path$4.dirname(dstpath); + const relativeToDst = path$4.join(dstdir, srcpath); + const exists = fs$6.existsSync(relativeToDst); + if (exists) { + return { + toCwd: relativeToDst, + toDst: srcpath + }; + } + const srcExists = fs$6.existsSync(srcpath); + if (!srcExists) throw new Error('relative srcpath does not exist'); + return { + toCwd: srcpath, + toDst: path$4.relative(dstdir, srcpath) + }; +} + +var symlinkPaths_1 = { + symlinkPaths: u$5(symlinkPaths$1), + symlinkPathsSync: symlinkPathsSync$1 +}; + +const fs$5 = fs$i; + +const u$4 = universalify$1.fromPromise; + +async function symlinkType$1(srcpath, type) { + if (type) return type; + let stats; + try { + stats = await fs$5.lstat(srcpath); + } catch { + return 'file'; + } + return stats && stats.isDirectory() ? 'dir' : 'file'; +} + +function symlinkTypeSync$1(srcpath, type) { + if (type) return type; + let stats; + try { + stats = fs$5.lstatSync(srcpath); + } catch { + return 'file'; + } + return stats && stats.isDirectory() ? 'dir' : 'file'; +} + +var symlinkType_1 = { + symlinkType: u$4(symlinkType$1), + symlinkTypeSync: symlinkTypeSync$1 +}; + +const u$3 = universalify$1.fromPromise; + +const path$3 = require$$1$1; + +const fs$4 = fs$i; + +const {mkdirs: mkdirs, mkdirsSync: mkdirsSync} = mkdirs$2; + +const {symlinkPaths: symlinkPaths, symlinkPathsSync: symlinkPathsSync} = symlinkPaths_1; + +const {symlinkType: symlinkType, symlinkTypeSync: symlinkTypeSync} = symlinkType_1; + +const {pathExists: pathExists$2} = pathExists_1; + +const {areIdentical: areIdentical} = stat$4; + +async function createSymlink$1(srcpath, dstpath, type) { + let stats; + try { + stats = await fs$4.lstat(dstpath); + } catch {} + if (stats && stats.isSymbolicLink()) { + const [srcStat, dstStat] = await Promise.all([ fs$4.stat(srcpath), fs$4.stat(dstpath) ]); + if (areIdentical(srcStat, dstStat)) return; + } + const relative = await symlinkPaths(srcpath, dstpath); + srcpath = relative.toDst; + const toType = await symlinkType(relative.toCwd, type); + const dir = path$3.dirname(dstpath); + if (!await pathExists$2(dir)) { + await mkdirs(dir); + } + return fs$4.symlink(srcpath, dstpath, toType); +} + +function createSymlinkSync$1(srcpath, dstpath, type) { + let stats; + try { + stats = fs$4.lstatSync(dstpath); + } catch {} + if (stats && stats.isSymbolicLink()) { + const srcStat = fs$4.statSync(srcpath); + const dstStat = fs$4.statSync(dstpath); + if (areIdentical(srcStat, dstStat)) return; + } + const relative = symlinkPathsSync(srcpath, dstpath); + srcpath = relative.toDst; + type = symlinkTypeSync(relative.toCwd, type); + const dir = path$3.dirname(dstpath); + const exists = fs$4.existsSync(dir); + if (exists) return fs$4.symlinkSync(srcpath, dstpath, type); + mkdirsSync(dir); + return fs$4.symlinkSync(srcpath, dstpath, type); +} + +var symlink = { + createSymlink: u$3(createSymlink$1), + createSymlinkSync: createSymlinkSync$1 +}; + +const {createFile: createFile, createFileSync: createFileSync} = file$1; + +const {createLink: createLink, createLinkSync: createLinkSync} = link; + +const {createSymlink: createSymlink, createSymlinkSync: createSymlinkSync} = symlink; + +var ensure = { + createFile: createFile, + createFileSync: createFileSync, + ensureFile: createFile, + ensureFileSync: createFileSync, + createLink: createLink, + createLinkSync: createLinkSync, + ensureLink: createLink, + ensureLinkSync: createLinkSync, + createSymlink: createSymlink, + createSymlinkSync: createSymlinkSync, + ensureSymlink: createSymlink, + ensureSymlinkSync: createSymlinkSync +}; + +function stringify$3(obj, {EOL: EOL = '\n', finalEOL: finalEOL = true, replacer: replacer = null, spaces: spaces} = {}) { + const EOF = finalEOL ? EOL : ''; + const str = JSON.stringify(obj, replacer, spaces); + return str.replace(/\n/g, EOL) + EOF; +} + +function stripBom$1(content) { + if (Buffer.isBuffer(content)) content = content.toString('utf8'); + return content.replace(/^\uFEFF/, ''); +} + +var utils = { + stringify: stringify$3, + stripBom: stripBom$1 +}; + +let _fs; + +try { + _fs = gracefulFs; +} catch (_) { + _fs = require$$0$1; +} + +const universalify = universalify$1; + +const {stringify: stringify$2, stripBom: stripBom} = utils; + +async function _readFile(file, options = {}) { + if (typeof options === 'string') { + options = { + encoding: options + }; + } + const fs = options.fs || _fs; + const shouldThrow = 'throws' in options ? options.throws : true; + let data = await universalify.fromCallback(fs.readFile)(file, options); + data = stripBom(data); + let obj; + try { + obj = JSON.parse(data, options ? options.reviver : null); + } catch (err) { + if (shouldThrow) { + err.message = `${file}: ${err.message}`; + throw err; + } else { + return null; + } + } + return obj; +} + +const readFile = universalify.fromPromise(_readFile); + +function readFileSync(file, options = {}) { + if (typeof options === 'string') { + options = { + encoding: options + }; + } + const fs = options.fs || _fs; + const shouldThrow = 'throws' in options ? options.throws : true; + try { + let content = fs.readFileSync(file, options); + content = stripBom(content); + return JSON.parse(content, options.reviver); + } catch (err) { + if (shouldThrow) { + err.message = `${file}: ${err.message}`; + throw err; + } else { + return null; + } + } +} + +async function _writeFile(file, obj, options = {}) { + const fs = options.fs || _fs; + const str = stringify$2(obj, options); + await universalify.fromCallback(fs.writeFile)(file, str, options); +} + +const writeFile = universalify.fromPromise(_writeFile); + +function writeFileSync(file, obj, options = {}) { + const fs = options.fs || _fs; + const str = stringify$2(obj, options); + return fs.writeFileSync(file, str, options); +} + +const jsonfile$1 = { + readFile: readFile, + readFileSync: readFileSync, + writeFile: writeFile, + writeFileSync: writeFileSync +}; + +var jsonfile_1 = jsonfile$1; + +const jsonFile$1 = jsonfile_1; + +var jsonfile = { + readJson: jsonFile$1.readFile, + readJsonSync: jsonFile$1.readFileSync, + writeJson: jsonFile$1.writeFile, + writeJsonSync: jsonFile$1.writeFileSync +}; + +const u$2 = universalify$1.fromPromise; + +const fs$3 = fs$i; + +const path$2 = require$$1$1; + +const mkdir = mkdirs$2; + +const pathExists$1 = pathExists_1.pathExists; + +async function outputFile$1(file, data, encoding = 'utf-8') { + const dir = path$2.dirname(file); + if (!await pathExists$1(dir)) { + await mkdir.mkdirs(dir); + } + return fs$3.writeFile(file, data, encoding); +} + +function outputFileSync$1(file, ...args) { + const dir = path$2.dirname(file); + if (!fs$3.existsSync(dir)) { + mkdir.mkdirsSync(dir); + } + fs$3.writeFileSync(file, ...args); +} + +var outputFile_1 = { + outputFile: u$2(outputFile$1), + outputFileSync: outputFileSync$1 +}; + +const {stringify: stringify$1} = utils; + +const {outputFile: outputFile} = outputFile_1; + +async function outputJson(file, data, options = {}) { + const str = stringify$1(data, options); + await outputFile(file, str, options); +} + +var outputJson_1 = outputJson; + +const {stringify: stringify} = utils; + +const {outputFileSync: outputFileSync} = outputFile_1; + +function outputJsonSync(file, data, options) { + const str = stringify(data, options); + outputFileSync(file, str, options); +} + +var outputJsonSync_1 = outputJsonSync; + +const u$1 = universalify$1.fromPromise; + +const jsonFile = jsonfile; + +jsonFile.outputJson = u$1(outputJson_1); + +jsonFile.outputJsonSync = outputJsonSync_1; + +jsonFile.outputJSON = jsonFile.outputJson; + +jsonFile.outputJSONSync = jsonFile.outputJsonSync; + +jsonFile.writeJSON = jsonFile.writeJson; + +jsonFile.writeJSONSync = jsonFile.writeJsonSync; + +jsonFile.readJSON = jsonFile.readJson; + +jsonFile.readJSONSync = jsonFile.readJsonSync; + +var json = jsonFile; + +const fs$2 = fs$i; + +const path$1 = require$$1$1; + +const {copy: copy} = copy$1; + +const {remove: remove} = remove_1; + +const {mkdirp: mkdirp} = mkdirs$2; + +const {pathExists: pathExists} = pathExists_1; + +const stat$1 = stat$4; + +async function move$1(src, dest, opts = {}) { + const overwrite = opts.overwrite || opts.clobber || false; + const {srcStat: srcStat, isChangingCase: isChangingCase = false} = await stat$1.checkPaths(src, dest, 'move', opts); + await stat$1.checkParentPaths(src, srcStat, dest, 'move'); + const destParent = path$1.dirname(dest); + const parsedParentPath = path$1.parse(destParent); + if (parsedParentPath.root !== destParent) { + await mkdirp(destParent); + } + return doRename$1(src, dest, overwrite, isChangingCase); +} + +async function doRename$1(src, dest, overwrite, isChangingCase) { + if (!isChangingCase) { + if (overwrite) { + await remove(dest); + } else if (await pathExists(dest)) { + throw new Error('dest already exists.'); + } + } + try { + await fs$2.rename(src, dest); + } catch (err) { + if (err.code !== 'EXDEV') { + throw err; + } + await moveAcrossDevice$1(src, dest, overwrite); + } +} + +async function moveAcrossDevice$1(src, dest, overwrite) { + const opts = { + overwrite: overwrite, + errorOnExist: true, + preserveTimestamps: true + }; + await copy(src, dest, opts); + return remove(src); +} + +var move_1 = move$1; + +const fs$1 = gracefulFs; + +const path = require$$1$1; + +const copySync = copy$1.copySync; + +const removeSync = remove_1.removeSync; + +const mkdirpSync = mkdirs$2.mkdirpSync; + +const stat = stat$4; + +function moveSync(src, dest, opts) { + opts = opts || {}; + const overwrite = opts.overwrite || opts.clobber || false; + const {srcStat: srcStat, isChangingCase: isChangingCase = false} = stat.checkPathsSync(src, dest, 'move', opts); + stat.checkParentPathsSync(src, srcStat, dest, 'move'); + if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest)); + return doRename(src, dest, overwrite, isChangingCase); +} + +function isParentRoot(dest) { + const parent = path.dirname(dest); + const parsedPath = path.parse(parent); + return parsedPath.root === parent; +} + +function doRename(src, dest, overwrite, isChangingCase) { + if (isChangingCase) return rename(src, dest, overwrite); + if (overwrite) { + removeSync(dest); + return rename(src, dest, overwrite); + } + if (fs$1.existsSync(dest)) throw new Error('dest already exists.'); + return rename(src, dest, overwrite); +} + +function rename(src, dest, overwrite) { + try { + fs$1.renameSync(src, dest); + } catch (err) { + if (err.code !== 'EXDEV') throw err; + return moveAcrossDevice(src, dest, overwrite); + } +} + +function moveAcrossDevice(src, dest, overwrite) { + const opts = { + overwrite: overwrite, + errorOnExist: true, + preserveTimestamps: true + }; + copySync(src, dest, opts); + return removeSync(src); +} + +var moveSync_1 = moveSync; + +const u = universalify$1.fromPromise; + +var move = { + move: u(move_1), + moveSync: moveSync_1 +}; + +var lib$1 = { + ...fs$i, + ...copy$1, + ...empty, + ...ensure, + ...json, + ...mkdirs$2, + ...move, + ...outputFile_1, + ...pathExists_1, + ...remove_1 +}; + +const fs = getDefaultExportFromCjs(lib$1); + +var LIB; + +(() => { + var t = { + 470: t => { + function e(t) { + if ('string' != typeof t) throw new TypeError('Path must be a string. Received ' + JSON.stringify(t)); + } + function r(t, e) { + for (var r, n = '', i = 0, o = -1, s = 0, h = 0; h <= t.length; ++h) { + if (h < t.length) r = t.charCodeAt(h); else { + if (47 === r) break; + r = 47; + } + if (47 === r) { + if (o === h - 1 || 1 === s) ; else if (o !== h - 1 && 2 === s) { + if (n.length < 2 || 2 !== i || 46 !== n.charCodeAt(n.length - 1) || 46 !== n.charCodeAt(n.length - 2)) if (n.length > 2) { + var a = n.lastIndexOf('/'); + if (a !== n.length - 1) { + -1 === a ? (n = '', i = 0) : i = (n = n.slice(0, a)).length - 1 - n.lastIndexOf('/'), + o = h, s = 0; + continue; + } + } else if (2 === n.length || 1 === n.length) { + n = '', i = 0, o = h, s = 0; + continue; + } + e && (n.length > 0 ? n += '/..' : n = '..', i = 2); + } else n.length > 0 ? n += '/' + t.slice(o + 1, h) : n = t.slice(o + 1, h), i = h - o - 1; + o = h, s = 0; + } else 46 === r && -1 !== s ? ++s : s = -1; + } + return n; + } + var n = { + resolve: function() { + for (var t, n = '', i = !1, o = arguments.length - 1; o >= -1 && !i; o--) { + var s; + o >= 0 ? s = arguments[o] : (void 0 === t && (t = process.cwd()), s = t), e(s), + 0 !== s.length && (n = s + '/' + n, i = 47 === s.charCodeAt(0)); + } + return n = r(n, !i), i ? n.length > 0 ? '/' + n : '/' : n.length > 0 ? n : '.'; + }, + normalize: function(t) { + if (e(t), 0 === t.length) return '.'; + var n = 47 === t.charCodeAt(0), i = 47 === t.charCodeAt(t.length - 1); + return 0 !== (t = r(t, !n)).length || n || (t = '.'), t.length > 0 && i && (t += '/'), + n ? '/' + t : t; + }, + isAbsolute: function(t) { + return e(t), t.length > 0 && 47 === t.charCodeAt(0); + }, + join: function() { + if (0 === arguments.length) return '.'; + for (var t, r = 0; r < arguments.length; ++r) { + var i = arguments[r]; + e(i), i.length > 0 && (void 0 === t ? t = i : t += '/' + i); + } + return void 0 === t ? '.' : n.normalize(t); + }, + relative: function(t, r) { + if (e(t), e(r), t === r) return ''; + if ((t = n.resolve(t)) === (r = n.resolve(r))) return ''; + for (var i = 1; i < t.length && 47 === t.charCodeAt(i); ++i) ; + for (var o = t.length, s = o - i, h = 1; h < r.length && 47 === r.charCodeAt(h); ++h) ; + for (var a = r.length - h, c = s < a ? s : a, f = -1, u = 0; u <= c; ++u) { + if (u === c) { + if (a > c) { + if (47 === r.charCodeAt(h + u)) return r.slice(h + u + 1); + if (0 === u) return r.slice(h + u); + } else s > c && (47 === t.charCodeAt(i + u) ? f = u : 0 === u && (f = 0)); + break; + } + var l = t.charCodeAt(i + u); + if (l !== r.charCodeAt(h + u)) break; + 47 === l && (f = u); + } + var g = ''; + for (u = i + f + 1; u <= o; ++u) u !== o && 47 !== t.charCodeAt(u) || (0 === g.length ? g += '..' : g += '/..'); + return g.length > 0 ? g + r.slice(h + f) : (h += f, 47 === r.charCodeAt(h) && ++h, + r.slice(h)); + }, + _makeLong: function(t) { + return t; + }, + dirname: function(t) { + if (e(t), 0 === t.length) return '.'; + for (var r = t.charCodeAt(0), n = 47 === r, i = -1, o = !0, s = t.length - 1; s >= 1; --s) if (47 === (r = t.charCodeAt(s))) { + if (!o) { + i = s; + break; + } + } else o = !1; + return -1 === i ? n ? '/' : '.' : n && 1 === i ? '//' : t.slice(0, i); + }, + basename: function(t, r) { + if (void 0 !== r && 'string' != typeof r) throw new TypeError('"ext" argument must be a string'); + e(t); + var n, i = 0, o = -1, s = !0; + if (void 0 !== r && r.length > 0 && r.length <= t.length) { + if (r.length === t.length && r === t) return ''; + var h = r.length - 1, a = -1; + for (n = t.length - 1; n >= 0; --n) { + var c = t.charCodeAt(n); + if (47 === c) { + if (!s) { + i = n + 1; + break; + } + } else -1 === a && (s = !1, a = n + 1), h >= 0 && (c === r.charCodeAt(h) ? -1 == --h && (o = n) : (h = -1, + o = a)); + } + return i === o ? o = a : -1 === o && (o = t.length), t.slice(i, o); + } + for (n = t.length - 1; n >= 0; --n) if (47 === t.charCodeAt(n)) { + if (!s) { + i = n + 1; + break; + } + } else -1 === o && (s = !1, o = n + 1); + return -1 === o ? '' : t.slice(i, o); + }, + extname: function(t) { + e(t); + for (var r = -1, n = 0, i = -1, o = !0, s = 0, h = t.length - 1; h >= 0; --h) { + var a = t.charCodeAt(h); + if (47 !== a) -1 === i && (o = !1, i = h + 1), 46 === a ? -1 === r ? r = h : 1 !== s && (s = 1) : -1 !== r && (s = -1); else if (!o) { + n = h + 1; + break; + } + } + return -1 === r || -1 === i || 0 === s || 1 === s && r === i - 1 && r === n + 1 ? '' : t.slice(r, i); + }, + format: function(t) { + if (null === t || 'object' != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t); + return function(t, e) { + var r = e.dir || e.root, n = e.base || (e.name || '') + (e.ext || ''); + return r ? r === e.root ? r + n : r + '/' + n : n; + }(0, t); + }, + parse: function(t) { + e(t); + var r = { + root: '', + dir: '', + base: '', + ext: '', + name: '' + }; + if (0 === t.length) return r; + var n, i = t.charCodeAt(0), o = 47 === i; + o ? (r.root = '/', n = 1) : n = 0; + for (var s = -1, h = 0, a = -1, c = !0, f = t.length - 1, u = 0; f >= n; --f) if (47 !== (i = t.charCodeAt(f))) -1 === a && (c = !1, + a = f + 1), 46 === i ? -1 === s ? s = f : 1 !== u && (u = 1) : -1 !== s && (u = -1); else if (!c) { + h = f + 1; + break; + } + return -1 === s || -1 === a || 0 === u || 1 === u && s === a - 1 && s === h + 1 ? -1 !== a && (r.base = r.name = 0 === h && o ? t.slice(1, a) : t.slice(h, a)) : (0 === h && o ? (r.name = t.slice(1, s), + r.base = t.slice(1, a)) : (r.name = t.slice(h, s), r.base = t.slice(h, a)), r.ext = t.slice(s, a)), + h > 0 ? r.dir = t.slice(0, h - 1) : o && (r.dir = '/'), r; + }, + sep: '/', + delimiter: ':', + win32: null, + posix: null + }; + n.posix = n, t.exports = n; + } + }, e = {}; + function r(n) { + var i = e[n]; + if (void 0 !== i) return i.exports; + var o = e[n] = { + exports: {} + }; + return t[n](o, o.exports, r), o.exports; + } + r.d = (t, e) => { + for (var n in e) r.o(e, n) && !r.o(t, n) && Object.defineProperty(t, n, { + enumerable: !0, + get: e[n] + }); + }, r.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e), r.r = t => { + 'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { + value: 'Module' + }), Object.defineProperty(t, '__esModule', { + value: !0 + }); + }; + var n = {}; + (() => { + let t; + if (r.r(n), r.d(n, { + URI: () => f, + Utils: () => P + }), 'object' == typeof process) t = 'win32' === process.platform; else if ('object' == typeof navigator) { + let e = navigator.userAgent; + t = e.indexOf('Windows') >= 0; + } + const e = /^\w[\w\d+.-]*$/, i = /^\//, o = /^\/\//; + function s(t, r) { + if (!t.scheme && r) throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`); + if (t.scheme && !e.test(t.scheme)) throw new Error('[UriError]: Scheme contains illegal characters.'); + if (t.path) if (t.authority) { + if (!i.test(t.path)) throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } else if (o.test(t.path)) throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + const h = '', a = '/', c = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; + class f { + static isUri(t) { + return t instanceof f || !!t && 'string' == typeof t.authority && 'string' == typeof t.fragment && 'string' == typeof t.path && 'string' == typeof t.query && 'string' == typeof t.scheme && 'string' == typeof t.fsPath && 'function' == typeof t.with && 'function' == typeof t.toString; + } + scheme; + authority; + path; + query; + fragment; + constructor(t, e, r, n, i, o = !1) { + 'object' == typeof t ? (this.scheme = t.scheme || h, this.authority = t.authority || h, + this.path = t.path || h, this.query = t.query || h, this.fragment = t.fragment || h) : (this.scheme = function(t, e) { + return t || e ? t : 'file'; + }(t, o), this.authority = e || h, this.path = function(t, e) { + switch (t) { + case 'https': + case 'http': + case 'file': + e ? e[0] !== a && (e = a + e) : e = a; + } + return e; + }(this.scheme, r || h), this.query = n || h, this.fragment = i || h, s(this, o)); + } + get fsPath() { + return m(this, !1); + } + with(t) { + if (!t) return this; + let {scheme: e, authority: r, path: n, query: i, fragment: o} = t; + return void 0 === e ? e = this.scheme : null === e && (e = h), void 0 === r ? r = this.authority : null === r && (r = h), + void 0 === n ? n = this.path : null === n && (n = h), void 0 === i ? i = this.query : null === i && (i = h), + void 0 === o ? o = this.fragment : null === o && (o = h), e === this.scheme && r === this.authority && n === this.path && i === this.query && o === this.fragment ? this : new l(e, r, n, i, o); + } + static parse(t, e = !1) { + const r = c.exec(t); + return r ? new l(r[2] || h, C(r[4] || h), C(r[5] || h), C(r[7] || h), C(r[9] || h), e) : new l(h, h, h, h, h); + } + static file(e) { + let r = h; + if (t && (e = e.replace(/\\/g, a)), e[0] === a && e[1] === a) { + const t = e.indexOf(a, 2); + -1 === t ? (r = e.substring(2), e = a) : (r = e.substring(2, t), e = e.substring(t) || a); + } + return new l('file', r, e, h, h); + } + static from(t) { + const e = new l(t.scheme, t.authority, t.path, t.query, t.fragment); + return s(e, !0), e; + } + toString(t = !1) { + return y(this, t); + } + toJSON() { + return this; + } + static revive(t) { + if (t) { + if (t instanceof f) return t; + { + const e = new l(t); + return e._formatted = t.external, e._fsPath = t._sep === u ? t.fsPath : null, e; + } + } + return t; + } + } + const u = t ? 1 : void 0; + class l extends f { + _formatted=null; + _fsPath=null; + get fsPath() { + return this._fsPath || (this._fsPath = m(this, !1)), this._fsPath; + } + toString(t = !1) { + return t ? y(this, !0) : (this._formatted || (this._formatted = y(this, !1)), this._formatted); + } + toJSON() { + const t = { + $mid: 1 + }; + return this._fsPath && (t.fsPath = this._fsPath, t._sep = u), this._formatted && (t.external = this._formatted), + this.path && (t.path = this.path), this.scheme && (t.scheme = this.scheme), this.authority && (t.authority = this.authority), + this.query && (t.query = this.query), this.fragment && (t.fragment = this.fragment), + t; + } + } + const g = { + 58: '%3A', + 47: '%2F', + 63: '%3F', + 35: '%23', + 91: '%5B', + 93: '%5D', + 64: '%40', + 33: '%21', + 36: '%24', + 38: '%26', + 39: '%27', + 40: '%28', + 41: '%29', + 42: '%2A', + 43: '%2B', + 44: '%2C', + 59: '%3B', + 61: '%3D', + 32: '%20' + }; + function d(t, e, r) { + let n, i = -1; + for (let o = 0; o < t.length; o++) { + const s = t.charCodeAt(o); + if (s >= 97 && s <= 122 || s >= 65 && s <= 90 || s >= 48 && s <= 57 || 45 === s || 46 === s || 95 === s || 126 === s || e && 47 === s || r && 91 === s || r && 93 === s || r && 58 === s) -1 !== i && (n += encodeURIComponent(t.substring(i, o)), + i = -1), void 0 !== n && (n += t.charAt(o)); else { + void 0 === n && (n = t.substr(0, o)); + const e = g[s]; + void 0 !== e ? (-1 !== i && (n += encodeURIComponent(t.substring(i, o)), i = -1), + n += e) : -1 === i && (i = o); + } + } + return -1 !== i && (n += encodeURIComponent(t.substring(i))), void 0 !== n ? n : t; + } + function p(t) { + let e; + for (let r = 0; r < t.length; r++) { + const n = t.charCodeAt(r); + 35 === n || 63 === n ? (void 0 === e && (e = t.substr(0, r)), e += g[n]) : void 0 !== e && (e += t[r]); + } + return void 0 !== e ? e : t; + } + function m(e, r) { + let n; + return n = e.authority && e.path.length > 1 && 'file' === e.scheme ? `//${e.authority}${e.path}` : 47 === e.path.charCodeAt(0) && (e.path.charCodeAt(1) >= 65 && e.path.charCodeAt(1) <= 90 || e.path.charCodeAt(1) >= 97 && e.path.charCodeAt(1) <= 122) && 58 === e.path.charCodeAt(2) ? r ? e.path.substr(1) : e.path[1].toLowerCase() + e.path.substr(2) : e.path, + t && (n = n.replace(/\//g, '\\')), n; + } + function y(t, e) { + const r = e ? p : d; + let n = '', {scheme: i, authority: o, path: s, query: h, fragment: c} = t; + if (i && (n += i, n += ':'), (o || 'file' === i) && (n += a, n += a), o) { + let t = o.indexOf('@'); + if (-1 !== t) { + const e = o.substr(0, t); + o = o.substr(t + 1), t = e.lastIndexOf(':'), -1 === t ? n += r(e, !1, !1) : (n += r(e.substr(0, t), !1, !1), + n += ':', n += r(e.substr(t + 1), !1, !0)), n += '@'; + } + o = o.toLowerCase(), t = o.lastIndexOf(':'), -1 === t ? n += r(o, !1, !0) : (n += r(o.substr(0, t), !1, !0), + n += o.substr(t)); + } + if (s) { + if (s.length >= 3 && 47 === s.charCodeAt(0) && 58 === s.charCodeAt(2)) { + const t = s.charCodeAt(1); + t >= 65 && t <= 90 && (s = `/${String.fromCharCode(t + 32)}:${s.substr(3)}`); + } else if (s.length >= 2 && 58 === s.charCodeAt(1)) { + const t = s.charCodeAt(0); + t >= 65 && t <= 90 && (s = `${String.fromCharCode(t + 32)}:${s.substr(2)}`); + } + n += r(s, !0, !1); + } + return h && (n += '?', n += r(h, !1, !1)), c && (n += '#', n += e ? c : d(c, !1, !1)), + n; + } + function v(t) { + try { + return decodeURIComponent(t); + } catch { + return t.length > 3 ? t.substr(0, 3) + v(t.substr(3)) : t; + } + } + const b = /(%[0-9A-Za-z][0-9A-Za-z])+/g; + function C(t) { + return t.match(b) ? t.replace(b, (t => v(t))) : t; + } + var A = r(470); + const w = A.posix || A, x = '/'; + var P; + !function(t) { + t.joinPath = function(t, ...e) { + return t.with({ + path: w.join(t.path, ...e) + }); + }, t.resolvePath = function(t, ...e) { + let r = t.path, n = !1; + r[0] !== x && (r = x + r, n = !0); + let i = w.resolve(r, ...e); + return n && i[0] === x && !t.authority && (i = i.substring(1)), t.with({ + path: i + }); + }, t.dirname = function(t) { + if (0 === t.path.length || t.path === x) return t; + let e = w.dirname(t.path); + return 1 === e.length && 46 === e.charCodeAt(0) && (e = ''), t.with({ + path: e + }); + }, t.basename = function(t) { + return w.basename(t.path); + }, t.extname = function(t) { + return w.extname(t.path); + }; + }(P || (P = {})); + })(), LIB = n; +})(); + +const {URI: URI, Utils: Utils} = LIB; + +class FullTextDocument { + constructor(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = undefined; + } + get uri() { + return this._uri; + } + get languageId() { + return this._languageId; + } + get version() { + return this._version; + } + getText(range) { + if (range) { + const start = this.offsetAt(range.start); + const end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + } + update(changes, version) { + for (let change of changes) { + if (FullTextDocument.isIncremental(change)) { + const range = getWellformedRange(change.range); + const startOffset = this.offsetAt(range.start); + const endOffset = this.offsetAt(range.end); + this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); + const startLine = Math.max(range.start.line, 0); + const endLine = Math.max(range.end.line, 0); + let lineOffsets = this._lineOffsets; + const addedLineOffsets = computeLineOffsets(change.text, false, startOffset); + if (endLine - startLine === addedLineOffsets.length) { + for (let i = 0, len = addedLineOffsets.length; i < len; i++) { + lineOffsets[i + startLine + 1] = addedLineOffsets[i]; + } + } else { + if (addedLineOffsets.length < 1e4) { + lineOffsets.splice(startLine + 1, endLine - startLine, ...addedLineOffsets); + } else { + this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); + } + } + const diff = change.text.length - (endOffset - startOffset); + if (diff !== 0) { + for (let i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { + lineOffsets[i] = lineOffsets[i] + diff; + } + } + } else if (FullTextDocument.isFull(change)) { + this._content = change.text; + this._lineOffsets = undefined; + } else { + throw new Error('Unknown change event received'); + } + } + this._version = version; + } + getLineOffsets() { + if (this._lineOffsets === undefined) { + this._lineOffsets = computeLineOffsets(this._content, true); + } + return this._lineOffsets; + } + positionAt(offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + let lineOffsets = this.getLineOffsets(); + let low = 0, high = lineOffsets.length; + if (high === 0) { + return { + line: 0, + character: offset + }; + } + while (low < high) { + let mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } else { + low = mid + 1; + } + } + let line = low - 1; + return { + line: line, + character: offset - lineOffsets[line] + }; + } + offsetAt(position) { + let lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } else if (position.line < 0) { + return 0; + } + let lineOffset = lineOffsets[position.line]; + let nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + } + get lineCount() { + return this.getLineOffsets().length; + } + static isIncremental(event) { + let candidate = event; + return candidate !== undefined && candidate !== null && typeof candidate.text === 'string' && candidate.range !== undefined && (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number'); + } + static isFull(event) { + let candidate = event; + return candidate !== undefined && candidate !== null && typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined; + } +} + +var TextDocument; + +(function(TextDocument) { + function create(uri, languageId, version, content) { + return new FullTextDocument(uri, languageId, version, content); + } + TextDocument.create = create; + function update(document, changes, version) { + if (document instanceof FullTextDocument) { + document.update(changes, version); + return document; + } else { + throw new Error('TextDocument.update: document must be created by TextDocument.create'); + } + } + TextDocument.update = update; + function applyEdits(document, edits) { + let text = document.getText(); + let sortedEdits = mergeSort(edits.map(getWellformedEdit), ((a, b) => { + let diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + })); + let lastModifiedOffset = 0; + const spans = []; + for (const e of sortedEdits) { + let startOffset = document.offsetAt(e.range.start); + if (startOffset < lastModifiedOffset) { + throw new Error('Overlapping edit'); + } else if (startOffset > lastModifiedOffset) { + spans.push(text.substring(lastModifiedOffset, startOffset)); + } + if (e.newText.length) { + spans.push(e.newText); + } + lastModifiedOffset = document.offsetAt(e.range.end); + } + spans.push(text.substr(lastModifiedOffset)); + return spans.join(''); + } + TextDocument.applyEdits = applyEdits; +})(TextDocument || (TextDocument = {})); + +function mergeSort(data, compare) { + if (data.length <= 1) { + return data; + } + const p = data.length / 2 | 0; + const left = data.slice(0, p); + const right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + let leftIdx = 0; + let rightIdx = 0; + let i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + let ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + data[i++] = left[leftIdx++]; + } else { + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; +} + +function computeLineOffsets(text, isAtLineStart, textOffset = 0) { + const result = isAtLineStart ? [ textOffset ] : []; + for (let i = 0; i < text.length; i++) { + let ch = text.charCodeAt(i); + if (ch === 13 || ch === 10) { + if (ch === 13 && i + 1 < text.length && text.charCodeAt(i + 1) === 10) { + i++; + } + result.push(textOffset + i + 1); + } + } + return result; +} + +function getWellformedRange(range) { + const start = range.start; + const end = range.end; + if (start.line > end.line || start.line === end.line && start.character > end.character) { + return { + start: end, + end: start + }; + } + return range; +} + +function getWellformedEdit(textEdit) { + const range = getWellformedRange(textEdit.range); + if (range !== textEdit.range) { + return { + newText: textEdit.newText, + range: range + }; + } + return textEdit; +} + +const typescript = 'typescript'; + +const typescriptreact = 'typescriptreact'; + +const javascript = 'javascript'; + +const javascriptreact = 'javascriptreact'; + +const jsTsLanguageModes = [ javascript, javascriptreact, typescript, typescriptreact ]; + +function isTypeScriptDocument(doc) { + return [ typescript, typescriptreact ].includes(doc.languageId); +} + +var TypeScriptRenameRequest; + +(function(TypeScriptRenameRequest) { + TypeScriptRenameRequest.type = new main$2.RequestType('_typescript.rename'); +})(TypeScriptRenameRequest || (TypeScriptRenameRequest = {})); + +var CommandTypes; + +(function(CommandTypes) { + CommandTypes['JsxClosingTag'] = 'jsxClosingTag'; + CommandTypes['LinkedEditingRange'] = 'linkedEditingRange'; + CommandTypes['Brace'] = 'brace'; + CommandTypes['BraceCompletion'] = 'braceCompletion'; + CommandTypes['GetSpanOfEnclosingComment'] = 'getSpanOfEnclosingComment'; + CommandTypes['Change'] = 'change'; + CommandTypes['Close'] = 'close'; + CommandTypes['Completions'] = 'completions'; + CommandTypes['CompletionInfo'] = 'completionInfo'; + CommandTypes['CompletionDetails'] = 'completionEntryDetails'; + CommandTypes['CompileOnSaveAffectedFileList'] = 'compileOnSaveAffectedFileList'; + CommandTypes['CompileOnSaveEmitFile'] = 'compileOnSaveEmitFile'; + CommandTypes['Configure'] = 'configure'; + CommandTypes['Definition'] = 'definition'; + CommandTypes['DefinitionAndBoundSpan'] = 'definitionAndBoundSpan'; + CommandTypes['EncodedSemanticClassificationsFull'] = 'encodedSemanticClassifications-full'; + CommandTypes['Implementation'] = 'implementation'; + CommandTypes['Exit'] = 'exit'; + CommandTypes['FileReferences'] = 'fileReferences'; + CommandTypes['Format'] = 'format'; + CommandTypes['Formatonkey'] = 'formatonkey'; + CommandTypes['Geterr'] = 'geterr'; + CommandTypes['GeterrForProject'] = 'geterrForProject'; + CommandTypes['SemanticDiagnosticsSync'] = 'semanticDiagnosticsSync'; + CommandTypes['SyntacticDiagnosticsSync'] = 'syntacticDiagnosticsSync'; + CommandTypes['SuggestionDiagnosticsSync'] = 'suggestionDiagnosticsSync'; + CommandTypes['NavBar'] = 'navbar'; + CommandTypes['Navto'] = 'navto'; + CommandTypes['NavTree'] = 'navtree'; + CommandTypes['NavTreeFull'] = 'navtree-full'; + CommandTypes['Occurrences'] = 'occurrences'; + CommandTypes['DocumentHighlights'] = 'documentHighlights'; + CommandTypes['Open'] = 'open'; + CommandTypes['Quickinfo'] = 'quickinfo'; + CommandTypes['References'] = 'references'; + CommandTypes['Reload'] = 'reload'; + CommandTypes['Rename'] = 'rename'; + CommandTypes['Saveto'] = 'saveto'; + CommandTypes['SignatureHelp'] = 'signatureHelp'; + CommandTypes['FindSourceDefinition'] = 'findSourceDefinition'; + CommandTypes['Status'] = 'status'; + CommandTypes['TypeDefinition'] = 'typeDefinition'; + CommandTypes['ProjectInfo'] = 'projectInfo'; + CommandTypes['ReloadProjects'] = 'reloadProjects'; + CommandTypes['Unknown'] = 'unknown'; + CommandTypes['OpenExternalProject'] = 'openExternalProject'; + CommandTypes['OpenExternalProjects'] = 'openExternalProjects'; + CommandTypes['CloseExternalProject'] = 'closeExternalProject'; + CommandTypes['UpdateOpen'] = 'updateOpen'; + CommandTypes['GetOutliningSpans'] = 'getOutliningSpans'; + CommandTypes['TodoComments'] = 'todoComments'; + CommandTypes['Indentation'] = 'indentation'; + CommandTypes['DocCommentTemplate'] = 'docCommentTemplate'; + CommandTypes['CompilerOptionsForInferredProjects'] = 'compilerOptionsForInferredProjects'; + CommandTypes['GetCodeFixes'] = 'getCodeFixes'; + CommandTypes['GetCombinedCodeFix'] = 'getCombinedCodeFix'; + CommandTypes['ApplyCodeActionCommand'] = 'applyCodeActionCommand'; + CommandTypes['GetSupportedCodeFixes'] = 'getSupportedCodeFixes'; + CommandTypes['GetApplicableRefactors'] = 'getApplicableRefactors'; + CommandTypes['GetEditsForRefactor'] = 'getEditsForRefactor'; + CommandTypes['OrganizeImports'] = 'organizeImports'; + CommandTypes['GetEditsForFileRename'] = 'getEditsForFileRename'; + CommandTypes['ConfigurePlugin'] = 'configurePlugin'; + CommandTypes['SelectionRange'] = 'selectionRange'; + CommandTypes['ToggleLineComment'] = 'toggleLineComment'; + CommandTypes['ToggleMultilineComment'] = 'toggleMultilineComment'; + CommandTypes['CommentSelection'] = 'commentSelection'; + CommandTypes['UncommentSelection'] = 'uncommentSelection'; + CommandTypes['PrepareCallHierarchy'] = 'prepareCallHierarchy'; + CommandTypes['ProvideCallHierarchyIncomingCalls'] = 'provideCallHierarchyIncomingCalls'; + CommandTypes['ProvideCallHierarchyOutgoingCalls'] = 'provideCallHierarchyOutgoingCalls'; + CommandTypes['ProvideInlayHints'] = 'provideInlayHints'; +})(CommandTypes || (CommandTypes = {})); + +var HighlightSpanKind; + +(function(HighlightSpanKind) { + HighlightSpanKind['none'] = 'none'; + HighlightSpanKind['definition'] = 'definition'; + HighlightSpanKind['reference'] = 'reference'; + HighlightSpanKind['writtenReference'] = 'writtenReference'; +})(HighlightSpanKind || (HighlightSpanKind = {})); + +var JsxEmit; + +(function(JsxEmit) { + JsxEmit['None'] = 'None'; + JsxEmit['Preserve'] = 'Preserve'; + JsxEmit['ReactNative'] = 'ReactNative'; + JsxEmit['React'] = 'React'; +})(JsxEmit || (JsxEmit = {})); + +var ModuleKind; + +(function(ModuleKind) { + ModuleKind['None'] = 'None'; + ModuleKind['CommonJS'] = 'CommonJS'; + ModuleKind['AMD'] = 'AMD'; + ModuleKind['UMD'] = 'UMD'; + ModuleKind['System'] = 'System'; + ModuleKind['ES6'] = 'ES6'; + ModuleKind['ES2015'] = 'ES2015'; + ModuleKind['ESNext'] = 'ESNext'; +})(ModuleKind || (ModuleKind = {})); + +var ModuleResolutionKind; + +(function(ModuleResolutionKind) { + ModuleResolutionKind['Classic'] = 'Classic'; + ModuleResolutionKind['Node'] = 'Node'; +})(ModuleResolutionKind || (ModuleResolutionKind = {})); + +var SemicolonPreference; + +(function(SemicolonPreference) { + SemicolonPreference['Ignore'] = 'ignore'; + SemicolonPreference['Insert'] = 'insert'; + SemicolonPreference['Remove'] = 'remove'; +})(SemicolonPreference || (SemicolonPreference = {})); + +var ScriptElementKind; + +(function(ScriptElementKind) { + ScriptElementKind['unknown'] = ''; + ScriptElementKind['warning'] = 'warning'; + ScriptElementKind['keyword'] = 'keyword'; + ScriptElementKind['scriptElement'] = 'script'; + ScriptElementKind['moduleElement'] = 'module'; + ScriptElementKind['classElement'] = 'class'; + ScriptElementKind['localClassElement'] = 'local class'; + ScriptElementKind['interfaceElement'] = 'interface'; + ScriptElementKind['typeElement'] = 'type'; + ScriptElementKind['enumElement'] = 'enum'; + ScriptElementKind['enumMemberElement'] = 'enum member'; + ScriptElementKind['variableElement'] = 'var'; + ScriptElementKind['localVariableElement'] = 'local var'; + ScriptElementKind['variableUsingElement'] = 'using'; + ScriptElementKind['variableAwaitUsingElement'] = 'await using'; + ScriptElementKind['functionElement'] = 'function'; + ScriptElementKind['localFunctionElement'] = 'local function'; + ScriptElementKind['memberFunctionElement'] = 'method'; + ScriptElementKind['memberGetAccessorElement'] = 'getter'; + ScriptElementKind['memberSetAccessorElement'] = 'setter'; + ScriptElementKind['memberVariableElement'] = 'property'; + ScriptElementKind['memberAccessorVariableElement'] = 'accessor'; + ScriptElementKind['constructorImplementationElement'] = 'constructor'; + ScriptElementKind['callSignatureElement'] = 'call'; + ScriptElementKind['indexSignatureElement'] = 'index'; + ScriptElementKind['constructSignatureElement'] = 'construct'; + ScriptElementKind['parameterElement'] = 'parameter'; + ScriptElementKind['typeParameterElement'] = 'type parameter'; + ScriptElementKind['primitiveType'] = 'primitive type'; + ScriptElementKind['label'] = 'label'; + ScriptElementKind['alias'] = 'alias'; + ScriptElementKind['constElement'] = 'const'; + ScriptElementKind['letElement'] = 'let'; + ScriptElementKind['directory'] = 'directory'; + ScriptElementKind['externalModuleName'] = 'external module name'; + ScriptElementKind['jsxAttribute'] = 'JSX attribute'; + ScriptElementKind['string'] = 'string'; + ScriptElementKind['link'] = 'link'; + ScriptElementKind['linkName'] = 'link name'; + ScriptElementKind['linkText'] = 'link text'; +})(ScriptElementKind || (ScriptElementKind = {})); + +var ScriptElementKindModifier; + +(function(ScriptElementKindModifier) { + ScriptElementKindModifier['none'] = ''; + ScriptElementKindModifier['publicMemberModifier'] = 'public'; + ScriptElementKindModifier['privateMemberModifier'] = 'private'; + ScriptElementKindModifier['protectedMemberModifier'] = 'protected'; + ScriptElementKindModifier['exportedModifier'] = 'export'; + ScriptElementKindModifier['ambientModifier'] = 'declare'; + ScriptElementKindModifier['staticModifier'] = 'static'; + ScriptElementKindModifier['abstractModifier'] = 'abstract'; + ScriptElementKindModifier['optionalModifier'] = 'optional'; + ScriptElementKindModifier['deprecatedModifier'] = 'deprecated'; + ScriptElementKindModifier['dtsModifier'] = '.d.ts'; + ScriptElementKindModifier['tsModifier'] = '.ts'; + ScriptElementKindModifier['tsxModifier'] = '.tsx'; + ScriptElementKindModifier['jsModifier'] = '.js'; + ScriptElementKindModifier['jsxModifier'] = '.jsx'; + ScriptElementKindModifier['jsonModifier'] = '.json'; + ScriptElementKindModifier['dmtsModifier'] = '.d.mts'; + ScriptElementKindModifier['mtsModifier'] = '.mts'; + ScriptElementKindModifier['mjsModifier'] = '.mjs'; + ScriptElementKindModifier['dctsModifier'] = '.d.cts'; + ScriptElementKindModifier['ctsModifier'] = '.cts'; + ScriptElementKindModifier['cjsModifier'] = '.cjs'; +})(ScriptElementKindModifier || (ScriptElementKindModifier = {})); + +var ScriptTarget; + +(function(ScriptTarget) { + ScriptTarget['ES3'] = 'ES3'; + ScriptTarget['ES5'] = 'ES5'; + ScriptTarget['ES6'] = 'ES6'; + ScriptTarget['ES2015'] = 'ES2015'; + ScriptTarget['ES2016'] = 'ES2016'; + ScriptTarget['ES2017'] = 'ES2017'; + ScriptTarget['ES2018'] = 'ES2018'; + ScriptTarget['ES2019'] = 'ES2019'; + ScriptTarget['ES2020'] = 'ES2020'; + ScriptTarget['ES2021'] = 'ES2021'; + ScriptTarget['ES2022'] = 'ES2022'; + ScriptTarget['ESNext'] = 'ESNext'; +})(ScriptTarget || (ScriptTarget = {})); + +var SymbolDisplayPartKind; + +(function(SymbolDisplayPartKind) { + SymbolDisplayPartKind[SymbolDisplayPartKind['aliasName'] = 0] = 'aliasName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['className'] = 1] = 'className'; + SymbolDisplayPartKind[SymbolDisplayPartKind['enumName'] = 2] = 'enumName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['fieldName'] = 3] = 'fieldName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['interfaceName'] = 4] = 'interfaceName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['keyword'] = 5] = 'keyword'; + SymbolDisplayPartKind[SymbolDisplayPartKind['lineBreak'] = 6] = 'lineBreak'; + SymbolDisplayPartKind[SymbolDisplayPartKind['numericLiteral'] = 7] = 'numericLiteral'; + SymbolDisplayPartKind[SymbolDisplayPartKind['stringLiteral'] = 8] = 'stringLiteral'; + SymbolDisplayPartKind[SymbolDisplayPartKind['localName'] = 9] = 'localName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['methodName'] = 10] = 'methodName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['moduleName'] = 11] = 'moduleName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['operator'] = 12] = 'operator'; + SymbolDisplayPartKind[SymbolDisplayPartKind['parameterName'] = 13] = 'parameterName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['propertyName'] = 14] = 'propertyName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['punctuation'] = 15] = 'punctuation'; + SymbolDisplayPartKind[SymbolDisplayPartKind['space'] = 16] = 'space'; + SymbolDisplayPartKind[SymbolDisplayPartKind['text'] = 17] = 'text'; + SymbolDisplayPartKind[SymbolDisplayPartKind['typeParameterName'] = 18] = 'typeParameterName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['enumMemberName'] = 19] = 'enumMemberName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['functionName'] = 20] = 'functionName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['regularExpressionLiteral'] = 21] = 'regularExpressionLiteral'; + SymbolDisplayPartKind[SymbolDisplayPartKind['link'] = 22] = 'link'; + SymbolDisplayPartKind[SymbolDisplayPartKind['linkName'] = 23] = 'linkName'; + SymbolDisplayPartKind[SymbolDisplayPartKind['linkText'] = 24] = 'linkText'; +})(SymbolDisplayPartKind || (SymbolDisplayPartKind = {})); + +var OrganizeImportsMode; + +(function(OrganizeImportsMode) { + OrganizeImportsMode['All'] = 'All'; + OrganizeImportsMode['SortAndCombine'] = 'SortAndCombine'; + OrganizeImportsMode['RemoveUnused'] = 'RemoveUnused'; +})(OrganizeImportsMode || (OrganizeImportsMode = {})); + +class KindModifiers {} + +KindModifiers.optional = 'optional'; + +KindModifiers.deprecated = 'deprecated'; + +KindModifiers.dtsFile = '.d.ts'; + +KindModifiers.tsFile = '.ts'; + +KindModifiers.tsxFile = '.tsx'; + +KindModifiers.jsFile = '.js'; + +KindModifiers.jsxFile = '.jsx'; + +KindModifiers.jsonFile = '.json'; + +KindModifiers.fileExtensionKindModifiers = [ KindModifiers.dtsFile, KindModifiers.tsFile, KindModifiers.tsxFile, KindModifiers.jsFile, KindModifiers.jsxFile, KindModifiers.jsonFile ]; + +const SYMBOL_DISPLAY_PART_KIND_MAP = { + aliasName: 0, + className: 1, + enumName: 2, + fieldName: 3, + interfaceName: 4, + keyword: 5, + lineBreak: 6, + numericLiteral: 7, + stringLiteral: 8, + localName: 9, + methodName: 10, + moduleName: 11, + operator: 12, + parameterName: 13, + propertyName: 14, + punctuation: 15, + space: 16, + text: 17, + typeParameterName: 18, + enumMemberName: 19, + functionName: 20, + regularExpressionLiteral: 21, + link: 22, + linkName: 23, + linkText: 24 +}; + +function toSymbolDisplayPartKind(kind) { + return SYMBOL_DISPLAY_PART_KIND_MAP[kind]; +} + +var ServerType; + +(function(ServerType) { + ServerType['Syntax'] = 'syntax'; + ServerType['Semantic'] = 'semantic'; +})(ServerType || (ServerType = {})); + +var ServerResponse; + +(function(ServerResponse) { + class Cancelled { + constructor(reason) { + this.reason = reason; + this.type = 'cancelled'; + } + } + ServerResponse.Cancelled = Cancelled; + ServerResponse.NoContent = { + type: 'noContent' + }; + ServerResponse.NoServer = { + type: 'noServer' + }; +})(ServerResponse || (ServerResponse = {})); + +var ClientCapability; + +(function(ClientCapability) { + ClientCapability[ClientCapability['Syntax'] = 0] = 'Syntax'; + ClientCapability[ClientCapability['EnhancedSyntax'] = 1] = 'EnhancedSyntax'; + ClientCapability[ClientCapability['Semantic'] = 2] = 'Semantic'; +})(ClientCapability || (ClientCapability = {})); + +class ClientCapabilities { + constructor(...capabilities) { + this.capabilities = new Set(capabilities); + } + has(capability) { + return this.capabilities.has(capability); + } +} + +var re$2 = { + exports: {} +}; + +const SEMVER_SPEC_VERSION = '2.0.0'; + +const MAX_LENGTH$1 = 256; + +const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || 9007199254740991; + +const MAX_SAFE_COMPONENT_LENGTH = 16; + +const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6; + +const RELEASE_TYPES = [ 'major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease' ]; + +var constants$1 = { + MAX_LENGTH: MAX_LENGTH$1, + MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1, + RELEASE_TYPES: RELEASE_TYPES, + SEMVER_SPEC_VERSION: SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 1, + FLAG_LOOSE: 2 +}; + +const debug$1 = typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error('SEMVER', ...args) : () => {}; + +var debug_1 = debug$1; + +(function(module, exports) { + const {MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH, MAX_LENGTH: MAX_LENGTH} = constants$1; + const debug = debug_1; + exports = module.exports = {}; + const re = exports.re = []; + const safeRe = exports.safeRe = []; + const src = exports.src = []; + const t = exports.t = {}; + let R = 0; + const LETTERDASHNUMBER = '[a-zA-Z0-9-]'; + const safeRegexReplacements = [ [ '\\s', 1 ], [ '\\d', MAX_LENGTH ], [ LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH ] ]; + const makeSafeRegex = value => { + for (const [token, max] of safeRegexReplacements) { + value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); + } + return value; + }; + const createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index = R++; + debug(name, index, value); + t[name] = index; + src[index] = value; + re[index] = new RegExp(value, isGlobal ? 'g' : undefined); + safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined); + }; + createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*'); + createToken('NUMERICIDENTIFIERLOOSE', '\\d+'); + createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); + createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`); + createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`); + createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`); + createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); + createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); + createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`); + createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); + createToken('FULLPLAIN', `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); + createToken('FULL', `^${src[t.FULLPLAIN]}$`); + createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); + createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`); + createToken('GTLT', '((?:<|>)?=?)'); + createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); + createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); + createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?` + `)?)?`); + createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?` + `)?)?`); + createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); + createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); + createToken('COERCEPLAIN', `${'(^|[^\\d])' + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); + createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); + createToken('COERCEFULL', src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?` + `(?:${src[t.BUILD]})?` + `(?:$|[^\\d])`); + createToken('COERCERTL', src[t.COERCE], true); + createToken('COERCERTLFULL', src[t.COERCEFULL], true); + createToken('LONETILDE', '(?:~>?)'); + createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true); + exports.tildeTrimReplace = '$1~'; + createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); + createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken('LONECARET', '(?:\\^)'); + createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true); + exports.caretTrimReplace = '$1^'; + createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); + createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); + createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); + createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); + exports.comparatorTrimReplace = '$1$2$3'; + createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`); + createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`); + createToken('STAR', '(<|>)?=?\\s*\\*'); + createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$'); + createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$'); +})(re$2, re$2.exports); + +var reExports = re$2.exports; + +const looseOption = Object.freeze({ + loose: true +}); + +const emptyOpts = Object.freeze({}); + +const parseOptions$1 = options => { + if (!options) { + return emptyOpts; + } + if (typeof options !== 'object') { + return looseOption; + } + return options; +}; + +var parseOptions_1 = parseOptions$1; + +const numeric = /^[0-9]+$/; + +const compareIdentifiers$1 = (a, b) => { + const anum = numeric.test(a); + const bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; +}; + +const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a); + +var identifiers$1 = { + compareIdentifiers: compareIdentifiers$1, + rcompareIdentifiers: rcompareIdentifiers +}; + +const debug = debug_1; + +const {MAX_LENGTH: MAX_LENGTH, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER} = constants$1; + +const {safeRe: re$1, t: t$1} = reExports; + +const parseOptions = parseOptions_1; + +const {compareIdentifiers: compareIdentifiers} = identifiers$1; + +let SemVer$d = class SemVer { + constructor(version, options) { + options = parseOptions(options); + if (version instanceof SemVer) { + if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { + return version; + } else { + version = version.version; + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`); + } + if (version.length > MAX_LENGTH) { + throw new TypeError(`version is longer than ${MAX_LENGTH} characters`); + } + debug('SemVer', version, options); + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + const m = version.trim().match(options.loose ? re$1[t$1.LOOSE] : re$1[t$1.FULL]); + if (!m) { + throw new TypeError(`Invalid Version: ${version}`); + } + this.raw = version; + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version'); + } + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version'); + } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version'); + } + if (!m[4]) { + this.prerelease = []; + } else { + this.prerelease = m[4].split('.').map((id => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; + } + } + return id; + })); + } + this.build = m[5] ? m[5].split('.') : []; + this.format(); + } + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}`; + } + return this.version; + } + toString() { + return this.version; + } + compare(other) { + debug('SemVer.compare', this.version, this.options, other); + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0; + } + other = new SemVer(other, this.options); + } + if (other.version === this.version) { + return 0; + } + return this.compareMain(other) || this.comparePre(other); + } + compareMain(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); + } + comparePre(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } + let i = 0; + do { + const a = this.prerelease[i]; + const b = other.prerelease[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) { + return 0; + } else if (b === undefined) { + return 1; + } else if (a === undefined) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + compareBuild(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); + } + let i = 0; + do { + const a = this.build[i]; + const b = other.build[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) { + return 0; + } else if (b === undefined) { + return 1; + } else if (a === undefined) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + inc(release, identifier, identifierBase) { + switch (release) { + case 'premajor': + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc('pre', identifier, identifierBase); + break; + + case 'preminor': + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc('pre', identifier, identifierBase); + break; + + case 'prepatch': + this.prerelease.length = 0; + this.inc('patch', identifier, identifierBase); + this.inc('pre', identifier, identifierBase); + break; + + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase); + } + this.inc('pre', identifier, identifierBase); + break; + + case 'major': + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + + case 'minor': + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + + case 'patch': + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + + case 'pre': + { + const base = Number(identifierBase) ? 1 : 0; + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty'); + } + if (this.prerelease.length === 0) { + this.prerelease = [ base ]; + } else { + let i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) { + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists'); + } + this.prerelease.push(base); + } + } + if (identifier) { + let prerelease = [ identifier, base ]; + if (identifierBase === false) { + prerelease = [ identifier ]; + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } + } + break; + } + + default: + throw new Error(`invalid increment argument: ${release}`); + } + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join('.')}`; + } + return this; + } +}; + +var semver$2 = SemVer$d; + +const SemVer$c = semver$2; + +const parse$6 = (version, options, throwErrors = false) => { + if (version instanceof SemVer$c) { + return version; + } + try { + return new SemVer$c(version, options); + } catch (er) { + if (!throwErrors) { + return null; + } + throw er; + } +}; + +var parse_1 = parse$6; + +const parse$5 = parse_1; + +const valid$2 = (version, options) => { + const v = parse$5(version, options); + return v ? v.version : null; +}; + +var valid_1 = valid$2; + +const parse$4 = parse_1; + +const clean$1 = (version, options) => { + const s = parse$4(version.trim().replace(/^[=v]+/, ''), options); + return s ? s.version : null; +}; + +var clean_1 = clean$1; + +const SemVer$b = semver$2; + +const inc$1 = (version, release, options, identifier, identifierBase) => { + if (typeof options === 'string') { + identifierBase = identifier; + identifier = options; + options = undefined; + } + try { + return new SemVer$b(version instanceof SemVer$b ? version.version : version, options).inc(release, identifier, identifierBase).version; + } catch (er) { + return null; + } +}; + +var inc_1 = inc$1; + +const parse$3 = parse_1; + +const diff$1 = (version1, version2) => { + const v1 = parse$3(version1, null, true); + const v2 = parse$3(version2, null, true); + const comparison = v1.compare(v2); + if (comparison === 0) { + return null; + } + const v1Higher = comparison > 0; + const highVersion = v1Higher ? v1 : v2; + const lowVersion = v1Higher ? v2 : v1; + const highHasPre = !!highVersion.prerelease.length; + const lowHasPre = !!lowVersion.prerelease.length; + if (lowHasPre && !highHasPre) { + if (!lowVersion.patch && !lowVersion.minor) { + return 'major'; + } + if (highVersion.patch) { + return 'patch'; + } + if (highVersion.minor) { + return 'minor'; + } + return 'major'; + } + const prefix = highHasPre ? 'pre' : ''; + if (v1.major !== v2.major) { + return prefix + 'major'; + } + if (v1.minor !== v2.minor) { + return prefix + 'minor'; + } + if (v1.patch !== v2.patch) { + return prefix + 'patch'; + } + return 'prerelease'; +}; + +var diff_1 = diff$1; + +const SemVer$a = semver$2; + +const major$1 = (a, loose) => new SemVer$a(a, loose).major; + +var major_1 = major$1; + +const SemVer$9 = semver$2; + +const minor$1 = (a, loose) => new SemVer$9(a, loose).minor; + +var minor_1 = minor$1; + +const SemVer$8 = semver$2; + +const patch$1 = (a, loose) => new SemVer$8(a, loose).patch; + +var patch_1 = patch$1; + +const parse$2 = parse_1; + +const prerelease$1 = (version, options) => { + const parsed = parse$2(version, options); + return parsed && parsed.prerelease.length ? parsed.prerelease : null; +}; + +var prerelease_1 = prerelease$1; + +const SemVer$7 = semver$2; + +const compare$b = (a, b, loose) => new SemVer$7(a, loose).compare(new SemVer$7(b, loose)); + +var compare_1 = compare$b; + +const compare$a = compare_1; + +const rcompare$1 = (a, b, loose) => compare$a(b, a, loose); + +var rcompare_1 = rcompare$1; + +const compare$9 = compare_1; + +const compareLoose$1 = (a, b) => compare$9(a, b, true); + +var compareLoose_1 = compareLoose$1; + +const SemVer$6 = semver$2; + +const compareBuild$3 = (a, b, loose) => { + const versionA = new SemVer$6(a, loose); + const versionB = new SemVer$6(b, loose); + return versionA.compare(versionB) || versionA.compareBuild(versionB); +}; + +var compareBuild_1 = compareBuild$3; + +const compareBuild$2 = compareBuild_1; + +const sort$1 = (list, loose) => list.sort(((a, b) => compareBuild$2(a, b, loose))); + +var sort_1 = sort$1; + +const compareBuild$1 = compareBuild_1; + +const rsort$1 = (list, loose) => list.sort(((a, b) => compareBuild$1(b, a, loose))); + +var rsort_1 = rsort$1; + +const compare$8 = compare_1; + +const gt$4 = (a, b, loose) => compare$8(a, b, loose) > 0; + +var gt_1 = gt$4; + +const compare$7 = compare_1; + +const lt$3 = (a, b, loose) => compare$7(a, b, loose) < 0; + +var lt_1 = lt$3; + +const compare$6 = compare_1; + +const eq$2 = (a, b, loose) => compare$6(a, b, loose) === 0; + +var eq_1 = eq$2; + +const compare$5 = compare_1; + +const neq$2 = (a, b, loose) => compare$5(a, b, loose) !== 0; + +var neq_1 = neq$2; + +const compare$4 = compare_1; + +const gte$3 = (a, b, loose) => compare$4(a, b, loose) >= 0; + +var gte_1 = gte$3; + +const compare$3 = compare_1; + +const lte$3 = (a, b, loose) => compare$3(a, b, loose) <= 0; + +var lte_1 = lte$3; + +const eq$1 = eq_1; + +const neq$1 = neq_1; + +const gt$3 = gt_1; + +const gte$2 = gte_1; + +const lt$2 = lt_1; + +const lte$2 = lte_1; + +const cmp$1 = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version; + } + if (typeof b === 'object') { + b = b.version; + } + return a === b; + + case '!==': + if (typeof a === 'object') { + a = a.version; + } + if (typeof b === 'object') { + b = b.version; + } + return a !== b; + + case '': + case '=': + case '==': + return eq$1(a, b, loose); + + case '!=': + return neq$1(a, b, loose); + + case '>': + return gt$3(a, b, loose); + + case '>=': + return gte$2(a, b, loose); + + case '<': + return lt$2(a, b, loose); + + case '<=': + return lte$2(a, b, loose); + + default: + throw new TypeError(`Invalid operator: ${op}`); + } +}; + +var cmp_1 = cmp$1; + +const SemVer$5 = semver$2; + +const parse$1 = parse_1; + +const {safeRe: re, t: t} = reExports; + +const coerce$1 = (version, options) => { + if (version instanceof SemVer$5) { + return version; + } + if (typeof version === 'number') { + version = String(version); + } + if (typeof version !== 'string') { + return null; + } + options = options || {}; + let match = null; + if (!options.rtl) { + match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); + } else { + const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; + let next; + while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; + } + coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; + } + coerceRtlRegex.lastIndex = -1; + } + if (match === null) { + return null; + } + const major = match[2]; + const minor = match[3] || '0'; + const patch = match[4] || '0'; + const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''; + const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''; + return parse$1(`${major}.${minor}.${patch}${prerelease}${build}`, options); +}; + +var coerce_1 = coerce$1; + +var iterator; + +var hasRequiredIterator; + +function requireIterator() { + if (hasRequiredIterator) return iterator; + hasRequiredIterator = 1; + iterator = function(Yallist) { + Yallist.prototype[Symbol.iterator] = function*() { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value; + } + }; + }; + return iterator; +} + +var yallist; + +var hasRequiredYallist; + +function requireYallist() { + if (hasRequiredYallist) return yallist; + hasRequiredYallist = 1; + yallist = Yallist; + Yallist.Node = Node; + Yallist.create = Yallist; + function Yallist(list) { + var self = this; + if (!(self instanceof Yallist)) { + self = new Yallist; + } + self.tail = null; + self.head = null; + self.length = 0; + if (list && typeof list.forEach === 'function') { + list.forEach((function(item) { + self.push(item); + })); + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]); + } + } + return self; + } + Yallist.prototype.removeNode = function(node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list'); + } + var next = node.next; + var prev = node.prev; + if (next) { + next.prev = prev; + } + if (prev) { + prev.next = next; + } + if (node === this.head) { + this.head = next; + } + if (node === this.tail) { + this.tail = prev; + } + node.list.length--; + node.next = null; + node.prev = null; + node.list = null; + return next; + }; + Yallist.prototype.unshiftNode = function(node) { + if (node === this.head) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var head = this.head; + node.list = this; + node.next = head; + if (head) { + head.prev = node; + } + this.head = node; + if (!this.tail) { + this.tail = node; + } + this.length++; + }; + Yallist.prototype.pushNode = function(node) { + if (node === this.tail) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var tail = this.tail; + node.list = this; + node.prev = tail; + if (tail) { + tail.next = node; + } + this.tail = node; + if (!this.head) { + this.head = node; + } + this.length++; + }; + Yallist.prototype.push = function() { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]); + } + return this.length; + }; + Yallist.prototype.unshift = function() { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]); + } + return this.length; + }; + Yallist.prototype.pop = function() { + if (!this.tail) { + return undefined; + } + var res = this.tail.value; + this.tail = this.tail.prev; + if (this.tail) { + this.tail.next = null; + } else { + this.head = null; + } + this.length--; + return res; + }; + Yallist.prototype.shift = function() { + if (!this.head) { + return undefined; + } + var res = this.head.value; + this.head = this.head.next; + if (this.head) { + this.head.prev = null; + } else { + this.tail = null; + } + this.length--; + return res; + }; + Yallist.prototype.forEach = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this); + walker = walker.next; + } + }; + Yallist.prototype.forEachReverse = function(fn, thisp) { + thisp = thisp || this; + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this); + walker = walker.prev; + } + }; + Yallist.prototype.get = function(n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + walker = walker.next; + } + if (i === n && walker !== null) { + return walker.value; + } + }; + Yallist.prototype.getReverse = function(n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + walker = walker.prev; + } + if (i === n && walker !== null) { + return walker.value; + } + }; + Yallist.prototype.map = function(fn, thisp) { + thisp = thisp || this; + var res = new Yallist; + for (var walker = this.head; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.next; + } + return res; + }; + Yallist.prototype.mapReverse = function(fn, thisp) { + thisp = thisp || this; + var res = new Yallist; + for (var walker = this.tail; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.prev; + } + return res; + }; + Yallist.prototype.reduce = function(fn, initial) { + var acc; + var walker = this.head; + if (arguments.length > 1) { + acc = initial; + } else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } else { + throw new TypeError('Reduce of empty list with no initial value'); + } + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i); + walker = walker.next; + } + return acc; + }; + Yallist.prototype.reduceReverse = function(fn, initial) { + var acc; + var walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } else { + throw new TypeError('Reduce of empty list with no initial value'); + } + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i); + walker = walker.prev; + } + return acc; + }; + Yallist.prototype.toArray = function() { + var arr = new Array(this.length); + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.next; + } + return arr; + }; + Yallist.prototype.toArrayReverse = function() { + var arr = new Array(this.length); + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.prev; + } + return arr; + }; + Yallist.prototype.slice = function(from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist; + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next; + } + for (;walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value); + } + return ret; + }; + Yallist.prototype.sliceReverse = function(from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist; + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev; + } + for (;walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value); + } + return ret; + }; + Yallist.prototype.splice = function(start, deleteCount, ...nodes) { + if (start > this.length) { + start = this.length - 1; + } + if (start < 0) { + start = this.length + start; + } + for (var i = 0, walker = this.head; walker !== null && i < start; i++) { + walker = walker.next; + } + var ret = []; + for (var i = 0; walker && i < deleteCount; i++) { + ret.push(walker.value); + walker = this.removeNode(walker); + } + if (walker === null) { + walker = this.tail; + } + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev; + } + for (var i = 0; i < nodes.length; i++) { + walker = insert(this, walker, nodes[i]); + } + return ret; + }; + Yallist.prototype.reverse = function() { + var head = this.head; + var tail = this.tail; + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev; + walker.prev = walker.next; + walker.next = p; + } + this.head = tail; + this.tail = head; + return this; + }; + function insert(self, node, value) { + var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self); + if (inserted.next === null) { + self.tail = inserted; + } + if (inserted.prev === null) { + self.head = inserted; + } + self.length++; + return inserted; + } + function push(self, item) { + self.tail = new Node(item, self.tail, null, self); + if (!self.head) { + self.head = self.tail; + } + self.length++; + } + function unshift(self, item) { + self.head = new Node(item, null, self.head, self); + if (!self.tail) { + self.tail = self.head; + } + self.length++; + } + function Node(value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list); + } + this.list = list; + this.value = value; + if (prev) { + prev.next = this; + this.prev = prev; + } else { + this.prev = null; + } + if (next) { + next.prev = this; + this.next = next; + } else { + this.next = null; + } + } + try { + requireIterator()(Yallist); + } catch (er) {} + return yallist; +} + +var lruCache; + +var hasRequiredLruCache; + +function requireLruCache() { + if (hasRequiredLruCache) return lruCache; + hasRequiredLruCache = 1; + const Yallist = requireYallist(); + const MAX = Symbol('max'); + const LENGTH = Symbol('length'); + const LENGTH_CALCULATOR = Symbol('lengthCalculator'); + const ALLOW_STALE = Symbol('allowStale'); + const MAX_AGE = Symbol('maxAge'); + const DISPOSE = Symbol('dispose'); + const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet'); + const LRU_LIST = Symbol('lruList'); + const CACHE = Symbol('cache'); + const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet'); + const naiveLength = () => 1; + class LRUCache { + constructor(options) { + if (typeof options === 'number') options = { + max: options + }; + if (!options) options = {}; + if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number'); + this[MAX] = options.max || Infinity; + const lc = options.length || naiveLength; + this[LENGTH_CALCULATOR] = typeof lc !== 'function' ? naiveLength : lc; + this[ALLOW_STALE] = options.stale || false; + if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number'); + this[MAX_AGE] = options.maxAge || 0; + this[DISPOSE] = options.dispose; + this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false; + this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false; + this.reset(); + } + set max(mL) { + if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number'); + this[MAX] = mL || Infinity; + trim(this); + } + get max() { + return this[MAX]; + } + set allowStale(allowStale) { + this[ALLOW_STALE] = !!allowStale; + } + get allowStale() { + return this[ALLOW_STALE]; + } + set maxAge(mA) { + if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number'); + this[MAX_AGE] = mA; + trim(this); + } + get maxAge() { + return this[MAX_AGE]; + } + set lengthCalculator(lC) { + if (typeof lC !== 'function') lC = naiveLength; + if (lC !== this[LENGTH_CALCULATOR]) { + this[LENGTH_CALCULATOR] = lC; + this[LENGTH] = 0; + this[LRU_LIST].forEach((hit => { + hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key); + this[LENGTH] += hit.length; + })); + } + trim(this); + } + get lengthCalculator() { + return this[LENGTH_CALCULATOR]; + } + get length() { + return this[LENGTH]; + } + get itemCount() { + return this[LRU_LIST].length; + } + rforEach(fn, thisp) { + thisp = thisp || this; + for (let walker = this[LRU_LIST].tail; walker !== null; ) { + const prev = walker.prev; + forEachStep(this, fn, walker, thisp); + walker = prev; + } + } + forEach(fn, thisp) { + thisp = thisp || this; + for (let walker = this[LRU_LIST].head; walker !== null; ) { + const next = walker.next; + forEachStep(this, fn, walker, thisp); + walker = next; + } + } + keys() { + return this[LRU_LIST].toArray().map((k => k.key)); + } + values() { + return this[LRU_LIST].toArray().map((k => k.value)); + } + reset() { + if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { + this[LRU_LIST].forEach((hit => this[DISPOSE](hit.key, hit.value))); + } + this[CACHE] = new Map; + this[LRU_LIST] = new Yallist; + this[LENGTH] = 0; + } + dump() { + return this[LRU_LIST].map((hit => isStale(this, hit) ? false : { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + })).toArray().filter((h => h)); + } + dumpLru() { + return this[LRU_LIST]; + } + set(key, value, maxAge) { + maxAge = maxAge || this[MAX_AGE]; + if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number'); + const now = maxAge ? Date.now() : 0; + const len = this[LENGTH_CALCULATOR](value, key); + if (this[CACHE].has(key)) { + if (len > this[MAX]) { + del(this, this[CACHE].get(key)); + return false; + } + const node = this[CACHE].get(key); + const item = node.value; + if (this[DISPOSE]) { + if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value); + } + item.now = now; + item.maxAge = maxAge; + item.value = value; + this[LENGTH] += len - item.length; + item.length = len; + this.get(key); + trim(this); + return true; + } + const hit = new Entry(key, value, len, now, maxAge); + if (hit.length > this[MAX]) { + if (this[DISPOSE]) this[DISPOSE](key, value); + return false; + } + this[LENGTH] += hit.length; + this[LRU_LIST].unshift(hit); + this[CACHE].set(key, this[LRU_LIST].head); + trim(this); + return true; + } + has(key) { + if (!this[CACHE].has(key)) return false; + const hit = this[CACHE].get(key).value; + return !isStale(this, hit); + } + get(key) { + return get(this, key, true); + } + peek(key) { + return get(this, key, false); + } + pop() { + const node = this[LRU_LIST].tail; + if (!node) return null; + del(this, node); + return node.value; + } + del(key) { + del(this, this[CACHE].get(key)); + } + load(arr) { + this.reset(); + const now = Date.now(); + for (let l = arr.length - 1; l >= 0; l--) { + const hit = arr[l]; + const expiresAt = hit.e || 0; + if (expiresAt === 0) this.set(hit.k, hit.v); else { + const maxAge = expiresAt - now; + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge); + } + } + } + } + prune() { + this[CACHE].forEach(((value, key) => get(this, key, false))); + } + } + const get = (self, key, doUse) => { + const node = self[CACHE].get(key); + if (node) { + const hit = node.value; + if (isStale(self, hit)) { + del(self, node); + if (!self[ALLOW_STALE]) return undefined; + } else { + if (doUse) { + if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now(); + self[LRU_LIST].unshiftNode(node); + } + } + return hit.value; + } + }; + const isStale = (self, hit) => { + if (!hit || !hit.maxAge && !self[MAX_AGE]) return false; + const diff = Date.now() - hit.now; + return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE]; + }; + const trim = self => { + if (self[LENGTH] > self[MAX]) { + for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) { + const prev = walker.prev; + del(self, walker); + walker = prev; + } + } + }; + const del = (self, node) => { + if (node) { + const hit = node.value; + if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value); + self[LENGTH] -= hit.length; + self[CACHE].delete(hit.key); + self[LRU_LIST].removeNode(node); + } + }; + class Entry { + constructor(key, value, length, now, maxAge) { + this.key = key; + this.value = value; + this.length = length; + this.now = now; + this.maxAge = maxAge || 0; + } + } + const forEachStep = (self, fn, node, thisp) => { + let hit = node.value; + if (isStale(self, hit)) { + del(self, node); + if (!self[ALLOW_STALE]) hit = undefined; + } + if (hit) fn.call(thisp, hit.value, hit.key, self); + }; + lruCache = LRUCache; + return lruCache; +} + +var range; + +var hasRequiredRange; + +function requireRange() { + if (hasRequiredRange) return range; + hasRequiredRange = 1; + class Range { + constructor(range, options) { + options = parseOptions(options); + if (range instanceof Range) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new Range(range.raw, options); + } + } + if (range instanceof Comparator) { + this.raw = range.value; + this.set = [ [ range ] ]; + this.format(); + return this; + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(' '); + this.set = this.raw.split('||').map((r => this.parseRange(r.trim()))).filter((c => c.length)); + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`); + } + if (this.set.length > 1) { + const first = this.set[0]; + this.set = this.set.filter((c => !isNullSet(c[0]))); + if (this.set.length === 0) { + this.set = [ first ]; + } else if (this.set.length > 1) { + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [ c ]; + break; + } + } + } + } + this.format(); + } + format() { + this.range = this.set.map((comps => comps.join(' ').trim())).join('||').trim(); + return this.range; + } + toString() { + return this.range; + } + parseRange(range) { + const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); + const memoKey = memoOpts + ':' + range; + const cached = cache.get(memoKey); + if (cached) { + return cached; + } + const loose = this.options.loose; + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); + debug('hyphen replace', range); + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); + debug('comparator trim', range); + range = range.replace(re[t.TILDETRIM], tildeTrimReplace); + debug('tilde trim', range); + range = range.replace(re[t.CARETTRIM], caretTrimReplace); + debug('caret trim', range); + let rangeList = range.split(' ').map((comp => parseComparator(comp, this.options))).join(' ').split(/\s+/).map((comp => replaceGTE0(comp, this.options))); + if (loose) { + rangeList = rangeList.filter((comp => { + debug('loose invalid filter', comp, this.options); + return !!comp.match(re[t.COMPARATORLOOSE]); + })); + } + debug('range list', rangeList); + const rangeMap = new Map; + const comparators = rangeList.map((comp => new Comparator(comp, this.options))); + for (const comp of comparators) { + if (isNullSet(comp)) { + return [ comp ]; + } + rangeMap.set(comp.value, comp); + } + if (rangeMap.size > 1 && rangeMap.has('')) { + rangeMap.delete(''); + } + const result = [ ...rangeMap.values() ]; + cache.set(memoKey, result); + return result; + } + intersects(range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required'); + } + return this.set.some((thisComparators => isSatisfiable(thisComparators, options) && range.set.some((rangeComparators => isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator => rangeComparators.every((rangeComparator => thisComparator.intersects(rangeComparator, options))))))))); + } + test(version) { + if (!version) { + return false; + } + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } + } + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true; + } + } + return false; + } + } + range = Range; + const LRU = requireLruCache(); + const cache = new LRU({ + max: 1e3 + }); + const parseOptions = parseOptions_1; + const Comparator = requireComparator(); + const debug = debug_1; + const SemVer = semver$2; + const {safeRe: re, t: t, comparatorTrimReplace: comparatorTrimReplace, tildeTrimReplace: tildeTrimReplace, caretTrimReplace: caretTrimReplace} = reExports; + const {FLAG_INCLUDE_PRERELEASE: FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE: FLAG_LOOSE} = constants$1; + const isNullSet = c => c.value === '<0.0.0-0'; + const isAny = c => c.value === ''; + const isSatisfiable = (comparators, options) => { + let result = true; + const remainingComparators = comparators.slice(); + let testComparator = remainingComparators.pop(); + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator => testComparator.intersects(otherComparator, options))); + testComparator = remainingComparators.pop(); + } + return result; + }; + const parseComparator = (comp, options) => { + debug('comp', comp, options); + comp = replaceCarets(comp, options); + debug('caret', comp); + comp = replaceTildes(comp, options); + debug('tildes', comp); + comp = replaceXRanges(comp, options); + debug('xrange', comp); + comp = replaceStars(comp, options); + debug('stars', comp); + return comp; + }; + const isX = id => !id || id.toLowerCase() === 'x' || id === '*'; + const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((c => replaceTilde(c, options))).join(' '); + const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; + return comp.replace(r, ((_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr); + let ret; + if (isX(M)) { + ret = ''; + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; + } else if (isX(p)) { + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; + } else if (pr) { + debug('replaceTilde pr', pr); + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } else { + ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; + } + debug('tilde return', ret); + return ret; + })); + }; + const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((c => replaceCaret(c, options))).join(' '); + const replaceCaret = (comp, options) => { + debug('caret', comp, options); + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; + const z = options.includePrerelease ? '-0' : ''; + return comp.replace(r, ((_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr); + let ret; + if (isX(M)) { + ret = ''; + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; + } + } else if (pr) { + debug('replaceCaret pr', pr); + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } + } else { + ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; + } + } else { + debug('no pr'); + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; + } + } else { + ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; + } + } + debug('caret return', ret); + return ret; + })); + }; + const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options); + return comp.split(/\s+/).map((c => replaceXRange(c, options))).join(' '); + }; + const replaceXRange = (comp, options) => { + comp = comp.trim(); + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; + return comp.replace(r, ((ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr); + const xM = isX(M); + const xm = xM || isX(m); + const xp = xm || isX(p); + const anyX = xp; + if (gtlt === '=' && anyX) { + gtlt = ''; + } + pr = options.includePrerelease ? '-0' : ''; + if (xM) { + if (gtlt === '>' || gtlt === '<') { + ret = '<0.0.0-0'; + } else { + ret = '*'; + } + } else if (gtlt && anyX) { + if (xm) { + m = 0; + } + p = 0; + if (gtlt === '>') { + gtlt = '>='; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else { + m = +m + 1; + p = 0; + } + } else if (gtlt === '<=') { + gtlt = '<'; + if (xm) { + M = +M + 1; + } else { + m = +m + 1; + } + } + if (gtlt === '<') { + pr = '-0'; + } + ret = `${gtlt + M}.${m}.${p}${pr}`; + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; + } else if (xp) { + ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; + } + debug('xRange return', ret); + return ret; + })); + }; + const replaceStars = (comp, options) => { + debug('replaceStars', comp, options); + return comp.trim().replace(re[t.STAR], ''); + }; + const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options); + return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ''); + }; + const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { + if (isX(fM)) { + from = ''; + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}`; + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`; + } else if (fpr) { + from = `>=${from}`; + } else { + from = `>=${from}${incPr ? '-0' : ''}`; + } + if (isX(tM)) { + to = ''; + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0`; + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0`; + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}`; + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0`; + } else { + to = `<=${to}`; + } + return `${from} ${to}`.trim(); + }; + const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (let i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === Comparator.ANY) { + continue; + } + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; + } + } + } + return false; + } + return true; + }; + return range; +} + +var comparator; + +var hasRequiredComparator; + +function requireComparator() { + if (hasRequiredComparator) return comparator; + hasRequiredComparator = 1; + const ANY = Symbol('SemVer ANY'); + class Comparator { + static get ANY() { + return ANY; + } + constructor(comp, options) { + options = parseOptions(options); + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; + } + } + comp = comp.trim().split(/\s+/).join(' '); + debug('comparator', comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ''; + } else { + this.value = this.operator + this.semver.version; + } + debug('comp', this); + } + parse(comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; + const m = comp.match(r); + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`); + } + this.operator = m[1] !== undefined ? m[1] : ''; + if (this.operator === '=') { + this.operator = ''; + } + if (!m[2]) { + this.semver = ANY; + } else { + this.semver = new SemVer(m[2], this.options.loose); + } + } + toString() { + return this.value; + } + test(version) { + debug('Comparator.test', version, this.options.loose); + if (this.semver === ANY || version === ANY) { + return true; + } + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } + } + return cmp(version, this.operator, this.semver, this.options); + } + intersects(comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required'); + } + if (this.operator === '') { + if (this.value === '') { + return true; + } + return new Range(comp.value, options).test(this.value); + } else if (comp.operator === '') { + if (comp.value === '') { + return true; + } + return new Range(this.value, options).test(comp.semver); + } + options = parseOptions(options); + if (options.includePrerelease && (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { + return false; + } + if (!options.includePrerelease && (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { + return false; + } + if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { + return true; + } + if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { + return true; + } + if (this.semver.version === comp.semver.version && this.operator.includes('=') && comp.operator.includes('=')) { + return true; + } + if (cmp(this.semver, '<', comp.semver, options) && this.operator.startsWith('>') && comp.operator.startsWith('<')) { + return true; + } + if (cmp(this.semver, '>', comp.semver, options) && this.operator.startsWith('<') && comp.operator.startsWith('>')) { + return true; + } + return false; + } + } + comparator = Comparator; + const parseOptions = parseOptions_1; + const {safeRe: re, t: t} = reExports; + const cmp = cmp_1; + const debug = debug_1; + const SemVer = semver$2; + const Range = requireRange(); + return comparator; +} + +const Range$a = requireRange(); + +const satisfies$4 = (version, range, options) => { + try { + range = new Range$a(range, options); + } catch (er) { + return false; + } + return range.test(version); +}; + +var satisfies_1 = satisfies$4; + +const Range$9 = requireRange(); + +const toComparators$1 = (range, options) => new Range$9(range, options).set.map((comp => comp.map((c => c.value)).join(' ').trim().split(' '))); + +var toComparators_1 = toComparators$1; + +const SemVer$4 = semver$2; + +const Range$8 = requireRange(); + +const maxSatisfying$1 = (versions, range, options) => { + let max = null; + let maxSV = null; + let rangeObj = null; + try { + rangeObj = new Range$8(range, options); + } catch (er) { + return null; + } + versions.forEach((v => { + if (rangeObj.test(v)) { + if (!max || maxSV.compare(v) === -1) { + max = v; + maxSV = new SemVer$4(max, options); + } + } + })); + return max; +}; + +var maxSatisfying_1 = maxSatisfying$1; + +const SemVer$3 = semver$2; + +const Range$7 = requireRange(); + +const minSatisfying$1 = (versions, range, options) => { + let min = null; + let minSV = null; + let rangeObj = null; + try { + rangeObj = new Range$7(range, options); + } catch (er) { + return null; + } + versions.forEach((v => { + if (rangeObj.test(v)) { + if (!min || minSV.compare(v) === 1) { + min = v; + minSV = new SemVer$3(min, options); + } + } + })); + return min; +}; + +var minSatisfying_1 = minSatisfying$1; + +const SemVer$2 = semver$2; + +const Range$6 = requireRange(); + +const gt$2 = gt_1; + +const minVersion$1 = (range, loose) => { + range = new Range$6(range, loose); + let minver = new SemVer$2('0.0.0'); + if (range.test(minver)) { + return minver; + } + minver = new SemVer$2('0.0.0-0'); + if (range.test(minver)) { + return minver; + } + minver = null; + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i]; + let setMin = null; + comparators.forEach((comparator => { + const compver = new SemVer$2(comparator.semver.version); + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++; + } else { + compver.prerelease.push(0); + } + compver.raw = compver.format(); + + case '': + case '>=': + if (!setMin || gt$2(compver, setMin)) { + setMin = compver; + } + break; + + case '<': + case '<=': + break; + + default: + throw new Error(`Unexpected operation: ${comparator.operator}`); + } + })); + if (setMin && (!minver || gt$2(minver, setMin))) { + minver = setMin; + } + } + if (minver && range.test(minver)) { + return minver; + } + return null; +}; + +var minVersion_1 = minVersion$1; + +const Range$5 = requireRange(); + +const validRange$1 = (range, options) => { + try { + return new Range$5(range, options).range || '*'; + } catch (er) { + return null; + } +}; + +var valid$1 = validRange$1; + +const SemVer$1 = semver$2; + +const Comparator$2 = requireComparator(); + +const {ANY: ANY$1} = Comparator$2; + +const Range$4 = requireRange(); + +const satisfies$3 = satisfies_1; + +const gt$1 = gt_1; + +const lt$1 = lt_1; + +const lte$1 = lte_1; + +const gte$1 = gte_1; + +const outside$3 = (version, range, hilo, options) => { + version = new SemVer$1(version, options); + range = new Range$4(range, options); + let gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case '>': + gtfn = gt$1; + ltefn = lte$1; + ltfn = lt$1; + comp = '>'; + ecomp = '>='; + break; + + case '<': + gtfn = lt$1; + ltefn = gte$1; + ltfn = gt$1; + comp = '<'; + ecomp = '<='; + break; + + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies$3(version, range, options)) { + return false; + } + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i]; + let high = null; + let low = null; + comparators.forEach((comparator => { + if (comparator.semver === ANY$1) { + comparator = new Comparator$2('>=0.0.0'); + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator; + } + })); + if (high.operator === comp || high.operator === ecomp) { + return false; + } + if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } + } + return true; +}; + +var outside_1 = outside$3; + +const outside$2 = outside_1; + +const gtr$1 = (version, range, options) => outside$2(version, range, '>', options); + +var gtr_1 = gtr$1; + +const outside$1 = outside_1; + +const ltr$1 = (version, range, options) => outside$1(version, range, '<', options); + +var ltr_1 = ltr$1; + +const Range$3 = requireRange(); + +const intersects$1 = (r1, r2, options) => { + r1 = new Range$3(r1, options); + r2 = new Range$3(r2, options); + return r1.intersects(r2, options); +}; + +var intersects_1 = intersects$1; + +const satisfies$2 = satisfies_1; + +const compare$2 = compare_1; + +var simplify = (versions, range, options) => { + const set = []; + let first = null; + let prev = null; + const v = versions.sort(((a, b) => compare$2(a, b, options))); + for (const version of v) { + const included = satisfies$2(version, range, options); + if (included) { + prev = version; + if (!first) { + first = version; + } + } else { + if (prev) { + set.push([ first, prev ]); + } + prev = null; + first = null; + } + } + if (first) { + set.push([ first, null ]); + } + const ranges = []; + for (const [min, max] of set) { + if (min === max) { + ranges.push(min); + } else if (!max && min === v[0]) { + ranges.push('*'); + } else if (!max) { + ranges.push(`>=${min}`); + } else if (min === v[0]) { + ranges.push(`<=${max}`); + } else { + ranges.push(`${min} - ${max}`); + } + } + const simplified = ranges.join(' || '); + const original = typeof range.raw === 'string' ? range.raw : String(range); + return simplified.length < original.length ? simplified : range; +}; + +const Range$2 = requireRange(); + +const Comparator$1 = requireComparator(); + +const {ANY: ANY} = Comparator$1; + +const satisfies$1 = satisfies_1; + +const compare$1 = compare_1; + +const subset$1 = (sub, dom, options = {}) => { + if (sub === dom) { + return true; + } + sub = new Range$2(sub, options); + dom = new Range$2(dom, options); + let sawNonNull = false; + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options); + sawNonNull = sawNonNull || isSub !== null; + if (isSub) { + continue OUTER; + } + } + if (sawNonNull) { + return false; + } + } + return true; +}; + +const minimumVersionWithPreRelease = [ new Comparator$1('>=0.0.0-0') ]; + +const minimumVersion = [ new Comparator$1('>=0.0.0') ]; + +const simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true; + } + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true; + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease; + } else { + sub = minimumVersion; + } + } + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true; + } else { + dom = minimumVersion; + } + } + const eqSet = new Set; + let gt, lt; + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') { + gt = higherGT(gt, c, options); + } else if (c.operator === '<' || c.operator === '<=') { + lt = lowerLT(lt, c, options); + } else { + eqSet.add(c.semver); + } + } + if (eqSet.size > 1) { + return null; + } + let gtltComp; + if (gt && lt) { + gtltComp = compare$1(gt.semver, lt.semver, options); + if (gtltComp > 0) { + return null; + } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { + return null; + } + } + for (const eq of eqSet) { + if (gt && !satisfies$1(eq, String(gt), options)) { + return null; + } + if (lt && !satisfies$1(eq, String(lt), options)) { + return null; + } + for (const c of dom) { + if (!satisfies$1(eq, String(c), options)) { + return false; + } + } + return true; + } + let higher, lower; + let hasDomLT, hasDomGT; + let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; + let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false; + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false; + } + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='; + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='; + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false; + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options); + if (higher === c && higher !== gt) { + return false; + } + } else if (gt.operator === '>=' && !satisfies$1(gt.semver, String(c), options)) { + return false; + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false; + } + } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options); + if (lower === c && lower !== lt) { + return false; + } + } else if (lt.operator === '<=' && !satisfies$1(lt.semver, String(c), options)) { + return false; + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false; + } + } + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false; + } + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false; + } + if (needDomGTPre || needDomLTPre) { + return false; + } + return true; +}; + +const higherGT = (a, b, options) => { + if (!a) { + return b; + } + const comp = compare$1(a.semver, b.semver, options); + return comp > 0 ? a : comp < 0 ? b : b.operator === '>' && a.operator === '>=' ? b : a; +}; + +const lowerLT = (a, b, options) => { + if (!a) { + return b; + } + const comp = compare$1(a.semver, b.semver, options); + return comp < 0 ? a : comp > 0 ? b : b.operator === '<' && a.operator === '<=' ? b : a; +}; + +var subset_1 = subset$1; + +const internalRe = reExports; + +const constants = constants$1; + +const SemVer = semver$2; + +const identifiers = identifiers$1; + +const parse = parse_1; + +const valid = valid_1; + +const clean = clean_1; + +const inc = inc_1; + +const diff = diff_1; + +const major = major_1; + +const minor = minor_1; + +const patch = patch_1; + +const prerelease = prerelease_1; + +const compare = compare_1; + +const rcompare = rcompare_1; + +const compareLoose = compareLoose_1; + +const compareBuild = compareBuild_1; + +const sort = sort_1; + +const rsort = rsort_1; + +const gt = gt_1; + +const lt = lt_1; + +const eq = eq_1; + +const neq = neq_1; + +const gte = gte_1; + +const lte = lte_1; + +const cmp = cmp_1; + +const coerce = coerce_1; + +const Comparator = requireComparator(); + +const Range$1 = requireRange(); + +const satisfies = satisfies_1; + +const toComparators = toComparators_1; + +const maxSatisfying = maxSatisfying_1; + +const minSatisfying = minSatisfying_1; + +const minVersion = minVersion_1; + +const validRange = valid$1; + +const outside = outside_1; + +const gtr = gtr_1; + +const ltr = ltr_1; + +const intersects = intersects_1; + +const simplifyRange = simplify; + +const subset = subset_1; + +var semver = { + parse: parse, + valid: valid, + clean: clean, + inc: inc, + diff: diff, + major: major, + minor: minor, + patch: patch, + prerelease: prerelease, + compare: compare, + rcompare: rcompare, + compareLoose: compareLoose, + compareBuild: compareBuild, + sort: sort, + rsort: rsort, + gt: gt, + lt: lt, + eq: eq, + neq: neq, + gte: gte, + lte: lte, + cmp: cmp, + coerce: coerce, + Comparator: Comparator, + Range: Range$1, + satisfies: satisfies, + toComparators: toComparators, + maxSatisfying: maxSatisfying, + minSatisfying: minSatisfying, + minVersion: minVersion, + validRange: validRange, + outside: outside, + gtr: gtr, + ltr: ltr, + intersects: intersects, + simplifyRange: simplifyRange, + subset: subset, + SemVer: SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers +}; + +const semver$1 = getDefaultExportFromCjs(semver); + +class API { + static fromSimpleString(value) { + return new API(value, value, value); + } + static fromVersionString(versionString) { + let version = semver$1.valid(versionString); + if (!version) { + return new API('invalid version', '1.0.0', '1.0.0'); + } + const index = versionString.indexOf('-'); + if (index >= 0) { + version = version.substr(0, index); + } + return new API(versionString, version, versionString); + } + constructor(displayName, version, fullVersionString) { + this.displayName = displayName; + this.version = version; + this.fullVersionString = fullVersionString; + } + eq(other) { + return semver$1.eq(this.version, other.version); + } + gte(other) { + return semver$1.gte(this.version, other.version); + } + lt(other) { + return !this.gte(other); + } +} + +API.defaultVersion = API.fromSimpleString('1.0.0'); + +API.v300 = API.fromSimpleString('3.0.0'); + +API.v310 = API.fromSimpleString('3.1.0'); + +API.v314 = API.fromSimpleString('3.1.4'); + +API.v320 = API.fromSimpleString('3.2.0'); + +API.v333 = API.fromSimpleString('3.3.3'); + +API.v340 = API.fromSimpleString('3.4.0'); + +API.v345 = API.fromSimpleString('3.4.5'); + +API.v350 = API.fromSimpleString('3.5.0'); + +API.v380 = API.fromSimpleString('3.8.0'); + +API.v381 = API.fromSimpleString('3.8.1'); + +API.v390 = API.fromSimpleString('3.9.0'); + +API.v400 = API.fromSimpleString('4.0.0'); + +API.v401 = API.fromSimpleString('4.0.1'); + +API.v420 = API.fromSimpleString('4.2.0'); + +API.v430 = API.fromSimpleString('4.3.0'); + +API.v440 = API.fromSimpleString('4.4.0'); + +API.v460 = API.fromSimpleString('4.6.0'); + +API.v470 = API.fromSimpleString('4.7.0'); + +API.v480 = API.fromSimpleString('4.8.0'); + +API.v490 = API.fromSimpleString('4.9.0'); + +API.v500 = API.fromSimpleString('5.0.0'); + +API.v510 = API.fromSimpleString('5.1.0'); + +function equals$1(a, b, itemEquals = ((a, b) => a === b)) { + if (a === b) { + return true; + } + if (a.length !== b.length) { + return false; + } + return a.every(((x, i) => itemEquals(x, b[i]))); +} + +function coalesce(array) { + return array.filter((e => !!e)); +} + +class Delayer { + constructor(defaultDelay) { + this.defaultDelay = defaultDelay; + this.timeout = null; + this.completionPromise = null; + this.onSuccess = null; + this.task = null; + } + trigger(task, delay = this.defaultDelay) { + this.task = task; + if (delay >= 0) { + this.cancelTimeout(); + } + if (!this.completionPromise) { + this.completionPromise = new Promise((resolve => { + this.onSuccess = resolve; + })).then((() => { + this.completionPromise = null; + this.onSuccess = null; + const result = this.task?.(); + this.task = null; + return result; + })); + } + if (delay >= 0 || this.timeout === null) { + this.timeout = setTimeout((() => { + this.timeout = null; + this.onSuccess?.(undefined); + }), delay >= 0 ? delay : this.defaultDelay); + } + return this.completionPromise; + } + cancelTimeout() { + if (this.timeout !== null) { + clearTimeout(this.timeout); + this.timeout = null; + } + } +} + +function makeRandomHexString(length) { + const chars = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' ]; + let result = ''; + for (let i = 0; i < length; i++) { + const idx = Math.floor(chars.length * Math.random()); + result += chars[idx]; + } + return result; +} + +const getRootTempDir = (() => { + let dir; + return () => { + if (!dir) { + const filename = `typescript-language-server${process.platform !== 'win32' && process.getuid ? process.getuid() : ''}`; + dir = path__default.join(os.tmpdir(), filename); + } + if (!fs$l.existsSync(dir)) { + fs$l.mkdirSync(dir); + } + return dir; + }; +})(); + +const getInstanceTempDir = (() => { + let dir; + return () => { + dir ?? (dir = path__default.join(getRootTempDir(), makeRandomHexString(20))); + if (!fs$l.existsSync(dir)) { + fs$l.mkdirSync(dir); + } + return dir; + }; +})(); + +function getTempFile(prefix) { + return path__default.join(getInstanceTempDir(), `${prefix}-${makeRandomHexString(20)}.tmp`); +} + +function looksLikeAbsoluteWindowsPath(path) { + return /^[a-zA-Z]:[/\\]/.test(path); +} + +const onCaseInsensitiveFileSystem = (() => { + let value; + return () => { + if (typeof value === 'undefined') { + if (process.platform === 'win32') { + value = true; + } else if (process.platform !== 'darwin') { + value = false; + } else { + const temp = getTempFile('typescript-case-check'); + fs$l.writeFileSync(temp, ''); + value = fs$l.existsSync(temp.toUpperCase()); + } + } + return value; + }; +})(); + +class ResourceMap { + constructor(_normalizePath = ResourceMap.defaultPathNormalizer, config) { + this._normalizePath = _normalizePath; + this.config = config; + this._map = new Map; + } + get size() { + return this._map.size; + } + has(resource) { + const file = this.toKey(resource); + return !!file && this._map.has(file); + } + get(resource) { + const file = this.toKey(resource); + if (!file) { + return undefined; + } + const entry = this._map.get(file); + return entry ? entry.value : undefined; + } + set(resource, value) { + const file = this.toKey(resource); + if (!file) { + return; + } + const entry = this._map.get(file); + if (entry) { + entry.value = value; + } else { + this._map.set(file, { + resource: resource, + value: value + }); + } + } + delete(resource) { + const file = this.toKey(resource); + if (file) { + this._map.delete(file); + } + } + clear() { + this._map.clear(); + } + values() { + return Array.from(this._map.values(), (x => x.value)); + } + entries() { + return this._map.values(); + } + toKey(resource) { + const key = this._normalizePath(resource); + if (!key) { + return key; + } + return this.isCaseInsensitivePath(key) ? key.toLowerCase() : key; + } + isCaseInsensitivePath(path) { + if (looksLikeAbsoluteWindowsPath(path)) { + return true; + } + return path[0] === '/' && this.config.onCaseInsensitiveFileSystem; + } +} + +ResourceMap.defaultPathNormalizer = resource => { + if (resource.scheme === 'file') { + return resource.fsPath; + } + return resource.toString(true); +}; + +function mode2ScriptKind(mode) { + switch (mode) { + case typescript: + return 'TS'; + + case typescriptreact: + return 'TSX'; + + case javascript: + return 'JS'; + + case javascriptreact: + return 'JSX'; + } + return undefined; +} + +function getModeFromFileUri(uri) { + const extension = extname(uri).toUpperCase(); + switch (extension) { + case '.TS': + return typescript; + + case '.TSX': + return typescriptreact; + + case '.JS': + return javascript; + + case '.JSX': + return javascriptreact; + } + return undefined; +} + +class PendingDiagnostics extends ResourceMap { + getOrderedFileSet() { + const orderedResources = Array.from(this.entries()).sort(((a, b) => a.value - b.value)).map((entry => entry.resource)); + const map = new ResourceMap(this._normalizePath, this.config); + for (const resource of orderedResources) { + map.set(resource, undefined); + } + return map; + } +} + +class GetErrRequest { + static executeGetErrRequest(client, files, onDone) { + return new GetErrRequest(client, files, onDone); + } + constructor(client, files, onDone) { + this.client = client; + this.files = files; + this._done = false; + this._token = new main$3.CancellationTokenSource; + if (!this.isErrorReportingEnabled()) { + this._done = true; + setImmediate(onDone); + return; + } + const supportsSyntaxGetErr = this.client.apiVersion.gte(API.v440); + const allFiles = coalesce(Array.from(files.entries()).filter((entry => supportsSyntaxGetErr || client.hasCapabilityForResource(entry.resource, ClientCapability.Semantic))).map((entry => client.toTsFilePath(entry.resource.toString())))); + if (!allFiles.length) { + this._done = true; + setImmediate(onDone); + } else { + const request = this.areProjectDiagnosticsEnabled() ? client.executeAsync(CommandTypes.GeterrForProject, { + delay: 0, + file: allFiles[0] + }, this._token.token) : client.executeAsync(CommandTypes.Geterr, { + delay: 0, + files: allFiles + }, this._token.token); + request.finally((() => { + if (this._done) { + return; + } + this._done = true; + onDone(); + })); + } + } + isErrorReportingEnabled() { + if (this.client.apiVersion.gte(API.v440)) { + return true; + } else { + return this.client.capabilities.has(ClientCapability.Semantic); + } + } + areProjectDiagnosticsEnabled() { + return false; + } + cancel() { + if (!this._done) { + this._token.cancel(); + } + this._token.dispose(); + } +} + +class LspDocument { + constructor(doc, filepath) { + const {uri: uri, languageId: languageId, version: version, text: text} = doc; + this._document = TextDocument.create(uri, languageId, version, text); + this._uri = URI.parse(uri); + this._filepath = filepath; + } + get uri() { + return this._uri; + } + get filepath() { + return this._filepath; + } + get languageId() { + return this._document.languageId; + } + get version() { + return this._document.version; + } + getText(range) { + return this._document.getText(range); + } + positionAt(offset) { + return this._document.positionAt(offset); + } + offsetAt(position) { + return this._document.offsetAt(position); + } + get lineCount() { + return this._document.lineCount; + } + getLine(line) { + const lineRange = this.getLineRange(line); + return this.getText(lineRange); + } + getLineRange(line) { + const lineStart = this.getLineStart(line); + const lineEnd = this.getLineEnd(line); + return main$3.Range.create(lineStart, lineEnd); + } + getLineEnd(line) { + const nextLine = line + 1; + const nextLineOffset = this.getLineOffset(nextLine); + return this.positionAt(nextLine < this._document.lineCount ? nextLineOffset - 1 : nextLineOffset); + } + getLineOffset(line) { + const lineStart = this.getLineStart(line); + return this.offsetAt(lineStart); + } + getLineStart(line) { + return main$3.Position.create(line, 0); + } + getFullRange() { + return main$3.Range.create(main$3.Position.create(0, 0), this.getLineEnd(Math.max(this.lineCount - 1, 0))); + } + applyEdit(version, change) { + const content = this.getText(); + let newContent = change.text; + if (main$3.TextDocumentContentChangeEvent.isIncremental(change)) { + const start = this.offsetAt(change.range.start); + const end = this.offsetAt(change.range.end); + newContent = content.substr(0, start) + change.text + content.substr(end); + } + this._document = TextDocument.create(this._uri.toString(), this.languageId, version, newContent); + } +} + +class LspDocuments { + constructor(client, lspClient, onCaseInsensitiveFileSystem) { + this._validateJavaScript = true; + this._validateTypeScript = true; + this.modeIds = new Set; + this._files = []; + this.documents = new Map; + this.client = client; + this.lspClient = lspClient; + const pathNormalizer = path => this.client.toTsFilePath(path.toString()); + this.pendingDiagnostics = new PendingDiagnostics(pathNormalizer, { + onCaseInsensitiveFileSystem: onCaseInsensitiveFileSystem + }); + this.diagnosticDelayer = new Delayer(300); + } + initialize(allModeIds) { + this.modeIds = new Set(allModeIds); + } + get files() { + return this._files; + } + get documentsForTesting() { + return this.documents; + } + get(file) { + const document = this.documents.get(file); + if (!document) { + return undefined; + } + if (this.files[0] !== file) { + this._files.splice(this._files.indexOf(file), 1); + this._files.unshift(file); + } + return document; + } + openTextDocument(textDocument) { + if (!this.modeIds.has(textDocument.languageId)) { + const detectedLanguageId = getModeFromFileUri(textDocument.uri); + if (detectedLanguageId) { + this.lspClient.logMessage({ + type: main$3.MessageType.Warning, + message: `Invalid langaugeId "${textDocument.languageId}" provided for uri "${textDocument.uri}". Correcting to "${detectedLanguageId}"` + }); + textDocument.languageId = detectedLanguageId; + } else { + return false; + } + } + const resource = textDocument.uri; + const filepath = this.client.toTsFilePath(resource); + if (!filepath) { + return false; + } + if (this.documents.has(filepath)) { + return true; + } + const document = new LspDocument(textDocument, filepath); + this.documents.set(filepath, document); + this._files.unshift(filepath); + this.client.executeWithoutWaitingForResponse(CommandTypes.Open, { + file: filepath, + fileContent: textDocument.text, + scriptKindName: mode2ScriptKind(textDocument.languageId), + projectRootPath: this.getProjectRootPath(document.uri) + }); + this.requestDiagnostic(document); + return true; + } + onDidCloseTextDocument(uri) { + const document = this.client.toOpenDocument(uri); + if (!document) { + return; + } + this._files.splice(this._files.indexOf(document.filepath), 1); + this.pendingDiagnostics.delete(document.uri); + this.pendingGetErr?.files.delete(document.uri); + this.documents.delete(document.filepath); + this.client.cancelInflightRequestsForResource(document.uri); + this.client.executeWithoutWaitingForResponse(CommandTypes.Close, { + file: document.filepath + }); + this.requestAllDiagnostics(); + } + requestDiagnosticsForTesting() { + this.triggerDiagnostics(0); + } + onDidChangeTextDocument(params) { + const {textDocument: textDocument} = params; + if (textDocument.version === null) { + throw new Error(`Received document change event for ${textDocument.uri} without valid version identifier`); + } + const filepath = this.client.toTsFilePath(textDocument.uri); + if (!filepath) { + return; + } + const document = this.documents.get(filepath); + if (!document) { + return; + } + this.client.cancelInflightRequestsForResource(document.uri); + for (const change of params.contentChanges) { + let line = 0; + let offset = 0; + let endLine = 0; + let endOffset = 0; + if (main$3.TextDocumentContentChangeEvent.isIncremental(change)) { + line = change.range.start.line + 1; + offset = change.range.start.character + 1; + endLine = change.range.end.line + 1; + endOffset = change.range.end.character + 1; + } else { + line = 1; + offset = 1; + const endPos = document.positionAt(document.getText().length); + endLine = endPos.line + 1; + endOffset = endPos.character + 1; + } + this.client.executeWithoutWaitingForResponse(CommandTypes.Change, { + file: filepath, + line: line, + offset: offset, + endLine: endLine, + endOffset: endOffset, + insertString: change.text + }); + document.applyEdit(textDocument.version, change); + } + const didTrigger = this.requestDiagnostic(document); + if (!didTrigger && this.pendingGetErr) { + this.pendingGetErr.cancel(); + this.pendingGetErr = undefined; + this.triggerDiagnostics(); + } + } + interruptGetErr(f) { + if (!this.pendingGetErr) { + return f(); + } + this.pendingGetErr.cancel(); + this.pendingGetErr = undefined; + const result = f(); + this.triggerDiagnostics(); + return result; + } + getProjectRootPath(resource) { + const workspaceRoot = this.client.getWorkspaceRootForResource(resource); + if (workspaceRoot) { + return this.client.toTsFilePath(workspaceRoot.toString()); + } + return undefined; + } + handles(resource) { + const filepath = this.client.toTsFilePath(resource.toString()); + return filepath !== undefined && this.documents.has(filepath); + } + requestAllDiagnostics() { + for (const buffer of this.documents.values()) { + if (this.shouldValidate(buffer)) { + this.pendingDiagnostics.set(buffer.uri, Date.now()); + } + } + this.triggerDiagnostics(); + } + hasPendingDiagnostics(resource) { + return this.pendingDiagnostics.has(resource); + } + getErr(resources) { + const handledResources = resources.filter((resource => this.handles(resource))); + if (!handledResources.length) { + return; + } + for (const resource of handledResources) { + this.pendingDiagnostics.set(resource, Date.now()); + } + this.triggerDiagnostics(); + } + triggerDiagnostics(delay = 200) { + this.diagnosticDelayer.trigger((() => { + this.sendPendingDiagnostics(); + }), delay); + } + requestDiagnostic(buffer) { + if (!this.shouldValidate(buffer)) { + return false; + } + this.pendingDiagnostics.set(buffer.uri, Date.now()); + const delay = Math.min(Math.max(Math.ceil(buffer.lineCount / 20), 300), 800); + this.triggerDiagnostics(delay); + return true; + } + sendPendingDiagnostics() { + const orderedFileSet = this.pendingDiagnostics.getOrderedFileSet(); + if (this.pendingGetErr) { + this.pendingGetErr.cancel(); + for (const {resource: resource} of this.pendingGetErr.files.entries()) { + const filename = this.client.toTsFilePath(resource.toString()); + if (filename && this.documents.get(filename)) { + orderedFileSet.set(resource, undefined); + } + } + this.pendingGetErr = undefined; + } + for (const buffer of this.documents.values()) { + orderedFileSet.set(buffer.uri, undefined); + } + if (orderedFileSet.size) { + const getErr = this.pendingGetErr = GetErrRequest.executeGetErrRequest(this.client, orderedFileSet, (() => { + if (this.pendingGetErr === getErr) { + this.pendingGetErr = undefined; + } + })); + } + this.pendingDiagnostics.clear(); + } + shouldValidate(buffer) { + switch (buffer.languageId) { + case 'javascript': + case 'javascriptreact': + return this._validateJavaScript; + + case 'typescript': + case 'typescriptreact': + default: + return this._validateTypeScript; + } + } +} + +const file = 'file'; + +const untitled = 'untitled'; + +const git = 'git'; + +const github = 'github'; + +const azurerepos = 'azurerepos'; + +const buffer = 'buffer'; + +const zipfile = 'zipfile'; + +const vsls = 'vsls'; + +function getSemanticSupportedSchemes() { + return [ file, untitled, buffer, zipfile ]; +} + +const disabledSchemes = new Set([ git, vsls, github, azurerepos ]); + +var TypeScriptServerPlugin; + +(function(TypeScriptServerPlugin) { + function equals(a, b) { + return a.uri.toString() === b.uri.toString() && a.name === b.name && equals$1(a.languages, b.languages); + } + TypeScriptServerPlugin.equals = equals; +})(TypeScriptServerPlugin || (TypeScriptServerPlugin = {})); + +class PluginManager { + setPlugins(plugins) { + this._plugins = this.readPlugins(plugins); + } + get plugins() { + return Array.from(this._plugins || []); + } + readPlugins(plugins) { + const newPlugins = []; + for (const plugin of plugins) { + newPlugins.push({ + name: plugin.name, + uri: URI.file(plugin.location), + languages: Array.isArray(plugin.languages) ? plugin.languages : [] + }); + } + return newPlugins; + } +} + +class TypeScriptServerError extends Error { + static create(serverId, version, response) { + const parsedResult = TypeScriptServerError.parseErrorText(response); + return new TypeScriptServerError(serverId, version, response, parsedResult?.message, parsedResult?.stack); + } + constructor(serverId, version, response, serverMessage, serverStack) { + super(`<${serverId}> TypeScript Server Error (${version.versionString})\n${serverMessage}\n${serverStack}`); + this.serverId = serverId; + this.version = version; + this.response = response; + this.serverMessage = serverMessage; + this.serverStack = serverStack; + } + get serverErrorText() { + return this.response.message; + } + get serverCommand() { + return this.response.command; + } + static parseErrorText(response) { + const errorText = response.message; + if (errorText) { + const errorPrefix = 'Error processing request. '; + if (errorText.startsWith(errorPrefix)) { + const prefixFreeErrorText = errorText.substr(errorPrefix.length); + const newlineIndex = prefixFreeErrorText.indexOf('\n'); + if (newlineIndex >= 0) { + const stack = prefixFreeErrorText.substring(newlineIndex + 1); + return { + message: prefixFreeErrorText.substring(0, newlineIndex), + stack: stack + }; + } + } + } + return undefined; + } +} + +const randomBytesAsync = promisify(crypto.randomBytes); + +const urlSafeCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~'.split(''); + +const numericCharacters = '0123456789'.split(''); + +const distinguishableCharacters = 'CDEHKMPRTUWXY012458'.split(''); + +const asciiPrintableCharacters = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'.split(''); + +const alphanumericCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.split(''); + +const generateForCustomCharacters = (length, characters) => { + const characterCount = characters.length; + const maxValidSelector = Math.floor(65536 / characterCount) * characterCount - 1; + const entropyLength = 2 * Math.ceil(1.1 * length); + let string = ''; + let stringLength = 0; + while (stringLength < length) { + const entropy = crypto.randomBytes(entropyLength); + let entropyPosition = 0; + while (entropyPosition < entropyLength && stringLength < length) { + const entropyValue = entropy.readUInt16LE(entropyPosition); + entropyPosition += 2; + if (entropyValue > maxValidSelector) { + continue; + } + string += characters[entropyValue % characterCount]; + stringLength++; + } + } + return string; +}; + +const generateForCustomCharactersAsync = async (length, characters) => { + const characterCount = characters.length; + const maxValidSelector = Math.floor(65536 / characterCount) * characterCount - 1; + const entropyLength = 2 * Math.ceil(1.1 * length); + let string = ''; + let stringLength = 0; + while (stringLength < length) { + const entropy = await randomBytesAsync(entropyLength); + let entropyPosition = 0; + while (entropyPosition < entropyLength && stringLength < length) { + const entropyValue = entropy.readUInt16LE(entropyPosition); + entropyPosition += 2; + if (entropyValue > maxValidSelector) { + continue; + } + string += characters[entropyValue % characterCount]; + stringLength++; + } + } + return string; +}; + +const generateRandomBytes = (byteLength, type, length) => crypto.randomBytes(byteLength).toString(type).slice(0, length); + +const generateRandomBytesAsync = async (byteLength, type, length) => { + const buffer = await randomBytesAsync(byteLength); + return buffer.toString(type).slice(0, length); +}; + +const allowedTypes = new Set([ undefined, 'hex', 'base64', 'url-safe', 'numeric', 'distinguishable', 'ascii-printable', 'alphanumeric' ]); + +const createGenerator = (generateForCustomCharacters, generateRandomBytes) => ({length: length, type: type, characters: characters}) => { + if (!(length >= 0 && Number.isFinite(length))) { + throw new TypeError('Expected a `length` to be a non-negative finite number'); + } + if (type !== undefined && characters !== undefined) { + throw new TypeError('Expected either `type` or `characters`'); + } + if (characters !== undefined && typeof characters !== 'string') { + throw new TypeError('Expected `characters` to be string'); + } + if (!allowedTypes.has(type)) { + throw new TypeError(`Unknown type: ${type}`); + } + if (type === undefined && characters === undefined) { + type = 'hex'; + } + if (type === 'hex' || type === undefined && characters === undefined) { + return generateRandomBytes(Math.ceil(length * .5), 'hex', length); + } + if (type === 'base64') { + return generateRandomBytes(Math.ceil(length * .75), 'base64', length); + } + if (type === 'url-safe') { + return generateForCustomCharacters(length, urlSafeCharacters); + } + if (type === 'numeric') { + return generateForCustomCharacters(length, numericCharacters); + } + if (type === 'distinguishable') { + return generateForCustomCharacters(length, distinguishableCharacters); + } + if (type === 'ascii-printable') { + return generateForCustomCharacters(length, asciiPrintableCharacters); + } + if (type === 'alphanumeric') { + return generateForCustomCharacters(length, alphanumericCharacters); + } + if (characters.length === 0) { + throw new TypeError('Expected `characters` string length to be greater than or equal to 1'); + } + if (characters.length > 65536) { + throw new TypeError('Expected `characters` string length to be less or equal to 65536'); + } + return generateForCustomCharacters(length, characters.split('')); +}; + +const cryptoRandomString = createGenerator(generateForCustomCharacters, generateRandomBytes); + +cryptoRandomString.async = createGenerator(generateForCustomCharactersAsync, generateRandomBytesAsync); + +function uniqueString() { + return cryptoRandomString({ + length: 32 + }); +} + +const temporaryDirectory$1 = await promises.realpath(os.tmpdir()); + +promisify$1(stream.pipeline); + +const getPath = (prefix = '') => path__default.join(temporaryDirectory$1, prefix + uniqueString()); + +function temporaryFile({name: name, extension: extension} = {}) { + if (name) { + if (extension !== undefined && extension !== null) { + throw new Error('The `name` and `extension` options are mutually exclusive'); + } + return path__default.join(temporaryDirectory(), name); + } + return getPath() + (extension === undefined || extension === null ? '' : '.' + extension.replace(/^\./, '')); +} + +function temporaryDirectory({prefix: prefix = ''} = {}) { + const directory = getPath(prefix); + fs$l.mkdirSync(directory); + return directory; +} + +class NodeRequestCanceller { + constructor(_serverId, _tracer) { + this._serverId = _serverId; + this._tracer = _tracer; + this.cancellationPipeName = temporaryFile({ + name: 'tscancellation' + }); + } + tryCancelOngoingRequest(seq) { + if (!this.cancellationPipeName) { + return false; + } + this._tracer.logTrace(this._serverId, `TypeScript Server: trying to cancel ongoing request with sequence number ${seq}`); + try { + fs$l.writeFileSync(this.cancellationPipeName + String(seq), ''); + } catch {} + return true; + } +} + +const nodeRequestCancellerFactory = new class { + create(serverId, tracer) { + return new NodeRequestCanceller(serverId, tracer); + } +}; + +var RequestQueueingType; + +(function(RequestQueueingType) { + RequestQueueingType[RequestQueueingType['Normal'] = 1] = 'Normal'; + RequestQueueingType[RequestQueueingType['LowPriority'] = 2] = 'LowPriority'; + RequestQueueingType[RequestQueueingType['Fence'] = 3] = 'Fence'; +})(RequestQueueingType || (RequestQueueingType = {})); + +class RequestQueue { + constructor() { + this.queue = []; + this.sequenceNumber = 0; + } + get length() { + return this.queue.length; + } + enqueue(item) { + if (item.queueingType === RequestQueueingType.Normal) { + let index = this.queue.length - 1; + while (index >= 0) { + if (this.queue[index].queueingType !== RequestQueueingType.LowPriority) { + break; + } + --index; + } + this.queue.splice(index + 1, 0, item); + } else { + this.queue.push(item); + } + } + dequeue() { + return this.queue.shift(); + } + tryDeletePendingRequest(seq) { + for (let i = 0; i < this.queue.length; i++) { + if (this.queue[i].request.seq === seq) { + this.queue.splice(i, 1); + return true; + } + } + return false; + } + createRequest(command, args) { + return { + seq: this.sequenceNumber++, + type: 'request', + command: command, + arguments: args + }; + } +} + +class CallbackMap { + constructor() { + this._callbacks = new Map; + this._asyncCallbacks = new Map; + } + destroy(cause) { + const cancellation = new ServerResponse.Cancelled(cause); + for (const callback of this._callbacks.values()) { + callback.onSuccess(cancellation); + } + this._callbacks.clear(); + for (const callback of this._asyncCallbacks.values()) { + callback.onSuccess(cancellation); + } + this._asyncCallbacks.clear(); + } + add(seq, callback, isAsync) { + if (isAsync) { + this._asyncCallbacks.set(seq, callback); + } else { + this._callbacks.set(seq, callback); + } + } + fetch(seq) { + const callback = this._callbacks.get(seq) || this._asyncCallbacks.get(seq); + this.delete(seq); + return callback; + } + delete(seq) { + if (!this._callbacks.delete(seq)) { + this._asyncCallbacks.delete(seq); + } + } +} + +var ExecutionTarget; + +(function(ExecutionTarget) { + ExecutionTarget[ExecutionTarget['Semantic'] = 0] = 'Semantic'; + ExecutionTarget[ExecutionTarget['Syntax'] = 1] = 'Syntax'; +})(ExecutionTarget || (ExecutionTarget = {})); + +class SingleTsServer { + constructor(_serverId, _serverSource, _process, _tsServerLogFile, _requestCanceller, _version, _tracer) { + this._serverId = _serverId; + this._serverSource = _serverSource; + this._process = _process; + this._tsServerLogFile = _tsServerLogFile; + this._requestCanceller = _requestCanceller; + this._version = _version; + this._tracer = _tracer; + this._requestQueue = new RequestQueue; + this._callbacks = new CallbackMap; + this._pendingResponses = new Set; + this._eventHandlers = new Set; + this._exitHandlers = new Set; + this._errorHandlers = new Set; + this._stdErrHandlers = new Set; + this._process.onData((msg => { + this.dispatchMessage(msg); + })); + this._process.onStdErr((error => { + this._stdErrHandlers.forEach((handler => handler(error))); + })); + this._process.onExit(((code, signal) => { + this._exitHandlers.forEach((handler => handler({ + code: code, + signal: signal + }))); + this._callbacks.destroy('server exited'); + })); + this._process.onError((error => { + this._errorHandlers.forEach((handler => handler(error))); + this._callbacks.destroy('server errored'); + })); + } + onEvent(handler) { + this._eventHandlers.add(handler); + } + onExit(handler) { + this._exitHandlers.add(handler); + } + onStdErr(handler) { + this._stdErrHandlers.add(handler); + } + onError(handler) { + this._errorHandlers.add(handler); + } + get tsServerLogFile() { + return this._tsServerLogFile; + } + write(serverRequest) { + this._process.write(serverRequest); + } + dispose() { + this._callbacks.destroy('server disposed'); + this._pendingResponses.clear(); + this._eventHandlers.clear(); + this._exitHandlers.clear(); + this._errorHandlers.clear(); + } + kill() { + this.dispose(); + this._process.kill(); + } + dispatchMessage(message) { + try { + switch (message.type) { + case 'response': + if (this._serverSource) { + this.dispatchResponse({ + ...message + }); + } else { + this.dispatchResponse(message); + } + break; + + case 'event': + { + const event = message; + if (event.event === 'requestCompleted') { + const seq = event.body.request_seq; + const callback = this._callbacks.fetch(seq); + if (callback) { + this._tracer.traceRequestCompleted(this._serverId, 'requestCompleted', seq, callback); + callback.onSuccess(undefined); + } + } else { + this._tracer.traceEvent(this._serverId, event); + this._eventHandlers.forEach((handler => handler(event))); + } + break; + } + + default: + throw new Error(`Unknown message type ${message.type} received`); + } + } finally { + this.sendNextRequests(); + } + } + tryCancelRequest(seq, command) { + try { + if (this._requestQueue.tryDeletePendingRequest(seq)) { + this.logTrace(`Canceled request with sequence number ${seq}`); + return true; + } + if (this._requestCanceller.tryCancelOngoingRequest(seq)) { + return true; + } + this.logTrace(`Tried to cancel request with sequence number ${seq}. But request got already delivered.`); + return false; + } finally { + const callback = this.fetchCallback(seq); + callback?.onSuccess(new ServerResponse.Cancelled(`Cancelled request ${seq} - ${command}`)); + } + } + dispatchResponse(response) { + const callback = this.fetchCallback(response.request_seq); + if (!callback) { + return; + } + this._tracer.traceResponse(this._serverId, response, callback); + if (response.success) { + callback.onSuccess(response); + } else if (response.message === 'No content available.') { + callback.onSuccess(ServerResponse.NoContent); + } else { + callback.onError(TypeScriptServerError.create(this._serverId, this._version, response)); + } + } + executeImpl(command, args, executeInfo) { + const request = this._requestQueue.createRequest(command, args); + const requestInfo = { + request: request, + expectsResponse: executeInfo.expectsResult, + isAsync: executeInfo.isAsync, + queueingType: SingleTsServer.getQueueingType(command, executeInfo.lowPriority) + }; + let result; + if (executeInfo.expectsResult) { + result = new Promise(((resolve, reject) => { + this._callbacks.add(request.seq, { + onSuccess: resolve, + onError: reject, + queuingStartTime: Date.now(), + isAsync: executeInfo.isAsync + }, executeInfo.isAsync); + if (executeInfo.token) { + executeInfo.token.onCancellationRequested((() => { + this.tryCancelRequest(request.seq, command); + })); + } + })); + } + this._requestQueue.enqueue(requestInfo); + this.sendNextRequests(); + return [ result ]; + } + sendNextRequests() { + while (this._pendingResponses.size === 0 && this._requestQueue.length > 0) { + const item = this._requestQueue.dequeue(); + if (item) { + this.sendRequest(item); + } + } + } + sendRequest(requestItem) { + const serverRequest = requestItem.request; + this._tracer.traceRequest(this._serverId, serverRequest, requestItem.expectsResponse, this._requestQueue.length); + if (requestItem.expectsResponse && !requestItem.isAsync) { + this._pendingResponses.add(requestItem.request.seq); + } + try { + this.write(serverRequest); + } catch (err) { + const callback = this.fetchCallback(serverRequest.seq); + callback?.onError(err); + } + } + fetchCallback(seq) { + const callback = this._callbacks.fetch(seq); + if (!callback) { + return undefined; + } + this._pendingResponses.delete(seq); + return callback; + } + logTrace(message) { + this._tracer.logTrace(this._serverId, message); + } + static getQueueingType(command, lowPriority) { + if (SingleTsServer.fenceCommands.has(command)) { + return RequestQueueingType.Fence; + } + return lowPriority ? RequestQueueingType.LowPriority : RequestQueueingType.Normal; + } +} + +SingleTsServer.fenceCommands = new Set([ 'change', 'close', 'open', 'updateOpen' ]); + +class RequestRouter { + constructor(servers, delegate) { + this.servers = servers; + this.delegate = delegate; + } + execute(command, args, executeInfo) { + if (RequestRouter.sharedCommands.has(command) && typeof executeInfo.executionTarget === 'undefined') { + const requestStates = this.servers.map((() => RequestState.Unresolved)); + let token = undefined; + if (executeInfo.token) { + const source = new main$3.CancellationTokenSource; + executeInfo.token.onCancellationRequested((() => { + if (requestStates.some((state => state === RequestState.Resolved))) { + return; + } + source.cancel(); + })); + token = source.token; + } + const allRequests = []; + for (let serverIndex = 0; serverIndex < this.servers.length; ++serverIndex) { + const server = this.servers[serverIndex].server; + const request = server.executeImpl(command, args, { + ...executeInfo, + token: token + })[0]; + allRequests.push(request); + if (request) { + request.then((result => { + requestStates[serverIndex] = RequestState.Resolved; + const erroredRequest = requestStates.find((state => state.type === 2)); + if (erroredRequest) { + this.delegate.onFatalError(command, erroredRequest.err); + } + return result; + }), (err => { + requestStates[serverIndex] = new RequestState.Errored(err); + if (requestStates.some((state => state === RequestState.Resolved))) { + this.delegate.onFatalError(command, err); + } + throw err; + })); + } + } + return allRequests; + } + for (const {canRun: canRun, server: server} of this.servers) { + if (!canRun || canRun(command, executeInfo)) { + return server.executeImpl(command, args, executeInfo); + } + } + throw new Error(`Could not find server for command: '${command}'`); + } +} + +RequestRouter.sharedCommands = new Set([ CommandTypes.Change, CommandTypes.Close, CommandTypes.Open, CommandTypes.UpdateOpen, CommandTypes.Configure ]); + +class SyntaxRoutingTsServer { + constructor(servers, delegate, enableDynamicRouting) { + this._projectLoading = true; + this._eventHandlers = new Set; + this._exitHandlers = new Set; + this._errorHandlers = new Set; + this.syntaxServer = servers.syntax; + this.semanticServer = servers.semantic; + this.router = new RequestRouter([ { + server: this.syntaxServer, + canRun: (command, execInfo) => { + switch (execInfo.executionTarget) { + case ExecutionTarget.Semantic: + return false; + + case ExecutionTarget.Syntax: + return true; + } + if (SyntaxRoutingTsServer.syntaxAlwaysCommands.has(command)) { + return true; + } + if (SyntaxRoutingTsServer.semanticCommands.has(command)) { + return false; + } + if (enableDynamicRouting && this.projectLoading && SyntaxRoutingTsServer.syntaxAllowedCommands.has(command)) { + return true; + } + return false; + } + }, { + server: this.semanticServer, + canRun: undefined + } ], delegate); + this.syntaxServer.onEvent((event => { + this._eventHandlers.forEach((handler => handler(event))); + })); + this.semanticServer.onEvent((event => { + switch (event.event) { + case 'projectLoadingStart': + this._projectLoading = true; + break; + + case 'projectLoadingFinish': + case 'semanticDiag': + case 'syntaxDiag': + case 'suggestionDiag': + case 'configFileDiag': + this._projectLoading = false; + break; + } + this._eventHandlers.forEach((handler => handler(event))); + })); + this.semanticServer.onExit((event => { + this._exitHandlers.forEach((handler => handler(event))); + this.syntaxServer.kill(); + })); + this.semanticServer.onError((event => this._errorHandlers.forEach((handler => handler(event))))); + } + get projectLoading() { + return this._projectLoading; + } + dispose() { + this._eventHandlers.clear(); + this._exitHandlers.clear(); + this._errorHandlers.clear(); + } + onEvent(handler) { + this._eventHandlers.add(handler); + } + onExit(handler) { + this._exitHandlers.add(handler); + } + onError(handler) { + this._errorHandlers.add(handler); + } + onStdErr(_handler) {} + get tsServerLogFile() { + return this.semanticServer.tsServerLogFile; + } + kill() { + this.dispose(); + this.syntaxServer.kill(); + this.semanticServer.kill(); + } + executeImpl(command, args, executeInfo) { + return this.router.execute(command, args, executeInfo); + } +} + +SyntaxRoutingTsServer.syntaxAlwaysCommands = new Set([ CommandTypes.NavTree, CommandTypes.GetOutliningSpans, CommandTypes.JsxClosingTag, CommandTypes.SelectionRange, CommandTypes.Format, CommandTypes.Formatonkey, CommandTypes.DocCommentTemplate ]); + +SyntaxRoutingTsServer.semanticCommands = new Set([ CommandTypes.Geterr, CommandTypes.GeterrForProject, CommandTypes.ProjectInfo, CommandTypes.ConfigurePlugin ]); + +SyntaxRoutingTsServer.syntaxAllowedCommands = new Set([ CommandTypes.CompletionDetails, CommandTypes.CompletionInfo, CommandTypes.Definition, CommandTypes.DefinitionAndBoundSpan, CommandTypes.DocumentHighlights, CommandTypes.Implementation, CommandTypes.Navto, CommandTypes.Quickinfo, CommandTypes.References, CommandTypes.Rename, CommandTypes.SignatureHelp ]); + +var RequestState; + +(function(RequestState) { + RequestState.Unresolved = { + type: 0 + }; + RequestState.Resolved = { + type: 1 + }; + class Errored { + constructor(err) { + this.err = err; + this.type = 2; + } + } + RequestState.Errored = Errored; +})(RequestState || (RequestState = {})); + +class NodeTsServerProcessFactory { + fork(version, args, kind, configuration) { + const tsServerPath = version.tsServerPath; + const useIpc = version.version?.gte(API.v490); + const runtimeArgs = [ ...args ]; + if (useIpc) { + runtimeArgs.push('--useNodeIpc'); + } + const childProcess = ChildProcess.fork(tsServerPath, runtimeArgs, { + silent: true, + cwd: undefined, + env: generatePatchedEnv(process.env, tsServerPath), + execArgv: getExecArgv(kind, configuration), + stdio: useIpc ? [ 'pipe', 'pipe', 'pipe', 'ipc' ] : undefined + }); + return useIpc ? new IpcChildServerProcess(childProcess) : new StdioChildServerProcess(childProcess); + } +} + +function generatePatchedEnv(env, modulePath) { + const newEnv = Object.assign({}, env); + newEnv.NODE_PATH = path__default.join(modulePath, '..', '..', '..'); + newEnv.PATH = newEnv.PATH || process.env.PATH; + return newEnv; +} + +function getExecArgv(kind, configuration) { + const args = []; + const debugPort = getDebugPort(kind); + if (debugPort) { + const inspectFlag = getTssDebugBrk() ? '--inspect-brk' : '--inspect'; + args.push(`${inspectFlag}=${debugPort}`); + } + if (configuration.maxTsServerMemory) { + args.push(`--max-old-space-size=${configuration.maxTsServerMemory}`); + } + return args; +} + +function getDebugPort(kind) { + if (kind === 'syntax') { + return undefined; + } + const value = getTssDebugBrk() || getTssDebug(); + if (value) { + const port = parseInt(value); + if (!isNaN(port)) { + return port; + } + } + return undefined; +} + +function getTssDebug() { + return process.env.TSS_DEBUG; +} + +function getTssDebugBrk() { + return process.env.TSS_DEBUG_BRK; +} + +class IpcChildServerProcess { + constructor(_process) { + this._process = _process; + } + write(serverRequest) { + this._process.send(serverRequest); + } + onData(handler) { + this._process.on('message', handler); + } + onExit(handler) { + this._process.on('exit', handler); + } + onStdErr(handler) { + this._process.stderr.on('data', (data => handler(data.toString()))); + } + onError(handler) { + this._process.on('error', handler); + } + kill() { + this._process.kill(); + } +} + +class StdioChildServerProcess { + constructor(_process) { + this._process = _process; + this._reader = new Reader(this._process.stdout); + } + get reader() { + return this._reader; + } + write(serverRequest) { + this._process.stdin.write(`${JSON.stringify(serverRequest)}\r\n`, 'utf8'); + } + onData(handler) { + this.reader.onData(handler); + } + onExit(handler) { + this._process.on('exit', handler); + } + onStdErr(handler) { + this._process.stderr.on('data', (data => handler(data.toString()))); + } + onError(handler) { + this._process.on('error', handler); + this.reader.onError(handler); + } + kill() { + this._process.kill(); + this.reader.dispose(); + this._reader = null; + } +} + +class Reader { + constructor(readable) { + this.buffer = new ProtocolBuffer; + this.nextMessageLength = -1; + this._onError = _error => {}; + this._onData = _data => {}; + this.isDisposed = false; + readable.on('data', (data => this.onLengthData(data))); + } + dispose() { + this.isDisposed = true; + this._onError = _error => {}; + this._onData = _data => {}; + } + onError(handler) { + this._onError = handler; + } + onData(handler) { + this._onData = handler; + } + onLengthData(data) { + if (this.isDisposed) { + return; + } + try { + this.buffer.append(data); + while (true) { + if (this.nextMessageLength === -1) { + this.nextMessageLength = this.buffer.tryReadContentLength(); + if (this.nextMessageLength === -1) { + return; + } + } + const msg = this.buffer.tryReadContent(this.nextMessageLength); + if (msg === null) { + return; + } + this.nextMessageLength = -1; + const json = JSON.parse(msg); + this._onData(json); + } + } catch (e) { + this._onError(e); + } + } +} + +const defaultSize = 8192; + +const contentLength = 'Content-Length: '; + +const contentLengthSize = Buffer.byteLength(contentLength, 'utf8'); + +const blank = Buffer.from(' ', 'utf8')[0]; + +const backslashR = Buffer.from('\r', 'utf8')[0]; + +const backslashN = Buffer.from('\n', 'utf8')[0]; + +class ProtocolBuffer { + constructor() { + this.index = 0; + this.buffer = Buffer.allocUnsafe(defaultSize); + } + append(data) { + let toAppend = null; + if (Buffer.isBuffer(data)) { + toAppend = data; + } else { + toAppend = Buffer.from(data, 'utf8'); + } + if (this.buffer.length - this.index >= toAppend.length) { + toAppend.copy(this.buffer, this.index, 0, toAppend.length); + } else { + const newSize = (Math.ceil((this.index + toAppend.length) / defaultSize) + 1) * defaultSize; + if (this.index === 0) { + this.buffer = Buffer.allocUnsafe(newSize); + toAppend.copy(this.buffer, 0, 0, toAppend.length); + } else { + this.buffer = Buffer.concat([ this.buffer.slice(0, this.index), toAppend ], newSize); + } + } + this.index += toAppend.length; + } + tryReadContentLength() { + let result = -1; + let current = 0; + while (current < this.index && (this.buffer[current] === blank || this.buffer[current] === backslashR || this.buffer[current] === backslashN)) { + current++; + } + if (this.index < current + contentLengthSize) { + return result; + } + current += contentLengthSize; + const start = current; + while (current < this.index && this.buffer[current] !== backslashR) { + current++; + } + if (current + 3 >= this.index || this.buffer[current + 1] !== backslashN || this.buffer[current + 2] !== backslashR || this.buffer[current + 3] !== backslashN) { + return result; + } + const data = this.buffer.toString('utf8', start, current); + result = parseInt(data); + this.buffer = this.buffer.slice(current + 4); + this.index = this.index - (current + 4); + return result; + } + tryReadContent(length) { + if (this.index < length) { + return null; + } + const result = this.buffer.toString('utf8', 0, length); + let sourceStart = length; + while (sourceStart < this.index && (this.buffer[sourceStart] === backslashR || this.buffer[sourceStart] === backslashN)) { + sourceStart++; + } + this.buffer.copy(this.buffer, 0, sourceStart); + this.index = this.index - sourceStart; + return result; + } +} + +var TsServerLogLevel; + +(function(TsServerLogLevel) { + TsServerLogLevel[TsServerLogLevel['Off'] = 0] = 'Off'; + TsServerLogLevel[TsServerLogLevel['Normal'] = 1] = 'Normal'; + TsServerLogLevel[TsServerLogLevel['Terse'] = 2] = 'Terse'; + TsServerLogLevel[TsServerLogLevel['RequestTime'] = 3] = 'RequestTime'; + TsServerLogLevel[TsServerLogLevel['Verbose'] = 4] = 'Verbose'; +})(TsServerLogLevel || (TsServerLogLevel = {})); + +(function(TsServerLogLevel) { + function fromString(value) { + switch (value?.toLowerCase()) { + case 'normal': + return TsServerLogLevel.Normal; + + case 'terse': + return TsServerLogLevel.Terse; + + case 'requestTime': + return TsServerLogLevel.RequestTime; + + case 'verbose': + return TsServerLogLevel.Verbose; + + case 'off': + default: + return TsServerLogLevel.Off; + } + } + TsServerLogLevel.fromString = fromString; + function toString(value) { + switch (value) { + case TsServerLogLevel.Normal: + return 'normal'; + + case TsServerLogLevel.Terse: + return 'terse'; + + case TsServerLogLevel.Verbose: + return 'verbose'; + + case TsServerLogLevel.Off: + default: + return 'off'; + } + } + TsServerLogLevel.toString = toString; +})(TsServerLogLevel || (TsServerLogLevel = {})); + +function toSyntaxServerConfiguration(value) { + switch (value) { + case 'never': + return 0; + + case 'auto': + return 2; + } + return 2; +} + +class TypeScriptServerSpawner { + constructor(_apiVersion, _logDirectoryProvider, _logger, _tracer) { + this._apiVersion = _apiVersion; + this._logDirectoryProvider = _logDirectoryProvider; + this._logger = _logger; + this._tracer = _tracer; + } + spawn(version, capabilities, configuration, pluginManager, delegate) { + let primaryServer; + const serverType = this.getCompositeServerType(version, capabilities, configuration); + switch (serverType) { + case 1: + case 2: + { + const enableDynamicRouting = serverType === 2; + primaryServer = new SyntaxRoutingTsServer({ + syntax: this.spawnTsServer('syntax', version, configuration, pluginManager), + semantic: this.spawnTsServer('semantic', version, configuration, pluginManager) + }, delegate, enableDynamicRouting); + break; + } + + case 0: + { + primaryServer = this.spawnTsServer('main', version, configuration, pluginManager); + break; + } + + case 3: + { + primaryServer = this.spawnTsServer('syntax', version, configuration, pluginManager); + break; + } + } + return primaryServer; + } + getCompositeServerType(version, capabilities, configuration) { + if (!capabilities.has(ClientCapability.Semantic)) { + return 3; + } + switch (configuration.useSyntaxServer) { + case 1: + return 3; + + case 0: + return 0; + + case 2: + if (version.version?.gte(API.v340)) { + return version.version?.gte(API.v400) ? 2 : 1; + } + return 0; + } + } + spawnTsServer(kind, version, configuration, pluginManager) { + const processFactory = new NodeTsServerProcessFactory; + const canceller = nodeRequestCancellerFactory.create(kind, this._tracer); + const {args: args, tsServerLogFile: tsServerLogFile} = this.getTsServerArgs(kind, configuration, this._apiVersion, pluginManager, canceller.cancellationPipeName); + if (this.isLoggingEnabled(configuration)) { + if (tsServerLogFile) { + this._logger.logIgnoringVerbosity(LogLevel.Info, `<${kind}> Log file: ${tsServerLogFile}`); + } else { + this._logger.logIgnoringVerbosity(LogLevel.Error, `<${kind}> Could not create log directory`); + } + } + const tsProcess = processFactory.fork(version, args, kind, configuration); + this._logger.log('Starting tsserver'); + return new SingleTsServer(kind, this.kindToServerType(kind), tsProcess, tsServerLogFile, canceller, version, this._tracer); + } + kindToServerType(kind) { + switch (kind) { + case 'syntax': + return ServerType.Syntax; + + case 'main': + case 'semantic': + case 'diagnostics': + default: + return ServerType.Semantic; + } + } + getTsServerArgs(kind, configuration, apiVersion, pluginManager, cancellationPipeName) { + const args = []; + let tsServerLogFile; + let tsServerTraceDirectory; + if (kind === 'syntax') { + if (apiVersion.gte(API.v401)) { + args.push('--serverMode', 'partialSemantic'); + } else { + args.push('--syntaxOnly'); + } + } + args.push('--useInferredProjectPerProjectRoot'); + const {disableAutomaticTypingAcquisition: disableAutomaticTypingAcquisition, locale: locale, npmLocation: npmLocation} = configuration; + if (disableAutomaticTypingAcquisition || kind === 'syntax' || kind === 'diagnostics') { + args.push('--disableAutomaticTypingAcquisition'); + } + if (cancellationPipeName) { + args.push('--cancellationPipeName', `${cancellationPipeName}*`); + } + if (this.isLoggingEnabled(configuration)) { + const logDir = this._logDirectoryProvider.getNewLogDirectory(); + if (logDir) { + tsServerLogFile = path__default.join(logDir, 'tsserver.log'); + args.push('--logVerbosity', TsServerLogLevel.toString(configuration.logVerbosity)); + args.push('--logFile', tsServerLogFile); + } + } + const pluginPaths = []; + if (pluginManager.plugins.length) { + args.push('--globalPlugins', pluginManager.plugins.map((x => x.name)).join(',')); + for (const plugin of pluginManager.plugins) { + pluginPaths.push(plugin.uri.fsPath); + } + } + if (pluginPaths.length !== 0) { + args.push('--pluginProbeLocations', pluginPaths.join(',')); + } + if (npmLocation) { + this._logger.info(`using npm from ${npmLocation}`); + args.push('--npmLocation', `"${npmLocation}"`); + } + args.push('--locale', locale || 'en'); + args.push('--validateDefaultNpmLocation'); + return { + args: args, + tsServerLogFile: tsServerLogFile, + tsServerTraceDirectory: tsServerTraceDirectory + }; + } + isLoggingEnabled(configuration) { + return configuration.logVerbosity !== TsServerLogLevel.Off; + } +} + +var Trace; + +(function(Trace) { + Trace[Trace['Off'] = 0] = 'Off'; + Trace[Trace['Messages'] = 1] = 'Messages'; + Trace[Trace['Verbose'] = 2] = 'Verbose'; +})(Trace || (Trace = {})); + +(function(Trace) { + function fromString(value) { + value = value.toLowerCase(); + switch (value) { + case 'off': + return Trace.Off; + + case 'messages': + return Trace.Messages; + + case 'verbose': + return Trace.Verbose; + + default: + return Trace.Off; + } + } + Trace.fromString = fromString; +})(Trace || (Trace = {})); + +class Tracer { + constructor(logger, trace) { + this.logger = logger; + this.trace = trace; + } + traceRequest(serverId, request, responseExpected, queueLength) { + if (this.trace === Trace.Off) { + return; + } + let data = undefined; + if (this.trace === Trace.Verbose && request.arguments) { + data = `Arguments: ${JSON.stringify(request.arguments, null, 4)}`; + } + this.logTrace(serverId, `Sending request: ${request.command} (${request.seq}). Response expected: ${responseExpected ? 'yes' : 'no'}. Current queue length: ${queueLength}`, data); + } + traceResponse(serverId, response, meta) { + if (this.trace === Trace.Off) { + return; + } + let data = undefined; + if (this.trace === Trace.Verbose && response.body) { + data = `Result: ${JSON.stringify(response.body, null, 4)}`; + } + this.logTrace(serverId, `Response received: ${response.command} (${response.request_seq}). Request took ${Date.now() - meta.queuingStartTime} ms. Success: ${response.success} ${!response.success ? `. Message: ${response.message}` : ''}`, data); + } + traceRequestCompleted(serverId, command, request_seq, meta) { + if (this.trace === Trace.Off) { + return; + } + this.logTrace(serverId, `Async response received: ${command} (${request_seq}). Request took ${Date.now() - meta.queuingStartTime} ms.`); + } + traceEvent(serverId, event) { + if (this.trace === Trace.Off) { + return; + } + let data = undefined; + if (this.trace === Trace.Verbose && event.body) { + data = `Data: ${JSON.stringify(event.body, null, 4)}`; + } + this.logTrace(serverId, `Event received: ${event.event} (${event.seq}).`, data); + } + logTrace(serverId, message, data) { + if (this.trace !== Trace.Off) { + this.logger.trace('Trace', `<${serverId}> ${message}`, data); + } + } +} + +class ZipfileURI extends URI { + constructor(uri, components) { + super(components); + this._originalUri = uri; + } + toString(_skipEncoding = false) { + return this._originalUri; + } + static parse(value, _strict = false) { + const uri = URI.parse(value, _strict); + return new ZipfileURI(value, uri); + } +} + +var ServerState; + +(function(ServerState) { + ServerState.None = { + type: 0 + }; + class Running { + constructor(server, apiVersion, tsserverVersion, languageServiceEnabled) { + this.server = server; + this.apiVersion = apiVersion; + this.tsserverVersion = tsserverVersion; + this.languageServiceEnabled = languageServiceEnabled; + this.type = 1; + this.toCancelOnResourceChange = new Set; + } + updateTsserverVersion(tsserverVersion) { + this.tsserverVersion = tsserverVersion; + } + updateLanguageServiceEnabled(enabled) { + this.languageServiceEnabled = enabled; + } + } + ServerState.Running = Running; + class Errored { + constructor(error, tsServerLogFile) { + this.error = error; + this.tsServerLogFile = tsServerLogFile; + this.type = 2; + } + } + ServerState.Errored = Errored; +})(ServerState || (ServerState = {})); + +function getDignosticsKind(event) { + switch (event.event) { + case 'syntaxDiag': + return 0; + + case 'semanticDiag': + return 1; + + case 'suggestionDiag': + return 2; + } + throw new Error('Unknown dignostics kind'); +} + +class ServerInitializingIndicator { + constructor(lspClient) { + this.lspClient = lspClient; + } + reset() { + if (this._task) { + const task = this._task; + this._task = undefined; + task.then((reporter => reporter.done())); + } + } + startedLoadingProject(projectName) { + this.reset(); + this._loadingProjectName = projectName; + this._task = this.lspClient.createProgressReporter(); + this._task.then((reporter => reporter.begin('Initializing JS/TS language features…'))); + } + finishedLoadingProject(projectName) { + if (this._loadingProjectName === projectName) { + this.reset(); + } + } +} + +const emptyAuthority = 'ts-nul-authority'; + +const inMemoryResourcePrefix = '^'; + +const RE_IN_MEMORY_FILEPATH = /^\^\/([^/]+)\/([^/]*)\/(.+)$/; + +class TsClient { + constructor(onCaseInsensitiveFileSystem, logger, lspClient) { + this.apiVersion = API.defaultVersion; + this.typescriptVersionSource = 'bundled'; + this.serverState = ServerState.None; + this.isNeovimHost = false; + this.workspaceFolders = []; + this.useSyntaxServer = 2; + this.pluginManager = new PluginManager; + this.documents = new LspDocuments(this, lspClient, onCaseInsensitiveFileSystem); + this.logger = new PrefixingLogger(logger, '[tsclient]'); + this.tsserverLogger = new PrefixingLogger(this.logger, '[tsserver]'); + this.lspClient = lspClient; + this.loadingIndicator = new ServerInitializingIndicator(this.lspClient); + } + get documentsForTesting() { + return this.documents.documentsForTesting; + } + openTextDocument(textDocument) { + return this.documents.openTextDocument(textDocument); + } + onDidCloseTextDocument(uri) { + this.documents.onDidCloseTextDocument(uri); + } + onDidChangeTextDocument(params) { + this.documents.onDidChangeTextDocument(params); + } + lastFileOrDummy() { + return this.documents.files[0] || this.workspaceFolders[0]?.uri.fsPath; + } + toTsFilePath(stringUri) { + if (this.isNeovimHost && stringUri.startsWith('zipfile:')) { + return stringUri; + } + const resource = URI.parse(stringUri); + if (disabledSchemes.has(resource.scheme)) { + return undefined; + } + if (resource.scheme === file) { + return resource.fsPath; + } + return inMemoryResourcePrefix + '/' + resource.scheme + '/' + (resource.authority || emptyAuthority) + (resource.path.startsWith('/') ? resource.path : '/' + resource.path) + (resource.fragment ? '#' + resource.fragment : ''); + } + toOpenDocument(textDocumentUri, options = {}) { + const filepath = this.toTsFilePath(textDocumentUri); + const document = filepath && this.documents.get(filepath); + if (!document) { + const uri = URI.parse(textDocumentUri); + if (!options.suppressAlertOnFailure && !disabledSchemes.has(uri.scheme)) { + console.error(`Unexpected resource ${textDocumentUri}`); + } + return undefined; + } + return document; + } + requestDiagnosticsForTesting() { + this.documents.requestDiagnosticsForTesting(); + } + hasPendingDiagnostics(resource) { + return this.documents.hasPendingDiagnostics(resource); + } + toResource(filepath) { + if (this.isNeovimHost && filepath.startsWith('zipfile:')) { + return ZipfileURI.parse(filepath); + } + if (filepath.startsWith(inMemoryResourcePrefix)) { + const parts = filepath.match(RE_IN_MEMORY_FILEPATH); + if (parts) { + const resource = URI.parse(parts[1] + '://' + (parts[2] === emptyAuthority ? '' : parts[2]) + '/' + parts[3]); + const tsFilepath = this.toTsFilePath(resource.toString()); + const document = tsFilepath && this.documents.get(tsFilepath); + return document ? document.uri : resource; + } + } + const fileUri = URI.file(filepath); + const document = this.documents.get(fileUri.fsPath); + return document ? document.uri : fileUri; + } + toResourceUri(filepath) { + return this.toResource(filepath).toString(); + } + getWorkspaceRootForResource(resource) { + for (const root of this.workspaceFolders.sort(((a, b) => a.uri.fsPath.length - b.uri.fsPath.length))) { + if (root.uri.scheme === resource.scheme && root.uri.authority === resource.authority) { + if (resource.fsPath.startsWith(root.uri.fsPath + path__default.sep)) { + return root.uri; + } + } + } + return undefined; + } + get capabilities() { + if (this.useSyntaxServer === 1) { + return new ClientCapabilities(ClientCapability.Syntax, ClientCapability.EnhancedSyntax); + } + if (this.apiVersion.gte(API.v400)) { + return new ClientCapabilities(ClientCapability.Syntax, ClientCapability.EnhancedSyntax, ClientCapability.Semantic); + } + return new ClientCapabilities(ClientCapability.Syntax, ClientCapability.Semantic); + } + hasCapabilityForResource(resource, capability) { + if (!this.capabilities.has(capability)) { + return false; + } + switch (capability) { + case ClientCapability.Semantic: + { + return getSemanticSupportedSchemes().includes(resource.scheme); + } + + case ClientCapability.Syntax: + case ClientCapability.EnhancedSyntax: + { + return true; + } + } + } + configurePlugin(pluginName, configuration) { + if (this.apiVersion.gte(API.v314)) { + this.executeWithoutWaitingForResponse(CommandTypes.ConfigurePlugin, { + pluginName: pluginName, + configuration: configuration + }); + } + } + start(workspaceRoot, options) { + this.apiVersion = options.typescriptVersion.version || API.defaultVersion; + this.typescriptVersionSource = options.typescriptVersion.source; + this.isNeovimHost = options.hostInfo === 'neovim'; + this.tracer = new Tracer(this.tsserverLogger, options.trace); + this.workspaceFolders = workspaceRoot ? [ { + uri: URI.file(workspaceRoot) + } ] : []; + this.useSyntaxServer = options.useSyntaxServer; + this.onEvent = options.onEvent; + this.onExit = options.onExit; + this.pluginManager.setPlugins(options.plugins); + const modeIds = [ ...jsTsLanguageModes, ...this.pluginManager.plugins.flatMap((x => x.languages)) ]; + this.documents.initialize(modeIds); + const tsServerSpawner = new TypeScriptServerSpawner(this.apiVersion, options.logDirectoryProvider, this.logger, this.tracer); + const tsServer = tsServerSpawner.spawn(options.typescriptVersion, this.capabilities, options, this.pluginManager, { + onFatalError: (command, err) => this.fatalError(command, err) + }); + this.serverState = new ServerState.Running(tsServer, this.apiVersion, undefined, true); + tsServer.onExit((data => { + this.serverState = ServerState.None; + this.shutdown(); + this.tsserverLogger.error(`Exited. Code: ${data.code}. Signal: ${data.signal}`); + this.onExit?.(data.code, data.signal); + })); + tsServer.onStdErr((error => { + if (error) { + this.logger.error(error); + } + })); + tsServer.onError((err => { + this.serverState = new ServerState.Errored(err, tsServer.tsServerLogFile); + if (err) { + this.tsserverLogger.error('Exited with error. Error message is: {0}', err.message || err.name); + } + this.serviceExited(); + })); + tsServer.onEvent((event => this.dispatchEvent(event))); + return true; + } + serviceExited() { + if (this.serverState.type === 1) { + this.serverState.server.kill(); + } + this.loadingIndicator.reset(); + } + dispatchEvent(event) { + switch (event.event) { + case 'syntaxDiag': + case 'semanticDiag': + case 'suggestionDiag': + case 'configFileDiag': + { + this.loadingIndicator.reset(); + this.onEvent?.(event); + break; + } + + case 'projectsUpdatedInBackground': + { + this.loadingIndicator.reset(); + const body = event.body; + const resources = body.openFiles.map((file => this.toResource(file))); + this.documents.getErr(resources); + break; + } + + case 'projectLoadingStart': + this.loadingIndicator.startedLoadingProject(event.body.projectName); + break; + + case 'projectLoadingFinish': + this.loadingIndicator.finishedLoadingProject(event.body.projectName); + break; + } + } + shutdown() { + if (this.loadingIndicator) { + this.loadingIndicator.reset(); + } + if (this.serverState.type === 1) { + this.serverState.server.kill(); + } + this.serverState = ServerState.None; + } + execute(command, args, token, config) { + let executions; + if (config?.cancelOnResourceChange) { + const runningServerState = this.serverState; + if (token && runningServerState.type === 1) { + const source = new main$1.CancellationTokenSource; + token.onCancellationRequested((() => source.cancel())); + const inFlight = { + resource: config.cancelOnResourceChange, + cancel: () => source.cancel() + }; + runningServerState.toCancelOnResourceChange.add(inFlight); + executions = this.executeImpl(command, args, { + isAsync: false, + token: source.token, + expectsResult: true, + ...config + }); + executions[0].catch((() => {})).finally((() => { + runningServerState.toCancelOnResourceChange.delete(inFlight); + source.dispose(); + })); + } + } + if (!executions) { + executions = this.executeImpl(command, args, { + isAsync: false, + token: token, + expectsResult: true, + ...config + }); + } + if (config?.nonRecoverable) { + executions[0].catch((err => this.fatalError(command, err))); + } + if (command === CommandTypes.UpdateOpen) { + Promise.all(executions).then((() => { + this.loadingIndicator.reset(); + })); + } + return executions[0].catch((error => { + throw new main$3.ResponseError(1, error.message); + })); + } + executeWithoutWaitingForResponse(command, args) { + this.executeImpl(command, args, { + isAsync: false, + token: undefined, + expectsResult: false + }); + } + executeAsync(command, args, token) { + return this.executeImpl(command, args, { + isAsync: true, + token: token, + expectsResult: true + })[0]; + } + interruptGetErr(f) { + return this.documents.interruptGetErr(f); + } + cancelInflightRequestsForResource(resource) { + if (this.serverState.type !== 1) { + return; + } + for (const request of this.serverState.toCancelOnResourceChange) { + if (request.resource === resource.toString()) { + request.cancel(); + } + } + } + executeImpl(command, args, executeInfo) { + const serverState = this.serverState; + if (serverState.type === 1) { + return serverState.server.executeImpl(command, args, executeInfo); + } else { + return [ Promise.resolve(ServerResponse.NoServer) ]; + } + } + fatalError(command, error) { + this.tsserverLogger.error(`A non-recoverable error occurred while executing command: ${command}`); + if (error instanceof TypeScriptServerError && error.serverErrorText) { + this.tsserverLogger.error(error.serverErrorText); + } + if (this.serverState.type === 1) { + this.logger.info('Killing TS Server'); + const logfile = this.serverState.server.tsServerLogFile; + this.serverState.server.kill(); + if (error instanceof TypeScriptServerError) { + this.serverState = new ServerState.Errored(error, logfile); + } + } + } +} + +const pDebounce = (fn, wait, options = {}) => { + if (!Number.isFinite(wait)) { + throw new TypeError('Expected `wait` to be a finite number'); + } + let leadingValue; + let timeout; + let resolveList = []; + return function(...arguments_) { + return new Promise((resolve => { + const shouldCallNow = options.before && !timeout; + clearTimeout(timeout); + timeout = setTimeout((() => { + timeout = null; + const result = options.before ? leadingValue : fn.apply(this, arguments_); + for (resolve of resolveList) { + resolve(result); + } + resolveList = []; + }), wait); + if (shouldCallNow) { + leadingValue = fn.apply(this, arguments_); + resolve(leadingValue); + } else { + resolveList.push(resolve); + } + })); + }; +}; + +pDebounce.promise = function_ => { + let currentPromise; + return async function(...arguments_) { + if (currentPromise) { + return currentPromise; + } + try { + currentPromise = function_.apply(this, arguments_); + return await currentPromise; + } finally { + currentPromise = undefined; + } + }; +}; + +var Range; + +(function(Range) { + Range.fromTextSpan = span => Range.fromLocations(span.start, span.end); + Range.toTextSpan = range => ({ + start: Position.toLocation(range.start), + end: Position.toLocation(range.end) + }); + Range.fromLocations = (start, end) => main$2.Range.create(Math.max(0, start.line - 1), Math.max(start.offset - 1, 0), Math.max(0, end.line - 1), Math.max(0, end.offset - 1)); + Range.toFileRangeRequestArgs = (file, range) => ({ + file: file, + startLine: range.start.line + 1, + startOffset: range.start.character + 1, + endLine: range.end.line + 1, + endOffset: range.end.character + 1 + }); + Range.toFormattingRequestArgs = (file, range) => ({ + file: file, + line: range.start.line + 1, + offset: range.start.character + 1, + endLine: range.end.line + 1, + endOffset: range.end.character + 1 + }); + function intersection(one, other) { + const start = Position.Max(other.start, one.start); + const end = Position.Min(other.end, one.end); + if (Position.isAfter(start, end)) { + return undefined; + } + return main$2.Range.create(start, end); + } + Range.intersection = intersection; + function union(one, other) { + const start = Position.Min(other.start, one.start); + const end = Position.Max(other.end, one.end); + return main$2.Range.create(start, end); + } + Range.union = union; +})(Range || (Range = {})); + +var Position; + +(function(Position) { + Position.fromLocation = tslocation => ({ + line: Math.max(tslocation.line - 1, 0), + character: Math.max(tslocation.offset - 1, 0) + }); + Position.toLocation = position => ({ + line: position.line + 1, + offset: position.character + 1 + }); + Position.toFileLocationRequestArgs = (file, position) => ({ + file: file, + line: position.line + 1, + offset: position.character + 1 + }); + function Min(...positions) { + if (!positions.length) { + return undefined; + } + let result = positions.pop(); + for (const p of positions) { + if (isBefore(p, result)) { + result = p; + } + } + return result; + } + Position.Min = Min; + function isBefore(one, other) { + if (one.line < other.line) { + return true; + } + if (other.line < one.line) { + return false; + } + return one.character < other.character; + } + Position.isBefore = isBefore; + function isEqual(one, other) { + return one.line === other.line && one.character === other.character; + } + Position.isEqual = isEqual; + function Max(...positions) { + if (!positions.length) { + return undefined; + } + let result = positions.pop(); + for (const p of positions) { + if (isAfter(p, result)) { + result = p; + } + } + return result; + } + Position.Max = Max; + function isAfter(one, other) { + return !isBeforeOrEqual(one, other); + } + Position.isAfter = isAfter; + function isBeforeOrEqual(one, other) { + if (one.line < other.line) { + return true; + } + if (other.line < one.line) { + return false; + } + return one.character <= other.character; + } + Position.isBeforeOrEqual = isBeforeOrEqual; +})(Position || (Position = {})); + +var Location; + +(function(Location) { + Location.fromTextSpan = (resource, tsTextSpan) => main$2.Location.create(resource, Range.fromTextSpan(tsTextSpan)); +})(Location || (Location = {})); + +function toLocation(fileSpan, client) { + const uri = client.toResourceUri(fileSpan.file); + return { + uri: uri, + range: { + start: Position.fromLocation(fileSpan.start), + end: Position.fromLocation(fileSpan.end) + } + }; +} + +const symbolKindsMapping = { + 'enum member': main$3.SymbolKind.Constant, + 'JSX attribute': main$3.SymbolKind.Property, + 'local class': main$3.SymbolKind.Class, + 'local function': main$3.SymbolKind.Function, + 'local var': main$3.SymbolKind.Variable, + 'type parameter': main$3.SymbolKind.Variable, + alias: main$3.SymbolKind.Variable, + class: main$3.SymbolKind.Class, + const: main$3.SymbolKind.Constant, + constructor: main$3.SymbolKind.Constructor, + enum: main$3.SymbolKind.Enum, + field: main$3.SymbolKind.Field, + file: main$3.SymbolKind.File, + function: main$3.SymbolKind.Function, + getter: main$3.SymbolKind.Method, + interface: main$3.SymbolKind.Interface, + let: main$3.SymbolKind.Variable, + method: main$3.SymbolKind.Method, + module: main$3.SymbolKind.Module, + parameter: main$3.SymbolKind.Variable, + property: main$3.SymbolKind.Property, + setter: main$3.SymbolKind.Method, + var: main$3.SymbolKind.Variable +}; + +function toSymbolKind(tspKind) { + return symbolKindsMapping[tspKind] || main$3.SymbolKind.Variable; +} + +function toDiagnosticSeverity(category) { + switch (category) { + case 'error': + return main$3.DiagnosticSeverity.Error; + + case 'warning': + return main$3.DiagnosticSeverity.Warning; + + case 'suggestion': + return main$3.DiagnosticSeverity.Hint; + + default: + return main$3.DiagnosticSeverity.Error; + } +} + +function toDiagnostic(diagnostic, client, features) { + const lspDiagnostic = { + range: { + start: Position.fromLocation(diagnostic.start), + end: Position.fromLocation(diagnostic.end) + }, + message: diagnostic.text, + severity: toDiagnosticSeverity(diagnostic.category), + code: diagnostic.code, + source: diagnostic.source || 'typescript', + relatedInformation: asRelatedInformation(diagnostic.relatedInformation, client) + }; + if (features.diagnosticsTagSupport) { + lspDiagnostic.tags = getDiagnosticTags(diagnostic); + } + return lspDiagnostic; +} + +function getDiagnosticTags(diagnostic) { + const tags = []; + if (diagnostic.reportsUnnecessary) { + tags.push(main$3.DiagnosticTag.Unnecessary); + } + if (diagnostic.reportsDeprecated) { + tags.push(main$3.DiagnosticTag.Deprecated); + } + return tags; +} + +function asRelatedInformation(info, client) { + if (!info) { + return undefined; + } + const result = []; + for (const item of info) { + const span = item.span; + if (span) { + result.push(main$3.DiagnosticRelatedInformation.create(toLocation(span, client), item.message)); + } + } + return result; +} + +function toSelectionRange(range) { + return main$3.SelectionRange.create(Range.fromTextSpan(range.textSpan), range.parent ? toSelectionRange(range.parent) : undefined); +} + +function toTextEdit(edit) { + return { + range: { + start: Position.fromLocation(edit.start), + end: Position.fromLocation(edit.end) + }, + newText: edit.newText + }; +} + +function toTextDocumentEdit(change, client) { + const uri = client.toResourceUri(change.fileName); + const document = client.toOpenDocument(uri); + return { + textDocument: { + uri: uri, + version: document?.version ?? null + }, + edits: change.textChanges.map((c => toTextEdit(c))) + }; +} + +function toDocumentHighlight(item) { + return item.highlightSpans.map((i => ({ + kind: toDocumentHighlightKind(i.kind), + range: { + start: Position.fromLocation(i.start), + end: Position.fromLocation(i.end) + } + }))); +} + +function toDocumentHighlightKind(kind) { + switch (kind) { + case HighlightSpanKind.definition: + return main$3.DocumentHighlightKind.Write; + + case HighlightSpanKind.reference: + case HighlightSpanKind.writtenReference: + return main$3.DocumentHighlightKind.Read; + + default: + return main$3.DocumentHighlightKind.Text; + } +} + +class FileDiagnostics { + constructor(uri, onPublishDiagnostics, client, features) { + this.uri = uri; + this.onPublishDiagnostics = onPublishDiagnostics; + this.client = client; + this.features = features; + this.closed = false; + this.diagnosticsPerKind = new Map; + this.firePublishDiagnostics = pDebounce((() => this.publishDiagnostics()), 50); + } + update(kind, diagnostics) { + if (this.diagnosticsPerKind.get(kind)?.length === 0 && diagnostics.length === 0) { + return; + } + this.diagnosticsPerKind.set(kind, diagnostics); + this.firePublishDiagnostics(); + } + publishDiagnostics() { + if (this.closed || !this.features.diagnosticsSupport) { + return; + } + const diagnostics = this.getDiagnostics(); + this.onPublishDiagnostics({ + uri: this.uri, + diagnostics: diagnostics + }); + } + getDiagnostics() { + const result = []; + for (const diagnostics of this.diagnosticsPerKind.values()) { + for (const diagnostic of diagnostics) { + result.push(toDiagnostic(diagnostic, this.client, this.features)); + } + } + return result; + } + onDidClose() { + this.diagnosticsPerKind.clear(); + this.publishDiagnostics(); + this.closed = true; + } + async waitForDiagnosticsForTesting() { + return new Promise((resolve => { + const interval = setInterval((() => { + if (this.diagnosticsPerKind.size === 3) { + clearInterval(interval); + this.publishDiagnostics(); + resolve(); + } + }), 50); + })); + } +} + +class DiagnosticEventQueue { + constructor(publishDiagnostics, client, features, logger) { + this.publishDiagnostics = publishDiagnostics; + this.client = client; + this.features = features; + this.logger = logger; + this.diagnostics = new Map; + this.ignoredDiagnosticCodes = new Set; + } + updateDiagnostics(kind, file, diagnostics) { + if (kind !== 0 && !this.client.hasCapabilityForResource(this.client.toResource(file), ClientCapability.Semantic)) { + return; + } + if (this.ignoredDiagnosticCodes.size) { + diagnostics = diagnostics.filter((diagnostic => !this.isDiagnosticIgnored(diagnostic))); + } + const uri = this.client.toResourceUri(file); + const diagnosticsForFile = this.diagnostics.get(uri) || new FileDiagnostics(uri, this.publishDiagnostics, this.client, this.features); + diagnosticsForFile.update(kind, diagnostics); + this.diagnostics.set(uri, diagnosticsForFile); + } + updateIgnoredDiagnosticCodes(ignoredCodes) { + this.ignoredDiagnosticCodes = new Set(ignoredCodes); + } + getDiagnosticsForFile(file) { + const uri = this.client.toResourceUri(file); + return this.diagnostics.get(uri)?.getDiagnostics() || []; + } + onDidCloseFile(file) { + const uri = this.client.toResourceUri(file); + const diagnosticsForFile = this.diagnostics.get(uri); + diagnosticsForFile?.onDidClose(); + this.diagnostics.delete(uri); + } + async waitForDiagnosticsForTesting(file) { + const uri = this.client.toResourceUri(file); + let diagnosticsForFile = this.diagnostics.get(uri); + if (diagnosticsForFile) { + diagnosticsForFile.onDidClose(); + } + diagnosticsForFile = new FileDiagnostics(uri, this.publishDiagnostics, this.client, this.features); + this.diagnostics.set(uri, diagnosticsForFile); + this.client.requestDiagnosticsForTesting(); + await diagnosticsForFile.waitForDiagnosticsForTesting(); + } + isDiagnosticIgnored(diagnostic) { + return diagnostic.code !== undefined && this.ignoredDiagnosticCodes.has(diagnostic.code); + } +} + +class SourceDefinitionCommand { + static async execute(uri, position, client, lspClient, reporter, token) { + if (client.apiVersion.lt(SourceDefinitionCommand.minVersion)) { + lspClient.showErrorMessage('Go to Source Definition failed. Requires TypeScript 4.7+.'); + return; + } + if (!position || typeof position.character !== 'number' || typeof position.line !== 'number') { + lspClient.showErrorMessage('Go to Source Definition failed. Invalid position.'); + return; + } + let file; + if (!uri || typeof uri !== 'string' || !(file = client.toTsFilePath(uri))) { + lspClient.showErrorMessage('Go to Source Definition failed. No resource provided.'); + return; + } + const document = client.toOpenDocument(client.toResourceUri(file)); + if (!document) { + lspClient.showErrorMessage('Go to Source Definition failed. File not opened in the editor.'); + return; + } + const args = Position.toFileLocationRequestArgs(file, position); + return await lspClient.withProgress({ + message: 'Finding source definitions…', + reporter: reporter + }, (async () => { + const response = await client.execute(CommandTypes.FindSourceDefinition, args, token); + if (response.type !== 'response' || !response.body) { + lspClient.showErrorMessage('No source definitions found.'); + return; + } + return response.body.map((reference => toLocation(reference, client))); + })); + } +} + +SourceDefinitionCommand.id = '_typescript.goToSourceDefinition'; + +SourceDefinitionCommand.minVersion = API.v470; + +const Commands = { + APPLY_WORKSPACE_EDIT: '_typescript.applyWorkspaceEdit', + APPLY_CODE_ACTION: '_typescript.applyCodeAction', + APPLY_REFACTORING: '_typescript.applyRefactoring', + CONFIGURE_PLUGIN: '_typescript.configurePlugin', + ORGANIZE_IMPORTS: '_typescript.organizeImports', + APPLY_RENAME_FILE: '_typescript.applyRenameFile', + APPLY_COMPLETION_CODE_ACTION: '_typescript.applyCompletionCodeAction', + SELECT_REFACTORING: '_typescript.selectRefactoring', + SOURCE_DEFINITION: SourceDefinitionCommand.id +}; + +const TypescriptVersionNotification = new main$3.NotificationType('$/typescriptVersion'); + +class MarkdownString { + constructor(value = '') { + this.value = value; + } + appendText(value, newlineStyle = 0) { + this.value += escapeMarkdownSyntaxTokens(value).replace(/([ \t]+)/g, ((_match, g1) => ' '.repeat(g1.length))).replace(/>/gm, '\\>').replace(/\n/g, newlineStyle === 1 ? '\\\n' : '\n\n'); + return this; + } + appendMarkdown(value) { + this.value += value; + return this; + } + appendCodeblock(langId, code) { + this.value += '\n```'; + this.value += langId; + this.value += '\n'; + this.value += code; + this.value += '\n```\n'; + return this; + } + toMarkupContent() { + return { + kind: 'markdown', + value: this.value + }; + } +} + +function escapeMarkdownSyntaxTokens(text) { + return text.replace(/[\\`*_{}[\]()#+\-!]/g, '\\$&'); +} + +function replaceLinks(text) { + return text.replace(/\{@(link|linkplain|linkcode) (https?:\/\/[^ |}]+?)(?:[| ]([^{}\n]+?))?\}/gi, ((_, tag, link, text) => { + switch (tag) { + case 'linkcode': + return `[\`${text ? text.trim() : link}\`](${link})`; + + default: + return `[${text ? text.trim() : link}](${link})`; + } + })); +} + +function processInlineTags(text) { + return replaceLinks(text); +} + +function getTagBodyText(tag, filePathConverter) { + if (!tag.text) { + return undefined; + } + function makeCodeblock(text) { + if (/^\s*[~`]{3}/m.test(text)) { + return text; + } + return '```\n' + text + '\n```'; + } + const text = convertLinkTags(tag.text, filePathConverter); + switch (tag.name) { + case 'example': + { + const captionTagMatches = text.match(/(.*?)<\/caption>\s*(\r\n|\n)/); + if (captionTagMatches && captionTagMatches.index === 0) { + return captionTagMatches[1] + '\n' + makeCodeblock(text.substring(captionTagMatches[0].length)); + } else { + return makeCodeblock(text); + } + } + + case 'author': + { + const emailMatch = text.match(/(.+)\s<([-.\w]+@[-.\w]+)>/); + if (emailMatch === null) { + return text; + } else { + return `${emailMatch[1]} ${emailMatch[2]}`; + } + } + + case 'default': + return makeCodeblock(text); + } + return processInlineTags(text); +} + +function getTagDocumentation(tag, filePathConverter) { + switch (tag.name) { + case 'augments': + case 'extends': + case 'param': + case 'template': + { + const body = convertLinkTags(tag.text, filePathConverter).split(/^(\S+)\s*-?\s*/); + if (body?.length === 3) { + const param = body[1]; + const doc = body[2]; + const label = `*@${tag.name}* \`${param}\``; + if (!doc) { + return label; + } + return label + (doc.match(/\r\n|\n/g) ? ' \n' + processInlineTags(doc) : ` — ${processInlineTags(doc)}`); + } + } + } + const label = `*@${tag.name}*`; + const text = getTagBodyText(tag, filePathConverter); + if (!text) { + return label; + } + return label + (text.match(/\r\n|\n/g) ? ' \n' + text : ` — ${text}`); +} + +function plainWithLinks(parts, filePathConverter) { + return processInlineTags(convertLinkTags(parts, filePathConverter)); +} + +function convertLinkTags(parts, filePathConverter) { + if (!parts) { + return ''; + } + if (typeof parts === 'string') { + return parts; + } + const out = []; + let currentLink; + for (const part of parts) { + switch (part.kind) { + case 'link': + if (currentLink) { + if (currentLink.target) { + const link = filePathConverter.toResource(currentLink.target.file).with({ + fragment: `L${currentLink.target.start.line},${currentLink.target.start.offset}` + }); + const linkText = currentLink.text ? currentLink.text : escapeMarkdownSyntaxTokensForCode(currentLink.name ?? ''); + out.push(`[${currentLink.linkcode ? '`' + linkText + '`' : linkText}](${link.toString()})`); + } else { + const text = currentLink.text ?? currentLink.name; + if (text) { + if (/^https?:/.test(text)) { + const parts = text.split(' '); + if (parts.length === 1) { + out.push(parts[0]); + } else if (parts.length > 1) { + const linkText = escapeMarkdownSyntaxTokensForCode(parts.slice(1).join(' ')); + out.push(`[${currentLink.linkcode ? '`' + linkText + '`' : linkText}](${parts[0]})`); + } + } else { + out.push(escapeMarkdownSyntaxTokensForCode(text)); + } + } + } + currentLink = undefined; + } else { + currentLink = { + linkcode: part.text === '{@linkcode ' + }; + } + break; + + case 'linkName': + if (currentLink) { + currentLink.name = part.text; + currentLink.target = part.target; + } + break; + + case 'linkText': + if (currentLink) { + currentLink.text = part.text; + } + break; + + default: + out.push(part.text); + break; + } + } + return processInlineTags(out.join('')); +} + +function tagsMarkdownPreview(tags, filePathConverter) { + return tags.map((tag => getTagDocumentation(tag, filePathConverter))).join(' \n\n'); +} + +function markdownDocumentation(documentation, tags, filePathConverter) { + const out = new MarkdownString; + addMarkdownDocumentation(out, documentation, tags, filePathConverter); + return out.value ? out.toMarkupContent() : undefined; +} + +function addMarkdownDocumentation(out, documentation, tags, converter) { + if (documentation) { + out.appendMarkdown(plainWithLinks(documentation, converter)); + } + if (tags) { + const tagsPreview = tagsMarkdownPreview(tags, converter); + if (tagsPreview) { + out.appendMarkdown('\n\n' + tagsPreview); + } + } + return out; +} + +function escapeMarkdownSyntaxTokensForCode(text) { + return text.replace(/`/g, '\\$&'); +} + +class SnippetString { + static isSnippetString(thing) { + if (thing instanceof SnippetString) { + return true; + } + if (!thing) { + return false; + } + return typeof thing.value === 'string'; + } + static _escape(value) { + return value.replace(/\$|}|\\/g, '\\$&'); + } + constructor(value) { + this._tabstop = 1; + this.value = value || ''; + } + appendText(str) { + this.value += SnippetString._escape(str); + return this; + } + appendTabstop(n = this._tabstop++) { + this.value += '$'; + this.value += n; + return this; + } + appendPlaceholder(value, n = this._tabstop++) { + if (typeof value === 'function') { + const nested = new SnippetString; + nested._tabstop = this._tabstop; + value(nested); + this._tabstop = nested._tabstop; + value = nested.value; + } else { + value = SnippetString._escape(value); + } + this.value += '${'; + this.value += n; + this.value += ':'; + this.value += value; + this.value += '}'; + return this; + } + appendVariable(name, defaultValue) { + if (typeof defaultValue === 'function') { + const nested = new SnippetString; + nested._tabstop = this._tabstop; + defaultValue(nested); + this._tabstop = nested._tabstop; + defaultValue = nested.value; + } else if (typeof defaultValue === 'string') { + defaultValue = defaultValue.replace(/\$|}/g, '\\$&'); + } + this.value += '${'; + this.value += name; + if (defaultValue) { + this.value += ':'; + this.value += defaultValue; + } + this.value += '}'; + return this; + } +} + +class CompletionDataCache { + constructor() { + this.store = new Map; + this.lastCacheId = 0; + } + reset() { + this.lastCacheId = 0; + this.store.clear(); + } + add(data) { + const cacheId = ++this.lastCacheId; + this.store.set(cacheId, data); + return cacheId; + } + get(cacheId) { + return this.store.get(cacheId); + } +} + +function asCompletionItems(entries, completionDataCache, file, position, document, filePathConverter, options, features, completionContext) { + const completions = []; + for (const entry of entries) { + if (entry.kind === 'warning') { + continue; + } + const completion = asCompletionItem(entry, completionDataCache, file, position, document, filePathConverter, options, features, completionContext); + if (!completion) { + continue; + } + completions.push(completion); + } + return completions; +} + +function asCompletionItem(entry, completionDataCache, file, position, document, filePathConverter, options, features, completionContext) { + const cacheId = completionDataCache.add({ + file: file, + line: position.line + 1, + offset: position.character + 1, + entryNames: [ entry.source || entry.data ? { + name: entry.name, + source: entry.source, + data: entry.data + } : entry.name ] + }); + const item = { + label: entry.name, + kind: asCompletionItemKind(entry.kind), + sortText: entry.sortText, + preselect: entry.isRecommended, + data: { + cacheId: cacheId + } + }; + if (features.completionCommitCharactersSupport) { + item.commitCharacters = asCommitCharacters(entry.kind); + } + if (features.completionLabelDetails) { + item.labelDetails = entry.labelDetails; + } + if (entry.source && entry.hasAction) { + item.sortText = `￿${entry.sortText}`; + } + const {isSnippet: isSnippet, replacementSpan: replacementSpan, sourceDisplay: sourceDisplay} = entry; + if (isSnippet && !features.completionSnippets) { + return null; + } + if (features.completionSnippets && (isSnippet || canCreateSnippetOfFunctionCall(item.kind, options))) { + item.insertTextFormat = main$3.InsertTextFormat.Snippet; + } + if (sourceDisplay) { + item.detail = plainWithLinks(sourceDisplay, filePathConverter); + } + const {line: line, optionalReplacementRange: optionalReplacementRange, isMemberCompletion: isMemberCompletion, dotAccessorContext: dotAccessorContext} = completionContext; + let range = getRangeFromReplacementSpan(replacementSpan, optionalReplacementRange, position, document, features); + let {insertText: insertText} = entry; + if (!features.completionDisableFilterText) { + item.filterText = getFilterText(entry, optionalReplacementRange, line, insertText); + } + if (isMemberCompletion && dotAccessorContext && !entry.isSnippet) { + const newInsertText = dotAccessorContext.text + (insertText || item.label); + if (!features.completionDisableFilterText) { + item.filterText = newInsertText; + } + if (!range) { + if (features.completionInsertReplaceSupport && optionalReplacementRange) { + range = { + insert: dotAccessorContext.range, + replace: Range.union(dotAccessorContext.range, optionalReplacementRange) + }; + } else { + range = { + replace: dotAccessorContext.range + }; + } + insertText = newInsertText; + } + } + if (entry.kindModifiers) { + const kindModifiers = new Set(entry.kindModifiers.split(/,|\s+/g)); + if (kindModifiers.has(KindModifiers.optional)) { + if (!insertText) { + insertText = item.label; + } + if (!item.filterText) { + item.filterText = item.label; + } + item.label += '?'; + } + if (kindModifiers.has(KindModifiers.deprecated)) { + item.tags = [ main$3.CompletionItemTag.Deprecated ]; + } + if (entry.kind === ScriptElementKind.scriptElement) { + for (const extModifier of KindModifiers.fileExtensionKindModifiers) { + if (kindModifiers.has(extModifier)) { + if (entry.name.toLowerCase().endsWith(extModifier)) { + item.detail = entry.name; + } else { + item.detail = entry.name + extModifier; + } + break; + } + } + } + } + if (range) { + item.textEdit = range.insert ? main$3.InsertReplaceEdit.create(insertText || item.label, range.insert, range.replace) : main$3.TextEdit.replace(range.replace, insertText || item.label); + } else { + item.insertText = insertText; + } + return item; +} + +function getRangeFromReplacementSpan(replacementSpan, optionalReplacementRange, position, document, features) { + if (replacementSpan) { + return { + replace: ensureRangeIsOnSingleLine(Range.fromTextSpan(replacementSpan), document) + }; + } + if (features.completionInsertReplaceSupport && optionalReplacementRange) { + const range = ensureRangeIsOnSingleLine(optionalReplacementRange, document); + return { + insert: main$3.Range.create(range.start, position), + replace: range + }; + } +} + +function getFilterText(entry, wordRange, line, insertText) { + if (entry.name.startsWith('#')) { + const wordStart = wordRange ? line.charAt(wordRange.start.character) : undefined; + if (insertText) { + if (insertText.startsWith('this.#')) { + return wordStart === '#' ? insertText : insertText.replace(/&this\.#/, ''); + } else { + return wordStart; + } + } else { + return wordStart === '#' ? undefined : entry.name.replace(/^#/, ''); + } + } + if (insertText?.startsWith('this.')) { + return undefined; + } + if (insertText?.startsWith('[')) { + return insertText.replace(/^\[['"](.+)[['"]\]$/, '.$1'); + } + return insertText; +} + +function ensureRangeIsOnSingleLine(range, document) { + if (range.start.line !== range.end.line) { + return main$3.Range.create(range.start, document.getLineEnd(range.start.line)); + } + return range; +} + +function asCompletionItemKind(kind) { + switch (kind) { + case ScriptElementKind.primitiveType: + case ScriptElementKind.keyword: + return main$3.CompletionItemKind.Keyword; + + case ScriptElementKind.constElement: + case ScriptElementKind.letElement: + case ScriptElementKind.variableElement: + case ScriptElementKind.localVariableElement: + case ScriptElementKind.alias: + case ScriptElementKind.parameterElement: + return main$3.CompletionItemKind.Variable; + + case ScriptElementKind.memberVariableElement: + case ScriptElementKind.memberGetAccessorElement: + case ScriptElementKind.memberSetAccessorElement: + return main$3.CompletionItemKind.Field; + + case ScriptElementKind.functionElement: + case ScriptElementKind.localFunctionElement: + return main$3.CompletionItemKind.Function; + + case ScriptElementKind.memberFunctionElement: + case ScriptElementKind.constructSignatureElement: + case ScriptElementKind.callSignatureElement: + case ScriptElementKind.indexSignatureElement: + return main$3.CompletionItemKind.Method; + + case ScriptElementKind.enumElement: + return main$3.CompletionItemKind.Enum; + + case ScriptElementKind.enumMemberElement: + return main$3.CompletionItemKind.EnumMember; + + case ScriptElementKind.moduleElement: + case ScriptElementKind.externalModuleName: + return main$3.CompletionItemKind.Module; + + case ScriptElementKind.classElement: + case ScriptElementKind.typeElement: + return main$3.CompletionItemKind.Class; + + case ScriptElementKind.interfaceElement: + return main$3.CompletionItemKind.Interface; + + case ScriptElementKind.warning: + return main$3.CompletionItemKind.Text; + + case ScriptElementKind.scriptElement: + return main$3.CompletionItemKind.File; + + case ScriptElementKind.directory: + return main$3.CompletionItemKind.Folder; + + case ScriptElementKind.string: + return main$3.CompletionItemKind.Constant; + } + return main$3.CompletionItemKind.Property; +} + +function asCommitCharacters(kind) { + const commitCharacters = []; + switch (kind) { + case ScriptElementKind.memberGetAccessorElement: + case ScriptElementKind.memberSetAccessorElement: + case ScriptElementKind.constructSignatureElement: + case ScriptElementKind.callSignatureElement: + case ScriptElementKind.indexSignatureElement: + case ScriptElementKind.enumElement: + case ScriptElementKind.interfaceElement: + commitCharacters.push('.'); + break; + + case ScriptElementKind.moduleElement: + case ScriptElementKind.alias: + case ScriptElementKind.constElement: + case ScriptElementKind.letElement: + case ScriptElementKind.variableElement: + case ScriptElementKind.localVariableElement: + case ScriptElementKind.memberVariableElement: + case ScriptElementKind.classElement: + case ScriptElementKind.functionElement: + case ScriptElementKind.memberFunctionElement: + commitCharacters.push('.', ','); + commitCharacters.push('('); + break; + } + return commitCharacters.length === 0 ? undefined : commitCharacters; +} + +async function asResolvedCompletionItem(item, details, document, client, options, features) { + item.detail = asDetail(details, client); + const {documentation: documentation, tags: tags} = details; + item.documentation = markdownDocumentation(documentation, tags, client); + if (details.codeActions?.length) { + const {additionalTextEdits: additionalTextEdits, command: command} = getCodeActions(details.codeActions, document.filepath, client); + item.additionalTextEdits = additionalTextEdits; + item.command = command; + } + if (document && features.completionSnippets && canCreateSnippetOfFunctionCall(item.kind, options)) { + const {line: line, offset: offset} = item.data; + const position = Position.fromLocation({ + line: line, + offset: offset + }); + const shouldCompleteFunction = await isValidFunctionCompletionContext(position, client, document); + if (shouldCompleteFunction) { + createSnippetOfFunctionCall(item, details); + } + } + return item; +} + +async function isValidFunctionCompletionContext(position, client, document) { + try { + const args = Position.toFileLocationRequestArgs(document.filepath, position); + const response = await client.execute(CommandTypes.Quickinfo, args); + if (response.type === 'response' && response.body) { + switch (response.body.kind) { + case 'var': + case 'let': + case 'const': + case 'alias': + return false; + } + } + } catch {} + const after = document.getLine(position.line).slice(position.character); + return after.match(/^[a-z_$0-9]*\s*\(/gi) === null; +} + +function canCreateSnippetOfFunctionCall(kind, options) { + return options.completeFunctionCalls === true && (kind === main$3.CompletionItemKind.Function || kind === main$3.CompletionItemKind.Method); +} + +function createSnippetOfFunctionCall(item, detail) { + const {displayParts: displayParts} = detail; + const parameterListParts = getParameterListParts(displayParts); + const snippet = new SnippetString; + snippet.appendText(`${item.insertText || item.textEdit?.newText || item.label}(`); + appendJoinedPlaceholders(snippet, parameterListParts.parts, ', '); + if (parameterListParts.hasOptionalParameters) { + snippet.appendTabstop(); + } + snippet.appendText(')'); + snippet.appendTabstop(0); + item.insertText = snippet.value; + item.insertTextFormat = main$3.InsertTextFormat.Snippet; + if (item.textEdit) { + item.textEdit.newText = snippet.value; + } +} + +function getParameterListParts(displayParts) { + const parts = []; + let isInMethod = false; + let hasOptionalParameters = false; + let parenCount = 0; + let braceCount = 0; + outer: for (let i = 0; i < displayParts.length; ++i) { + const part = displayParts[i]; + switch (toSymbolDisplayPartKind(part.kind)) { + case SymbolDisplayPartKind.methodName: + case SymbolDisplayPartKind.functionName: + case SymbolDisplayPartKind.text: + case SymbolDisplayPartKind.propertyName: + if (parenCount === 0 && braceCount === 0) { + isInMethod = true; + } + break; + + case SymbolDisplayPartKind.parameterName: + if (parenCount === 1 && braceCount === 0 && isInMethod) { + const next = displayParts[i + 1]; + const nameIsFollowedByOptionalIndicator = next && next.text === '?'; + const nameIsThis = part.text === 'this'; + if (!nameIsFollowedByOptionalIndicator && !nameIsThis) { + parts.push(part); + } + hasOptionalParameters = hasOptionalParameters || nameIsFollowedByOptionalIndicator; + } + break; + + case SymbolDisplayPartKind.punctuation: + if (part.text === '(') { + ++parenCount; + } else if (part.text === ')') { + --parenCount; + if (parenCount <= 0 && isInMethod) { + break outer; + } + } else if (part.text === '...' && parenCount === 1) { + hasOptionalParameters = true; + break outer; + } else if (part.text === '{') { + ++braceCount; + } else if (part.text === '}') { + --braceCount; + } + break; + } + } + return { + hasOptionalParameters: hasOptionalParameters, + parts: parts + }; +} + +function appendJoinedPlaceholders(snippet, parts, joiner) { + for (let i = 0; i < parts.length; ++i) { + const paramterPart = parts[i]; + snippet.appendPlaceholder(paramterPart.text); + if (i !== parts.length - 1) { + snippet.appendText(joiner); + } + } +} + +function getCodeActions(codeActions, filepath, client) { + const additionalTextEdits = []; + let hasRemainingCommandsOrEdits = false; + for (const tsAction of codeActions) { + if (tsAction.commands) { + hasRemainingCommandsOrEdits = true; + } + if (tsAction.changes) { + for (const change of tsAction.changes) { + const tsFileName = client.toResource(change.fileName).fsPath; + if (tsFileName === filepath) { + additionalTextEdits.push(...change.textChanges.map(toTextEdit)); + } else { + hasRemainingCommandsOrEdits = true; + } + } + } + } + let command = undefined; + if (hasRemainingCommandsOrEdits) { + command = { + title: '', + command: Commands.APPLY_COMPLETION_CODE_ACTION, + arguments: [ filepath, codeActions.map((codeAction => ({ + commands: codeAction.commands, + description: codeAction.description, + changes: codeAction.changes.filter((x => x.fileName !== filepath)) + }))) ] + }; + } + return { + command: command, + additionalTextEdits: additionalTextEdits.length ? additionalTextEdits : undefined + }; +} + +function asDetail({displayParts: displayParts, sourceDisplay: sourceDisplay, source: deprecatedSource}, filePathConverter) { + const result = []; + const source = sourceDisplay || deprecatedSource; + if (source) { + result.push(`Auto import from '${plainWithLinks(source, filePathConverter)}'`); + } + const detail = plainWithLinks(displayParts, filePathConverter); + if (detail) { + result.push(detail); + } + return result.join('\n'); +} + +function getCompletionTriggerCharacter(character) { + switch (character) { + case '@': + case '#': + case ' ': + case '.': + case '"': + case '\'': + case '`': + case '/': + case '<': + return character; + + default: + return undefined; + } +} + +function asSignatureHelp(info, context, filePathConverter) { + const signatures = info.items.map((item => asSignatureInformation(item, filePathConverter))); + return { + activeSignature: getActiveSignature(info, signatures, context), + activeParameter: getActiveParameter(info), + signatures: signatures + }; +} + +function getActiveSignature(info, signatures, context) { + if (context?.activeSignatureHelp?.activeSignature !== undefined) { + const previouslyActiveSignature = context.activeSignatureHelp.signatures[context.activeSignatureHelp.activeSignature]; + if (previouslyActiveSignature && context.isRetrigger) { + const existingIndex = signatures.findIndex((other => other.label === previouslyActiveSignature.label)); + if (existingIndex !== -1) { + return existingIndex; + } + } + } + return info.selectedItemIndex; +} + +function getActiveParameter(info) { + const activeSignature = info.items[info.selectedItemIndex]; + if (activeSignature?.isVariadic) { + return Math.min(info.argumentIndex, activeSignature.parameters.length - 1); + } + return info.argumentIndex; +} + +function asSignatureInformation(item, filePathConverter) { + const parameters = item.parameters.map((parameter => asParameterInformation(parameter, filePathConverter))); + const signature = { + label: plainWithLinks(item.prefixDisplayParts, filePathConverter), + documentation: markdownDocumentation(item.documentation, item.tags.filter((x => x.name !== 'param')), filePathConverter), + parameters: parameters + }; + signature.label += parameters.map((parameter => parameter.label)).join(plainWithLinks(item.separatorDisplayParts, filePathConverter)); + signature.label += plainWithLinks(item.suffixDisplayParts, filePathConverter); + return signature; +} + +function asParameterInformation(parameter, filePathConverter) { + const {displayParts: displayParts, documentation: documentation} = parameter; + return { + label: plainWithLinks(displayParts, filePathConverter), + documentation: markdownDocumentation(documentation, undefined, filePathConverter) + }; +} + +function toTsTriggerReason(context) { + switch (context.triggerKind) { + case main$3.SignatureHelpTriggerKind.TriggerCharacter: + if (context.triggerCharacter) { + if (context.isRetrigger) { + return { + kind: 'retrigger', + triggerCharacter: context.triggerCharacter + }; + } else { + return { + kind: 'characterTyped', + triggerCharacter: context.triggerCharacter + }; + } + } else { + return { + kind: 'invoked' + }; + } + + case main$3.SignatureHelpTriggerKind.ContentChange: + return context.isRetrigger ? { + kind: 'retrigger' + } : { + kind: 'invoked' + }; + + case main$3.SignatureHelpTriggerKind.Invoked: + default: + return { + kind: 'invoked' + }; + } +} + +function provideQuickFix(response, client) { + if (!response?.body) { + return []; + } + return response.body.map((fix => main$3.CodeAction.create(fix.description, { + title: fix.description, + command: Commands.APPLY_WORKSPACE_EDIT, + arguments: [ { + documentChanges: fix.changes.map((c => toTextDocumentEdit(c, client))) + } ] + }, main$3.CodeActionKind.QuickFix))); +} + +function provideRefactors(response, args, features) { + if (!response?.body) { + return []; + } + const actions = []; + for (const info of response.body) { + if (info.inlineable === false) { + actions.push(asSelectRefactoring(info, args)); + } else { + const relevantActions = features.codeActionDisabledSupport ? info.actions : info.actions.filter((action => !action.notApplicableReason)); + for (const action of relevantActions) { + actions.push(asApplyRefactoring(action, info, args)); + } + } + } + return actions; +} + +function asSelectRefactoring(info, args) { + return main$3.CodeAction.create(info.description, main$3.Command.create(info.description, Commands.SELECT_REFACTORING, info, args), main$3.CodeActionKind.Refactor); +} + +function asApplyRefactoring(action, info, args) { + const codeAction = main$3.CodeAction.create(action.description, asKind(info)); + if (action.notApplicableReason) { + codeAction.disabled = { + reason: action.notApplicableReason + }; + } else { + codeAction.command = main$3.Command.create(action.description, Commands.APPLY_REFACTORING, { + ...args, + refactor: info.name, + action: action.name + }); + } + return codeAction; +} + +function asKind(refactor) { + if (refactor.name.startsWith('function_')) { + return `${main$3.CodeActionKind.RefactorExtract}.function`; + } else if (refactor.name.startsWith('constant_')) { + return `${main$3.CodeActionKind.RefactorExtract}.constant`; + } else if (refactor.name.startsWith('Move')) { + return `${main$3.CodeActionKind.Refactor}.move`; + } + return main$3.CodeActionKind.Refactor; +} + +class CodeActionKind { + constructor(value) { + this.value = value; + } + equals(other) { + return this.value === other.value; + } + contains(other) { + return this.equals(other) || this.value === '' || other.value.startsWith(this.value + CodeActionKind.sep); + } + intersects(other) { + return this.contains(other) || other.contains(this); + } + append(part) { + return new CodeActionKind(this.value + CodeActionKind.sep + part); + } +} + +CodeActionKind.sep = '.'; + +CodeActionKind.Empty = new CodeActionKind(main$3.CodeActionKind.Empty); + +CodeActionKind.QuickFix = new CodeActionKind(main$3.CodeActionKind.QuickFix); + +CodeActionKind.Refactor = new CodeActionKind(main$3.CodeActionKind.Refactor); + +CodeActionKind.Source = new CodeActionKind(main$3.CodeActionKind.Source); + +CodeActionKind.SourceAddMissingImportsTs = CodeActionKind.Source.append('addMissingImports').append('ts'); + +CodeActionKind.SourceFixAll = new CodeActionKind(main$3.CodeActionKind.SourceFixAll); + +CodeActionKind.SourceFixAllTs = CodeActionKind.SourceFixAll.append('ts'); + +CodeActionKind.SourceOrganizeImports = new CodeActionKind(main$3.CodeActionKind.SourceOrganizeImports); + +CodeActionKind.SourceOrganizeImportsTs = CodeActionKind.SourceOrganizeImports.append('ts'); + +CodeActionKind.SourceRemoveUnusedImportsTs = CodeActionKind.Source.append('removeUnusedImports').append('ts'); + +CodeActionKind.SourceRemoveUnusedTs = CodeActionKind.Source.append('removeUnused').append('ts'); + +CodeActionKind.SourceSortImportsTs = CodeActionKind.Source.append('sortImports').append('ts'); + +const organizeImportsCommand = { + title: 'Organize Imports', + kind: CodeActionKind.SourceOrganizeImportsTs, + mode: OrganizeImportsMode.All +}; + +const sortImportsCommand = { + minVersion: API.v430, + title: 'Sort Imports', + kind: CodeActionKind.SourceSortImportsTs, + mode: OrganizeImportsMode.SortAndCombine +}; + +const removeUnusedImportsCommand = { + minVersion: API.v490, + title: 'Remove Unused Imports', + kind: CodeActionKind.SourceRemoveUnusedImportsTs, + mode: OrganizeImportsMode.RemoveUnused +}; + +const organizeImportsCommands = [ organizeImportsCommand, sortImportsCommand, removeUnusedImportsCommand ]; + +function provideOrganizeImports(command, response, client) { + if (!response || response.body.length === 0) { + return []; + } + return [ main$3.CodeAction.create(command.title, { + documentChanges: response.body.map((edit => toTextDocumentEdit(edit, client))) + }, command.kind.value) ]; +} + +function collectDocumentSymbols(parent, symbols) { + return collectDocumentSymbolsInRange(parent, symbols, { + start: Range.fromTextSpan(parent.spans[0]).start, + end: Range.fromTextSpan(parent.spans[parent.spans.length - 1]).end + }); +} + +function collectDocumentSymbolsInRange(parent, symbols, range) { + let shouldInclude = shouldIncludeEntry(parent); + for (const span of parent.spans) { + const spanRange = Range.fromTextSpan(span); + if (!Range.intersection(range, spanRange)) { + continue; + } + const children = []; + if (parent.childItems) { + for (const child of parent.childItems) { + if (child.spans.some((childSpan => !!Range.intersection(spanRange, Range.fromTextSpan(childSpan))))) { + const includedChild = collectDocumentSymbolsInRange(child, children, spanRange); + shouldInclude = shouldInclude || includedChild; + } + } + } + let selectionRange = spanRange; + if (parent.nameSpan) { + const nameRange = Range.fromTextSpan(parent.nameSpan); + if (Range.intersection(spanRange, nameRange)) { + selectionRange = nameRange; + } + } + if (shouldInclude) { + symbols.push({ + name: parent.text, + detail: '', + kind: toSymbolKind(parent.kind), + range: spanRange, + selectionRange: selectionRange, + children: children + }); + } + } + return shouldInclude; +} + +function collectSymbolInformation(uri, current, symbols, containerName) { + let shouldInclude = shouldIncludeEntry(current); + const name = current.text; + for (const span of current.spans) { + const range = Range.fromTextSpan(span); + const children = []; + if (current.childItems) { + for (const child of current.childItems) { + if (child.spans.some((span => !!Range.intersection(range, Range.fromTextSpan(span))))) { + const includedChild = collectSymbolInformation(uri, child, children, name); + shouldInclude = shouldInclude || includedChild; + } + } + } + if (shouldInclude) { + symbols.push({ + name: name, + kind: toSymbolKind(current.kind), + location: { + uri: uri, + range: range + }, + containerName: containerName + }); + symbols.push(...children); + } + } + return shouldInclude; +} + +function shouldIncludeEntry(item) { + if (item.kind === ScriptElementKind.alias) { + return false; + } + return !!(item.text && item.text !== '' && item.text !== ''); +} + +function fromProtocolCallHierarchyItem(item, client, workspaceRoot) { + const useFileName = isSourceFileItem(item); + const name = useFileName ? path__default.basename(item.file) : item.name; + const detail = useFileName ? workspaceRoot ? path__default.relative(workspaceRoot, path__default.dirname(item.file)) : path__default.dirname(item.file) : item.containerName ?? ''; + const result = { + kind: fromProtocolScriptElementKind(item.kind), + name: name, + detail: detail, + uri: client.toResourceUri(item.file), + range: Range.fromTextSpan(item.span), + selectionRange: Range.fromTextSpan(item.selectionSpan) + }; + const kindModifiers = item.kindModifiers ? parseKindModifier(item.kindModifiers) : undefined; + if (kindModifiers?.has(ScriptElementKindModifier.deprecatedModifier)) { + result.tags = [ main$3.SymbolTag.Deprecated ]; + } + return result; +} + +function fromProtocolCallHierarchyIncomingCall(item, client, workspaceRoot) { + return { + from: fromProtocolCallHierarchyItem(item.from, client, workspaceRoot), + fromRanges: item.fromSpans.map(Range.fromTextSpan) + }; +} + +function fromProtocolCallHierarchyOutgoingCall(item, client, workspaceRoot) { + return { + to: fromProtocolCallHierarchyItem(item.to, client, workspaceRoot), + fromRanges: item.fromSpans.map(Range.fromTextSpan) + }; +} + +function isSourceFileItem(item) { + return item.kind === ScriptElementKind.scriptElement || item.kind === ScriptElementKind.moduleElement && item.selectionSpan.start.line === 1 && item.selectionSpan.start.offset === 1; +} + +function fromProtocolScriptElementKind(kind) { + switch (kind) { + case ScriptElementKind.moduleElement: + return main$3.SymbolKind.Module; + + case ScriptElementKind.classElement: + return main$3.SymbolKind.Class; + + case ScriptElementKind.enumElement: + return main$3.SymbolKind.Enum; + + case ScriptElementKind.enumMemberElement: + return main$3.SymbolKind.EnumMember; + + case ScriptElementKind.interfaceElement: + return main$3.SymbolKind.Interface; + + case ScriptElementKind.indexSignatureElement: + return main$3.SymbolKind.Method; + + case ScriptElementKind.callSignatureElement: + return main$3.SymbolKind.Method; + + case ScriptElementKind.memberFunctionElement: + return main$3.SymbolKind.Method; + + case ScriptElementKind.memberVariableElement: + return main$3.SymbolKind.Property; + + case ScriptElementKind.memberGetAccessorElement: + return main$3.SymbolKind.Property; + + case ScriptElementKind.memberSetAccessorElement: + return main$3.SymbolKind.Property; + + case ScriptElementKind.variableElement: + return main$3.SymbolKind.Variable; + + case ScriptElementKind.letElement: + return main$3.SymbolKind.Variable; + + case ScriptElementKind.constElement: + return main$3.SymbolKind.Variable; + + case ScriptElementKind.localVariableElement: + return main$3.SymbolKind.Variable; + + case ScriptElementKind.alias: + return main$3.SymbolKind.Variable; + + case ScriptElementKind.functionElement: + return main$3.SymbolKind.Function; + + case ScriptElementKind.localFunctionElement: + return main$3.SymbolKind.Function; + + case ScriptElementKind.constructSignatureElement: + return main$3.SymbolKind.Constructor; + + case ScriptElementKind.constructorImplementationElement: + return main$3.SymbolKind.Constructor; + + case ScriptElementKind.typeParameterElement: + return main$3.SymbolKind.TypeParameter; + + case ScriptElementKind.string: + return main$3.SymbolKind.String; + + default: + return main$3.SymbolKind.Variable; + } +} + +function parseKindModifier(kindModifiers) { + return new Set(kindModifiers.split(/,|\s+/g)); +} + +var isMergeableObject = function isMergeableObject(value) { + return isNonNullObject(value) && !isSpecial(value); +}; + +function isNonNullObject(value) { + return !!value && typeof value === 'object'; +} + +function isSpecial(value) { + var stringValue = Object.prototype.toString.call(value); + return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value); +} + +var canUseSymbol = typeof Symbol === 'function' && Symbol.for; + +var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 60103; + +function isReactElement(value) { + return value.$$typeof === REACT_ELEMENT_TYPE; +} + +function emptyTarget(val) { + return Array.isArray(val) ? [] : {}; +} + +function cloneUnlessOtherwiseSpecified(value, options) { + return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value; +} + +function defaultArrayMerge(target, source, options) { + return target.concat(source).map((function(element) { + return cloneUnlessOtherwiseSpecified(element, options); + })); +} + +function getMergeFunction(key, options) { + if (!options.customMerge) { + return deepmerge; + } + var customMerge = options.customMerge(key); + return typeof customMerge === 'function' ? customMerge : deepmerge; +} + +function getEnumerableOwnPropertySymbols(target) { + return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter((function(symbol) { + return Object.propertyIsEnumerable.call(target, symbol); + })) : []; +} + +function getKeys(target) { + return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); +} + +function propertyIsOnObject(object, property) { + try { + return property in object; + } catch (_) { + return false; + } +} + +function propertyIsUnsafe(target, key) { + return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); +} + +function mergeObject(target, source, options) { + var destination = {}; + if (options.isMergeableObject(target)) { + getKeys(target).forEach((function(key) { + destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); + })); + } + getKeys(source).forEach((function(key) { + if (propertyIsUnsafe(target, key)) { + return; + } + if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { + destination[key] = getMergeFunction(key, options)(target[key], source[key], options); + } else { + destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); + } + })); + return destination; +} + +function deepmerge(target, source, options) { + options = options || {}; + options.arrayMerge = options.arrayMerge || defaultArrayMerge; + options.isMergeableObject = options.isMergeableObject || isMergeableObject; + options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; + var sourceIsArray = Array.isArray(source); + var targetIsArray = Array.isArray(target); + var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; + if (!sourceAndTargetTypesMatch) { + return cloneUnlessOtherwiseSpecified(source, options); + } else if (sourceIsArray) { + return options.arrayMerge(target, source, options); + } else { + return mergeObject(target, source, options); + } +} + +deepmerge.all = function deepmergeAll(array, options) { + if (!Array.isArray(array)) { + throw new Error('first argument should be an array'); + } + return array.reduce((function(prev, next) { + return deepmerge(prev, next, options); + }), {}); +}; + +var deepmerge_1 = deepmerge; + +var cjs$1 = deepmerge_1; + +const deepmerge$1 = getDefaultExportFromCjs(cjs$1); + +function equals(one, other) { + if (one === other) { + return true; + } + if (one === null || one === undefined || other === null || other === undefined) { + return false; + } + if (typeof one !== typeof other) { + return false; + } + if (typeof one !== 'object') { + return false; + } + if (Array.isArray(one) !== Array.isArray(other)) { + return false; + } + if (Array.isArray(one)) { + return equals$1(one, other, equals); + } else { + const oneKeys = []; + for (const key in one) { + oneKeys.push(key); + } + oneKeys.sort(); + const otherKeys = []; + for (const key in other) { + otherKeys.push(key); + } + otherKeys.sort(); + if (!equals$1(oneKeys, otherKeys)) { + return false; + } + return oneKeys.every((key => equals(one[key], other[key]))); + } +} + +function getInferredProjectCompilerOptions(version, workspaceConfig) { + const projectConfig = { + module: ModuleKind.ESNext, + moduleResolution: ModuleResolutionKind.Node, + target: ScriptTarget.ES2022, + jsx: JsxEmit.React + }; + if (version.gte(API.v500)) { + projectConfig.allowImportingTsExtensions = true; + } + if (workspaceConfig.checkJs) { + projectConfig.checkJs = true; + projectConfig.allowJs = true; + } + if (workspaceConfig.experimentalDecorators) { + projectConfig.experimentalDecorators = true; + } + if (workspaceConfig.strictNullChecks) { + projectConfig.strictNullChecks = true; + } + if (workspaceConfig.strictFunctionTypes) { + projectConfig.strictFunctionTypes = true; + } + if (workspaceConfig.module) { + projectConfig.module = workspaceConfig.module; + } + if (workspaceConfig.target) { + projectConfig.target = workspaceConfig.target; + } + projectConfig.sourceMap = true; + return projectConfig; +} + +const DEFAULT_TSSERVER_PREFERENCES = { + allowIncompleteCompletions: true, + allowRenameOfImportPath: true, + allowTextChangesInNewFiles: true, + autoImportFileExcludePatterns: [], + disableLineTextInReferences: true, + disableSuggestions: false, + displayPartsForJSDoc: true, + excludeLibrarySymbolsInNavTo: true, + generateReturnInDocTemplate: true, + importModuleSpecifierEnding: 'auto', + importModuleSpecifierPreference: 'shortest', + includeAutomaticOptionalChainCompletions: true, + includeCompletionsForImportStatements: true, + includeCompletionsForModuleExports: true, + includeCompletionsWithClassMemberSnippets: true, + includeCompletionsWithInsertText: true, + includeCompletionsWithObjectLiteralMethodSnippets: true, + includeCompletionsWithSnippetText: true, + includeInlayEnumMemberValueHints: false, + includeInlayFunctionLikeReturnTypeHints: false, + includeInlayFunctionParameterTypeHints: false, + includeInlayParameterNameHints: 'none', + includeInlayParameterNameHintsWhenArgumentMatchesName: false, + includeInlayPropertyDeclarationTypeHints: false, + includeInlayVariableTypeHints: false, + includeInlayVariableTypeHintsWhenTypeMatchesName: false, + includePackageJsonAutoImports: 'auto', + interactiveInlayHints: true, + jsxAttributeCompletionStyle: 'auto', + lazyConfiguredProjectsFromExternalProject: false, + organizeImportsAccentCollation: true, + organizeImportsCaseFirst: false, + organizeImportsCollation: 'ordinal', + organizeImportsCollationLocale: 'en', + organizeImportsIgnoreCase: 'auto', + organizeImportsNumericCollation: false, + providePrefixAndSuffixTextForRename: true, + provideRefactorNotApplicableReason: true, + quotePreference: 'auto', + useLabelDetailsInCompletionEntries: true +}; + +const DEFAULT_IMPLICIT_PROJECT_CONFIGURATION = { + checkJs: false, + experimentalDecorators: false, + module: ModuleKind.ESNext, + strictFunctionTypes: true, + strictNullChecks: true, + target: ScriptTarget.ES2020 +}; + +const DEFAULT_WORKSPACE_CONFIGURATION = { + implicitProjectConfiguration: DEFAULT_IMPLICIT_PROJECT_CONFIGURATION +}; + +function areFileConfigurationsEqual(a, b) { + return equals(a, b); +} + +class FileConfigurationManager { + constructor(client, onCaseInsensitiveFileSystem) { + this.client = client; + this.tsPreferences = deepmerge$1({}, DEFAULT_TSSERVER_PREFERENCES); + this.workspaceConfiguration = deepmerge$1({}, DEFAULT_WORKSPACE_CONFIGURATION); + this.formatOptions = new ResourceMap(undefined, { + onCaseInsensitiveFileSystem: onCaseInsensitiveFileSystem + }); + } + onDidCloseTextDocument(documentUri) { + this.formatOptions.delete(documentUri); + } + mergeTsPreferences(preferences) { + this.tsPreferences = deepmerge$1(this.tsPreferences, preferences); + } + setWorkspaceConfiguration(configuration) { + this.workspaceConfiguration = deepmerge$1(DEFAULT_WORKSPACE_CONFIGURATION, configuration); + this.setCompilerOptionsForInferredProjects(); + } + setGlobalConfiguration(workspaceFolder, hostInfo) { + const formatOptions = { + newLineCharacter: '\n' + }; + this.client.executeWithoutWaitingForResponse(CommandTypes.Configure, { + ...hostInfo ? { + hostInfo: hostInfo + } : {}, + formatOptions: formatOptions, + preferences: { + ...this.tsPreferences, + autoImportFileExcludePatterns: this.getAutoImportFileExcludePatternsPreference(workspaceFolder) + } + }); + this.setCompilerOptionsForInferredProjects(); + } + setCompilerOptionsForInferredProjects() { + this.client.executeWithoutWaitingForResponse(CommandTypes.CompilerOptionsForInferredProjects, { + options: { + ...getInferredProjectCompilerOptions(this.client.apiVersion, this.workspaceConfiguration.implicitProjectConfiguration), + allowJs: true, + allowNonTsExtensions: true, + allowSyntheticDefaultImports: true, + resolveJsonModule: true + } + }); + } + async ensureConfigurationForDocument(document, token) { + return this.ensureConfigurationOptions(document, undefined, token); + } + async ensureConfigurationOptions(document, options, token) { + const currentOptions = this.getFileOptions(document, options); + const cachedOptions = this.formatOptions.get(document.uri); + if (cachedOptions) { + const cachedOptionsValue = await cachedOptions; + if (token?.isCancellationRequested) { + return; + } + if (cachedOptionsValue && areFileConfigurationsEqual(cachedOptionsValue, currentOptions)) { + return; + } + } + const task = (async () => { + try { + const response = await this.client.execute(CommandTypes.Configure, { + file: document.filepath, + ...currentOptions + }, token); + return response.type === 'response' ? currentOptions : undefined; + } catch { + return undefined; + } + })(); + this.formatOptions.set(document.uri, task); + await task; + } + async setGlobalConfigurationFromDocument(document, token) { + const args = { + file: undefined, + ...this.getFileOptions(document) + }; + await this.client.execute(CommandTypes.Configure, args, token); + } + reset() { + this.formatOptions.clear(); + } + getFileOptions(document, options) { + return { + formatOptions: this.getFormatOptions(document, options), + preferences: this.getPreferences(document) + }; + } + getFormatOptions(document, formattingOptions) { + const workspacePreferences = this.getWorkspacePreferencesForFile(document); + const opts = { + ...workspacePreferences?.format, + ...formattingOptions + }; + if (opts.convertTabsToSpaces === undefined) { + opts.convertTabsToSpaces = formattingOptions?.insertSpaces; + } + if (opts.indentSize === undefined) { + opts.indentSize = formattingOptions?.tabSize; + } + if (opts.newLineCharacter === undefined) { + opts.newLineCharacter = '\n'; + } + return opts; + } + getWorkspacePreferencesForFile(document) { + return this.workspaceConfiguration[isTypeScriptDocument(document) ? 'typescript' : 'javascript'] || {}; + } + getPreferences(document) { + const workspacePreferences = this.getWorkspacePreferencesForFile(document); + const preferences = Object.assign({}, this.tsPreferences, workspacePreferences?.inlayHints || {}); + return { + ...preferences, + quotePreference: this.getQuoteStylePreference(preferences) + }; + } + getQuoteStylePreference(preferences) { + switch (preferences.quotePreference) { + case 'single': + return 'single'; + + case 'double': + return 'double'; + + default: + return this.client.apiVersion.gte(API.v333) ? 'auto' : undefined; + } + } + getAutoImportFileExcludePatternsPreference(workspaceFolder) { + if (!workspaceFolder || this.tsPreferences.autoImportFileExcludePatterns.length === 0) { + return; + } + return this.tsPreferences.autoImportFileExcludePatterns.map((p => { + const slashNormalized = p.replace(/\\/g, '/'); + const isRelative = /^\.\.?($|\/)/.test(slashNormalized); + return path__default.posix.isAbsolute(p) ? p : p.startsWith('*') ? `/${slashNormalized}` : isRelative ? path__default.posix.join(workspaceFolder, p) : `/**/${slashNormalized}`; + })); + } +} + +const variableDeclaredButNeverUsed = new Set([ 6196, 6133 ]); + +const unreachableCode$1 = new Set([ 7027 ]); + +const incorrectlyImplementsInterface = new Set([ 2420 ]); + +const cannotFindName = new Set([ 2552, 2304 ]); + +const asyncOnlyAllowedInAsyncFunctions = new Set([ 1308 ]); + +const awaitInSyncFunction = 'fixAwaitInSyncFunction'; + +const classIncorrectlyImplementsInterface = 'fixClassIncorrectlyImplementsInterface'; + +const unreachableCode = 'fixUnreachableCode'; + +const unusedIdentifier = 'unusedIdentifier'; + +const fixImport = 'import'; + +async function buildIndividualFixes(fixes, client, file, diagnostics) { + const edits = []; + for (const diagnostic of diagnostics) { + for (const {codes: codes, fixName: fixName} of fixes) { + if (!codes.has(diagnostic.code)) { + continue; + } + const args = { + ...Range.toFileRangeRequestArgs(file, diagnostic.range), + errorCodes: [ +diagnostic.code ] + }; + const response = await client.execute(CommandTypes.GetCodeFixes, args); + if (response.type !== 'response') { + continue; + } + const fix = response.body?.find((fix => fix.fixName === fixName)); + if (fix) { + edits.push(...fix.changes.map((change => toTextDocumentEdit(change, client)))); + break; + } + } + } + return edits; +} + +async function buildCombinedFix(fixes, client, file, diagnostics) { + const edits = []; + for (const diagnostic of diagnostics) { + for (const {codes: codes, fixName: fixName} of fixes) { + if (!codes.has(diagnostic.code)) { + continue; + } + const args = { + ...Range.toFileRangeRequestArgs(file, diagnostic.range), + errorCodes: [ +diagnostic.code ] + }; + const response = await client.execute(CommandTypes.GetCodeFixes, args); + if (response.type !== 'response' || !response.body?.length) { + continue; + } + const fix = response.body?.find((fix => fix.fixName === fixName)); + if (!fix) { + continue; + } + if (!fix.fixId) { + edits.push(...fix.changes.map((change => toTextDocumentEdit(change, client)))); + return edits; + } + const combinedArgs = { + scope: { + type: 'file', + args: { + file: file + } + }, + fixId: fix.fixId + }; + const combinedResponse = await client.execute(CommandTypes.GetCombinedCodeFix, combinedArgs); + if (combinedResponse.type !== 'response' || !combinedResponse.body) { + return edits; + } + edits.push(...combinedResponse.body.changes.map((change => toTextDocumentEdit(change, client)))); + return edits; + } + } + return edits; +} + +class SourceAction {} + +class SourceFixAll extends SourceAction { + constructor() { + super(...arguments); + this.title = 'Fix all'; + } + async build(client, file, diagnostics) { + const edits = []; + edits.push(...await buildIndividualFixes([ { + codes: incorrectlyImplementsInterface, + fixName: classIncorrectlyImplementsInterface + }, { + codes: asyncOnlyAllowedInAsyncFunctions, + fixName: awaitInSyncFunction + } ], client, file, diagnostics)); + edits.push(...await buildCombinedFix([ { + codes: unreachableCode$1, + fixName: unreachableCode + } ], client, file, diagnostics)); + if (!edits.length) { + return null; + } + return main$3.CodeAction.create(this.title, { + documentChanges: edits + }, SourceFixAll.kind.value); + } +} + +SourceFixAll.kind = CodeActionKind.SourceFixAllTs; + +class SourceRemoveUnused extends SourceAction { + constructor() { + super(...arguments); + this.title = 'Remove all unused code'; + } + async build(client, file, diagnostics) { + const edits = await buildCombinedFix([ { + codes: variableDeclaredButNeverUsed, + fixName: unusedIdentifier + } ], client, file, diagnostics); + if (!edits.length) { + return null; + } + return main$3.CodeAction.create(this.title, { + documentChanges: edits + }, SourceRemoveUnused.kind.value); + } +} + +SourceRemoveUnused.kind = CodeActionKind.SourceRemoveUnusedTs; + +class SourceAddMissingImports extends SourceAction { + constructor() { + super(...arguments); + this.title = 'Add all missing imports'; + } + async build(client, file, diagnostics) { + const edits = await buildCombinedFix([ { + codes: cannotFindName, + fixName: fixImport + } ], client, file, diagnostics); + if (!edits.length) { + return null; + } + return main$3.CodeAction.create(this.title, { + documentChanges: edits + }, SourceAddMissingImports.kind.value); + } +} + +SourceAddMissingImports.kind = CodeActionKind.SourceAddMissingImportsTs; + +class TypeScriptAutoFixProvider { + static get kinds() { + return TypeScriptAutoFixProvider.kindProviders.map((provider => provider.kind)); + } + constructor(client) { + this.client = client; + } + async provideCodeActions(kinds, file, diagnostics) { + const results = []; + for (const provider of TypeScriptAutoFixProvider.kindProviders) { + if (kinds.some((kind => kind.contains(provider.kind)))) { + results.push((new provider).build(this.client, file, diagnostics)); + } + } + return (await Promise.all(results)).flatMap((result => result || [])); + } +} + +TypeScriptAutoFixProvider.kindProviders = [ SourceFixAll, SourceRemoveUnused, SourceAddMissingImports ]; + +function escapeRegExp(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +} + +var CodeLensType; + +(function(CodeLensType) { + CodeLensType[CodeLensType['Reference'] = 0] = 'Reference'; + CodeLensType[CodeLensType['Implementation'] = 1] = 'Implementation'; +})(CodeLensType || (CodeLensType = {})); + +class TypeScriptBaseCodeLensProvider { + constructor(client, cachedResponse, fileConfigurationManager) { + this.client = client; + this.cachedResponse = cachedResponse; + this.fileConfigurationManager = fileConfigurationManager; + } + async provideCodeLenses(document, token) { + const configuration = this.fileConfigurationManager.getWorkspacePreferencesForFile(document); + if (this.type === CodeLensType.Implementation && !configuration.implementationsCodeLens?.enabled || this.type === CodeLensType.Reference && !configuration.referencesCodeLens?.enabled) { + return []; + } + const response = await this.cachedResponse.execute(document, (() => this.client.execute(CommandTypes.NavTree, { + file: document.filepath + }, token))); + if (response.type !== 'response') { + return []; + } + const referenceableSpans = []; + response.body?.childItems?.forEach((item => this.walkNavTree(document, item, undefined, referenceableSpans))); + return referenceableSpans.map((span => main$2.CodeLens.create(span, { + uri: document.uri.toString(), + type: this.type + }))); + } + walkNavTree(document, item, parent, results) { + const range = this.extractSymbol(document, item, parent); + if (range) { + results.push(range); + } + item.childItems?.forEach((child => this.walkNavTree(document, child, item, results))); + } +} + +TypeScriptBaseCodeLensProvider.cancelledCommand = { + title: '', + command: '' +}; + +TypeScriptBaseCodeLensProvider.errorCommand = { + title: 'Could not determine references', + command: '' +}; + +function getSymbolRange(document, item) { + if (item.nameSpan) { + return Range.fromTextSpan(item.nameSpan); + } + const span = item.spans?.[0]; + if (!span) { + return undefined; + } + const range = Range.fromTextSpan(span); + const text = document.getText(range); + const identifierMatch = new RegExp(`^(.*?(\\b|\\W))${escapeRegExp(item.text || '')}(\\b|\\W)`, 'gm'); + const match = identifierMatch.exec(text); + const prefixLength = match ? match.index + match[1].length : 0; + const startOffset = document.offsetAt(range.start) + prefixLength; + return main$2.Range.create(document.positionAt(startOffset), document.positionAt(startOffset + item.text.length)); +} + +class TypeScriptImplementationsCodeLensProvider extends TypeScriptBaseCodeLensProvider { + get type() { + return CodeLensType.Implementation; + } + async resolveCodeLens(codeLens, token) { + const document = this.client.toOpenDocument(codeLens.data.uri); + if (!document) { + return codeLens; + } + if (!this.fileConfigurationManager.getWorkspacePreferencesForFile(document).implementationsCodeLens?.enabled) { + return codeLens; + } + const args = Position.toFileLocationRequestArgs(document.filepath, codeLens.range.start); + const response = await this.client.execute(CommandTypes.Implementation, args, token, { + lowPriority: true, + executionTarget: ExecutionTarget.Semantic, + cancelOnResourceChange: codeLens.data.uri + }); + if (response.type !== 'response' || !response.body) { + codeLens.command = response.type === 'cancelled' ? TypeScriptBaseCodeLensProvider.cancelledCommand : TypeScriptBaseCodeLensProvider.errorCommand; + return codeLens; + } + const locations = response.body.map((reference => main$2.Location.create(this.client.toResourceUri(reference.file), reference.start.line === reference.end.line ? Range.fromTextSpan(reference) : main$2.Range.create(Position.fromLocation(reference.start), main$2.Position.create(reference.start.line, 0))))).filter((location => !(location.uri.toString() === codeLens.data.uri && location.range.start.line === codeLens.range.start.line && location.range.start.character === codeLens.range.start.character))); + codeLens.command = this.getCommand(locations, codeLens); + return codeLens; + } + getCommand(locations, codeLens) { + return { + title: this.getTitle(locations), + command: locations.length ? 'editor.action.showReferences' : '', + arguments: [ codeLens.data.uri, codeLens.range.start, locations ] + }; + } + getTitle(locations) { + return locations.length === 1 ? '1 implementation' : `${locations.length} implementations`; + } + extractSymbol(document, item, _parent) { + switch (item.kind) { + case ScriptElementKind.interfaceElement: + return getSymbolRange(document, item); + + case ScriptElementKind.classElement: + case ScriptElementKind.memberFunctionElement: + case ScriptElementKind.memberVariableElement: + case ScriptElementKind.memberGetAccessorElement: + case ScriptElementKind.memberSetAccessorElement: + if (item.kindModifiers.match(/\babstract\b/g)) { + return getSymbolRange(document, item); + } + break; + } + return undefined; + } +} + +class TypeScriptReferencesCodeLensProvider extends TypeScriptBaseCodeLensProvider { + get type() { + return CodeLensType.Reference; + } + async resolveCodeLens(codeLens, token) { + const document = this.client.toOpenDocument(codeLens.data.uri); + if (!document) { + return codeLens; + } + if (!this.fileConfigurationManager.getWorkspacePreferencesForFile(document).referencesCodeLens?.enabled) { + return codeLens; + } + const args = Position.toFileLocationRequestArgs(document.filepath, codeLens.range.start); + const response = await this.client.execute(CommandTypes.References, args, token, { + lowPriority: true, + executionTarget: ExecutionTarget.Semantic, + cancelOnResourceChange: codeLens.data.uri + }); + if (response.type !== 'response' || !response.body) { + codeLens.command = response.type === 'cancelled' ? TypeScriptBaseCodeLensProvider.cancelledCommand : TypeScriptBaseCodeLensProvider.errorCommand; + return codeLens; + } + const locations = response.body.refs.filter((reference => !reference.isDefinition)).map((reference => Location.fromTextSpan(this.client.toResourceUri(reference.file), reference))); + codeLens.command = { + title: this.getCodeLensLabel(locations), + command: locations.length ? 'editor.action.showReferences' : '', + arguments: [ codeLens.data.uri, codeLens.range.start, locations ] + }; + return codeLens; + } + getCodeLensLabel(locations) { + return locations.length === 1 ? '1 reference' : `${locations.length} references`; + } + extractSymbol(document, item, parent) { + if (parent && parent.kind === ScriptElementKind.enumElement) { + return getSymbolRange(document, item); + } + switch (item.kind) { + case ScriptElementKind.functionElement: + { + const showOnAllFunctions = this.fileConfigurationManager.getWorkspacePreferencesForFile(document).referencesCodeLens?.showOnAllFunctions; + if (showOnAllFunctions) { + return getSymbolRange(document, item); + } + } + + case ScriptElementKind.constElement: + case ScriptElementKind.letElement: + case ScriptElementKind.variableElement: + if (/\bexport\b/.test(item.kindModifiers)) { + return getSymbolRange(document, item); + } + break; + + case ScriptElementKind.classElement: + if (item.text === '') { + break; + } + return getSymbolRange(document, item); + + case ScriptElementKind.interfaceElement: + case ScriptElementKind.typeElement: + case ScriptElementKind.enumElement: + return getSymbolRange(document, item); + + case ScriptElementKind.memberFunctionElement: + case ScriptElementKind.memberGetAccessorElement: + case ScriptElementKind.memberSetAccessorElement: + case ScriptElementKind.constructorImplementationElement: + case ScriptElementKind.memberVariableElement: + if (parent && Position.isEqual(Position.fromLocation(parent.spans[0].start), Position.fromLocation(item.spans[0].start))) { + return undefined; + } + switch (parent?.kind) { + case ScriptElementKind.classElement: + case ScriptElementKind.interfaceElement: + case ScriptElementKind.typeElement: + return getSymbolRange(document, item); + } + break; + } + return undefined; + } +} + +class TypeScriptInlayHintsProvider { + static async provideInlayHints(textDocument, range, client, lspClient, fileConfigurationManager, token) { + if (client.apiVersion.lt(TypeScriptInlayHintsProvider.minVersion)) { + lspClient.showErrorMessage('Inlay Hints request failed. Requires TypeScript 4.4+.'); + return []; + } + const document = client.toOpenDocument(textDocument.uri); + if (!document) { + lspClient.showErrorMessage('Inlay Hints request failed. File not opened in the editor.'); + return []; + } + if (!areInlayHintsEnabledForFile(fileConfigurationManager, document)) { + return []; + } + await fileConfigurationManager.ensureConfigurationForDocument(document, token); + if (token?.isCancellationRequested) { + return []; + } + const start = document.offsetAt(range.start); + const length = document.offsetAt(range.end) - start; + const response = await client.execute(CommandTypes.ProvideInlayHints, { + file: document.filepath, + start: start, + length: length + }, token); + if (response.type !== 'response' || !response.success || !response.body) { + return []; + } + return response.body.map((hint => { + const inlayHint = main$3.InlayHint.create(Position.fromLocation(hint.position), TypeScriptInlayHintsProvider.convertInlayHintText(hint, client), fromProtocolInlayHintKind(hint.kind)); + hint.whitespaceBefore && (inlayHint.paddingLeft = true); + hint.whitespaceAfter && (inlayHint.paddingRight = true); + return inlayHint; + })); + } + static convertInlayHintText(tsHint, filePathConverter) { + if (tsHint.displayParts) { + return tsHint.displayParts.map((part => { + const out = main$3.InlayHintLabelPart.create(part.text); + if (part.span) { + out.location = Location.fromTextSpan(filePathConverter.toResource(part.span.file).toString(), part.span); + } + return out; + })); + } + return tsHint.text; + } +} + +TypeScriptInlayHintsProvider.minVersion = API.v440; + +function areInlayHintsEnabledForFile(fileConfigurationManager, document) { + const preferences = fileConfigurationManager.getPreferences(document); + return preferences.includeInlayParameterNameHints === 'literals' || preferences.includeInlayParameterNameHints === 'all' || preferences.includeInlayEnumMemberValueHints || preferences.includeInlayFunctionLikeReturnTypeHints || preferences.includeInlayFunctionParameterTypeHints || preferences.includeInlayPropertyDeclarationTypeHints || preferences.includeInlayVariableTypeHints; +} + +function fromProtocolInlayHintKind(kind) { + switch (kind) { + case 'Parameter': + return main$3.InlayHintKind.Parameter; + + case 'Type': + return main$3.InlayHintKind.Type; + + case 'Enum': + return undefined; + + default: + return undefined; + } +} + +var TokenEncodingConsts; + +(function(TokenEncodingConsts) { + TokenEncodingConsts[TokenEncodingConsts['typeOffset'] = 8] = 'typeOffset'; + TokenEncodingConsts[TokenEncodingConsts['modifierMask'] = 255] = 'modifierMask'; +})(TokenEncodingConsts || (TokenEncodingConsts = {})); + +function transformSpans(doc, spans) { + const lspSpans = []; + let previousLine = 0; + let previousTokenStart = 0; + for (let i = 0; i < spans.length; i += 3) { + const tokenStart = spans[i]; + const tokenLength = spans[i + 1]; + const tokenTypeBitSet = spans[i + 2]; + const tokenModifier = tokenTypeBitSet & TokenEncodingConsts.modifierMask; + const tokenType = (tokenTypeBitSet >> TokenEncodingConsts.typeOffset) - 1; + const {line: line, character: character} = doc.positionAt(tokenStart); + const deltaLine = line - previousLine; + const deltaStart = previousLine === line ? character - previousTokenStart : character; + lspSpans.push(deltaLine, deltaStart, tokenLength, tokenType, tokenModifier); + previousTokenStart = character; + previousLine = line; + } + return lspSpans; +} + +class CachedResponse { + constructor() { + this.version = -1; + this.document = ''; + } + execute(document, resolve) { + if (this.response && this.matches(document)) { + return this.response = this.response.then((result => result.type === 'cancelled' ? resolve() : result)); + } + return this.reset(document, resolve); + } + onDocumentClose(document) { + if (this.document === document.uri.toString()) { + this.response = undefined; + this.version = -1; + this.document = ''; + } + } + matches(document) { + return this.version === document.version && this.document === document.uri.toString(); + } + async reset(document, resolve) { + this.version = document.version; + this.document = document.uri.toString(); + return this.response = resolve(); + } +} + +class LogDirectoryProvider { + constructor(rootPath) { + this.rootPath = rootPath; + } + getNewLogDirectory() { + const root = this.logDirectory(); + if (root) { + try { + return fs$l.mkdtempSync(path__default.join(root, 'tsserver-log-')); + } catch (e) { + return undefined; + } + } + return undefined; + } + logDirectory() { + if (!this.rootPath) { + return undefined; + } + try { + if (!fs$l.existsSync(this.rootPath)) { + fs$l.mkdirSync(this.rootPath); + } + return this.rootPath; + } catch { + return undefined; + } + } +} + +var cjs = {}; + +var posix$1 = {}; + +Object.defineProperty(posix$1, '__esModule', { + value: true +}); + +posix$1.sync = posix$1.isexe = void 0; + +const fs_1$1 = require$$0$1; + +const promises_1$1 = require$$1$2; + +const isexe$2 = async (path, options = {}) => { + const {ignoreErrors: ignoreErrors = false} = options; + try { + return checkStat$1(await (0, promises_1$1.stat)(path), options); + } catch (e) { + const er = e; + if (ignoreErrors || er.code === 'EACCES') return false; + throw er; + } +}; + +posix$1.isexe = isexe$2; + +const sync$1 = (path, options = {}) => { + const {ignoreErrors: ignoreErrors = false} = options; + try { + return checkStat$1((0, fs_1$1.statSync)(path), options); + } catch (e) { + const er = e; + if (ignoreErrors || er.code === 'EACCES') return false; + throw er; + } +}; + +posix$1.sync = sync$1; + +const checkStat$1 = (stat, options) => stat.isFile() && checkMode(stat, options); + +const checkMode = (stat, options) => { + const myUid = options.uid ?? process.getuid?.(); + const myGroups = options.groups ?? process.getgroups?.() ?? []; + const myGid = options.gid ?? process.getgid?.() ?? myGroups[0]; + if (myUid === undefined || myGid === undefined) { + throw new Error('cannot get uid or gid'); + } + const groups = new Set([ myGid, ...myGroups ]); + const mod = stat.mode; + const uid = stat.uid; + const gid = stat.gid; + const u = parseInt('100', 8); + const g = parseInt('010', 8); + const o = parseInt('001', 8); + const ug = u | g; + return !!(mod & o || mod & g && groups.has(gid) || mod & u && uid === myUid || mod & ug && myUid === 0); +}; + +var win32 = {}; + +Object.defineProperty(win32, '__esModule', { + value: true +}); + +win32.sync = win32.isexe = void 0; + +const fs_1 = require$$0$1; + +const promises_1 = require$$1$2; + +const isexe$1 = async (path, options = {}) => { + const {ignoreErrors: ignoreErrors = false} = options; + try { + return checkStat(await (0, promises_1.stat)(path), path, options); + } catch (e) { + const er = e; + if (ignoreErrors || er.code === 'EACCES') return false; + throw er; + } +}; + +win32.isexe = isexe$1; + +const sync = (path, options = {}) => { + const {ignoreErrors: ignoreErrors = false} = options; + try { + return checkStat((0, fs_1.statSync)(path), path, options); + } catch (e) { + const er = e; + if (ignoreErrors || er.code === 'EACCES') return false; + throw er; + } +}; + +win32.sync = sync; + +const checkPathExt = (path, options) => { + const {pathExt: pathExt = process.env.PATHEXT || ''} = options; + const peSplit = pathExt.split(';'); + if (peSplit.indexOf('') !== -1) { + return true; + } + for (let i = 0; i < peSplit.length; i++) { + const p = peSplit[i].toLowerCase(); + const ext = path.substring(path.length - p.length).toLowerCase(); + if (p && ext === p) { + return true; + } + } + return false; +}; + +const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options); + +var options$1 = {}; + +Object.defineProperty(options$1, '__esModule', { + value: true +}); + +(function(exports) { + var __createBinding = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function() { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = commonjsGlobal && commonjsGlobal.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, 'default', { + enumerable: true, + value: v + }); + } : function(o, v) { + o['default'] = v; + }); + var __importStar = commonjsGlobal && commonjsGlobal.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + var __exportStar = commonjsGlobal && commonjsGlobal.__exportStar || function(m, exports) { + for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); + }; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.sync = exports.isexe = exports.posix = exports.win32 = void 0; + const posix = __importStar(posix$1); + exports.posix = posix; + const win32$1 = __importStar(win32); + exports.win32 = win32$1; + __exportStar(options$1, exports); + const platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform; + const impl = platform === 'win32' ? win32$1 : posix; + exports.isexe = impl.isexe; + exports.sync = impl.sync; +})(cjs); + +const {isexe: isexe, sync: isexeSync} = cjs; + +const {join: join, delimiter: delimiter, sep: sep, posix: posix} = require$$1$1; + +const isWindows = process.platform === 'win32'; + +const rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? '' : sep}]`.replace(/(\\)/g, '\\$1')); + +const rRel = new RegExp(`^\\.${rSlash.source}`); + +const getNotFoundError = cmd => Object.assign(new Error(`not found: ${cmd}`), { + code: 'ENOENT' +}); + +const getPathInfo = (cmd, {path: optPath = process.env.PATH, pathExt: optPathExt = process.env.PATHEXT, delimiter: optDelimiter = delimiter}) => { + const pathEnv = cmd.match(rSlash) ? [ '' ] : [ ...isWindows ? [ process.cwd() ] : [], ...(optPath || '').split(optDelimiter) ]; + if (isWindows) { + const pathExtExe = optPathExt || [ '.EXE', '.CMD', '.BAT', '.COM' ].join(optDelimiter); + const pathExt = pathExtExe.split(optDelimiter).flatMap((item => [ item, item.toLowerCase() ])); + if (cmd.includes('.') && pathExt[0] !== '') { + pathExt.unshift(''); + } + return { + pathEnv: pathEnv, + pathExt: pathExt, + pathExtExe: pathExtExe + }; + } + return { + pathEnv: pathEnv, + pathExt: [ '' ] + }; +}; + +const getPathPart = (raw, cmd) => { + const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw; + const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : ''; + return prefix + join(pathPart, cmd); +}; + +const which = async (cmd, opt = {}) => { + const {pathEnv: pathEnv, pathExt: pathExt, pathExtExe: pathExtExe} = getPathInfo(cmd, opt); + const found = []; + for (const envPart of pathEnv) { + const p = getPathPart(envPart, cmd); + for (const ext of pathExt) { + const withExt = p + ext; + const is = await isexe(withExt, { + pathExt: pathExtExe, + ignoreErrors: true + }); + if (is) { + if (!opt.all) { + return withExt; + } + found.push(withExt); + } + } + } + if (opt.all && found.length) { + return found; + } + if (opt.nothrow) { + return null; + } + throw getNotFoundError(cmd); +}; + +const whichSync = (cmd, opt = {}) => { + const {pathEnv: pathEnv, pathExt: pathExt, pathExtExe: pathExtExe} = getPathInfo(cmd, opt); + const found = []; + for (const pathEnvPart of pathEnv) { + const p = getPathPart(pathEnvPart, cmd); + for (const ext of pathExt) { + const withExt = p + ext; + const is = isexeSync(withExt, { + pathExt: pathExtExe, + ignoreErrors: true + }); + if (is) { + if (!opt.all) { + return withExt; + } + found.push(withExt); + } + } + } + if (opt.all && found.length) { + return found; + } + if (opt.nothrow) { + return null; + } + throw getNotFoundError(cmd); +}; + +var lib = which; + +which.sync = whichSync; + +const which$1 = getDefaultExportFromCjs(lib); + +const typeMappings = { + directory: 'isDirectory', + file: 'isFile' +}; + +function checkType(type) { + if (Object.hasOwnProperty.call(typeMappings, type)) { + return; + } + throw new Error(`Invalid type specified: ${type}`); +} + +const matchType = (type, stat) => stat[typeMappings[type]](); + +const toPath$1 = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath; + +function locatePathSync(paths, {cwd: cwd = process$2.cwd(), type: type = 'file', allowSymlinks: allowSymlinks = true} = {}) { + checkType(type); + cwd = toPath$1(cwd); + const statFunction = allowSymlinks ? fs$l.statSync : fs$l.lstatSync; + for (const path_ of paths) { + try { + const stat = statFunction(path__default.resolve(cwd, path_), { + throwIfNoEntry: false + }); + if (!stat) { + continue; + } + if (matchType(type, stat)) { + return path_; + } + } catch {} + } +} + +const toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath; + +const findUpStop = Symbol('findUpStop'); + +function findUpMultipleSync(name, options = {}) { + let directory = path__default.resolve(toPath(options.cwd) || ''); + const {root: root} = path__default.parse(directory); + const stopAt = options.stopAt || root; + const limit = options.limit || Number.POSITIVE_INFINITY; + const paths = [ name ].flat(); + const runMatcher = locateOptions => { + if (typeof name !== 'function') { + return locatePathSync(paths, locateOptions); + } + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePathSync([ foundPath ], locateOptions); + } + return foundPath; + }; + const matches = []; + while (true) { + const foundPath = runMatcher({ + ...options, + cwd: directory + }); + if (foundPath === findUpStop) { + break; + } + if (foundPath) { + matches.push(path__default.resolve(directory, foundPath)); + } + if (directory === stopAt || matches.length >= limit) { + break; + } + directory = path__default.dirname(directory); + } + return matches; +} + +function findUpSync(name, options = {}) { + const matches = findUpMultipleSync(name, { + ...options, + limit: 1 + }); + return matches[0]; +} + +function pkgUpSync({cwd: cwd} = {}) { + return findUpSync('package.json', { + cwd: cwd + }); +} + +function findPathToModule(dir, moduleNames) { + const stat = statSync(dir); + if (stat.isDirectory()) { + const candidates = moduleNames.map((moduleName => resolve$1(dir, moduleName))); + const modulePath = candidates.find(existsSync); + if (modulePath) { + return modulePath; + } + } + const parent = resolve$1(dir, '..'); + if (parent !== dir) { + return findPathToModule(parent, moduleNames); + } +} + +class TypeScriptVersion { + constructor(source, path, logger) { + this.source = source; + this.path = path; + this.logger = logger; + this._api = null; + } + get tsServerPath() { + return this.path; + } + get isValid() { + return this.version !== null; + } + get version() { + if (this._api) { + return this._api; + } + this._api = this.getTypeScriptVersion(this.tsServerPath); + return this._api; + } + get versionString() { + const version = this.version; + return version ? version.displayName : null; + } + getTypeScriptVersion(serverPath) { + this.logger.log(`Resolving TypeScript version from path "${serverPath}"...`); + if (!fs$l.existsSync(serverPath)) { + this.logger.log('Server path does not exist on disk'); + return null; + } + const p = serverPath.split(path__default.sep); + if (p.length <= 2) { + this.logger.log('Server path is invalid (has less than two path components).'); + return null; + } + const p2 = p.slice(0, -2); + const modulePath = p2.join(path__default.sep); + let fileName = path__default.join(modulePath, 'package.json'); + if (!fs$l.existsSync(fileName)) { + if (path__default.basename(modulePath) === 'built') { + fileName = path__default.join(modulePath, '..', 'package.json'); + } + } + if (!fs$l.existsSync(fileName)) { + this.logger.log(`Failed to find package.json at path "${fileName}"`); + return null; + } + this.logger.log(`Reading version from package.json at "${fileName}"`); + const contents = fs$l.readFileSync(fileName).toString(); + let desc = null; + try { + desc = JSON.parse(contents); + } catch (err) { + this.logger.log('Failed parsing contents of package.json.'); + return null; + } + if (!desc?.version) { + this.logger.log('Failed reading version number from package.json.'); + return null; + } + this.logger.log(`Resolved TypeScript version to "${desc.version}"`); + return API.fromVersionString(desc.version); + } +} + +const MODULE_FOLDERS = [ 'node_modules/typescript/lib', '.vscode/pnpify/typescript/lib', '.yarn/sdks/typescript/lib' ]; + +class TypeScriptVersionProvider { + constructor(userTsserverPath, logger) { + this.userTsserverPath = userTsserverPath; + this.logger = logger; + } + getUserSettingVersion() { + if (!this.userTsserverPath) { + return null; + } + this.logger.log(`Resolving user-provided tsserver path "${this.userTsserverPath}"...`); + let resolvedPath = this.userTsserverPath; + if (!path__default.isAbsolute(resolvedPath)) { + const binaryPath = which$1.sync(resolvedPath, { + nothrow: true + }); + if (binaryPath) { + resolvedPath = binaryPath; + } + this.logger.log(`Non-absolute tsserver path resolved to "${binaryPath ? resolvedPath : ''}"`); + } + let stat = fs$l.lstatSync(resolvedPath, { + throwIfNoEntry: false + }); + if (stat?.isSymbolicLink()) { + resolvedPath = fs$l.realpathSync(resolvedPath); + this.logger.log(`Symbolic link tsserver path resolved to "${resolvedPath}"`); + } + stat = fs$l.lstatSync(resolvedPath, { + throwIfNoEntry: false + }); + if (stat?.isFile()) { + if (path__default.basename(resolvedPath) === 'tsserver.js') { + this.logger.log(`Resolved tsserver location: ${resolvedPath}`); + return new TypeScriptVersion('user-setting', resolvedPath, this.logger); + } + resolvedPath = path__default.dirname(resolvedPath); + this.logger.log(`Resolved directory path from a file path: ${resolvedPath}`); + } + try { + const packageJsonPath = pkgUpSync({ + cwd: resolvedPath + }); + this.logger.log(`Resolved package.json location: "${packageJsonPath}"`); + if (packageJsonPath) { + resolvedPath = path__default.join(path__default.dirname(packageJsonPath), 'lib', 'tsserver.js'); + this.logger.log(`Resolved tsserver location: "${resolvedPath}"`); + } + } catch {} + return new TypeScriptVersion('user-setting', resolvedPath, this.logger); + } + getWorkspaceVersion(workspaceFolders) { + for (const p of workspaceFolders) { + const libFolder = findPathToModule(p, MODULE_FOLDERS); + if (libFolder) { + const tsServerPath = path__default.join(libFolder, 'tsserver.js'); + const version = new TypeScriptVersion('workspace', tsServerPath, this.logger); + if (version.isValid) { + return version; + } + } + } + return null; + } + bundledVersion() { + const require = createRequire(import.meta.url); + try { + const file = require.resolve('typescript'); + const tsServerPath = path__default.join(path__default.dirname(file), 'tsserver.js'); + const bundledVersion = new TypeScriptVersion('bundled', tsServerPath, this.logger); + return bundledVersion; + } catch (e) { + return null; + } + } +} + +class LspServer { + constructor(options) { + this.options = options; + this.initializeParams = null; + this.completionDataCache = new CompletionDataCache; + this.typeScriptAutoFixProvider = null; + this.features = {}; + this.cachedNavTreeResponse = new CachedResponse; + this.implementationsCodeLensProvider = null; + this.referencesCodeLensProvider = null; + this.logger = new PrefixingLogger(options.logger, '[lspserver]'); + this.tsClient = new TsClient(onCaseInsensitiveFileSystem(), this.logger, options.lspClient); + this.fileConfigurationManager = new FileConfigurationManager(this.tsClient, onCaseInsensitiveFileSystem()); + this.diagnosticQueue = new DiagnosticEventQueue((diagnostics => this.options.lspClient.publishDiagnostics(diagnostics)), this.tsClient, this.features, this.logger); + } + closeAllForTesting() { + for (const document of this.tsClient.documentsForTesting.values()) { + this.closeDocument(document.uri.toString()); + } + } + async waitForDiagnosticsForFile(uri) { + const document = this.tsClient.toOpenDocument(uri); + if (!document) { + throw new Error(`Document not open: ${uri}`); + } + await this.diagnosticQueue.waitForDiagnosticsForTesting(document.filepath); + } + shutdown() { + this.tsClient.shutdown(); + } + async initialize(params) { + this.initializeParams = params; + const clientCapabilities = this.initializeParams.capabilities; + this.workspaceRoot = this.initializeParams.rootUri ? URI.parse(this.initializeParams.rootUri).fsPath : this.initializeParams.rootPath || undefined; + const userInitializationOptions = this.initializeParams.initializationOptions || {}; + const {disableAutomaticTypingAcquisition: disableAutomaticTypingAcquisition, hostInfo: hostInfo, maxTsServerMemory: maxTsServerMemory, npmLocation: npmLocation, locale: locale, plugins: plugins, tsserver: tsserver} = userInitializationOptions; + const typescriptVersion = this.findTypescriptVersion(tsserver?.path, tsserver?.fallbackPath); + if (typescriptVersion) { + this.options.lspClient.logMessage({ + type: main$3.MessageType.Info, + message: `Using Typescript version (${typescriptVersion.source}) ${typescriptVersion.versionString} from path "${typescriptVersion.tsServerPath}"` + }); + } else { + throw Error('Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting.'); + } + this.fileConfigurationManager.mergeTsPreferences(userInitializationOptions.preferences || {}); + this.features.completionDisableFilterText = userInitializationOptions.completionDisableFilterText ?? false; + const {textDocument: textDocument} = clientCapabilities; + if (textDocument) { + const {codeAction: codeAction, completion: completion, definition: definition, publishDiagnostics: publishDiagnostics} = textDocument; + if (codeAction) { + this.features.codeActionDisabledSupport = codeAction.disabledSupport; + } + if (completion) { + const {completionItem: completionItem} = completion; + if (completionItem) { + const {commitCharactersSupport: commitCharactersSupport, insertReplaceSupport: insertReplaceSupport, labelDetailsSupport: labelDetailsSupport, snippetSupport: snippetSupport} = completionItem; + this.features.completionCommitCharactersSupport = commitCharactersSupport; + this.features.completionInsertReplaceSupport = insertReplaceSupport; + this.features.completionSnippets = snippetSupport; + this.features.completionLabelDetails = this.fileConfigurationManager.tsPreferences.useLabelDetailsInCompletionEntries && labelDetailsSupport && typescriptVersion.version?.gte(API.v470); + } + } + if (definition) { + this.features.definitionLinkSupport = definition.linkSupport; + } + this.features.diagnosticsSupport = Boolean(publishDiagnostics); + this.features.diagnosticsTagSupport = Boolean(publishDiagnostics?.tagSupport); + } + this.fileConfigurationManager.mergeTsPreferences({ + useLabelDetailsInCompletionEntries: this.features.completionLabelDetails + }); + const tsserverLogVerbosity = tsserver?.logVerbosity && TsServerLogLevel.fromString(tsserver.logVerbosity); + const started = this.tsClient.start(this.workspaceRoot, { + trace: Trace.fromString(tsserver?.trace || 'off'), + typescriptVersion: typescriptVersion, + logDirectoryProvider: new LogDirectoryProvider(this.getLogDirectoryPath(userInitializationOptions)), + logVerbosity: tsserverLogVerbosity ?? TsServerLogLevel.Off, + disableAutomaticTypingAcquisition: disableAutomaticTypingAcquisition, + maxTsServerMemory: maxTsServerMemory, + npmLocation: npmLocation, + hostInfo: hostInfo, + locale: locale, + plugins: plugins || [], + onEvent: this.onTsEvent.bind(this), + onExit: (exitCode, signal) => { + this.shutdown(); + if (exitCode) { + throw new Error(`tsserver process has exited (exit code: ${exitCode}, signal: ${signal}). Stopping the server.`); + } + }, + useSyntaxServer: toSyntaxServerConfiguration(userInitializationOptions.tsserver?.useSyntaxServer) + }); + if (!started) { + throw new Error('tsserver process has failed to start.'); + } + process.on('exit', (() => { + this.shutdown(); + })); + process.on('SIGINT', (() => { + process.exit(); + })); + this.typeScriptAutoFixProvider = new TypeScriptAutoFixProvider(this.tsClient); + this.fileConfigurationManager.setGlobalConfiguration(this.workspaceRoot, hostInfo); + this.registerHandlers(); + const prepareSupport = textDocument?.rename?.prepareSupport && this.tsClient.apiVersion.gte(API.v310); + const initializeResult = { + capabilities: { + textDocumentSync: main$3.TextDocumentSyncKind.Incremental, + completionProvider: { + triggerCharacters: [ '.', '"', '\'', '/', '@', '<' ], + resolveProvider: true + }, + codeActionProvider: clientCapabilities.textDocument?.codeAction?.codeActionLiteralSupport ? { + codeActionKinds: [ ...TypeScriptAutoFixProvider.kinds.map((kind => kind.value)), CodeActionKind.SourceOrganizeImportsTs.value, CodeActionKind.SourceRemoveUnusedImportsTs.value, CodeActionKind.SourceSortImportsTs.value, CodeActionKind.QuickFix.value, CodeActionKind.Refactor.value ] + } : true, + codeLensProvider: { + resolveProvider: true + }, + definitionProvider: true, + documentFormattingProvider: true, + documentRangeFormattingProvider: true, + documentHighlightProvider: true, + documentSymbolProvider: true, + executeCommandProvider: { + commands: [ Commands.APPLY_WORKSPACE_EDIT, Commands.APPLY_CODE_ACTION, Commands.APPLY_REFACTORING, Commands.CONFIGURE_PLUGIN, Commands.ORGANIZE_IMPORTS, Commands.APPLY_RENAME_FILE, Commands.SOURCE_DEFINITION ] + }, + hoverProvider: true, + inlayHintProvider: true, + linkedEditingRangeProvider: false, + renameProvider: prepareSupport ? { + prepareProvider: true + } : true, + referencesProvider: true, + selectionRangeProvider: true, + signatureHelpProvider: { + triggerCharacters: [ '(', ',', '<' ], + retriggerCharacters: [ ')' ] + }, + workspaceSymbolProvider: true, + implementationProvider: true, + typeDefinitionProvider: true, + foldingRangeProvider: true, + semanticTokensProvider: { + documentSelector: null, + legend: { + tokenTypes: [ 'class', 'enum', 'interface', 'namespace', 'typeParameter', 'type', 'parameter', 'variable', 'enumMember', 'property', 'function', 'member' ], + tokenModifiers: [ 'declaration', 'static', 'async', 'readonly', 'defaultLibrary', 'local' ] + }, + full: true, + range: true + }, + workspace: { + fileOperations: { + willRename: { + filters: [ { + scheme: 'file', + pattern: { + glob: '**/*.{ts,js,jsx,tsx,mjs,mts,cjs,cts}', + matches: 'file' + } + }, { + scheme: 'file', + pattern: { + glob: '**', + matches: 'folder' + } + } ] + } + } + } + } + }; + if (textDocument?.callHierarchy && typescriptVersion.version?.gte(API.v380)) { + initializeResult.capabilities.callHierarchyProvider = true; + } + if (textDocument?.linkedEditingRange && typescriptVersion.version?.gte(API.v510)) { + initializeResult.capabilities.linkedEditingRangeProvider = true; + } + this.logger.log('onInitialize result', initializeResult); + return initializeResult; + } + registerHandlers() { + if (this.initializeParams?.capabilities.textDocument?.codeLens) { + this.implementationsCodeLensProvider = new TypeScriptImplementationsCodeLensProvider(this.tsClient, this.cachedNavTreeResponse, this.fileConfigurationManager); + this.referencesCodeLensProvider = new TypeScriptReferencesCodeLensProvider(this.tsClient, this.cachedNavTreeResponse, this.fileConfigurationManager); + } + } + initialized(_) { + const {apiVersion: apiVersion, typescriptVersionSource: typescriptVersionSource} = this.tsClient; + this.options.lspClient.sendNotification(TypescriptVersionNotification, { + version: apiVersion.displayName, + source: typescriptVersionSource + }); + } + findTypescriptVersion(userTsserverPath, fallbackTsserverPath) { + const typescriptVersionProvider = new TypeScriptVersionProvider(userTsserverPath, this.logger); + const userSettingVersion = typescriptVersionProvider.getUserSettingVersion(); + if (userSettingVersion) { + if (userSettingVersion.isValid) { + return userSettingVersion; + } + this.logger.logIgnoringVerbosity(LogLevel.Warning, `Typescript specified through user setting ignored due to invalid path "${userSettingVersion.path}"`); + } + if (this.workspaceRoot) { + const workspaceVersion = typescriptVersionProvider.getWorkspaceVersion([ this.workspaceRoot ]); + if (workspaceVersion) { + return workspaceVersion; + } + } + const fallbackVersionProvider = new TypeScriptVersionProvider(fallbackTsserverPath, this.logger); + const fallbackSettingVersion = fallbackVersionProvider.getUserSettingVersion(); + if (fallbackSettingVersion) { + if (fallbackSettingVersion.isValid) { + return fallbackSettingVersion; + } + this.logger.logIgnoringVerbosity(LogLevel.Warning, `Typescript specified through fallback setting ignored due to invalid path "${fallbackSettingVersion.path}"`); + } + const bundledVersion = typescriptVersionProvider.bundledVersion(); + if (bundledVersion?.isValid) { + return bundledVersion; + } + return null; + } + getLogDirectoryPath(initializationOptions) { + if (initializationOptions.tsserver?.logDirectory) { + return initializationOptions.tsserver.logDirectory; + } + if (this.workspaceRoot) { + return path$e.join(this.workspaceRoot, '.log'); + } + return undefined; + } + didChangeConfiguration(params) { + this.fileConfigurationManager.setWorkspaceConfiguration(params.settings || {}); + const ignoredDiagnosticCodes = this.fileConfigurationManager.workspaceConfiguration.diagnostics?.ignoredCodes || []; + this.tsClient.interruptGetErr((() => this.diagnosticQueue.updateIgnoredDiagnosticCodes(ignoredDiagnosticCodes))); + } + didOpenTextDocument(params) { + if (this.tsClient.toOpenDocument(params.textDocument.uri, { + suppressAlertOnFailure: true + })) { + throw new Error(`Can't open already open document: ${params.textDocument.uri}`); + } + if (!this.tsClient.openTextDocument(params.textDocument)) { + throw new Error(`Cannot open document '${params.textDocument.uri}' (languageId: ${params.textDocument.languageId}).`); + } + } + didCloseTextDocument(params) { + this.closeDocument(params.textDocument.uri); + } + closeDocument(uri) { + const document = this.tsClient.toOpenDocument(uri); + if (!document) { + throw new Error(`Trying to close not opened document: ${uri}`); + } + this.cachedNavTreeResponse.onDocumentClose(document); + this.tsClient.onDidCloseTextDocument(uri); + this.diagnosticQueue.onDidCloseFile(document.filepath); + this.fileConfigurationManager.onDidCloseTextDocument(document.uri); + } + didChangeTextDocument(params) { + this.tsClient.onDidChangeTextDocument(params); + } + didSaveTextDocument(_params) {} + async definition(params, token) { + return this.getDefinition({ + type: this.features.definitionLinkSupport ? CommandTypes.DefinitionAndBoundSpan : CommandTypes.Definition, + params: params + }, token); + } + async implementation(params, token) { + return this.getSymbolLocations({ + type: CommandTypes.Implementation, + params: params + }, token); + } + async typeDefinition(params, token) { + return this.getSymbolLocations({ + type: CommandTypes.TypeDefinition, + params: params + }, token); + } + async getDefinition({type: type, params: params}, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return; + } + if (type === CommandTypes.DefinitionAndBoundSpan) { + const args = Position.toFileLocationRequestArgs(document.filepath, params.position); + const response = await this.tsClient.execute(type, args, token); + if (response.type !== 'response' || !response.body) { + return undefined; + } + const span = response.body.textSpan ? Range.fromTextSpan(response.body.textSpan) : undefined; + return response.body.definitions.map((location => { + const target = toLocation(location, this.tsClient); + const targetRange = location.contextStart && location.contextEnd ? Range.fromLocations(location.contextStart, location.contextEnd) : target.range; + return { + originSelectionRange: span, + targetRange: targetRange, + targetUri: target.uri, + targetSelectionRange: target.range + }; + })); + } + return this.getSymbolLocations({ + type: CommandTypes.Definition, + params: params + }); + } + async getSymbolLocations({type: type, params: params}, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return []; + } + const args = Position.toFileLocationRequestArgs(document.filepath, params.position); + const response = await this.tsClient.execute(type, args, token); + if (response.type !== 'response' || !response.body) { + return undefined; + } + return response.body.map((fileSpan => toLocation(fileSpan, this.tsClient))); + } + async documentSymbol(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return []; + } + const response = await this.cachedNavTreeResponse.execute(document, (() => this.tsClient.execute(CommandTypes.NavTree, { + file: document.filepath + }, token))); + if (response.type !== 'response' || !response.body?.childItems) { + return []; + } + if (this.supportHierarchicalDocumentSymbol) { + const symbols = []; + for (const item of response.body.childItems) { + collectDocumentSymbols(item, symbols); + } + return symbols; + } + const symbols = []; + for (const item of response.body.childItems) { + collectSymbolInformation(params.textDocument.uri, item, symbols); + } + return symbols; + } + get supportHierarchicalDocumentSymbol() { + const textDocument = this.initializeParams?.capabilities.textDocument; + const documentSymbol = textDocument?.documentSymbol; + return !!documentSymbol && !!documentSymbol.hierarchicalDocumentSymbolSupport; + } + async completion(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return main$3.CompletionList.create([]); + } + const {filepath: filepath} = document; + this.completionDataCache.reset(); + const completionOptions = this.fileConfigurationManager.workspaceConfiguration.completions || {}; + const result = await this.tsClient.interruptGetErr((async () => { + await this.fileConfigurationManager.ensureConfigurationForDocument(document, token); + const response = await this.tsClient.execute(CommandTypes.CompletionInfo, { + file: filepath, + line: params.position.line + 1, + offset: params.position.character + 1, + triggerCharacter: getCompletionTriggerCharacter(params.context?.triggerCharacter), + triggerKind: params.context?.triggerKind + }, token); + if (response.type !== 'response') { + return undefined; + } + return response.body; + })); + if (!result) { + return main$3.CompletionList.create(); + } + const {entries: entries, isIncomplete: isIncomplete, optionalReplacementSpan: optionalReplacementSpan, isMemberCompletion: isMemberCompletion} = result; + const line = document.getLine(params.position.line); + let dotAccessorContext; + if (isMemberCompletion) { + const dotMatch = line.slice(0, params.position.character).match(/\??\.\s*$/) || undefined; + if (dotMatch) { + const startPosition = main$3.Position.create(params.position.line, params.position.character - dotMatch[0].length); + const range = main$3.Range.create(startPosition, params.position); + const text = document.getText(range); + dotAccessorContext = { + range: range, + text: text + }; + } + } + const completionContext = { + isMemberCompletion: isMemberCompletion, + dotAccessorContext: dotAccessorContext, + line: line, + optionalReplacementRange: optionalReplacementSpan ? Range.fromTextSpan(optionalReplacementSpan) : undefined + }; + const completions = asCompletionItems(entries, this.completionDataCache, filepath, params.position, document, this.tsClient, completionOptions, this.features, completionContext); + return main$3.CompletionList.create(completions, isIncomplete); + } + async completionResolve(item, token) { + item.data = item.data?.cacheId !== undefined ? this.completionDataCache.get(item.data.cacheId) : item.data; + const uri = this.tsClient.toResourceUri(item.data.file); + const document = item.data?.file ? this.tsClient.toOpenDocument(uri) : undefined; + if (!document) { + return item; + } + await this.fileConfigurationManager.ensureConfigurationForDocument(document, token); + const response = await this.tsClient.interruptGetErr((() => this.tsClient.execute(CommandTypes.CompletionDetails, item.data, token))); + if (response.type !== 'response' || !response.body?.length) { + return item; + } + return asResolvedCompletionItem(item, response.body[0], document, this.tsClient, this.fileConfigurationManager.workspaceConfiguration.completions || {}, this.features); + } + async hover(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return { + contents: [] + }; + } + const result = await this.tsClient.interruptGetErr((async () => { + await this.fileConfigurationManager.ensureConfigurationForDocument(document, token); + const response = await this.tsClient.execute(CommandTypes.Quickinfo, Position.toFileLocationRequestArgs(document.filepath, params.position), token); + if (response.type === 'response' && response.body) { + return response.body; + } + })); + if (!result) { + return null; + } + const contents = new MarkdownString; + const {displayString: displayString, documentation: documentation, tags: tags} = result; + if (displayString) { + contents.appendCodeblock('typescript', displayString); + } + addMarkdownDocumentation(contents, documentation, tags, this.tsClient); + return { + contents: contents.toMarkupContent(), + range: Range.fromTextSpan(result) + }; + } + async prepareRename(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return null; + } + const response = await this.tsClient.execute(CommandTypes.Rename, Position.toFileLocationRequestArgs(document.filepath, params.position), token); + if (response.type !== 'response' || !response.body?.info) { + return null; + } + const renameInfo = response.body.info; + if (!renameInfo.canRename) { + throw new Error(renameInfo.localizedErrorMessage); + } + return Range.fromTextSpan(renameInfo.triggerSpan); + } + async rename(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return null; + } + const result = await this.tsClient.interruptGetErr((async () => { + await this.fileConfigurationManager.ensureConfigurationForDocument(document); + const response = await this.tsClient.execute(CommandTypes.Rename, Position.toFileLocationRequestArgs(document.filepath, params.position), token); + if (response.type !== 'response' || !response.body?.info.canRename || !response.body?.locs.length) { + return null; + } + return response.body; + })); + if (!result) { + return null; + } + const changes = {}; + result.locs.forEach((spanGroup => { + const uri = this.tsClient.toResourceUri(spanGroup.file); + const textEdits = changes[uri] || (changes[uri] = []); + spanGroup.locs.forEach((textSpan => { + textEdits.push({ + newText: `${textSpan.prefixText || ''}${params.newName}${textSpan.suffixText || ''}`, + range: { + start: Position.fromLocation(textSpan.start), + end: Position.fromLocation(textSpan.end) + } + }); + })); + })); + return { + changes: changes + }; + } + async references(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return []; + } + const response = await this.tsClient.execute(CommandTypes.References, Position.toFileLocationRequestArgs(document.filepath, params.position), token); + if (response.type !== 'response' || !response.body) { + return []; + } + return response.body.refs.filter((fileSpan => params.context.includeDeclaration || !fileSpan.isDefinition)).map((fileSpan => toLocation(fileSpan, this.tsClient))); + } + async documentFormatting(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + throw new Error(`The document should be opened for formatting', file: ${params.textDocument.uri}`); + } + const formatOptions = params.options; + await this.fileConfigurationManager.ensureConfigurationOptions(document, formatOptions); + const response = await this.tsClient.execute(CommandTypes.Format, { + ...Range.toFormattingRequestArgs(document.filepath, document.getFullRange()), + options: formatOptions + }, token); + if (response.type !== 'response' || !response.body) { + return []; + } + return response.body.map((e => toTextEdit(e))); + } + async documentRangeFormatting(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return []; + } + const formatOptions = params.options; + await this.fileConfigurationManager.ensureConfigurationOptions(document, formatOptions); + const response = await this.tsClient.execute(CommandTypes.Format, { + ...Range.toFormattingRequestArgs(document.filepath, params.range), + options: formatOptions + }, token); + if (response.type !== 'response' || !response.body) { + return []; + } + return response.body.map((e => toTextEdit(e))); + } + async selectionRanges(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return null; + } + const response = await this.tsClient.execute(CommandTypes.SelectionRange, { + file: document.filepath, + locations: params.positions.map(Position.toLocation) + }, token); + if (response.type !== 'response' || !response.body) { + return null; + } + return response.body.map(toSelectionRange); + } + async signatureHelp(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return undefined; + } + const {position: position, context: context} = params; + const args = { + file: document.filepath, + line: position.line + 1, + offset: position.character + 1, + triggerReason: context ? toTsTriggerReason(context) : undefined + }; + const response = await this.tsClient.interruptGetErr((() => this.tsClient.execute(CommandTypes.SignatureHelp, args, token))); + if (response.type !== 'response' || !response.body) { + return undefined; + } + return asSignatureHelp(response.body, params.context, this.tsClient); + } + async codeAction(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return []; + } + await this.tsClient.interruptGetErr((() => this.fileConfigurationManager.ensureConfigurationForDocument(document))); + const fileRangeArgs = Range.toFileRangeRequestArgs(document.filepath, params.range); + const actions = []; + const kinds = params.context.only?.map((kind => new CodeActionKind(kind))); + if (!kinds || kinds.some((kind => kind.contains(CodeActionKind.QuickFix)))) { + actions.push(...provideQuickFix(await this.getCodeFixes(fileRangeArgs, params.context, token), this.tsClient)); + } + if (!kinds || kinds.some((kind => kind.contains(CodeActionKind.Refactor)))) { + actions.push(...provideRefactors(await this.getRefactors(fileRangeArgs, params.context, token), fileRangeArgs, this.features)); + } + for (const kind of kinds || []) { + for (const command of organizeImportsCommands) { + if (!kind.contains(command.kind) || command.minVersion && this.tsClient.apiVersion.lt(command.minVersion)) { + continue; + } + let skipDestructiveCodeActions = command.mode === OrganizeImportsMode.SortAndCombine; + let mode = command.mode; + const isOrganizeImports = command.kind.equals(CodeActionKind.SourceOrganizeImportsTs); + if (isOrganizeImports) { + const documentHasErrors = params.context.diagnostics.some((d => (d.severity ?? 0) <= 2)); + skipDestructiveCodeActions = documentHasErrors; + mode = OrganizeImportsMode.SortAndCombine; + } + const response = await this.tsClient.interruptGetErr((() => this.tsClient.execute(CommandTypes.OrganizeImports, { + scope: { + type: 'file', + args: fileRangeArgs + }, + skipDestructiveCodeActions: skipDestructiveCodeActions, + mode: mode + }, token))); + if (response.type === 'response' && response.body) { + actions.push(...provideOrganizeImports(command, response, this.tsClient)); + } + } + } + if (kinds && !this.tsClient.hasPendingDiagnostics(document.uri)) { + const diagnostics = this.diagnosticQueue.getDiagnosticsForFile(document.filepath) || []; + if (diagnostics.length) { + actions.push(...await this.typeScriptAutoFixProvider.provideCodeActions(kinds, document.filepath, diagnostics)); + } + } + return actions; + } + async getCodeFixes(fileRangeArgs, context, token) { + const errorCodes = context.diagnostics.map((diagnostic => Number(diagnostic.code))); + const args = { + ...fileRangeArgs, + errorCodes: errorCodes + }; + const response = await this.tsClient.execute(CommandTypes.GetCodeFixes, args, token); + return response.type === 'response' ? response : undefined; + } + async getRefactors(fileRangeArgs, context, token) { + const args = { + ...fileRangeArgs, + triggerReason: context.triggerKind === main$3.CodeActionTriggerKind.Invoked ? 'invoked' : undefined, + kind: context.only?.length === 1 ? context.only[0] : undefined + }; + const response = await this.tsClient.execute(CommandTypes.GetApplicableRefactors, args, token); + return response.type === 'response' ? response : undefined; + } + async executeCommand(params, token, workDoneProgress) { + if (params.command === Commands.APPLY_WORKSPACE_EDIT && params.arguments) { + const edit = params.arguments[0]; + await this.options.lspClient.applyWorkspaceEdit({ + edit: edit + }); + } else if (params.command === Commands.APPLY_CODE_ACTION && params.arguments) { + const codeAction = params.arguments[0]; + if (!await this.applyFileCodeEdits(codeAction.changes)) { + return; + } + if (codeAction.commands?.length) { + for (const command of codeAction.commands) { + await this.tsClient.execute(CommandTypes.ApplyCodeActionCommand, { + command: command + }, token); + } + } + } else if (params.command === Commands.APPLY_REFACTORING && params.arguments) { + const args = params.arguments[0]; + const response = await this.tsClient.execute(CommandTypes.GetEditsForRefactor, args, token); + if (response.type !== 'response' || !response.body) { + return; + } + const {body: body} = response; + if (!body?.edits.length) { + return; + } + for (const edit of body.edits) { + await fs.ensureFile(edit.fileName); + } + if (!await this.applyFileCodeEdits(body.edits)) { + return; + } + const renameLocation = body.renameLocation; + if (renameLocation) { + await this.options.lspClient.rename({ + textDocument: { + uri: this.tsClient.toResourceUri(args.file) + }, + position: Position.fromLocation(renameLocation) + }); + } + } else if (params.command === Commands.CONFIGURE_PLUGIN && params.arguments) { + const [pluginName, configuration] = params.arguments; + this.tsClient.configurePlugin(pluginName, configuration); + } else if (params.command === Commands.ORGANIZE_IMPORTS && params.arguments) { + const file = params.arguments[0]; + const uri = this.tsClient.toResourceUri(file); + const document = this.tsClient.toOpenDocument(uri); + if (!document) { + return; + } + const additionalArguments = params.arguments[1] || {}; + const body = await this.tsClient.interruptGetErr((async () => { + await this.fileConfigurationManager.ensureConfigurationForDocument(document); + const response = await this.tsClient.execute(CommandTypes.OrganizeImports, { + scope: { + type: 'file', + args: { + file: file + } + }, + skipDestructiveCodeActions: additionalArguments.skipDestructiveCodeActions, + mode: additionalArguments.skipDestructiveCodeActions ? OrganizeImportsMode.SortAndCombine : OrganizeImportsMode.All + }, token); + if (response.type !== 'response') { + return; + } + return response.body; + })); + if (!body) { + return; + } + await this.applyFileCodeEdits(body); + } else if (params.command === Commands.APPLY_RENAME_FILE && params.arguments) { + const {sourceUri: sourceUri, targetUri: targetUri} = params.arguments[0]; + this.applyRenameFile(sourceUri, targetUri, token); + } else if (params.command === Commands.APPLY_COMPLETION_CODE_ACTION && params.arguments) { + const [_, codeActions] = params.arguments; + for (const codeAction of codeActions) { + await this.applyFileCodeEdits(codeAction.changes); + if (codeAction.commands?.length) { + for (const command of codeAction.commands) { + await this.tsClient.execute(CommandTypes.ApplyCodeActionCommand, { + command: command + }, token); + } + } + break; + } + } else if (params.command === Commands.SOURCE_DEFINITION) { + const [uri, position] = params.arguments || []; + const reporter = await this.options.lspClient.createProgressReporter(token, workDoneProgress); + return SourceDefinitionCommand.execute(uri, position, this.tsClient, this.options.lspClient, reporter, token); + } else { + this.logger.error(`Unknown command ${params.command}.`); + } + } + async applyFileCodeEdits(edits) { + if (!edits.length) { + return false; + } + const changes = {}; + for (const edit of edits) { + changes[this.tsClient.toResourceUri(edit.fileName)] = edit.textChanges.map(toTextEdit); + } + const {applied: applied} = await this.options.lspClient.applyWorkspaceEdit({ + edit: { + changes: changes + } + }); + return applied; + } + async willRenameFiles(params, token) { + const changes = {}; + for (const rename of params.files) { + const codeEdits = await this.getEditsForFileRename(rename.oldUri, rename.newUri, token); + for (const codeEdit of codeEdits) { + const uri = this.tsClient.toResourceUri(codeEdit.fileName); + const textEdits = changes[uri] || (changes[uri] = []); + textEdits.push(...codeEdit.textChanges.map(toTextEdit)); + } + } + return { + changes: changes + }; + } + async applyRenameFile(sourceUri, targetUri, token) { + const edits = await this.getEditsForFileRename(sourceUri, targetUri, token); + this.applyFileCodeEdits(edits); + } + async getEditsForFileRename(sourceUri, targetUri, token) { + const newFilePath = this.tsClient.toTsFilePath(targetUri); + const oldFilePath = this.tsClient.toTsFilePath(sourceUri); + if (!newFilePath || !oldFilePath) { + return []; + } + const response = await this.tsClient.interruptGetErr((() => this.tsClient.execute(CommandTypes.GetEditsForFileRename, { + oldFilePath: oldFilePath, + newFilePath: newFilePath + }, token))); + if (response.type !== 'response' || !response.body) { + return []; + } + return response.body; + } + async codeLens(params, token) { + if (!this.implementationsCodeLensProvider || !this.referencesCodeLensProvider) { + return []; + } + const doc = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!doc) { + return []; + } + return [ ...await this.implementationsCodeLensProvider.provideCodeLenses(doc, token), ...await this.referencesCodeLensProvider.provideCodeLenses(doc, token) ]; + } + async codeLensResolve(codeLens, token) { + if (!this.implementationsCodeLensProvider || !this.referencesCodeLensProvider) { + return codeLens; + } + if (codeLens.data?.type === CodeLensType.Implementation) { + return await this.implementationsCodeLensProvider.resolveCodeLens(codeLens, token); + } + if (codeLens.data?.type === CodeLensType.Reference) { + return await this.referencesCodeLensProvider.resolveCodeLens(codeLens, token); + } + throw new Error('Unexpected CodeLens!'); + } + async documentHighlight(params, token) { + const doc = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!doc) { + throw new Error(`The document should be opened first: ${params.textDocument.uri}`); + } + const response = await this.tsClient.execute(CommandTypes.DocumentHighlights, { + file: doc.filepath, + line: params.position.line + 1, + offset: params.position.character + 1, + filesToSearch: [ doc.filepath ] + }, token); + if (response.type !== 'response' || !response.body) { + return []; + } + return response.body.flatMap((item => toDocumentHighlight(item))); + } + async workspaceSymbol(params, token) { + const response = await this.tsClient.execute(CommandTypes.Navto, { + file: this.tsClient.lastFileOrDummy(), + searchValue: params.query + }, token); + if (response.type !== 'response' || !response.body) { + return []; + } + return response.body.map((item => ({ + location: { + uri: this.tsClient.toResourceUri(item.file), + range: { + start: Position.fromLocation(item.start), + end: Position.fromLocation(item.end) + } + }, + kind: toSymbolKind(item.kind), + name: item.name + }))); + } + async foldingRanges(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + throw new Error(`The document should be opened for foldingRanges', file: ${params.textDocument.uri}`); + } + const response = await this.tsClient.execute(CommandTypes.GetOutliningSpans, { + file: document.filepath + }, token); + if (response.type !== 'response' || !response.body) { + return undefined; + } + const foldingRanges = []; + for (const span of response.body) { + const foldingRange = this.asFoldingRange(span, document); + if (foldingRange) { + foldingRanges.push(foldingRange); + } + } + return foldingRanges; + } + asFoldingRange(span, document) { + const range = Range.fromTextSpan(span.textSpan); + const kind = this.asFoldingRangeKind(span); + if (span.kind === 'comment') { + const line = document.getLine(range.start.line); + if (line.match(/\/\/\s*#endregion/gi)) { + return undefined; + } + } + const startLine = range.start.line; + const endLine = range.end.character > 0 && document.getText(main$3.Range.create(main$3.Position.create(range.end.line, range.end.character - 1), range.end)) === '}' ? Math.max(range.end.line - 1, range.start.line) : range.end.line; + return { + startLine: startLine, + endLine: endLine, + kind: kind + }; + } + asFoldingRangeKind(span) { + switch (span.kind) { + case 'comment': + return main$3.FoldingRangeKind.Comment; + + case 'region': + return main$3.FoldingRangeKind.Region; + + case 'imports': + return main$3.FoldingRangeKind.Imports; + + case 'code': + default: + return undefined; + } + } + async onTsEvent(event) { + if (event.event === 'semanticDiag' || event.event === 'syntaxDiag' || event.event === 'suggestionDiag') { + const diagnosticEvent = event; + if (diagnosticEvent.body?.diagnostics) { + const {file: file, diagnostics: diagnostics} = diagnosticEvent.body; + this.diagnosticQueue.updateDiagnostics(getDignosticsKind(event), file, diagnostics); + } + } + } + async prepareCallHierarchy(params, token) { + const document = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!document) { + return null; + } + const args = Position.toFileLocationRequestArgs(document.filepath, params.position); + const response = await this.tsClient.execute(CommandTypes.PrepareCallHierarchy, args, token); + if (response.type !== 'response' || !response.body) { + return null; + } + const items = Array.isArray(response.body) ? response.body : [ response.body ]; + return items.map((item => fromProtocolCallHierarchyItem(item, this.tsClient, this.workspaceRoot))); + } + async callHierarchyIncomingCalls(params, token) { + const file = this.tsClient.toTsFilePath(params.item.uri); + if (!file) { + return null; + } + const args = Position.toFileLocationRequestArgs(file, params.item.selectionRange.start); + const response = await this.tsClient.execute(CommandTypes.ProvideCallHierarchyIncomingCalls, args, token); + if (response.type !== 'response' || !response.body) { + return null; + } + return response.body.map((item => fromProtocolCallHierarchyIncomingCall(item, this.tsClient, this.workspaceRoot))); + } + async callHierarchyOutgoingCalls(params, token) { + const file = this.tsClient.toTsFilePath(params.item.uri); + if (!file) { + return null; + } + const args = Position.toFileLocationRequestArgs(file, params.item.selectionRange.start); + const response = await this.tsClient.execute(CommandTypes.ProvideCallHierarchyOutgoingCalls, args, token); + if (response.type !== 'response' || !response.body) { + return null; + } + return response.body.map((item => fromProtocolCallHierarchyOutgoingCall(item, this.tsClient, this.workspaceRoot))); + } + async inlayHints(params, token) { + return await TypeScriptInlayHintsProvider.provideInlayHints(params.textDocument, params.range, this.tsClient, this.options.lspClient, this.fileConfigurationManager, token); + } + async linkedEditingRange(params, token) { + const doc = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!doc) { + return null; + } + const args = Position.toFileLocationRequestArgs(doc.filepath, params.position); + const response = await this.tsClient.execute(CommandTypes.LinkedEditingRange, args, token); + if (response.type !== 'response' || !response.body) { + return null; + } + return { + ranges: response.body.ranges.map(Range.fromTextSpan), + wordPattern: response.body.wordPattern + }; + } + async semanticTokensFull(params, token) { + const doc = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!doc) { + return { + data: [] + }; + } + const start = doc.offsetAt({ + line: 0, + character: 0 + }); + const end = doc.offsetAt({ + line: doc.lineCount, + character: 0 + }); + return this.getSemanticTokens(doc, doc.filepath, start, end, token); + } + async semanticTokensRange(params, token) { + const doc = this.tsClient.toOpenDocument(params.textDocument.uri); + if (!doc) { + return { + data: [] + }; + } + const start = doc.offsetAt(params.range.start); + const end = doc.offsetAt(params.range.end); + return this.getSemanticTokens(doc, doc.filepath, start, end, token); + } + async getSemanticTokens(doc, file, startOffset, endOffset, token) { + const response = await this.tsClient.execute(CommandTypes.EncodedSemanticClassificationsFull, { + file: file, + start: startOffset, + length: endOffset - startOffset, + format: '2020' + }, token, { + cancelOnResourceChange: doc.uri.toString() + }); + if (response.type !== 'response' || !response.body?.spans) { + return { + data: [] + }; + } + return { + data: transformSpans(doc, response.body.spans) + }; + } +} + +const nullProgressReporter = attachWorkDone_1(undefined, undefined); + +class LspClientImpl { + constructor(connection) { + this.connection = connection; + } + async createProgressReporter(_, workDoneProgress) { + let reporter; + if (workDoneProgress && workDoneProgress.constructor !== nullProgressReporter.constructor) { + reporter = workDoneProgress; + } else { + reporter = workDoneProgress || await this.connection.window.createWorkDoneProgress(); + } + return reporter; + } + async withProgress(options, task) { + const {message: message, reporter: reporter} = options; + reporter.begin(message); + return task(reporter).then((result => { + reporter.done(); + return result; + })); + } + publishDiagnostics(params) { + this.connection.sendDiagnostics(params); + } + showErrorMessage(message) { + this.connection.sendNotification(main$3.ShowMessageNotification.type, { + type: main$3.MessageType.Error, + message: message + }); + } + logMessage(args) { + this.connection.sendNotification(main$3.LogMessageNotification.type, args); + } + async applyWorkspaceEdit(params) { + return this.connection.workspace.applyEdit(params); + } + async rename(args) { + return this.connection.sendRequest(TypeScriptRenameRequest.type, args); + } + async sendNotification(type, params) { + await this.connection.sendNotification(type, params); + } +} + +function createLspConnection(options) { + const connection = lsp.createConnection(lsp.ProposedFeatures.all); + const lspClient = new LspClientImpl(connection); + const logger = new LspClientLogger(lspClient, options.showMessageLevel); + const server = new LspServer({ + logger: logger, + lspClient: lspClient + }); + connection.onInitialize(server.initialize.bind(server)); + connection.onInitialized(server.initialized.bind(server)); + connection.onDidChangeConfiguration(server.didChangeConfiguration.bind(server)); + connection.onDidOpenTextDocument(server.didOpenTextDocument.bind(server)); + connection.onDidSaveTextDocument(server.didSaveTextDocument.bind(server)); + connection.onDidCloseTextDocument(server.didCloseTextDocument.bind(server)); + connection.onDidChangeTextDocument(server.didChangeTextDocument.bind(server)); + connection.onCodeAction(server.codeAction.bind(server)); + connection.onCodeLens(server.codeLens.bind(server)); + connection.onCodeLensResolve(server.codeLensResolve.bind(server)); + connection.onCompletion(server.completion.bind(server)); + connection.onCompletionResolve(server.completionResolve.bind(server)); + connection.onDefinition(server.definition.bind(server)); + connection.onImplementation(server.implementation.bind(server)); + connection.onTypeDefinition(server.typeDefinition.bind(server)); + connection.onDocumentFormatting(server.documentFormatting.bind(server)); + connection.onDocumentRangeFormatting(server.documentRangeFormatting.bind(server)); + connection.onDocumentHighlight(server.documentHighlight.bind(server)); + connection.onDocumentSymbol(server.documentSymbol.bind(server)); + connection.onExecuteCommand(server.executeCommand.bind(server)); + connection.onHover(server.hover.bind(server)); + connection.onReferences(server.references.bind(server)); + connection.onRenameRequest(server.rename.bind(server)); + connection.onPrepareRename(server.prepareRename.bind(server)); + connection.onSelectionRanges(server.selectionRanges.bind(server)); + connection.onSignatureHelp(server.signatureHelp.bind(server)); + connection.onWorkspaceSymbol(server.workspaceSymbol.bind(server)); + connection.onFoldingRanges(server.foldingRanges.bind(server)); + connection.languages.onLinkedEditingRange(server.linkedEditingRange.bind(server)); + connection.languages.callHierarchy.onPrepare(server.prepareCallHierarchy.bind(server)); + connection.languages.callHierarchy.onIncomingCalls(server.callHierarchyIncomingCalls.bind(server)); + connection.languages.callHierarchy.onOutgoingCalls(server.callHierarchyOutgoingCalls.bind(server)); + connection.languages.inlayHint.on(server.inlayHints.bind(server)); + connection.languages.semanticTokens.on(server.semanticTokensFull.bind(server)); + connection.languages.semanticTokens.onRange(server.semanticTokensRange.bind(server)); + connection.workspace.onWillRenameFiles(server.willRenameFiles.bind(server)); + return connection; +} + +const DEFAULT_LOG_LEVEL = lsp$1.MessageType.Info; + +const {version: version} = JSON.parse(readFileSync$1(new URL('../package.json', import.meta.url), { + encoding: 'utf8' +})); + +const program = new Command('typescript-language-server').version(version).requiredOption('--stdio', 'use stdio').option('--log-level ', 'A number indicating the log level (4 = log, 3 = info, 2 = warn, 1 = error). Defaults to `2`.').parse(process.argv); + +const options = program.opts(); + +let logLevel = DEFAULT_LOG_LEVEL; + +if (options.logLevel) { + logLevel = parseInt(options.logLevel, 10); + if (logLevel && (logLevel < 1 || logLevel > 4)) { + console.error(`Invalid '--log-level ${logLevel}'. Falling back to 'info' level.`); + logLevel = DEFAULT_LOG_LEVEL; + } +} + +createLspConnection({ + showMessageLevel: logLevel +}).listen(); +//# sourceMappingURL=cli.mjs.map diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/lib/cli.mjs.map b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/lib/cli.mjs.map new file mode 100644 index 00000000..bcd8e707 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript-language-server/lib/cli.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.mjs","sources":["../node_modules/commander/lib/error.js","../node_modules/commander/lib/argument.js","../node_modules/commander/lib/help.js","../node_modules/commander/lib/option.js","../node_modules/commander/lib/suggestSimilar.js","../node_modules/commander/lib/command.js","../node_modules/commander/index.js","../node_modules/commander/esm.mjs","../node_modules/vscode-languageserver/lib/common/utils/is.js","../node_modules/vscode-jsonrpc/lib/common/is.js","../node_modules/vscode-jsonrpc/lib/common/messages.js","../node_modules/vscode-jsonrpc/lib/common/linkedMap.js","../node_modules/vscode-jsonrpc/lib/common/disposable.js","../node_modules/vscode-jsonrpc/lib/common/ral.js","../node_modules/vscode-jsonrpc/lib/common/events.js","../node_modules/vscode-jsonrpc/lib/common/cancellation.js","../node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js","../node_modules/vscode-jsonrpc/lib/common/semaphore.js","../node_modules/vscode-jsonrpc/lib/common/messageReader.js","../node_modules/vscode-jsonrpc/lib/common/messageWriter.js","../node_modules/vscode-jsonrpc/lib/common/messageBuffer.js","../node_modules/vscode-jsonrpc/lib/common/connection.js","../node_modules/vscode-jsonrpc/lib/common/api.js","../node_modules/vscode-jsonrpc/lib/node/ril.js","../node_modules/vscode-jsonrpc/lib/node/main.js","../node_modules/vscode-jsonrpc/node.js","../node_modules/vscode-languageserver-types/lib/umd/main.js","../node_modules/vscode-languageserver-protocol/lib/common/messages.js","../node_modules/vscode-languageserver-protocol/lib/common/utils/is.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js","../node_modules/vscode-languageserver-protocol/lib/common/protocol.js","../node_modules/vscode-languageserver-protocol/lib/common/connection.js","../node_modules/vscode-languageserver-protocol/lib/common/api.js","../node_modules/vscode-languageserver-protocol/lib/node/main.js","../node_modules/vscode-languageserver/lib/common/utils/uuid.js","../node_modules/vscode-languageserver/lib/common/progress.js","../node_modules/vscode-languageserver/lib/common/configuration.js","../node_modules/vscode-languageserver/lib/common/workspaceFolder.js","../node_modules/vscode-languageserver/lib/common/callHierarchy.js","../node_modules/vscode-languageserver/lib/common/semanticTokens.js","../node_modules/vscode-languageserver/lib/common/showDocument.js","../node_modules/vscode-languageserver/lib/common/fileOperations.js","../node_modules/vscode-languageserver/lib/common/linkedEditingRange.js","../node_modules/vscode-languageserver/lib/common/typeHierarchy.js","../node_modules/vscode-languageserver/lib/common/inlineValue.js","../node_modules/vscode-languageserver/lib/common/foldingRange.js","../node_modules/vscode-languageserver/lib/common/inlayHint.js","../node_modules/vscode-languageserver/lib/common/diagnostic.js","../node_modules/vscode-languageserver/lib/common/textDocuments.js","../node_modules/vscode-languageserver/lib/common/notebook.js","../node_modules/vscode-languageserver/lib/common/moniker.js","../node_modules/vscode-languageserver/lib/common/server.js","../node_modules/vscode-languageserver/lib/node/files.js","../node_modules/vscode-languageserver-protocol/node.js","../node_modules/vscode-languageserver/lib/common/inlineCompletion.proposed.js","../node_modules/vscode-languageserver/lib/common/api.js","../node_modules/vscode-languageserver/lib/node/main.js","../node_modules/vscode-languageserver/node.js","../src/utils/logger.ts","../node_modules/universalify/index.js","../node_modules/graceful-fs/polyfills.js","../node_modules/graceful-fs/legacy-streams.js","../node_modules/graceful-fs/clone.js","../node_modules/graceful-fs/graceful-fs.js","../node_modules/fs-extra/lib/fs/index.js","../node_modules/fs-extra/lib/mkdirs/utils.js","../node_modules/fs-extra/lib/mkdirs/make-dir.js","../node_modules/fs-extra/lib/mkdirs/index.js","../node_modules/fs-extra/lib/path-exists/index.js","../node_modules/fs-extra/lib/util/utimes.js","../node_modules/fs-extra/lib/util/stat.js","../node_modules/fs-extra/lib/copy/copy.js","../node_modules/fs-extra/lib/copy/copy-sync.js","../node_modules/fs-extra/lib/copy/index.js","../node_modules/fs-extra/lib/remove/index.js","../node_modules/fs-extra/lib/empty/index.js","../node_modules/fs-extra/lib/ensure/file.js","../node_modules/fs-extra/lib/ensure/link.js","../node_modules/fs-extra/lib/ensure/symlink-paths.js","../node_modules/fs-extra/lib/ensure/symlink-type.js","../node_modules/fs-extra/lib/ensure/symlink.js","../node_modules/fs-extra/lib/ensure/index.js","../node_modules/jsonfile/utils.js","../node_modules/jsonfile/index.js","../node_modules/fs-extra/lib/json/jsonfile.js","../node_modules/fs-extra/lib/output-file/index.js","../node_modules/fs-extra/lib/json/output-json.js","../node_modules/fs-extra/lib/json/output-json-sync.js","../node_modules/fs-extra/lib/json/index.js","../node_modules/fs-extra/lib/move/move.js","../node_modules/fs-extra/lib/move/move-sync.js","../node_modules/fs-extra/lib/move/index.js","../node_modules/fs-extra/lib/index.js","../node_modules/vscode-uri/lib/esm/index.mjs","../node_modules/vscode-languageserver-textdocument/lib/esm/main.js","../src/configuration/languageIds.ts","../src/ts-protocol.ts","../src/typescriptService.ts","../node_modules/semver/internal/constants.js","../node_modules/semver/internal/debug.js","../node_modules/semver/internal/re.js","../node_modules/semver/internal/parse-options.js","../node_modules/semver/internal/identifiers.js","../node_modules/semver/classes/semver.js","../node_modules/semver/functions/parse.js","../node_modules/semver/functions/valid.js","../node_modules/semver/functions/clean.js","../node_modules/semver/functions/inc.js","../node_modules/semver/functions/diff.js","../node_modules/semver/functions/major.js","../node_modules/semver/functions/minor.js","../node_modules/semver/functions/patch.js","../node_modules/semver/functions/prerelease.js","../node_modules/semver/functions/compare.js","../node_modules/semver/functions/rcompare.js","../node_modules/semver/functions/compare-loose.js","../node_modules/semver/functions/compare-build.js","../node_modules/semver/functions/sort.js","../node_modules/semver/functions/rsort.js","../node_modules/semver/functions/gt.js","../node_modules/semver/functions/lt.js","../node_modules/semver/functions/eq.js","../node_modules/semver/functions/neq.js","../node_modules/semver/functions/gte.js","../node_modules/semver/functions/lte.js","../node_modules/semver/functions/cmp.js","../node_modules/semver/functions/coerce.js","../node_modules/yallist/iterator.js","../node_modules/yallist/yallist.js","../node_modules/lru-cache/index.js","../node_modules/semver/classes/range.js","../node_modules/semver/classes/comparator.js","../node_modules/semver/functions/satisfies.js","../node_modules/semver/ranges/to-comparators.js","../node_modules/semver/ranges/max-satisfying.js","../node_modules/semver/ranges/min-satisfying.js","../node_modules/semver/ranges/min-version.js","../node_modules/semver/ranges/valid.js","../node_modules/semver/ranges/outside.js","../node_modules/semver/ranges/gtr.js","../node_modules/semver/ranges/ltr.js","../node_modules/semver/ranges/intersects.js","../node_modules/semver/ranges/simplify.js","../node_modules/semver/ranges/subset.js","../node_modules/semver/index.js","../src/utils/api.ts","../src/utils/arrays.ts","../src/utils/async.ts","../src/utils/temp.ts","../src/utils/fs.ts","../src/utils/resourceMap.ts","../src/document.ts","../src/configuration/fileSchemes.ts","../src/tsServer/plugins.ts","../src/tsServer/serverError.ts","../node_modules/crypto-random-string/index.js","../node_modules/unique-string/index.js","../node_modules/temp-dir/index.js","../node_modules/tempy/index.js","../src/tsServer/cancellation.ts","../src/tsServer/requestQueue.ts","../src/tsServer/callbackMap.ts","../src/tsServer/server.ts","../src/tsServer/serverProcess.ts","../src/utils/configuration.ts","../src/tsServer/spawner.ts","../src/tsServer/tracer.ts","../src/utils/uri.ts","../src/ts-client.ts","../node_modules/p-debounce/index.js","../src/utils/typeConverters.ts","../src/protocol-translation.ts","../src/diagnostic-queue.ts","../src/features/source-definition.ts","../src/commands.ts","../src/utils/MarkdownString.ts","../src/utils/previewer.ts","../src/utils/SnippetString.ts","../src/completion.ts","../src/hover.ts","../src/quickfix.ts","../src/refactor.ts","../src/utils/types.ts","../src/organize-imports.ts","../src/document-symbol.ts","../src/features/call-hierarchy.ts","../node_modules/deepmerge/dist/cjs.js","../src/utils/objects.ts","../src/utils/tsconfig.ts","../src/features/fileConfigurationManager.ts","../src/utils/errorCodes.ts","../src/utils/fixNames.ts","../src/features/fix-all.ts","../src/utils/regexp.ts","../src/features/code-lens/baseCodeLensProvider.ts","../src/features/code-lens/implementationsCodeLens.ts","../src/features/code-lens/referencesCodeLens.ts","../src/features/inlay-hints.ts","../src/features/semantic-tokens.ts","../src/tsServer/cachedResponse.ts","../src/tsServer/logDirectoryProvider.ts","../node_modules/isexe/dist/cjs/posix.js","../node_modules/isexe/dist/cjs/win32.js","../node_modules/isexe/dist/cjs/options.js","../node_modules/isexe/dist/cjs/index.js","../node_modules/which/lib/index.js","../node_modules/pkg-up/node_modules/locate-path/index.js","../node_modules/pkg-up/node_modules/find-up/index.js","../node_modules/pkg-up/index.js","../src/utils/modules-resolver.ts","../src/tsServer/versionProvider.ts","../src/lsp-server.ts","../src/lsp-client.ts","../src/lsp-connection.ts","../src/cli.ts"],"sourcesContent":["/**\n * CommanderError class\n * @class\n */\nclass CommanderError extends Error {\n /**\n * Constructs the CommanderError class\n * @param {number} exitCode suggested exit code which could be used with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @constructor\n */\n constructor(exitCode, code, message) {\n super(message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n this.code = code;\n this.exitCode = exitCode;\n this.nestedError = undefined;\n }\n}\n\n/**\n * InvalidArgumentError class\n * @class\n */\nclass InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param {string} [message] explanation of why argument is invalid\n * @constructor\n */\n constructor(message) {\n super(1, 'commander.invalidArgument', message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n }\n}\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\n","const { InvalidArgumentError } = require('./error.js');\n\nclass Argument {\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @param {string} name\n * @param {string} [description]\n */\n\n constructor(name, description) {\n this.description = description || '';\n this.variadic = false;\n this.parseArg = undefined;\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.argChoices = undefined;\n\n switch (name[0]) {\n case '<': // e.g. \n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.length > 3 && this._name.slice(-3) === '...') {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package internal use only\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(', ')}.`);\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nfunction humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required\n ? '<' + nameOutput + '>'\n : '[' + nameOutput + ']';\n}\n\nexports.Argument = Argument;\nexports.humanReadableArgName = humanReadableArgName;\n","const { humanReadableArgName } = require('./argument.js');\n\n/**\n * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`\n * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types\n * @typedef { import(\"./argument.js\").Argument } Argument\n * @typedef { import(\"./command.js\").Command } Command\n * @typedef { import(\"./option.js\").Option } Option\n */\n\n// Although this is a class, methods are static in style to allow override using subclass or just functions.\nclass Help {\n constructor() {\n this.helpWidth = undefined;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter(cmd => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns number\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short ? option.short.replace(/^-/, '') : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(cmd.createOption(helpOption.long, helpOption.description));\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(cmd.createOption(helpOption.short, helpOption.description));\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) {\n const visibleOptions = ancestorCmd.options.filter((option) => !option.hidden);\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach(argument => {\n argument.description = argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find(argument => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments.map(arg => humanReadableArgName(arg)).join(' ');\n return cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '');\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(max, helper.subcommandTerm(command).length);\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(max, helper.optionTerm(option).length);\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(max, helper.optionTerm(option).length);\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(max, helper.argumentTerm(argument).length);\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault = option.required || option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`);\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n return `${option.description} (${extraInfo.join(', ')})`;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`);\n }\n if (extraInfo.length > 0) {\n const extraDescripton = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescripton}`;\n }\n return extraDescripton;\n }\n return argument.description;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth || 80;\n const itemIndentWidth = 2;\n const itemSeparatorWidth = 2; // between term and description\n function formatItem(term, description) {\n if (description) {\n const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;\n return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth);\n }\n return term;\n }\n function formatList(textArray) {\n return textArray.join('\\n').replace(/^/gm, ' '.repeat(itemIndentWidth));\n }\n\n // Usage\n let output = [`Usage: ${helper.commandUsage(cmd)}`, ''];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([helper.wrap(commandDescription, helpWidth, 0), '']);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument));\n });\n if (argumentList.length > 0) {\n output = output.concat(['Arguments:', formatList(argumentList), '']);\n }\n\n // Options\n const optionList = helper.visibleOptions(cmd).map((option) => {\n return formatItem(helper.optionTerm(option), helper.optionDescription(option));\n });\n if (optionList.length > 0) {\n output = output.concat(['Options:', formatList(optionList), '']);\n }\n\n if (this.showGlobalOptions) {\n const globalOptionList = helper.visibleGlobalOptions(cmd).map((option) => {\n return formatItem(helper.optionTerm(option), helper.optionDescription(option));\n });\n if (globalOptionList.length > 0) {\n output = output.concat(['Global Options:', formatList(globalOptionList), '']);\n }\n }\n\n // Commands\n const commandList = helper.visibleCommands(cmd).map((cmd) => {\n return formatItem(helper.subcommandTerm(cmd), helper.subcommandDescription(cmd));\n });\n if (commandList.length > 0) {\n output = output.concat(['Commands:', formatList(commandList), '']);\n }\n\n return output.join('\\n');\n }\n\n /**\n * Calculate the pad width from the maximum term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n padWidth(cmd, helper) {\n return Math.max(\n helper.longestOptionTermLength(cmd, helper),\n helper.longestGlobalOptionTermLength(cmd, helper),\n helper.longestSubcommandTermLength(cmd, helper),\n helper.longestArgumentTermLength(cmd, helper)\n );\n }\n\n /**\n * Wrap the given string to width characters per line, with lines after the first indented.\n * Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted.\n *\n * @param {string} str\n * @param {number} width\n * @param {number} indent\n * @param {number} [minColumnWidth=40]\n * @return {string}\n *\n */\n\n wrap(str, width, indent, minColumnWidth = 40) {\n // Full \\s characters, minus the linefeeds.\n const indents = ' \\\\f\\\\t\\\\v\\u00a0\\u1680\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff';\n // Detect manually wrapped and indented strings by searching for line break followed by spaces.\n const manualIndent = new RegExp(`[\\\\n][${indents}]+`);\n if (str.match(manualIndent)) return str;\n // Do not wrap if not enough room for a wrapped column of text (as could end up with a word per line).\n const columnWidth = width - indent;\n if (columnWidth < minColumnWidth) return str;\n\n const leadingStr = str.slice(0, indent);\n const columnText = str.slice(indent).replace('\\r\\n', '\\n');\n const indentString = ' '.repeat(indent);\n const zeroWidthSpace = '\\u200B';\n const breaks = `\\\\s${zeroWidthSpace}`;\n // Match line end (so empty lines don't collapse),\n // or as much text as will fit in column, or excess text up to first break.\n const regex = new RegExp(`\\n|.{1,${columnWidth - 1}}([${breaks}]|$)|[^${breaks}]+?([${breaks}]|$)`, 'g');\n const lines = columnText.match(regex) || [];\n return leadingStr + lines.map((line, i) => {\n if (line === '\\n') return ''; // preserve empty lines\n return ((i > 0) ? indentString : '') + line.trimEnd();\n }).join('\\n');\n }\n}\n\nexports.Help = Help;\n","const { InvalidArgumentError } = require('./error.js');\n\nclass Option {\n /**\n * Initialize a new `Option` with the given `flags` and `description`.\n *\n * @param {string} flags\n * @param {string} [description]\n */\n\n constructor(flags, description) {\n this.flags = flags;\n this.description = description || '';\n\n this.required = flags.includes('<'); // A value must be supplied when the option is specified.\n this.optional = flags.includes('['); // A value is optional when the option is specified.\n // variadic test ignores et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag;\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {Object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package internal use only\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(', ')}.`);\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as a object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package internal use only\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package internal use only\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nclass DualOptions {\n /**\n * @param {Option[]} options\n */\n constructor(options) {\n this.positiveOptions = new Map();\n this.negativeOptions = new Map();\n this.dualOptions = new Set();\n options.forEach(option => {\n if (option.negate) {\n this.negativeOptions.set(option.attributeName(), option);\n } else {\n this.positiveOptions.set(option.attributeName(), option);\n }\n });\n this.negativeOptions.forEach((value, key) => {\n if (this.positiveOptions.has(key)) {\n this.dualOptions.add(key);\n }\n });\n }\n\n /**\n * Did the value come from the option, and not from possible matching dual option?\n *\n * @param {*} value\n * @param {Option} option\n * @returns {boolean}\n */\n valueFromOption(value, option) {\n const optionKey = option.attributeName();\n if (!this.dualOptions.has(optionKey)) return true;\n\n // Use the value to deduce if (probably) came from the option.\n const preset = this.negativeOptions.get(optionKey).presetArg;\n const negativeValue = (preset !== undefined) ? preset : false;\n return option.negate === (negativeValue === value);\n }\n}\n\n/**\n * Convert string from kebab-case to camelCase.\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction camelcase(str) {\n return str.split('-').reduce((str, word) => {\n return str + word[0].toUpperCase() + word.slice(1);\n });\n}\n\n/**\n * Split the short and long flag out of something like '-m,--mixed '\n *\n * @private\n */\n\nfunction splitOptionFlags(flags) {\n let shortFlag;\n let longFlag;\n // Use original very loose parsing to maintain backwards compatibility for now,\n // which allowed for example unintended `-sw, --short-word` [sic].\n const flagParts = flags.split(/[ |,]+/);\n if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) shortFlag = flagParts.shift();\n longFlag = flagParts.shift();\n // Add support for lone short flag without significantly changing parsing!\n if (!shortFlag && /^-[^-]$/.test(longFlag)) {\n shortFlag = longFlag;\n longFlag = undefined;\n }\n return { shortFlag, longFlag };\n}\n\nexports.Option = Option;\nexports.DualOptions = DualOptions;\n","const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance\n // Calculating optimal string alignment distance, no substring is edited more than once.\n // (Simple implementation.)\n\n // Quick early exit, return worst case.\n if (Math.abs(a.length - b.length) > maxDistance) return Math.max(a.length, b.length);\n\n // distance between prefix substrings of a and b\n const d = [];\n\n // pure deletions turn a into empty string\n for (let i = 0; i <= a.length; i++) {\n d[i] = [i];\n }\n // pure insertions turn empty string into b\n for (let j = 0; j <= b.length; j++) {\n d[0][j] = j;\n }\n\n // fill matrix\n for (let j = 1; j <= b.length; j++) {\n for (let i = 1; i <= a.length; i++) {\n let cost = 1;\n if (a[i - 1] === b[j - 1]) {\n cost = 0;\n } else {\n cost = 1;\n }\n d[i][j] = Math.min(\n d[i - 1][j] + 1, // deletion\n d[i][j - 1] + 1, // insertion\n d[i - 1][j - 1] + cost // substitution\n );\n // transposition\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);\n }\n }\n }\n\n return d[a.length][b.length];\n}\n\n/**\n * Find close matches, restricted to same number of edits.\n *\n * @param {string} word\n * @param {string[]} candidates\n * @returns {string}\n */\n\nfunction suggestSimilar(word, candidates) {\n if (!candidates || candidates.length === 0) return '';\n // remove possible duplicates\n candidates = Array.from(new Set(candidates));\n\n const searchingOptions = word.startsWith('--');\n if (searchingOptions) {\n word = word.slice(2);\n candidates = candidates.map(candidate => candidate.slice(2));\n }\n\n let similar = [];\n let bestDistance = maxDistance;\n const minSimilarity = 0.4;\n candidates.forEach((candidate) => {\n if (candidate.length <= 1) return; // no one character guesses\n\n const distance = editDistance(word, candidate);\n const length = Math.max(word.length, candidate.length);\n const similarity = (length - distance) / length;\n if (similarity > minSimilarity) {\n if (distance < bestDistance) {\n // better edit distance, throw away previous worse matches\n bestDistance = distance;\n similar = [candidate];\n } else if (distance === bestDistance) {\n similar.push(candidate);\n }\n }\n });\n\n similar.sort((a, b) => a.localeCompare(b));\n if (searchingOptions) {\n similar = similar.map(candidate => `--${candidate}`);\n }\n\n if (similar.length > 1) {\n return `\\n(Did you mean one of ${similar.join(', ')}?)`;\n }\n if (similar.length === 1) {\n return `\\n(Did you mean ${similar[0]}?)`;\n }\n return '';\n}\n\nexports.suggestSimilar = suggestSimilar;\n","const EventEmitter = require('events').EventEmitter;\nconst childProcess = require('child_process');\nconst path = require('path');\nconst fs = require('fs');\nconst process = require('process');\n\nconst { Argument, humanReadableArgName } = require('./argument.js');\nconst { CommanderError } = require('./error.js');\nconst { Help } = require('./help.js');\nconst { Option, DualOptions } = require('./option.js');\nconst { suggestSimilar } = require('./suggestSimilar');\n\nclass Command extends EventEmitter {\n /**\n * Initialize a new `Command`.\n *\n * @param {string} [name]\n */\n\n constructor(name) {\n super();\n /** @type {Command[]} */\n this.commands = [];\n /** @type {Option[]} */\n this.options = [];\n this.parent = null;\n this._allowUnknownOption = false;\n this._allowExcessArguments = true;\n /** @type {Argument[]} */\n this.registeredArguments = [];\n this._args = this.registeredArguments; // deprecated old name\n /** @type {string[]} */\n this.args = []; // cli args with options removed\n this.rawArgs = [];\n this.processedArgs = []; // like .args but after custom processing and collecting variadic\n this._scriptPath = null;\n this._name = name || '';\n this._optionValues = {};\n this._optionValueSources = {}; // default, env, cli etc\n this._storeOptionsAsProperties = false;\n this._actionHandler = null;\n this._executableHandler = false;\n this._executableFile = null; // custom name for executable\n this._executableDir = null; // custom search directory for subcommands\n this._defaultCommandName = null;\n this._exitCallback = null;\n this._aliases = [];\n this._combineFlagAndOptionalValue = true;\n this._description = '';\n this._summary = '';\n this._argsDescription = undefined; // legacy\n this._enablePositionalOptions = false;\n this._passThroughOptions = false;\n this._lifeCycleHooks = {}; // a hash of arrays\n /** @type {(boolean | string)} */\n this._showHelpAfterError = false;\n this._showSuggestionAfterError = true;\n\n // see .configureOutput() for docs\n this._outputConfiguration = {\n writeOut: (str) => process.stdout.write(str),\n writeErr: (str) => process.stderr.write(str),\n getOutHelpWidth: () => process.stdout.isTTY ? process.stdout.columns : undefined,\n getErrHelpWidth: () => process.stderr.isTTY ? process.stderr.columns : undefined,\n outputError: (str, write) => write(str)\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue = sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n *\n * // Command implemented using separate executable file (description is second parameter to `.command`)\n * program\n * .command('start ', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n *\n * @param {string} nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...`\n * @param {(Object|string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {Object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {Object} [configuration] - configuration options\n * @return {(Command|Object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // functions to change where being written, stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // matching functions to specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // functions based on what is being written out\n * outputError(str, write) // used for displaying errors, and not used for displaying help\n *\n * @param {Object} [configuration] - configuration options\n * @return {(Command|Object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n Object.assign(this._outputConfiguration, configuration);\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {Object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [fn] - custom argument processing function\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, fn, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof fn === 'function') {\n argument.default(defaultValue).argParser(fn);\n } else {\n argument.default(fn);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments(' [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names.trim().split(/ +/).forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument && previousArgument.variadic) {\n throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);\n }\n if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {\n throw new Error(`a default value for a required argument is never used: '${argument.name()}'`);\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n return this;\n }\n\n enableOrNameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = enableOrNameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand = this._addImplicitHelpCommand ??\n (this.commands.length && !this._actionHandler && !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @api private\n */\n\n _registerOption(option) {\n const matchingOption = (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag = (option.long && this._findOption(option.long)) ? option.long : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @api private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) => this._findCommand(name));\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(`cannot add command '${newCmd}' as already have command '${existingCmd}'`);\n }\n\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.negate) {\n // --no-foo is special and defaults foo to true, unless a --foo option is already defined\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(name, option.defaultValue === undefined ? true : option.defaultValue, 'default');\n }\n } else if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._concatValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error('To add an Option object use addOption() instead of option() or requiredOption()');\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('-p, --pizza-type ', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip ', 'add tip to purchase cost', parseFloat) // custom parse function\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n option(flags, description, parseArg, defaultValue) {\n return this._optionEx({}, flags, description, parseArg, defaultValue);\n }\n\n /**\n * Add a required option which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n requiredOption(flags, description, parseArg, defaultValue) {\n return this._optionEx({ mandatory: true }, flags, description, parseArg, defaultValue);\n }\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * // for `.option('-f,--flag [value]'):\n * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour\n * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n *\n * @param {boolean} [combine=true] - if `true` or omitted, an optional value can be specified directly after the flag.\n */\n combineFlagAndOptionalValue(combine = true) {\n this._combineFlagAndOptionalValue = !!combine;\n return this;\n }\n\n /**\n * Allow unknown options on the command line.\n *\n * @param {boolean} [allowUnknown=true] - if `true` or omitted, no error will be thrown\n * for unknown options.\n */\n allowUnknownOption(allowUnknown = true) {\n this._allowUnknownOption = !!allowUnknown;\n return this;\n }\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @param {boolean} [allowExcess=true] - if `true` or omitted, no error will be thrown\n * for excess arguments.\n */\n allowExcessArguments(allowExcess = true) {\n this._allowExcessArguments = !!allowExcess;\n return this;\n }\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @param {boolean} [positional=true]\n */\n enablePositionalOptions(positional = true) {\n this._enablePositionalOptions = !!positional;\n return this;\n }\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @param {boolean} [passThrough=true]\n * for unknown options.\n */\n passThroughOptions(passThrough = true) {\n this._passThroughOptions = !!passThrough;\n this._checkForBrokenPassThrough();\n return this;\n }\n\n /**\n * @private\n */\n\n _checkForBrokenPassThrough() {\n if (this.parent && this._passThroughOptions && !this.parent._enablePositionalOptions) {\n throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`);\n }\n }\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @param {boolean} [storeAsProperties=true]\n * @return {Command} `this` command for chaining\n */\n\n storeOptionsAsProperties(storeAsProperties = true) {\n if (this.options.length) {\n throw new Error('call .storeOptionsAsProperties() before adding options');\n }\n if (Object.keys(this._optionValues).length) {\n throw new Error('call .storeOptionsAsProperties() before setting option values');\n }\n this._storeOptionsAsProperties = !!storeAsProperties;\n return this;\n }\n\n /**\n * Retrieve option value.\n *\n * @param {string} key\n * @return {Object} value\n */\n\n getOptionValue(key) {\n if (this._storeOptionsAsProperties) {\n return this[key];\n }\n return this._optionValues[key];\n }\n\n /**\n * Store option value.\n *\n * @param {string} key\n * @param {Object} value\n * @return {Command} `this` command for chaining\n */\n\n setOptionValue(key, value) {\n return this.setOptionValueWithSource(key, value, undefined);\n }\n\n /**\n * Store option value and where the value came from.\n *\n * @param {string} key\n * @param {Object} value\n * @param {string} source - expected values are default/config/env/cli/implied\n * @return {Command} `this` command for chaining\n */\n\n setOptionValueWithSource(key, value, source) {\n if (this._storeOptionsAsProperties) {\n this[key] = value;\n } else {\n this._optionValues[key] = value;\n }\n this._optionValueSources[key] = source;\n return this;\n }\n\n /**\n * Get source of option value.\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSource(key) {\n return this._optionValueSources[key];\n }\n\n /**\n * Get source of option value. See also .optsWithGlobals().\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSourceWithGlobals(key) {\n // global overwrites local, like optsWithGlobals\n let source;\n this._getCommandAndAncestors().forEach((cmd) => {\n if (cmd.getOptionValueSource(key) !== undefined) {\n source = cmd.getOptionValueSource(key);\n }\n });\n return source;\n }\n\n /**\n * Get user arguments from implied or explicit arguments.\n * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.\n *\n * @private\n */\n\n _prepareUserArgs(argv, parseOptions) {\n if (argv !== undefined && !Array.isArray(argv)) {\n throw new Error('first parameter to parse must be array or undefined');\n }\n parseOptions = parseOptions || {};\n\n // Default to using process.argv\n if (argv === undefined) {\n argv = process.argv;\n // @ts-ignore: unknown property\n if (process.versions && process.versions.electron) {\n parseOptions.from = 'electron';\n }\n }\n this.rawArgs = argv.slice();\n\n // make it a little easier for callers by supporting various argv conventions\n let userArgs;\n switch (parseOptions.from) {\n case undefined:\n case 'node':\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n break;\n case 'electron':\n // @ts-ignore: unknown property\n if (process.defaultApp) {\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n } else {\n userArgs = argv.slice(1);\n }\n break;\n case 'user':\n userArgs = argv.slice(0);\n break;\n default:\n throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);\n }\n\n // Find default name for program from arguments.\n if (!this._name && this._scriptPath) this.nameFromFilename(this._scriptPath);\n this._name = this._name || 'program';\n\n return userArgs;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * The default expectation is that the arguments are from node and have the application as argv[0]\n * and the script being run in argv[1], with user parameters after that.\n *\n * @example\n * program.parse(process.argv);\n * program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv] - optional, defaults to process.argv\n * @param {Object} [parseOptions] - optionally specify style of options with from: node/user/electron\n * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'\n * @return {Command} `this` command for chaining\n */\n\n parse(argv, parseOptions) {\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n this._parseCommand([], userArgs);\n\n return this;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.\n *\n * The default expectation is that the arguments are from node and have the application as argv[0]\n * and the script being run in argv[1], with user parameters after that.\n *\n * @example\n * await program.parseAsync(process.argv);\n * await program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv]\n * @param {Object} [parseOptions]\n * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'\n * @return {Promise}\n */\n\n async parseAsync(argv, parseOptions) {\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n await this._parseCommand([], userArgs);\n\n return this;\n }\n\n /**\n * Execute a sub-command executable.\n *\n * @private\n */\n\n _executeSubCommand(subcommand, args) {\n args = args.slice();\n let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.\n const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];\n\n function findFile(baseDir, baseName) {\n // Look for specified file\n const localBin = path.resolve(baseDir, baseName);\n if (fs.existsSync(localBin)) return localBin;\n\n // Stop looking if candidate already has an expected extension.\n if (sourceExt.includes(path.extname(baseName))) return undefined;\n\n // Try all the extensions.\n const foundExt = sourceExt.find(ext => fs.existsSync(`${localBin}${ext}`));\n if (foundExt) return `${localBin}${foundExt}`;\n\n return undefined;\n }\n\n // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // executableFile and executableDir might be full path, or just a name\n let executableFile = subcommand._executableFile || `${this._name}-${subcommand._name}`;\n let executableDir = this._executableDir || '';\n if (this._scriptPath) {\n let resolvedScriptPath; // resolve possible symlink for installed npm binary\n try {\n resolvedScriptPath = fs.realpathSync(this._scriptPath);\n } catch (err) {\n resolvedScriptPath = this._scriptPath;\n }\n executableDir = path.resolve(path.dirname(resolvedScriptPath), executableDir);\n }\n\n // Look for a local file in preference to a command in PATH.\n if (executableDir) {\n let localFile = findFile(executableDir, executableFile);\n\n // Legacy search using prefix of script name instead of command name\n if (!localFile && !subcommand._executableFile && this._scriptPath) {\n const legacyName = path.basename(this._scriptPath, path.extname(this._scriptPath));\n if (legacyName !== this._name) {\n localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);\n }\n }\n executableFile = localFile || executableFile;\n }\n\n launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) { // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n // @ts-ignore\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code, _signal) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(new CommanderError(code, 'commander.executeSubCommandAsync', '(close)'));\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore\n if (err.code === 'ENOENT') {\n const executableDirMessage = executableDir\n ? `searched for local subcommand relative to directory '${executableDir}'`\n : 'no directory for search for local subcommand, use .executableDir() to supply a custom directory';\n const executableMissing = `'${executableFile}' does not exist\n - if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${executableDirMessage}`;\n throw new Error(executableMissing);\n // @ts-ignore\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(1, 'commander.executeSubCommandAsync', '(error)');\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(promiseChain, subCommand, 'preSubcommand');\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(subcommandName, [], [\n this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'\n ]);\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (this.registeredArguments.length > 0 && this.registeredArguments[this.registeredArguments.length - 1].variadic) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(argument, value, previous, invalidValueMessage);\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise && promise.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter(cmd => cmd._lifeCycleHooks[event] !== undefined)\n .forEach(hookedCommand => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (this._getHelpCommand() && operands[0] === this._getHelpCommand().name()) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(this._defaultCommandName, operands, unknown);\n }\n if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () => this._actionHandler(this.processedArgs));\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent && this.parent.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) { // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(cmd => cmd._name === name || cmd._aliases.includes(name));\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package internal use only\n */\n\n _findOption(arg) {\n return this.options.find(option => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (anOption.mandatory && (cmd.getOptionValue(anOption.attributeName()) === undefined)) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter(\n (option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n }\n );\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName())\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} argv\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(argv) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n const args = argv.slice();\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n // parse options\n let activeVariadicOption = null;\n while (args.length) {\n const arg = args.shift();\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args);\n break;\n }\n\n if (activeVariadicOption && !maybeOption(arg)) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args.shift();\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (args.length > 0 && !maybeOption(args[0])) {\n value = args.shift();\n }\n this.emit(`option:${option.name()}`, value);\n } else { // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (option.required || (option.optional && this._combineFlagAndOptionalValue)) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option, emit and put back remainder of arg for further processing\n this.emit(`option:${option.name()}`);\n args.unshift(`-${arg.slice(2)}`);\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n if (maybeOption(arg)) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n } else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {\n operands.push(arg);\n if (args.length > 0) operands.push(...args);\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg);\n if (args.length > 0) dest.push(...args);\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {Object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] = key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {Object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {}\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {Object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(`${message}\\n`, this._outputConfiguration.writeErr);\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (this.getOptionValue(optionKey) === undefined || ['default', 'config', 'env'].includes(this.getOptionValueSource(optionKey))) {\n if (option.required || option.optional) { // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else { // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return this.getOptionValue(optionKey) !== undefined && !['default', 'implied'].includes(this.getOptionValueSource(optionKey));\n };\n this.options\n .filter(option => (option.implied !== undefined) &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(this.getOptionValue(option.attributeName()), option))\n .forEach((option) => {\n Object.keys(option.implied)\n .filter(impliedKey => !hasCustomOptionValue(impliedKey))\n .forEach(impliedKey => {\n this.setOptionValueWithSource(impliedKey, option.implied[impliedKey], 'implied');\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(target => target.negate && optionKey === target.attributeName());\n const positiveOption = this.options.find(target => !target.negate && optionKey === target.attributeName());\n if (negativeOption && (\n (negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)\n )) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n let command = this;\n do {\n const moreFlags = command.createHelp().visibleOptions(command)\n .filter(option => option.long)\n .map(option => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = (expected === 1) ? '' : 's';\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp().visibleCommands(this).forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {Object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined) return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n let command = this;\n if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name) throw new Error('Command alias can\\'t be the same as its name');\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()].concat(matchingCommand.aliases()).join('|');\n throw new Error(`cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`);\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return [].concat(\n (this.options.length || (this._helpOption !== null) ? '[options]' : []),\n (this.commands.length ? '[command]' : []),\n (this.registeredArguments.length ? args : [])\n ).join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or require.main.filename, or __filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(require.main.filename);\n *\n * @param {string} filename\n * @return {Command}\n */\n\n nameFromFilename(filename) {\n this._name = path.basename(filename, path.extname(filename));\n\n return this;\n }\n\n /**\n * Get or set the directory for searching for executable subcommands of this command.\n *\n * @example\n * program.executableDir(__dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n if (helper.helpWidth === undefined) {\n helper.helpWidth = (contextOptions && contextOptions.error) ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth();\n }\n return helper.formatHelp(this, helper);\n }\n\n /**\n * @private\n */\n\n _getHelpContext(contextOptions) {\n contextOptions = contextOptions || {};\n const context = { error: !!contextOptions.error };\n let write;\n if (context.error) {\n write = (arg) => this._outputConfiguration.writeErr(arg);\n } else {\n write = (arg) => this._outputConfiguration.writeOut(arg);\n }\n context.write = contextOptions.write || write;\n context.command = this;\n return context;\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n const context = this._getHelpContext(contextOptions);\n\n this._getCommandAndAncestors().reverse().forEach(command => command.emit('beforeAllHelp', context));\n this.emit('beforeHelp', context);\n\n let helpInformation = this.helpInformation(context);\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (typeof helpInformation !== 'string' && !Buffer.isBuffer(helpInformation)) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n context.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', context);\n this._getCommandAndAncestors().forEach(command => command.emit('afterAllHelp', context));\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support disabling built-in help option.\n if (typeof flags === 'boolean') {\n if (flags) {\n this._helpOption = this._helpOption ?? undefined; // preserve existing option\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n flags = flags ?? '-h, --help';\n description = description ?? 'display help for command';\n this._helpOption = this.createOption(flags, description);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package internal use only\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = process.exitCode || 0;\n if (exitCode === 0 && contextOptions && typeof contextOptions !== 'function' && contextOptions.error) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find(arg => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\nexports.Command = Command;\n","const { Argument } = require('./lib/argument.js');\nconst { Command } = require('./lib/command.js');\nconst { CommanderError, InvalidArgumentError } = require('./lib/error.js');\nconst { Help } = require('./lib/help.js');\nconst { Option } = require('./lib/option.js');\n\nexports.program = new Command();\n\nexports.createCommand = (name) => new Command(name);\nexports.createOption = (flags, description) => new Option(flags, description);\nexports.createArgument = (name, description) => new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexports.Command = Command;\nexports.Option = Option;\nexports.Argument = Argument;\nexports.Help = Help;\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\nexports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated\n","import commander from './index.js';\n\n// wrapper to provide named exports for ESM.\nexport const {\n program,\n createCommand,\n createArgument,\n createOption,\n CommanderError,\n InvalidArgumentError,\n InvalidOptionArgumentError, // deprecated old name\n Command,\n Argument,\n Option,\n Help\n} = commander;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.thenable = exports.typedArray = exports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;\nfunction boolean(value) {\n return value === true || value === false;\n}\nexports.boolean = boolean;\nfunction string(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexports.string = string;\nfunction number(value) {\n return typeof value === 'number' || value instanceof Number;\n}\nexports.number = number;\nfunction error(value) {\n return value instanceof Error;\n}\nexports.error = error;\nfunction func(value) {\n return typeof value === 'function';\n}\nexports.func = func;\nfunction array(value) {\n return Array.isArray(value);\n}\nexports.array = array;\nfunction stringArray(value) {\n return array(value) && value.every(elem => string(elem));\n}\nexports.stringArray = stringArray;\nfunction typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n}\nexports.typedArray = typedArray;\nfunction thenable(value) {\n return value && func(value.then);\n}\nexports.thenable = thenable;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;\nfunction boolean(value) {\n return value === true || value === false;\n}\nexports.boolean = boolean;\nfunction string(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexports.string = string;\nfunction number(value) {\n return typeof value === 'number' || value instanceof Number;\n}\nexports.number = number;\nfunction error(value) {\n return value instanceof Error;\n}\nexports.error = error;\nfunction func(value) {\n return typeof value === 'function';\n}\nexports.func = func;\nfunction array(value) {\n return Array.isArray(value);\n}\nexports.array = array;\nfunction stringArray(value) {\n return array(value) && value.every(elem => string(elem));\n}\nexports.stringArray = stringArray;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Message = exports.NotificationType9 = exports.NotificationType8 = exports.NotificationType7 = exports.NotificationType6 = exports.NotificationType5 = exports.NotificationType4 = exports.NotificationType3 = exports.NotificationType2 = exports.NotificationType1 = exports.NotificationType0 = exports.NotificationType = exports.RequestType9 = exports.RequestType8 = exports.RequestType7 = exports.RequestType6 = exports.RequestType5 = exports.RequestType4 = exports.RequestType3 = exports.RequestType2 = exports.RequestType1 = exports.RequestType = exports.RequestType0 = exports.AbstractMessageSignature = exports.ParameterStructures = exports.ResponseError = exports.ErrorCodes = void 0;\nconst is = require(\"./is\");\n/**\n * Predefined error codes.\n */\nvar ErrorCodes;\n(function (ErrorCodes) {\n // Defined by JSON RPC\n ErrorCodes.ParseError = -32700;\n ErrorCodes.InvalidRequest = -32600;\n ErrorCodes.MethodNotFound = -32601;\n ErrorCodes.InvalidParams = -32602;\n ErrorCodes.InternalError = -32603;\n /**\n * This is the start range of JSON RPC reserved error codes.\n * It doesn't denote a real error code. No application error codes should\n * be defined between the start and end range. For backwards\n * compatibility the `ServerNotInitialized` and the `UnknownErrorCode`\n * are left in the range.\n *\n * @since 3.16.0\n */\n ErrorCodes.jsonrpcReservedErrorRangeStart = -32099;\n /** @deprecated use jsonrpcReservedErrorRangeStart */\n ErrorCodes.serverErrorStart = -32099;\n /**\n * An error occurred when write a message to the transport layer.\n */\n ErrorCodes.MessageWriteError = -32099;\n /**\n * An error occurred when reading a message from the transport layer.\n */\n ErrorCodes.MessageReadError = -32098;\n /**\n * The connection got disposed or lost and all pending responses got\n * rejected.\n */\n ErrorCodes.PendingResponseRejected = -32097;\n /**\n * The connection is inactive and a use of it failed.\n */\n ErrorCodes.ConnectionInactive = -32096;\n /**\n * Error code indicating that a server received a notification or\n * request before the server has received the `initialize` request.\n */\n ErrorCodes.ServerNotInitialized = -32002;\n ErrorCodes.UnknownErrorCode = -32001;\n /**\n * This is the end range of JSON RPC reserved error codes.\n * It doesn't denote a real error code.\n *\n * @since 3.16.0\n */\n ErrorCodes.jsonrpcReservedErrorRangeEnd = -32000;\n /** @deprecated use jsonrpcReservedErrorRangeEnd */\n ErrorCodes.serverErrorEnd = -32000;\n})(ErrorCodes || (exports.ErrorCodes = ErrorCodes = {}));\n/**\n * An error object return in a response in case a request\n * has failed.\n */\nclass ResponseError extends Error {\n constructor(code, message, data) {\n super(message);\n this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;\n this.data = data;\n Object.setPrototypeOf(this, ResponseError.prototype);\n }\n toJson() {\n const result = {\n code: this.code,\n message: this.message\n };\n if (this.data !== undefined) {\n result.data = this.data;\n }\n return result;\n }\n}\nexports.ResponseError = ResponseError;\nclass ParameterStructures {\n constructor(kind) {\n this.kind = kind;\n }\n static is(value) {\n return value === ParameterStructures.auto || value === ParameterStructures.byName || value === ParameterStructures.byPosition;\n }\n toString() {\n return this.kind;\n }\n}\nexports.ParameterStructures = ParameterStructures;\n/**\n * The parameter structure is automatically inferred on the number of parameters\n * and the parameter type in case of a single param.\n */\nParameterStructures.auto = new ParameterStructures('auto');\n/**\n * Forces `byPosition` parameter structure. This is useful if you have a single\n * parameter which has a literal type.\n */\nParameterStructures.byPosition = new ParameterStructures('byPosition');\n/**\n * Forces `byName` parameter structure. This is only useful when having a single\n * parameter. The library will report errors if used with a different number of\n * parameters.\n */\nParameterStructures.byName = new ParameterStructures('byName');\n/**\n * An abstract implementation of a MessageType.\n */\nclass AbstractMessageSignature {\n constructor(method, numberOfParams) {\n this.method = method;\n this.numberOfParams = numberOfParams;\n }\n get parameterStructures() {\n return ParameterStructures.auto;\n }\n}\nexports.AbstractMessageSignature = AbstractMessageSignature;\n/**\n * Classes to type request response pairs\n */\nclass RequestType0 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 0);\n }\n}\nexports.RequestType0 = RequestType0;\nclass RequestType extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.RequestType = RequestType;\nclass RequestType1 extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.RequestType1 = RequestType1;\nclass RequestType2 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 2);\n }\n}\nexports.RequestType2 = RequestType2;\nclass RequestType3 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 3);\n }\n}\nexports.RequestType3 = RequestType3;\nclass RequestType4 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 4);\n }\n}\nexports.RequestType4 = RequestType4;\nclass RequestType5 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 5);\n }\n}\nexports.RequestType5 = RequestType5;\nclass RequestType6 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 6);\n }\n}\nexports.RequestType6 = RequestType6;\nclass RequestType7 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 7);\n }\n}\nexports.RequestType7 = RequestType7;\nclass RequestType8 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 8);\n }\n}\nexports.RequestType8 = RequestType8;\nclass RequestType9 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 9);\n }\n}\nexports.RequestType9 = RequestType9;\nclass NotificationType extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.NotificationType = NotificationType;\nclass NotificationType0 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 0);\n }\n}\nexports.NotificationType0 = NotificationType0;\nclass NotificationType1 extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.NotificationType1 = NotificationType1;\nclass NotificationType2 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 2);\n }\n}\nexports.NotificationType2 = NotificationType2;\nclass NotificationType3 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 3);\n }\n}\nexports.NotificationType3 = NotificationType3;\nclass NotificationType4 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 4);\n }\n}\nexports.NotificationType4 = NotificationType4;\nclass NotificationType5 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 5);\n }\n}\nexports.NotificationType5 = NotificationType5;\nclass NotificationType6 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 6);\n }\n}\nexports.NotificationType6 = NotificationType6;\nclass NotificationType7 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 7);\n }\n}\nexports.NotificationType7 = NotificationType7;\nclass NotificationType8 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 8);\n }\n}\nexports.NotificationType8 = NotificationType8;\nclass NotificationType9 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 9);\n }\n}\nexports.NotificationType9 = NotificationType9;\nvar Message;\n(function (Message) {\n /**\n * Tests if the given message is a request message\n */\n function isRequest(message) {\n const candidate = message;\n return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));\n }\n Message.isRequest = isRequest;\n /**\n * Tests if the given message is a notification message\n */\n function isNotification(message) {\n const candidate = message;\n return candidate && is.string(candidate.method) && message.id === void 0;\n }\n Message.isNotification = isNotification;\n /**\n * Tests if the given message is a response message\n */\n function isResponse(message) {\n const candidate = message;\n return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);\n }\n Message.isResponse = isResponse;\n})(Message || (exports.Message = Message = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LRUCache = exports.LinkedMap = exports.Touch = void 0;\nvar Touch;\n(function (Touch) {\n Touch.None = 0;\n Touch.First = 1;\n Touch.AsOld = Touch.First;\n Touch.Last = 2;\n Touch.AsNew = Touch.Last;\n})(Touch || (exports.Touch = Touch = {}));\nclass LinkedMap {\n constructor() {\n this[_a] = 'LinkedMap';\n this._map = new Map();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state = 0;\n }\n clear() {\n this._map.clear();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state++;\n }\n isEmpty() {\n return !this._head && !this._tail;\n }\n get size() {\n return this._size;\n }\n get first() {\n return this._head?.value;\n }\n get last() {\n return this._tail?.value;\n }\n has(key) {\n return this._map.has(key);\n }\n get(key, touch = Touch.None) {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n if (touch !== Touch.None) {\n this.touch(item, touch);\n }\n return item.value;\n }\n set(key, value, touch = Touch.None) {\n let item = this._map.get(key);\n if (item) {\n item.value = value;\n if (touch !== Touch.None) {\n this.touch(item, touch);\n }\n }\n else {\n item = { key, value, next: undefined, previous: undefined };\n switch (touch) {\n case Touch.None:\n this.addItemLast(item);\n break;\n case Touch.First:\n this.addItemFirst(item);\n break;\n case Touch.Last:\n this.addItemLast(item);\n break;\n default:\n this.addItemLast(item);\n break;\n }\n this._map.set(key, item);\n this._size++;\n }\n return this;\n }\n delete(key) {\n return !!this.remove(key);\n }\n remove(key) {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n this._map.delete(key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n shift() {\n if (!this._head && !this._tail) {\n return undefined;\n }\n if (!this._head || !this._tail) {\n throw new Error('Invalid list');\n }\n const item = this._head;\n this._map.delete(item.key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n forEach(callbackfn, thisArg) {\n const state = this._state;\n let current = this._head;\n while (current) {\n if (thisArg) {\n callbackfn.bind(thisArg)(current.value, current.key, this);\n }\n else {\n callbackfn(current.value, current.key, this);\n }\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n current = current.next;\n }\n }\n keys() {\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]: () => {\n return iterator;\n },\n next: () => {\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.key, done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n values() {\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]: () => {\n return iterator;\n },\n next: () => {\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.value, done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n entries() {\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]: () => {\n return iterator;\n },\n next: () => {\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: [current.key, current.value], done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n [(_a = Symbol.toStringTag, Symbol.iterator)]() {\n return this.entries();\n }\n trimOld(newSize) {\n if (newSize >= this.size) {\n return;\n }\n if (newSize === 0) {\n this.clear();\n return;\n }\n let current = this._head;\n let currentSize = this.size;\n while (current && currentSize > newSize) {\n this._map.delete(current.key);\n current = current.next;\n currentSize--;\n }\n this._head = current;\n this._size = currentSize;\n if (current) {\n current.previous = undefined;\n }\n this._state++;\n }\n addItemFirst(item) {\n // First time Insert\n if (!this._head && !this._tail) {\n this._tail = item;\n }\n else if (!this._head) {\n throw new Error('Invalid list');\n }\n else {\n item.next = this._head;\n this._head.previous = item;\n }\n this._head = item;\n this._state++;\n }\n addItemLast(item) {\n // First time Insert\n if (!this._head && !this._tail) {\n this._head = item;\n }\n else if (!this._tail) {\n throw new Error('Invalid list');\n }\n else {\n item.previous = this._tail;\n this._tail.next = item;\n }\n this._tail = item;\n this._state++;\n }\n removeItem(item) {\n if (item === this._head && item === this._tail) {\n this._head = undefined;\n this._tail = undefined;\n }\n else if (item === this._head) {\n // This can only happened if size === 1 which is handle\n // by the case above.\n if (!item.next) {\n throw new Error('Invalid list');\n }\n item.next.previous = undefined;\n this._head = item.next;\n }\n else if (item === this._tail) {\n // This can only happened if size === 1 which is handle\n // by the case above.\n if (!item.previous) {\n throw new Error('Invalid list');\n }\n item.previous.next = undefined;\n this._tail = item.previous;\n }\n else {\n const next = item.next;\n const previous = item.previous;\n if (!next || !previous) {\n throw new Error('Invalid list');\n }\n next.previous = previous;\n previous.next = next;\n }\n item.next = undefined;\n item.previous = undefined;\n this._state++;\n }\n touch(item, touch) {\n if (!this._head || !this._tail) {\n throw new Error('Invalid list');\n }\n if ((touch !== Touch.First && touch !== Touch.Last)) {\n return;\n }\n if (touch === Touch.First) {\n if (item === this._head) {\n return;\n }\n const next = item.next;\n const previous = item.previous;\n // Unlink the item\n if (item === this._tail) {\n // previous must be defined since item was not head but is tail\n // So there are more than on item in the map\n previous.next = undefined;\n this._tail = previous;\n }\n else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next.previous = previous;\n previous.next = next;\n }\n // Insert the node at head\n item.previous = undefined;\n item.next = this._head;\n this._head.previous = item;\n this._head = item;\n this._state++;\n }\n else if (touch === Touch.Last) {\n if (item === this._tail) {\n return;\n }\n const next = item.next;\n const previous = item.previous;\n // Unlink the item.\n if (item === this._head) {\n // next must be defined since item was not tail but is head\n // So there are more than on item in the map\n next.previous = undefined;\n this._head = next;\n }\n else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next.previous = previous;\n previous.next = next;\n }\n item.next = undefined;\n item.previous = this._tail;\n this._tail.next = item;\n this._tail = item;\n this._state++;\n }\n }\n toJSON() {\n const data = [];\n this.forEach((value, key) => {\n data.push([key, value]);\n });\n return data;\n }\n fromJSON(data) {\n this.clear();\n for (const [key, value] of data) {\n this.set(key, value);\n }\n }\n}\nexports.LinkedMap = LinkedMap;\nclass LRUCache extends LinkedMap {\n constructor(limit, ratio = 1) {\n super();\n this._limit = limit;\n this._ratio = Math.min(Math.max(0, ratio), 1);\n }\n get limit() {\n return this._limit;\n }\n set limit(limit) {\n this._limit = limit;\n this.checkTrim();\n }\n get ratio() {\n return this._ratio;\n }\n set ratio(ratio) {\n this._ratio = Math.min(Math.max(0, ratio), 1);\n this.checkTrim();\n }\n get(key, touch = Touch.AsNew) {\n return super.get(key, touch);\n }\n peek(key) {\n return super.get(key, Touch.None);\n }\n set(key, value) {\n super.set(key, value, Touch.Last);\n this.checkTrim();\n return this;\n }\n checkTrim() {\n if (this.size > this._limit) {\n this.trimOld(Math.round(this._limit * this._ratio));\n }\n }\n}\nexports.LRUCache = LRUCache;\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Disposable = void 0;\nvar Disposable;\n(function (Disposable) {\n function create(func) {\n return {\n dispose: func\n };\n }\n Disposable.create = create;\n})(Disposable || (exports.Disposable = Disposable = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nlet _ral;\nfunction RAL() {\n if (_ral === undefined) {\n throw new Error(`No runtime abstraction layer installed`);\n }\n return _ral;\n}\n(function (RAL) {\n function install(ral) {\n if (ral === undefined) {\n throw new Error(`No runtime abstraction layer provided`);\n }\n _ral = ral;\n }\n RAL.install = install;\n})(RAL || (RAL = {}));\nexports.default = RAL;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = exports.Event = void 0;\nconst ral_1 = require(\"./ral\");\nvar Event;\n(function (Event) {\n const _disposable = { dispose() { } };\n Event.None = function () { return _disposable; };\n})(Event || (exports.Event = Event = {}));\nclass CallbackList {\n add(callback, context = null, bucket) {\n if (!this._callbacks) {\n this._callbacks = [];\n this._contexts = [];\n }\n this._callbacks.push(callback);\n this._contexts.push(context);\n if (Array.isArray(bucket)) {\n bucket.push({ dispose: () => this.remove(callback, context) });\n }\n }\n remove(callback, context = null) {\n if (!this._callbacks) {\n return;\n }\n let foundCallbackWithDifferentContext = false;\n for (let i = 0, len = this._callbacks.length; i < len; i++) {\n if (this._callbacks[i] === callback) {\n if (this._contexts[i] === context) {\n // callback & context match => remove it\n this._callbacks.splice(i, 1);\n this._contexts.splice(i, 1);\n return;\n }\n else {\n foundCallbackWithDifferentContext = true;\n }\n }\n }\n if (foundCallbackWithDifferentContext) {\n throw new Error('When adding a listener with a context, you should remove it with the same context');\n }\n }\n invoke(...args) {\n if (!this._callbacks) {\n return [];\n }\n const ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);\n for (let i = 0, len = callbacks.length; i < len; i++) {\n try {\n ret.push(callbacks[i].apply(contexts[i], args));\n }\n catch (e) {\n // eslint-disable-next-line no-console\n (0, ral_1.default)().console.error(e);\n }\n }\n return ret;\n }\n isEmpty() {\n return !this._callbacks || this._callbacks.length === 0;\n }\n dispose() {\n this._callbacks = undefined;\n this._contexts = undefined;\n }\n}\nclass Emitter {\n constructor(_options) {\n this._options = _options;\n }\n /**\n * For the public to allow to subscribe\n * to events from this Emitter\n */\n get event() {\n if (!this._event) {\n this._event = (listener, thisArgs, disposables) => {\n if (!this._callbacks) {\n this._callbacks = new CallbackList();\n }\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\n this._options.onFirstListenerAdd(this);\n }\n this._callbacks.add(listener, thisArgs);\n const result = {\n dispose: () => {\n if (!this._callbacks) {\n // disposable is disposed after emitter is disposed.\n return;\n }\n this._callbacks.remove(listener, thisArgs);\n result.dispose = Emitter._noop;\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\n this._options.onLastListenerRemove(this);\n }\n }\n };\n if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }\n /**\n * To be kept private to fire an event to\n * subscribers\n */\n fire(event) {\n if (this._callbacks) {\n this._callbacks.invoke.call(this._callbacks, event);\n }\n }\n dispose() {\n if (this._callbacks) {\n this._callbacks.dispose();\n this._callbacks = undefined;\n }\n }\n}\nexports.Emitter = Emitter;\nEmitter._noop = function () { };\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CancellationTokenSource = exports.CancellationToken = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst events_1 = require(\"./events\");\nvar CancellationToken;\n(function (CancellationToken) {\n CancellationToken.None = Object.freeze({\n isCancellationRequested: false,\n onCancellationRequested: events_1.Event.None\n });\n CancellationToken.Cancelled = Object.freeze({\n isCancellationRequested: true,\n onCancellationRequested: events_1.Event.None\n });\n function is(value) {\n const candidate = value;\n return candidate && (candidate === CancellationToken.None\n || candidate === CancellationToken.Cancelled\n || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested));\n }\n CancellationToken.is = is;\n})(CancellationToken || (exports.CancellationToken = CancellationToken = {}));\nconst shortcutEvent = Object.freeze(function (callback, context) {\n const handle = (0, ral_1.default)().timer.setTimeout(callback.bind(context), 0);\n return { dispose() { handle.dispose(); } };\n});\nclass MutableToken {\n constructor() {\n this._isCancelled = false;\n }\n cancel() {\n if (!this._isCancelled) {\n this._isCancelled = true;\n if (this._emitter) {\n this._emitter.fire(undefined);\n this.dispose();\n }\n }\n }\n get isCancellationRequested() {\n return this._isCancelled;\n }\n get onCancellationRequested() {\n if (this._isCancelled) {\n return shortcutEvent;\n }\n if (!this._emitter) {\n this._emitter = new events_1.Emitter();\n }\n return this._emitter.event;\n }\n dispose() {\n if (this._emitter) {\n this._emitter.dispose();\n this._emitter = undefined;\n }\n }\n}\nclass CancellationTokenSource {\n get token() {\n if (!this._token) {\n // be lazy and create the token only when\n // actually needed\n this._token = new MutableToken();\n }\n return this._token;\n }\n cancel() {\n if (!this._token) {\n // save an object by returning the default\n // cancelled token when cancellation happens\n // before someone asks for the token\n this._token = CancellationToken.Cancelled;\n }\n else {\n this._token.cancel();\n }\n }\n dispose() {\n if (!this._token) {\n // ensure to initialize with an empty token if we had none\n this._token = CancellationToken.None;\n }\n else if (this._token instanceof MutableToken) {\n // actually dispose\n this._token.dispose();\n }\n }\n}\nexports.CancellationTokenSource = CancellationTokenSource;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SharedArrayReceiverStrategy = exports.SharedArraySenderStrategy = void 0;\nconst cancellation_1 = require(\"./cancellation\");\nvar CancellationState;\n(function (CancellationState) {\n CancellationState.Continue = 0;\n CancellationState.Cancelled = 1;\n})(CancellationState || (CancellationState = {}));\nclass SharedArraySenderStrategy {\n constructor() {\n this.buffers = new Map();\n }\n enableCancellation(request) {\n if (request.id === null) {\n return;\n }\n const buffer = new SharedArrayBuffer(4);\n const data = new Int32Array(buffer, 0, 1);\n data[0] = CancellationState.Continue;\n this.buffers.set(request.id, buffer);\n request.$cancellationData = buffer;\n }\n async sendCancellation(_conn, id) {\n const buffer = this.buffers.get(id);\n if (buffer === undefined) {\n return;\n }\n const data = new Int32Array(buffer, 0, 1);\n Atomics.store(data, 0, CancellationState.Cancelled);\n }\n cleanup(id) {\n this.buffers.delete(id);\n }\n dispose() {\n this.buffers.clear();\n }\n}\nexports.SharedArraySenderStrategy = SharedArraySenderStrategy;\nclass SharedArrayBufferCancellationToken {\n constructor(buffer) {\n this.data = new Int32Array(buffer, 0, 1);\n }\n get isCancellationRequested() {\n return Atomics.load(this.data, 0) === CancellationState.Cancelled;\n }\n get onCancellationRequested() {\n throw new Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`);\n }\n}\nclass SharedArrayBufferCancellationTokenSource {\n constructor(buffer) {\n this.token = new SharedArrayBufferCancellationToken(buffer);\n }\n cancel() {\n }\n dispose() {\n }\n}\nclass SharedArrayReceiverStrategy {\n constructor() {\n this.kind = 'request';\n }\n createCancellationTokenSource(request) {\n const buffer = request.$cancellationData;\n if (buffer === undefined) {\n return new cancellation_1.CancellationTokenSource();\n }\n return new SharedArrayBufferCancellationTokenSource(buffer);\n }\n}\nexports.SharedArrayReceiverStrategy = SharedArrayReceiverStrategy;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Semaphore = void 0;\nconst ral_1 = require(\"./ral\");\nclass Semaphore {\n constructor(capacity = 1) {\n if (capacity <= 0) {\n throw new Error('Capacity must be greater than 0');\n }\n this._capacity = capacity;\n this._active = 0;\n this._waiting = [];\n }\n lock(thunk) {\n return new Promise((resolve, reject) => {\n this._waiting.push({ thunk, resolve, reject });\n this.runNext();\n });\n }\n get active() {\n return this._active;\n }\n runNext() {\n if (this._waiting.length === 0 || this._active === this._capacity) {\n return;\n }\n (0, ral_1.default)().timer.setImmediate(() => this.doRunNext());\n }\n doRunNext() {\n if (this._waiting.length === 0 || this._active === this._capacity) {\n return;\n }\n const next = this._waiting.shift();\n this._active++;\n if (this._active > this._capacity) {\n throw new Error(`To many thunks active`);\n }\n try {\n const result = next.thunk();\n if (result instanceof Promise) {\n result.then((value) => {\n this._active--;\n next.resolve(value);\n this.runNext();\n }, (err) => {\n this._active--;\n next.reject(err);\n this.runNext();\n });\n }\n else {\n this._active--;\n next.resolve(result);\n this.runNext();\n }\n }\n catch (err) {\n this._active--;\n next.reject(err);\n this.runNext();\n }\n }\n}\nexports.Semaphore = Semaphore;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ReadableStreamMessageReader = exports.AbstractMessageReader = exports.MessageReader = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst events_1 = require(\"./events\");\nconst semaphore_1 = require(\"./semaphore\");\nvar MessageReader;\n(function (MessageReader) {\n function is(value) {\n let candidate = value;\n return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) &&\n Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);\n }\n MessageReader.is = is;\n})(MessageReader || (exports.MessageReader = MessageReader = {}));\nclass AbstractMessageReader {\n constructor() {\n this.errorEmitter = new events_1.Emitter();\n this.closeEmitter = new events_1.Emitter();\n this.partialMessageEmitter = new events_1.Emitter();\n }\n dispose() {\n this.errorEmitter.dispose();\n this.closeEmitter.dispose();\n }\n get onError() {\n return this.errorEmitter.event;\n }\n fireError(error) {\n this.errorEmitter.fire(this.asError(error));\n }\n get onClose() {\n return this.closeEmitter.event;\n }\n fireClose() {\n this.closeEmitter.fire(undefined);\n }\n get onPartialMessage() {\n return this.partialMessageEmitter.event;\n }\n firePartialMessage(info) {\n this.partialMessageEmitter.fire(info);\n }\n asError(error) {\n if (error instanceof Error) {\n return error;\n }\n else {\n return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\n }\n }\n}\nexports.AbstractMessageReader = AbstractMessageReader;\nvar ResolvedMessageReaderOptions;\n(function (ResolvedMessageReaderOptions) {\n function fromOptions(options) {\n let charset;\n let result;\n let contentDecoder;\n const contentDecoders = new Map();\n let contentTypeDecoder;\n const contentTypeDecoders = new Map();\n if (options === undefined || typeof options === 'string') {\n charset = options ?? 'utf-8';\n }\n else {\n charset = options.charset ?? 'utf-8';\n if (options.contentDecoder !== undefined) {\n contentDecoder = options.contentDecoder;\n contentDecoders.set(contentDecoder.name, contentDecoder);\n }\n if (options.contentDecoders !== undefined) {\n for (const decoder of options.contentDecoders) {\n contentDecoders.set(decoder.name, decoder);\n }\n }\n if (options.contentTypeDecoder !== undefined) {\n contentTypeDecoder = options.contentTypeDecoder;\n contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);\n }\n if (options.contentTypeDecoders !== undefined) {\n for (const decoder of options.contentTypeDecoders) {\n contentTypeDecoders.set(decoder.name, decoder);\n }\n }\n }\n if (contentTypeDecoder === undefined) {\n contentTypeDecoder = (0, ral_1.default)().applicationJson.decoder;\n contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);\n }\n return { charset, contentDecoder, contentDecoders, contentTypeDecoder, contentTypeDecoders };\n }\n ResolvedMessageReaderOptions.fromOptions = fromOptions;\n})(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {}));\nclass ReadableStreamMessageReader extends AbstractMessageReader {\n constructor(readable, options) {\n super();\n this.readable = readable;\n this.options = ResolvedMessageReaderOptions.fromOptions(options);\n this.buffer = (0, ral_1.default)().messageBuffer.create(this.options.charset);\n this._partialMessageTimeout = 10000;\n this.nextMessageLength = -1;\n this.messageToken = 0;\n this.readSemaphore = new semaphore_1.Semaphore(1);\n }\n set partialMessageTimeout(timeout) {\n this._partialMessageTimeout = timeout;\n }\n get partialMessageTimeout() {\n return this._partialMessageTimeout;\n }\n listen(callback) {\n this.nextMessageLength = -1;\n this.messageToken = 0;\n this.partialMessageTimer = undefined;\n this.callback = callback;\n const result = this.readable.onData((data) => {\n this.onData(data);\n });\n this.readable.onError((error) => this.fireError(error));\n this.readable.onClose(() => this.fireClose());\n return result;\n }\n onData(data) {\n try {\n this.buffer.append(data);\n while (true) {\n if (this.nextMessageLength === -1) {\n const headers = this.buffer.tryReadHeaders(true);\n if (!headers) {\n return;\n }\n const contentLength = headers.get('content-length');\n if (!contentLength) {\n this.fireError(new Error(`Header must provide a Content-Length property.\\n${JSON.stringify(Object.fromEntries(headers))}`));\n return;\n }\n const length = parseInt(contentLength);\n if (isNaN(length)) {\n this.fireError(new Error(`Content-Length value must be a number. Got ${contentLength}`));\n return;\n }\n this.nextMessageLength = length;\n }\n const body = this.buffer.tryReadBody(this.nextMessageLength);\n if (body === undefined) {\n /** We haven't received the full message yet. */\n this.setPartialMessageTimer();\n return;\n }\n this.clearPartialMessageTimer();\n this.nextMessageLength = -1;\n // Make sure that we convert one received message after the\n // other. Otherwise it could happen that a decoding of a second\n // smaller message finished before the decoding of a first larger\n // message and then we would deliver the second message first.\n this.readSemaphore.lock(async () => {\n const bytes = this.options.contentDecoder !== undefined\n ? await this.options.contentDecoder.decode(body)\n : body;\n const message = await this.options.contentTypeDecoder.decode(bytes, this.options);\n this.callback(message);\n }).catch((error) => {\n this.fireError(error);\n });\n }\n }\n catch (error) {\n this.fireError(error);\n }\n }\n clearPartialMessageTimer() {\n if (this.partialMessageTimer) {\n this.partialMessageTimer.dispose();\n this.partialMessageTimer = undefined;\n }\n }\n setPartialMessageTimer() {\n this.clearPartialMessageTimer();\n if (this._partialMessageTimeout <= 0) {\n return;\n }\n this.partialMessageTimer = (0, ral_1.default)().timer.setTimeout((token, timeout) => {\n this.partialMessageTimer = undefined;\n if (token === this.messageToken) {\n this.firePartialMessage({ messageToken: token, waitingTime: timeout });\n this.setPartialMessageTimer();\n }\n }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);\n }\n}\nexports.ReadableStreamMessageReader = ReadableStreamMessageReader;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WriteableStreamMessageWriter = exports.AbstractMessageWriter = exports.MessageWriter = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst semaphore_1 = require(\"./semaphore\");\nconst events_1 = require(\"./events\");\nconst ContentLength = 'Content-Length: ';\nconst CRLF = '\\r\\n';\nvar MessageWriter;\n(function (MessageWriter) {\n function is(value) {\n let candidate = value;\n return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) &&\n Is.func(candidate.onError) && Is.func(candidate.write);\n }\n MessageWriter.is = is;\n})(MessageWriter || (exports.MessageWriter = MessageWriter = {}));\nclass AbstractMessageWriter {\n constructor() {\n this.errorEmitter = new events_1.Emitter();\n this.closeEmitter = new events_1.Emitter();\n }\n dispose() {\n this.errorEmitter.dispose();\n this.closeEmitter.dispose();\n }\n get onError() {\n return this.errorEmitter.event;\n }\n fireError(error, message, count) {\n this.errorEmitter.fire([this.asError(error), message, count]);\n }\n get onClose() {\n return this.closeEmitter.event;\n }\n fireClose() {\n this.closeEmitter.fire(undefined);\n }\n asError(error) {\n if (error instanceof Error) {\n return error;\n }\n else {\n return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\n }\n }\n}\nexports.AbstractMessageWriter = AbstractMessageWriter;\nvar ResolvedMessageWriterOptions;\n(function (ResolvedMessageWriterOptions) {\n function fromOptions(options) {\n if (options === undefined || typeof options === 'string') {\n return { charset: options ?? 'utf-8', contentTypeEncoder: (0, ral_1.default)().applicationJson.encoder };\n }\n else {\n return { charset: options.charset ?? 'utf-8', contentEncoder: options.contentEncoder, contentTypeEncoder: options.contentTypeEncoder ?? (0, ral_1.default)().applicationJson.encoder };\n }\n }\n ResolvedMessageWriterOptions.fromOptions = fromOptions;\n})(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {}));\nclass WriteableStreamMessageWriter extends AbstractMessageWriter {\n constructor(writable, options) {\n super();\n this.writable = writable;\n this.options = ResolvedMessageWriterOptions.fromOptions(options);\n this.errorCount = 0;\n this.writeSemaphore = new semaphore_1.Semaphore(1);\n this.writable.onError((error) => this.fireError(error));\n this.writable.onClose(() => this.fireClose());\n }\n async write(msg) {\n return this.writeSemaphore.lock(async () => {\n const payload = this.options.contentTypeEncoder.encode(msg, this.options).then((buffer) => {\n if (this.options.contentEncoder !== undefined) {\n return this.options.contentEncoder.encode(buffer);\n }\n else {\n return buffer;\n }\n });\n return payload.then((buffer) => {\n const headers = [];\n headers.push(ContentLength, buffer.byteLength.toString(), CRLF);\n headers.push(CRLF);\n return this.doWrite(msg, headers, buffer);\n }, (error) => {\n this.fireError(error);\n throw error;\n });\n });\n }\n async doWrite(msg, headers, data) {\n try {\n await this.writable.write(headers.join(''), 'ascii');\n return this.writable.write(data);\n }\n catch (error) {\n this.handleError(error, msg);\n return Promise.reject(error);\n }\n }\n handleError(error, msg) {\n this.errorCount++;\n this.fireError(error, msg, this.errorCount);\n }\n end() {\n this.writable.end();\n }\n}\nexports.WriteableStreamMessageWriter = WriteableStreamMessageWriter;\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AbstractMessageBuffer = void 0;\nconst CR = 13;\nconst LF = 10;\nconst CRLF = '\\r\\n';\nclass AbstractMessageBuffer {\n constructor(encoding = 'utf-8') {\n this._encoding = encoding;\n this._chunks = [];\n this._totalLength = 0;\n }\n get encoding() {\n return this._encoding;\n }\n append(chunk) {\n const toAppend = typeof chunk === 'string' ? this.fromString(chunk, this._encoding) : chunk;\n this._chunks.push(toAppend);\n this._totalLength += toAppend.byteLength;\n }\n tryReadHeaders(lowerCaseKeys = false) {\n if (this._chunks.length === 0) {\n return undefined;\n }\n let state = 0;\n let chunkIndex = 0;\n let offset = 0;\n let chunkBytesRead = 0;\n row: while (chunkIndex < this._chunks.length) {\n const chunk = this._chunks[chunkIndex];\n offset = 0;\n column: while (offset < chunk.length) {\n const value = chunk[offset];\n switch (value) {\n case CR:\n switch (state) {\n case 0:\n state = 1;\n break;\n case 2:\n state = 3;\n break;\n default:\n state = 0;\n }\n break;\n case LF:\n switch (state) {\n case 1:\n state = 2;\n break;\n case 3:\n state = 4;\n offset++;\n break row;\n default:\n state = 0;\n }\n break;\n default:\n state = 0;\n }\n offset++;\n }\n chunkBytesRead += chunk.byteLength;\n chunkIndex++;\n }\n if (state !== 4) {\n return undefined;\n }\n // The buffer contains the two CRLF at the end. So we will\n // have two empty lines after the split at the end as well.\n const buffer = this._read(chunkBytesRead + offset);\n const result = new Map();\n const headers = this.toString(buffer, 'ascii').split(CRLF);\n if (headers.length < 2) {\n return result;\n }\n for (let i = 0; i < headers.length - 2; i++) {\n const header = headers[i];\n const index = header.indexOf(':');\n if (index === -1) {\n throw new Error(`Message header must separate key and value using ':'\\n${header}`);\n }\n const key = header.substr(0, index);\n const value = header.substr(index + 1).trim();\n result.set(lowerCaseKeys ? key.toLowerCase() : key, value);\n }\n return result;\n }\n tryReadBody(length) {\n if (this._totalLength < length) {\n return undefined;\n }\n return this._read(length);\n }\n get numberOfBytes() {\n return this._totalLength;\n }\n _read(byteCount) {\n if (byteCount === 0) {\n return this.emptyBuffer();\n }\n if (byteCount > this._totalLength) {\n throw new Error(`Cannot read so many bytes!`);\n }\n if (this._chunks[0].byteLength === byteCount) {\n // super fast path, precisely first chunk must be returned\n const chunk = this._chunks[0];\n this._chunks.shift();\n this._totalLength -= byteCount;\n return this.asNative(chunk);\n }\n if (this._chunks[0].byteLength > byteCount) {\n // fast path, the reading is entirely within the first chunk\n const chunk = this._chunks[0];\n const result = this.asNative(chunk, byteCount);\n this._chunks[0] = chunk.slice(byteCount);\n this._totalLength -= byteCount;\n return result;\n }\n const result = this.allocNative(byteCount);\n let resultOffset = 0;\n let chunkIndex = 0;\n while (byteCount > 0) {\n const chunk = this._chunks[chunkIndex];\n if (chunk.byteLength > byteCount) {\n // this chunk will survive\n const chunkPart = chunk.slice(0, byteCount);\n result.set(chunkPart, resultOffset);\n resultOffset += byteCount;\n this._chunks[chunkIndex] = chunk.slice(byteCount);\n this._totalLength -= byteCount;\n byteCount -= byteCount;\n }\n else {\n // this chunk will be entirely read\n result.set(chunk, resultOffset);\n resultOffset += chunk.byteLength;\n this._chunks.shift();\n this._totalLength -= chunk.byteLength;\n byteCount -= chunk.byteLength;\n }\n }\n return result;\n }\n}\nexports.AbstractMessageBuffer = AbstractMessageBuffer;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createMessageConnection = exports.ConnectionOptions = exports.MessageStrategy = exports.CancellationStrategy = exports.CancellationSenderStrategy = exports.CancellationReceiverStrategy = exports.RequestCancellationReceiverStrategy = exports.IdCancellationReceiverStrategy = exports.ConnectionStrategy = exports.ConnectionError = exports.ConnectionErrors = exports.LogTraceNotification = exports.SetTraceNotification = exports.TraceFormat = exports.TraceValues = exports.Trace = exports.NullLogger = exports.ProgressType = exports.ProgressToken = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst messages_1 = require(\"./messages\");\nconst linkedMap_1 = require(\"./linkedMap\");\nconst events_1 = require(\"./events\");\nconst cancellation_1 = require(\"./cancellation\");\nvar CancelNotification;\n(function (CancelNotification) {\n CancelNotification.type = new messages_1.NotificationType('$/cancelRequest');\n})(CancelNotification || (CancelNotification = {}));\nvar ProgressToken;\n(function (ProgressToken) {\n function is(value) {\n return typeof value === 'string' || typeof value === 'number';\n }\n ProgressToken.is = is;\n})(ProgressToken || (exports.ProgressToken = ProgressToken = {}));\nvar ProgressNotification;\n(function (ProgressNotification) {\n ProgressNotification.type = new messages_1.NotificationType('$/progress');\n})(ProgressNotification || (ProgressNotification = {}));\nclass ProgressType {\n constructor() {\n }\n}\nexports.ProgressType = ProgressType;\nvar StarRequestHandler;\n(function (StarRequestHandler) {\n function is(value) {\n return Is.func(value);\n }\n StarRequestHandler.is = is;\n})(StarRequestHandler || (StarRequestHandler = {}));\nexports.NullLogger = Object.freeze({\n error: () => { },\n warn: () => { },\n info: () => { },\n log: () => { }\n});\nvar Trace;\n(function (Trace) {\n Trace[Trace[\"Off\"] = 0] = \"Off\";\n Trace[Trace[\"Messages\"] = 1] = \"Messages\";\n Trace[Trace[\"Compact\"] = 2] = \"Compact\";\n Trace[Trace[\"Verbose\"] = 3] = \"Verbose\";\n})(Trace || (exports.Trace = Trace = {}));\nvar TraceValues;\n(function (TraceValues) {\n /**\n * Turn tracing off.\n */\n TraceValues.Off = 'off';\n /**\n * Trace messages only.\n */\n TraceValues.Messages = 'messages';\n /**\n * Compact message tracing.\n */\n TraceValues.Compact = 'compact';\n /**\n * Verbose message tracing.\n */\n TraceValues.Verbose = 'verbose';\n})(TraceValues || (exports.TraceValues = TraceValues = {}));\n(function (Trace) {\n function fromString(value) {\n if (!Is.string(value)) {\n return Trace.Off;\n }\n value = value.toLowerCase();\n switch (value) {\n case 'off':\n return Trace.Off;\n case 'messages':\n return Trace.Messages;\n case 'compact':\n return Trace.Compact;\n case 'verbose':\n return Trace.Verbose;\n default:\n return Trace.Off;\n }\n }\n Trace.fromString = fromString;\n function toString(value) {\n switch (value) {\n case Trace.Off:\n return 'off';\n case Trace.Messages:\n return 'messages';\n case Trace.Compact:\n return 'compact';\n case Trace.Verbose:\n return 'verbose';\n default:\n return 'off';\n }\n }\n Trace.toString = toString;\n})(Trace || (exports.Trace = Trace = {}));\nvar TraceFormat;\n(function (TraceFormat) {\n TraceFormat[\"Text\"] = \"text\";\n TraceFormat[\"JSON\"] = \"json\";\n})(TraceFormat || (exports.TraceFormat = TraceFormat = {}));\n(function (TraceFormat) {\n function fromString(value) {\n if (!Is.string(value)) {\n return TraceFormat.Text;\n }\n value = value.toLowerCase();\n if (value === 'json') {\n return TraceFormat.JSON;\n }\n else {\n return TraceFormat.Text;\n }\n }\n TraceFormat.fromString = fromString;\n})(TraceFormat || (exports.TraceFormat = TraceFormat = {}));\nvar SetTraceNotification;\n(function (SetTraceNotification) {\n SetTraceNotification.type = new messages_1.NotificationType('$/setTrace');\n})(SetTraceNotification || (exports.SetTraceNotification = SetTraceNotification = {}));\nvar LogTraceNotification;\n(function (LogTraceNotification) {\n LogTraceNotification.type = new messages_1.NotificationType('$/logTrace');\n})(LogTraceNotification || (exports.LogTraceNotification = LogTraceNotification = {}));\nvar ConnectionErrors;\n(function (ConnectionErrors) {\n /**\n * The connection is closed.\n */\n ConnectionErrors[ConnectionErrors[\"Closed\"] = 1] = \"Closed\";\n /**\n * The connection got disposed.\n */\n ConnectionErrors[ConnectionErrors[\"Disposed\"] = 2] = \"Disposed\";\n /**\n * The connection is already in listening mode.\n */\n ConnectionErrors[ConnectionErrors[\"AlreadyListening\"] = 3] = \"AlreadyListening\";\n})(ConnectionErrors || (exports.ConnectionErrors = ConnectionErrors = {}));\nclass ConnectionError extends Error {\n constructor(code, message) {\n super(message);\n this.code = code;\n Object.setPrototypeOf(this, ConnectionError.prototype);\n }\n}\nexports.ConnectionError = ConnectionError;\nvar ConnectionStrategy;\n(function (ConnectionStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && Is.func(candidate.cancelUndispatched);\n }\n ConnectionStrategy.is = is;\n})(ConnectionStrategy || (exports.ConnectionStrategy = ConnectionStrategy = {}));\nvar IdCancellationReceiverStrategy;\n(function (IdCancellationReceiverStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && (candidate.kind === undefined || candidate.kind === 'id') && Is.func(candidate.createCancellationTokenSource) && (candidate.dispose === undefined || Is.func(candidate.dispose));\n }\n IdCancellationReceiverStrategy.is = is;\n})(IdCancellationReceiverStrategy || (exports.IdCancellationReceiverStrategy = IdCancellationReceiverStrategy = {}));\nvar RequestCancellationReceiverStrategy;\n(function (RequestCancellationReceiverStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && candidate.kind === 'request' && Is.func(candidate.createCancellationTokenSource) && (candidate.dispose === undefined || Is.func(candidate.dispose));\n }\n RequestCancellationReceiverStrategy.is = is;\n})(RequestCancellationReceiverStrategy || (exports.RequestCancellationReceiverStrategy = RequestCancellationReceiverStrategy = {}));\nvar CancellationReceiverStrategy;\n(function (CancellationReceiverStrategy) {\n CancellationReceiverStrategy.Message = Object.freeze({\n createCancellationTokenSource(_) {\n return new cancellation_1.CancellationTokenSource();\n }\n });\n function is(value) {\n return IdCancellationReceiverStrategy.is(value) || RequestCancellationReceiverStrategy.is(value);\n }\n CancellationReceiverStrategy.is = is;\n})(CancellationReceiverStrategy || (exports.CancellationReceiverStrategy = CancellationReceiverStrategy = {}));\nvar CancellationSenderStrategy;\n(function (CancellationSenderStrategy) {\n CancellationSenderStrategy.Message = Object.freeze({\n sendCancellation(conn, id) {\n return conn.sendNotification(CancelNotification.type, { id });\n },\n cleanup(_) { }\n });\n function is(value) {\n const candidate = value;\n return candidate && Is.func(candidate.sendCancellation) && Is.func(candidate.cleanup);\n }\n CancellationSenderStrategy.is = is;\n})(CancellationSenderStrategy || (exports.CancellationSenderStrategy = CancellationSenderStrategy = {}));\nvar CancellationStrategy;\n(function (CancellationStrategy) {\n CancellationStrategy.Message = Object.freeze({\n receiver: CancellationReceiverStrategy.Message,\n sender: CancellationSenderStrategy.Message\n });\n function is(value) {\n const candidate = value;\n return candidate && CancellationReceiverStrategy.is(candidate.receiver) && CancellationSenderStrategy.is(candidate.sender);\n }\n CancellationStrategy.is = is;\n})(CancellationStrategy || (exports.CancellationStrategy = CancellationStrategy = {}));\nvar MessageStrategy;\n(function (MessageStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && Is.func(candidate.handleMessage);\n }\n MessageStrategy.is = is;\n})(MessageStrategy || (exports.MessageStrategy = MessageStrategy = {}));\nvar ConnectionOptions;\n(function (ConnectionOptions) {\n function is(value) {\n const candidate = value;\n return candidate && (CancellationStrategy.is(candidate.cancellationStrategy) || ConnectionStrategy.is(candidate.connectionStrategy) || MessageStrategy.is(candidate.messageStrategy));\n }\n ConnectionOptions.is = is;\n})(ConnectionOptions || (exports.ConnectionOptions = ConnectionOptions = {}));\nvar ConnectionState;\n(function (ConnectionState) {\n ConnectionState[ConnectionState[\"New\"] = 1] = \"New\";\n ConnectionState[ConnectionState[\"Listening\"] = 2] = \"Listening\";\n ConnectionState[ConnectionState[\"Closed\"] = 3] = \"Closed\";\n ConnectionState[ConnectionState[\"Disposed\"] = 4] = \"Disposed\";\n})(ConnectionState || (ConnectionState = {}));\nfunction createMessageConnection(messageReader, messageWriter, _logger, options) {\n const logger = _logger !== undefined ? _logger : exports.NullLogger;\n let sequenceNumber = 0;\n let notificationSequenceNumber = 0;\n let unknownResponseSequenceNumber = 0;\n const version = '2.0';\n let starRequestHandler = undefined;\n const requestHandlers = new Map();\n let starNotificationHandler = undefined;\n const notificationHandlers = new Map();\n const progressHandlers = new Map();\n let timer;\n let messageQueue = new linkedMap_1.LinkedMap();\n let responsePromises = new Map();\n let knownCanceledRequests = new Set();\n let requestTokens = new Map();\n let trace = Trace.Off;\n let traceFormat = TraceFormat.Text;\n let tracer;\n let state = ConnectionState.New;\n const errorEmitter = new events_1.Emitter();\n const closeEmitter = new events_1.Emitter();\n const unhandledNotificationEmitter = new events_1.Emitter();\n const unhandledProgressEmitter = new events_1.Emitter();\n const disposeEmitter = new events_1.Emitter();\n const cancellationStrategy = (options && options.cancellationStrategy) ? options.cancellationStrategy : CancellationStrategy.Message;\n function createRequestQueueKey(id) {\n if (id === null) {\n throw new Error(`Can't send requests with id null since the response can't be correlated.`);\n }\n return 'req-' + id.toString();\n }\n function createResponseQueueKey(id) {\n if (id === null) {\n return 'res-unknown-' + (++unknownResponseSequenceNumber).toString();\n }\n else {\n return 'res-' + id.toString();\n }\n }\n function createNotificationQueueKey() {\n return 'not-' + (++notificationSequenceNumber).toString();\n }\n function addMessageToQueue(queue, message) {\n if (messages_1.Message.isRequest(message)) {\n queue.set(createRequestQueueKey(message.id), message);\n }\n else if (messages_1.Message.isResponse(message)) {\n queue.set(createResponseQueueKey(message.id), message);\n }\n else {\n queue.set(createNotificationQueueKey(), message);\n }\n }\n function cancelUndispatched(_message) {\n return undefined;\n }\n function isListening() {\n return state === ConnectionState.Listening;\n }\n function isClosed() {\n return state === ConnectionState.Closed;\n }\n function isDisposed() {\n return state === ConnectionState.Disposed;\n }\n function closeHandler() {\n if (state === ConnectionState.New || state === ConnectionState.Listening) {\n state = ConnectionState.Closed;\n closeEmitter.fire(undefined);\n }\n // If the connection is disposed don't sent close events.\n }\n function readErrorHandler(error) {\n errorEmitter.fire([error, undefined, undefined]);\n }\n function writeErrorHandler(data) {\n errorEmitter.fire(data);\n }\n messageReader.onClose(closeHandler);\n messageReader.onError(readErrorHandler);\n messageWriter.onClose(closeHandler);\n messageWriter.onError(writeErrorHandler);\n function triggerMessageQueue() {\n if (timer || messageQueue.size === 0) {\n return;\n }\n timer = (0, ral_1.default)().timer.setImmediate(() => {\n timer = undefined;\n processMessageQueue();\n });\n }\n function handleMessage(message) {\n if (messages_1.Message.isRequest(message)) {\n handleRequest(message);\n }\n else if (messages_1.Message.isNotification(message)) {\n handleNotification(message);\n }\n else if (messages_1.Message.isResponse(message)) {\n handleResponse(message);\n }\n else {\n handleInvalidMessage(message);\n }\n }\n function processMessageQueue() {\n if (messageQueue.size === 0) {\n return;\n }\n const message = messageQueue.shift();\n try {\n const messageStrategy = options?.messageStrategy;\n if (MessageStrategy.is(messageStrategy)) {\n messageStrategy.handleMessage(message, handleMessage);\n }\n else {\n handleMessage(message);\n }\n }\n finally {\n triggerMessageQueue();\n }\n }\n const callback = (message) => {\n try {\n // We have received a cancellation message. Check if the message is still in the queue\n // and cancel it if allowed to do so.\n if (messages_1.Message.isNotification(message) && message.method === CancelNotification.type.method) {\n const cancelId = message.params.id;\n const key = createRequestQueueKey(cancelId);\n const toCancel = messageQueue.get(key);\n if (messages_1.Message.isRequest(toCancel)) {\n const strategy = options?.connectionStrategy;\n const response = (strategy && strategy.cancelUndispatched) ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);\n if (response && (response.error !== undefined || response.result !== undefined)) {\n messageQueue.delete(key);\n requestTokens.delete(cancelId);\n response.id = toCancel.id;\n traceSendingResponse(response, message.method, Date.now());\n messageWriter.write(response).catch(() => logger.error(`Sending response for canceled message failed.`));\n return;\n }\n }\n const cancellationToken = requestTokens.get(cancelId);\n // The request is already running. Cancel the token\n if (cancellationToken !== undefined) {\n cancellationToken.cancel();\n traceReceivedNotification(message);\n return;\n }\n else {\n // Remember the cancel but still queue the message to\n // clean up state in process message.\n knownCanceledRequests.add(cancelId);\n }\n }\n addMessageToQueue(messageQueue, message);\n }\n finally {\n triggerMessageQueue();\n }\n };\n function handleRequest(requestMessage) {\n if (isDisposed()) {\n // we return here silently since we fired an event when the\n // connection got disposed.\n return;\n }\n function reply(resultOrError, method, startTime) {\n const message = {\n jsonrpc: version,\n id: requestMessage.id\n };\n if (resultOrError instanceof messages_1.ResponseError) {\n message.error = resultOrError.toJson();\n }\n else {\n message.result = resultOrError === undefined ? null : resultOrError;\n }\n traceSendingResponse(message, method, startTime);\n messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));\n }\n function replyError(error, method, startTime) {\n const message = {\n jsonrpc: version,\n id: requestMessage.id,\n error: error.toJson()\n };\n traceSendingResponse(message, method, startTime);\n messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));\n }\n function replySuccess(result, method, startTime) {\n // The JSON RPC defines that a response must either have a result or an error\n // So we can't treat undefined as a valid response result.\n if (result === undefined) {\n result = null;\n }\n const message = {\n jsonrpc: version,\n id: requestMessage.id,\n result: result\n };\n traceSendingResponse(message, method, startTime);\n messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));\n }\n traceReceivedRequest(requestMessage);\n const element = requestHandlers.get(requestMessage.method);\n let type;\n let requestHandler;\n if (element) {\n type = element.type;\n requestHandler = element.handler;\n }\n const startTime = Date.now();\n if (requestHandler || starRequestHandler) {\n const tokenKey = requestMessage.id ?? String(Date.now()); //\n const cancellationSource = IdCancellationReceiverStrategy.is(cancellationStrategy.receiver)\n ? cancellationStrategy.receiver.createCancellationTokenSource(tokenKey)\n : cancellationStrategy.receiver.createCancellationTokenSource(requestMessage);\n if (requestMessage.id !== null && knownCanceledRequests.has(requestMessage.id)) {\n cancellationSource.cancel();\n }\n if (requestMessage.id !== null) {\n requestTokens.set(tokenKey, cancellationSource);\n }\n try {\n let handlerResult;\n if (requestHandler) {\n if (requestMessage.params === undefined) {\n if (type !== undefined && type.numberOfParams !== 0) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines ${type.numberOfParams} params but received none.`), requestMessage.method, startTime);\n return;\n }\n handlerResult = requestHandler(cancellationSource.token);\n }\n else if (Array.isArray(requestMessage.params)) {\n if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byName) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by name but received parameters by position`), requestMessage.method, startTime);\n return;\n }\n handlerResult = requestHandler(...requestMessage.params, cancellationSource.token);\n }\n else {\n if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byPosition) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by position but received parameters by name`), requestMessage.method, startTime);\n return;\n }\n handlerResult = requestHandler(requestMessage.params, cancellationSource.token);\n }\n }\n else if (starRequestHandler) {\n handlerResult = starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);\n }\n const promise = handlerResult;\n if (!handlerResult) {\n requestTokens.delete(tokenKey);\n replySuccess(handlerResult, requestMessage.method, startTime);\n }\n else if (promise.then) {\n promise.then((resultOrError) => {\n requestTokens.delete(tokenKey);\n reply(resultOrError, requestMessage.method, startTime);\n }, error => {\n requestTokens.delete(tokenKey);\n if (error instanceof messages_1.ResponseError) {\n replyError(error, requestMessage.method, startTime);\n }\n else if (error && Is.string(error.message)) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\n }\n else {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\n }\n });\n }\n else {\n requestTokens.delete(tokenKey);\n reply(handlerResult, requestMessage.method, startTime);\n }\n }\n catch (error) {\n requestTokens.delete(tokenKey);\n if (error instanceof messages_1.ResponseError) {\n reply(error, requestMessage.method, startTime);\n }\n else if (error && Is.string(error.message)) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\n }\n else {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\n }\n }\n }\n else {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);\n }\n }\n function handleResponse(responseMessage) {\n if (isDisposed()) {\n // See handle request.\n return;\n }\n if (responseMessage.id === null) {\n if (responseMessage.error) {\n logger.error(`Received response message without id: Error is: \\n${JSON.stringify(responseMessage.error, undefined, 4)}`);\n }\n else {\n logger.error(`Received response message without id. No further error information provided.`);\n }\n }\n else {\n const key = responseMessage.id;\n const responsePromise = responsePromises.get(key);\n traceReceivedResponse(responseMessage, responsePromise);\n if (responsePromise !== undefined) {\n responsePromises.delete(key);\n try {\n if (responseMessage.error) {\n const error = responseMessage.error;\n responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));\n }\n else if (responseMessage.result !== undefined) {\n responsePromise.resolve(responseMessage.result);\n }\n else {\n throw new Error('Should never happen.');\n }\n }\n catch (error) {\n if (error.message) {\n logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);\n }\n else {\n logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);\n }\n }\n }\n }\n }\n function handleNotification(message) {\n if (isDisposed()) {\n // See handle request.\n return;\n }\n let type = undefined;\n let notificationHandler;\n if (message.method === CancelNotification.type.method) {\n const cancelId = message.params.id;\n knownCanceledRequests.delete(cancelId);\n traceReceivedNotification(message);\n return;\n }\n else {\n const element = notificationHandlers.get(message.method);\n if (element) {\n notificationHandler = element.handler;\n type = element.type;\n }\n }\n if (notificationHandler || starNotificationHandler) {\n try {\n traceReceivedNotification(message);\n if (notificationHandler) {\n if (message.params === undefined) {\n if (type !== undefined) {\n if (type.numberOfParams !== 0 && type.parameterStructures !== messages_1.ParameterStructures.byName) {\n logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received none.`);\n }\n }\n notificationHandler();\n }\n else if (Array.isArray(message.params)) {\n // There are JSON-RPC libraries that send progress message as positional params although\n // specified as named. So convert them if this is the case.\n const params = message.params;\n if (message.method === ProgressNotification.type.method && params.length === 2 && ProgressToken.is(params[0])) {\n notificationHandler({ token: params[0], value: params[1] });\n }\n else {\n if (type !== undefined) {\n if (type.parameterStructures === messages_1.ParameterStructures.byName) {\n logger.error(`Notification ${message.method} defines parameters by name but received parameters by position`);\n }\n if (type.numberOfParams !== message.params.length) {\n logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received ${params.length} arguments`);\n }\n }\n notificationHandler(...params);\n }\n }\n else {\n if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byPosition) {\n logger.error(`Notification ${message.method} defines parameters by position but received parameters by name`);\n }\n notificationHandler(message.params);\n }\n }\n else if (starNotificationHandler) {\n starNotificationHandler(message.method, message.params);\n }\n }\n catch (error) {\n if (error.message) {\n logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);\n }\n else {\n logger.error(`Notification handler '${message.method}' failed unexpectedly.`);\n }\n }\n }\n else {\n unhandledNotificationEmitter.fire(message);\n }\n }\n function handleInvalidMessage(message) {\n if (!message) {\n logger.error('Received empty message.');\n return;\n }\n logger.error(`Received message which is neither a response nor a notification message:\\n${JSON.stringify(message, null, 4)}`);\n // Test whether we find an id to reject the promise\n const responseMessage = message;\n if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {\n const key = responseMessage.id;\n const responseHandler = responsePromises.get(key);\n if (responseHandler) {\n responseHandler.reject(new Error('The received response has neither a result nor an error property.'));\n }\n }\n }\n function stringifyTrace(params) {\n if (params === undefined || params === null) {\n return undefined;\n }\n switch (trace) {\n case Trace.Verbose:\n return JSON.stringify(params, null, 4);\n case Trace.Compact:\n return JSON.stringify(params);\n default:\n return undefined;\n }\n }\n function traceSendingRequest(message) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if ((trace === Trace.Verbose || trace === Trace.Compact) && message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);\n }\n else {\n logLSPMessage('send-request', message);\n }\n }\n function traceSendingNotification(message) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n else {\n data = 'No parameters provided.\\n\\n';\n }\n }\n tracer.log(`Sending notification '${message.method}'.`, data);\n }\n else {\n logLSPMessage('send-notification', message);\n }\n }\n function traceSendingResponse(message, method, startTime) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.error && message.error.data) {\n data = `Error data: ${stringifyTrace(message.error.data)}\\n\\n`;\n }\n else {\n if (message.result) {\n data = `Result: ${stringifyTrace(message.result)}\\n\\n`;\n }\n else if (message.error === undefined) {\n data = 'No result returned.\\n\\n';\n }\n }\n }\n tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);\n }\n else {\n logLSPMessage('send-response', message);\n }\n }\n function traceReceivedRequest(message) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if ((trace === Trace.Verbose || trace === Trace.Compact) && message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n tracer.log(`Received request '${message.method} - (${message.id})'.`, data);\n }\n else {\n logLSPMessage('receive-request', message);\n }\n }\n function traceReceivedNotification(message) {\n if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n else {\n data = 'No parameters provided.\\n\\n';\n }\n }\n tracer.log(`Received notification '${message.method}'.`, data);\n }\n else {\n logLSPMessage('receive-notification', message);\n }\n }\n function traceReceivedResponse(message, responsePromise) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.error && message.error.data) {\n data = `Error data: ${stringifyTrace(message.error.data)}\\n\\n`;\n }\n else {\n if (message.result) {\n data = `Result: ${stringifyTrace(message.result)}\\n\\n`;\n }\n else if (message.error === undefined) {\n data = 'No result returned.\\n\\n';\n }\n }\n }\n if (responsePromise) {\n const error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : '';\n tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);\n }\n else {\n tracer.log(`Received response ${message.id} without active response promise.`, data);\n }\n }\n else {\n logLSPMessage('receive-response', message);\n }\n }\n function logLSPMessage(type, message) {\n if (!tracer || trace === Trace.Off) {\n return;\n }\n const lspMessage = {\n isLSPMessage: true,\n type,\n message,\n timestamp: Date.now()\n };\n tracer.log(lspMessage);\n }\n function throwIfClosedOrDisposed() {\n if (isClosed()) {\n throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.');\n }\n if (isDisposed()) {\n throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.');\n }\n }\n function throwIfListening() {\n if (isListening()) {\n throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening');\n }\n }\n function throwIfNotListening() {\n if (!isListening()) {\n throw new Error('Call listen() first.');\n }\n }\n function undefinedToNull(param) {\n if (param === undefined) {\n return null;\n }\n else {\n return param;\n }\n }\n function nullToUndefined(param) {\n if (param === null) {\n return undefined;\n }\n else {\n return param;\n }\n }\n function isNamedParam(param) {\n return param !== undefined && param !== null && !Array.isArray(param) && typeof param === 'object';\n }\n function computeSingleParam(parameterStructures, param) {\n switch (parameterStructures) {\n case messages_1.ParameterStructures.auto:\n if (isNamedParam(param)) {\n return nullToUndefined(param);\n }\n else {\n return [undefinedToNull(param)];\n }\n case messages_1.ParameterStructures.byName:\n if (!isNamedParam(param)) {\n throw new Error(`Received parameters by name but param is not an object literal.`);\n }\n return nullToUndefined(param);\n case messages_1.ParameterStructures.byPosition:\n return [undefinedToNull(param)];\n default:\n throw new Error(`Unknown parameter structure ${parameterStructures.toString()}`);\n }\n }\n function computeMessageParams(type, params) {\n let result;\n const numberOfParams = type.numberOfParams;\n switch (numberOfParams) {\n case 0:\n result = undefined;\n break;\n case 1:\n result = computeSingleParam(type.parameterStructures, params[0]);\n break;\n default:\n result = [];\n for (let i = 0; i < params.length && i < numberOfParams; i++) {\n result.push(undefinedToNull(params[i]));\n }\n if (params.length < numberOfParams) {\n for (let i = params.length; i < numberOfParams; i++) {\n result.push(null);\n }\n }\n break;\n }\n return result;\n }\n const connection = {\n sendNotification: (type, ...args) => {\n throwIfClosedOrDisposed();\n let method;\n let messageParams;\n if (Is.string(type)) {\n method = type;\n const first = args[0];\n let paramStart = 0;\n let parameterStructures = messages_1.ParameterStructures.auto;\n if (messages_1.ParameterStructures.is(first)) {\n paramStart = 1;\n parameterStructures = first;\n }\n let paramEnd = args.length;\n const numberOfParams = paramEnd - paramStart;\n switch (numberOfParams) {\n case 0:\n messageParams = undefined;\n break;\n case 1:\n messageParams = computeSingleParam(parameterStructures, args[paramStart]);\n break;\n default:\n if (parameterStructures === messages_1.ParameterStructures.byName) {\n throw new Error(`Received ${numberOfParams} parameters for 'by Name' notification parameter structure.`);\n }\n messageParams = args.slice(paramStart, paramEnd).map(value => undefinedToNull(value));\n break;\n }\n }\n else {\n const params = args;\n method = type.method;\n messageParams = computeMessageParams(type, params);\n }\n const notificationMessage = {\n jsonrpc: version,\n method: method,\n params: messageParams\n };\n traceSendingNotification(notificationMessage);\n return messageWriter.write(notificationMessage).catch((error) => {\n logger.error(`Sending notification failed.`);\n throw error;\n });\n },\n onNotification: (type, handler) => {\n throwIfClosedOrDisposed();\n let method;\n if (Is.func(type)) {\n starNotificationHandler = type;\n }\n else if (handler) {\n if (Is.string(type)) {\n method = type;\n notificationHandlers.set(type, { type: undefined, handler });\n }\n else {\n method = type.method;\n notificationHandlers.set(type.method, { type, handler });\n }\n }\n return {\n dispose: () => {\n if (method !== undefined) {\n notificationHandlers.delete(method);\n }\n else {\n starNotificationHandler = undefined;\n }\n }\n };\n },\n onProgress: (_type, token, handler) => {\n if (progressHandlers.has(token)) {\n throw new Error(`Progress handler for token ${token} already registered`);\n }\n progressHandlers.set(token, handler);\n return {\n dispose: () => {\n progressHandlers.delete(token);\n }\n };\n },\n sendProgress: (_type, token, value) => {\n // This should not await but simple return to ensure that we don't have another\n // async scheduling. Otherwise one send could overtake another send.\n return connection.sendNotification(ProgressNotification.type, { token, value });\n },\n onUnhandledProgress: unhandledProgressEmitter.event,\n sendRequest: (type, ...args) => {\n throwIfClosedOrDisposed();\n throwIfNotListening();\n let method;\n let messageParams;\n let token = undefined;\n if (Is.string(type)) {\n method = type;\n const first = args[0];\n const last = args[args.length - 1];\n let paramStart = 0;\n let parameterStructures = messages_1.ParameterStructures.auto;\n if (messages_1.ParameterStructures.is(first)) {\n paramStart = 1;\n parameterStructures = first;\n }\n let paramEnd = args.length;\n if (cancellation_1.CancellationToken.is(last)) {\n paramEnd = paramEnd - 1;\n token = last;\n }\n const numberOfParams = paramEnd - paramStart;\n switch (numberOfParams) {\n case 0:\n messageParams = undefined;\n break;\n case 1:\n messageParams = computeSingleParam(parameterStructures, args[paramStart]);\n break;\n default:\n if (parameterStructures === messages_1.ParameterStructures.byName) {\n throw new Error(`Received ${numberOfParams} parameters for 'by Name' request parameter structure.`);\n }\n messageParams = args.slice(paramStart, paramEnd).map(value => undefinedToNull(value));\n break;\n }\n }\n else {\n const params = args;\n method = type.method;\n messageParams = computeMessageParams(type, params);\n const numberOfParams = type.numberOfParams;\n token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined;\n }\n const id = sequenceNumber++;\n let disposable;\n if (token) {\n disposable = token.onCancellationRequested(() => {\n const p = cancellationStrategy.sender.sendCancellation(connection, id);\n if (p === undefined) {\n logger.log(`Received no promise from cancellation strategy when cancelling id ${id}`);\n return Promise.resolve();\n }\n else {\n return p.catch(() => {\n logger.log(`Sending cancellation messages for id ${id} failed`);\n });\n }\n });\n }\n const requestMessage = {\n jsonrpc: version,\n id: id,\n method: method,\n params: messageParams\n };\n traceSendingRequest(requestMessage);\n if (typeof cancellationStrategy.sender.enableCancellation === 'function') {\n cancellationStrategy.sender.enableCancellation(requestMessage);\n }\n return new Promise(async (resolve, reject) => {\n const resolveWithCleanup = (r) => {\n resolve(r);\n cancellationStrategy.sender.cleanup(id);\n disposable?.dispose();\n };\n const rejectWithCleanup = (r) => {\n reject(r);\n cancellationStrategy.sender.cleanup(id);\n disposable?.dispose();\n };\n const responsePromise = { method: method, timerStart: Date.now(), resolve: resolveWithCleanup, reject: rejectWithCleanup };\n try {\n await messageWriter.write(requestMessage);\n responsePromises.set(id, responsePromise);\n }\n catch (error) {\n logger.error(`Sending request failed.`);\n // Writing the message failed. So we need to reject the promise.\n responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, error.message ? error.message : 'Unknown reason'));\n throw error;\n }\n });\n },\n onRequest: (type, handler) => {\n throwIfClosedOrDisposed();\n let method = null;\n if (StarRequestHandler.is(type)) {\n method = undefined;\n starRequestHandler = type;\n }\n else if (Is.string(type)) {\n method = null;\n if (handler !== undefined) {\n method = type;\n requestHandlers.set(type, { handler: handler, type: undefined });\n }\n }\n else {\n if (handler !== undefined) {\n method = type.method;\n requestHandlers.set(type.method, { type, handler });\n }\n }\n return {\n dispose: () => {\n if (method === null) {\n return;\n }\n if (method !== undefined) {\n requestHandlers.delete(method);\n }\n else {\n starRequestHandler = undefined;\n }\n }\n };\n },\n hasPendingResponse: () => {\n return responsePromises.size > 0;\n },\n trace: async (_value, _tracer, sendNotificationOrTraceOptions) => {\n let _sendNotification = false;\n let _traceFormat = TraceFormat.Text;\n if (sendNotificationOrTraceOptions !== undefined) {\n if (Is.boolean(sendNotificationOrTraceOptions)) {\n _sendNotification = sendNotificationOrTraceOptions;\n }\n else {\n _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;\n _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;\n }\n }\n trace = _value;\n traceFormat = _traceFormat;\n if (trace === Trace.Off) {\n tracer = undefined;\n }\n else {\n tracer = _tracer;\n }\n if (_sendNotification && !isClosed() && !isDisposed()) {\n await connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) });\n }\n },\n onError: errorEmitter.event,\n onClose: closeEmitter.event,\n onUnhandledNotification: unhandledNotificationEmitter.event,\n onDispose: disposeEmitter.event,\n end: () => {\n messageWriter.end();\n },\n dispose: () => {\n if (isDisposed()) {\n return;\n }\n state = ConnectionState.Disposed;\n disposeEmitter.fire(undefined);\n const error = new messages_1.ResponseError(messages_1.ErrorCodes.PendingResponseRejected, 'Pending response rejected since connection got disposed');\n for (const promise of responsePromises.values()) {\n promise.reject(error);\n }\n responsePromises = new Map();\n requestTokens = new Map();\n knownCanceledRequests = new Set();\n messageQueue = new linkedMap_1.LinkedMap();\n // Test for backwards compatibility\n if (Is.func(messageWriter.dispose)) {\n messageWriter.dispose();\n }\n if (Is.func(messageReader.dispose)) {\n messageReader.dispose();\n }\n },\n listen: () => {\n throwIfClosedOrDisposed();\n throwIfListening();\n state = ConnectionState.Listening;\n messageReader.listen(callback);\n },\n inspect: () => {\n // eslint-disable-next-line no-console\n (0, ral_1.default)().console.log('inspect');\n }\n };\n connection.onNotification(LogTraceNotification.type, (params) => {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n const verbose = trace === Trace.Verbose || trace === Trace.Compact;\n tracer.log(params.message, verbose ? params.verbose : undefined);\n });\n connection.onNotification(ProgressNotification.type, (params) => {\n const handler = progressHandlers.get(params.token);\n if (handler) {\n handler(params.value);\n }\n else {\n unhandledProgressEmitter.fire(params);\n }\n });\n return connection;\n}\nexports.createMessageConnection = createMessageConnection;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n/// \nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProgressType = exports.ProgressToken = exports.createMessageConnection = exports.NullLogger = exports.ConnectionOptions = exports.ConnectionStrategy = exports.AbstractMessageBuffer = exports.WriteableStreamMessageWriter = exports.AbstractMessageWriter = exports.MessageWriter = exports.ReadableStreamMessageReader = exports.AbstractMessageReader = exports.MessageReader = exports.SharedArrayReceiverStrategy = exports.SharedArraySenderStrategy = exports.CancellationToken = exports.CancellationTokenSource = exports.Emitter = exports.Event = exports.Disposable = exports.LRUCache = exports.Touch = exports.LinkedMap = exports.ParameterStructures = exports.NotificationType9 = exports.NotificationType8 = exports.NotificationType7 = exports.NotificationType6 = exports.NotificationType5 = exports.NotificationType4 = exports.NotificationType3 = exports.NotificationType2 = exports.NotificationType1 = exports.NotificationType0 = exports.NotificationType = exports.ErrorCodes = exports.ResponseError = exports.RequestType9 = exports.RequestType8 = exports.RequestType7 = exports.RequestType6 = exports.RequestType5 = exports.RequestType4 = exports.RequestType3 = exports.RequestType2 = exports.RequestType1 = exports.RequestType0 = exports.RequestType = exports.Message = exports.RAL = void 0;\nexports.MessageStrategy = exports.CancellationStrategy = exports.CancellationSenderStrategy = exports.CancellationReceiverStrategy = exports.ConnectionError = exports.ConnectionErrors = exports.LogTraceNotification = exports.SetTraceNotification = exports.TraceFormat = exports.TraceValues = exports.Trace = void 0;\nconst messages_1 = require(\"./messages\");\nObject.defineProperty(exports, \"Message\", { enumerable: true, get: function () { return messages_1.Message; } });\nObject.defineProperty(exports, \"RequestType\", { enumerable: true, get: function () { return messages_1.RequestType; } });\nObject.defineProperty(exports, \"RequestType0\", { enumerable: true, get: function () { return messages_1.RequestType0; } });\nObject.defineProperty(exports, \"RequestType1\", { enumerable: true, get: function () { return messages_1.RequestType1; } });\nObject.defineProperty(exports, \"RequestType2\", { enumerable: true, get: function () { return messages_1.RequestType2; } });\nObject.defineProperty(exports, \"RequestType3\", { enumerable: true, get: function () { return messages_1.RequestType3; } });\nObject.defineProperty(exports, \"RequestType4\", { enumerable: true, get: function () { return messages_1.RequestType4; } });\nObject.defineProperty(exports, \"RequestType5\", { enumerable: true, get: function () { return messages_1.RequestType5; } });\nObject.defineProperty(exports, \"RequestType6\", { enumerable: true, get: function () { return messages_1.RequestType6; } });\nObject.defineProperty(exports, \"RequestType7\", { enumerable: true, get: function () { return messages_1.RequestType7; } });\nObject.defineProperty(exports, \"RequestType8\", { enumerable: true, get: function () { return messages_1.RequestType8; } });\nObject.defineProperty(exports, \"RequestType9\", { enumerable: true, get: function () { return messages_1.RequestType9; } });\nObject.defineProperty(exports, \"ResponseError\", { enumerable: true, get: function () { return messages_1.ResponseError; } });\nObject.defineProperty(exports, \"ErrorCodes\", { enumerable: true, get: function () { return messages_1.ErrorCodes; } });\nObject.defineProperty(exports, \"NotificationType\", { enumerable: true, get: function () { return messages_1.NotificationType; } });\nObject.defineProperty(exports, \"NotificationType0\", { enumerable: true, get: function () { return messages_1.NotificationType0; } });\nObject.defineProperty(exports, \"NotificationType1\", { enumerable: true, get: function () { return messages_1.NotificationType1; } });\nObject.defineProperty(exports, \"NotificationType2\", { enumerable: true, get: function () { return messages_1.NotificationType2; } });\nObject.defineProperty(exports, \"NotificationType3\", { enumerable: true, get: function () { return messages_1.NotificationType3; } });\nObject.defineProperty(exports, \"NotificationType4\", { enumerable: true, get: function () { return messages_1.NotificationType4; } });\nObject.defineProperty(exports, \"NotificationType5\", { enumerable: true, get: function () { return messages_1.NotificationType5; } });\nObject.defineProperty(exports, \"NotificationType6\", { enumerable: true, get: function () { return messages_1.NotificationType6; } });\nObject.defineProperty(exports, \"NotificationType7\", { enumerable: true, get: function () { return messages_1.NotificationType7; } });\nObject.defineProperty(exports, \"NotificationType8\", { enumerable: true, get: function () { return messages_1.NotificationType8; } });\nObject.defineProperty(exports, \"NotificationType9\", { enumerable: true, get: function () { return messages_1.NotificationType9; } });\nObject.defineProperty(exports, \"ParameterStructures\", { enumerable: true, get: function () { return messages_1.ParameterStructures; } });\nconst linkedMap_1 = require(\"./linkedMap\");\nObject.defineProperty(exports, \"LinkedMap\", { enumerable: true, get: function () { return linkedMap_1.LinkedMap; } });\nObject.defineProperty(exports, \"LRUCache\", { enumerable: true, get: function () { return linkedMap_1.LRUCache; } });\nObject.defineProperty(exports, \"Touch\", { enumerable: true, get: function () { return linkedMap_1.Touch; } });\nconst disposable_1 = require(\"./disposable\");\nObject.defineProperty(exports, \"Disposable\", { enumerable: true, get: function () { return disposable_1.Disposable; } });\nconst events_1 = require(\"./events\");\nObject.defineProperty(exports, \"Event\", { enumerable: true, get: function () { return events_1.Event; } });\nObject.defineProperty(exports, \"Emitter\", { enumerable: true, get: function () { return events_1.Emitter; } });\nconst cancellation_1 = require(\"./cancellation\");\nObject.defineProperty(exports, \"CancellationTokenSource\", { enumerable: true, get: function () { return cancellation_1.CancellationTokenSource; } });\nObject.defineProperty(exports, \"CancellationToken\", { enumerable: true, get: function () { return cancellation_1.CancellationToken; } });\nconst sharedArrayCancellation_1 = require(\"./sharedArrayCancellation\");\nObject.defineProperty(exports, \"SharedArraySenderStrategy\", { enumerable: true, get: function () { return sharedArrayCancellation_1.SharedArraySenderStrategy; } });\nObject.defineProperty(exports, \"SharedArrayReceiverStrategy\", { enumerable: true, get: function () { return sharedArrayCancellation_1.SharedArrayReceiverStrategy; } });\nconst messageReader_1 = require(\"./messageReader\");\nObject.defineProperty(exports, \"MessageReader\", { enumerable: true, get: function () { return messageReader_1.MessageReader; } });\nObject.defineProperty(exports, \"AbstractMessageReader\", { enumerable: true, get: function () { return messageReader_1.AbstractMessageReader; } });\nObject.defineProperty(exports, \"ReadableStreamMessageReader\", { enumerable: true, get: function () { return messageReader_1.ReadableStreamMessageReader; } });\nconst messageWriter_1 = require(\"./messageWriter\");\nObject.defineProperty(exports, \"MessageWriter\", { enumerable: true, get: function () { return messageWriter_1.MessageWriter; } });\nObject.defineProperty(exports, \"AbstractMessageWriter\", { enumerable: true, get: function () { return messageWriter_1.AbstractMessageWriter; } });\nObject.defineProperty(exports, \"WriteableStreamMessageWriter\", { enumerable: true, get: function () { return messageWriter_1.WriteableStreamMessageWriter; } });\nconst messageBuffer_1 = require(\"./messageBuffer\");\nObject.defineProperty(exports, \"AbstractMessageBuffer\", { enumerable: true, get: function () { return messageBuffer_1.AbstractMessageBuffer; } });\nconst connection_1 = require(\"./connection\");\nObject.defineProperty(exports, \"ConnectionStrategy\", { enumerable: true, get: function () { return connection_1.ConnectionStrategy; } });\nObject.defineProperty(exports, \"ConnectionOptions\", { enumerable: true, get: function () { return connection_1.ConnectionOptions; } });\nObject.defineProperty(exports, \"NullLogger\", { enumerable: true, get: function () { return connection_1.NullLogger; } });\nObject.defineProperty(exports, \"createMessageConnection\", { enumerable: true, get: function () { return connection_1.createMessageConnection; } });\nObject.defineProperty(exports, \"ProgressToken\", { enumerable: true, get: function () { return connection_1.ProgressToken; } });\nObject.defineProperty(exports, \"ProgressType\", { enumerable: true, get: function () { return connection_1.ProgressType; } });\nObject.defineProperty(exports, \"Trace\", { enumerable: true, get: function () { return connection_1.Trace; } });\nObject.defineProperty(exports, \"TraceValues\", { enumerable: true, get: function () { return connection_1.TraceValues; } });\nObject.defineProperty(exports, \"TraceFormat\", { enumerable: true, get: function () { return connection_1.TraceFormat; } });\nObject.defineProperty(exports, \"SetTraceNotification\", { enumerable: true, get: function () { return connection_1.SetTraceNotification; } });\nObject.defineProperty(exports, \"LogTraceNotification\", { enumerable: true, get: function () { return connection_1.LogTraceNotification; } });\nObject.defineProperty(exports, \"ConnectionErrors\", { enumerable: true, get: function () { return connection_1.ConnectionErrors; } });\nObject.defineProperty(exports, \"ConnectionError\", { enumerable: true, get: function () { return connection_1.ConnectionError; } });\nObject.defineProperty(exports, \"CancellationReceiverStrategy\", { enumerable: true, get: function () { return connection_1.CancellationReceiverStrategy; } });\nObject.defineProperty(exports, \"CancellationSenderStrategy\", { enumerable: true, get: function () { return connection_1.CancellationSenderStrategy; } });\nObject.defineProperty(exports, \"CancellationStrategy\", { enumerable: true, get: function () { return connection_1.CancellationStrategy; } });\nObject.defineProperty(exports, \"MessageStrategy\", { enumerable: true, get: function () { return connection_1.MessageStrategy; } });\nconst ral_1 = require(\"./ral\");\nexports.RAL = ral_1.default;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"util\");\nconst api_1 = require(\"../common/api\");\nclass MessageBuffer extends api_1.AbstractMessageBuffer {\n constructor(encoding = 'utf-8') {\n super(encoding);\n }\n emptyBuffer() {\n return MessageBuffer.emptyBuffer;\n }\n fromString(value, encoding) {\n return Buffer.from(value, encoding);\n }\n toString(value, encoding) {\n if (value instanceof Buffer) {\n return value.toString(encoding);\n }\n else {\n return new util_1.TextDecoder(encoding).decode(value);\n }\n }\n asNative(buffer, length) {\n if (length === undefined) {\n return buffer instanceof Buffer ? buffer : Buffer.from(buffer);\n }\n else {\n return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer, 0, length);\n }\n }\n allocNative(length) {\n return Buffer.allocUnsafe(length);\n }\n}\nMessageBuffer.emptyBuffer = Buffer.allocUnsafe(0);\nclass ReadableStreamWrapper {\n constructor(stream) {\n this.stream = stream;\n }\n onClose(listener) {\n this.stream.on('close', listener);\n return api_1.Disposable.create(() => this.stream.off('close', listener));\n }\n onError(listener) {\n this.stream.on('error', listener);\n return api_1.Disposable.create(() => this.stream.off('error', listener));\n }\n onEnd(listener) {\n this.stream.on('end', listener);\n return api_1.Disposable.create(() => this.stream.off('end', listener));\n }\n onData(listener) {\n this.stream.on('data', listener);\n return api_1.Disposable.create(() => this.stream.off('data', listener));\n }\n}\nclass WritableStreamWrapper {\n constructor(stream) {\n this.stream = stream;\n }\n onClose(listener) {\n this.stream.on('close', listener);\n return api_1.Disposable.create(() => this.stream.off('close', listener));\n }\n onError(listener) {\n this.stream.on('error', listener);\n return api_1.Disposable.create(() => this.stream.off('error', listener));\n }\n onEnd(listener) {\n this.stream.on('end', listener);\n return api_1.Disposable.create(() => this.stream.off('end', listener));\n }\n write(data, encoding) {\n return new Promise((resolve, reject) => {\n const callback = (error) => {\n if (error === undefined || error === null) {\n resolve();\n }\n else {\n reject(error);\n }\n };\n if (typeof data === 'string') {\n this.stream.write(data, encoding, callback);\n }\n else {\n this.stream.write(data, callback);\n }\n });\n }\n end() {\n this.stream.end();\n }\n}\nconst _ril = Object.freeze({\n messageBuffer: Object.freeze({\n create: (encoding) => new MessageBuffer(encoding)\n }),\n applicationJson: Object.freeze({\n encoder: Object.freeze({\n name: 'application/json',\n encode: (msg, options) => {\n try {\n return Promise.resolve(Buffer.from(JSON.stringify(msg, undefined, 0), options.charset));\n }\n catch (err) {\n return Promise.reject(err);\n }\n }\n }),\n decoder: Object.freeze({\n name: 'application/json',\n decode: (buffer, options) => {\n try {\n if (buffer instanceof Buffer) {\n return Promise.resolve(JSON.parse(buffer.toString(options.charset)));\n }\n else {\n return Promise.resolve(JSON.parse(new util_1.TextDecoder(options.charset).decode(buffer)));\n }\n }\n catch (err) {\n return Promise.reject(err);\n }\n }\n })\n }),\n stream: Object.freeze({\n asReadableStream: (stream) => new ReadableStreamWrapper(stream),\n asWritableStream: (stream) => new WritableStreamWrapper(stream)\n }),\n console: console,\n timer: Object.freeze({\n setTimeout(callback, ms, ...args) {\n const handle = setTimeout(callback, ms, ...args);\n return { dispose: () => clearTimeout(handle) };\n },\n setImmediate(callback, ...args) {\n const handle = setImmediate(callback, ...args);\n return { dispose: () => clearImmediate(handle) };\n },\n setInterval(callback, ms, ...args) {\n const handle = setInterval(callback, ms, ...args);\n return { dispose: () => clearInterval(handle) };\n }\n })\n});\nfunction RIL() {\n return _ril;\n}\n(function (RIL) {\n function install() {\n api_1.RAL.install(_ril);\n }\n RIL.install = install;\n})(RIL || (RIL = {}));\nexports.default = RIL;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createMessageConnection = exports.createServerSocketTransport = exports.createClientSocketTransport = exports.createServerPipeTransport = exports.createClientPipeTransport = exports.generateRandomPipeName = exports.StreamMessageWriter = exports.StreamMessageReader = exports.SocketMessageWriter = exports.SocketMessageReader = exports.PortMessageWriter = exports.PortMessageReader = exports.IPCMessageWriter = exports.IPCMessageReader = void 0;\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\nconst ril_1 = require(\"./ril\");\n// Install the node runtime abstract.\nril_1.default.install();\nconst path = require(\"path\");\nconst os = require(\"os\");\nconst crypto_1 = require(\"crypto\");\nconst net_1 = require(\"net\");\nconst api_1 = require(\"../common/api\");\n__exportStar(require(\"../common/api\"), exports);\nclass IPCMessageReader extends api_1.AbstractMessageReader {\n constructor(process) {\n super();\n this.process = process;\n let eventEmitter = this.process;\n eventEmitter.on('error', (error) => this.fireError(error));\n eventEmitter.on('close', () => this.fireClose());\n }\n listen(callback) {\n this.process.on('message', callback);\n return api_1.Disposable.create(() => this.process.off('message', callback));\n }\n}\nexports.IPCMessageReader = IPCMessageReader;\nclass IPCMessageWriter extends api_1.AbstractMessageWriter {\n constructor(process) {\n super();\n this.process = process;\n this.errorCount = 0;\n const eventEmitter = this.process;\n eventEmitter.on('error', (error) => this.fireError(error));\n eventEmitter.on('close', () => this.fireClose);\n }\n write(msg) {\n try {\n if (typeof this.process.send === 'function') {\n this.process.send(msg, undefined, undefined, (error) => {\n if (error) {\n this.errorCount++;\n this.handleError(error, msg);\n }\n else {\n this.errorCount = 0;\n }\n });\n }\n return Promise.resolve();\n }\n catch (error) {\n this.handleError(error, msg);\n return Promise.reject(error);\n }\n }\n handleError(error, msg) {\n this.errorCount++;\n this.fireError(error, msg, this.errorCount);\n }\n end() {\n }\n}\nexports.IPCMessageWriter = IPCMessageWriter;\nclass PortMessageReader extends api_1.AbstractMessageReader {\n constructor(port) {\n super();\n this.onData = new api_1.Emitter;\n port.on('close', () => this.fireClose);\n port.on('error', (error) => this.fireError(error));\n port.on('message', (message) => {\n this.onData.fire(message);\n });\n }\n listen(callback) {\n return this.onData.event(callback);\n }\n}\nexports.PortMessageReader = PortMessageReader;\nclass PortMessageWriter extends api_1.AbstractMessageWriter {\n constructor(port) {\n super();\n this.port = port;\n this.errorCount = 0;\n port.on('close', () => this.fireClose());\n port.on('error', (error) => this.fireError(error));\n }\n write(msg) {\n try {\n this.port.postMessage(msg);\n return Promise.resolve();\n }\n catch (error) {\n this.handleError(error, msg);\n return Promise.reject(error);\n }\n }\n handleError(error, msg) {\n this.errorCount++;\n this.fireError(error, msg, this.errorCount);\n }\n end() {\n }\n}\nexports.PortMessageWriter = PortMessageWriter;\nclass SocketMessageReader extends api_1.ReadableStreamMessageReader {\n constructor(socket, encoding = 'utf-8') {\n super((0, ril_1.default)().stream.asReadableStream(socket), encoding);\n }\n}\nexports.SocketMessageReader = SocketMessageReader;\nclass SocketMessageWriter extends api_1.WriteableStreamMessageWriter {\n constructor(socket, options) {\n super((0, ril_1.default)().stream.asWritableStream(socket), options);\n this.socket = socket;\n }\n dispose() {\n super.dispose();\n this.socket.destroy();\n }\n}\nexports.SocketMessageWriter = SocketMessageWriter;\nclass StreamMessageReader extends api_1.ReadableStreamMessageReader {\n constructor(readable, encoding) {\n super((0, ril_1.default)().stream.asReadableStream(readable), encoding);\n }\n}\nexports.StreamMessageReader = StreamMessageReader;\nclass StreamMessageWriter extends api_1.WriteableStreamMessageWriter {\n constructor(writable, options) {\n super((0, ril_1.default)().stream.asWritableStream(writable), options);\n }\n}\nexports.StreamMessageWriter = StreamMessageWriter;\nconst XDG_RUNTIME_DIR = process.env['XDG_RUNTIME_DIR'];\nconst safeIpcPathLengths = new Map([\n ['linux', 107],\n ['darwin', 103]\n]);\nfunction generateRandomPipeName() {\n const randomSuffix = (0, crypto_1.randomBytes)(21).toString('hex');\n if (process.platform === 'win32') {\n return `\\\\\\\\.\\\\pipe\\\\vscode-jsonrpc-${randomSuffix}-sock`;\n }\n let result;\n if (XDG_RUNTIME_DIR) {\n result = path.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);\n }\n else {\n result = path.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);\n }\n const limit = safeIpcPathLengths.get(process.platform);\n if (limit !== undefined && result.length > limit) {\n (0, ril_1.default)().console.warn(`WARNING: IPC handle \"${result}\" is longer than ${limit} characters.`);\n }\n return result;\n}\nexports.generateRandomPipeName = generateRandomPipeName;\nfunction createClientPipeTransport(pipeName, encoding = 'utf-8') {\n let connectResolve;\n const connected = new Promise((resolve, _reject) => {\n connectResolve = resolve;\n });\n return new Promise((resolve, reject) => {\n let server = (0, net_1.createServer)((socket) => {\n server.close();\n connectResolve([\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ]);\n });\n server.on('error', reject);\n server.listen(pipeName, () => {\n server.removeListener('error', reject);\n resolve({\n onConnected: () => { return connected; }\n });\n });\n });\n}\nexports.createClientPipeTransport = createClientPipeTransport;\nfunction createServerPipeTransport(pipeName, encoding = 'utf-8') {\n const socket = (0, net_1.createConnection)(pipeName);\n return [\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ];\n}\nexports.createServerPipeTransport = createServerPipeTransport;\nfunction createClientSocketTransport(port, encoding = 'utf-8') {\n let connectResolve;\n const connected = new Promise((resolve, _reject) => {\n connectResolve = resolve;\n });\n return new Promise((resolve, reject) => {\n const server = (0, net_1.createServer)((socket) => {\n server.close();\n connectResolve([\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ]);\n });\n server.on('error', reject);\n server.listen(port, '127.0.0.1', () => {\n server.removeListener('error', reject);\n resolve({\n onConnected: () => { return connected; }\n });\n });\n });\n}\nexports.createClientSocketTransport = createClientSocketTransport;\nfunction createServerSocketTransport(port, encoding = 'utf-8') {\n const socket = (0, net_1.createConnection)(port, '127.0.0.1');\n return [\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ];\n}\nexports.createServerSocketTransport = createServerSocketTransport;\nfunction isReadableStream(value) {\n const candidate = value;\n return candidate.read !== undefined && candidate.addListener !== undefined;\n}\nfunction isWritableStream(value) {\n const candidate = value;\n return candidate.write !== undefined && candidate.addListener !== undefined;\n}\nfunction createMessageConnection(input, output, logger, options) {\n if (!logger) {\n logger = api_1.NullLogger;\n }\n const reader = isReadableStream(input) ? new StreamMessageReader(input) : input;\n const writer = isWritableStream(output) ? new StreamMessageWriter(output) : output;\n if (api_1.ConnectionStrategy.is(options)) {\n options = { connectionStrategy: options };\n }\n return (0, api_1.createMessageConnection)(reader, writer, logger, options);\n}\nexports.createMessageConnection = createMessageConnection;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\n'use strict';\n\nmodule.exports = require('./lib/node/main');","(function (factory) {\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n var v = factory(require, exports);\n if (v !== undefined) module.exports = v;\n }\n else if (typeof define === \"function\" && define.amd) {\n define([\"require\", \"exports\"], factory);\n }\n})(function (require, exports) {\n /* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n 'use strict';\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.TextDocument = exports.EOL = exports.WorkspaceFolder = exports.InlineCompletionContext = exports.SelectedCompletionInfo = exports.InlineCompletionTriggerKind = exports.InlineCompletionList = exports.InlineCompletionItem = exports.StringValue = exports.InlayHint = exports.InlayHintLabelPart = exports.InlayHintKind = exports.InlineValueContext = exports.InlineValueEvaluatableExpression = exports.InlineValueVariableLookup = exports.InlineValueText = exports.SemanticTokens = exports.SemanticTokenModifiers = exports.SemanticTokenTypes = exports.SelectionRange = exports.DocumentLink = exports.FormattingOptions = exports.CodeLens = exports.CodeAction = exports.CodeActionContext = exports.CodeActionTriggerKind = exports.CodeActionKind = exports.DocumentSymbol = exports.WorkspaceSymbol = exports.SymbolInformation = exports.SymbolTag = exports.SymbolKind = exports.DocumentHighlight = exports.DocumentHighlightKind = exports.SignatureInformation = exports.ParameterInformation = exports.Hover = exports.MarkedString = exports.CompletionList = exports.CompletionItem = exports.CompletionItemLabelDetails = exports.InsertTextMode = exports.InsertReplaceEdit = exports.CompletionItemTag = exports.InsertTextFormat = exports.CompletionItemKind = exports.MarkupContent = exports.MarkupKind = exports.TextDocumentItem = exports.OptionalVersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier = exports.TextDocumentIdentifier = exports.WorkspaceChange = exports.WorkspaceEdit = exports.DeleteFile = exports.RenameFile = exports.CreateFile = exports.TextDocumentEdit = exports.AnnotatedTextEdit = exports.ChangeAnnotationIdentifier = exports.ChangeAnnotation = exports.TextEdit = exports.Command = exports.Diagnostic = exports.CodeDescription = exports.DiagnosticTag = exports.DiagnosticSeverity = exports.DiagnosticRelatedInformation = exports.FoldingRange = exports.FoldingRangeKind = exports.ColorPresentation = exports.ColorInformation = exports.Color = exports.LocationLink = exports.Location = exports.Range = exports.Position = exports.uinteger = exports.integer = exports.URI = exports.DocumentUri = void 0;\n var DocumentUri;\n (function (DocumentUri) {\n function is(value) {\n return typeof value === 'string';\n }\n DocumentUri.is = is;\n })(DocumentUri || (exports.DocumentUri = DocumentUri = {}));\n var URI;\n (function (URI) {\n function is(value) {\n return typeof value === 'string';\n }\n URI.is = is;\n })(URI || (exports.URI = URI = {}));\n var integer;\n (function (integer) {\n integer.MIN_VALUE = -2147483648;\n integer.MAX_VALUE = 2147483647;\n function is(value) {\n return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE;\n }\n integer.is = is;\n })(integer || (exports.integer = integer = {}));\n var uinteger;\n (function (uinteger) {\n uinteger.MIN_VALUE = 0;\n uinteger.MAX_VALUE = 2147483647;\n function is(value) {\n return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE;\n }\n uinteger.is = is;\n })(uinteger || (exports.uinteger = uinteger = {}));\n /**\n * The Position namespace provides helper functions to work with\n * {@link Position} literals.\n */\n var Position;\n (function (Position) {\n /**\n * Creates a new Position literal from the given line and character.\n * @param line The position's line.\n * @param character The position's character.\n */\n function create(line, character) {\n if (line === Number.MAX_VALUE) {\n line = uinteger.MAX_VALUE;\n }\n if (character === Number.MAX_VALUE) {\n character = uinteger.MAX_VALUE;\n }\n return { line: line, character: character };\n }\n Position.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Position} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);\n }\n Position.is = is;\n })(Position || (exports.Position = Position = {}));\n /**\n * The Range namespace provides helper functions to work with\n * {@link Range} literals.\n */\n var Range;\n (function (Range) {\n function create(one, two, three, four) {\n if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {\n return { start: Position.create(one, two), end: Position.create(three, four) };\n }\n else if (Position.is(one) && Position.is(two)) {\n return { start: one, end: two };\n }\n else {\n throw new Error(\"Range#create called with invalid arguments[\".concat(one, \", \").concat(two, \", \").concat(three, \", \").concat(four, \"]\"));\n }\n }\n Range.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Range} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }\n Range.is = is;\n })(Range || (exports.Range = Range = {}));\n /**\n * The Location namespace provides helper functions to work with\n * {@link Location} literals.\n */\n var Location;\n (function (Location) {\n /**\n * Creates a Location literal.\n * @param uri The location's uri.\n * @param range The location's range.\n */\n function create(uri, range) {\n return { uri: uri, range: range };\n }\n Location.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Location} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\n }\n Location.is = is;\n })(Location || (exports.Location = Location = {}));\n /**\n * The LocationLink namespace provides helper functions to work with\n * {@link LocationLink} literals.\n */\n var LocationLink;\n (function (LocationLink) {\n /**\n * Creates a LocationLink literal.\n * @param targetUri The definition's uri.\n * @param targetRange The full range of the definition.\n * @param targetSelectionRange The span of the symbol definition at the target.\n * @param originSelectionRange The span of the symbol being defined in the originating source file.\n */\n function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\n return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };\n }\n LocationLink.create = create;\n /**\n * Checks whether the given literal conforms to the {@link LocationLink} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)\n && Range.is(candidate.targetSelectionRange)\n && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\n }\n LocationLink.is = is;\n })(LocationLink || (exports.LocationLink = LocationLink = {}));\n /**\n * The Color namespace provides helper functions to work with\n * {@link Color} literals.\n */\n var Color;\n (function (Color) {\n /**\n * Creates a new Color literal.\n */\n function create(red, green, blue, alpha) {\n return {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha,\n };\n }\n Color.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Color} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1)\n && Is.numberRange(candidate.green, 0, 1)\n && Is.numberRange(candidate.blue, 0, 1)\n && Is.numberRange(candidate.alpha, 0, 1);\n }\n Color.is = is;\n })(Color || (exports.Color = Color = {}));\n /**\n * The ColorInformation namespace provides helper functions to work with\n * {@link ColorInformation} literals.\n */\n var ColorInformation;\n (function (ColorInformation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(range, color) {\n return {\n range: range,\n color: color,\n };\n }\n ColorInformation.create = create;\n /**\n * Checks whether the given literal conforms to the {@link ColorInformation} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);\n }\n ColorInformation.is = is;\n })(ColorInformation || (exports.ColorInformation = ColorInformation = {}));\n /**\n * The Color namespace provides helper functions to work with\n * {@link ColorPresentation} literals.\n */\n var ColorPresentation;\n (function (ColorPresentation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(label, textEdit, additionalTextEdits) {\n return {\n label: label,\n textEdit: textEdit,\n additionalTextEdits: additionalTextEdits,\n };\n }\n ColorPresentation.create = create;\n /**\n * Checks whether the given literal conforms to the {@link ColorInformation} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.label)\n && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))\n && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\n }\n ColorPresentation.is = is;\n })(ColorPresentation || (exports.ColorPresentation = ColorPresentation = {}));\n /**\n * A set of predefined range kinds.\n */\n var FoldingRangeKind;\n (function (FoldingRangeKind) {\n /**\n * Folding range for a comment\n */\n FoldingRangeKind.Comment = 'comment';\n /**\n * Folding range for an import or include\n */\n FoldingRangeKind.Imports = 'imports';\n /**\n * Folding range for a region (e.g. `#region`)\n */\n FoldingRangeKind.Region = 'region';\n })(FoldingRangeKind || (exports.FoldingRangeKind = FoldingRangeKind = {}));\n /**\n * The folding range namespace provides helper functions to work with\n * {@link FoldingRange} literals.\n */\n var FoldingRange;\n (function (FoldingRange) {\n /**\n * Creates a new FoldingRange literal.\n */\n function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {\n var result = {\n startLine: startLine,\n endLine: endLine\n };\n if (Is.defined(startCharacter)) {\n result.startCharacter = startCharacter;\n }\n if (Is.defined(endCharacter)) {\n result.endCharacter = endCharacter;\n }\n if (Is.defined(kind)) {\n result.kind = kind;\n }\n if (Is.defined(collapsedText)) {\n result.collapsedText = collapsedText;\n }\n return result;\n }\n FoldingRange.create = create;\n /**\n * Checks whether the given literal conforms to the {@link FoldingRange} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)\n && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))\n && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))\n && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\n }\n FoldingRange.is = is;\n })(FoldingRange || (exports.FoldingRange = FoldingRange = {}));\n /**\n * The DiagnosticRelatedInformation namespace provides helper functions to work with\n * {@link DiagnosticRelatedInformation} literals.\n */\n var DiagnosticRelatedInformation;\n (function (DiagnosticRelatedInformation) {\n /**\n * Creates a new DiagnosticRelatedInformation literal.\n */\n function create(location, message) {\n return {\n location: location,\n message: message\n };\n }\n DiagnosticRelatedInformation.create = create;\n /**\n * Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\n }\n DiagnosticRelatedInformation.is = is;\n })(DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = DiagnosticRelatedInformation = {}));\n /**\n * The diagnostic's severity.\n */\n var DiagnosticSeverity;\n (function (DiagnosticSeverity) {\n /**\n * Reports an error.\n */\n DiagnosticSeverity.Error = 1;\n /**\n * Reports a warning.\n */\n DiagnosticSeverity.Warning = 2;\n /**\n * Reports an information.\n */\n DiagnosticSeverity.Information = 3;\n /**\n * Reports a hint.\n */\n DiagnosticSeverity.Hint = 4;\n })(DiagnosticSeverity || (exports.DiagnosticSeverity = DiagnosticSeverity = {}));\n /**\n * The diagnostic tags.\n *\n * @since 3.15.0\n */\n var DiagnosticTag;\n (function (DiagnosticTag) {\n /**\n * Unused or unnecessary code.\n *\n * Clients are allowed to render diagnostics with this tag faded out instead of having\n * an error squiggle.\n */\n DiagnosticTag.Unnecessary = 1;\n /**\n * Deprecated or obsolete code.\n *\n * Clients are allowed to rendered diagnostics with this tag strike through.\n */\n DiagnosticTag.Deprecated = 2;\n })(DiagnosticTag || (exports.DiagnosticTag = DiagnosticTag = {}));\n /**\n * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.\n *\n * @since 3.16.0\n */\n var CodeDescription;\n (function (CodeDescription) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.href);\n }\n CodeDescription.is = is;\n })(CodeDescription || (exports.CodeDescription = CodeDescription = {}));\n /**\n * The Diagnostic namespace provides helper functions to work with\n * {@link Diagnostic} literals.\n */\n var Diagnostic;\n (function (Diagnostic) {\n /**\n * Creates a new Diagnostic literal.\n */\n function create(range, message, severity, code, source, relatedInformation) {\n var result = { range: range, message: message };\n if (Is.defined(severity)) {\n result.severity = severity;\n }\n if (Is.defined(code)) {\n result.code = code;\n }\n if (Is.defined(source)) {\n result.source = source;\n }\n if (Is.defined(relatedInformation)) {\n result.relatedInformation = relatedInformation;\n }\n return result;\n }\n Diagnostic.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Diagnostic} interface.\n */\n function is(value) {\n var _a;\n var candidate = value;\n return Is.defined(candidate)\n && Range.is(candidate.range)\n && Is.string(candidate.message)\n && (Is.number(candidate.severity) || Is.undefined(candidate.severity))\n && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))\n && (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))\n && (Is.string(candidate.source) || Is.undefined(candidate.source))\n && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\n }\n Diagnostic.is = is;\n })(Diagnostic || (exports.Diagnostic = Diagnostic = {}));\n /**\n * The Command namespace provides helper functions to work with\n * {@link Command} literals.\n */\n var Command;\n (function (Command) {\n /**\n * Creates a new Command literal.\n */\n function create(title, command) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var result = { title: title, command: command };\n if (Is.defined(args) && args.length > 0) {\n result.arguments = args;\n }\n return result;\n }\n Command.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Command} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\n }\n Command.is = is;\n })(Command || (exports.Command = Command = {}));\n /**\n * The TextEdit namespace provides helper function to create replace,\n * insert and delete edits more easily.\n */\n var TextEdit;\n (function (TextEdit) {\n /**\n * Creates a replace text edit.\n * @param range The range of text to be replaced.\n * @param newText The new text.\n */\n function replace(range, newText) {\n return { range: range, newText: newText };\n }\n TextEdit.replace = replace;\n /**\n * Creates an insert text edit.\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n */\n function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }\n TextEdit.insert = insert;\n /**\n * Creates a delete text edit.\n * @param range The range of text to be deleted.\n */\n function del(range) {\n return { range: range, newText: '' };\n }\n TextEdit.del = del;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate)\n && Is.string(candidate.newText)\n && Range.is(candidate.range);\n }\n TextEdit.is = is;\n })(TextEdit || (exports.TextEdit = TextEdit = {}));\n var ChangeAnnotation;\n (function (ChangeAnnotation) {\n function create(label, needsConfirmation, description) {\n var result = { label: label };\n if (needsConfirmation !== undefined) {\n result.needsConfirmation = needsConfirmation;\n }\n if (description !== undefined) {\n result.description = description;\n }\n return result;\n }\n ChangeAnnotation.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.label) &&\n (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&\n (Is.string(candidate.description) || candidate.description === undefined);\n }\n ChangeAnnotation.is = is;\n })(ChangeAnnotation || (exports.ChangeAnnotation = ChangeAnnotation = {}));\n var ChangeAnnotationIdentifier;\n (function (ChangeAnnotationIdentifier) {\n function is(value) {\n var candidate = value;\n return Is.string(candidate);\n }\n ChangeAnnotationIdentifier.is = is;\n })(ChangeAnnotationIdentifier || (exports.ChangeAnnotationIdentifier = ChangeAnnotationIdentifier = {}));\n var AnnotatedTextEdit;\n (function (AnnotatedTextEdit) {\n /**\n * Creates an annotated replace text edit.\n *\n * @param range The range of text to be replaced.\n * @param newText The new text.\n * @param annotation The annotation.\n */\n function replace(range, newText, annotation) {\n return { range: range, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.replace = replace;\n /**\n * Creates an annotated insert text edit.\n *\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n * @param annotation The annotation.\n */\n function insert(position, newText, annotation) {\n return { range: { start: position, end: position }, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.insert = insert;\n /**\n * Creates an annotated delete text edit.\n *\n * @param range The range of text to be deleted.\n * @param annotation The annotation.\n */\n function del(range, annotation) {\n return { range: range, newText: '', annotationId: annotation };\n }\n AnnotatedTextEdit.del = del;\n function is(value) {\n var candidate = value;\n return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n AnnotatedTextEdit.is = is;\n })(AnnotatedTextEdit || (exports.AnnotatedTextEdit = AnnotatedTextEdit = {}));\n /**\n * The TextDocumentEdit namespace provides helper function to create\n * an edit that manipulates a text document.\n */\n var TextDocumentEdit;\n (function (TextDocumentEdit) {\n /**\n * Creates a new `TextDocumentEdit`\n */\n function create(textDocument, edits) {\n return { textDocument: textDocument, edits: edits };\n }\n TextDocumentEdit.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate)\n && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)\n && Array.isArray(candidate.edits);\n }\n TextDocumentEdit.is = is;\n })(TextDocumentEdit || (exports.TextDocumentEdit = TextDocumentEdit = {}));\n var CreateFile;\n (function (CreateFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'create',\n uri: uri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n CreateFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n CreateFile.is = is;\n })(CreateFile || (exports.CreateFile = CreateFile = {}));\n var RenameFile;\n (function (RenameFile) {\n function create(oldUri, newUri, options, annotation) {\n var result = {\n kind: 'rename',\n oldUri: oldUri,\n newUri: newUri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n RenameFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n RenameFile.is = is;\n })(RenameFile || (exports.RenameFile = RenameFile = {}));\n var DeleteFile;\n (function (DeleteFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'delete',\n uri: uri\n };\n if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n DeleteFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n DeleteFile.is = is;\n })(DeleteFile || (exports.DeleteFile = DeleteFile = {}));\n var WorkspaceEdit;\n (function (WorkspaceEdit) {\n function is(value) {\n var candidate = value;\n return candidate &&\n (candidate.changes !== undefined || candidate.documentChanges !== undefined) &&\n (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {\n if (Is.string(change.kind)) {\n return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\n }\n else {\n return TextDocumentEdit.is(change);\n }\n }));\n }\n WorkspaceEdit.is = is;\n })(WorkspaceEdit || (exports.WorkspaceEdit = WorkspaceEdit = {}));\n var TextEditChangeImpl = /** @class */ (function () {\n function TextEditChangeImpl(edits, changeAnnotations) {\n this.edits = edits;\n this.changeAnnotations = changeAnnotations;\n }\n TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.insert(position, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.insert(position, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.insert(position, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.replace(range, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.replace(range, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.replace(range, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.delete = function (range, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.del(range);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.del(range, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.del(range, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.add = function (edit) {\n this.edits.push(edit);\n };\n TextEditChangeImpl.prototype.all = function () {\n return this.edits;\n };\n TextEditChangeImpl.prototype.clear = function () {\n this.edits.splice(0, this.edits.length);\n };\n TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {\n if (value === undefined) {\n throw new Error(\"Text edit change is not configured to manage change annotations.\");\n }\n };\n return TextEditChangeImpl;\n }());\n /**\n * A helper class\n */\n var ChangeAnnotations = /** @class */ (function () {\n function ChangeAnnotations(annotations) {\n this._annotations = annotations === undefined ? Object.create(null) : annotations;\n this._counter = 0;\n this._size = 0;\n }\n ChangeAnnotations.prototype.all = function () {\n return this._annotations;\n };\n Object.defineProperty(ChangeAnnotations.prototype, \"size\", {\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {\n var id;\n if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {\n id = idOrAnnotation;\n }\n else {\n id = this.nextId();\n annotation = idOrAnnotation;\n }\n if (this._annotations[id] !== undefined) {\n throw new Error(\"Id \".concat(id, \" is already in use.\"));\n }\n if (annotation === undefined) {\n throw new Error(\"No annotation provided for id \".concat(id));\n }\n this._annotations[id] = annotation;\n this._size++;\n return id;\n };\n ChangeAnnotations.prototype.nextId = function () {\n this._counter++;\n return this._counter.toString();\n };\n return ChangeAnnotations;\n }());\n /**\n * A workspace change helps constructing changes to a workspace.\n */\n var WorkspaceChange = /** @class */ (function () {\n function WorkspaceChange(workspaceEdit) {\n var _this = this;\n this._textEditChanges = Object.create(null);\n if (workspaceEdit !== undefined) {\n this._workspaceEdit = workspaceEdit;\n if (workspaceEdit.documentChanges) {\n this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);\n workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n workspaceEdit.documentChanges.forEach(function (change) {\n if (TextDocumentEdit.is(change)) {\n var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);\n _this._textEditChanges[change.textDocument.uri] = textEditChange;\n }\n });\n }\n else if (workspaceEdit.changes) {\n Object.keys(workspaceEdit.changes).forEach(function (key) {\n var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\n _this._textEditChanges[key] = textEditChange;\n });\n }\n }\n else {\n this._workspaceEdit = {};\n }\n }\n Object.defineProperty(WorkspaceChange.prototype, \"edit\", {\n /**\n * Returns the underlying {@link WorkspaceEdit} literal\n * use to be returned from a workspace edit operation like rename.\n */\n get: function () {\n this.initDocumentChanges();\n if (this._changeAnnotations !== undefined) {\n if (this._changeAnnotations.size === 0) {\n this._workspaceEdit.changeAnnotations = undefined;\n }\n else {\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n }\n return this._workspaceEdit;\n },\n enumerable: false,\n configurable: true\n });\n WorkspaceChange.prototype.getTextEditChange = function (key) {\n if (OptionalVersionedTextDocumentIdentifier.is(key)) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var textDocument = { uri: key.uri, version: key.version };\n var result = this._textEditChanges[textDocument.uri];\n if (!result) {\n var edits = [];\n var textDocumentEdit = {\n textDocument: textDocument,\n edits: edits\n };\n this._workspaceEdit.documentChanges.push(textDocumentEdit);\n result = new TextEditChangeImpl(edits, this._changeAnnotations);\n this._textEditChanges[textDocument.uri] = result;\n }\n return result;\n }\n else {\n this.initChanges();\n if (this._workspaceEdit.changes === undefined) {\n throw new Error('Workspace edit is not configured for normal text edit changes.');\n }\n var result = this._textEditChanges[key];\n if (!result) {\n var edits = [];\n this._workspaceEdit.changes[key] = edits;\n result = new TextEditChangeImpl(edits);\n this._textEditChanges[key] = result;\n }\n return result;\n }\n };\n WorkspaceChange.prototype.initDocumentChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._changeAnnotations = new ChangeAnnotations();\n this._workspaceEdit.documentChanges = [];\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n };\n WorkspaceChange.prototype.initChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._workspaceEdit.changes = Object.create(null);\n }\n };\n WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = CreateFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = CreateFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = RenameFile.create(oldUri, newUri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = RenameFile.create(oldUri, newUri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = DeleteFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = DeleteFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n return WorkspaceChange;\n }());\n exports.WorkspaceChange = WorkspaceChange;\n /**\n * The TextDocumentIdentifier namespace provides helper functions to work with\n * {@link TextDocumentIdentifier} literals.\n */\n var TextDocumentIdentifier;\n (function (TextDocumentIdentifier) {\n /**\n * Creates a new TextDocumentIdentifier literal.\n * @param uri The document's uri.\n */\n function create(uri) {\n return { uri: uri };\n }\n TextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri);\n }\n TextDocumentIdentifier.is = is;\n })(TextDocumentIdentifier || (exports.TextDocumentIdentifier = TextDocumentIdentifier = {}));\n /**\n * The VersionedTextDocumentIdentifier namespace provides helper functions to work with\n * {@link VersionedTextDocumentIdentifier} literals.\n */\n var VersionedTextDocumentIdentifier;\n (function (VersionedTextDocumentIdentifier) {\n /**\n * Creates a new VersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param version The document's version.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n VersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);\n }\n VersionedTextDocumentIdentifier.is = is;\n })(VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = VersionedTextDocumentIdentifier = {}));\n /**\n * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with\n * {@link OptionalVersionedTextDocumentIdentifier} literals.\n */\n var OptionalVersionedTextDocumentIdentifier;\n (function (OptionalVersionedTextDocumentIdentifier) {\n /**\n * Creates a new OptionalVersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param version The document's version.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n OptionalVersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));\n }\n OptionalVersionedTextDocumentIdentifier.is = is;\n })(OptionalVersionedTextDocumentIdentifier || (exports.OptionalVersionedTextDocumentIdentifier = OptionalVersionedTextDocumentIdentifier = {}));\n /**\n * The TextDocumentItem namespace provides helper functions to work with\n * {@link TextDocumentItem} literals.\n */\n var TextDocumentItem;\n (function (TextDocumentItem) {\n /**\n * Creates a new TextDocumentItem literal.\n * @param uri The document's uri.\n * @param languageId The document's language identifier.\n * @param version The document's version number.\n * @param text The document's text.\n */\n function create(uri, languageId, version, text) {\n return { uri: uri, languageId: languageId, version: version, text: text };\n }\n TextDocumentItem.create = create;\n /**\n * Checks whether the given literal conforms to the {@link TextDocumentItem} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);\n }\n TextDocumentItem.is = is;\n })(TextDocumentItem || (exports.TextDocumentItem = TextDocumentItem = {}));\n /**\n * Describes the content type that a client supports in various\n * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.\n *\n * Please note that `MarkupKinds` must not start with a `$`. This kinds\n * are reserved for internal usage.\n */\n var MarkupKind;\n (function (MarkupKind) {\n /**\n * Plain text is supported as a content format\n */\n MarkupKind.PlainText = 'plaintext';\n /**\n * Markdown is supported as a content format\n */\n MarkupKind.Markdown = 'markdown';\n /**\n * Checks whether the given value is a value of the {@link MarkupKind} type.\n */\n function is(value) {\n var candidate = value;\n return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;\n }\n MarkupKind.is = is;\n })(MarkupKind || (exports.MarkupKind = MarkupKind = {}));\n var MarkupContent;\n (function (MarkupContent) {\n /**\n * Checks whether the given value conforms to the {@link MarkupContent} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }\n MarkupContent.is = is;\n })(MarkupContent || (exports.MarkupContent = MarkupContent = {}));\n /**\n * The kind of a completion entry.\n */\n var CompletionItemKind;\n (function (CompletionItemKind) {\n CompletionItemKind.Text = 1;\n CompletionItemKind.Method = 2;\n CompletionItemKind.Function = 3;\n CompletionItemKind.Constructor = 4;\n CompletionItemKind.Field = 5;\n CompletionItemKind.Variable = 6;\n CompletionItemKind.Class = 7;\n CompletionItemKind.Interface = 8;\n CompletionItemKind.Module = 9;\n CompletionItemKind.Property = 10;\n CompletionItemKind.Unit = 11;\n CompletionItemKind.Value = 12;\n CompletionItemKind.Enum = 13;\n CompletionItemKind.Keyword = 14;\n CompletionItemKind.Snippet = 15;\n CompletionItemKind.Color = 16;\n CompletionItemKind.File = 17;\n CompletionItemKind.Reference = 18;\n CompletionItemKind.Folder = 19;\n CompletionItemKind.EnumMember = 20;\n CompletionItemKind.Constant = 21;\n CompletionItemKind.Struct = 22;\n CompletionItemKind.Event = 23;\n CompletionItemKind.Operator = 24;\n CompletionItemKind.TypeParameter = 25;\n })(CompletionItemKind || (exports.CompletionItemKind = CompletionItemKind = {}));\n /**\n * Defines whether the insert text in a completion item should be interpreted as\n * plain text or a snippet.\n */\n var InsertTextFormat;\n (function (InsertTextFormat) {\n /**\n * The primary text to be inserted is treated as a plain string.\n */\n InsertTextFormat.PlainText = 1;\n /**\n * The primary text to be inserted is treated as a snippet.\n *\n * A snippet can define tab stops and placeholders with `$1`, `$2`\n * and `${3:foo}`. `$0` defines the final tab stop, it defaults to\n * the end of the snippet. Placeholders with equal identifiers are linked,\n * that is typing in one will update others too.\n *\n * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax\n */\n InsertTextFormat.Snippet = 2;\n })(InsertTextFormat || (exports.InsertTextFormat = InsertTextFormat = {}));\n /**\n * Completion item tags are extra annotations that tweak the rendering of a completion\n * item.\n *\n * @since 3.15.0\n */\n var CompletionItemTag;\n (function (CompletionItemTag) {\n /**\n * Render a completion as obsolete, usually using a strike-out.\n */\n CompletionItemTag.Deprecated = 1;\n })(CompletionItemTag || (exports.CompletionItemTag = CompletionItemTag = {}));\n /**\n * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.\n *\n * @since 3.16.0\n */\n var InsertReplaceEdit;\n (function (InsertReplaceEdit) {\n /**\n * Creates a new insert / replace edit\n */\n function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }\n InsertReplaceEdit.create = create;\n /**\n * Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface.\n */\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);\n }\n InsertReplaceEdit.is = is;\n })(InsertReplaceEdit || (exports.InsertReplaceEdit = InsertReplaceEdit = {}));\n /**\n * How whitespace and indentation is handled during completion\n * item insertion.\n *\n * @since 3.16.0\n */\n var InsertTextMode;\n (function (InsertTextMode) {\n /**\n * The insertion or replace strings is taken as it is. If the\n * value is multi line the lines below the cursor will be\n * inserted using the indentation defined in the string value.\n * The client will not apply any kind of adjustments to the\n * string.\n */\n InsertTextMode.asIs = 1;\n /**\n * The editor adjusts leading whitespace of new lines so that\n * they match the indentation up to the cursor of the line for\n * which the item is accepted.\n *\n * Consider a line like this: <2tabs><3tabs>foo. Accepting a\n * multi line completion item is indented using 2 tabs and all\n * following lines inserted will be indented using 2 tabs as well.\n */\n InsertTextMode.adjustIndentation = 2;\n })(InsertTextMode || (exports.InsertTextMode = InsertTextMode = {}));\n var CompletionItemLabelDetails;\n (function (CompletionItemLabelDetails) {\n function is(value) {\n var candidate = value;\n return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) &&\n (Is.string(candidate.description) || candidate.description === undefined);\n }\n CompletionItemLabelDetails.is = is;\n })(CompletionItemLabelDetails || (exports.CompletionItemLabelDetails = CompletionItemLabelDetails = {}));\n /**\n * The CompletionItem namespace provides functions to deal with\n * completion items.\n */\n var CompletionItem;\n (function (CompletionItem) {\n /**\n * Create a completion item and seed it with a label.\n * @param label The completion item's label\n */\n function create(label) {\n return { label: label };\n }\n CompletionItem.create = create;\n })(CompletionItem || (exports.CompletionItem = CompletionItem = {}));\n /**\n * The CompletionList namespace provides functions to deal with\n * completion lists.\n */\n var CompletionList;\n (function (CompletionList) {\n /**\n * Creates a new completion list.\n *\n * @param items The completion items.\n * @param isIncomplete The list is not complete.\n */\n function create(items, isIncomplete) {\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\n }\n CompletionList.create = create;\n })(CompletionList || (exports.CompletionList = CompletionList = {}));\n var MarkedString;\n (function (MarkedString) {\n /**\n * Creates a marked string from plain text.\n *\n * @param plainText The plain text.\n */\n function fromPlainText(plainText) {\n return plainText.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n }\n MarkedString.fromPlainText = fromPlainText;\n /**\n * Checks whether the given value conforms to the {@link MarkedString} type.\n */\n function is(value) {\n var candidate = value;\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\n }\n MarkedString.is = is;\n })(MarkedString || (exports.MarkedString = MarkedString = {}));\n var Hover;\n (function (Hover) {\n /**\n * Checks whether the given value conforms to the {@link Hover} interface.\n */\n function is(value) {\n var candidate = value;\n return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||\n MarkedString.is(candidate.contents) ||\n Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));\n }\n Hover.is = is;\n })(Hover || (exports.Hover = Hover = {}));\n /**\n * The ParameterInformation namespace provides helper functions to work with\n * {@link ParameterInformation} literals.\n */\n var ParameterInformation;\n (function (ParameterInformation) {\n /**\n * Creates a new parameter information literal.\n *\n * @param label A label string.\n * @param documentation A doc string.\n */\n function create(label, documentation) {\n return documentation ? { label: label, documentation: documentation } : { label: label };\n }\n ParameterInformation.create = create;\n })(ParameterInformation || (exports.ParameterInformation = ParameterInformation = {}));\n /**\n * The SignatureInformation namespace provides helper functions to work with\n * {@link SignatureInformation} literals.\n */\n var SignatureInformation;\n (function (SignatureInformation) {\n function create(label, documentation) {\n var parameters = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n parameters[_i - 2] = arguments[_i];\n }\n var result = { label: label };\n if (Is.defined(documentation)) {\n result.documentation = documentation;\n }\n if (Is.defined(parameters)) {\n result.parameters = parameters;\n }\n else {\n result.parameters = [];\n }\n return result;\n }\n SignatureInformation.create = create;\n })(SignatureInformation || (exports.SignatureInformation = SignatureInformation = {}));\n /**\n * A document highlight kind.\n */\n var DocumentHighlightKind;\n (function (DocumentHighlightKind) {\n /**\n * A textual occurrence.\n */\n DocumentHighlightKind.Text = 1;\n /**\n * Read-access of a symbol, like reading a variable.\n */\n DocumentHighlightKind.Read = 2;\n /**\n * Write-access of a symbol, like writing to a variable.\n */\n DocumentHighlightKind.Write = 3;\n })(DocumentHighlightKind || (exports.DocumentHighlightKind = DocumentHighlightKind = {}));\n /**\n * DocumentHighlight namespace to provide helper functions to work with\n * {@link DocumentHighlight} literals.\n */\n var DocumentHighlight;\n (function (DocumentHighlight) {\n /**\n * Create a DocumentHighlight object.\n * @param range The range the highlight applies to.\n * @param kind The highlight kind\n */\n function create(range, kind) {\n var result = { range: range };\n if (Is.number(kind)) {\n result.kind = kind;\n }\n return result;\n }\n DocumentHighlight.create = create;\n })(DocumentHighlight || (exports.DocumentHighlight = DocumentHighlight = {}));\n /**\n * A symbol kind.\n */\n var SymbolKind;\n (function (SymbolKind) {\n SymbolKind.File = 1;\n SymbolKind.Module = 2;\n SymbolKind.Namespace = 3;\n SymbolKind.Package = 4;\n SymbolKind.Class = 5;\n SymbolKind.Method = 6;\n SymbolKind.Property = 7;\n SymbolKind.Field = 8;\n SymbolKind.Constructor = 9;\n SymbolKind.Enum = 10;\n SymbolKind.Interface = 11;\n SymbolKind.Function = 12;\n SymbolKind.Variable = 13;\n SymbolKind.Constant = 14;\n SymbolKind.String = 15;\n SymbolKind.Number = 16;\n SymbolKind.Boolean = 17;\n SymbolKind.Array = 18;\n SymbolKind.Object = 19;\n SymbolKind.Key = 20;\n SymbolKind.Null = 21;\n SymbolKind.EnumMember = 22;\n SymbolKind.Struct = 23;\n SymbolKind.Event = 24;\n SymbolKind.Operator = 25;\n SymbolKind.TypeParameter = 26;\n })(SymbolKind || (exports.SymbolKind = SymbolKind = {}));\n /**\n * Symbol tags are extra annotations that tweak the rendering of a symbol.\n *\n * @since 3.16\n */\n var SymbolTag;\n (function (SymbolTag) {\n /**\n * Render a symbol as obsolete, usually using a strike-out.\n */\n SymbolTag.Deprecated = 1;\n })(SymbolTag || (exports.SymbolTag = SymbolTag = {}));\n var SymbolInformation;\n (function (SymbolInformation) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the location of the symbol.\n * @param uri The resource of the location of symbol.\n * @param containerName The name of the symbol containing the symbol.\n */\n function create(name, kind, range, uri, containerName) {\n var result = {\n name: name,\n kind: kind,\n location: { uri: uri, range: range }\n };\n if (containerName) {\n result.containerName = containerName;\n }\n return result;\n }\n SymbolInformation.create = create;\n })(SymbolInformation || (exports.SymbolInformation = SymbolInformation = {}));\n var WorkspaceSymbol;\n (function (WorkspaceSymbol) {\n /**\n * Create a new workspace symbol.\n *\n * @param name The name of the symbol.\n * @param kind The kind of the symbol.\n * @param uri The resource of the location of the symbol.\n * @param range An options range of the location.\n * @returns A WorkspaceSymbol.\n */\n function create(name, kind, uri, range) {\n return range !== undefined\n ? { name: name, kind: kind, location: { uri: uri, range: range } }\n : { name: name, kind: kind, location: { uri: uri } };\n }\n WorkspaceSymbol.create = create;\n })(WorkspaceSymbol || (exports.WorkspaceSymbol = WorkspaceSymbol = {}));\n var DocumentSymbol;\n (function (DocumentSymbol) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param detail The detail of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the symbol.\n * @param selectionRange The selectionRange of the symbol.\n * @param children Children of the symbol.\n */\n function create(name, detail, kind, range, selectionRange, children) {\n var result = {\n name: name,\n detail: detail,\n kind: kind,\n range: range,\n selectionRange: selectionRange\n };\n if (children !== undefined) {\n result.children = children;\n }\n return result;\n }\n DocumentSymbol.create = create;\n /**\n * Checks whether the given literal conforms to the {@link DocumentSymbol} interface.\n */\n function is(value) {\n var candidate = value;\n return candidate &&\n Is.string(candidate.name) && Is.number(candidate.kind) &&\n Range.is(candidate.range) && Range.is(candidate.selectionRange) &&\n (candidate.detail === undefined || Is.string(candidate.detail)) &&\n (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&\n (candidate.children === undefined || Array.isArray(candidate.children)) &&\n (candidate.tags === undefined || Array.isArray(candidate.tags));\n }\n DocumentSymbol.is = is;\n })(DocumentSymbol || (exports.DocumentSymbol = DocumentSymbol = {}));\n /**\n * A set of predefined code action kinds\n */\n var CodeActionKind;\n (function (CodeActionKind) {\n /**\n * Empty kind.\n */\n CodeActionKind.Empty = '';\n /**\n * Base kind for quickfix actions: 'quickfix'\n */\n CodeActionKind.QuickFix = 'quickfix';\n /**\n * Base kind for refactoring actions: 'refactor'\n */\n CodeActionKind.Refactor = 'refactor';\n /**\n * Base kind for refactoring extraction actions: 'refactor.extract'\n *\n * Example extract actions:\n *\n * - Extract method\n * - Extract function\n * - Extract variable\n * - Extract interface from class\n * - ...\n */\n CodeActionKind.RefactorExtract = 'refactor.extract';\n /**\n * Base kind for refactoring inline actions: 'refactor.inline'\n *\n * Example inline actions:\n *\n * - Inline function\n * - Inline variable\n * - Inline constant\n * - ...\n */\n CodeActionKind.RefactorInline = 'refactor.inline';\n /**\n * Base kind for refactoring rewrite actions: 'refactor.rewrite'\n *\n * Example rewrite actions:\n *\n * - Convert JavaScript function to class\n * - Add or remove parameter\n * - Encapsulate field\n * - Make method static\n * - Move method to base class\n * - ...\n */\n CodeActionKind.RefactorRewrite = 'refactor.rewrite';\n /**\n * Base kind for source actions: `source`\n *\n * Source code actions apply to the entire file.\n */\n CodeActionKind.Source = 'source';\n /**\n * Base kind for an organize imports source action: `source.organizeImports`\n */\n CodeActionKind.SourceOrganizeImports = 'source.organizeImports';\n /**\n * Base kind for auto-fix source actions: `source.fixAll`.\n *\n * Fix all actions automatically fix errors that have a clear fix that do not require user input.\n * They should not suppress errors or perform unsafe fixes such as generating new types or classes.\n *\n * @since 3.15.0\n */\n CodeActionKind.SourceFixAll = 'source.fixAll';\n })(CodeActionKind || (exports.CodeActionKind = CodeActionKind = {}));\n /**\n * The reason why code actions were requested.\n *\n * @since 3.17.0\n */\n var CodeActionTriggerKind;\n (function (CodeActionTriggerKind) {\n /**\n * Code actions were explicitly requested by the user or by an extension.\n */\n CodeActionTriggerKind.Invoked = 1;\n /**\n * Code actions were requested automatically.\n *\n * This typically happens when current selection in a file changes, but can\n * also be triggered when file content changes.\n */\n CodeActionTriggerKind.Automatic = 2;\n })(CodeActionTriggerKind || (exports.CodeActionTriggerKind = CodeActionTriggerKind = {}));\n /**\n * The CodeActionContext namespace provides helper functions to work with\n * {@link CodeActionContext} literals.\n */\n var CodeActionContext;\n (function (CodeActionContext) {\n /**\n * Creates a new CodeActionContext literal.\n */\n function create(diagnostics, only, triggerKind) {\n var result = { diagnostics: diagnostics };\n if (only !== undefined && only !== null) {\n result.only = only;\n }\n if (triggerKind !== undefined && triggerKind !== null) {\n result.triggerKind = triggerKind;\n }\n return result;\n }\n CodeActionContext.create = create;\n /**\n * Checks whether the given literal conforms to the {@link CodeActionContext} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is)\n && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string))\n && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);\n }\n CodeActionContext.is = is;\n })(CodeActionContext || (exports.CodeActionContext = CodeActionContext = {}));\n var CodeAction;\n (function (CodeAction) {\n function create(title, kindOrCommandOrEdit, kind) {\n var result = { title: title };\n var checkKind = true;\n if (typeof kindOrCommandOrEdit === 'string') {\n checkKind = false;\n result.kind = kindOrCommandOrEdit;\n }\n else if (Command.is(kindOrCommandOrEdit)) {\n result.command = kindOrCommandOrEdit;\n }\n else {\n result.edit = kindOrCommandOrEdit;\n }\n if (checkKind && kind !== undefined) {\n result.kind = kind;\n }\n return result;\n }\n CodeAction.create = create;\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.title) &&\n (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&\n (candidate.kind === undefined || Is.string(candidate.kind)) &&\n (candidate.edit !== undefined || candidate.command !== undefined) &&\n (candidate.command === undefined || Command.is(candidate.command)) &&\n (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&\n (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));\n }\n CodeAction.is = is;\n })(CodeAction || (exports.CodeAction = CodeAction = {}));\n /**\n * The CodeLens namespace provides helper functions to work with\n * {@link CodeLens} literals.\n */\n var CodeLens;\n (function (CodeLens) {\n /**\n * Creates a new CodeLens literal.\n */\n function create(range, data) {\n var result = { range: range };\n if (Is.defined(data)) {\n result.data = data;\n }\n return result;\n }\n CodeLens.create = create;\n /**\n * Checks whether the given literal conforms to the {@link CodeLens} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\n }\n CodeLens.is = is;\n })(CodeLens || (exports.CodeLens = CodeLens = {}));\n /**\n * The FormattingOptions namespace provides helper functions to work with\n * {@link FormattingOptions} literals.\n */\n var FormattingOptions;\n (function (FormattingOptions) {\n /**\n * Creates a new FormattingOptions literal.\n */\n function create(tabSize, insertSpaces) {\n return { tabSize: tabSize, insertSpaces: insertSpaces };\n }\n FormattingOptions.create = create;\n /**\n * Checks whether the given literal conforms to the {@link FormattingOptions} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\n }\n FormattingOptions.is = is;\n })(FormattingOptions || (exports.FormattingOptions = FormattingOptions = {}));\n /**\n * The DocumentLink namespace provides helper functions to work with\n * {@link DocumentLink} literals.\n */\n var DocumentLink;\n (function (DocumentLink) {\n /**\n * Creates a new DocumentLink literal.\n */\n function create(range, target, data) {\n return { range: range, target: target, data: data };\n }\n DocumentLink.create = create;\n /**\n * Checks whether the given literal conforms to the {@link DocumentLink} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\n }\n DocumentLink.is = is;\n })(DocumentLink || (exports.DocumentLink = DocumentLink = {}));\n /**\n * The SelectionRange namespace provides helper function to work with\n * SelectionRange literals.\n */\n var SelectionRange;\n (function (SelectionRange) {\n /**\n * Creates a new SelectionRange\n * @param range the range.\n * @param parent an optional parent.\n */\n function create(range, parent) {\n return { range: range, parent: parent };\n }\n SelectionRange.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));\n }\n SelectionRange.is = is;\n })(SelectionRange || (exports.SelectionRange = SelectionRange = {}));\n /**\n * A set of predefined token types. This set is not fixed\n * an clients can specify additional token types via the\n * corresponding client capabilities.\n *\n * @since 3.16.0\n */\n var SemanticTokenTypes;\n (function (SemanticTokenTypes) {\n SemanticTokenTypes[\"namespace\"] = \"namespace\";\n /**\n * Represents a generic type. Acts as a fallback for types which can't be mapped to\n * a specific type like class or enum.\n */\n SemanticTokenTypes[\"type\"] = \"type\";\n SemanticTokenTypes[\"class\"] = \"class\";\n SemanticTokenTypes[\"enum\"] = \"enum\";\n SemanticTokenTypes[\"interface\"] = \"interface\";\n SemanticTokenTypes[\"struct\"] = \"struct\";\n SemanticTokenTypes[\"typeParameter\"] = \"typeParameter\";\n SemanticTokenTypes[\"parameter\"] = \"parameter\";\n SemanticTokenTypes[\"variable\"] = \"variable\";\n SemanticTokenTypes[\"property\"] = \"property\";\n SemanticTokenTypes[\"enumMember\"] = \"enumMember\";\n SemanticTokenTypes[\"event\"] = \"event\";\n SemanticTokenTypes[\"function\"] = \"function\";\n SemanticTokenTypes[\"method\"] = \"method\";\n SemanticTokenTypes[\"macro\"] = \"macro\";\n SemanticTokenTypes[\"keyword\"] = \"keyword\";\n SemanticTokenTypes[\"modifier\"] = \"modifier\";\n SemanticTokenTypes[\"comment\"] = \"comment\";\n SemanticTokenTypes[\"string\"] = \"string\";\n SemanticTokenTypes[\"number\"] = \"number\";\n SemanticTokenTypes[\"regexp\"] = \"regexp\";\n SemanticTokenTypes[\"operator\"] = \"operator\";\n /**\n * @since 3.17.0\n */\n SemanticTokenTypes[\"decorator\"] = \"decorator\";\n })(SemanticTokenTypes || (exports.SemanticTokenTypes = SemanticTokenTypes = {}));\n /**\n * A set of predefined token modifiers. This set is not fixed\n * an clients can specify additional token types via the\n * corresponding client capabilities.\n *\n * @since 3.16.0\n */\n var SemanticTokenModifiers;\n (function (SemanticTokenModifiers) {\n SemanticTokenModifiers[\"declaration\"] = \"declaration\";\n SemanticTokenModifiers[\"definition\"] = \"definition\";\n SemanticTokenModifiers[\"readonly\"] = \"readonly\";\n SemanticTokenModifiers[\"static\"] = \"static\";\n SemanticTokenModifiers[\"deprecated\"] = \"deprecated\";\n SemanticTokenModifiers[\"abstract\"] = \"abstract\";\n SemanticTokenModifiers[\"async\"] = \"async\";\n SemanticTokenModifiers[\"modification\"] = \"modification\";\n SemanticTokenModifiers[\"documentation\"] = \"documentation\";\n SemanticTokenModifiers[\"defaultLibrary\"] = \"defaultLibrary\";\n })(SemanticTokenModifiers || (exports.SemanticTokenModifiers = SemanticTokenModifiers = {}));\n /**\n * @since 3.16.0\n */\n var SemanticTokens;\n (function (SemanticTokens) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&\n Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');\n }\n SemanticTokens.is = is;\n })(SemanticTokens || (exports.SemanticTokens = SemanticTokens = {}));\n /**\n * The InlineValueText namespace provides functions to deal with InlineValueTexts.\n *\n * @since 3.17.0\n */\n var InlineValueText;\n (function (InlineValueText) {\n /**\n * Creates a new InlineValueText literal.\n */\n function create(range, text) {\n return { range: range, text: text };\n }\n InlineValueText.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);\n }\n InlineValueText.is = is;\n })(InlineValueText || (exports.InlineValueText = InlineValueText = {}));\n /**\n * The InlineValueVariableLookup namespace provides functions to deal with InlineValueVariableLookups.\n *\n * @since 3.17.0\n */\n var InlineValueVariableLookup;\n (function (InlineValueVariableLookup) {\n /**\n * Creates a new InlineValueText literal.\n */\n function create(range, variableName, caseSensitiveLookup) {\n return { range: range, variableName: variableName, caseSensitiveLookup: caseSensitiveLookup };\n }\n InlineValueVariableLookup.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup)\n && (Is.string(candidate.variableName) || candidate.variableName === undefined);\n }\n InlineValueVariableLookup.is = is;\n })(InlineValueVariableLookup || (exports.InlineValueVariableLookup = InlineValueVariableLookup = {}));\n /**\n * The InlineValueEvaluatableExpression namespace provides functions to deal with InlineValueEvaluatableExpression.\n *\n * @since 3.17.0\n */\n var InlineValueEvaluatableExpression;\n (function (InlineValueEvaluatableExpression) {\n /**\n * Creates a new InlineValueEvaluatableExpression literal.\n */\n function create(range, expression) {\n return { range: range, expression: expression };\n }\n InlineValueEvaluatableExpression.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range)\n && (Is.string(candidate.expression) || candidate.expression === undefined);\n }\n InlineValueEvaluatableExpression.is = is;\n })(InlineValueEvaluatableExpression || (exports.InlineValueEvaluatableExpression = InlineValueEvaluatableExpression = {}));\n /**\n * The InlineValueContext namespace provides helper functions to work with\n * {@link InlineValueContext} literals.\n *\n * @since 3.17.0\n */\n var InlineValueContext;\n (function (InlineValueContext) {\n /**\n * Creates a new InlineValueContext literal.\n */\n function create(frameId, stoppedLocation) {\n return { frameId: frameId, stoppedLocation: stoppedLocation };\n }\n InlineValueContext.create = create;\n /**\n * Checks whether the given literal conforms to the {@link InlineValueContext} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(value.stoppedLocation);\n }\n InlineValueContext.is = is;\n })(InlineValueContext || (exports.InlineValueContext = InlineValueContext = {}));\n /**\n * Inlay hint kinds.\n *\n * @since 3.17.0\n */\n var InlayHintKind;\n (function (InlayHintKind) {\n /**\n * An inlay hint that for a type annotation.\n */\n InlayHintKind.Type = 1;\n /**\n * An inlay hint that is for a parameter.\n */\n InlayHintKind.Parameter = 2;\n function is(value) {\n return value === 1 || value === 2;\n }\n InlayHintKind.is = is;\n })(InlayHintKind || (exports.InlayHintKind = InlayHintKind = {}));\n var InlayHintLabelPart;\n (function (InlayHintLabelPart) {\n function create(value) {\n return { value: value };\n }\n InlayHintLabelPart.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate)\n && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))\n && (candidate.location === undefined || Location.is(candidate.location))\n && (candidate.command === undefined || Command.is(candidate.command));\n }\n InlayHintLabelPart.is = is;\n })(InlayHintLabelPart || (exports.InlayHintLabelPart = InlayHintLabelPart = {}));\n var InlayHint;\n (function (InlayHint) {\n function create(position, label, kind) {\n var result = { position: position, label: label };\n if (kind !== undefined) {\n result.kind = kind;\n }\n return result;\n }\n InlayHint.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.position)\n && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is))\n && (candidate.kind === undefined || InlayHintKind.is(candidate.kind))\n && (candidate.textEdits === undefined) || Is.typedArray(candidate.textEdits, TextEdit.is)\n && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))\n && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft))\n && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight));\n }\n InlayHint.is = is;\n })(InlayHint || (exports.InlayHint = InlayHint = {}));\n var StringValue;\n (function (StringValue) {\n function createSnippet(value) {\n return { kind: 'snippet', value: value };\n }\n StringValue.createSnippet = createSnippet;\n })(StringValue || (exports.StringValue = StringValue = {}));\n var InlineCompletionItem;\n (function (InlineCompletionItem) {\n function create(insertText, filterText, range, command) {\n return { insertText: insertText, filterText: filterText, range: range, command: command };\n }\n InlineCompletionItem.create = create;\n })(InlineCompletionItem || (exports.InlineCompletionItem = InlineCompletionItem = {}));\n var InlineCompletionList;\n (function (InlineCompletionList) {\n function create(items) {\n return { items: items };\n }\n InlineCompletionList.create = create;\n })(InlineCompletionList || (exports.InlineCompletionList = InlineCompletionList = {}));\n /**\n * Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.\n *\n * @since 3.18.0\n * @proposed\n */\n var InlineCompletionTriggerKind;\n (function (InlineCompletionTriggerKind) {\n /**\n * Completion was triggered explicitly by a user gesture.\n */\n InlineCompletionTriggerKind.Invoked = 0;\n /**\n * Completion was triggered automatically while editing.\n */\n InlineCompletionTriggerKind.Automatic = 1;\n })(InlineCompletionTriggerKind || (exports.InlineCompletionTriggerKind = InlineCompletionTriggerKind = {}));\n var SelectedCompletionInfo;\n (function (SelectedCompletionInfo) {\n function create(range, text) {\n return { range: range, text: text };\n }\n SelectedCompletionInfo.create = create;\n })(SelectedCompletionInfo || (exports.SelectedCompletionInfo = SelectedCompletionInfo = {}));\n var InlineCompletionContext;\n (function (InlineCompletionContext) {\n function create(triggerKind, selectedCompletionInfo) {\n return { triggerKind: triggerKind, selectedCompletionInfo: selectedCompletionInfo };\n }\n InlineCompletionContext.create = create;\n })(InlineCompletionContext || (exports.InlineCompletionContext = InlineCompletionContext = {}));\n var WorkspaceFolder;\n (function (WorkspaceFolder) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);\n }\n WorkspaceFolder.is = is;\n })(WorkspaceFolder || (exports.WorkspaceFolder = WorkspaceFolder = {}));\n exports.EOL = ['\\n', '\\r\\n', '\\r'];\n /**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\n var TextDocument;\n (function (TextDocument) {\n /**\n * Creates a new ITextDocument literal from the given uri and content.\n * @param uri The document's uri.\n * @param languageId The document's language Id.\n * @param version The document's version.\n * @param content The document's content.\n */\n function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }\n TextDocument.create = create;\n /**\n * Checks whether the given literal conforms to the {@link ITextDocument} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }\n TextDocument.is = is;\n function applyEdits(document, edits) {\n var text = document.getText();\n var sortedEdits = mergeSort(edits, function (a, b) {\n var diff = a.range.start.line - b.range.start.line;\n if (diff === 0) {\n return a.range.start.character - b.range.start.character;\n }\n return diff;\n });\n var lastModifiedOffset = text.length;\n for (var i = sortedEdits.length - 1; i >= 0; i--) {\n var e = sortedEdits[i];\n var startOffset = document.offsetAt(e.range.start);\n var endOffset = document.offsetAt(e.range.end);\n if (endOffset <= lastModifiedOffset) {\n text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\n }\n else {\n throw new Error('Overlapping edit');\n }\n lastModifiedOffset = startOffset;\n }\n return text;\n }\n TextDocument.applyEdits = applyEdits;\n function mergeSort(data, compare) {\n if (data.length <= 1) {\n // sorted\n return data;\n }\n var p = (data.length / 2) | 0;\n var left = data.slice(0, p);\n var right = data.slice(p);\n mergeSort(left, compare);\n mergeSort(right, compare);\n var leftIdx = 0;\n var rightIdx = 0;\n var i = 0;\n while (leftIdx < left.length && rightIdx < right.length) {\n var ret = compare(left[leftIdx], right[rightIdx]);\n if (ret <= 0) {\n // smaller_equal -> take left to preserve order\n data[i++] = left[leftIdx++];\n }\n else {\n // greater -> take right\n data[i++] = right[rightIdx++];\n }\n }\n while (leftIdx < left.length) {\n data[i++] = left[leftIdx++];\n }\n while (rightIdx < right.length) {\n data[i++] = right[rightIdx++];\n }\n return data;\n }\n })(TextDocument || (exports.TextDocument = TextDocument = {}));\n /**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\n var FullTextDocument = /** @class */ (function () {\n function FullTextDocument(uri, languageId, version, content) {\n this._uri = uri;\n this._languageId = languageId;\n this._version = version;\n this._content = content;\n this._lineOffsets = undefined;\n }\n Object.defineProperty(FullTextDocument.prototype, \"uri\", {\n get: function () {\n return this._uri;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"languageId\", {\n get: function () {\n return this._languageId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"version\", {\n get: function () {\n return this._version;\n },\n enumerable: false,\n configurable: true\n });\n FullTextDocument.prototype.getText = function (range) {\n if (range) {\n var start = this.offsetAt(range.start);\n var end = this.offsetAt(range.end);\n return this._content.substring(start, end);\n }\n return this._content;\n };\n FullTextDocument.prototype.update = function (event, version) {\n this._content = event.text;\n this._version = version;\n this._lineOffsets = undefined;\n };\n FullTextDocument.prototype.getLineOffsets = function () {\n if (this._lineOffsets === undefined) {\n var lineOffsets = [];\n var text = this._content;\n var isLineStart = true;\n for (var i = 0; i < text.length; i++) {\n if (isLineStart) {\n lineOffsets.push(i);\n isLineStart = false;\n }\n var ch = text.charAt(i);\n isLineStart = (ch === '\\r' || ch === '\\n');\n if (ch === '\\r' && i + 1 < text.length && text.charAt(i + 1) === '\\n') {\n i++;\n }\n }\n if (isLineStart && text.length > 0) {\n lineOffsets.push(text.length);\n }\n this._lineOffsets = lineOffsets;\n }\n return this._lineOffsets;\n };\n FullTextDocument.prototype.positionAt = function (offset) {\n offset = Math.max(Math.min(offset, this._content.length), 0);\n var lineOffsets = this.getLineOffsets();\n var low = 0, high = lineOffsets.length;\n if (high === 0) {\n return Position.create(0, offset);\n }\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (lineOffsets[mid] > offset) {\n high = mid;\n }\n else {\n low = mid + 1;\n }\n }\n // low is the least x for which the line offset is larger than the current offset\n // or array.length if no line offset is larger than the current offset\n var line = low - 1;\n return Position.create(line, offset - lineOffsets[line]);\n };\n FullTextDocument.prototype.offsetAt = function (position) {\n var lineOffsets = this.getLineOffsets();\n if (position.line >= lineOffsets.length) {\n return this._content.length;\n }\n else if (position.line < 0) {\n return 0;\n }\n var lineOffset = lineOffsets[position.line];\n var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\n return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\n };\n Object.defineProperty(FullTextDocument.prototype, \"lineCount\", {\n get: function () {\n return this.getLineOffsets().length;\n },\n enumerable: false,\n configurable: true\n });\n return FullTextDocument;\n }());\n var Is;\n (function (Is) {\n var toString = Object.prototype.toString;\n function defined(value) {\n return typeof value !== 'undefined';\n }\n Is.defined = defined;\n function undefined(value) {\n return typeof value === 'undefined';\n }\n Is.undefined = undefined;\n function boolean(value) {\n return value === true || value === false;\n }\n Is.boolean = boolean;\n function string(value) {\n return toString.call(value) === '[object String]';\n }\n Is.string = string;\n function number(value) {\n return toString.call(value) === '[object Number]';\n }\n Is.number = number;\n function numberRange(value, min, max) {\n return toString.call(value) === '[object Number]' && min <= value && value <= max;\n }\n Is.numberRange = numberRange;\n function integer(value) {\n return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;\n }\n Is.integer = integer;\n function uinteger(value) {\n return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;\n }\n Is.uinteger = uinteger;\n function func(value) {\n return toString.call(value) === '[object Function]';\n }\n Is.func = func;\n function objectLiteral(value) {\n // Strictly speaking class instances pass this check as well. Since the LSP\n // doesn't use classes we ignore this for now. If we do we need to add something\n // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\n return value !== null && typeof value === 'object';\n }\n Is.objectLiteral = objectLiteral;\n function typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n }\n Is.typedArray = typedArray;\n })(Is || (Is = {}));\n});\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProtocolNotificationType = exports.ProtocolNotificationType0 = exports.ProtocolRequestType = exports.ProtocolRequestType0 = exports.RegistrationType = exports.MessageDirection = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nvar MessageDirection;\n(function (MessageDirection) {\n MessageDirection[\"clientToServer\"] = \"clientToServer\";\n MessageDirection[\"serverToClient\"] = \"serverToClient\";\n MessageDirection[\"both\"] = \"both\";\n})(MessageDirection || (exports.MessageDirection = MessageDirection = {}));\nclass RegistrationType {\n constructor(method) {\n this.method = method;\n }\n}\nexports.RegistrationType = RegistrationType;\nclass ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 {\n constructor(method) {\n super(method);\n }\n}\nexports.ProtocolRequestType0 = ProtocolRequestType0;\nclass ProtocolRequestType extends vscode_jsonrpc_1.RequestType {\n constructor(method) {\n super(method, vscode_jsonrpc_1.ParameterStructures.byName);\n }\n}\nexports.ProtocolRequestType = ProtocolRequestType;\nclass ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 {\n constructor(method) {\n super(method);\n }\n}\nexports.ProtocolNotificationType0 = ProtocolNotificationType0;\nclass ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType {\n constructor(method) {\n super(method, vscode_jsonrpc_1.ParameterStructures.byName);\n }\n}\nexports.ProtocolNotificationType = ProtocolNotificationType;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.objectLiteral = exports.typedArray = exports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;\nfunction boolean(value) {\n return value === true || value === false;\n}\nexports.boolean = boolean;\nfunction string(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexports.string = string;\nfunction number(value) {\n return typeof value === 'number' || value instanceof Number;\n}\nexports.number = number;\nfunction error(value) {\n return value instanceof Error;\n}\nexports.error = error;\nfunction func(value) {\n return typeof value === 'function';\n}\nexports.func = func;\nfunction array(value) {\n return Array.isArray(value);\n}\nexports.array = array;\nfunction stringArray(value) {\n return array(value) && value.every(elem => string(elem));\n}\nexports.stringArray = stringArray;\nfunction typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n}\nexports.typedArray = typedArray;\nfunction objectLiteral(value) {\n // Strictly speaking class instances pass this check as well. Since the LSP\n // doesn't use classes we ignore this for now. If we do we need to add something\n // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\n return value !== null && typeof value === 'object';\n}\nexports.objectLiteral = objectLiteral;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ImplementationRequest = void 0;\nconst messages_1 = require(\"./messages\");\n// @ts-ignore: to avoid inlining LocationLink as dynamic import\nlet __noDynamicImport;\n/**\n * A request to resolve the implementation locations of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPositionParams}\n * the response is of type {@link Definition} or a Thenable that resolves to such.\n */\nvar ImplementationRequest;\n(function (ImplementationRequest) {\n ImplementationRequest.method = 'textDocument/implementation';\n ImplementationRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ImplementationRequest.type = new messages_1.ProtocolRequestType(ImplementationRequest.method);\n})(ImplementationRequest || (exports.ImplementationRequest = ImplementationRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypeDefinitionRequest = void 0;\nconst messages_1 = require(\"./messages\");\n// @ts-ignore: to avoid inlining LocatioLink as dynamic import\nlet __noDynamicImport;\n/**\n * A request to resolve the type definition locations of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPositionParams}\n * the response is of type {@link Definition} or a Thenable that resolves to such.\n */\nvar TypeDefinitionRequest;\n(function (TypeDefinitionRequest) {\n TypeDefinitionRequest.method = 'textDocument/typeDefinition';\n TypeDefinitionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeDefinitionRequest.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest.method);\n})(TypeDefinitionRequest || (exports.TypeDefinitionRequest = TypeDefinitionRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.\n */\nvar WorkspaceFoldersRequest;\n(function (WorkspaceFoldersRequest) {\n WorkspaceFoldersRequest.method = 'workspace/workspaceFolders';\n WorkspaceFoldersRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n WorkspaceFoldersRequest.type = new messages_1.ProtocolRequestType0(WorkspaceFoldersRequest.method);\n})(WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = WorkspaceFoldersRequest = {}));\n/**\n * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace\n * folder configuration changes.\n */\nvar DidChangeWorkspaceFoldersNotification;\n(function (DidChangeWorkspaceFoldersNotification) {\n DidChangeWorkspaceFoldersNotification.method = 'workspace/didChangeWorkspaceFolders';\n DidChangeWorkspaceFoldersNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeWorkspaceFoldersNotification.type = new messages_1.ProtocolNotificationType(DidChangeWorkspaceFoldersNotification.method);\n})(DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = DidChangeWorkspaceFoldersNotification = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConfigurationRequest = void 0;\nconst messages_1 = require(\"./messages\");\n//---- Get Configuration request ----\n/**\n * The 'workspace/configuration' request is sent from the server to the client to fetch a certain\n * configuration setting.\n *\n * This pull model replaces the old push model were the client signaled configuration change via an\n * event. If the server still needs to react to configuration changes (since the server caches the\n * result of `workspace/configuration` requests) the server should register for an empty configuration\n * change event and empty the cache if such an event is received.\n */\nvar ConfigurationRequest;\n(function (ConfigurationRequest) {\n ConfigurationRequest.method = 'workspace/configuration';\n ConfigurationRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ConfigurationRequest.type = new messages_1.ProtocolRequestType(ConfigurationRequest.method);\n})(ConfigurationRequest || (exports.ConfigurationRequest = ConfigurationRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ColorPresentationRequest = exports.DocumentColorRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to list all color symbols found in a given text document. The request's\n * parameter is of type {@link DocumentColorParams} the\n * response is of type {@link ColorInformation ColorInformation[]} or a Thenable\n * that resolves to such.\n */\nvar DocumentColorRequest;\n(function (DocumentColorRequest) {\n DocumentColorRequest.method = 'textDocument/documentColor';\n DocumentColorRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentColorRequest.type = new messages_1.ProtocolRequestType(DocumentColorRequest.method);\n})(DocumentColorRequest || (exports.DocumentColorRequest = DocumentColorRequest = {}));\n/**\n * A request to list all presentation for a color. The request's\n * parameter is of type {@link ColorPresentationParams} the\n * response is of type {@link ColorInformation ColorInformation[]} or a Thenable\n * that resolves to such.\n */\nvar ColorPresentationRequest;\n(function (ColorPresentationRequest) {\n ColorPresentationRequest.method = 'textDocument/colorPresentation';\n ColorPresentationRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ColorPresentationRequest.type = new messages_1.ProtocolRequestType(ColorPresentationRequest.method);\n})(ColorPresentationRequest || (exports.ColorPresentationRequest = ColorPresentationRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide folding ranges in a document. The request's\n * parameter is of type {@link FoldingRangeParams}, the\n * response is of type {@link FoldingRangeList} or a Thenable\n * that resolves to such.\n */\nvar FoldingRangeRequest;\n(function (FoldingRangeRequest) {\n FoldingRangeRequest.method = 'textDocument/foldingRange';\n FoldingRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n FoldingRangeRequest.type = new messages_1.ProtocolRequestType(FoldingRangeRequest.method);\n})(FoldingRangeRequest || (exports.FoldingRangeRequest = FoldingRangeRequest = {}));\n/**\n * @since 3.18.0\n * @proposed\n */\nvar FoldingRangeRefreshRequest;\n(function (FoldingRangeRefreshRequest) {\n FoldingRangeRefreshRequest.method = `workspace/foldingRange/refresh`;\n FoldingRangeRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n FoldingRangeRefreshRequest.type = new messages_1.ProtocolRequestType0(FoldingRangeRefreshRequest.method);\n})(FoldingRangeRefreshRequest || (exports.FoldingRangeRefreshRequest = FoldingRangeRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DeclarationRequest = void 0;\nconst messages_1 = require(\"./messages\");\n// @ts-ignore: to avoid inlining LocationLink as dynamic import\nlet __noDynamicImport;\n/**\n * A request to resolve the type definition locations of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPositionParams}\n * the response is of type {@link Declaration} or a typed array of {@link DeclarationLink}\n * or a Thenable that resolves to such.\n */\nvar DeclarationRequest;\n(function (DeclarationRequest) {\n DeclarationRequest.method = 'textDocument/declaration';\n DeclarationRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DeclarationRequest.type = new messages_1.ProtocolRequestType(DeclarationRequest.method);\n})(DeclarationRequest || (exports.DeclarationRequest = DeclarationRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SelectionRangeRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide selection ranges in a document. The request's\n * parameter is of type {@link SelectionRangeParams}, the\n * response is of type {@link SelectionRange SelectionRange[]} or a Thenable\n * that resolves to such.\n */\nvar SelectionRangeRequest;\n(function (SelectionRangeRequest) {\n SelectionRangeRequest.method = 'textDocument/selectionRange';\n SelectionRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SelectionRangeRequest.type = new messages_1.ProtocolRequestType(SelectionRangeRequest.method);\n})(SelectionRangeRequest || (exports.SelectionRangeRequest = SelectionRangeRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nconst messages_1 = require(\"./messages\");\nvar WorkDoneProgress;\n(function (WorkDoneProgress) {\n WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType();\n function is(value) {\n return value === WorkDoneProgress.type;\n }\n WorkDoneProgress.is = is;\n})(WorkDoneProgress || (exports.WorkDoneProgress = WorkDoneProgress = {}));\n/**\n * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress\n * reporting from the server.\n */\nvar WorkDoneProgressCreateRequest;\n(function (WorkDoneProgressCreateRequest) {\n WorkDoneProgressCreateRequest.method = 'window/workDoneProgress/create';\n WorkDoneProgressCreateRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n WorkDoneProgressCreateRequest.type = new messages_1.ProtocolRequestType(WorkDoneProgressCreateRequest.method);\n})(WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = WorkDoneProgressCreateRequest = {}));\n/**\n * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress\n * initiated on the server side.\n */\nvar WorkDoneProgressCancelNotification;\n(function (WorkDoneProgressCancelNotification) {\n WorkDoneProgressCancelNotification.method = 'window/workDoneProgress/cancel';\n WorkDoneProgressCancelNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkDoneProgressCancelNotification.type = new messages_1.ProtocolNotificationType(WorkDoneProgressCancelNotification.method);\n})(WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = WorkDoneProgressCancelNotification = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) TypeFox, Microsoft and others. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.CallHierarchyPrepareRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to result a `CallHierarchyItem` in a document at a given position.\n * Can be used as an input to an incoming or outgoing call hierarchy.\n *\n * @since 3.16.0\n */\nvar CallHierarchyPrepareRequest;\n(function (CallHierarchyPrepareRequest) {\n CallHierarchyPrepareRequest.method = 'textDocument/prepareCallHierarchy';\n CallHierarchyPrepareRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CallHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest.method);\n})(CallHierarchyPrepareRequest || (exports.CallHierarchyPrepareRequest = CallHierarchyPrepareRequest = {}));\n/**\n * A request to resolve the incoming calls for a given `CallHierarchyItem`.\n *\n * @since 3.16.0\n */\nvar CallHierarchyIncomingCallsRequest;\n(function (CallHierarchyIncomingCallsRequest) {\n CallHierarchyIncomingCallsRequest.method = 'callHierarchy/incomingCalls';\n CallHierarchyIncomingCallsRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CallHierarchyIncomingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest.method);\n})(CallHierarchyIncomingCallsRequest || (exports.CallHierarchyIncomingCallsRequest = CallHierarchyIncomingCallsRequest = {}));\n/**\n * A request to resolve the outgoing calls for a given `CallHierarchyItem`.\n *\n * @since 3.16.0\n */\nvar CallHierarchyOutgoingCallsRequest;\n(function (CallHierarchyOutgoingCallsRequest) {\n CallHierarchyOutgoingCallsRequest.method = 'callHierarchy/outgoingCalls';\n CallHierarchyOutgoingCallsRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CallHierarchyOutgoingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest.method);\n})(CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = CallHierarchyOutgoingCallsRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.SemanticTokensRegistrationType = exports.TokenFormat = void 0;\nconst messages_1 = require(\"./messages\");\n//------- 'textDocument/semanticTokens' -----\nvar TokenFormat;\n(function (TokenFormat) {\n TokenFormat.Relative = 'relative';\n})(TokenFormat || (exports.TokenFormat = TokenFormat = {}));\nvar SemanticTokensRegistrationType;\n(function (SemanticTokensRegistrationType) {\n SemanticTokensRegistrationType.method = 'textDocument/semanticTokens';\n SemanticTokensRegistrationType.type = new messages_1.RegistrationType(SemanticTokensRegistrationType.method);\n})(SemanticTokensRegistrationType || (exports.SemanticTokensRegistrationType = SemanticTokensRegistrationType = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensRequest;\n(function (SemanticTokensRequest) {\n SemanticTokensRequest.method = 'textDocument/semanticTokens/full';\n SemanticTokensRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SemanticTokensRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRequest.method);\n SemanticTokensRequest.registrationMethod = SemanticTokensRegistrationType.method;\n})(SemanticTokensRequest || (exports.SemanticTokensRequest = SemanticTokensRequest = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensDeltaRequest;\n(function (SemanticTokensDeltaRequest) {\n SemanticTokensDeltaRequest.method = 'textDocument/semanticTokens/full/delta';\n SemanticTokensDeltaRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SemanticTokensDeltaRequest.type = new messages_1.ProtocolRequestType(SemanticTokensDeltaRequest.method);\n SemanticTokensDeltaRequest.registrationMethod = SemanticTokensRegistrationType.method;\n})(SemanticTokensDeltaRequest || (exports.SemanticTokensDeltaRequest = SemanticTokensDeltaRequest = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensRangeRequest;\n(function (SemanticTokensRangeRequest) {\n SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range';\n SemanticTokensRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SemanticTokensRangeRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest.method);\n SemanticTokensRangeRequest.registrationMethod = SemanticTokensRegistrationType.method;\n})(SemanticTokensRangeRequest || (exports.SemanticTokensRangeRequest = SemanticTokensRangeRequest = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensRefreshRequest;\n(function (SemanticTokensRefreshRequest) {\n SemanticTokensRefreshRequest.method = `workspace/semanticTokens/refresh`;\n SemanticTokensRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n SemanticTokensRefreshRequest.type = new messages_1.ProtocolRequestType0(SemanticTokensRefreshRequest.method);\n})(SemanticTokensRefreshRequest || (exports.SemanticTokensRefreshRequest = SemanticTokensRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShowDocumentRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to show a document. This request might open an\n * external program depending on the value of the URI to open.\n * For example a request to open `https://code.visualstudio.com/`\n * will very likely open the URI in a WEB browser.\n *\n * @since 3.16.0\n*/\nvar ShowDocumentRequest;\n(function (ShowDocumentRequest) {\n ShowDocumentRequest.method = 'window/showDocument';\n ShowDocumentRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ShowDocumentRequest.type = new messages_1.ProtocolRequestType(ShowDocumentRequest.method);\n})(ShowDocumentRequest || (exports.ShowDocumentRequest = ShowDocumentRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LinkedEditingRangeRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide ranges that can be edited together.\n *\n * @since 3.16.0\n */\nvar LinkedEditingRangeRequest;\n(function (LinkedEditingRangeRequest) {\n LinkedEditingRangeRequest.method = 'textDocument/linkedEditingRange';\n LinkedEditingRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n LinkedEditingRangeRequest.type = new messages_1.ProtocolRequestType(LinkedEditingRangeRequest.method);\n})(LinkedEditingRangeRequest || (exports.LinkedEditingRangeRequest = LinkedEditingRangeRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.DidRenameFilesNotification = exports.WillRenameFilesRequest = exports.DidCreateFilesNotification = exports.WillCreateFilesRequest = exports.FileOperationPatternKind = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A pattern kind describing if a glob pattern matches a file a folder or\n * both.\n *\n * @since 3.16.0\n */\nvar FileOperationPatternKind;\n(function (FileOperationPatternKind) {\n /**\n * The pattern matches a file only.\n */\n FileOperationPatternKind.file = 'file';\n /**\n * The pattern matches a folder only.\n */\n FileOperationPatternKind.folder = 'folder';\n})(FileOperationPatternKind || (exports.FileOperationPatternKind = FileOperationPatternKind = {}));\n/**\n * The will create files request is sent from the client to the server before files are actually\n * created as long as the creation is triggered from within the client.\n *\n * The request can return a `WorkspaceEdit` which will be applied to workspace before the\n * files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file\n * to be created.\n *\n * @since 3.16.0\n */\nvar WillCreateFilesRequest;\n(function (WillCreateFilesRequest) {\n WillCreateFilesRequest.method = 'workspace/willCreateFiles';\n WillCreateFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillCreateFilesRequest.type = new messages_1.ProtocolRequestType(WillCreateFilesRequest.method);\n})(WillCreateFilesRequest || (exports.WillCreateFilesRequest = WillCreateFilesRequest = {}));\n/**\n * The did create files notification is sent from the client to the server when\n * files were created from within the client.\n *\n * @since 3.16.0\n */\nvar DidCreateFilesNotification;\n(function (DidCreateFilesNotification) {\n DidCreateFilesNotification.method = 'workspace/didCreateFiles';\n DidCreateFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidCreateFilesNotification.type = new messages_1.ProtocolNotificationType(DidCreateFilesNotification.method);\n})(DidCreateFilesNotification || (exports.DidCreateFilesNotification = DidCreateFilesNotification = {}));\n/**\n * The will rename files request is sent from the client to the server before files are actually\n * renamed as long as the rename is triggered from within the client.\n *\n * @since 3.16.0\n */\nvar WillRenameFilesRequest;\n(function (WillRenameFilesRequest) {\n WillRenameFilesRequest.method = 'workspace/willRenameFiles';\n WillRenameFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillRenameFilesRequest.type = new messages_1.ProtocolRequestType(WillRenameFilesRequest.method);\n})(WillRenameFilesRequest || (exports.WillRenameFilesRequest = WillRenameFilesRequest = {}));\n/**\n * The did rename files notification is sent from the client to the server when\n * files were renamed from within the client.\n *\n * @since 3.16.0\n */\nvar DidRenameFilesNotification;\n(function (DidRenameFilesNotification) {\n DidRenameFilesNotification.method = 'workspace/didRenameFiles';\n DidRenameFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidRenameFilesNotification.type = new messages_1.ProtocolNotificationType(DidRenameFilesNotification.method);\n})(DidRenameFilesNotification || (exports.DidRenameFilesNotification = DidRenameFilesNotification = {}));\n/**\n * The will delete files request is sent from the client to the server before files are actually\n * deleted as long as the deletion is triggered from within the client.\n *\n * @since 3.16.0\n */\nvar DidDeleteFilesNotification;\n(function (DidDeleteFilesNotification) {\n DidDeleteFilesNotification.method = 'workspace/didDeleteFiles';\n DidDeleteFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidDeleteFilesNotification.type = new messages_1.ProtocolNotificationType(DidDeleteFilesNotification.method);\n})(DidDeleteFilesNotification || (exports.DidDeleteFilesNotification = DidDeleteFilesNotification = {}));\n/**\n * The did delete files notification is sent from the client to the server when\n * files were deleted from within the client.\n *\n * @since 3.16.0\n */\nvar WillDeleteFilesRequest;\n(function (WillDeleteFilesRequest) {\n WillDeleteFilesRequest.method = 'workspace/willDeleteFiles';\n WillDeleteFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillDeleteFilesRequest.type = new messages_1.ProtocolRequestType(WillDeleteFilesRequest.method);\n})(WillDeleteFilesRequest || (exports.WillDeleteFilesRequest = WillDeleteFilesRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * Moniker uniqueness level to define scope of the moniker.\n *\n * @since 3.16.0\n */\nvar UniquenessLevel;\n(function (UniquenessLevel) {\n /**\n * The moniker is only unique inside a document\n */\n UniquenessLevel.document = 'document';\n /**\n * The moniker is unique inside a project for which a dump got created\n */\n UniquenessLevel.project = 'project';\n /**\n * The moniker is unique inside the group to which a project belongs\n */\n UniquenessLevel.group = 'group';\n /**\n * The moniker is unique inside the moniker scheme.\n */\n UniquenessLevel.scheme = 'scheme';\n /**\n * The moniker is globally unique\n */\n UniquenessLevel.global = 'global';\n})(UniquenessLevel || (exports.UniquenessLevel = UniquenessLevel = {}));\n/**\n * The moniker kind.\n *\n * @since 3.16.0\n */\nvar MonikerKind;\n(function (MonikerKind) {\n /**\n * The moniker represent a symbol that is imported into a project\n */\n MonikerKind.$import = 'import';\n /**\n * The moniker represents a symbol that is exported from a project\n */\n MonikerKind.$export = 'export';\n /**\n * The moniker represents a symbol that is local to a project (e.g. a local\n * variable of a function, a class not visible outside the project, ...)\n */\n MonikerKind.local = 'local';\n})(MonikerKind || (exports.MonikerKind = MonikerKind = {}));\n/**\n * A request to get the moniker of a symbol at a given text document position.\n * The request parameter is of type {@link TextDocumentPositionParams}.\n * The response is of type {@link Moniker Moniker[]} or `null`.\n */\nvar MonikerRequest;\n(function (MonikerRequest) {\n MonikerRequest.method = 'textDocument/moniker';\n MonikerRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n MonikerRequest.type = new messages_1.ProtocolRequestType(MonikerRequest.method);\n})(MonikerRequest || (exports.MonikerRequest = MonikerRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) TypeFox, Microsoft and others. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypeHierarchySubtypesRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchyPrepareRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to result a `TypeHierarchyItem` in a document at a given position.\n * Can be used as an input to a subtypes or supertypes type hierarchy.\n *\n * @since 3.17.0\n */\nvar TypeHierarchyPrepareRequest;\n(function (TypeHierarchyPrepareRequest) {\n TypeHierarchyPrepareRequest.method = 'textDocument/prepareTypeHierarchy';\n TypeHierarchyPrepareRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(TypeHierarchyPrepareRequest.method);\n})(TypeHierarchyPrepareRequest || (exports.TypeHierarchyPrepareRequest = TypeHierarchyPrepareRequest = {}));\n/**\n * A request to resolve the supertypes for a given `TypeHierarchyItem`.\n *\n * @since 3.17.0\n */\nvar TypeHierarchySupertypesRequest;\n(function (TypeHierarchySupertypesRequest) {\n TypeHierarchySupertypesRequest.method = 'typeHierarchy/supertypes';\n TypeHierarchySupertypesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeHierarchySupertypesRequest.type = new messages_1.ProtocolRequestType(TypeHierarchySupertypesRequest.method);\n})(TypeHierarchySupertypesRequest || (exports.TypeHierarchySupertypesRequest = TypeHierarchySupertypesRequest = {}));\n/**\n * A request to resolve the subtypes for a given `TypeHierarchyItem`.\n *\n * @since 3.17.0\n */\nvar TypeHierarchySubtypesRequest;\n(function (TypeHierarchySubtypesRequest) {\n TypeHierarchySubtypesRequest.method = 'typeHierarchy/subtypes';\n TypeHierarchySubtypesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeHierarchySubtypesRequest.type = new messages_1.ProtocolRequestType(TypeHierarchySubtypesRequest.method);\n})(TypeHierarchySubtypesRequest || (exports.TypeHierarchySubtypesRequest = TypeHierarchySubtypesRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineValueRefreshRequest = exports.InlineValueRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide inline values in a document. The request's parameter is of\n * type {@link InlineValueParams}, the response is of type\n * {@link InlineValue InlineValue[]} or a Thenable that resolves to such.\n *\n * @since 3.17.0\n */\nvar InlineValueRequest;\n(function (InlineValueRequest) {\n InlineValueRequest.method = 'textDocument/inlineValue';\n InlineValueRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlineValueRequest.type = new messages_1.ProtocolRequestType(InlineValueRequest.method);\n})(InlineValueRequest || (exports.InlineValueRequest = InlineValueRequest = {}));\n/**\n * @since 3.17.0\n */\nvar InlineValueRefreshRequest;\n(function (InlineValueRefreshRequest) {\n InlineValueRefreshRequest.method = `workspace/inlineValue/refresh`;\n InlineValueRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n InlineValueRefreshRequest.type = new messages_1.ProtocolRequestType0(InlineValueRefreshRequest.method);\n})(InlineValueRefreshRequest || (exports.InlineValueRefreshRequest = InlineValueRefreshRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide inlay hints in a document. The request's parameter is of\n * type {@link InlayHintsParams}, the response is of type\n * {@link InlayHint InlayHint[]} or a Thenable that resolves to such.\n *\n * @since 3.17.0\n */\nvar InlayHintRequest;\n(function (InlayHintRequest) {\n InlayHintRequest.method = 'textDocument/inlayHint';\n InlayHintRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlayHintRequest.type = new messages_1.ProtocolRequestType(InlayHintRequest.method);\n})(InlayHintRequest || (exports.InlayHintRequest = InlayHintRequest = {}));\n/**\n * A request to resolve additional properties for an inlay hint.\n * The request's parameter is of type {@link InlayHint}, the response is\n * of type {@link InlayHint} or a Thenable that resolves to such.\n *\n * @since 3.17.0\n */\nvar InlayHintResolveRequest;\n(function (InlayHintResolveRequest) {\n InlayHintResolveRequest.method = 'inlayHint/resolve';\n InlayHintResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlayHintResolveRequest.type = new messages_1.ProtocolRequestType(InlayHintResolveRequest.method);\n})(InlayHintResolveRequest || (exports.InlayHintResolveRequest = InlayHintResolveRequest = {}));\n/**\n * @since 3.17.0\n */\nvar InlayHintRefreshRequest;\n(function (InlayHintRefreshRequest) {\n InlayHintRefreshRequest.method = `workspace/inlayHint/refresh`;\n InlayHintRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n InlayHintRefreshRequest.type = new messages_1.ProtocolRequestType0(InlayHintRefreshRequest.method);\n})(InlayHintRefreshRequest || (exports.InlayHintRefreshRequest = InlayHintRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nconst Is = require(\"./utils/is\");\nconst messages_1 = require(\"./messages\");\n/**\n * @since 3.17.0\n */\nvar DiagnosticServerCancellationData;\n(function (DiagnosticServerCancellationData) {\n function is(value) {\n const candidate = value;\n return candidate && Is.boolean(candidate.retriggerRequest);\n }\n DiagnosticServerCancellationData.is = is;\n})(DiagnosticServerCancellationData || (exports.DiagnosticServerCancellationData = DiagnosticServerCancellationData = {}));\n/**\n * The document diagnostic report kinds.\n *\n * @since 3.17.0\n */\nvar DocumentDiagnosticReportKind;\n(function (DocumentDiagnosticReportKind) {\n /**\n * A diagnostic report with a full\n * set of problems.\n */\n DocumentDiagnosticReportKind.Full = 'full';\n /**\n * A report indicating that the last\n * returned report is still accurate.\n */\n DocumentDiagnosticReportKind.Unchanged = 'unchanged';\n})(DocumentDiagnosticReportKind || (exports.DocumentDiagnosticReportKind = DocumentDiagnosticReportKind = {}));\n/**\n * The document diagnostic request definition.\n *\n * @since 3.17.0\n */\nvar DocumentDiagnosticRequest;\n(function (DocumentDiagnosticRequest) {\n DocumentDiagnosticRequest.method = 'textDocument/diagnostic';\n DocumentDiagnosticRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentDiagnosticRequest.type = new messages_1.ProtocolRequestType(DocumentDiagnosticRequest.method);\n DocumentDiagnosticRequest.partialResult = new vscode_jsonrpc_1.ProgressType();\n})(DocumentDiagnosticRequest || (exports.DocumentDiagnosticRequest = DocumentDiagnosticRequest = {}));\n/**\n * The workspace diagnostic request definition.\n *\n * @since 3.17.0\n */\nvar WorkspaceDiagnosticRequest;\n(function (WorkspaceDiagnosticRequest) {\n WorkspaceDiagnosticRequest.method = 'workspace/diagnostic';\n WorkspaceDiagnosticRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkspaceDiagnosticRequest.type = new messages_1.ProtocolRequestType(WorkspaceDiagnosticRequest.method);\n WorkspaceDiagnosticRequest.partialResult = new vscode_jsonrpc_1.ProgressType();\n})(WorkspaceDiagnosticRequest || (exports.WorkspaceDiagnosticRequest = WorkspaceDiagnosticRequest = {}));\n/**\n * The diagnostic refresh request definition.\n *\n * @since 3.17.0\n */\nvar DiagnosticRefreshRequest;\n(function (DiagnosticRefreshRequest) {\n DiagnosticRefreshRequest.method = `workspace/diagnostic/refresh`;\n DiagnosticRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n DiagnosticRefreshRequest.type = new messages_1.ProtocolRequestType0(DiagnosticRefreshRequest.method);\n})(DiagnosticRefreshRequest || (exports.DiagnosticRefreshRequest = DiagnosticRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = void 0;\nconst vscode_languageserver_types_1 = require(\"vscode-languageserver-types\");\nconst Is = require(\"./utils/is\");\nconst messages_1 = require(\"./messages\");\n/**\n * A notebook cell kind.\n *\n * @since 3.17.0\n */\nvar NotebookCellKind;\n(function (NotebookCellKind) {\n /**\n * A markup-cell is formatted source that is used for display.\n */\n NotebookCellKind.Markup = 1;\n /**\n * A code-cell is source code.\n */\n NotebookCellKind.Code = 2;\n function is(value) {\n return value === 1 || value === 2;\n }\n NotebookCellKind.is = is;\n})(NotebookCellKind || (exports.NotebookCellKind = NotebookCellKind = {}));\nvar ExecutionSummary;\n(function (ExecutionSummary) {\n function create(executionOrder, success) {\n const result = { executionOrder };\n if (success === true || success === false) {\n result.success = success;\n }\n return result;\n }\n ExecutionSummary.create = create;\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.executionOrder) && (candidate.success === undefined || Is.boolean(candidate.success));\n }\n ExecutionSummary.is = is;\n function equals(one, other) {\n if (one === other) {\n return true;\n }\n if (one === null || one === undefined || other === null || other === undefined) {\n return false;\n }\n return one.executionOrder === other.executionOrder && one.success === other.success;\n }\n ExecutionSummary.equals = equals;\n})(ExecutionSummary || (exports.ExecutionSummary = ExecutionSummary = {}));\nvar NotebookCell;\n(function (NotebookCell) {\n function create(kind, document) {\n return { kind, document };\n }\n NotebookCell.create = create;\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && NotebookCellKind.is(candidate.kind) && vscode_languageserver_types_1.DocumentUri.is(candidate.document) &&\n (candidate.metadata === undefined || Is.objectLiteral(candidate.metadata));\n }\n NotebookCell.is = is;\n function diff(one, two) {\n const result = new Set();\n if (one.document !== two.document) {\n result.add('document');\n }\n if (one.kind !== two.kind) {\n result.add('kind');\n }\n if (one.executionSummary !== two.executionSummary) {\n result.add('executionSummary');\n }\n if ((one.metadata !== undefined || two.metadata !== undefined) && !equalsMetadata(one.metadata, two.metadata)) {\n result.add('metadata');\n }\n if ((one.executionSummary !== undefined || two.executionSummary !== undefined) && !ExecutionSummary.equals(one.executionSummary, two.executionSummary)) {\n result.add('executionSummary');\n }\n return result;\n }\n NotebookCell.diff = diff;\n function equalsMetadata(one, other) {\n if (one === other) {\n return true;\n }\n if (one === null || one === undefined || other === null || other === undefined) {\n return false;\n }\n if (typeof one !== typeof other) {\n return false;\n }\n if (typeof one !== 'object') {\n return false;\n }\n const oneArray = Array.isArray(one);\n const otherArray = Array.isArray(other);\n if (oneArray !== otherArray) {\n return false;\n }\n if (oneArray && otherArray) {\n if (one.length !== other.length) {\n return false;\n }\n for (let i = 0; i < one.length; i++) {\n if (!equalsMetadata(one[i], other[i])) {\n return false;\n }\n }\n }\n if (Is.objectLiteral(one) && Is.objectLiteral(other)) {\n const oneKeys = Object.keys(one);\n const otherKeys = Object.keys(other);\n if (oneKeys.length !== otherKeys.length) {\n return false;\n }\n oneKeys.sort();\n otherKeys.sort();\n if (!equalsMetadata(oneKeys, otherKeys)) {\n return false;\n }\n for (let i = 0; i < oneKeys.length; i++) {\n const prop = oneKeys[i];\n if (!equalsMetadata(one[prop], other[prop])) {\n return false;\n }\n }\n }\n return true;\n }\n})(NotebookCell || (exports.NotebookCell = NotebookCell = {}));\nvar NotebookDocument;\n(function (NotebookDocument) {\n function create(uri, notebookType, version, cells) {\n return { uri, notebookType, version, cells };\n }\n NotebookDocument.create = create;\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.uri) && vscode_languageserver_types_1.integer.is(candidate.version) && Is.typedArray(candidate.cells, NotebookCell.is);\n }\n NotebookDocument.is = is;\n})(NotebookDocument || (exports.NotebookDocument = NotebookDocument = {}));\nvar NotebookDocumentSyncRegistrationType;\n(function (NotebookDocumentSyncRegistrationType) {\n NotebookDocumentSyncRegistrationType.method = 'notebookDocument/sync';\n NotebookDocumentSyncRegistrationType.messageDirection = messages_1.MessageDirection.clientToServer;\n NotebookDocumentSyncRegistrationType.type = new messages_1.RegistrationType(NotebookDocumentSyncRegistrationType.method);\n})(NotebookDocumentSyncRegistrationType || (exports.NotebookDocumentSyncRegistrationType = NotebookDocumentSyncRegistrationType = {}));\n/**\n * A notification sent when a notebook opens.\n *\n * @since 3.17.0\n */\nvar DidOpenNotebookDocumentNotification;\n(function (DidOpenNotebookDocumentNotification) {\n DidOpenNotebookDocumentNotification.method = 'notebookDocument/didOpen';\n DidOpenNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidOpenNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenNotebookDocumentNotification.method);\n DidOpenNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidOpenNotebookDocumentNotification || (exports.DidOpenNotebookDocumentNotification = DidOpenNotebookDocumentNotification = {}));\nvar NotebookCellArrayChange;\n(function (NotebookCellArrayChange) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.start) && vscode_languageserver_types_1.uinteger.is(candidate.deleteCount) && (candidate.cells === undefined || Is.typedArray(candidate.cells, NotebookCell.is));\n }\n NotebookCellArrayChange.is = is;\n function create(start, deleteCount, cells) {\n const result = { start, deleteCount };\n if (cells !== undefined) {\n result.cells = cells;\n }\n return result;\n }\n NotebookCellArrayChange.create = create;\n})(NotebookCellArrayChange || (exports.NotebookCellArrayChange = NotebookCellArrayChange = {}));\nvar DidChangeNotebookDocumentNotification;\n(function (DidChangeNotebookDocumentNotification) {\n DidChangeNotebookDocumentNotification.method = 'notebookDocument/didChange';\n DidChangeNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeNotebookDocumentNotification.method);\n DidChangeNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidChangeNotebookDocumentNotification || (exports.DidChangeNotebookDocumentNotification = DidChangeNotebookDocumentNotification = {}));\n/**\n * A notification sent when a notebook document is saved.\n *\n * @since 3.17.0\n */\nvar DidSaveNotebookDocumentNotification;\n(function (DidSaveNotebookDocumentNotification) {\n DidSaveNotebookDocumentNotification.method = 'notebookDocument/didSave';\n DidSaveNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidSaveNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveNotebookDocumentNotification.method);\n DidSaveNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidSaveNotebookDocumentNotification || (exports.DidSaveNotebookDocumentNotification = DidSaveNotebookDocumentNotification = {}));\n/**\n * A notification sent when a notebook closes.\n *\n * @since 3.17.0\n */\nvar DidCloseNotebookDocumentNotification;\n(function (DidCloseNotebookDocumentNotification) {\n DidCloseNotebookDocumentNotification.method = 'notebookDocument/didClose';\n DidCloseNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidCloseNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseNotebookDocumentNotification.method);\n DidCloseNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidCloseNotebookDocumentNotification || (exports.DidCloseNotebookDocumentNotification = DidCloseNotebookDocumentNotification = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineCompletionRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide inline completions in a document. The request's parameter is of\n * type {@link InlineCompletionParams}, the response is of type\n * {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.\n *\n * @since 3.18.0\n * @proposed\n */\nvar InlineCompletionRequest;\n(function (InlineCompletionRequest) {\n InlineCompletionRequest.method = 'textDocument/inlineCompletion';\n InlineCompletionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlineCompletionRequest.type = new messages_1.ProtocolRequestType(InlineCompletionRequest.method);\n})(InlineCompletionRequest || (exports.InlineCompletionRequest = InlineCompletionRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkspaceSymbolRequest = exports.CodeActionResolveRequest = exports.CodeActionRequest = exports.DocumentSymbolRequest = exports.DocumentHighlightRequest = exports.ReferencesRequest = exports.DefinitionRequest = exports.SignatureHelpRequest = exports.SignatureHelpTriggerKind = exports.HoverRequest = exports.CompletionResolveRequest = exports.CompletionRequest = exports.CompletionTriggerKind = exports.PublishDiagnosticsNotification = exports.WatchKind = exports.RelativePattern = exports.FileChangeType = exports.DidChangeWatchedFilesNotification = exports.WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentNotification = exports.TextDocumentSaveReason = exports.DidSaveTextDocumentNotification = exports.DidCloseTextDocumentNotification = exports.DidChangeTextDocumentNotification = exports.TextDocumentContentChangeEvent = exports.DidOpenTextDocumentNotification = exports.TextDocumentSyncKind = exports.TelemetryEventNotification = exports.LogMessageNotification = exports.ShowMessageRequest = exports.ShowMessageNotification = exports.MessageType = exports.DidChangeConfigurationNotification = exports.ExitNotification = exports.ShutdownRequest = exports.InitializedNotification = exports.InitializeErrorCodes = exports.InitializeRequest = exports.WorkDoneProgressOptions = exports.TextDocumentRegistrationOptions = exports.StaticRegistrationOptions = exports.PositionEncodingKind = exports.FailureHandlingKind = exports.ResourceOperationKind = exports.UnregistrationRequest = exports.RegistrationRequest = exports.DocumentSelector = exports.NotebookCellTextDocumentFilter = exports.NotebookDocumentFilter = exports.TextDocumentFilter = void 0;\nexports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = exports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.WillRenameFilesRequest = exports.DidRenameFilesNotification = exports.WillCreateFilesRequest = exports.DidCreateFilesNotification = exports.FileOperationPatternKind = exports.LinkedEditingRangeRequest = exports.ShowDocumentRequest = exports.SemanticTokensRegistrationType = exports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.TokenFormat = exports.CallHierarchyPrepareRequest = exports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = exports.SelectionRangeRequest = exports.DeclarationRequest = exports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = exports.ColorPresentationRequest = exports.DocumentColorRequest = exports.ConfigurationRequest = exports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = exports.TypeDefinitionRequest = exports.ImplementationRequest = exports.ApplyWorkspaceEditRequest = exports.ExecuteCommandRequest = exports.PrepareRenameRequest = exports.RenameRequest = exports.PrepareSupportDefaultBehavior = exports.DocumentOnTypeFormattingRequest = exports.DocumentRangesFormattingRequest = exports.DocumentRangeFormattingRequest = exports.DocumentFormattingRequest = exports.DocumentLinkResolveRequest = exports.DocumentLinkRequest = exports.CodeLensRefreshRequest = exports.CodeLensResolveRequest = exports.CodeLensRequest = exports.WorkspaceSymbolResolveRequest = void 0;\nexports.InlineCompletionRequest = exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = exports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = exports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = exports.InlineValueRefreshRequest = exports.InlineValueRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchySubtypesRequest = exports.TypeHierarchyPrepareRequest = void 0;\nconst messages_1 = require(\"./messages\");\nconst vscode_languageserver_types_1 = require(\"vscode-languageserver-types\");\nconst Is = require(\"./utils/is\");\nconst protocol_implementation_1 = require(\"./protocol.implementation\");\nObject.defineProperty(exports, \"ImplementationRequest\", { enumerable: true, get: function () { return protocol_implementation_1.ImplementationRequest; } });\nconst protocol_typeDefinition_1 = require(\"./protocol.typeDefinition\");\nObject.defineProperty(exports, \"TypeDefinitionRequest\", { enumerable: true, get: function () { return protocol_typeDefinition_1.TypeDefinitionRequest; } });\nconst protocol_workspaceFolder_1 = require(\"./protocol.workspaceFolder\");\nObject.defineProperty(exports, \"WorkspaceFoldersRequest\", { enumerable: true, get: function () { return protocol_workspaceFolder_1.WorkspaceFoldersRequest; } });\nObject.defineProperty(exports, \"DidChangeWorkspaceFoldersNotification\", { enumerable: true, get: function () { return protocol_workspaceFolder_1.DidChangeWorkspaceFoldersNotification; } });\nconst protocol_configuration_1 = require(\"./protocol.configuration\");\nObject.defineProperty(exports, \"ConfigurationRequest\", { enumerable: true, get: function () { return protocol_configuration_1.ConfigurationRequest; } });\nconst protocol_colorProvider_1 = require(\"./protocol.colorProvider\");\nObject.defineProperty(exports, \"DocumentColorRequest\", { enumerable: true, get: function () { return protocol_colorProvider_1.DocumentColorRequest; } });\nObject.defineProperty(exports, \"ColorPresentationRequest\", { enumerable: true, get: function () { return protocol_colorProvider_1.ColorPresentationRequest; } });\nconst protocol_foldingRange_1 = require(\"./protocol.foldingRange\");\nObject.defineProperty(exports, \"FoldingRangeRequest\", { enumerable: true, get: function () { return protocol_foldingRange_1.FoldingRangeRequest; } });\nObject.defineProperty(exports, \"FoldingRangeRefreshRequest\", { enumerable: true, get: function () { return protocol_foldingRange_1.FoldingRangeRefreshRequest; } });\nconst protocol_declaration_1 = require(\"./protocol.declaration\");\nObject.defineProperty(exports, \"DeclarationRequest\", { enumerable: true, get: function () { return protocol_declaration_1.DeclarationRequest; } });\nconst protocol_selectionRange_1 = require(\"./protocol.selectionRange\");\nObject.defineProperty(exports, \"SelectionRangeRequest\", { enumerable: true, get: function () { return protocol_selectionRange_1.SelectionRangeRequest; } });\nconst protocol_progress_1 = require(\"./protocol.progress\");\nObject.defineProperty(exports, \"WorkDoneProgress\", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgress; } });\nObject.defineProperty(exports, \"WorkDoneProgressCreateRequest\", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgressCreateRequest; } });\nObject.defineProperty(exports, \"WorkDoneProgressCancelNotification\", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgressCancelNotification; } });\nconst protocol_callHierarchy_1 = require(\"./protocol.callHierarchy\");\nObject.defineProperty(exports, \"CallHierarchyIncomingCallsRequest\", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyIncomingCallsRequest; } });\nObject.defineProperty(exports, \"CallHierarchyOutgoingCallsRequest\", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyOutgoingCallsRequest; } });\nObject.defineProperty(exports, \"CallHierarchyPrepareRequest\", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyPrepareRequest; } });\nconst protocol_semanticTokens_1 = require(\"./protocol.semanticTokens\");\nObject.defineProperty(exports, \"TokenFormat\", { enumerable: true, get: function () { return protocol_semanticTokens_1.TokenFormat; } });\nObject.defineProperty(exports, \"SemanticTokensRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRequest; } });\nObject.defineProperty(exports, \"SemanticTokensDeltaRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensDeltaRequest; } });\nObject.defineProperty(exports, \"SemanticTokensRangeRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRangeRequest; } });\nObject.defineProperty(exports, \"SemanticTokensRefreshRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRefreshRequest; } });\nObject.defineProperty(exports, \"SemanticTokensRegistrationType\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRegistrationType; } });\nconst protocol_showDocument_1 = require(\"./protocol.showDocument\");\nObject.defineProperty(exports, \"ShowDocumentRequest\", { enumerable: true, get: function () { return protocol_showDocument_1.ShowDocumentRequest; } });\nconst protocol_linkedEditingRange_1 = require(\"./protocol.linkedEditingRange\");\nObject.defineProperty(exports, \"LinkedEditingRangeRequest\", { enumerable: true, get: function () { return protocol_linkedEditingRange_1.LinkedEditingRangeRequest; } });\nconst protocol_fileOperations_1 = require(\"./protocol.fileOperations\");\nObject.defineProperty(exports, \"FileOperationPatternKind\", { enumerable: true, get: function () { return protocol_fileOperations_1.FileOperationPatternKind; } });\nObject.defineProperty(exports, \"DidCreateFilesNotification\", { enumerable: true, get: function () { return protocol_fileOperations_1.DidCreateFilesNotification; } });\nObject.defineProperty(exports, \"WillCreateFilesRequest\", { enumerable: true, get: function () { return protocol_fileOperations_1.WillCreateFilesRequest; } });\nObject.defineProperty(exports, \"DidRenameFilesNotification\", { enumerable: true, get: function () { return protocol_fileOperations_1.DidRenameFilesNotification; } });\nObject.defineProperty(exports, \"WillRenameFilesRequest\", { enumerable: true, get: function () { return protocol_fileOperations_1.WillRenameFilesRequest; } });\nObject.defineProperty(exports, \"DidDeleteFilesNotification\", { enumerable: true, get: function () { return protocol_fileOperations_1.DidDeleteFilesNotification; } });\nObject.defineProperty(exports, \"WillDeleteFilesRequest\", { enumerable: true, get: function () { return protocol_fileOperations_1.WillDeleteFilesRequest; } });\nconst protocol_moniker_1 = require(\"./protocol.moniker\");\nObject.defineProperty(exports, \"UniquenessLevel\", { enumerable: true, get: function () { return protocol_moniker_1.UniquenessLevel; } });\nObject.defineProperty(exports, \"MonikerKind\", { enumerable: true, get: function () { return protocol_moniker_1.MonikerKind; } });\nObject.defineProperty(exports, \"MonikerRequest\", { enumerable: true, get: function () { return protocol_moniker_1.MonikerRequest; } });\nconst protocol_typeHierarchy_1 = require(\"./protocol.typeHierarchy\");\nObject.defineProperty(exports, \"TypeHierarchyPrepareRequest\", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchyPrepareRequest; } });\nObject.defineProperty(exports, \"TypeHierarchySubtypesRequest\", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchySubtypesRequest; } });\nObject.defineProperty(exports, \"TypeHierarchySupertypesRequest\", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchySupertypesRequest; } });\nconst protocol_inlineValue_1 = require(\"./protocol.inlineValue\");\nObject.defineProperty(exports, \"InlineValueRequest\", { enumerable: true, get: function () { return protocol_inlineValue_1.InlineValueRequest; } });\nObject.defineProperty(exports, \"InlineValueRefreshRequest\", { enumerable: true, get: function () { return protocol_inlineValue_1.InlineValueRefreshRequest; } });\nconst protocol_inlayHint_1 = require(\"./protocol.inlayHint\");\nObject.defineProperty(exports, \"InlayHintRequest\", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintRequest; } });\nObject.defineProperty(exports, \"InlayHintResolveRequest\", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintResolveRequest; } });\nObject.defineProperty(exports, \"InlayHintRefreshRequest\", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintRefreshRequest; } });\nconst protocol_diagnostic_1 = require(\"./protocol.diagnostic\");\nObject.defineProperty(exports, \"DiagnosticServerCancellationData\", { enumerable: true, get: function () { return protocol_diagnostic_1.DiagnosticServerCancellationData; } });\nObject.defineProperty(exports, \"DocumentDiagnosticReportKind\", { enumerable: true, get: function () { return protocol_diagnostic_1.DocumentDiagnosticReportKind; } });\nObject.defineProperty(exports, \"DocumentDiagnosticRequest\", { enumerable: true, get: function () { return protocol_diagnostic_1.DocumentDiagnosticRequest; } });\nObject.defineProperty(exports, \"WorkspaceDiagnosticRequest\", { enumerable: true, get: function () { return protocol_diagnostic_1.WorkspaceDiagnosticRequest; } });\nObject.defineProperty(exports, \"DiagnosticRefreshRequest\", { enumerable: true, get: function () { return protocol_diagnostic_1.DiagnosticRefreshRequest; } });\nconst protocol_notebook_1 = require(\"./protocol.notebook\");\nObject.defineProperty(exports, \"NotebookCellKind\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCellKind; } });\nObject.defineProperty(exports, \"ExecutionSummary\", { enumerable: true, get: function () { return protocol_notebook_1.ExecutionSummary; } });\nObject.defineProperty(exports, \"NotebookCell\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCell; } });\nObject.defineProperty(exports, \"NotebookDocument\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookDocument; } });\nObject.defineProperty(exports, \"NotebookDocumentSyncRegistrationType\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookDocumentSyncRegistrationType; } });\nObject.defineProperty(exports, \"DidOpenNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidOpenNotebookDocumentNotification; } });\nObject.defineProperty(exports, \"NotebookCellArrayChange\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCellArrayChange; } });\nObject.defineProperty(exports, \"DidChangeNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidChangeNotebookDocumentNotification; } });\nObject.defineProperty(exports, \"DidSaveNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidSaveNotebookDocumentNotification; } });\nObject.defineProperty(exports, \"DidCloseNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidCloseNotebookDocumentNotification; } });\nconst protocol_inlineCompletion_1 = require(\"./protocol.inlineCompletion\");\nObject.defineProperty(exports, \"InlineCompletionRequest\", { enumerable: true, get: function () { return protocol_inlineCompletion_1.InlineCompletionRequest; } });\n// @ts-ignore: to avoid inlining LocationLink as dynamic import\nlet __noDynamicImport;\n/**\n * The TextDocumentFilter namespace provides helper functions to work with\n * {@link TextDocumentFilter} literals.\n *\n * @since 3.17.0\n */\nvar TextDocumentFilter;\n(function (TextDocumentFilter) {\n function is(value) {\n const candidate = value;\n return Is.string(candidate) || (Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern));\n }\n TextDocumentFilter.is = is;\n})(TextDocumentFilter || (exports.TextDocumentFilter = TextDocumentFilter = {}));\n/**\n * The NotebookDocumentFilter namespace provides helper functions to work with\n * {@link NotebookDocumentFilter} literals.\n *\n * @since 3.17.0\n */\nvar NotebookDocumentFilter;\n(function (NotebookDocumentFilter) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && (Is.string(candidate.notebookType) || Is.string(candidate.scheme) || Is.string(candidate.pattern));\n }\n NotebookDocumentFilter.is = is;\n})(NotebookDocumentFilter || (exports.NotebookDocumentFilter = NotebookDocumentFilter = {}));\n/**\n * The NotebookCellTextDocumentFilter namespace provides helper functions to work with\n * {@link NotebookCellTextDocumentFilter} literals.\n *\n * @since 3.17.0\n */\nvar NotebookCellTextDocumentFilter;\n(function (NotebookCellTextDocumentFilter) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate)\n && (Is.string(candidate.notebook) || NotebookDocumentFilter.is(candidate.notebook))\n && (candidate.language === undefined || Is.string(candidate.language));\n }\n NotebookCellTextDocumentFilter.is = is;\n})(NotebookCellTextDocumentFilter || (exports.NotebookCellTextDocumentFilter = NotebookCellTextDocumentFilter = {}));\n/**\n * The DocumentSelector namespace provides helper functions to work with\n * {@link DocumentSelector}s.\n */\nvar DocumentSelector;\n(function (DocumentSelector) {\n function is(value) {\n if (!Array.isArray(value)) {\n return false;\n }\n for (let elem of value) {\n if (!Is.string(elem) && !TextDocumentFilter.is(elem) && !NotebookCellTextDocumentFilter.is(elem)) {\n return false;\n }\n }\n return true;\n }\n DocumentSelector.is = is;\n})(DocumentSelector || (exports.DocumentSelector = DocumentSelector = {}));\n/**\n * The `client/registerCapability` request is sent from the server to the client to register a new capability\n * handler on the client side.\n */\nvar RegistrationRequest;\n(function (RegistrationRequest) {\n RegistrationRequest.method = 'client/registerCapability';\n RegistrationRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n RegistrationRequest.type = new messages_1.ProtocolRequestType(RegistrationRequest.method);\n})(RegistrationRequest || (exports.RegistrationRequest = RegistrationRequest = {}));\n/**\n * The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability\n * handler on the client side.\n */\nvar UnregistrationRequest;\n(function (UnregistrationRequest) {\n UnregistrationRequest.method = 'client/unregisterCapability';\n UnregistrationRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n UnregistrationRequest.type = new messages_1.ProtocolRequestType(UnregistrationRequest.method);\n})(UnregistrationRequest || (exports.UnregistrationRequest = UnregistrationRequest = {}));\nvar ResourceOperationKind;\n(function (ResourceOperationKind) {\n /**\n * Supports creating new files and folders.\n */\n ResourceOperationKind.Create = 'create';\n /**\n * Supports renaming existing files and folders.\n */\n ResourceOperationKind.Rename = 'rename';\n /**\n * Supports deleting existing files and folders.\n */\n ResourceOperationKind.Delete = 'delete';\n})(ResourceOperationKind || (exports.ResourceOperationKind = ResourceOperationKind = {}));\nvar FailureHandlingKind;\n(function (FailureHandlingKind) {\n /**\n * Applying the workspace change is simply aborted if one of the changes provided\n * fails. All operations executed before the failing operation stay executed.\n */\n FailureHandlingKind.Abort = 'abort';\n /**\n * All operations are executed transactional. That means they either all\n * succeed or no changes at all are applied to the workspace.\n */\n FailureHandlingKind.Transactional = 'transactional';\n /**\n * If the workspace edit contains only textual file changes they are executed transactional.\n * If resource changes (create, rename or delete file) are part of the change the failure\n * handling strategy is abort.\n */\n FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional';\n /**\n * The client tries to undo the operations already executed. But there is no\n * guarantee that this is succeeding.\n */\n FailureHandlingKind.Undo = 'undo';\n})(FailureHandlingKind || (exports.FailureHandlingKind = FailureHandlingKind = {}));\n/**\n * A set of predefined position encoding kinds.\n *\n * @since 3.17.0\n */\nvar PositionEncodingKind;\n(function (PositionEncodingKind) {\n /**\n * Character offsets count UTF-8 code units (e.g. bytes).\n */\n PositionEncodingKind.UTF8 = 'utf-8';\n /**\n * Character offsets count UTF-16 code units.\n *\n * This is the default and must always be supported\n * by servers\n */\n PositionEncodingKind.UTF16 = 'utf-16';\n /**\n * Character offsets count UTF-32 code units.\n *\n * Implementation note: these are the same as Unicode codepoints,\n * so this `PositionEncodingKind` may also be used for an\n * encoding-agnostic representation of character offsets.\n */\n PositionEncodingKind.UTF32 = 'utf-32';\n})(PositionEncodingKind || (exports.PositionEncodingKind = PositionEncodingKind = {}));\n/**\n * The StaticRegistrationOptions namespace provides helper functions to work with\n * {@link StaticRegistrationOptions} literals.\n */\nvar StaticRegistrationOptions;\n(function (StaticRegistrationOptions) {\n function hasId(value) {\n const candidate = value;\n return candidate && Is.string(candidate.id) && candidate.id.length > 0;\n }\n StaticRegistrationOptions.hasId = hasId;\n})(StaticRegistrationOptions || (exports.StaticRegistrationOptions = StaticRegistrationOptions = {}));\n/**\n * The TextDocumentRegistrationOptions namespace provides helper functions to work with\n * {@link TextDocumentRegistrationOptions} literals.\n */\nvar TextDocumentRegistrationOptions;\n(function (TextDocumentRegistrationOptions) {\n function is(value) {\n const candidate = value;\n return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector));\n }\n TextDocumentRegistrationOptions.is = is;\n})(TextDocumentRegistrationOptions || (exports.TextDocumentRegistrationOptions = TextDocumentRegistrationOptions = {}));\n/**\n * The WorkDoneProgressOptions namespace provides helper functions to work with\n * {@link WorkDoneProgressOptions} literals.\n */\nvar WorkDoneProgressOptions;\n(function (WorkDoneProgressOptions) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && (candidate.workDoneProgress === undefined || Is.boolean(candidate.workDoneProgress));\n }\n WorkDoneProgressOptions.is = is;\n function hasWorkDoneProgress(value) {\n const candidate = value;\n return candidate && Is.boolean(candidate.workDoneProgress);\n }\n WorkDoneProgressOptions.hasWorkDoneProgress = hasWorkDoneProgress;\n})(WorkDoneProgressOptions || (exports.WorkDoneProgressOptions = WorkDoneProgressOptions = {}));\n/**\n * The initialize request is sent from the client to the server.\n * It is sent once as the request after starting up the server.\n * The requests parameter is of type {@link InitializeParams}\n * the response if of type {@link InitializeResult} of a Thenable that\n * resolves to such.\n */\nvar InitializeRequest;\n(function (InitializeRequest) {\n InitializeRequest.method = 'initialize';\n InitializeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InitializeRequest.type = new messages_1.ProtocolRequestType(InitializeRequest.method);\n})(InitializeRequest || (exports.InitializeRequest = InitializeRequest = {}));\n/**\n * Known error codes for an `InitializeErrorCodes`;\n */\nvar InitializeErrorCodes;\n(function (InitializeErrorCodes) {\n /**\n * If the protocol version provided by the client can't be handled by the server.\n *\n * @deprecated This initialize error got replaced by client capabilities. There is\n * no version handshake in version 3.0x\n */\n InitializeErrorCodes.unknownProtocolVersion = 1;\n})(InitializeErrorCodes || (exports.InitializeErrorCodes = InitializeErrorCodes = {}));\n/**\n * The initialized notification is sent from the client to the\n * server after the client is fully initialized and the server\n * is allowed to send requests from the server to the client.\n */\nvar InitializedNotification;\n(function (InitializedNotification) {\n InitializedNotification.method = 'initialized';\n InitializedNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n InitializedNotification.type = new messages_1.ProtocolNotificationType(InitializedNotification.method);\n})(InitializedNotification || (exports.InitializedNotification = InitializedNotification = {}));\n//---- Shutdown Method ----\n/**\n * A shutdown request is sent from the client to the server.\n * It is sent once when the client decides to shutdown the\n * server. The only notification that is sent after a shutdown request\n * is the exit event.\n */\nvar ShutdownRequest;\n(function (ShutdownRequest) {\n ShutdownRequest.method = 'shutdown';\n ShutdownRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ShutdownRequest.type = new messages_1.ProtocolRequestType0(ShutdownRequest.method);\n})(ShutdownRequest || (exports.ShutdownRequest = ShutdownRequest = {}));\n//---- Exit Notification ----\n/**\n * The exit event is sent from the client to the server to\n * ask the server to exit its process.\n */\nvar ExitNotification;\n(function (ExitNotification) {\n ExitNotification.method = 'exit';\n ExitNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n ExitNotification.type = new messages_1.ProtocolNotificationType0(ExitNotification.method);\n})(ExitNotification || (exports.ExitNotification = ExitNotification = {}));\n/**\n * The configuration change notification is sent from the client to the server\n * when the client's configuration has changed. The notification contains\n * the changed configuration as defined by the language client.\n */\nvar DidChangeConfigurationNotification;\n(function (DidChangeConfigurationNotification) {\n DidChangeConfigurationNotification.method = 'workspace/didChangeConfiguration';\n DidChangeConfigurationNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeConfigurationNotification.type = new messages_1.ProtocolNotificationType(DidChangeConfigurationNotification.method);\n})(DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = DidChangeConfigurationNotification = {}));\n//---- Message show and log notifications ----\n/**\n * The message type\n */\nvar MessageType;\n(function (MessageType) {\n /**\n * An error message.\n */\n MessageType.Error = 1;\n /**\n * A warning message.\n */\n MessageType.Warning = 2;\n /**\n * An information message.\n */\n MessageType.Info = 3;\n /**\n * A log message.\n */\n MessageType.Log = 4;\n /**\n * A debug message.\n *\n * @since 3.18.0\n */\n MessageType.Debug = 5;\n})(MessageType || (exports.MessageType = MessageType = {}));\n/**\n * The show message notification is sent from a server to a client to ask\n * the client to display a particular message in the user interface.\n */\nvar ShowMessageNotification;\n(function (ShowMessageNotification) {\n ShowMessageNotification.method = 'window/showMessage';\n ShowMessageNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n ShowMessageNotification.type = new messages_1.ProtocolNotificationType(ShowMessageNotification.method);\n})(ShowMessageNotification || (exports.ShowMessageNotification = ShowMessageNotification = {}));\n/**\n * The show message request is sent from the server to the client to show a message\n * and a set of options actions to the user.\n */\nvar ShowMessageRequest;\n(function (ShowMessageRequest) {\n ShowMessageRequest.method = 'window/showMessageRequest';\n ShowMessageRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ShowMessageRequest.type = new messages_1.ProtocolRequestType(ShowMessageRequest.method);\n})(ShowMessageRequest || (exports.ShowMessageRequest = ShowMessageRequest = {}));\n/**\n * The log message notification is sent from the server to the client to ask\n * the client to log a particular message.\n */\nvar LogMessageNotification;\n(function (LogMessageNotification) {\n LogMessageNotification.method = 'window/logMessage';\n LogMessageNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n LogMessageNotification.type = new messages_1.ProtocolNotificationType(LogMessageNotification.method);\n})(LogMessageNotification || (exports.LogMessageNotification = LogMessageNotification = {}));\n//---- Telemetry notification\n/**\n * The telemetry event notification is sent from the server to the client to ask\n * the client to log telemetry data.\n */\nvar TelemetryEventNotification;\n(function (TelemetryEventNotification) {\n TelemetryEventNotification.method = 'telemetry/event';\n TelemetryEventNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n TelemetryEventNotification.type = new messages_1.ProtocolNotificationType(TelemetryEventNotification.method);\n})(TelemetryEventNotification || (exports.TelemetryEventNotification = TelemetryEventNotification = {}));\n/**\n * Defines how the host (editor) should sync\n * document changes to the language server.\n */\nvar TextDocumentSyncKind;\n(function (TextDocumentSyncKind) {\n /**\n * Documents should not be synced at all.\n */\n TextDocumentSyncKind.None = 0;\n /**\n * Documents are synced by always sending the full content\n * of the document.\n */\n TextDocumentSyncKind.Full = 1;\n /**\n * Documents are synced by sending the full content on open.\n * After that only incremental updates to the document are\n * send.\n */\n TextDocumentSyncKind.Incremental = 2;\n})(TextDocumentSyncKind || (exports.TextDocumentSyncKind = TextDocumentSyncKind = {}));\n/**\n * The document open notification is sent from the client to the server to signal\n * newly opened text documents. The document's truth is now managed by the client\n * and the server must not try to read the document's truth using the document's\n * uri. Open in this sense means it is managed by the client. It doesn't necessarily\n * mean that its content is presented in an editor. An open notification must not\n * be sent more than once without a corresponding close notification send before.\n * This means open and close notification must be balanced and the max open count\n * is one.\n */\nvar DidOpenTextDocumentNotification;\n(function (DidOpenTextDocumentNotification) {\n DidOpenTextDocumentNotification.method = 'textDocument/didOpen';\n DidOpenTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidOpenTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification.method);\n})(DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = DidOpenTextDocumentNotification = {}));\nvar TextDocumentContentChangeEvent;\n(function (TextDocumentContentChangeEvent) {\n /**\n * Checks whether the information describes a delta event.\n */\n function isIncremental(event) {\n let candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range !== undefined &&\n (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number');\n }\n TextDocumentContentChangeEvent.isIncremental = isIncremental;\n /**\n * Checks whether the information describes a full replacement event.\n */\n function isFull(event) {\n let candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined;\n }\n TextDocumentContentChangeEvent.isFull = isFull;\n})(TextDocumentContentChangeEvent || (exports.TextDocumentContentChangeEvent = TextDocumentContentChangeEvent = {}));\n/**\n * The document change notification is sent from the client to the server to signal\n * changes to a text document.\n */\nvar DidChangeTextDocumentNotification;\n(function (DidChangeTextDocumentNotification) {\n DidChangeTextDocumentNotification.method = 'textDocument/didChange';\n DidChangeTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification.method);\n})(DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = DidChangeTextDocumentNotification = {}));\n/**\n * The document close notification is sent from the client to the server when\n * the document got closed in the client. The document's truth now exists where\n * the document's uri points to (e.g. if the document's uri is a file uri the\n * truth now exists on disk). As with the open notification the close notification\n * is about managing the document's content. Receiving a close notification\n * doesn't mean that the document was open in an editor before. A close\n * notification requires a previous open notification to be sent.\n */\nvar DidCloseTextDocumentNotification;\n(function (DidCloseTextDocumentNotification) {\n DidCloseTextDocumentNotification.method = 'textDocument/didClose';\n DidCloseTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidCloseTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification.method);\n})(DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = DidCloseTextDocumentNotification = {}));\n/**\n * The document save notification is sent from the client to the server when\n * the document got saved in the client.\n */\nvar DidSaveTextDocumentNotification;\n(function (DidSaveTextDocumentNotification) {\n DidSaveTextDocumentNotification.method = 'textDocument/didSave';\n DidSaveTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification.method);\n})(DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = DidSaveTextDocumentNotification = {}));\n/**\n * Represents reasons why a text document is saved.\n */\nvar TextDocumentSaveReason;\n(function (TextDocumentSaveReason) {\n /**\n * Manually triggered, e.g. by the user pressing save, by starting debugging,\n * or by an API call.\n */\n TextDocumentSaveReason.Manual = 1;\n /**\n * Automatic after a delay.\n */\n TextDocumentSaveReason.AfterDelay = 2;\n /**\n * When the editor lost focus.\n */\n TextDocumentSaveReason.FocusOut = 3;\n})(TextDocumentSaveReason || (exports.TextDocumentSaveReason = TextDocumentSaveReason = {}));\n/**\n * A document will save notification is sent from the client to the server before\n * the document is actually saved.\n */\nvar WillSaveTextDocumentNotification;\n(function (WillSaveTextDocumentNotification) {\n WillSaveTextDocumentNotification.method = 'textDocument/willSave';\n WillSaveTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n WillSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification.method);\n})(WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = WillSaveTextDocumentNotification = {}));\n/**\n * A document will save request is sent from the client to the server before\n * the document is actually saved. The request can return an array of TextEdits\n * which will be applied to the text document before it is saved. Please note that\n * clients might drop results if computing the text edits took too long or if a\n * server constantly fails on this request. This is done to keep the save fast and\n * reliable.\n */\nvar WillSaveTextDocumentWaitUntilRequest;\n(function (WillSaveTextDocumentWaitUntilRequest) {\n WillSaveTextDocumentWaitUntilRequest.method = 'textDocument/willSaveWaitUntil';\n WillSaveTextDocumentWaitUntilRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillSaveTextDocumentWaitUntilRequest.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest.method);\n})(WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = WillSaveTextDocumentWaitUntilRequest = {}));\n/**\n * The watched files notification is sent from the client to the server when\n * the client detects changes to file watched by the language client.\n */\nvar DidChangeWatchedFilesNotification;\n(function (DidChangeWatchedFilesNotification) {\n DidChangeWatchedFilesNotification.method = 'workspace/didChangeWatchedFiles';\n DidChangeWatchedFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeWatchedFilesNotification.type = new messages_1.ProtocolNotificationType(DidChangeWatchedFilesNotification.method);\n})(DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = DidChangeWatchedFilesNotification = {}));\n/**\n * The file event type\n */\nvar FileChangeType;\n(function (FileChangeType) {\n /**\n * The file got created.\n */\n FileChangeType.Created = 1;\n /**\n * The file got changed.\n */\n FileChangeType.Changed = 2;\n /**\n * The file got deleted.\n */\n FileChangeType.Deleted = 3;\n})(FileChangeType || (exports.FileChangeType = FileChangeType = {}));\nvar RelativePattern;\n(function (RelativePattern) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && (vscode_languageserver_types_1.URI.is(candidate.baseUri) || vscode_languageserver_types_1.WorkspaceFolder.is(candidate.baseUri)) && Is.string(candidate.pattern);\n }\n RelativePattern.is = is;\n})(RelativePattern || (exports.RelativePattern = RelativePattern = {}));\nvar WatchKind;\n(function (WatchKind) {\n /**\n * Interested in create events.\n */\n WatchKind.Create = 1;\n /**\n * Interested in change events\n */\n WatchKind.Change = 2;\n /**\n * Interested in delete events\n */\n WatchKind.Delete = 4;\n})(WatchKind || (exports.WatchKind = WatchKind = {}));\n/**\n * Diagnostics notification are sent from the server to the client to signal\n * results of validation runs.\n */\nvar PublishDiagnosticsNotification;\n(function (PublishDiagnosticsNotification) {\n PublishDiagnosticsNotification.method = 'textDocument/publishDiagnostics';\n PublishDiagnosticsNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n PublishDiagnosticsNotification.type = new messages_1.ProtocolNotificationType(PublishDiagnosticsNotification.method);\n})(PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = PublishDiagnosticsNotification = {}));\n/**\n * How a completion was triggered\n */\nvar CompletionTriggerKind;\n(function (CompletionTriggerKind) {\n /**\n * Completion was triggered by typing an identifier (24x7 code\n * complete), manual invocation (e.g Ctrl+Space) or via API.\n */\n CompletionTriggerKind.Invoked = 1;\n /**\n * Completion was triggered by a trigger character specified by\n * the `triggerCharacters` properties of the `CompletionRegistrationOptions`.\n */\n CompletionTriggerKind.TriggerCharacter = 2;\n /**\n * Completion was re-triggered as current completion list is incomplete\n */\n CompletionTriggerKind.TriggerForIncompleteCompletions = 3;\n})(CompletionTriggerKind || (exports.CompletionTriggerKind = CompletionTriggerKind = {}));\n/**\n * Request to request completion at a given text document position. The request's\n * parameter is of type {@link TextDocumentPosition} the response\n * is of type {@link CompletionItem CompletionItem[]} or {@link CompletionList}\n * or a Thenable that resolves to such.\n *\n * The request can delay the computation of the {@link CompletionItem.detail `detail`}\n * and {@link CompletionItem.documentation `documentation`} properties to the `completionItem/resolve`\n * request. However, properties that are needed for the initial sorting and filtering, like `sortText`,\n * `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.\n */\nvar CompletionRequest;\n(function (CompletionRequest) {\n CompletionRequest.method = 'textDocument/completion';\n CompletionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CompletionRequest.type = new messages_1.ProtocolRequestType(CompletionRequest.method);\n})(CompletionRequest || (exports.CompletionRequest = CompletionRequest = {}));\n/**\n * Request to resolve additional information for a given completion item.The request's\n * parameter is of type {@link CompletionItem} the response\n * is of type {@link CompletionItem} or a Thenable that resolves to such.\n */\nvar CompletionResolveRequest;\n(function (CompletionResolveRequest) {\n CompletionResolveRequest.method = 'completionItem/resolve';\n CompletionResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CompletionResolveRequest.type = new messages_1.ProtocolRequestType(CompletionResolveRequest.method);\n})(CompletionResolveRequest || (exports.CompletionResolveRequest = CompletionResolveRequest = {}));\n/**\n * Request to request hover information at a given text document position. The request's\n * parameter is of type {@link TextDocumentPosition} the response is of\n * type {@link Hover} or a Thenable that resolves to such.\n */\nvar HoverRequest;\n(function (HoverRequest) {\n HoverRequest.method = 'textDocument/hover';\n HoverRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n HoverRequest.type = new messages_1.ProtocolRequestType(HoverRequest.method);\n})(HoverRequest || (exports.HoverRequest = HoverRequest = {}));\n/**\n * How a signature help was triggered.\n *\n * @since 3.15.0\n */\nvar SignatureHelpTriggerKind;\n(function (SignatureHelpTriggerKind) {\n /**\n * Signature help was invoked manually by the user or by a command.\n */\n SignatureHelpTriggerKind.Invoked = 1;\n /**\n * Signature help was triggered by a trigger character.\n */\n SignatureHelpTriggerKind.TriggerCharacter = 2;\n /**\n * Signature help was triggered by the cursor moving or by the document content changing.\n */\n SignatureHelpTriggerKind.ContentChange = 3;\n})(SignatureHelpTriggerKind || (exports.SignatureHelpTriggerKind = SignatureHelpTriggerKind = {}));\nvar SignatureHelpRequest;\n(function (SignatureHelpRequest) {\n SignatureHelpRequest.method = 'textDocument/signatureHelp';\n SignatureHelpRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SignatureHelpRequest.type = new messages_1.ProtocolRequestType(SignatureHelpRequest.method);\n})(SignatureHelpRequest || (exports.SignatureHelpRequest = SignatureHelpRequest = {}));\n/**\n * A request to resolve the definition location of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPosition}\n * the response is of either type {@link Definition} or a typed array of\n * {@link DefinitionLink} or a Thenable that resolves to such.\n */\nvar DefinitionRequest;\n(function (DefinitionRequest) {\n DefinitionRequest.method = 'textDocument/definition';\n DefinitionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DefinitionRequest.type = new messages_1.ProtocolRequestType(DefinitionRequest.method);\n})(DefinitionRequest || (exports.DefinitionRequest = DefinitionRequest = {}));\n/**\n * A request to resolve project-wide references for the symbol denoted\n * by the given text document position. The request's parameter is of\n * type {@link ReferenceParams} the response is of type\n * {@link Location Location[]} or a Thenable that resolves to such.\n */\nvar ReferencesRequest;\n(function (ReferencesRequest) {\n ReferencesRequest.method = 'textDocument/references';\n ReferencesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ReferencesRequest.type = new messages_1.ProtocolRequestType(ReferencesRequest.method);\n})(ReferencesRequest || (exports.ReferencesRequest = ReferencesRequest = {}));\n/**\n * Request to resolve a {@link DocumentHighlight} for a given\n * text document position. The request's parameter is of type {@link TextDocumentPosition}\n * the request response is an array of type {@link DocumentHighlight}\n * or a Thenable that resolves to such.\n */\nvar DocumentHighlightRequest;\n(function (DocumentHighlightRequest) {\n DocumentHighlightRequest.method = 'textDocument/documentHighlight';\n DocumentHighlightRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentHighlightRequest.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest.method);\n})(DocumentHighlightRequest || (exports.DocumentHighlightRequest = DocumentHighlightRequest = {}));\n/**\n * A request to list all symbols found in a given text document. The request's\n * parameter is of type {@link TextDocumentIdentifier} the\n * response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable\n * that resolves to such.\n */\nvar DocumentSymbolRequest;\n(function (DocumentSymbolRequest) {\n DocumentSymbolRequest.method = 'textDocument/documentSymbol';\n DocumentSymbolRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentSymbolRequest.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest.method);\n})(DocumentSymbolRequest || (exports.DocumentSymbolRequest = DocumentSymbolRequest = {}));\n/**\n * A request to provide commands for the given text document and range.\n */\nvar CodeActionRequest;\n(function (CodeActionRequest) {\n CodeActionRequest.method = 'textDocument/codeAction';\n CodeActionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeActionRequest.type = new messages_1.ProtocolRequestType(CodeActionRequest.method);\n})(CodeActionRequest || (exports.CodeActionRequest = CodeActionRequest = {}));\n/**\n * Request to resolve additional information for a given code action.The request's\n * parameter is of type {@link CodeAction} the response\n * is of type {@link CodeAction} or a Thenable that resolves to such.\n */\nvar CodeActionResolveRequest;\n(function (CodeActionResolveRequest) {\n CodeActionResolveRequest.method = 'codeAction/resolve';\n CodeActionResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeActionResolveRequest.type = new messages_1.ProtocolRequestType(CodeActionResolveRequest.method);\n})(CodeActionResolveRequest || (exports.CodeActionResolveRequest = CodeActionResolveRequest = {}));\n/**\n * A request to list project-wide symbols matching the query string given\n * by the {@link WorkspaceSymbolParams}. The response is\n * of type {@link SymbolInformation SymbolInformation[]} or a Thenable that\n * resolves to such.\n *\n * @since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients\n * need to advertise support for WorkspaceSymbols via the client capability\n * `workspace.symbol.resolveSupport`.\n *\n */\nvar WorkspaceSymbolRequest;\n(function (WorkspaceSymbolRequest) {\n WorkspaceSymbolRequest.method = 'workspace/symbol';\n WorkspaceSymbolRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkspaceSymbolRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest.method);\n})(WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = WorkspaceSymbolRequest = {}));\n/**\n * A request to resolve the range inside the workspace\n * symbol's location.\n *\n * @since 3.17.0\n */\nvar WorkspaceSymbolResolveRequest;\n(function (WorkspaceSymbolResolveRequest) {\n WorkspaceSymbolResolveRequest.method = 'workspaceSymbol/resolve';\n WorkspaceSymbolResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkspaceSymbolResolveRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolResolveRequest.method);\n})(WorkspaceSymbolResolveRequest || (exports.WorkspaceSymbolResolveRequest = WorkspaceSymbolResolveRequest = {}));\n/**\n * A request to provide code lens for the given text document.\n */\nvar CodeLensRequest;\n(function (CodeLensRequest) {\n CodeLensRequest.method = 'textDocument/codeLens';\n CodeLensRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeLensRequest.type = new messages_1.ProtocolRequestType(CodeLensRequest.method);\n})(CodeLensRequest || (exports.CodeLensRequest = CodeLensRequest = {}));\n/**\n * A request to resolve a command for a given code lens.\n */\nvar CodeLensResolveRequest;\n(function (CodeLensResolveRequest) {\n CodeLensResolveRequest.method = 'codeLens/resolve';\n CodeLensResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeLensResolveRequest.type = new messages_1.ProtocolRequestType(CodeLensResolveRequest.method);\n})(CodeLensResolveRequest || (exports.CodeLensResolveRequest = CodeLensResolveRequest = {}));\n/**\n * A request to refresh all code actions\n *\n * @since 3.16.0\n */\nvar CodeLensRefreshRequest;\n(function (CodeLensRefreshRequest) {\n CodeLensRefreshRequest.method = `workspace/codeLens/refresh`;\n CodeLensRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n CodeLensRefreshRequest.type = new messages_1.ProtocolRequestType0(CodeLensRefreshRequest.method);\n})(CodeLensRefreshRequest || (exports.CodeLensRefreshRequest = CodeLensRefreshRequest = {}));\n/**\n * A request to provide document links\n */\nvar DocumentLinkRequest;\n(function (DocumentLinkRequest) {\n DocumentLinkRequest.method = 'textDocument/documentLink';\n DocumentLinkRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentLinkRequest.type = new messages_1.ProtocolRequestType(DocumentLinkRequest.method);\n})(DocumentLinkRequest || (exports.DocumentLinkRequest = DocumentLinkRequest = {}));\n/**\n * Request to resolve additional information for a given document link. The request's\n * parameter is of type {@link DocumentLink} the response\n * is of type {@link DocumentLink} or a Thenable that resolves to such.\n */\nvar DocumentLinkResolveRequest;\n(function (DocumentLinkResolveRequest) {\n DocumentLinkResolveRequest.method = 'documentLink/resolve';\n DocumentLinkResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentLinkResolveRequest.type = new messages_1.ProtocolRequestType(DocumentLinkResolveRequest.method);\n})(DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = DocumentLinkResolveRequest = {}));\n/**\n * A request to format a whole document.\n */\nvar DocumentFormattingRequest;\n(function (DocumentFormattingRequest) {\n DocumentFormattingRequest.method = 'textDocument/formatting';\n DocumentFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest.method);\n})(DocumentFormattingRequest || (exports.DocumentFormattingRequest = DocumentFormattingRequest = {}));\n/**\n * A request to format a range in a document.\n */\nvar DocumentRangeFormattingRequest;\n(function (DocumentRangeFormattingRequest) {\n DocumentRangeFormattingRequest.method = 'textDocument/rangeFormatting';\n DocumentRangeFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentRangeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest.method);\n})(DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = DocumentRangeFormattingRequest = {}));\n/**\n * A request to format ranges in a document.\n *\n * @since 3.18.0\n * @proposed\n */\nvar DocumentRangesFormattingRequest;\n(function (DocumentRangesFormattingRequest) {\n DocumentRangesFormattingRequest.method = 'textDocument/rangesFormatting';\n DocumentRangesFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentRangesFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangesFormattingRequest.method);\n})(DocumentRangesFormattingRequest || (exports.DocumentRangesFormattingRequest = DocumentRangesFormattingRequest = {}));\n/**\n * A request to format a document on type.\n */\nvar DocumentOnTypeFormattingRequest;\n(function (DocumentOnTypeFormattingRequest) {\n DocumentOnTypeFormattingRequest.method = 'textDocument/onTypeFormatting';\n DocumentOnTypeFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentOnTypeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest.method);\n})(DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = DocumentOnTypeFormattingRequest = {}));\n//---- Rename ----------------------------------------------\nvar PrepareSupportDefaultBehavior;\n(function (PrepareSupportDefaultBehavior) {\n /**\n * The client's default behavior is to select the identifier\n * according the to language's syntax rule.\n */\n PrepareSupportDefaultBehavior.Identifier = 1;\n})(PrepareSupportDefaultBehavior || (exports.PrepareSupportDefaultBehavior = PrepareSupportDefaultBehavior = {}));\n/**\n * A request to rename a symbol.\n */\nvar RenameRequest;\n(function (RenameRequest) {\n RenameRequest.method = 'textDocument/rename';\n RenameRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n RenameRequest.type = new messages_1.ProtocolRequestType(RenameRequest.method);\n})(RenameRequest || (exports.RenameRequest = RenameRequest = {}));\n/**\n * A request to test and perform the setup necessary for a rename.\n *\n * @since 3.16 - support for default behavior\n */\nvar PrepareRenameRequest;\n(function (PrepareRenameRequest) {\n PrepareRenameRequest.method = 'textDocument/prepareRename';\n PrepareRenameRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n PrepareRenameRequest.type = new messages_1.ProtocolRequestType(PrepareRenameRequest.method);\n})(PrepareRenameRequest || (exports.PrepareRenameRequest = PrepareRenameRequest = {}));\n/**\n * A request send from the client to the server to execute a command. The request might return\n * a workspace edit which the client will apply to the workspace.\n */\nvar ExecuteCommandRequest;\n(function (ExecuteCommandRequest) {\n ExecuteCommandRequest.method = 'workspace/executeCommand';\n ExecuteCommandRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ExecuteCommandRequest.type = new messages_1.ProtocolRequestType(ExecuteCommandRequest.method);\n})(ExecuteCommandRequest || (exports.ExecuteCommandRequest = ExecuteCommandRequest = {}));\n/**\n * A request sent from the server to the client to modified certain resources.\n */\nvar ApplyWorkspaceEditRequest;\n(function (ApplyWorkspaceEditRequest) {\n ApplyWorkspaceEditRequest.method = 'workspace/applyEdit';\n ApplyWorkspaceEditRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ApplyWorkspaceEditRequest.type = new messages_1.ProtocolRequestType('workspace/applyEdit');\n})(ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = ApplyWorkspaceEditRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createProtocolConnection = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nfunction createProtocolConnection(input, output, logger, options) {\n if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) {\n options = { connectionStrategy: options };\n }\n return (0, vscode_jsonrpc_1.createMessageConnection)(input, output, logger, options);\n}\nexports.createProtocolConnection = createProtocolConnection;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LSPErrorCodes = exports.createProtocolConnection = void 0;\n__exportStar(require(\"vscode-jsonrpc\"), exports);\n__exportStar(require(\"vscode-languageserver-types\"), exports);\n__exportStar(require(\"./messages\"), exports);\n__exportStar(require(\"./protocol\"), exports);\nvar connection_1 = require(\"./connection\");\nObject.defineProperty(exports, \"createProtocolConnection\", { enumerable: true, get: function () { return connection_1.createProtocolConnection; } });\nvar LSPErrorCodes;\n(function (LSPErrorCodes) {\n /**\n * This is the start range of LSP reserved error codes.\n * It doesn't denote a real error code.\n *\n * @since 3.16.0\n */\n LSPErrorCodes.lspReservedErrorRangeStart = -32899;\n /**\n * A request failed but it was syntactically correct, e.g the\n * method name was known and the parameters were valid. The error\n * message should contain human readable information about why\n * the request failed.\n *\n * @since 3.17.0\n */\n LSPErrorCodes.RequestFailed = -32803;\n /**\n * The server cancelled the request. This error code should\n * only be used for requests that explicitly support being\n * server cancellable.\n *\n * @since 3.17.0\n */\n LSPErrorCodes.ServerCancelled = -32802;\n /**\n * The server detected that the content of a document got\n * modified outside normal conditions. A server should\n * NOT send this error code if it detects a content change\n * in it unprocessed messages. The result even computed\n * on an older state might still be useful for the client.\n *\n * If a client decides that a result is not of any use anymore\n * the client should cancel the request.\n */\n LSPErrorCodes.ContentModified = -32801;\n /**\n * The client has canceled a request and a server as detected\n * the cancel.\n */\n LSPErrorCodes.RequestCancelled = -32800;\n /**\n * This is the end range of LSP reserved error codes.\n * It doesn't denote a real error code.\n *\n * @since 3.16.0\n */\n LSPErrorCodes.lspReservedErrorRangeEnd = -32800;\n})(LSPErrorCodes || (exports.LSPErrorCodes = LSPErrorCodes = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createProtocolConnection = void 0;\nconst node_1 = require(\"vscode-jsonrpc/node\");\n__exportStar(require(\"vscode-jsonrpc/node\"), exports);\n__exportStar(require(\"../common/api\"), exports);\nfunction createProtocolConnection(input, output, logger, options) {\n return (0, node_1.createMessageConnection)(input, output, logger, options);\n}\nexports.createProtocolConnection = createProtocolConnection;\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateUuid = exports.parse = exports.isUUID = exports.v4 = exports.empty = void 0;\nclass ValueUUID {\n constructor(_value) {\n this._value = _value;\n // empty\n }\n asHex() {\n return this._value;\n }\n equals(other) {\n return this.asHex() === other.asHex();\n }\n}\nclass V4UUID extends ValueUUID {\n static _oneOf(array) {\n return array[Math.floor(array.length * Math.random())];\n }\n static _randomHex() {\n return V4UUID._oneOf(V4UUID._chars);\n }\n constructor() {\n super([\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n '4',\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n V4UUID._oneOf(V4UUID._timeHighBits),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n ].join(''));\n }\n}\nV4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];\nV4UUID._timeHighBits = ['8', '9', 'a', 'b'];\n/**\n * An empty UUID that contains only zeros.\n */\nexports.empty = new ValueUUID('00000000-0000-0000-0000-000000000000');\nfunction v4() {\n return new V4UUID();\n}\nexports.v4 = v4;\nconst _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nfunction isUUID(value) {\n return _UUIDPattern.test(value);\n}\nexports.isUUID = isUUID;\n/**\n * Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.\n * @param value A uuid string.\n */\nfunction parse(value) {\n if (!isUUID(value)) {\n throw new Error('invalid uuid');\n }\n return new ValueUUID(value);\n}\nexports.parse = parse;\nfunction generateUuid() {\n return v4().asHex();\n}\nexports.generateUuid = generateUuid;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.attachPartialResult = exports.ProgressFeature = exports.attachWorkDone = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst uuid_1 = require(\"./utils/uuid\");\nclass WorkDoneProgressReporterImpl {\n constructor(_connection, _token) {\n this._connection = _connection;\n this._token = _token;\n WorkDoneProgressReporterImpl.Instances.set(this._token, this);\n }\n begin(title, percentage, message, cancellable) {\n let param = {\n kind: 'begin',\n title,\n percentage,\n message,\n cancellable\n };\n this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, param);\n }\n report(arg0, arg1) {\n let param = {\n kind: 'report'\n };\n if (typeof arg0 === 'number') {\n param.percentage = arg0;\n if (arg1 !== undefined) {\n param.message = arg1;\n }\n }\n else {\n param.message = arg0;\n }\n this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, param);\n }\n done() {\n WorkDoneProgressReporterImpl.Instances.delete(this._token);\n this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, { kind: 'end' });\n }\n}\nWorkDoneProgressReporterImpl.Instances = new Map();\nclass WorkDoneProgressServerReporterImpl extends WorkDoneProgressReporterImpl {\n constructor(connection, token) {\n super(connection, token);\n this._source = new vscode_languageserver_protocol_1.CancellationTokenSource();\n }\n get token() {\n return this._source.token;\n }\n done() {\n this._source.dispose();\n super.done();\n }\n cancel() {\n this._source.cancel();\n }\n}\nclass NullProgressReporter {\n constructor() {\n }\n begin() {\n }\n report() {\n }\n done() {\n }\n}\nclass NullProgressServerReporter extends NullProgressReporter {\n constructor() {\n super();\n this._source = new vscode_languageserver_protocol_1.CancellationTokenSource();\n }\n get token() {\n return this._source.token;\n }\n done() {\n this._source.dispose();\n }\n cancel() {\n this._source.cancel();\n }\n}\nfunction attachWorkDone(connection, params) {\n if (params === undefined || params.workDoneToken === undefined) {\n return new NullProgressReporter();\n }\n const token = params.workDoneToken;\n delete params.workDoneToken;\n return new WorkDoneProgressReporterImpl(connection, token);\n}\nexports.attachWorkDone = attachWorkDone;\nconst ProgressFeature = (Base) => {\n return class extends Base {\n constructor() {\n super();\n this._progressSupported = false;\n }\n initialize(capabilities) {\n super.initialize(capabilities);\n if (capabilities?.window?.workDoneProgress === true) {\n this._progressSupported = true;\n this.connection.onNotification(vscode_languageserver_protocol_1.WorkDoneProgressCancelNotification.type, (params) => {\n let progress = WorkDoneProgressReporterImpl.Instances.get(params.token);\n if (progress instanceof WorkDoneProgressServerReporterImpl || progress instanceof NullProgressServerReporter) {\n progress.cancel();\n }\n });\n }\n }\n attachWorkDoneProgress(token) {\n if (token === undefined) {\n return new NullProgressReporter();\n }\n else {\n return new WorkDoneProgressReporterImpl(this.connection, token);\n }\n }\n createWorkDoneProgress() {\n if (this._progressSupported) {\n const token = (0, uuid_1.generateUuid)();\n return this.connection.sendRequest(vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.type, { token }).then(() => {\n const result = new WorkDoneProgressServerReporterImpl(this.connection, token);\n return result;\n });\n }\n else {\n return Promise.resolve(new NullProgressServerReporter());\n }\n }\n };\n};\nexports.ProgressFeature = ProgressFeature;\nvar ResultProgress;\n(function (ResultProgress) {\n ResultProgress.type = new vscode_languageserver_protocol_1.ProgressType();\n})(ResultProgress || (ResultProgress = {}));\nclass ResultProgressReporterImpl {\n constructor(_connection, _token) {\n this._connection = _connection;\n this._token = _token;\n }\n report(data) {\n this._connection.sendProgress(ResultProgress.type, this._token, data);\n }\n}\nfunction attachPartialResult(connection, params) {\n if (params === undefined || params.partialResultToken === undefined) {\n return undefined;\n }\n const token = params.partialResultToken;\n delete params.partialResultToken;\n return new ResultProgressReporterImpl(connection, token);\n}\nexports.attachPartialResult = attachPartialResult;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConfigurationFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nconst ConfigurationFeature = (Base) => {\n return class extends Base {\n getConfiguration(arg) {\n if (!arg) {\n return this._getConfiguration({});\n }\n else if (Is.string(arg)) {\n return this._getConfiguration({ section: arg });\n }\n else {\n return this._getConfiguration(arg);\n }\n }\n _getConfiguration(arg) {\n let params = {\n items: Array.isArray(arg) ? arg : [arg]\n };\n return this.connection.sendRequest(vscode_languageserver_protocol_1.ConfigurationRequest.type, params).then((result) => {\n if (Array.isArray(result)) {\n return Array.isArray(arg) ? result : result[0];\n }\n else {\n return Array.isArray(arg) ? [] : null;\n }\n });\n }\n };\n};\nexports.ConfigurationFeature = ConfigurationFeature;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkspaceFoldersFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst WorkspaceFoldersFeature = (Base) => {\n return class extends Base {\n constructor() {\n super();\n this._notificationIsAutoRegistered = false;\n }\n initialize(capabilities) {\n super.initialize(capabilities);\n let workspaceCapabilities = capabilities.workspace;\n if (workspaceCapabilities && workspaceCapabilities.workspaceFolders) {\n this._onDidChangeWorkspaceFolders = new vscode_languageserver_protocol_1.Emitter();\n this.connection.onNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, (params) => {\n this._onDidChangeWorkspaceFolders.fire(params.event);\n });\n }\n }\n fillServerCapabilities(capabilities) {\n super.fillServerCapabilities(capabilities);\n const changeNotifications = capabilities.workspace?.workspaceFolders?.changeNotifications;\n this._notificationIsAutoRegistered = changeNotifications === true || typeof changeNotifications === 'string';\n }\n getWorkspaceFolders() {\n return this.connection.sendRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type);\n }\n get onDidChangeWorkspaceFolders() {\n if (!this._onDidChangeWorkspaceFolders) {\n throw new Error('Client doesn\\'t support sending workspace folder change events.');\n }\n if (!this._notificationIsAutoRegistered && !this._unregistration) {\n this._unregistration = this.connection.client.register(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type);\n }\n return this._onDidChangeWorkspaceFolders.event;\n }\n };\n};\nexports.WorkspaceFoldersFeature = WorkspaceFoldersFeature;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CallHierarchyFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst CallHierarchyFeature = (Base) => {\n return class extends Base {\n get callHierarchy() {\n return {\n onPrepare: (handler) => {\n return this.connection.onRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), undefined);\n });\n },\n onIncomingCalls: (handler) => {\n const type = vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type;\n return this.connection.onRequest(type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));\n });\n },\n onOutgoingCalls: (handler) => {\n const type = vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type;\n return this.connection.onRequest(type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));\n });\n }\n };\n }\n };\n};\nexports.CallHierarchyFeature = CallHierarchyFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SemanticTokensBuilder = exports.SemanticTokensDiff = exports.SemanticTokensFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst SemanticTokensFeature = (Base) => {\n return class extends Base {\n get semanticTokens() {\n return {\n refresh: () => {\n return this.connection.sendRequest(vscode_languageserver_protocol_1.SemanticTokensRefreshRequest.type);\n },\n on: (handler) => {\n const type = vscode_languageserver_protocol_1.SemanticTokensRequest.type;\n return this.connection.onRequest(type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));\n });\n },\n onDelta: (handler) => {\n const type = vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type;\n return this.connection.onRequest(type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));\n });\n },\n onRange: (handler) => {\n const type = vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type;\n return this.connection.onRequest(type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));\n });\n }\n };\n }\n };\n};\nexports.SemanticTokensFeature = SemanticTokensFeature;\nclass SemanticTokensDiff {\n constructor(originalSequence, modifiedSequence) {\n this.originalSequence = originalSequence;\n this.modifiedSequence = modifiedSequence;\n }\n computeDiff() {\n const originalLength = this.originalSequence.length;\n const modifiedLength = this.modifiedSequence.length;\n let startIndex = 0;\n while (startIndex < modifiedLength && startIndex < originalLength && this.originalSequence[startIndex] === this.modifiedSequence[startIndex]) {\n startIndex++;\n }\n if (startIndex < modifiedLength && startIndex < originalLength) {\n let originalEndIndex = originalLength - 1;\n let modifiedEndIndex = modifiedLength - 1;\n while (originalEndIndex >= startIndex && modifiedEndIndex >= startIndex && this.originalSequence[originalEndIndex] === this.modifiedSequence[modifiedEndIndex]) {\n originalEndIndex--;\n modifiedEndIndex--;\n }\n // if one moved behind the start index move them forward again\n if (originalEndIndex < startIndex || modifiedEndIndex < startIndex) {\n originalEndIndex++;\n modifiedEndIndex++;\n }\n const deleteCount = originalEndIndex - startIndex + 1;\n const newData = this.modifiedSequence.slice(startIndex, modifiedEndIndex + 1);\n // If we moved behind the start index we could have missed a simple delete.\n if (newData.length === 1 && newData[0] === this.originalSequence[originalEndIndex]) {\n return [\n { start: startIndex, deleteCount: deleteCount - 1 }\n ];\n }\n else {\n return [\n { start: startIndex, deleteCount, data: newData }\n ];\n }\n }\n else if (startIndex < modifiedLength) {\n return [\n { start: startIndex, deleteCount: 0, data: this.modifiedSequence.slice(startIndex) }\n ];\n }\n else if (startIndex < originalLength) {\n return [\n { start: startIndex, deleteCount: originalLength - startIndex }\n ];\n }\n else {\n // The two arrays are the same.\n return [];\n }\n }\n}\nexports.SemanticTokensDiff = SemanticTokensDiff;\nclass SemanticTokensBuilder {\n constructor() {\n this._prevData = undefined;\n this.initialize();\n }\n initialize() {\n this._id = Date.now();\n this._prevLine = 0;\n this._prevChar = 0;\n this._data = [];\n this._dataLen = 0;\n }\n push(line, char, length, tokenType, tokenModifiers) {\n let pushLine = line;\n let pushChar = char;\n if (this._dataLen > 0) {\n pushLine -= this._prevLine;\n if (pushLine === 0) {\n pushChar -= this._prevChar;\n }\n }\n this._data[this._dataLen++] = pushLine;\n this._data[this._dataLen++] = pushChar;\n this._data[this._dataLen++] = length;\n this._data[this._dataLen++] = tokenType;\n this._data[this._dataLen++] = tokenModifiers;\n this._prevLine = line;\n this._prevChar = char;\n }\n get id() {\n return this._id.toString();\n }\n previousResult(id) {\n if (this.id === id) {\n this._prevData = this._data;\n }\n this.initialize();\n }\n build() {\n this._prevData = undefined;\n return {\n resultId: this.id,\n data: this._data\n };\n }\n canBuildEdits() {\n return this._prevData !== undefined;\n }\n buildEdits() {\n if (this._prevData !== undefined) {\n return {\n resultId: this.id,\n edits: (new SemanticTokensDiff(this._prevData, this._data)).computeDiff()\n };\n }\n else {\n return this.build();\n }\n }\n}\nexports.SemanticTokensBuilder = SemanticTokensBuilder;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShowDocumentFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst ShowDocumentFeature = (Base) => {\n return class extends Base {\n showDocument(params) {\n return this.connection.sendRequest(vscode_languageserver_protocol_1.ShowDocumentRequest.type, params);\n }\n };\n};\nexports.ShowDocumentFeature = ShowDocumentFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileOperationsFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst FileOperationsFeature = (Base) => {\n return class extends Base {\n onDidCreateFiles(handler) {\n return this.connection.onNotification(vscode_languageserver_protocol_1.DidCreateFilesNotification.type, (params) => {\n handler(params);\n });\n }\n onDidRenameFiles(handler) {\n return this.connection.onNotification(vscode_languageserver_protocol_1.DidRenameFilesNotification.type, (params) => {\n handler(params);\n });\n }\n onDidDeleteFiles(handler) {\n return this.connection.onNotification(vscode_languageserver_protocol_1.DidDeleteFilesNotification.type, (params) => {\n handler(params);\n });\n }\n onWillCreateFiles(handler) {\n return this.connection.onRequest(vscode_languageserver_protocol_1.WillCreateFilesRequest.type, (params, cancel) => {\n return handler(params, cancel);\n });\n }\n onWillRenameFiles(handler) {\n return this.connection.onRequest(vscode_languageserver_protocol_1.WillRenameFilesRequest.type, (params, cancel) => {\n return handler(params, cancel);\n });\n }\n onWillDeleteFiles(handler) {\n return this.connection.onRequest(vscode_languageserver_protocol_1.WillDeleteFilesRequest.type, (params, cancel) => {\n return handler(params, cancel);\n });\n }\n };\n};\nexports.FileOperationsFeature = FileOperationsFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LinkedEditingRangeFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst LinkedEditingRangeFeature = (Base) => {\n return class extends Base {\n onLinkedEditingRange(handler) {\n return this.connection.onRequest(vscode_languageserver_protocol_1.LinkedEditingRangeRequest.type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), undefined);\n });\n }\n };\n};\nexports.LinkedEditingRangeFeature = LinkedEditingRangeFeature;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypeHierarchyFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst TypeHierarchyFeature = (Base) => {\n return class extends Base {\n get typeHierarchy() {\n return {\n onPrepare: (handler) => {\n return this.connection.onRequest(vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), undefined);\n });\n },\n onSupertypes: (handler) => {\n const type = vscode_languageserver_protocol_1.TypeHierarchySupertypesRequest.type;\n return this.connection.onRequest(type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));\n });\n },\n onSubtypes: (handler) => {\n const type = vscode_languageserver_protocol_1.TypeHierarchySubtypesRequest.type;\n return this.connection.onRequest(type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));\n });\n }\n };\n }\n };\n};\nexports.TypeHierarchyFeature = TypeHierarchyFeature;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineValueFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst InlineValueFeature = (Base) => {\n return class extends Base {\n get inlineValue() {\n return {\n refresh: () => {\n return this.connection.sendRequest(vscode_languageserver_protocol_1.InlineValueRefreshRequest.type);\n },\n on: (handler) => {\n return this.connection.onRequest(vscode_languageserver_protocol_1.InlineValueRequest.type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params));\n });\n }\n };\n }\n };\n};\nexports.InlineValueFeature = InlineValueFeature;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FoldingRangeFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst FoldingRangeFeature = (Base) => {\n return class extends Base {\n get foldingRange() {\n return {\n refresh: () => {\n return this.connection.sendRequest(vscode_languageserver_protocol_1.FoldingRangeRefreshRequest.type);\n },\n on: (handler) => {\n const type = vscode_languageserver_protocol_1.FoldingRangeRequest.type;\n return this.connection.onRequest(type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));\n });\n }\n };\n }\n };\n};\nexports.FoldingRangeFeature = FoldingRangeFeature;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlayHintFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst InlayHintFeature = (Base) => {\n return class extends Base {\n get inlayHint() {\n return {\n refresh: () => {\n return this.connection.sendRequest(vscode_languageserver_protocol_1.InlayHintRefreshRequest.type);\n },\n on: (handler) => {\n return this.connection.onRequest(vscode_languageserver_protocol_1.InlayHintRequest.type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params));\n });\n },\n resolve: (handler) => {\n return this.connection.onRequest(vscode_languageserver_protocol_1.InlayHintResolveRequest.type, (params, cancel) => {\n return handler(params, cancel);\n });\n }\n };\n }\n };\n};\nexports.InlayHintFeature = InlayHintFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagnosticFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst DiagnosticFeature = (Base) => {\n return class extends Base {\n get diagnostics() {\n return {\n refresh: () => {\n return this.connection.sendRequest(vscode_languageserver_protocol_1.DiagnosticRefreshRequest.type);\n },\n on: (handler) => {\n return this.connection.onRequest(vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(vscode_languageserver_protocol_1.DocumentDiagnosticRequest.partialResult, params));\n });\n },\n onWorkspace: (handler) => {\n return this.connection.onRequest(vscode_languageserver_protocol_1.WorkspaceDiagnosticRequest.type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(vscode_languageserver_protocol_1.WorkspaceDiagnosticRequest.partialResult, params));\n });\n }\n };\n }\n };\n};\nexports.DiagnosticFeature = DiagnosticFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TextDocuments = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\n/**\n * A manager for simple text documents. The manager requires at a minimum that\n * the server registered for the following text document sync events in the\n * initialize handler or via dynamic registration:\n *\n * - open and close events.\n * - change events.\n *\n * Registering for save and will save events is optional.\n */\nclass TextDocuments {\n /**\n * Create a new text document manager.\n */\n constructor(configuration) {\n this._configuration = configuration;\n this._syncedDocuments = new Map();\n this._onDidChangeContent = new vscode_languageserver_protocol_1.Emitter();\n this._onDidOpen = new vscode_languageserver_protocol_1.Emitter();\n this._onDidClose = new vscode_languageserver_protocol_1.Emitter();\n this._onDidSave = new vscode_languageserver_protocol_1.Emitter();\n this._onWillSave = new vscode_languageserver_protocol_1.Emitter();\n }\n /**\n * An event that fires when a text document managed by this manager\n * has been opened.\n */\n get onDidOpen() {\n return this._onDidOpen.event;\n }\n /**\n * An event that fires when a text document managed by this manager\n * has been opened or the content changes.\n */\n get onDidChangeContent() {\n return this._onDidChangeContent.event;\n }\n /**\n * An event that fires when a text document managed by this manager\n * will be saved.\n */\n get onWillSave() {\n return this._onWillSave.event;\n }\n /**\n * Sets a handler that will be called if a participant wants to provide\n * edits during a text document save.\n */\n onWillSaveWaitUntil(handler) {\n this._willSaveWaitUntil = handler;\n }\n /**\n * An event that fires when a text document managed by this manager\n * has been saved.\n */\n get onDidSave() {\n return this._onDidSave.event;\n }\n /**\n * An event that fires when a text document managed by this manager\n * has been closed.\n */\n get onDidClose() {\n return this._onDidClose.event;\n }\n /**\n * Returns the document for the given URI. Returns undefined if\n * the document is not managed by this instance.\n *\n * @param uri The text document's URI to retrieve.\n * @return the text document or `undefined`.\n */\n get(uri) {\n return this._syncedDocuments.get(uri);\n }\n /**\n * Returns all text documents managed by this instance.\n *\n * @return all text documents.\n */\n all() {\n return Array.from(this._syncedDocuments.values());\n }\n /**\n * Returns the URIs of all text documents managed by this instance.\n *\n * @return the URI's of all text documents.\n */\n keys() {\n return Array.from(this._syncedDocuments.keys());\n }\n /**\n * Listens for `low level` notification on the given connection to\n * update the text documents managed by this instance.\n *\n * Please note that the connection only provides handlers not an event model. Therefore\n * listening on a connection will overwrite the following handlers on a connection:\n * `onDidOpenTextDocument`, `onDidChangeTextDocument`, `onDidCloseTextDocument`,\n * `onWillSaveTextDocument`, `onWillSaveTextDocumentWaitUntil` and `onDidSaveTextDocument`.\n *\n * Use the corresponding events on the TextDocuments instance instead.\n *\n * @param connection The connection to listen on.\n */\n listen(connection) {\n connection.__textDocumentSync = vscode_languageserver_protocol_1.TextDocumentSyncKind.Incremental;\n const disposables = [];\n disposables.push(connection.onDidOpenTextDocument((event) => {\n const td = event.textDocument;\n const document = this._configuration.create(td.uri, td.languageId, td.version, td.text);\n this._syncedDocuments.set(td.uri, document);\n const toFire = Object.freeze({ document });\n this._onDidOpen.fire(toFire);\n this._onDidChangeContent.fire(toFire);\n }));\n disposables.push(connection.onDidChangeTextDocument((event) => {\n const td = event.textDocument;\n const changes = event.contentChanges;\n if (changes.length === 0) {\n return;\n }\n const { version } = td;\n if (version === null || version === undefined) {\n throw new Error(`Received document change event for ${td.uri} without valid version identifier`);\n }\n let syncedDocument = this._syncedDocuments.get(td.uri);\n if (syncedDocument !== undefined) {\n syncedDocument = this._configuration.update(syncedDocument, changes, version);\n this._syncedDocuments.set(td.uri, syncedDocument);\n this._onDidChangeContent.fire(Object.freeze({ document: syncedDocument }));\n }\n }));\n disposables.push(connection.onDidCloseTextDocument((event) => {\n let syncedDocument = this._syncedDocuments.get(event.textDocument.uri);\n if (syncedDocument !== undefined) {\n this._syncedDocuments.delete(event.textDocument.uri);\n this._onDidClose.fire(Object.freeze({ document: syncedDocument }));\n }\n }));\n disposables.push(connection.onWillSaveTextDocument((event) => {\n let syncedDocument = this._syncedDocuments.get(event.textDocument.uri);\n if (syncedDocument !== undefined) {\n this._onWillSave.fire(Object.freeze({ document: syncedDocument, reason: event.reason }));\n }\n }));\n disposables.push(connection.onWillSaveTextDocumentWaitUntil((event, token) => {\n let syncedDocument = this._syncedDocuments.get(event.textDocument.uri);\n if (syncedDocument !== undefined && this._willSaveWaitUntil) {\n return this._willSaveWaitUntil(Object.freeze({ document: syncedDocument, reason: event.reason }), token);\n }\n else {\n return [];\n }\n }));\n disposables.push(connection.onDidSaveTextDocument((event) => {\n let syncedDocument = this._syncedDocuments.get(event.textDocument.uri);\n if (syncedDocument !== undefined) {\n this._onDidSave.fire(Object.freeze({ document: syncedDocument }));\n }\n }));\n return vscode_languageserver_protocol_1.Disposable.create(() => { disposables.forEach(disposable => disposable.dispose()); });\n }\n}\nexports.TextDocuments = TextDocuments;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NotebookDocuments = exports.NotebookSyncFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst textDocuments_1 = require(\"./textDocuments\");\nconst NotebookSyncFeature = (Base) => {\n return class extends Base {\n get synchronization() {\n return {\n onDidOpenNotebookDocument: (handler) => {\n return this.connection.onNotification(vscode_languageserver_protocol_1.DidOpenNotebookDocumentNotification.type, (params) => {\n handler(params);\n });\n },\n onDidChangeNotebookDocument: (handler) => {\n return this.connection.onNotification(vscode_languageserver_protocol_1.DidChangeNotebookDocumentNotification.type, (params) => {\n handler(params);\n });\n },\n onDidSaveNotebookDocument: (handler) => {\n return this.connection.onNotification(vscode_languageserver_protocol_1.DidSaveNotebookDocumentNotification.type, (params) => {\n handler(params);\n });\n },\n onDidCloseNotebookDocument: (handler) => {\n return this.connection.onNotification(vscode_languageserver_protocol_1.DidCloseNotebookDocumentNotification.type, (params) => {\n handler(params);\n });\n }\n };\n }\n };\n};\nexports.NotebookSyncFeature = NotebookSyncFeature;\nclass CellTextDocumentConnection {\n onDidOpenTextDocument(handler) {\n this.openHandler = handler;\n return vscode_languageserver_protocol_1.Disposable.create(() => { this.openHandler = undefined; });\n }\n openTextDocument(params) {\n this.openHandler && this.openHandler(params);\n }\n onDidChangeTextDocument(handler) {\n this.changeHandler = handler;\n return vscode_languageserver_protocol_1.Disposable.create(() => { this.changeHandler = handler; });\n }\n changeTextDocument(params) {\n this.changeHandler && this.changeHandler(params);\n }\n onDidCloseTextDocument(handler) {\n this.closeHandler = handler;\n return vscode_languageserver_protocol_1.Disposable.create(() => { this.closeHandler = undefined; });\n }\n closeTextDocument(params) {\n this.closeHandler && this.closeHandler(params);\n }\n onWillSaveTextDocument() {\n return CellTextDocumentConnection.NULL_DISPOSE;\n }\n onWillSaveTextDocumentWaitUntil() {\n return CellTextDocumentConnection.NULL_DISPOSE;\n }\n onDidSaveTextDocument() {\n return CellTextDocumentConnection.NULL_DISPOSE;\n }\n}\nCellTextDocumentConnection.NULL_DISPOSE = Object.freeze({ dispose: () => { } });\nclass NotebookDocuments {\n constructor(configurationOrTextDocuments) {\n if (configurationOrTextDocuments instanceof textDocuments_1.TextDocuments) {\n this._cellTextDocuments = configurationOrTextDocuments;\n }\n else {\n this._cellTextDocuments = new textDocuments_1.TextDocuments(configurationOrTextDocuments);\n }\n this.notebookDocuments = new Map();\n this.notebookCellMap = new Map();\n this._onDidOpen = new vscode_languageserver_protocol_1.Emitter();\n this._onDidChange = new vscode_languageserver_protocol_1.Emitter();\n this._onDidSave = new vscode_languageserver_protocol_1.Emitter();\n this._onDidClose = new vscode_languageserver_protocol_1.Emitter();\n }\n get cellTextDocuments() {\n return this._cellTextDocuments;\n }\n getCellTextDocument(cell) {\n return this._cellTextDocuments.get(cell.document);\n }\n getNotebookDocument(uri) {\n return this.notebookDocuments.get(uri);\n }\n getNotebookCell(uri) {\n const value = this.notebookCellMap.get(uri);\n return value && value[0];\n }\n findNotebookDocumentForCell(cell) {\n const key = typeof cell === 'string' ? cell : cell.document;\n const value = this.notebookCellMap.get(key);\n return value && value[1];\n }\n get onDidOpen() {\n return this._onDidOpen.event;\n }\n get onDidSave() {\n return this._onDidSave.event;\n }\n get onDidChange() {\n return this._onDidChange.event;\n }\n get onDidClose() {\n return this._onDidClose.event;\n }\n /**\n * Listens for `low level` notification on the given connection to\n * update the notebook documents managed by this instance.\n *\n * Please note that the connection only provides handlers not an event model. Therefore\n * listening on a connection will overwrite the following handlers on a connection:\n * `onDidOpenNotebookDocument`, `onDidChangeNotebookDocument`, `onDidSaveNotebookDocument`,\n * and `onDidCloseNotebookDocument`.\n *\n * @param connection The connection to listen on.\n */\n listen(connection) {\n const cellTextDocumentConnection = new CellTextDocumentConnection();\n const disposables = [];\n disposables.push(this.cellTextDocuments.listen(cellTextDocumentConnection));\n disposables.push(connection.notebooks.synchronization.onDidOpenNotebookDocument((params) => {\n this.notebookDocuments.set(params.notebookDocument.uri, params.notebookDocument);\n for (const cellTextDocument of params.cellTextDocuments) {\n cellTextDocumentConnection.openTextDocument({ textDocument: cellTextDocument });\n }\n this.updateCellMap(params.notebookDocument);\n this._onDidOpen.fire(params.notebookDocument);\n }));\n disposables.push(connection.notebooks.synchronization.onDidChangeNotebookDocument((params) => {\n const notebookDocument = this.notebookDocuments.get(params.notebookDocument.uri);\n if (notebookDocument === undefined) {\n return;\n }\n notebookDocument.version = params.notebookDocument.version;\n const oldMetadata = notebookDocument.metadata;\n let metadataChanged = false;\n const change = params.change;\n if (change.metadata !== undefined) {\n metadataChanged = true;\n notebookDocument.metadata = change.metadata;\n }\n const opened = [];\n const closed = [];\n const data = [];\n const text = [];\n if (change.cells !== undefined) {\n const changedCells = change.cells;\n if (changedCells.structure !== undefined) {\n const array = changedCells.structure.array;\n notebookDocument.cells.splice(array.start, array.deleteCount, ...(array.cells !== undefined ? array.cells : []));\n // Additional open cell text documents.\n if (changedCells.structure.didOpen !== undefined) {\n for (const open of changedCells.structure.didOpen) {\n cellTextDocumentConnection.openTextDocument({ textDocument: open });\n opened.push(open.uri);\n }\n }\n // Additional closed cell test documents.\n if (changedCells.structure.didClose) {\n for (const close of changedCells.structure.didClose) {\n cellTextDocumentConnection.closeTextDocument({ textDocument: close });\n closed.push(close.uri);\n }\n }\n }\n if (changedCells.data !== undefined) {\n const cellUpdates = new Map(changedCells.data.map(cell => [cell.document, cell]));\n for (let i = 0; i <= notebookDocument.cells.length; i++) {\n const change = cellUpdates.get(notebookDocument.cells[i].document);\n if (change !== undefined) {\n const old = notebookDocument.cells.splice(i, 1, change);\n data.push({ old: old[0], new: change });\n cellUpdates.delete(change.document);\n if (cellUpdates.size === 0) {\n break;\n }\n }\n }\n }\n if (changedCells.textContent !== undefined) {\n for (const cellTextDocument of changedCells.textContent) {\n cellTextDocumentConnection.changeTextDocument({ textDocument: cellTextDocument.document, contentChanges: cellTextDocument.changes });\n text.push(cellTextDocument.document.uri);\n }\n }\n }\n // Update internal data structure.\n this.updateCellMap(notebookDocument);\n const changeEvent = { notebookDocument };\n if (metadataChanged) {\n changeEvent.metadata = { old: oldMetadata, new: notebookDocument.metadata };\n }\n const added = [];\n for (const open of opened) {\n added.push(this.getNotebookCell(open));\n }\n const removed = [];\n for (const close of closed) {\n removed.push(this.getNotebookCell(close));\n }\n const textContent = [];\n for (const change of text) {\n textContent.push(this.getNotebookCell(change));\n }\n if (added.length > 0 || removed.length > 0 || data.length > 0 || textContent.length > 0) {\n changeEvent.cells = { added, removed, changed: { data, textContent } };\n }\n if (changeEvent.metadata !== undefined || changeEvent.cells !== undefined) {\n this._onDidChange.fire(changeEvent);\n }\n }));\n disposables.push(connection.notebooks.synchronization.onDidSaveNotebookDocument((params) => {\n const notebookDocument = this.notebookDocuments.get(params.notebookDocument.uri);\n if (notebookDocument === undefined) {\n return;\n }\n this._onDidSave.fire(notebookDocument);\n }));\n disposables.push(connection.notebooks.synchronization.onDidCloseNotebookDocument((params) => {\n const notebookDocument = this.notebookDocuments.get(params.notebookDocument.uri);\n if (notebookDocument === undefined) {\n return;\n }\n this._onDidClose.fire(notebookDocument);\n for (const cellTextDocument of params.cellTextDocuments) {\n cellTextDocumentConnection.closeTextDocument({ textDocument: cellTextDocument });\n }\n this.notebookDocuments.delete(params.notebookDocument.uri);\n for (const cell of notebookDocument.cells) {\n this.notebookCellMap.delete(cell.document);\n }\n }));\n return vscode_languageserver_protocol_1.Disposable.create(() => { disposables.forEach(disposable => disposable.dispose()); });\n }\n updateCellMap(notebookDocument) {\n for (const cell of notebookDocument.cells) {\n this.notebookCellMap.set(cell.document, [cell, notebookDocument]);\n }\n }\n}\nexports.NotebookDocuments = NotebookDocuments;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MonikerFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst MonikerFeature = (Base) => {\n return class extends Base {\n get moniker() {\n return {\n on: (handler) => {\n const type = vscode_languageserver_protocol_1.MonikerRequest.type;\n return this.connection.onRequest(type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));\n });\n },\n };\n }\n };\n};\nexports.MonikerFeature = MonikerFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createConnection = exports.combineFeatures = exports.combineNotebooksFeatures = exports.combineLanguagesFeatures = exports.combineWorkspaceFeatures = exports.combineWindowFeatures = exports.combineClientFeatures = exports.combineTracerFeatures = exports.combineTelemetryFeatures = exports.combineConsoleFeatures = exports._NotebooksImpl = exports._LanguagesImpl = exports.BulkUnregistration = exports.BulkRegistration = exports.ErrorMessageTracker = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nconst UUID = require(\"./utils/uuid\");\nconst progress_1 = require(\"./progress\");\nconst configuration_1 = require(\"./configuration\");\nconst workspaceFolder_1 = require(\"./workspaceFolder\");\nconst callHierarchy_1 = require(\"./callHierarchy\");\nconst semanticTokens_1 = require(\"./semanticTokens\");\nconst showDocument_1 = require(\"./showDocument\");\nconst fileOperations_1 = require(\"./fileOperations\");\nconst linkedEditingRange_1 = require(\"./linkedEditingRange\");\nconst typeHierarchy_1 = require(\"./typeHierarchy\");\nconst inlineValue_1 = require(\"./inlineValue\");\nconst foldingRange_1 = require(\"./foldingRange\");\n// import { InlineCompletionFeatureShape, InlineCompletionFeature } from './inlineCompletion.proposed';\nconst inlayHint_1 = require(\"./inlayHint\");\nconst diagnostic_1 = require(\"./diagnostic\");\nconst notebook_1 = require(\"./notebook\");\nconst moniker_1 = require(\"./moniker\");\nfunction null2Undefined(value) {\n if (value === null) {\n return undefined;\n }\n return value;\n}\n/**\n * Helps tracking error message. Equal occurrences of the same\n * message are only stored once. This class is for example\n * useful if text documents are validated in a loop and equal\n * error message should be folded into one.\n */\nclass ErrorMessageTracker {\n constructor() {\n this._messages = Object.create(null);\n }\n /**\n * Add a message to the tracker.\n *\n * @param message The message to add.\n */\n add(message) {\n let count = this._messages[message];\n if (!count) {\n count = 0;\n }\n count++;\n this._messages[message] = count;\n }\n /**\n * Send all tracked messages to the connection's window.\n *\n * @param connection The connection established between client and server.\n */\n sendErrors(connection) {\n Object.keys(this._messages).forEach(message => {\n connection.window.showErrorMessage(message);\n });\n }\n}\nexports.ErrorMessageTracker = ErrorMessageTracker;\nclass RemoteConsoleImpl {\n constructor() {\n }\n rawAttach(connection) {\n this._rawConnection = connection;\n }\n attach(connection) {\n this._connection = connection;\n }\n get connection() {\n if (!this._connection) {\n throw new Error('Remote is not attached to a connection yet.');\n }\n return this._connection;\n }\n fillServerCapabilities(_capabilities) {\n }\n initialize(_capabilities) {\n }\n error(message) {\n this.send(vscode_languageserver_protocol_1.MessageType.Error, message);\n }\n warn(message) {\n this.send(vscode_languageserver_protocol_1.MessageType.Warning, message);\n }\n info(message) {\n this.send(vscode_languageserver_protocol_1.MessageType.Info, message);\n }\n log(message) {\n this.send(vscode_languageserver_protocol_1.MessageType.Log, message);\n }\n debug(message) {\n this.send(vscode_languageserver_protocol_1.MessageType.Debug, message);\n }\n send(type, message) {\n if (this._rawConnection) {\n this._rawConnection.sendNotification(vscode_languageserver_protocol_1.LogMessageNotification.type, { type, message }).catch(() => {\n (0, vscode_languageserver_protocol_1.RAL)().console.error(`Sending log message failed`);\n });\n }\n }\n}\nclass _RemoteWindowImpl {\n constructor() {\n }\n attach(connection) {\n this._connection = connection;\n }\n get connection() {\n if (!this._connection) {\n throw new Error('Remote is not attached to a connection yet.');\n }\n return this._connection;\n }\n initialize(_capabilities) {\n }\n fillServerCapabilities(_capabilities) {\n }\n showErrorMessage(message, ...actions) {\n let params = { type: vscode_languageserver_protocol_1.MessageType.Error, message, actions };\n return this.connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);\n }\n showWarningMessage(message, ...actions) {\n let params = { type: vscode_languageserver_protocol_1.MessageType.Warning, message, actions };\n return this.connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);\n }\n showInformationMessage(message, ...actions) {\n let params = { type: vscode_languageserver_protocol_1.MessageType.Info, message, actions };\n return this.connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);\n }\n}\nconst RemoteWindowImpl = (0, showDocument_1.ShowDocumentFeature)((0, progress_1.ProgressFeature)(_RemoteWindowImpl));\nvar BulkRegistration;\n(function (BulkRegistration) {\n /**\n * Creates a new bulk registration.\n * @return an empty bulk registration.\n */\n function create() {\n return new BulkRegistrationImpl();\n }\n BulkRegistration.create = create;\n})(BulkRegistration || (exports.BulkRegistration = BulkRegistration = {}));\nclass BulkRegistrationImpl {\n constructor() {\n this._registrations = [];\n this._registered = new Set();\n }\n add(type, registerOptions) {\n const method = Is.string(type) ? type : type.method;\n if (this._registered.has(method)) {\n throw new Error(`${method} is already added to this registration`);\n }\n const id = UUID.generateUuid();\n this._registrations.push({\n id: id,\n method: method,\n registerOptions: registerOptions || {}\n });\n this._registered.add(method);\n }\n asRegistrationParams() {\n return {\n registrations: this._registrations\n };\n }\n}\nvar BulkUnregistration;\n(function (BulkUnregistration) {\n function create() {\n return new BulkUnregistrationImpl(undefined, []);\n }\n BulkUnregistration.create = create;\n})(BulkUnregistration || (exports.BulkUnregistration = BulkUnregistration = {}));\nclass BulkUnregistrationImpl {\n constructor(_connection, unregistrations) {\n this._connection = _connection;\n this._unregistrations = new Map();\n unregistrations.forEach(unregistration => {\n this._unregistrations.set(unregistration.method, unregistration);\n });\n }\n get isAttached() {\n return !!this._connection;\n }\n attach(connection) {\n this._connection = connection;\n }\n add(unregistration) {\n this._unregistrations.set(unregistration.method, unregistration);\n }\n dispose() {\n let unregistrations = [];\n for (let unregistration of this._unregistrations.values()) {\n unregistrations.push(unregistration);\n }\n let params = {\n unregisterations: unregistrations\n };\n this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).catch(() => {\n this._connection.console.info(`Bulk unregistration failed.`);\n });\n }\n disposeSingle(arg) {\n const method = Is.string(arg) ? arg : arg.method;\n const unregistration = this._unregistrations.get(method);\n if (!unregistration) {\n return false;\n }\n let params = {\n unregisterations: [unregistration]\n };\n this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(() => {\n this._unregistrations.delete(method);\n }, (_error) => {\n this._connection.console.info(`Un-registering request handler for ${unregistration.id} failed.`);\n });\n return true;\n }\n}\nclass RemoteClientImpl {\n attach(connection) {\n this._connection = connection;\n }\n get connection() {\n if (!this._connection) {\n throw new Error('Remote is not attached to a connection yet.');\n }\n return this._connection;\n }\n initialize(_capabilities) {\n }\n fillServerCapabilities(_capabilities) {\n }\n register(typeOrRegistrations, registerOptionsOrType, registerOptions) {\n if (typeOrRegistrations instanceof BulkRegistrationImpl) {\n return this.registerMany(typeOrRegistrations);\n }\n else if (typeOrRegistrations instanceof BulkUnregistrationImpl) {\n return this.registerSingle1(typeOrRegistrations, registerOptionsOrType, registerOptions);\n }\n else {\n return this.registerSingle2(typeOrRegistrations, registerOptionsOrType);\n }\n }\n registerSingle1(unregistration, type, registerOptions) {\n const method = Is.string(type) ? type : type.method;\n const id = UUID.generateUuid();\n let params = {\n registrations: [{ id, method, registerOptions: registerOptions || {} }]\n };\n if (!unregistration.isAttached) {\n unregistration.attach(this.connection);\n }\n return this.connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then((_result) => {\n unregistration.add({ id: id, method: method });\n return unregistration;\n }, (_error) => {\n this.connection.console.info(`Registering request handler for ${method} failed.`);\n return Promise.reject(_error);\n });\n }\n registerSingle2(type, registerOptions) {\n const method = Is.string(type) ? type : type.method;\n const id = UUID.generateUuid();\n let params = {\n registrations: [{ id, method, registerOptions: registerOptions || {} }]\n };\n return this.connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then((_result) => {\n return vscode_languageserver_protocol_1.Disposable.create(() => {\n this.unregisterSingle(id, method).catch(() => { this.connection.console.info(`Un-registering capability with id ${id} failed.`); });\n });\n }, (_error) => {\n this.connection.console.info(`Registering request handler for ${method} failed.`);\n return Promise.reject(_error);\n });\n }\n unregisterSingle(id, method) {\n let params = {\n unregisterations: [{ id, method }]\n };\n return this.connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).catch(() => {\n this.connection.console.info(`Un-registering request handler for ${id} failed.`);\n });\n }\n registerMany(registrations) {\n let params = registrations.asRegistrationParams();\n return this.connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then(() => {\n return new BulkUnregistrationImpl(this._connection, params.registrations.map(registration => { return { id: registration.id, method: registration.method }; }));\n }, (_error) => {\n this.connection.console.info(`Bulk registration failed.`);\n return Promise.reject(_error);\n });\n }\n}\nclass _RemoteWorkspaceImpl {\n constructor() {\n }\n attach(connection) {\n this._connection = connection;\n }\n get connection() {\n if (!this._connection) {\n throw new Error('Remote is not attached to a connection yet.');\n }\n return this._connection;\n }\n initialize(_capabilities) {\n }\n fillServerCapabilities(_capabilities) {\n }\n applyEdit(paramOrEdit) {\n function isApplyWorkspaceEditParams(value) {\n return value && !!value.edit;\n }\n let params = isApplyWorkspaceEditParams(paramOrEdit) ? paramOrEdit : { edit: paramOrEdit };\n return this.connection.sendRequest(vscode_languageserver_protocol_1.ApplyWorkspaceEditRequest.type, params);\n }\n}\nconst RemoteWorkspaceImpl = (0, fileOperations_1.FileOperationsFeature)((0, workspaceFolder_1.WorkspaceFoldersFeature)((0, configuration_1.ConfigurationFeature)(_RemoteWorkspaceImpl)));\nclass TracerImpl {\n constructor() {\n this._trace = vscode_languageserver_protocol_1.Trace.Off;\n }\n attach(connection) {\n this._connection = connection;\n }\n get connection() {\n if (!this._connection) {\n throw new Error('Remote is not attached to a connection yet.');\n }\n return this._connection;\n }\n initialize(_capabilities) {\n }\n fillServerCapabilities(_capabilities) {\n }\n set trace(value) {\n this._trace = value;\n }\n log(message, verbose) {\n if (this._trace === vscode_languageserver_protocol_1.Trace.Off) {\n return;\n }\n this.connection.sendNotification(vscode_languageserver_protocol_1.LogTraceNotification.type, {\n message: message,\n verbose: this._trace === vscode_languageserver_protocol_1.Trace.Verbose ? verbose : undefined\n }).catch(() => {\n // Very hard to decide what to do. We tried to send a log\n // message which failed so we can't simply send another :-(.\n });\n }\n}\nclass TelemetryImpl {\n constructor() {\n }\n attach(connection) {\n this._connection = connection;\n }\n get connection() {\n if (!this._connection) {\n throw new Error('Remote is not attached to a connection yet.');\n }\n return this._connection;\n }\n initialize(_capabilities) {\n }\n fillServerCapabilities(_capabilities) {\n }\n logEvent(data) {\n this.connection.sendNotification(vscode_languageserver_protocol_1.TelemetryEventNotification.type, data).catch(() => {\n this.connection.console.log(`Sending TelemetryEventNotification failed`);\n });\n }\n}\nclass _LanguagesImpl {\n constructor() {\n }\n attach(connection) {\n this._connection = connection;\n }\n get connection() {\n if (!this._connection) {\n throw new Error('Remote is not attached to a connection yet.');\n }\n return this._connection;\n }\n initialize(_capabilities) {\n }\n fillServerCapabilities(_capabilities) {\n }\n attachWorkDoneProgress(params) {\n return (0, progress_1.attachWorkDone)(this.connection, params);\n }\n attachPartialResultProgress(_type, params) {\n return (0, progress_1.attachPartialResult)(this.connection, params);\n }\n}\nexports._LanguagesImpl = _LanguagesImpl;\nconst LanguagesImpl = (0, foldingRange_1.FoldingRangeFeature)((0, moniker_1.MonikerFeature)((0, diagnostic_1.DiagnosticFeature)((0, inlayHint_1.InlayHintFeature)((0, inlineValue_1.InlineValueFeature)((0, typeHierarchy_1.TypeHierarchyFeature)((0, linkedEditingRange_1.LinkedEditingRangeFeature)((0, semanticTokens_1.SemanticTokensFeature)((0, callHierarchy_1.CallHierarchyFeature)(_LanguagesImpl)))))))));\nclass _NotebooksImpl {\n constructor() {\n }\n attach(connection) {\n this._connection = connection;\n }\n get connection() {\n if (!this._connection) {\n throw new Error('Remote is not attached to a connection yet.');\n }\n return this._connection;\n }\n initialize(_capabilities) {\n }\n fillServerCapabilities(_capabilities) {\n }\n attachWorkDoneProgress(params) {\n return (0, progress_1.attachWorkDone)(this.connection, params);\n }\n attachPartialResultProgress(_type, params) {\n return (0, progress_1.attachPartialResult)(this.connection, params);\n }\n}\nexports._NotebooksImpl = _NotebooksImpl;\nconst NotebooksImpl = (0, notebook_1.NotebookSyncFeature)(_NotebooksImpl);\nfunction combineConsoleFeatures(one, two) {\n return function (Base) {\n return two(one(Base));\n };\n}\nexports.combineConsoleFeatures = combineConsoleFeatures;\nfunction combineTelemetryFeatures(one, two) {\n return function (Base) {\n return two(one(Base));\n };\n}\nexports.combineTelemetryFeatures = combineTelemetryFeatures;\nfunction combineTracerFeatures(one, two) {\n return function (Base) {\n return two(one(Base));\n };\n}\nexports.combineTracerFeatures = combineTracerFeatures;\nfunction combineClientFeatures(one, two) {\n return function (Base) {\n return two(one(Base));\n };\n}\nexports.combineClientFeatures = combineClientFeatures;\nfunction combineWindowFeatures(one, two) {\n return function (Base) {\n return two(one(Base));\n };\n}\nexports.combineWindowFeatures = combineWindowFeatures;\nfunction combineWorkspaceFeatures(one, two) {\n return function (Base) {\n return two(one(Base));\n };\n}\nexports.combineWorkspaceFeatures = combineWorkspaceFeatures;\nfunction combineLanguagesFeatures(one, two) {\n return function (Base) {\n return two(one(Base));\n };\n}\nexports.combineLanguagesFeatures = combineLanguagesFeatures;\nfunction combineNotebooksFeatures(one, two) {\n return function (Base) {\n return two(one(Base));\n };\n}\nexports.combineNotebooksFeatures = combineNotebooksFeatures;\nfunction combineFeatures(one, two) {\n function combine(one, two, func) {\n if (one && two) {\n return func(one, two);\n }\n else if (one) {\n return one;\n }\n else {\n return two;\n }\n }\n let result = {\n __brand: 'features',\n console: combine(one.console, two.console, combineConsoleFeatures),\n tracer: combine(one.tracer, two.tracer, combineTracerFeatures),\n telemetry: combine(one.telemetry, two.telemetry, combineTelemetryFeatures),\n client: combine(one.client, two.client, combineClientFeatures),\n window: combine(one.window, two.window, combineWindowFeatures),\n workspace: combine(one.workspace, two.workspace, combineWorkspaceFeatures),\n languages: combine(one.languages, two.languages, combineLanguagesFeatures),\n notebooks: combine(one.notebooks, two.notebooks, combineNotebooksFeatures)\n };\n return result;\n}\nexports.combineFeatures = combineFeatures;\nfunction createConnection(connectionFactory, watchDog, factories) {\n const logger = (factories && factories.console ? new (factories.console(RemoteConsoleImpl))() : new RemoteConsoleImpl());\n const connection = connectionFactory(logger);\n logger.rawAttach(connection);\n const tracer = (factories && factories.tracer ? new (factories.tracer(TracerImpl))() : new TracerImpl());\n const telemetry = (factories && factories.telemetry ? new (factories.telemetry(TelemetryImpl))() : new TelemetryImpl());\n const client = (factories && factories.client ? new (factories.client(RemoteClientImpl))() : new RemoteClientImpl());\n const remoteWindow = (factories && factories.window ? new (factories.window(RemoteWindowImpl))() : new RemoteWindowImpl());\n const workspace = (factories && factories.workspace ? new (factories.workspace(RemoteWorkspaceImpl))() : new RemoteWorkspaceImpl());\n const languages = (factories && factories.languages ? new (factories.languages(LanguagesImpl))() : new LanguagesImpl());\n const notebooks = (factories && factories.notebooks ? new (factories.notebooks(NotebooksImpl))() : new NotebooksImpl());\n const allRemotes = [logger, tracer, telemetry, client, remoteWindow, workspace, languages, notebooks];\n function asPromise(value) {\n if (value instanceof Promise) {\n return value;\n }\n else if (Is.thenable(value)) {\n return new Promise((resolve, reject) => {\n value.then((resolved) => resolve(resolved), (error) => reject(error));\n });\n }\n else {\n return Promise.resolve(value);\n }\n }\n let shutdownHandler = undefined;\n let initializeHandler = undefined;\n let exitHandler = undefined;\n let protocolConnection = {\n listen: () => connection.listen(),\n sendRequest: (type, ...params) => connection.sendRequest(Is.string(type) ? type : type.method, ...params),\n onRequest: (type, handler) => connection.onRequest(type, handler),\n sendNotification: (type, param) => {\n const method = Is.string(type) ? type : type.method;\n return connection.sendNotification(method, param);\n },\n onNotification: (type, handler) => connection.onNotification(type, handler),\n onProgress: connection.onProgress,\n sendProgress: connection.sendProgress,\n onInitialize: (handler) => {\n initializeHandler = handler;\n return {\n dispose: () => {\n initializeHandler = undefined;\n }\n };\n },\n onInitialized: (handler) => connection.onNotification(vscode_languageserver_protocol_1.InitializedNotification.type, handler),\n onShutdown: (handler) => {\n shutdownHandler = handler;\n return {\n dispose: () => {\n shutdownHandler = undefined;\n }\n };\n },\n onExit: (handler) => {\n exitHandler = handler;\n return {\n dispose: () => {\n exitHandler = undefined;\n }\n };\n },\n get console() { return logger; },\n get telemetry() { return telemetry; },\n get tracer() { return tracer; },\n get client() { return client; },\n get window() { return remoteWindow; },\n get workspace() { return workspace; },\n get languages() { return languages; },\n get notebooks() { return notebooks; },\n onDidChangeConfiguration: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type, handler),\n onDidChangeWatchedFiles: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type, handler),\n __textDocumentSync: undefined,\n onDidOpenTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type, handler),\n onDidChangeTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, handler),\n onDidCloseTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.type, handler),\n onWillSaveTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type, handler),\n onWillSaveTextDocumentWaitUntil: (handler) => connection.onRequest(vscode_languageserver_protocol_1.WillSaveTextDocumentWaitUntilRequest.type, handler),\n onDidSaveTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.type, handler),\n sendDiagnostics: (params) => connection.sendNotification(vscode_languageserver_protocol_1.PublishDiagnosticsNotification.type, params),\n onHover: (handler) => connection.onRequest(vscode_languageserver_protocol_1.HoverRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), undefined);\n }),\n onCompletion: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CompletionRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onCompletionResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, handler),\n onSignatureHelp: (handler) => connection.onRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), undefined);\n }),\n onDeclaration: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onDefinition: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onTypeDefinition: (handler) => connection.onRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onImplementation: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onReferences: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onDocumentHighlight: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onDocumentSymbol: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onWorkspaceSymbol: (handler) => connection.onRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onWorkspaceSymbolResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.type, handler),\n onCodeAction: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onCodeActionResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeActionResolveRequest.type, (params, cancel) => {\n return handler(params, cancel);\n }),\n onCodeLens: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onCodeLensResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, (params, cancel) => {\n return handler(params, cancel);\n }),\n onDocumentFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), undefined);\n }),\n onDocumentRangeFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), undefined);\n }),\n onDocumentOnTypeFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, (params, cancel) => {\n return handler(params, cancel);\n }),\n onRenameRequest: (handler) => connection.onRequest(vscode_languageserver_protocol_1.RenameRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), undefined);\n }),\n onPrepareRename: (handler) => connection.onRequest(vscode_languageserver_protocol_1.PrepareRenameRequest.type, (params, cancel) => {\n return handler(params, cancel);\n }),\n onDocumentLinks: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onDocumentLinkResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, (params, cancel) => {\n return handler(params, cancel);\n }),\n onDocumentColor: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onColorPresentation: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onFoldingRanges: (handler) => connection.onRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onSelectionRanges: (handler) => connection.onRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), (0, progress_1.attachPartialResult)(connection, params));\n }),\n onExecuteCommand: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, (params, cancel) => {\n return handler(params, cancel, (0, progress_1.attachWorkDone)(connection, params), undefined);\n }),\n dispose: () => connection.dispose()\n };\n for (let remote of allRemotes) {\n remote.attach(protocolConnection);\n }\n connection.onRequest(vscode_languageserver_protocol_1.InitializeRequest.type, (params) => {\n watchDog.initialize(params);\n if (Is.string(params.trace)) {\n tracer.trace = vscode_languageserver_protocol_1.Trace.fromString(params.trace);\n }\n for (let remote of allRemotes) {\n remote.initialize(params.capabilities);\n }\n if (initializeHandler) {\n let result = initializeHandler(params, new vscode_languageserver_protocol_1.CancellationTokenSource().token, (0, progress_1.attachWorkDone)(connection, params), undefined);\n return asPromise(result).then((value) => {\n if (value instanceof vscode_languageserver_protocol_1.ResponseError) {\n return value;\n }\n let result = value;\n if (!result) {\n result = { capabilities: {} };\n }\n let capabilities = result.capabilities;\n if (!capabilities) {\n capabilities = {};\n result.capabilities = capabilities;\n }\n if (capabilities.textDocumentSync === undefined || capabilities.textDocumentSync === null) {\n capabilities.textDocumentSync = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\n }\n else if (!Is.number(capabilities.textDocumentSync) && !Is.number(capabilities.textDocumentSync.change)) {\n capabilities.textDocumentSync.change = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\n }\n for (let remote of allRemotes) {\n remote.fillServerCapabilities(capabilities);\n }\n return result;\n });\n }\n else {\n let result = { capabilities: { textDocumentSync: vscode_languageserver_protocol_1.TextDocumentSyncKind.None } };\n for (let remote of allRemotes) {\n remote.fillServerCapabilities(result.capabilities);\n }\n return result;\n }\n });\n connection.onRequest(vscode_languageserver_protocol_1.ShutdownRequest.type, () => {\n watchDog.shutdownReceived = true;\n if (shutdownHandler) {\n return shutdownHandler(new vscode_languageserver_protocol_1.CancellationTokenSource().token);\n }\n else {\n return undefined;\n }\n });\n connection.onNotification(vscode_languageserver_protocol_1.ExitNotification.type, () => {\n try {\n if (exitHandler) {\n exitHandler();\n }\n }\n finally {\n if (watchDog.shutdownReceived) {\n watchDog.exit(0);\n }\n else {\n watchDog.exit(1);\n }\n }\n });\n connection.onNotification(vscode_languageserver_protocol_1.SetTraceNotification.type, (params) => {\n tracer.trace = vscode_languageserver_protocol_1.Trace.fromString(params.value);\n });\n return protocolConnection;\n}\nexports.createConnection = createConnection;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveModulePath = exports.FileSystem = exports.resolveGlobalYarnPath = exports.resolveGlobalNodePath = exports.resolve = exports.uriToFilePath = void 0;\nconst url = require(\"url\");\nconst path = require(\"path\");\nconst fs = require(\"fs\");\nconst child_process_1 = require(\"child_process\");\n/**\n * @deprecated Use the `vscode-uri` npm module which provides a more\n * complete implementation of handling VS Code URIs.\n */\nfunction uriToFilePath(uri) {\n let parsed = url.parse(uri);\n if (parsed.protocol !== 'file:' || !parsed.path) {\n return undefined;\n }\n let segments = parsed.path.split('/');\n for (var i = 0, len = segments.length; i < len; i++) {\n segments[i] = decodeURIComponent(segments[i]);\n }\n if (process.platform === 'win32' && segments.length > 1) {\n let first = segments[0];\n let second = segments[1];\n // Do we have a drive letter and we started with a / which is the\n // case if the first segement is empty (see split above)\n if (first.length === 0 && second.length > 1 && second[1] === ':') {\n // Remove first slash\n segments.shift();\n }\n }\n return path.normalize(segments.join('/'));\n}\nexports.uriToFilePath = uriToFilePath;\nfunction isWindows() {\n return process.platform === 'win32';\n}\nfunction resolve(moduleName, nodePath, cwd, tracer) {\n const nodePathKey = 'NODE_PATH';\n const app = [\n 'var p = process;',\n 'p.on(\\'message\\',function(m){',\n 'if(m.c===\\'e\\'){',\n 'p.exit(0);',\n '}',\n 'else if(m.c===\\'rs\\'){',\n 'try{',\n 'var r=require.resolve(m.a);',\n 'p.send({c:\\'r\\',s:true,r:r});',\n '}',\n 'catch(err){',\n 'p.send({c:\\'r\\',s:false});',\n '}',\n '}',\n '});'\n ].join('');\n return new Promise((resolve, reject) => {\n let env = process.env;\n let newEnv = Object.create(null);\n Object.keys(env).forEach(key => newEnv[key] = env[key]);\n if (nodePath && fs.existsSync(nodePath) /* see issue 545 */) {\n if (newEnv[nodePathKey]) {\n newEnv[nodePathKey] = nodePath + path.delimiter + newEnv[nodePathKey];\n }\n else {\n newEnv[nodePathKey] = nodePath;\n }\n if (tracer) {\n tracer(`NODE_PATH value is: ${newEnv[nodePathKey]}`);\n }\n }\n newEnv['ELECTRON_RUN_AS_NODE'] = '1';\n try {\n let cp = (0, child_process_1.fork)('', [], {\n cwd: cwd,\n env: newEnv,\n execArgv: ['-e', app]\n });\n if (cp.pid === void 0) {\n reject(new Error(`Starting process to resolve node module ${moduleName} failed`));\n return;\n }\n cp.on('error', (error) => {\n reject(error);\n });\n cp.on('message', (message) => {\n if (message.c === 'r') {\n cp.send({ c: 'e' });\n if (message.s) {\n resolve(message.r);\n }\n else {\n reject(new Error(`Failed to resolve module: ${moduleName}`));\n }\n }\n });\n let message = {\n c: 'rs',\n a: moduleName\n };\n cp.send(message);\n }\n catch (error) {\n reject(error);\n }\n });\n}\nexports.resolve = resolve;\n/**\n * Resolve the global npm package path.\n * @deprecated Since this depends on the used package manager and their version the best is that servers\n * implement this themselves since they know best what kind of package managers to support.\n * @param tracer the tracer to use\n */\nfunction resolveGlobalNodePath(tracer) {\n let npmCommand = 'npm';\n const env = Object.create(null);\n Object.keys(process.env).forEach(key => env[key] = process.env[key]);\n env['NO_UPDATE_NOTIFIER'] = 'true';\n const options = {\n encoding: 'utf8',\n env\n };\n if (isWindows()) {\n npmCommand = 'npm.cmd';\n options.shell = true;\n }\n let handler = () => { };\n try {\n process.on('SIGPIPE', handler);\n let stdout = (0, child_process_1.spawnSync)(npmCommand, ['config', 'get', 'prefix'], options).stdout;\n if (!stdout) {\n if (tracer) {\n tracer(`'npm config get prefix' didn't return a value.`);\n }\n return undefined;\n }\n let prefix = stdout.trim();\n if (tracer) {\n tracer(`'npm config get prefix' value is: ${prefix}`);\n }\n if (prefix.length > 0) {\n if (isWindows()) {\n return path.join(prefix, 'node_modules');\n }\n else {\n return path.join(prefix, 'lib', 'node_modules');\n }\n }\n return undefined;\n }\n catch (err) {\n return undefined;\n }\n finally {\n process.removeListener('SIGPIPE', handler);\n }\n}\nexports.resolveGlobalNodePath = resolveGlobalNodePath;\n/*\n * Resolve the global yarn pakage path.\n * @deprecated Since this depends on the used package manager and their version the best is that servers\n * implement this themselves since they know best what kind of package managers to support.\n * @param tracer the tracer to use\n */\nfunction resolveGlobalYarnPath(tracer) {\n let yarnCommand = 'yarn';\n let options = {\n encoding: 'utf8'\n };\n if (isWindows()) {\n yarnCommand = 'yarn.cmd';\n options.shell = true;\n }\n let handler = () => { };\n try {\n process.on('SIGPIPE', handler);\n let results = (0, child_process_1.spawnSync)(yarnCommand, ['global', 'dir', '--json'], options);\n let stdout = results.stdout;\n if (!stdout) {\n if (tracer) {\n tracer(`'yarn global dir' didn't return a value.`);\n if (results.stderr) {\n tracer(results.stderr);\n }\n }\n return undefined;\n }\n let lines = stdout.trim().split(/\\r?\\n/);\n for (let line of lines) {\n try {\n let yarn = JSON.parse(line);\n if (yarn.type === 'log') {\n return path.join(yarn.data, 'node_modules');\n }\n }\n catch (e) {\n // Do nothing. Ignore the line\n }\n }\n return undefined;\n }\n catch (err) {\n return undefined;\n }\n finally {\n process.removeListener('SIGPIPE', handler);\n }\n}\nexports.resolveGlobalYarnPath = resolveGlobalYarnPath;\nvar FileSystem;\n(function (FileSystem) {\n let _isCaseSensitive = undefined;\n function isCaseSensitive() {\n if (_isCaseSensitive !== void 0) {\n return _isCaseSensitive;\n }\n if (process.platform === 'win32') {\n _isCaseSensitive = false;\n }\n else {\n // convert current file name to upper case / lower case and check if file exists\n // (guards against cases when name is already all uppercase or lowercase)\n _isCaseSensitive = !fs.existsSync(__filename.toUpperCase()) || !fs.existsSync(__filename.toLowerCase());\n }\n return _isCaseSensitive;\n }\n FileSystem.isCaseSensitive = isCaseSensitive;\n function isParent(parent, child) {\n if (isCaseSensitive()) {\n return path.normalize(child).indexOf(path.normalize(parent)) === 0;\n }\n else {\n return path.normalize(child).toLowerCase().indexOf(path.normalize(parent).toLowerCase()) === 0;\n }\n }\n FileSystem.isParent = isParent;\n})(FileSystem || (exports.FileSystem = FileSystem = {}));\nfunction resolveModulePath(workspaceRoot, moduleName, nodePath, tracer) {\n if (nodePath) {\n if (!path.isAbsolute(nodePath)) {\n nodePath = path.join(workspaceRoot, nodePath);\n }\n return resolve(moduleName, nodePath, nodePath, tracer).then((value) => {\n if (FileSystem.isParent(nodePath, value)) {\n return value;\n }\n else {\n return Promise.reject(new Error(`Failed to load ${moduleName} from node path location.`));\n }\n }).then(undefined, (_error) => {\n return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer);\n });\n }\n else {\n return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer);\n }\n}\nexports.resolveModulePath = resolveModulePath;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\n'use strict';\n\nmodule.exports = require('./lib/node/main');","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineCompletionFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst InlineCompletionFeature = (Base) => {\n return class extends Base {\n get inlineCompletion() {\n return {\n on: (handler) => {\n return this.connection.onRequest(vscode_languageserver_protocol_1.InlineCompletionRequest.type, (params, cancel) => {\n return handler(params, cancel, this.attachWorkDoneProgress(params));\n });\n }\n };\n }\n };\n};\nexports.InlineCompletionFeature = InlineCompletionFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProposedFeatures = exports.NotebookDocuments = exports.TextDocuments = exports.SemanticTokensBuilder = void 0;\nconst semanticTokens_1 = require(\"./semanticTokens\");\nObject.defineProperty(exports, \"SemanticTokensBuilder\", { enumerable: true, get: function () { return semanticTokens_1.SemanticTokensBuilder; } });\nconst ic = require(\"./inlineCompletion.proposed\");\n__exportStar(require(\"vscode-languageserver-protocol/\"), exports);\nconst textDocuments_1 = require(\"./textDocuments\");\nObject.defineProperty(exports, \"TextDocuments\", { enumerable: true, get: function () { return textDocuments_1.TextDocuments; } });\nconst notebook_1 = require(\"./notebook\");\nObject.defineProperty(exports, \"NotebookDocuments\", { enumerable: true, get: function () { return notebook_1.NotebookDocuments; } });\n__exportStar(require(\"./server\"), exports);\nvar ProposedFeatures;\n(function (ProposedFeatures) {\n ProposedFeatures.all = {\n __brand: 'features',\n languages: ic.InlineCompletionFeature\n };\n})(ProposedFeatures || (exports.ProposedFeatures = ProposedFeatures = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n/// \nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createConnection = exports.Files = void 0;\nconst node_util_1 = require(\"node:util\");\nconst Is = require(\"../common/utils/is\");\nconst server_1 = require(\"../common/server\");\nconst fm = require(\"./files\");\nconst node_1 = require(\"vscode-languageserver-protocol/node\");\n__exportStar(require(\"vscode-languageserver-protocol/node\"), exports);\n__exportStar(require(\"../common/api\"), exports);\nvar Files;\n(function (Files) {\n Files.uriToFilePath = fm.uriToFilePath;\n Files.resolveGlobalNodePath = fm.resolveGlobalNodePath;\n Files.resolveGlobalYarnPath = fm.resolveGlobalYarnPath;\n Files.resolve = fm.resolve;\n Files.resolveModulePath = fm.resolveModulePath;\n})(Files || (exports.Files = Files = {}));\nlet _protocolConnection;\nfunction endProtocolConnection() {\n if (_protocolConnection === undefined) {\n return;\n }\n try {\n _protocolConnection.end();\n }\n catch (_err) {\n // Ignore. The client process could have already\n // did and we can't send an end into the connection.\n }\n}\nlet _shutdownReceived = false;\nlet exitTimer = undefined;\nfunction setupExitTimer() {\n const argName = '--clientProcessId';\n function runTimer(value) {\n try {\n let processId = parseInt(value);\n if (!isNaN(processId)) {\n exitTimer = setInterval(() => {\n try {\n process.kill(processId, 0);\n }\n catch (ex) {\n // Parent process doesn't exist anymore. Exit the server.\n endProtocolConnection();\n process.exit(_shutdownReceived ? 0 : 1);\n }\n }, 3000);\n }\n }\n catch (e) {\n // Ignore errors;\n }\n }\n for (let i = 2; i < process.argv.length; i++) {\n let arg = process.argv[i];\n if (arg === argName && i + 1 < process.argv.length) {\n runTimer(process.argv[i + 1]);\n return;\n }\n else {\n let args = arg.split('=');\n if (args[0] === argName) {\n runTimer(args[1]);\n }\n }\n }\n}\nsetupExitTimer();\nconst watchDog = {\n initialize: (params) => {\n const processId = params.processId;\n if (Is.number(processId) && exitTimer === undefined) {\n // We received a parent process id. Set up a timer to periodically check\n // if the parent is still alive.\n setInterval(() => {\n try {\n process.kill(processId, 0);\n }\n catch (ex) {\n // Parent process doesn't exist anymore. Exit the server.\n process.exit(_shutdownReceived ? 0 : 1);\n }\n }, 3000);\n }\n },\n get shutdownReceived() {\n return _shutdownReceived;\n },\n set shutdownReceived(value) {\n _shutdownReceived = value;\n },\n exit: (code) => {\n endProtocolConnection();\n process.exit(code);\n }\n};\nfunction createConnection(arg1, arg2, arg3, arg4) {\n let factories;\n let input;\n let output;\n let options;\n if (arg1 !== void 0 && arg1.__brand === 'features') {\n factories = arg1;\n arg1 = arg2;\n arg2 = arg3;\n arg3 = arg4;\n }\n if (node_1.ConnectionStrategy.is(arg1) || node_1.ConnectionOptions.is(arg1)) {\n options = arg1;\n }\n else {\n input = arg1;\n output = arg2;\n options = arg3;\n }\n return _createConnection(input, output, options, factories);\n}\nexports.createConnection = createConnection;\nfunction _createConnection(input, output, options, factories) {\n let stdio = false;\n if (!input && !output && process.argv.length > 2) {\n let port = void 0;\n let pipeName = void 0;\n let argv = process.argv.slice(2);\n for (let i = 0; i < argv.length; i++) {\n let arg = argv[i];\n if (arg === '--node-ipc') {\n input = new node_1.IPCMessageReader(process);\n output = new node_1.IPCMessageWriter(process);\n break;\n }\n else if (arg === '--stdio') {\n stdio = true;\n input = process.stdin;\n output = process.stdout;\n break;\n }\n else if (arg === '--socket') {\n port = parseInt(argv[i + 1]);\n break;\n }\n else if (arg === '--pipe') {\n pipeName = argv[i + 1];\n break;\n }\n else {\n var args = arg.split('=');\n if (args[0] === '--socket') {\n port = parseInt(args[1]);\n break;\n }\n else if (args[0] === '--pipe') {\n pipeName = args[1];\n break;\n }\n }\n }\n if (port) {\n let transport = (0, node_1.createServerSocketTransport)(port);\n input = transport[0];\n output = transport[1];\n }\n else if (pipeName) {\n let transport = (0, node_1.createServerPipeTransport)(pipeName);\n input = transport[0];\n output = transport[1];\n }\n }\n var commandLineMessage = 'Use arguments of createConnection or set command line parameters: \\'--node-ipc\\', \\'--stdio\\' or \\'--socket={number}\\'';\n if (!input) {\n throw new Error('Connection input stream is not set. ' + commandLineMessage);\n }\n if (!output) {\n throw new Error('Connection output stream is not set. ' + commandLineMessage);\n }\n // Backwards compatibility\n if (Is.func(input.read) && Is.func(input.on)) {\n let inputStream = input;\n inputStream.on('end', () => {\n endProtocolConnection();\n process.exit(_shutdownReceived ? 0 : 1);\n });\n inputStream.on('close', () => {\n endProtocolConnection();\n process.exit(_shutdownReceived ? 0 : 1);\n });\n }\n const connectionFactory = (logger) => {\n const result = (0, node_1.createProtocolConnection)(input, output, logger, options);\n if (stdio) {\n patchConsole(logger);\n }\n return result;\n };\n return (0, server_1.createConnection)(connectionFactory, watchDog, factories);\n}\nfunction patchConsole(logger) {\n function serialize(args) {\n return args.map(arg => typeof arg === 'string' ? arg : (0, node_util_1.inspect)(arg)).join(' ');\n }\n const counters = new Map();\n console.assert = function assert(assertion, ...args) {\n if (assertion) {\n return;\n }\n if (args.length === 0) {\n logger.error('Assertion failed');\n }\n else {\n const [message, ...rest] = args;\n logger.error(`Assertion failed: ${message} ${serialize(rest)}`);\n }\n };\n console.count = function count(label = 'default') {\n const message = String(label);\n let counter = counters.get(message) ?? 0;\n counter += 1;\n counters.set(message, counter);\n logger.log(`${message}: ${message}`);\n };\n console.countReset = function countReset(label) {\n if (label === undefined) {\n counters.clear();\n }\n else {\n counters.delete(String(label));\n }\n };\n console.debug = function debug(...args) {\n logger.log(serialize(args));\n };\n console.dir = function dir(arg, options) {\n // @ts-expect-error https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66626\n logger.log((0, node_util_1.inspect)(arg, options));\n };\n console.log = function log(...args) {\n logger.log(serialize(args));\n };\n console.error = function error(...args) {\n logger.error(serialize(args));\n };\n console.trace = function trace(...args) {\n const stack = new Error().stack.replace(/(.+\\n){2}/, '');\n let message = 'Trace';\n if (args.length !== 0) {\n message += `: ${serialize(args)}`;\n }\n logger.log(`${message}\\n${stack}`);\n };\n console.warn = function warn(...args) {\n logger.warn(serialize(args));\n };\n}\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\n'use strict';\n\nmodule.exports = require('./lib/node/main');",null,"'use strict'\n\nexports.fromCallback = function (fn) {\n return Object.defineProperty(function (...args) {\n if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n else {\n return new Promise((resolve, reject) => {\n args.push((err, res) => (err != null) ? reject(err) : resolve(res))\n fn.apply(this, args)\n })\n }\n }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n return Object.defineProperty(function (...args) {\n const cb = args[args.length - 1]\n if (typeof cb !== 'function') return fn.apply(this, args)\n else {\n args.pop()\n fn.apply(this, args).then(r => cb(null, r), cb)\n }\n }, 'name', { value: fn.name })\n}\n","var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (fs.chmod && !fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (fs.chown && !fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = typeof fs.rename !== 'function' ? fs.rename\n : (function (fs$rename) {\n function rename (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\" || er.code === \"EBUSY\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n return rename\n })(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = typeof fs.read !== 'function' ? fs.read\n : (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else if (fs.futimes) {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n","var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n","'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n","var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n resetQueue()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n resetQueue()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb, startTime) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb, startTime) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb, startTime) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return go$copyFile(src, dest, flags, cb)\n\n function go$copyFile (src, dest, flags, cb, startTime) {\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n var noReaddirOptionVersions = /^v[0-5]\\./\n function readdir (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n var go$readdir = noReaddirOptionVersions.test(process.version)\n ? function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n : function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, options, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n\n return go$readdir(path, options, cb)\n\n function fs$readdirCallback (path, options, cb, startTime) {\n return function (err, files) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([\n go$readdir,\n [path, options, cb],\n err,\n startTime || Date.now(),\n Date.now()\n ])\n else {\n if (files && files.sort)\n files.sort()\n\n if (typeof cb === 'function')\n cb.call(this, err, files)\n }\n }\n }\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb, startTime) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}\n\nfunction retry () {\n // clear the timer and remove it to help prevent unintended concurrency\n clearTimeout(retryTimer)\n retryTimer = undefined\n\n if (fs[gracefulQueue].length === 0)\n return\n\n var elem = fs[gracefulQueue].shift()\n var fn = elem[0]\n var args = elem[1]\n // these items may be unset if they were added by an older graceful-fs\n var err = elem[2]\n var startTime = elem[3]\n var lastTime = elem[4]\n\n // if we don't have a startTime we have no way of knowing if we've waited\n // long enough, so go ahead and retry this item now\n if (startTime === undefined) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args)\n } else if (Date.now() - startTime >= 60000) {\n // it's been more than 60 seconds total, bail now\n debug('TIMEOUT', fn.name, args)\n var cb = args.pop()\n if (typeof cb === 'function')\n cb.call(null, err)\n } else {\n // the amount of time between the last attempt and right now\n var sinceAttempt = Date.now() - lastTime\n // the amount of time between when we first tried, and when we last tried\n // rounded up to at least 1\n var sinceStart = Math.max(lastTime - startTime, 1)\n // backoff. wait longer than the total time we've been retrying, but only\n // up to a maximum of 100ms\n var desiredDelay = Math.min(sinceStart * 1.2, 100)\n // it's been long enough since the last retry, do it again\n if (sinceAttempt >= desiredDelay) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args.concat([startTime]))\n } else {\n // if we can't do this job yet, push it to the end of the queue\n // and let the next iteration check again\n fs[gracefulQueue].push(elem)\n }\n }\n\n // schedule our next run if one isn't already scheduled\n if (retryTimer === undefined) {\n retryTimer = setTimeout(retry, 0)\n }\n}\n","'use strict'\n// This is adapted from https://github.com/normalize/mz\n// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\n\nconst api = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'close',\n 'copyFile',\n 'fchmod',\n 'fchown',\n 'fdatasync',\n 'fstat',\n 'fsync',\n 'ftruncate',\n 'futimes',\n 'lchmod',\n 'lchown',\n 'link',\n 'lstat',\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir',\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'rename',\n 'rm',\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile'\n].filter(key => {\n // Some commands are not available on some systems. Ex:\n // fs.cp was added in Node.js v16.7.0\n // fs.lchown is not available on at least some Linux\n return typeof fs[key] === 'function'\n})\n\n// Export cloned fs:\nObject.assign(exports, fs)\n\n// Universalify async methods:\napi.forEach(method => {\n exports[method] = u(fs[method])\n})\n\n// We differ from mz/fs in that we still ship the old, broken, fs.exists()\n// since we are a drop-in replacement for the native module\nexports.exists = function (filename, callback) {\n if (typeof callback === 'function') {\n return fs.exists(filename, callback)\n }\n return new Promise(resolve => {\n return fs.exists(filename, resolve)\n })\n}\n\n// fs.read(), fs.write(), fs.readv(), & fs.writev() need special treatment due to multiple callback args\n\nexports.read = function (fd, buffer, offset, length, position, callback) {\n if (typeof callback === 'function') {\n return fs.read(fd, buffer, offset, length, position, callback)\n }\n return new Promise((resolve, reject) => {\n fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {\n if (err) return reject(err)\n resolve({ bytesRead, buffer })\n })\n })\n}\n\n// Function signature can be\n// fs.write(fd, buffer[, offset[, length[, position]]], callback)\n// OR\n// fs.write(fd, string[, position[, encoding]], callback)\n// We need to handle both cases, so we use ...args\nexports.write = function (fd, buffer, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.write(fd, buffer, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffer })\n })\n })\n}\n\n// Function signature is\n// s.readv(fd, buffers[, position], callback)\n// We need to handle the optional arg, so we use ...args\nexports.readv = function (fd, buffers, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.readv(fd, buffers, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {\n if (err) return reject(err)\n resolve({ bytesRead, buffers })\n })\n })\n}\n\n// Function signature is\n// s.writev(fd, buffers[, position], callback)\n// We need to handle the optional arg, so we use ...args\nexports.writev = function (fd, buffers, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.writev(fd, buffers, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffers })\n })\n })\n}\n\n// fs.realpath.native sometimes not available if fs is monkey-patched\nif (typeof fs.realpath.native === 'function') {\n exports.realpath.native = u(fs.realpath.native)\n} else {\n process.emitWarning(\n 'fs.realpath.native is not a function. Is fs being monkey-patched?',\n 'Warning', 'fs-extra-WARN0003'\n )\n}\n","// Adapted from https://github.com/sindresorhus/make-dir\n// Copyright (c) Sindre Sorhus (sindresorhus.com)\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict'\nconst path = require('path')\n\n// https://github.com/nodejs/node/issues/8987\n// https://github.com/libuv/libuv/pull/1088\nmodule.exports.checkPath = function checkPath (pth) {\n if (process.platform === 'win32') {\n const pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(path.parse(pth).root, ''))\n\n if (pathHasInvalidWinCharacters) {\n const error = new Error(`Path contains invalid characters: ${pth}`)\n error.code = 'EINVAL'\n throw error\n }\n }\n}\n","'use strict'\nconst fs = require('../fs')\nconst { checkPath } = require('./utils')\n\nconst getMode = options => {\n const defaults = { mode: 0o777 }\n if (typeof options === 'number') return options\n return ({ ...defaults, ...options }).mode\n}\n\nmodule.exports.makeDir = async (dir, options) => {\n checkPath(dir)\n\n return fs.mkdir(dir, {\n mode: getMode(options),\n recursive: true\n })\n}\n\nmodule.exports.makeDirSync = (dir, options) => {\n checkPath(dir)\n\n return fs.mkdirSync(dir, {\n mode: getMode(options),\n recursive: true\n })\n}\n","'use strict'\nconst u = require('universalify').fromPromise\nconst { makeDir: _makeDir, makeDirSync } = require('./make-dir')\nconst makeDir = u(_makeDir)\n\nmodule.exports = {\n mkdirs: makeDir,\n mkdirsSync: makeDirSync,\n // alias\n mkdirp: makeDir,\n mkdirpSync: makeDirSync,\n ensureDir: makeDir,\n ensureDirSync: makeDirSync\n}\n","'use strict'\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\n\nfunction pathExists (path) {\n return fs.access(path).then(() => true).catch(() => false)\n}\n\nmodule.exports = {\n pathExists: u(pathExists),\n pathExistsSync: fs.existsSync\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst u = require('universalify').fromPromise\n\nasync function utimesMillis (path, atime, mtime) {\n // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)\n const fd = await fs.open(path, 'r+')\n\n let closeErr = null\n\n try {\n await fs.futimes(fd, atime, mtime)\n } finally {\n try {\n await fs.close(fd)\n } catch (e) {\n closeErr = e\n }\n }\n\n if (closeErr) {\n throw closeErr\n }\n}\n\nfunction utimesMillisSync (path, atime, mtime) {\n const fd = fs.openSync(path, 'r+')\n fs.futimesSync(fd, atime, mtime)\n return fs.closeSync(fd)\n}\n\nmodule.exports = {\n utimesMillis: u(utimesMillis),\n utimesMillisSync\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst u = require('universalify').fromPromise\n\nfunction getStats (src, dest, opts) {\n const statFunc = opts.dereference\n ? (file) => fs.stat(file, { bigint: true })\n : (file) => fs.lstat(file, { bigint: true })\n return Promise.all([\n statFunc(src),\n statFunc(dest).catch(err => {\n if (err.code === 'ENOENT') return null\n throw err\n })\n ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))\n}\n\nfunction getStatsSync (src, dest, opts) {\n let destStat\n const statFunc = opts.dereference\n ? (file) => fs.statSync(file, { bigint: true })\n : (file) => fs.lstatSync(file, { bigint: true })\n const srcStat = statFunc(src)\n try {\n destStat = statFunc(dest)\n } catch (err) {\n if (err.code === 'ENOENT') return { srcStat, destStat: null }\n throw err\n }\n return { srcStat, destStat }\n}\n\nasync function checkPaths (src, dest, funcName, opts) {\n const { srcStat, destStat } = await getStats(src, dest, opts)\n if (destStat) {\n if (areIdentical(srcStat, destStat)) {\n const srcBaseName = path.basename(src)\n const destBaseName = path.basename(dest)\n if (funcName === 'move' &&\n srcBaseName !== destBaseName &&\n srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n return { srcStat, destStat, isChangingCase: true }\n }\n throw new Error('Source and destination must not be the same.')\n }\n if (srcStat.isDirectory() && !destStat.isDirectory()) {\n throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n }\n if (!srcStat.isDirectory() && destStat.isDirectory()) {\n throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)\n }\n }\n\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n\n return { srcStat, destStat }\n}\n\nfunction checkPathsSync (src, dest, funcName, opts) {\n const { srcStat, destStat } = getStatsSync(src, dest, opts)\n\n if (destStat) {\n if (areIdentical(srcStat, destStat)) {\n const srcBaseName = path.basename(src)\n const destBaseName = path.basename(dest)\n if (funcName === 'move' &&\n srcBaseName !== destBaseName &&\n srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n return { srcStat, destStat, isChangingCase: true }\n }\n throw new Error('Source and destination must not be the same.')\n }\n if (srcStat.isDirectory() && !destStat.isDirectory()) {\n throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n }\n if (!srcStat.isDirectory() && destStat.isDirectory()) {\n throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)\n }\n }\n\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return { srcStat, destStat }\n}\n\n// recursively check if dest parent is a subdirectory of src.\n// It works for all file types including symlinks since it\n// checks the src and dest inodes. It starts from the deepest\n// parent and stops once it reaches the src parent or the root path.\nasync function checkParentPaths (src, srcStat, dest, funcName) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return\n\n let destStat\n try {\n destStat = await fs.stat(destParent, { bigint: true })\n } catch (err) {\n if (err.code === 'ENOENT') return\n throw err\n }\n\n if (areIdentical(srcStat, destStat)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n\n return checkParentPaths(src, srcStat, destParent, funcName)\n}\n\nfunction checkParentPathsSync (src, srcStat, dest, funcName) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return\n let destStat\n try {\n destStat = fs.statSync(destParent, { bigint: true })\n } catch (err) {\n if (err.code === 'ENOENT') return\n throw err\n }\n if (areIdentical(srcStat, destStat)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return checkParentPathsSync(src, srcStat, destParent, funcName)\n}\n\nfunction areIdentical (srcStat, destStat) {\n return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev\n}\n\n// return true if dest is a subdir of src, otherwise false.\n// It only checks the path strings.\nfunction isSrcSubdir (src, dest) {\n const srcArr = path.resolve(src).split(path.sep).filter(i => i)\n const destArr = path.resolve(dest).split(path.sep).filter(i => i)\n return srcArr.every((cur, i) => destArr[i] === cur)\n}\n\nfunction errMsg (src, dest, funcName) {\n return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`\n}\n\nmodule.exports = {\n // checkPaths\n checkPaths: u(checkPaths),\n checkPathsSync,\n // checkParent\n checkParentPaths: u(checkParentPaths),\n checkParentPathsSync,\n // Misc\n isSrcSubdir,\n areIdentical\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst { mkdirs } = require('../mkdirs')\nconst { pathExists } = require('../path-exists')\nconst { utimesMillis } = require('../util/utimes')\nconst stat = require('../util/stat')\n\nasync function copy (src, dest, opts = {}) {\n if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n process.emitWarning(\n 'Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n' +\n '\\tsee https://github.com/jprichardson/node-fs-extra/issues/269',\n 'Warning', 'fs-extra-WARN0001'\n )\n }\n\n const { srcStat, destStat } = await stat.checkPaths(src, dest, 'copy', opts)\n\n await stat.checkParentPaths(src, srcStat, dest, 'copy')\n\n const include = await runFilter(src, dest, opts)\n\n if (!include) return\n\n // check if the parent of dest exists, and create it if it doesn't exist\n const destParent = path.dirname(dest)\n const dirExists = await pathExists(destParent)\n if (!dirExists) {\n await mkdirs(destParent)\n }\n\n await getStatsAndPerformCopy(destStat, src, dest, opts)\n}\n\nasync function runFilter (src, dest, opts) {\n if (!opts.filter) return true\n return opts.filter(src, dest)\n}\n\nasync function getStatsAndPerformCopy (destStat, src, dest, opts) {\n const statFn = opts.dereference ? fs.stat : fs.lstat\n const srcStat = await statFn(src)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n\n if (\n srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()\n ) return onFile(srcStat, destStat, src, dest, opts)\n\n if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)\n if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)\n throw new Error(`Unknown file: ${src}`)\n}\n\nasync function onFile (srcStat, destStat, src, dest, opts) {\n if (!destStat) return copyFile(srcStat, src, dest, opts)\n\n if (opts.overwrite) {\n await fs.unlink(dest)\n return copyFile(srcStat, src, dest, opts)\n }\n if (opts.errorOnExist) {\n throw new Error(`'${dest}' already exists`)\n }\n}\n\nasync function copyFile (srcStat, src, dest, opts) {\n await fs.copyFile(src, dest)\n if (opts.preserveTimestamps) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcStat.mode)) {\n await makeFileWritable(dest, srcStat.mode)\n }\n\n // Set timestamps and mode correspondingly\n\n // Note that The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n const updatedSrcStat = await fs.stat(src)\n await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n }\n\n return fs.chmod(dest, srcStat.mode)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n return fs.chmod(dest, srcMode | 0o200)\n}\n\nasync function onDir (srcStat, destStat, src, dest, opts) {\n // the dest directory might not exist, create it\n if (!destStat) {\n await fs.mkdir(dest)\n }\n\n const items = await fs.readdir(src)\n\n // loop through the files in the current directory to copy everything\n await Promise.all(items.map(async item => {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n\n // skip the item if it is matches by the filter function\n const include = await runFilter(srcItem, destItem, opts)\n if (!include) return\n\n const { destStat } = await stat.checkPaths(srcItem, destItem, 'copy', opts)\n\n // If the item is a copyable file, `getStatsAndPerformCopy` will copy it\n // If the item is a directory, `getStatsAndPerformCopy` will call `onDir` recursively\n return getStatsAndPerformCopy(destStat, srcItem, destItem, opts)\n }))\n\n if (!destStat) {\n await fs.chmod(dest, srcStat.mode)\n }\n}\n\nasync function onLink (destStat, src, dest, opts) {\n let resolvedSrc = await fs.readlink(src)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n if (!destStat) {\n return fs.symlink(resolvedSrc, dest)\n }\n\n let resolvedDest = null\n try {\n resolvedDest = await fs.readlink(dest)\n } catch (e) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (e.code === 'EINVAL' || e.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest)\n throw e\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n }\n\n // do not copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n }\n\n // copy the link\n await fs.unlink(dest)\n return fs.symlink(resolvedSrc, dest)\n}\n\nmodule.exports = copy\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirsSync = require('../mkdirs').mkdirsSync\nconst utimesMillisSync = require('../util/utimes').utimesMillisSync\nconst stat = require('../util/stat')\n\nfunction copySync (src, dest, opts) {\n if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n opts = opts || {}\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n process.emitWarning(\n 'Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n' +\n '\\tsee https://github.com/jprichardson/node-fs-extra/issues/269',\n 'Warning', 'fs-extra-WARN0002'\n )\n }\n\n const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)\n stat.checkParentPathsSync(src, srcStat, dest, 'copy')\n if (opts.filter && !opts.filter(src, dest)) return\n const destParent = path.dirname(dest)\n if (!fs.existsSync(destParent)) mkdirsSync(destParent)\n return getStats(destStat, src, dest, opts)\n}\n\nfunction getStats (destStat, src, dest, opts) {\n const statSync = opts.dereference ? fs.statSync : fs.lstatSync\n const srcStat = statSync(src)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)\n else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)\n throw new Error(`Unknown file: ${src}`)\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts) {\n if (!destStat) return copyFile(srcStat, src, dest, opts)\n return mayCopyFile(srcStat, src, dest, opts)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts) {\n if (opts.overwrite) {\n fs.unlinkSync(dest)\n return copyFile(srcStat, src, dest, opts)\n } else if (opts.errorOnExist) {\n throw new Error(`'${dest}' already exists`)\n }\n}\n\nfunction copyFile (srcStat, src, dest, opts) {\n fs.copyFileSync(src, dest)\n if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)\n return setDestMode(dest, srcStat.mode)\n}\n\nfunction handleTimestamps (srcMode, src, dest) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)\n return setDestTimestamps(src, dest)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n return setDestMode(dest, srcMode | 0o200)\n}\n\nfunction setDestMode (dest, srcMode) {\n return fs.chmodSync(dest, srcMode)\n}\n\nfunction setDestTimestamps (src, dest) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n const updatedSrcStat = fs.statSync(src)\n return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)\n return copyDir(src, dest, opts)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts) {\n fs.mkdirSync(dest)\n copyDir(src, dest, opts)\n return setDestMode(dest, srcMode)\n}\n\nfunction copyDir (src, dest, opts) {\n fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))\n}\n\nfunction copyDirItem (item, src, dest, opts) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n if (opts.filter && !opts.filter(srcItem, destItem)) return\n const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)\n return getStats(destStat, srcItem, destItem, opts)\n}\n\nfunction onLink (destStat, src, dest, opts) {\n let resolvedSrc = fs.readlinkSync(src)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlinkSync(resolvedSrc, dest)\n } else {\n let resolvedDest\n try {\n resolvedDest = fs.readlinkSync(dest)\n } catch (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)\n throw err\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n }\n\n // prevent copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n }\n return copyLink(resolvedSrc, dest)\n }\n}\n\nfunction copyLink (resolvedSrc, dest) {\n fs.unlinkSync(dest)\n return fs.symlinkSync(resolvedSrc, dest)\n}\n\nmodule.exports = copySync\n","'use strict'\n\nconst u = require('universalify').fromPromise\nmodule.exports = {\n copy: u(require('./copy')),\n copySync: require('./copy-sync')\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst u = require('universalify').fromCallback\n\nfunction remove (path, callback) {\n fs.rm(path, { recursive: true, force: true }, callback)\n}\n\nfunction removeSync (path) {\n fs.rmSync(path, { recursive: true, force: true })\n}\n\nmodule.exports = {\n remove: u(remove),\n removeSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst remove = require('../remove')\n\nconst emptyDir = u(async function emptyDir (dir) {\n let items\n try {\n items = await fs.readdir(dir)\n } catch {\n return mkdir.mkdirs(dir)\n }\n\n return Promise.all(items.map(item => remove.remove(path.join(dir, item))))\n})\n\nfunction emptyDirSync (dir) {\n let items\n try {\n items = fs.readdirSync(dir)\n } catch {\n return mkdir.mkdirsSync(dir)\n }\n\n items.forEach(item => {\n item = path.join(dir, item)\n remove.removeSync(item)\n })\n}\n\nmodule.exports = {\n emptyDirSync,\n emptydirSync: emptyDirSync,\n emptyDir,\n emptydir: emptyDir\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst path = require('path')\nconst fs = require('../fs')\nconst mkdir = require('../mkdirs')\n\nasync function createFile (file) {\n let stats\n try {\n stats = await fs.stat(file)\n } catch { }\n if (stats && stats.isFile()) return\n\n const dir = path.dirname(file)\n\n let dirStats = null\n try {\n dirStats = await fs.stat(dir)\n } catch (err) {\n // if the directory doesn't exist, make it\n if (err.code === 'ENOENT') {\n await mkdir.mkdirs(dir)\n await fs.writeFile(file, '')\n return\n } else {\n throw err\n }\n }\n\n if (dirStats.isDirectory()) {\n await fs.writeFile(file, '')\n } else {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n await fs.readdir(dir)\n }\n}\n\nfunction createFileSync (file) {\n let stats\n try {\n stats = fs.statSync(file)\n } catch { }\n if (stats && stats.isFile()) return\n\n const dir = path.dirname(file)\n try {\n if (!fs.statSync(dir).isDirectory()) {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdirSync(dir)\n }\n } catch (err) {\n // If the stat call above failed because the directory doesn't exist, create it\n if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)\n else throw err\n }\n\n fs.writeFileSync(file, '')\n}\n\nmodule.exports = {\n createFile: u(createFile),\n createFileSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst path = require('path')\nconst fs = require('../fs')\nconst mkdir = require('../mkdirs')\nconst { pathExists } = require('../path-exists')\nconst { areIdentical } = require('../util/stat')\n\nasync function createLink (srcpath, dstpath) {\n let dstStat\n try {\n dstStat = await fs.lstat(dstpath)\n } catch {\n // ignore error\n }\n\n let srcStat\n try {\n srcStat = await fs.lstat(srcpath)\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n throw err\n }\n\n if (dstStat && areIdentical(srcStat, dstStat)) return\n\n const dir = path.dirname(dstpath)\n\n const dirExists = await pathExists(dir)\n\n if (!dirExists) {\n await mkdir.mkdirs(dir)\n }\n\n await fs.link(srcpath, dstpath)\n}\n\nfunction createLinkSync (srcpath, dstpath) {\n let dstStat\n try {\n dstStat = fs.lstatSync(dstpath)\n } catch {}\n\n try {\n const srcStat = fs.lstatSync(srcpath)\n if (dstStat && areIdentical(srcStat, dstStat)) return\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n throw err\n }\n\n const dir = path.dirname(dstpath)\n const dirExists = fs.existsSync(dir)\n if (dirExists) return fs.linkSync(srcpath, dstpath)\n mkdir.mkdirsSync(dir)\n\n return fs.linkSync(srcpath, dstpath)\n}\n\nmodule.exports = {\n createLink: u(createLink),\n createLinkSync\n}\n","'use strict'\n\nconst path = require('path')\nconst fs = require('../fs')\nconst { pathExists } = require('../path-exists')\n\nconst u = require('universalify').fromPromise\n\n/**\n * Function that returns two types of paths, one relative to symlink, and one\n * relative to the current working directory. Checks if path is absolute or\n * relative. If the path is relative, this function checks if the path is\n * relative to symlink or relative to current working directory. This is an\n * initiative to find a smarter `srcpath` to supply when building symlinks.\n * This allows you to determine which path to use out of one of three possible\n * types of source paths. The first is an absolute path. This is detected by\n * `path.isAbsolute()`. When an absolute path is provided, it is checked to\n * see if it exists. If it does it's used, if not an error is returned\n * (callback)/ thrown (sync). The other two options for `srcpath` are a\n * relative url. By default Node's `fs.symlink` works by creating a symlink\n * using `dstpath` and expects the `srcpath` to be relative to the newly\n * created symlink. If you provide a `srcpath` that does not exist on the file\n * system it results in a broken symlink. To minimize this, the function\n * checks to see if the 'relative to symlink' source file exists, and if it\n * does it will use it. If it does not, it checks if there's a file that\n * exists that is relative to the current working directory, if does its used.\n * This preserves the expectations of the original fs.symlink spec and adds\n * the ability to pass in `relative to current working direcotry` paths.\n */\n\nasync function symlinkPaths (srcpath, dstpath) {\n if (path.isAbsolute(srcpath)) {\n try {\n await fs.lstat(srcpath)\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n throw err\n }\n\n return {\n toCwd: srcpath,\n toDst: srcpath\n }\n }\n\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n\n const exists = await pathExists(relativeToDst)\n if (exists) {\n return {\n toCwd: relativeToDst,\n toDst: srcpath\n }\n }\n\n try {\n await fs.lstat(srcpath)\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n throw err\n }\n\n return {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n }\n}\n\nfunction symlinkPathsSync (srcpath, dstpath) {\n if (path.isAbsolute(srcpath)) {\n const exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('absolute srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: srcpath\n }\n }\n\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n const exists = fs.existsSync(relativeToDst)\n if (exists) {\n return {\n toCwd: relativeToDst,\n toDst: srcpath\n }\n }\n\n const srcExists = fs.existsSync(srcpath)\n if (!srcExists) throw new Error('relative srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n }\n}\n\nmodule.exports = {\n symlinkPaths: u(symlinkPaths),\n symlinkPathsSync\n}\n","'use strict'\n\nconst fs = require('../fs')\nconst u = require('universalify').fromPromise\n\nasync function symlinkType (srcpath, type) {\n if (type) return type\n\n let stats\n try {\n stats = await fs.lstat(srcpath)\n } catch {\n return 'file'\n }\n\n return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nfunction symlinkTypeSync (srcpath, type) {\n if (type) return type\n\n let stats\n try {\n stats = fs.lstatSync(srcpath)\n } catch {\n return 'file'\n }\n return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nmodule.exports = {\n symlinkType: u(symlinkType),\n symlinkTypeSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst path = require('path')\nconst fs = require('../fs')\n\nconst { mkdirs, mkdirsSync } = require('../mkdirs')\n\nconst { symlinkPaths, symlinkPathsSync } = require('./symlink-paths')\nconst { symlinkType, symlinkTypeSync } = require('./symlink-type')\n\nconst { pathExists } = require('../path-exists')\n\nconst { areIdentical } = require('../util/stat')\n\nasync function createSymlink (srcpath, dstpath, type) {\n let stats\n try {\n stats = await fs.lstat(dstpath)\n } catch { }\n\n if (stats && stats.isSymbolicLink()) {\n const [srcStat, dstStat] = await Promise.all([\n fs.stat(srcpath),\n fs.stat(dstpath)\n ])\n\n if (areIdentical(srcStat, dstStat)) return\n }\n\n const relative = await symlinkPaths(srcpath, dstpath)\n srcpath = relative.toDst\n const toType = await symlinkType(relative.toCwd, type)\n const dir = path.dirname(dstpath)\n\n if (!(await pathExists(dir))) {\n await mkdirs(dir)\n }\n\n return fs.symlink(srcpath, dstpath, toType)\n}\n\nfunction createSymlinkSync (srcpath, dstpath, type) {\n let stats\n try {\n stats = fs.lstatSync(dstpath)\n } catch { }\n if (stats && stats.isSymbolicLink()) {\n const srcStat = fs.statSync(srcpath)\n const dstStat = fs.statSync(dstpath)\n if (areIdentical(srcStat, dstStat)) return\n }\n\n const relative = symlinkPathsSync(srcpath, dstpath)\n srcpath = relative.toDst\n type = symlinkTypeSync(relative.toCwd, type)\n const dir = path.dirname(dstpath)\n const exists = fs.existsSync(dir)\n if (exists) return fs.symlinkSync(srcpath, dstpath, type)\n mkdirsSync(dir)\n return fs.symlinkSync(srcpath, dstpath, type)\n}\n\nmodule.exports = {\n createSymlink: u(createSymlink),\n createSymlinkSync\n}\n","'use strict'\n\nconst { createFile, createFileSync } = require('./file')\nconst { createLink, createLinkSync } = require('./link')\nconst { createSymlink, createSymlinkSync } = require('./symlink')\n\nmodule.exports = {\n // file\n createFile,\n createFileSync,\n ensureFile: createFile,\n ensureFileSync: createFileSync,\n // link\n createLink,\n createLinkSync,\n ensureLink: createLink,\n ensureLinkSync: createLinkSync,\n // symlink\n createSymlink,\n createSymlinkSync,\n ensureSymlink: createSymlink,\n ensureSymlinkSync: createSymlinkSync\n}\n","function stringify (obj, { EOL = '\\n', finalEOL = true, replacer = null, spaces } = {}) {\n const EOF = finalEOL ? EOL : ''\n const str = JSON.stringify(obj, replacer, spaces)\n\n return str.replace(/\\n/g, EOL) + EOF\n}\n\nfunction stripBom (content) {\n // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified\n if (Buffer.isBuffer(content)) content = content.toString('utf8')\n return content.replace(/^\\uFEFF/, '')\n}\n\nmodule.exports = { stringify, stripBom }\n","let _fs\ntry {\n _fs = require('graceful-fs')\n} catch (_) {\n _fs = require('fs')\n}\nconst universalify = require('universalify')\nconst { stringify, stripBom } = require('./utils')\n\nasync function _readFile (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n let data = await universalify.fromCallback(fs.readFile)(file, options)\n\n data = stripBom(data)\n\n let obj\n try {\n obj = JSON.parse(data, options ? options.reviver : null)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n\n return obj\n}\n\nconst readFile = universalify.fromPromise(_readFile)\n\nfunction readFileSync (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n try {\n let content = fs.readFileSync(file, options)\n content = stripBom(content)\n return JSON.parse(content, options.reviver)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n}\n\nasync function _writeFile (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n\n await universalify.fromCallback(fs.writeFile)(file, str, options)\n}\n\nconst writeFile = universalify.fromPromise(_writeFile)\n\nfunction writeFileSync (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n // not sure if fs.writeFileSync returns anything, but just in case\n return fs.writeFileSync(file, str, options)\n}\n\nconst jsonfile = {\n readFile,\n readFileSync,\n writeFile,\n writeFileSync\n}\n\nmodule.exports = jsonfile\n","'use strict'\n\nconst jsonFile = require('jsonfile')\n\nmodule.exports = {\n // jsonfile exports\n readJson: jsonFile.readFile,\n readJsonSync: jsonFile.readFileSync,\n writeJson: jsonFile.writeFile,\n writeJsonSync: jsonFile.writeFileSync\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nasync function outputFile (file, data, encoding = 'utf-8') {\n const dir = path.dirname(file)\n\n if (!(await pathExists(dir))) {\n await mkdir.mkdirs(dir)\n }\n\n return fs.writeFile(file, data, encoding)\n}\n\nfunction outputFileSync (file, ...args) {\n const dir = path.dirname(file)\n if (!fs.existsSync(dir)) {\n mkdir.mkdirsSync(dir)\n }\n\n fs.writeFileSync(file, ...args)\n}\n\nmodule.exports = {\n outputFile: u(outputFile),\n outputFileSync\n}\n","'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFile } = require('../output-file')\n\nasync function outputJson (file, data, options = {}) {\n const str = stringify(data, options)\n\n await outputFile(file, str, options)\n}\n\nmodule.exports = outputJson\n","'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFileSync } = require('../output-file')\n\nfunction outputJsonSync (file, data, options) {\n const str = stringify(data, options)\n\n outputFileSync(file, str, options)\n}\n\nmodule.exports = outputJsonSync\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst jsonFile = require('./jsonfile')\n\njsonFile.outputJson = u(require('./output-json'))\njsonFile.outputJsonSync = require('./output-json-sync')\n// aliases\njsonFile.outputJSON = jsonFile.outputJson\njsonFile.outputJSONSync = jsonFile.outputJsonSync\njsonFile.writeJSON = jsonFile.writeJson\njsonFile.writeJSONSync = jsonFile.writeJsonSync\njsonFile.readJSON = jsonFile.readJson\njsonFile.readJSONSync = jsonFile.readJsonSync\n\nmodule.exports = jsonFile\n","'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst { copy } = require('../copy')\nconst { remove } = require('../remove')\nconst { mkdirp } = require('../mkdirs')\nconst { pathExists } = require('../path-exists')\nconst stat = require('../util/stat')\n\nasync function move (src, dest, opts = {}) {\n const overwrite = opts.overwrite || opts.clobber || false\n\n const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, 'move', opts)\n\n await stat.checkParentPaths(src, srcStat, dest, 'move')\n\n // If the parent of dest is not root, make sure it exists before proceeding\n const destParent = path.dirname(dest)\n const parsedParentPath = path.parse(destParent)\n if (parsedParentPath.root !== destParent) {\n await mkdirp(destParent)\n }\n\n return doRename(src, dest, overwrite, isChangingCase)\n}\n\nasync function doRename (src, dest, overwrite, isChangingCase) {\n if (!isChangingCase) {\n if (overwrite) {\n await remove(dest)\n } else if (await pathExists(dest)) {\n throw new Error('dest already exists.')\n }\n }\n\n try {\n // Try w/ rename first, and try copy + remove if EXDEV\n await fs.rename(src, dest)\n } catch (err) {\n if (err.code !== 'EXDEV') {\n throw err\n }\n await moveAcrossDevice(src, dest, overwrite)\n }\n}\n\nasync function moveAcrossDevice (src, dest, overwrite) {\n const opts = {\n overwrite,\n errorOnExist: true,\n preserveTimestamps: true\n }\n\n await copy(src, dest, opts)\n return remove(src)\n}\n\nmodule.exports = move\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copySync = require('../copy').copySync\nconst removeSync = require('../remove').removeSync\nconst mkdirpSync = require('../mkdirs').mkdirpSync\nconst stat = require('../util/stat')\n\nfunction moveSync (src, dest, opts) {\n opts = opts || {}\n const overwrite = opts.overwrite || opts.clobber || false\n\n const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)\n stat.checkParentPathsSync(src, srcStat, dest, 'move')\n if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))\n return doRename(src, dest, overwrite, isChangingCase)\n}\n\nfunction isParentRoot (dest) {\n const parent = path.dirname(dest)\n const parsedPath = path.parse(parent)\n return parsedPath.root === parent\n}\n\nfunction doRename (src, dest, overwrite, isChangingCase) {\n if (isChangingCase) return rename(src, dest, overwrite)\n if (overwrite) {\n removeSync(dest)\n return rename(src, dest, overwrite)\n }\n if (fs.existsSync(dest)) throw new Error('dest already exists.')\n return rename(src, dest, overwrite)\n}\n\nfunction rename (src, dest, overwrite) {\n try {\n fs.renameSync(src, dest)\n } catch (err) {\n if (err.code !== 'EXDEV') throw err\n return moveAcrossDevice(src, dest, overwrite)\n }\n}\n\nfunction moveAcrossDevice (src, dest, overwrite) {\n const opts = {\n overwrite,\n errorOnExist: true,\n preserveTimestamps: true\n }\n copySync(src, dest, opts)\n return removeSync(src)\n}\n\nmodule.exports = moveSync\n","'use strict'\n\nconst u = require('universalify').fromPromise\nmodule.exports = {\n move: u(require('./move')),\n moveSync: require('./move-sync')\n}\n","'use strict'\n\nmodule.exports = {\n // Export promiseified graceful-fs:\n ...require('./fs'),\n // Export extra methods:\n ...require('./copy'),\n ...require('./empty'),\n ...require('./ensure'),\n ...require('./json'),\n ...require('./mkdirs'),\n ...require('./move'),\n ...require('./output-file'),\n ...require('./path-exists'),\n ...require('./remove')\n}\n","var LIB;(()=>{\"use strict\";var t={470:t=>{function e(t){if(\"string\"!=typeof t)throw new TypeError(\"Path must be a string. Received \"+JSON.stringify(t))}function r(t,e){for(var r,n=\"\",i=0,o=-1,s=0,h=0;h<=t.length;++h){if(h2){var a=n.lastIndexOf(\"/\");if(a!==n.length-1){-1===a?(n=\"\",i=0):i=(n=n.slice(0,a)).length-1-n.lastIndexOf(\"/\"),o=h,s=0;continue}}else if(2===n.length||1===n.length){n=\"\",i=0,o=h,s=0;continue}e&&(n.length>0?n+=\"/..\":n=\"..\",i=2)}else n.length>0?n+=\"/\"+t.slice(o+1,h):n=t.slice(o+1,h),i=h-o-1;o=h,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var t,n=\"\",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===t&&(t=process.cwd()),s=t),e(s),0!==s.length&&(n=s+\"/\"+n,i=47===s.charCodeAt(0))}return n=r(n,!i),i?n.length>0?\"/\"+n:\"/\":n.length>0?n:\".\"},normalize:function(t){if(e(t),0===t.length)return\".\";var n=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=r(t,!n)).length||n||(t=\".\"),t.length>0&&i&&(t+=\"/\"),n?\"/\"+t:t},isAbsolute:function(t){return e(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return\".\";for(var t,r=0;r0&&(void 0===t?t=i:t+=\"/\"+i)}return void 0===t?\".\":n.normalize(t)},relative:function(t,r){if(e(t),e(r),t===r)return\"\";if((t=n.resolve(t))===(r=n.resolve(r)))return\"\";for(var i=1;ic){if(47===r.charCodeAt(h+u))return r.slice(h+u+1);if(0===u)return r.slice(h+u)}else s>c&&(47===t.charCodeAt(i+u)?f=u:0===u&&(f=0));break}var l=t.charCodeAt(i+u);if(l!==r.charCodeAt(h+u))break;47===l&&(f=u)}var g=\"\";for(u=i+f+1;u<=o;++u)u!==o&&47!==t.charCodeAt(u)||(0===g.length?g+=\"..\":g+=\"/..\");return g.length>0?g+r.slice(h+f):(h+=f,47===r.charCodeAt(h)&&++h,r.slice(h))},_makeLong:function(t){return t},dirname:function(t){if(e(t),0===t.length)return\".\";for(var r=t.charCodeAt(0),n=47===r,i=-1,o=!0,s=t.length-1;s>=1;--s)if(47===(r=t.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?\"/\":\".\":n&&1===i?\"//\":t.slice(0,i)},basename:function(t,r){if(void 0!==r&&\"string\"!=typeof r)throw new TypeError('\"ext\" argument must be a string');e(t);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return\"\";var h=r.length-1,a=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!s){i=n+1;break}}else-1===a&&(s=!1,a=n+1),h>=0&&(c===r.charCodeAt(h)?-1==--h&&(o=n):(h=-1,o=a))}return i===o?o=a:-1===o&&(o=t.length),t.slice(i,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?\"\":t.slice(i,o)},extname:function(t){e(t);for(var r=-1,n=0,i=-1,o=!0,s=0,h=t.length-1;h>=0;--h){var a=t.charCodeAt(h);if(47!==a)-1===i&&(o=!1,i=h+1),46===a?-1===r?r=h:1!==s&&(s=1):-1!==r&&(s=-1);else if(!o){n=h+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?\"\":t.slice(r,i)},format:function(t){if(null===t||\"object\"!=typeof t)throw new TypeError('The \"pathObject\" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||\"\")+(e.ext||\"\");return r?r===e.root?r+n:r+\"/\"+n:n}(0,t)},parse:function(t){e(t);var r={root:\"\",dir:\"\",base:\"\",ext:\"\",name:\"\"};if(0===t.length)return r;var n,i=t.charCodeAt(0),o=47===i;o?(r.root=\"/\",n=1):n=0;for(var s=-1,h=0,a=-1,c=!0,f=t.length-1,u=0;f>=n;--f)if(47!==(i=t.charCodeAt(f)))-1===a&&(c=!1,a=f+1),46===i?-1===s?s=f:1!==u&&(u=1):-1!==s&&(u=-1);else if(!c){h=f+1;break}return-1===s||-1===a||0===u||1===u&&s===a-1&&s===h+1?-1!==a&&(r.base=r.name=0===h&&o?t.slice(1,a):t.slice(h,a)):(0===h&&o?(r.name=t.slice(1,s),r.base=t.slice(1,a)):(r.name=t.slice(h,s),r.base=t.slice(h,a)),r.ext=t.slice(s,a)),h>0?r.dir=t.slice(0,h-1):o&&(r.dir=\"/\"),r},sep:\"/\",delimiter:\":\",win32:null,posix:null};n.posix=n,t.exports=n}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})};var n={};(()=>{let t;if(r.r(n),r.d(n,{URI:()=>f,Utils:()=>P}),\"object\"==typeof process)t=\"win32\"===process.platform;else if(\"object\"==typeof navigator){let e=navigator.userAgent;t=e.indexOf(\"Windows\")>=0}const e=/^\\w[\\w\\d+.-]*$/,i=/^\\//,o=/^\\/\\//;function s(t,r){if(!t.scheme&&r)throw new Error(`[UriError]: Scheme is missing: {scheme: \"\", authority: \"${t.authority}\", path: \"${t.path}\", query: \"${t.query}\", fragment: \"${t.fragment}\"}`);if(t.scheme&&!e.test(t.scheme))throw new Error(\"[UriError]: Scheme contains illegal characters.\");if(t.path)if(t.authority){if(!i.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character')}else if(o.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")')}const h=\"\",a=\"/\",c=/^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;class f{static isUri(t){return t instanceof f||!!t&&\"string\"==typeof t.authority&&\"string\"==typeof t.fragment&&\"string\"==typeof t.path&&\"string\"==typeof t.query&&\"string\"==typeof t.scheme&&\"string\"==typeof t.fsPath&&\"function\"==typeof t.with&&\"function\"==typeof t.toString}scheme;authority;path;query;fragment;constructor(t,e,r,n,i,o=!1){\"object\"==typeof t?(this.scheme=t.scheme||h,this.authority=t.authority||h,this.path=t.path||h,this.query=t.query||h,this.fragment=t.fragment||h):(this.scheme=function(t,e){return t||e?t:\"file\"}(t,o),this.authority=e||h,this.path=function(t,e){switch(t){case\"https\":case\"http\":case\"file\":e?e[0]!==a&&(e=a+e):e=a}return e}(this.scheme,r||h),this.query=n||h,this.fragment=i||h,s(this,o))}get fsPath(){return m(this,!1)}with(t){if(!t)return this;let{scheme:e,authority:r,path:n,query:i,fragment:o}=t;return void 0===e?e=this.scheme:null===e&&(e=h),void 0===r?r=this.authority:null===r&&(r=h),void 0===n?n=this.path:null===n&&(n=h),void 0===i?i=this.query:null===i&&(i=h),void 0===o?o=this.fragment:null===o&&(o=h),e===this.scheme&&r===this.authority&&n===this.path&&i===this.query&&o===this.fragment?this:new l(e,r,n,i,o)}static parse(t,e=!1){const r=c.exec(t);return r?new l(r[2]||h,C(r[4]||h),C(r[5]||h),C(r[7]||h),C(r[9]||h),e):new l(h,h,h,h,h)}static file(e){let r=h;if(t&&(e=e.replace(/\\\\/g,a)),e[0]===a&&e[1]===a){const t=e.indexOf(a,2);-1===t?(r=e.substring(2),e=a):(r=e.substring(2,t),e=e.substring(t)||a)}return new l(\"file\",r,e,h,h)}static from(t){const e=new l(t.scheme,t.authority,t.path,t.query,t.fragment);return s(e,!0),e}toString(t=!1){return y(this,t)}toJSON(){return this}static revive(t){if(t){if(t instanceof f)return t;{const e=new l(t);return e._formatted=t.external,e._fsPath=t._sep===u?t.fsPath:null,e}}return t}}const u=t?1:void 0;class l extends f{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=m(this,!1)),this._fsPath}toString(t=!1){return t?y(this,!0):(this._formatted||(this._formatted=y(this,!1)),this._formatted)}toJSON(){const t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=u),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t}}const g={58:\"%3A\",47:\"%2F\",63:\"%3F\",35:\"%23\",91:\"%5B\",93:\"%5D\",64:\"%40\",33:\"%21\",36:\"%24\",38:\"%26\",39:\"%27\",40:\"%28\",41:\"%29\",42:\"%2A\",43:\"%2B\",44:\"%2C\",59:\"%3B\",61:\"%3D\",32:\"%20\"};function d(t,e,r){let n,i=-1;for(let o=0;o=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||e&&47===s||r&&91===s||r&&93===s||r&&58===s)-1!==i&&(n+=encodeURIComponent(t.substring(i,o)),i=-1),void 0!==n&&(n+=t.charAt(o));else{void 0===n&&(n=t.substr(0,o));const e=g[s];void 0!==e?(-1!==i&&(n+=encodeURIComponent(t.substring(i,o)),i=-1),n+=e):-1===i&&(i=o)}}return-1!==i&&(n+=encodeURIComponent(t.substring(i))),void 0!==n?n:t}function p(t){let e;for(let r=0;r1&&\"file\"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?r?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,t&&(n=n.replace(/\\//g,\"\\\\\")),n}function y(t,e){const r=e?p:d;let n=\"\",{scheme:i,authority:o,path:s,query:h,fragment:c}=t;if(i&&(n+=i,n+=\":\"),(o||\"file\"===i)&&(n+=a,n+=a),o){let t=o.indexOf(\"@\");if(-1!==t){const e=o.substr(0,t);o=o.substr(t+1),t=e.lastIndexOf(\":\"),-1===t?n+=r(e,!1,!1):(n+=r(e.substr(0,t),!1,!1),n+=\":\",n+=r(e.substr(t+1),!1,!0)),n+=\"@\"}o=o.toLowerCase(),t=o.lastIndexOf(\":\"),-1===t?n+=r(o,!1,!0):(n+=r(o.substr(0,t),!1,!0),n+=o.substr(t))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){const t=s.charCodeAt(1);t>=65&&t<=90&&(s=`/${String.fromCharCode(t+32)}:${s.substr(3)}`)}else if(s.length>=2&&58===s.charCodeAt(1)){const t=s.charCodeAt(0);t>=65&&t<=90&&(s=`${String.fromCharCode(t+32)}:${s.substr(2)}`)}n+=r(s,!0,!1)}return h&&(n+=\"?\",n+=r(h,!1,!1)),c&&(n+=\"#\",n+=e?c:d(c,!1,!1)),n}function v(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+v(t.substr(3)):t}}const b=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function C(t){return t.match(b)?t.replace(b,(t=>v(t))):t}var A=r(470);const w=A.posix||A,x=\"/\";var P;!function(t){t.joinPath=function(t,...e){return t.with({path:w.join(t.path,...e)})},t.resolvePath=function(t,...e){let r=t.path,n=!1;r[0]!==x&&(r=x+r,n=!0);let i=w.resolve(r,...e);return n&&i[0]===x&&!t.authority&&(i=i.substring(1)),t.with({path:i})},t.dirname=function(t){if(0===t.path.length||t.path===x)return t;let e=w.dirname(t.path);return 1===e.length&&46===e.charCodeAt(0)&&(e=\"\"),t.with({path:e})},t.basename=function(t){return w.basename(t.path)},t.extname=function(t){return w.extname(t.path)}}(P||(P={}))})(),LIB=n})();export const{URI,Utils}=LIB;\n//# sourceMappingURL=index.mjs.map","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nclass FullTextDocument {\n constructor(uri, languageId, version, content) {\n this._uri = uri;\n this._languageId = languageId;\n this._version = version;\n this._content = content;\n this._lineOffsets = undefined;\n }\n get uri() {\n return this._uri;\n }\n get languageId() {\n return this._languageId;\n }\n get version() {\n return this._version;\n }\n getText(range) {\n if (range) {\n const start = this.offsetAt(range.start);\n const end = this.offsetAt(range.end);\n return this._content.substring(start, end);\n }\n return this._content;\n }\n update(changes, version) {\n for (let change of changes) {\n if (FullTextDocument.isIncremental(change)) {\n // makes sure start is before end\n const range = getWellformedRange(change.range);\n // update content\n const startOffset = this.offsetAt(range.start);\n const endOffset = this.offsetAt(range.end);\n this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length);\n // update the offsets\n const startLine = Math.max(range.start.line, 0);\n const endLine = Math.max(range.end.line, 0);\n let lineOffsets = this._lineOffsets;\n const addedLineOffsets = computeLineOffsets(change.text, false, startOffset);\n if (endLine - startLine === addedLineOffsets.length) {\n for (let i = 0, len = addedLineOffsets.length; i < len; i++) {\n lineOffsets[i + startLine + 1] = addedLineOffsets[i];\n }\n }\n else {\n if (addedLineOffsets.length < 10000) {\n lineOffsets.splice(startLine + 1, endLine - startLine, ...addedLineOffsets);\n }\n else { // avoid too many arguments for splice\n this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1));\n }\n }\n const diff = change.text.length - (endOffset - startOffset);\n if (diff !== 0) {\n for (let i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) {\n lineOffsets[i] = lineOffsets[i] + diff;\n }\n }\n }\n else if (FullTextDocument.isFull(change)) {\n this._content = change.text;\n this._lineOffsets = undefined;\n }\n else {\n throw new Error('Unknown change event received');\n }\n }\n this._version = version;\n }\n getLineOffsets() {\n if (this._lineOffsets === undefined) {\n this._lineOffsets = computeLineOffsets(this._content, true);\n }\n return this._lineOffsets;\n }\n positionAt(offset) {\n offset = Math.max(Math.min(offset, this._content.length), 0);\n let lineOffsets = this.getLineOffsets();\n let low = 0, high = lineOffsets.length;\n if (high === 0) {\n return { line: 0, character: offset };\n }\n while (low < high) {\n let mid = Math.floor((low + high) / 2);\n if (lineOffsets[mid] > offset) {\n high = mid;\n }\n else {\n low = mid + 1;\n }\n }\n // low is the least x for which the line offset is larger than the current offset\n // or array.length if no line offset is larger than the current offset\n let line = low - 1;\n return { line, character: offset - lineOffsets[line] };\n }\n offsetAt(position) {\n let lineOffsets = this.getLineOffsets();\n if (position.line >= lineOffsets.length) {\n return this._content.length;\n }\n else if (position.line < 0) {\n return 0;\n }\n let lineOffset = lineOffsets[position.line];\n let nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\n return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\n }\n get lineCount() {\n return this.getLineOffsets().length;\n }\n static isIncremental(event) {\n let candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range !== undefined &&\n (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number');\n }\n static isFull(event) {\n let candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined;\n }\n}\nexport var TextDocument;\n(function (TextDocument) {\n /**\n * Creates a new text document.\n *\n * @param uri The document's uri.\n * @param languageId The document's language Id.\n * @param version The document's initial version number.\n * @param content The document's content.\n */\n function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }\n TextDocument.create = create;\n /**\n * Updates a TextDocument by modifying its content.\n *\n * @param document the document to update. Only documents created by TextDocument.create are valid inputs.\n * @param changes the changes to apply to the document.\n * @param version the changes version for the document.\n * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter.\n *\n */\n function update(document, changes, version) {\n if (document instanceof FullTextDocument) {\n document.update(changes, version);\n return document;\n }\n else {\n throw new Error('TextDocument.update: document must be created by TextDocument.create');\n }\n }\n TextDocument.update = update;\n function applyEdits(document, edits) {\n let text = document.getText();\n let sortedEdits = mergeSort(edits.map(getWellformedEdit), (a, b) => {\n let diff = a.range.start.line - b.range.start.line;\n if (diff === 0) {\n return a.range.start.character - b.range.start.character;\n }\n return diff;\n });\n let lastModifiedOffset = 0;\n const spans = [];\n for (const e of sortedEdits) {\n let startOffset = document.offsetAt(e.range.start);\n if (startOffset < lastModifiedOffset) {\n throw new Error('Overlapping edit');\n }\n else if (startOffset > lastModifiedOffset) {\n spans.push(text.substring(lastModifiedOffset, startOffset));\n }\n if (e.newText.length) {\n spans.push(e.newText);\n }\n lastModifiedOffset = document.offsetAt(e.range.end);\n }\n spans.push(text.substr(lastModifiedOffset));\n return spans.join('');\n }\n TextDocument.applyEdits = applyEdits;\n})(TextDocument || (TextDocument = {}));\nfunction mergeSort(data, compare) {\n if (data.length <= 1) {\n // sorted\n return data;\n }\n const p = (data.length / 2) | 0;\n const left = data.slice(0, p);\n const right = data.slice(p);\n mergeSort(left, compare);\n mergeSort(right, compare);\n let leftIdx = 0;\n let rightIdx = 0;\n let i = 0;\n while (leftIdx < left.length && rightIdx < right.length) {\n let ret = compare(left[leftIdx], right[rightIdx]);\n if (ret <= 0) {\n // smaller_equal -> take left to preserve order\n data[i++] = left[leftIdx++];\n }\n else {\n // greater -> take right\n data[i++] = right[rightIdx++];\n }\n }\n while (leftIdx < left.length) {\n data[i++] = left[leftIdx++];\n }\n while (rightIdx < right.length) {\n data[i++] = right[rightIdx++];\n }\n return data;\n}\nfunction computeLineOffsets(text, isAtLineStart, textOffset = 0) {\n const result = isAtLineStart ? [textOffset] : [];\n for (let i = 0; i < text.length; i++) {\n let ch = text.charCodeAt(i);\n if (ch === 13 /* CharCode.CarriageReturn */ || ch === 10 /* CharCode.LineFeed */) {\n if (ch === 13 /* CharCode.CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* CharCode.LineFeed */) {\n i++;\n }\n result.push(textOffset + i + 1);\n }\n }\n return result;\n}\nfunction getWellformedRange(range) {\n const start = range.start;\n const end = range.end;\n if (start.line > end.line || (start.line === end.line && start.character > end.character)) {\n return { start: end, end: start };\n }\n return range;\n}\nfunction getWellformedEdit(textEdit) {\n const range = getWellformedRange(textEdit.range);\n if (range !== textEdit.range) {\n return { newText: textEdit.newText, range };\n }\n return textEdit;\n}\n",null,null,null,"// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n","// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n","const SemVer = require('../classes/semver')\nconst parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version\n }\n try {\n return new SemVer(version, options)\n } catch (er) {\n if (!throwErrors) {\n return null\n }\n throw er\n }\n}\n\nmodule.exports = parse\n","const parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n","const parse = require('./parse')\nconst clean = (version, options) => {\n const s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\nmodule.exports = clean\n","const SemVer = require('../classes/semver')\n\nconst inc = (version, release, options, identifier, identifierBase) => {\n if (typeof (options) === 'string') {\n identifierBase = identifier\n identifier = options\n options = undefined\n }\n\n try {\n return new SemVer(\n version instanceof SemVer ? version.version : version,\n options\n ).inc(release, identifier, identifierBase).version\n } catch (er) {\n return null\n }\n}\nmodule.exports = inc\n","const parse = require('./parse.js')\n\nconst diff = (version1, version2) => {\n const v1 = parse(version1, null, true)\n const v2 = parse(version2, null, true)\n const comparison = v1.compare(v2)\n\n if (comparison === 0) {\n return null\n }\n\n const v1Higher = comparison > 0\n const highVersion = v1Higher ? v1 : v2\n const lowVersion = v1Higher ? v2 : v1\n const highHasPre = !!highVersion.prerelease.length\n const lowHasPre = !!lowVersion.prerelease.length\n\n if (lowHasPre && !highHasPre) {\n // Going from prerelease -> no prerelease requires some special casing\n\n // If the low version has only a major, then it will always be a major\n // Some examples:\n // 1.0.0-1 -> 1.0.0\n // 1.0.0-1 -> 1.1.1\n // 1.0.0-1 -> 2.0.0\n if (!lowVersion.patch && !lowVersion.minor) {\n return 'major'\n }\n\n // Otherwise it can be determined by checking the high version\n\n if (highVersion.patch) {\n // anything higher than a patch bump would result in the wrong version\n return 'patch'\n }\n\n if (highVersion.minor) {\n // anything higher than a minor bump would result in the wrong version\n return 'minor'\n }\n\n // bumping major/minor/patch all have same result\n return 'major'\n }\n\n // add the `pre` prefix if we are going to a prerelease version\n const prefix = highHasPre ? 'pre' : ''\n\n if (v1.major !== v2.major) {\n return prefix + 'major'\n }\n\n if (v1.minor !== v2.minor) {\n return prefix + 'minor'\n }\n\n if (v1.patch !== v2.patch) {\n return prefix + 'patch'\n }\n\n // high and low are preleases\n return 'prerelease'\n}\n\nmodule.exports = diff\n","const SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","const SemVer = require('../classes/semver')\nconst minor = (a, loose) => new SemVer(a, loose).minor\nmodule.exports = minor\n","const SemVer = require('../classes/semver')\nconst patch = (a, loose) => new SemVer(a, loose).patch\nmodule.exports = patch\n","const parse = require('./parse')\nconst prerelease = (version, options) => {\n const parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\nmodule.exports = prerelease\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const compare = require('./compare')\nconst rcompare = (a, b, loose) => compare(b, a, loose)\nmodule.exports = rcompare\n","const compare = require('./compare')\nconst compareLoose = (a, b) => compare(a, b, true)\nmodule.exports = compareLoose\n","const SemVer = require('../classes/semver')\nconst compareBuild = (a, b, loose) => {\n const versionA = new SemVer(a, loose)\n const versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\nmodule.exports = compareBuild\n","const compareBuild = require('./compare-build')\nconst sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))\nmodule.exports = sort\n","const compareBuild = require('./compare-build')\nconst rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))\nmodule.exports = rsort\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a === b\n\n case '!==':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]\n let next\n while ((next = coerceRtlRegex.exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n coerceRtlRegex.lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n const major = match[2]\n const minor = match[3] || '0'\n const patch = match[4] || '0'\n const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''\n const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''\n\n return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)\n}\nmodule.exports = coerce\n","'use strict'\nmodule.exports = function (Yallist) {\n Yallist.prototype[Symbol.iterator] = function* () {\n for (let walker = this.head; walker; walker = walker.next) {\n yield walker.value\n }\n }\n}\n","'use strict'\nmodule.exports = Yallist\n\nYallist.Node = Node\nYallist.create = Yallist\n\nfunction Yallist (list) {\n var self = this\n if (!(self instanceof Yallist)) {\n self = new Yallist()\n }\n\n self.tail = null\n self.head = null\n self.length = 0\n\n if (list && typeof list.forEach === 'function') {\n list.forEach(function (item) {\n self.push(item)\n })\n } else if (arguments.length > 0) {\n for (var i = 0, l = arguments.length; i < l; i++) {\n self.push(arguments[i])\n }\n }\n\n return self\n}\n\nYallist.prototype.removeNode = function (node) {\n if (node.list !== this) {\n throw new Error('removing node which does not belong to this list')\n }\n\n var next = node.next\n var prev = node.prev\n\n if (next) {\n next.prev = prev\n }\n\n if (prev) {\n prev.next = next\n }\n\n if (node === this.head) {\n this.head = next\n }\n if (node === this.tail) {\n this.tail = prev\n }\n\n node.list.length--\n node.next = null\n node.prev = null\n node.list = null\n\n return next\n}\n\nYallist.prototype.unshiftNode = function (node) {\n if (node === this.head) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var head = this.head\n node.list = this\n node.next = head\n if (head) {\n head.prev = node\n }\n\n this.head = node\n if (!this.tail) {\n this.tail = node\n }\n this.length++\n}\n\nYallist.prototype.pushNode = function (node) {\n if (node === this.tail) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var tail = this.tail\n node.list = this\n node.prev = tail\n if (tail) {\n tail.next = node\n }\n\n this.tail = node\n if (!this.head) {\n this.head = node\n }\n this.length++\n}\n\nYallist.prototype.push = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n push(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.unshift = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n unshift(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.pop = function () {\n if (!this.tail) {\n return undefined\n }\n\n var res = this.tail.value\n this.tail = this.tail.prev\n if (this.tail) {\n this.tail.next = null\n } else {\n this.head = null\n }\n this.length--\n return res\n}\n\nYallist.prototype.shift = function () {\n if (!this.head) {\n return undefined\n }\n\n var res = this.head.value\n this.head = this.head.next\n if (this.head) {\n this.head.prev = null\n } else {\n this.tail = null\n }\n this.length--\n return res\n}\n\nYallist.prototype.forEach = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.head, i = 0; walker !== null; i++) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.next\n }\n}\n\nYallist.prototype.forEachReverse = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.prev\n }\n}\n\nYallist.prototype.get = function (n) {\n for (var i = 0, walker = this.head; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.next\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.getReverse = function (n) {\n for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.prev\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.map = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.head; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.next\n }\n return res\n}\n\nYallist.prototype.mapReverse = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.tail; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.prev\n }\n return res\n}\n\nYallist.prototype.reduce = function (fn, initial) {\n var acc\n var walker = this.head\n if (arguments.length > 1) {\n acc = initial\n } else if (this.head) {\n walker = this.head.next\n acc = this.head.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = 0; walker !== null; i++) {\n acc = fn(acc, walker.value, i)\n walker = walker.next\n }\n\n return acc\n}\n\nYallist.prototype.reduceReverse = function (fn, initial) {\n var acc\n var walker = this.tail\n if (arguments.length > 1) {\n acc = initial\n } else if (this.tail) {\n walker = this.tail.prev\n acc = this.tail.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = this.length - 1; walker !== null; i--) {\n acc = fn(acc, walker.value, i)\n walker = walker.prev\n }\n\n return acc\n}\n\nYallist.prototype.toArray = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.head; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.next\n }\n return arr\n}\n\nYallist.prototype.toArrayReverse = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.tail; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.prev\n }\n return arr\n}\n\nYallist.prototype.slice = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = 0, walker = this.head; walker !== null && i < from; i++) {\n walker = walker.next\n }\n for (; walker !== null && i < to; i++, walker = walker.next) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.sliceReverse = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {\n walker = walker.prev\n }\n for (; walker !== null && i > from; i--, walker = walker.prev) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.splice = function (start, deleteCount, ...nodes) {\n if (start > this.length) {\n start = this.length - 1\n }\n if (start < 0) {\n start = this.length + start;\n }\n\n for (var i = 0, walker = this.head; walker !== null && i < start; i++) {\n walker = walker.next\n }\n\n var ret = []\n for (var i = 0; walker && i < deleteCount; i++) {\n ret.push(walker.value)\n walker = this.removeNode(walker)\n }\n if (walker === null) {\n walker = this.tail\n }\n\n if (walker !== this.head && walker !== this.tail) {\n walker = walker.prev\n }\n\n for (var i = 0; i < nodes.length; i++) {\n walker = insert(this, walker, nodes[i])\n }\n return ret;\n}\n\nYallist.prototype.reverse = function () {\n var head = this.head\n var tail = this.tail\n for (var walker = head; walker !== null; walker = walker.prev) {\n var p = walker.prev\n walker.prev = walker.next\n walker.next = p\n }\n this.head = tail\n this.tail = head\n return this\n}\n\nfunction insert (self, node, value) {\n var inserted = node === self.head ?\n new Node(value, null, node, self) :\n new Node(value, node, node.next, self)\n\n if (inserted.next === null) {\n self.tail = inserted\n }\n if (inserted.prev === null) {\n self.head = inserted\n }\n\n self.length++\n\n return inserted\n}\n\nfunction push (self, item) {\n self.tail = new Node(item, self.tail, null, self)\n if (!self.head) {\n self.head = self.tail\n }\n self.length++\n}\n\nfunction unshift (self, item) {\n self.head = new Node(item, null, self.head, self)\n if (!self.tail) {\n self.tail = self.head\n }\n self.length++\n}\n\nfunction Node (value, prev, next, list) {\n if (!(this instanceof Node)) {\n return new Node(value, prev, next, list)\n }\n\n this.list = list\n this.value = value\n\n if (prev) {\n prev.next = this\n this.prev = prev\n } else {\n this.prev = null\n }\n\n if (next) {\n next.prev = this\n this.next = next\n } else {\n this.next = null\n }\n}\n\ntry {\n // add if support for Symbol.iterator is present\n require('./iterator.js')(Yallist)\n} catch (er) {}\n","'use strict'\n\n// A linked list to keep track of recently-used-ness\nconst Yallist = require('yallist')\n\nconst MAX = Symbol('max')\nconst LENGTH = Symbol('length')\nconst LENGTH_CALCULATOR = Symbol('lengthCalculator')\nconst ALLOW_STALE = Symbol('allowStale')\nconst MAX_AGE = Symbol('maxAge')\nconst DISPOSE = Symbol('dispose')\nconst NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')\nconst LRU_LIST = Symbol('lruList')\nconst CACHE = Symbol('cache')\nconst UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')\n\nconst naiveLength = () => 1\n\n// lruList is a yallist where the head is the youngest\n// item, and the tail is the oldest. the list contains the Hit\n// objects as the entries.\n// Each Hit object has a reference to its Yallist.Node. This\n// never changes.\n//\n// cache is a Map (or PseudoMap) that matches the keys to\n// the Yallist.Node object.\nclass LRUCache {\n constructor (options) {\n if (typeof options === 'number')\n options = { max: options }\n\n if (!options)\n options = {}\n\n if (options.max && (typeof options.max !== 'number' || options.max < 0))\n throw new TypeError('max must be a non-negative number')\n // Kind of weird to have a default max of Infinity, but oh well.\n const max = this[MAX] = options.max || Infinity\n\n const lc = options.length || naiveLength\n this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc\n this[ALLOW_STALE] = options.stale || false\n if (options.maxAge && typeof options.maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n this[MAX_AGE] = options.maxAge || 0\n this[DISPOSE] = options.dispose\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false\n this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false\n this.reset()\n }\n\n // resize the cache when the max changes.\n set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }\n get max () {\n return this[MAX]\n }\n\n set allowStale (allowStale) {\n this[ALLOW_STALE] = !!allowStale\n }\n get allowStale () {\n return this[ALLOW_STALE]\n }\n\n set maxAge (mA) {\n if (typeof mA !== 'number')\n throw new TypeError('maxAge must be a non-negative number')\n\n this[MAX_AGE] = mA\n trim(this)\n }\n get maxAge () {\n return this[MAX_AGE]\n }\n\n // resize the cache when the lengthCalculator changes.\n set lengthCalculator (lC) {\n if (typeof lC !== 'function')\n lC = naiveLength\n\n if (lC !== this[LENGTH_CALCULATOR]) {\n this[LENGTH_CALCULATOR] = lC\n this[LENGTH] = 0\n this[LRU_LIST].forEach(hit => {\n hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)\n this[LENGTH] += hit.length\n })\n }\n trim(this)\n }\n get lengthCalculator () { return this[LENGTH_CALCULATOR] }\n\n get length () { return this[LENGTH] }\n get itemCount () { return this[LRU_LIST].length }\n\n rforEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].tail; walker !== null;) {\n const prev = walker.prev\n forEachStep(this, fn, walker, thisp)\n walker = prev\n }\n }\n\n forEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].head; walker !== null;) {\n const next = walker.next\n forEachStep(this, fn, walker, thisp)\n walker = next\n }\n }\n\n keys () {\n return this[LRU_LIST].toArray().map(k => k.key)\n }\n\n values () {\n return this[LRU_LIST].toArray().map(k => k.value)\n }\n\n reset () {\n if (this[DISPOSE] &&\n this[LRU_LIST] &&\n this[LRU_LIST].length) {\n this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))\n }\n\n this[CACHE] = new Map() // hash of items by key\n this[LRU_LIST] = new Yallist() // list of items in order of use recency\n this[LENGTH] = 0 // length of items in the list\n }\n\n dump () {\n return this[LRU_LIST].map(hit =>\n isStale(this, hit) ? false : {\n k: hit.key,\n v: hit.value,\n e: hit.now + (hit.maxAge || 0)\n }).toArray().filter(h => h)\n }\n\n dumpLru () {\n return this[LRU_LIST]\n }\n\n set (key, value, maxAge) {\n maxAge = maxAge || this[MAX_AGE]\n\n if (maxAge && typeof maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n\n const now = maxAge ? Date.now() : 0\n const len = this[LENGTH_CALCULATOR](value, key)\n\n if (this[CACHE].has(key)) {\n if (len > this[MAX]) {\n del(this, this[CACHE].get(key))\n return false\n }\n\n const node = this[CACHE].get(key)\n const item = node.value\n\n // dispose of the old one before overwriting\n // split out into 2 ifs for better coverage tracking\n if (this[DISPOSE]) {\n if (!this[NO_DISPOSE_ON_SET])\n this[DISPOSE](key, item.value)\n }\n\n item.now = now\n item.maxAge = maxAge\n item.value = value\n this[LENGTH] += len - item.length\n item.length = len\n this.get(key)\n trim(this)\n return true\n }\n\n const hit = new Entry(key, value, len, now, maxAge)\n\n // oversized objects fall out of cache automatically.\n if (hit.length > this[MAX]) {\n if (this[DISPOSE])\n this[DISPOSE](key, value)\n\n return false\n }\n\n this[LENGTH] += hit.length\n this[LRU_LIST].unshift(hit)\n this[CACHE].set(key, this[LRU_LIST].head)\n trim(this)\n return true\n }\n\n has (key) {\n if (!this[CACHE].has(key)) return false\n const hit = this[CACHE].get(key).value\n return !isStale(this, hit)\n }\n\n get (key) {\n return get(this, key, true)\n }\n\n peek (key) {\n return get(this, key, false)\n }\n\n pop () {\n const node = this[LRU_LIST].tail\n if (!node)\n return null\n\n del(this, node)\n return node.value\n }\n\n del (key) {\n del(this, this[CACHE].get(key))\n }\n\n load (arr) {\n // reset the cache\n this.reset()\n\n const now = Date.now()\n // A previous serialized cache has the most recent items first\n for (let l = arr.length - 1; l >= 0; l--) {\n const hit = arr[l]\n const expiresAt = hit.e || 0\n if (expiresAt === 0)\n // the item was created without expiration in a non aged cache\n this.set(hit.k, hit.v)\n else {\n const maxAge = expiresAt - now\n // dont add already expired items\n if (maxAge > 0) {\n this.set(hit.k, hit.v, maxAge)\n }\n }\n }\n }\n\n prune () {\n this[CACHE].forEach((value, key) => get(this, key, false))\n }\n}\n\nconst get = (self, key, doUse) => {\n const node = self[CACHE].get(key)\n if (node) {\n const hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n return undefined\n } else {\n if (doUse) {\n if (self[UPDATE_AGE_ON_GET])\n node.value.now = Date.now()\n self[LRU_LIST].unshiftNode(node)\n }\n }\n return hit.value\n }\n}\n\nconst isStale = (self, hit) => {\n if (!hit || (!hit.maxAge && !self[MAX_AGE]))\n return false\n\n const diff = Date.now() - hit.now\n return hit.maxAge ? diff > hit.maxAge\n : self[MAX_AGE] && (diff > self[MAX_AGE])\n}\n\nconst trim = self => {\n if (self[LENGTH] > self[MAX]) {\n for (let walker = self[LRU_LIST].tail;\n self[LENGTH] > self[MAX] && walker !== null;) {\n // We know that we're about to delete this one, and also\n // what the next least recently used key will be, so just\n // go ahead and set it now.\n const prev = walker.prev\n del(self, walker)\n walker = prev\n }\n }\n}\n\nconst del = (self, node) => {\n if (node) {\n const hit = node.value\n if (self[DISPOSE])\n self[DISPOSE](hit.key, hit.value)\n\n self[LENGTH] -= hit.length\n self[CACHE].delete(hit.key)\n self[LRU_LIST].removeNode(node)\n }\n}\n\nclass Entry {\n constructor (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n }\n}\n\nconst forEachStep = (self, fn, node, thisp) => {\n let hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n hit = undefined\n }\n if (hit)\n fn.call(thisp, hit.value, hit.key, self)\n}\n\nmodule.exports = LRUCache\n","// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.format()\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range\n .trim()\n .split(/\\s+/)\n .join(' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.format()\n }\n\n format () {\n this.range = this.set\n .map((comps) => comps.join(' ').trim())\n .join('||')\n .trim()\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('lru-cache')\nconst cache = new LRU({ max: 1000 })\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","const Range = require('../classes/range')\n\n// Mostly just for testing and legacy API reasons\nconst toComparators = (range, options) =>\n new Range(range, options).set\n .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))\n\nmodule.exports = toComparators\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\n\nconst maxSatisfying = (versions, range, options) => {\n let max = null\n let maxSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\nmodule.exports = maxSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst minSatisfying = (versions, range, options) => {\n let min = null\n let minSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\nmodule.exports = minSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin))) {\n minver = setMin\n }\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n","const Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n","const SemVer = require('../classes/semver')\nconst Comparator = require('../classes/comparator')\nconst { ANY } = Comparator\nconst Range = require('../classes/range')\nconst satisfies = require('../functions/satisfies')\nconst gt = require('../functions/gt')\nconst lt = require('../functions/lt')\nconst lte = require('../functions/lte')\nconst gte = require('../functions/gte')\n\nconst outside = (version, range, hilo, options) => {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n let gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisfies the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let high = null\n let low = null\n\n comparators.forEach((comparator) => {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nmodule.exports = outside\n","// Determine if version is greater than all the versions possible in the range.\nconst outside = require('./outside')\nconst gtr = (version, range, options) => outside(version, range, '>', options)\nmodule.exports = gtr\n","const outside = require('./outside')\n// Determine if version is less than all the versions possible in the range\nconst ltr = (version, range, options) => outside(version, range, '<', options)\nmodule.exports = ltr\n","const Range = require('../classes/range')\nconst intersects = (r1, r2, options) => {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2, options)\n}\nmodule.exports = intersects\n","// given a set of versions and a range, create a \"simplified\" range\n// that includes the same versions that the original range does\n// If the original range is shorter than the simplified one, return that.\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\nmodule.exports = (versions, range, options) => {\n const set = []\n let first = null\n let prev = null\n const v = versions.sort((a, b) => compare(a, b, options))\n for (const version of v) {\n const included = satisfies(version, range, options)\n if (included) {\n prev = version\n if (!first) {\n first = version\n }\n } else {\n if (prev) {\n set.push([first, prev])\n }\n prev = null\n first = null\n }\n }\n if (first) {\n set.push([first, null])\n }\n\n const ranges = []\n for (const [min, max] of set) {\n if (min === max) {\n ranges.push(min)\n } else if (!max && min === v[0]) {\n ranges.push('*')\n } else if (!max) {\n ranges.push(`>=${min}`)\n } else if (min === v[0]) {\n ranges.push(`<=${max}`)\n } else {\n ranges.push(`${min} - ${max}`)\n }\n }\n const simplified = ranges.join(' || ')\n const original = typeof range.raw === 'string' ? range.raw : String(range)\n return simplified.length < original.length ? simplified : range\n}\n","const Range = require('../classes/range.js')\nconst Comparator = require('../classes/comparator.js')\nconst { ANY } = Comparator\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\n\n// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:\n// - Every simple range `r1, r2, ...` is a null set, OR\n// - Every simple range `r1, r2, ...` which is not a null set is a subset of\n// some `R1, R2, ...`\n//\n// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:\n// - If c is only the ANY comparator\n// - If C is only the ANY comparator, return true\n// - Else if in prerelease mode, return false\n// - else replace c with `[>=0.0.0]`\n// - If C is only the ANY comparator\n// - if in prerelease mode, return true\n// - else replace C with `[>=0.0.0]`\n// - Let EQ be the set of = comparators in c\n// - If EQ is more than one, return true (null set)\n// - Let GT be the highest > or >= comparator in c\n// - Let LT be the lowest < or <= comparator in c\n// - If GT and LT, and GT.semver > LT.semver, return true (null set)\n// - If any C is a = range, and GT or LT are set, return false\n// - If EQ\n// - If GT, and EQ does not satisfy GT, return true (null set)\n// - If LT, and EQ does not satisfy LT, return true (null set)\n// - If EQ satisfies every C, return true\n// - Else return false\n// - If GT\n// - If GT.semver is lower than any > or >= comp in C, return false\n// - If GT is >=, and GT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the GT.semver tuple, return false\n// - If LT\n// - If LT.semver is greater than any < or <= comp in C, return false\n// - If LT is <=, and LT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the LT.semver tuple, return false\n// - Else return true\n\nconst subset = (sub, dom, options = {}) => {\n if (sub === dom) {\n return true\n }\n\n sub = new Range(sub, options)\n dom = new Range(dom, options)\n let sawNonNull = false\n\n OUTER: for (const simpleSub of sub.set) {\n for (const simpleDom of dom.set) {\n const isSub = simpleSubset(simpleSub, simpleDom, options)\n sawNonNull = sawNonNull || isSub !== null\n if (isSub) {\n continue OUTER\n }\n }\n // the null set is a subset of everything, but null simple ranges in\n // a complex range should be ignored. so if we saw a non-null range,\n // then we know this isn't a subset, but if EVERY simple range was null,\n // then it is a subset.\n if (sawNonNull) {\n return false\n }\n }\n return true\n}\n\nconst minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]\nconst minimumVersion = [new Comparator('>=0.0.0')]\n\nconst simpleSubset = (sub, dom, options) => {\n if (sub === dom) {\n return true\n }\n\n if (sub.length === 1 && sub[0].semver === ANY) {\n if (dom.length === 1 && dom[0].semver === ANY) {\n return true\n } else if (options.includePrerelease) {\n sub = minimumVersionWithPreRelease\n } else {\n sub = minimumVersion\n }\n }\n\n if (dom.length === 1 && dom[0].semver === ANY) {\n if (options.includePrerelease) {\n return true\n } else {\n dom = minimumVersion\n }\n }\n\n const eqSet = new Set()\n let gt, lt\n for (const c of sub) {\n if (c.operator === '>' || c.operator === '>=') {\n gt = higherGT(gt, c, options)\n } else if (c.operator === '<' || c.operator === '<=') {\n lt = lowerLT(lt, c, options)\n } else {\n eqSet.add(c.semver)\n }\n }\n\n if (eqSet.size > 1) {\n return null\n }\n\n let gtltComp\n if (gt && lt) {\n gtltComp = compare(gt.semver, lt.semver, options)\n if (gtltComp > 0) {\n return null\n } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {\n return null\n }\n }\n\n // will iterate one or zero times\n for (const eq of eqSet) {\n if (gt && !satisfies(eq, String(gt), options)) {\n return null\n }\n\n if (lt && !satisfies(eq, String(lt), options)) {\n return null\n }\n\n for (const c of dom) {\n if (!satisfies(eq, String(c), options)) {\n return false\n }\n }\n\n return true\n }\n\n let higher, lower\n let hasDomLT, hasDomGT\n // if the subset has a prerelease, we need a comparator in the superset\n // with the same tuple and a prerelease, or it's not a subset\n let needDomLTPre = lt &&\n !options.includePrerelease &&\n lt.semver.prerelease.length ? lt.semver : false\n let needDomGTPre = gt &&\n !options.includePrerelease &&\n gt.semver.prerelease.length ? gt.semver : false\n // exception: <1.2.3-0 is the same as <1.2.3\n if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&\n lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {\n needDomLTPre = false\n }\n\n for (const c of dom) {\n hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='\n hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='\n if (gt) {\n if (needDomGTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomGTPre.major &&\n c.semver.minor === needDomGTPre.minor &&\n c.semver.patch === needDomGTPre.patch) {\n needDomGTPre = false\n }\n }\n if (c.operator === '>' || c.operator === '>=') {\n higher = higherGT(gt, c, options)\n if (higher === c && higher !== gt) {\n return false\n }\n } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {\n return false\n }\n }\n if (lt) {\n if (needDomLTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomLTPre.major &&\n c.semver.minor === needDomLTPre.minor &&\n c.semver.patch === needDomLTPre.patch) {\n needDomLTPre = false\n }\n }\n if (c.operator === '<' || c.operator === '<=') {\n lower = lowerLT(lt, c, options)\n if (lower === c && lower !== lt) {\n return false\n }\n } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {\n return false\n }\n }\n if (!c.operator && (lt || gt) && gtltComp !== 0) {\n return false\n }\n }\n\n // if there was a < or >, and nothing in the dom, then must be false\n // UNLESS it was limited by another range in the other direction.\n // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0\n if (gt && hasDomLT && !lt && gtltComp !== 0) {\n return false\n }\n\n if (lt && hasDomGT && !gt && gtltComp !== 0) {\n return false\n }\n\n // we needed a prerelease range in a specific tuple, but didn't get one\n // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,\n // because it includes prereleases in the 1.2.3 tuple\n if (needDomGTPre || needDomLTPre) {\n return false\n }\n\n return true\n}\n\n// >=1.2.3 is lower than >1.2.3\nconst higherGT = (a, b, options) => {\n if (!a) {\n return b\n }\n const comp = compare(a.semver, b.semver, options)\n return comp > 0 ? a\n : comp < 0 ? b\n : b.operator === '>' && a.operator === '>=' ? b\n : a\n}\n\n// <=1.2.3 is higher than <1.2.3\nconst lowerLT = (a, b, options) => {\n if (!a) {\n return b\n }\n const comp = compare(a.semver, b.semver, options)\n return comp < 0 ? a\n : comp > 0 ? b\n : b.operator === '<' && a.operator === '<=' ? b\n : a\n}\n\nmodule.exports = subset\n","// just pre-load all the stuff that index.js lazily exports\nconst internalRe = require('./internal/re')\nconst constants = require('./internal/constants')\nconst SemVer = require('./classes/semver')\nconst identifiers = require('./internal/identifiers')\nconst parse = require('./functions/parse')\nconst valid = require('./functions/valid')\nconst clean = require('./functions/clean')\nconst inc = require('./functions/inc')\nconst diff = require('./functions/diff')\nconst major = require('./functions/major')\nconst minor = require('./functions/minor')\nconst patch = require('./functions/patch')\nconst prerelease = require('./functions/prerelease')\nconst compare = require('./functions/compare')\nconst rcompare = require('./functions/rcompare')\nconst compareLoose = require('./functions/compare-loose')\nconst compareBuild = require('./functions/compare-build')\nconst sort = require('./functions/sort')\nconst rsort = require('./functions/rsort')\nconst gt = require('./functions/gt')\nconst lt = require('./functions/lt')\nconst eq = require('./functions/eq')\nconst neq = require('./functions/neq')\nconst gte = require('./functions/gte')\nconst lte = require('./functions/lte')\nconst cmp = require('./functions/cmp')\nconst coerce = require('./functions/coerce')\nconst Comparator = require('./classes/comparator')\nconst Range = require('./classes/range')\nconst satisfies = require('./functions/satisfies')\nconst toComparators = require('./ranges/to-comparators')\nconst maxSatisfying = require('./ranges/max-satisfying')\nconst minSatisfying = require('./ranges/min-satisfying')\nconst minVersion = require('./ranges/min-version')\nconst validRange = require('./ranges/valid')\nconst outside = require('./ranges/outside')\nconst gtr = require('./ranges/gtr')\nconst ltr = require('./ranges/ltr')\nconst intersects = require('./ranges/intersects')\nconst simplifyRange = require('./ranges/simplify')\nconst subset = require('./ranges/subset')\nmodule.exports = {\n parse,\n valid,\n clean,\n inc,\n diff,\n major,\n minor,\n patch,\n prerelease,\n compare,\n rcompare,\n compareLoose,\n compareBuild,\n sort,\n rsort,\n gt,\n lt,\n eq,\n neq,\n gte,\n lte,\n cmp,\n coerce,\n Comparator,\n Range,\n satisfies,\n toComparators,\n maxSatisfying,\n minSatisfying,\n minVersion,\n validRange,\n outside,\n gtr,\n ltr,\n intersects,\n simplifyRange,\n subset,\n SemVer,\n re: internalRe.re,\n src: internalRe.src,\n tokens: internalRe.t,\n SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,\n RELEASE_TYPES: constants.RELEASE_TYPES,\n compareIdentifiers: identifiers.compareIdentifiers,\n rcompareIdentifiers: identifiers.rcompareIdentifiers,\n}\n",null,null,null,null,null,null,null,null,null,null,"import {promisify} from 'util';\nimport crypto from 'crypto';\n\nconst randomBytesAsync = promisify(crypto.randomBytes);\n\nconst urlSafeCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~'.split('');\nconst numericCharacters = '0123456789'.split('');\nconst distinguishableCharacters = 'CDEHKMPRTUWXY012458'.split('');\nconst asciiPrintableCharacters = '!\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'.split('');\nconst alphanumericCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.split('');\n\nconst generateForCustomCharacters = (length, characters) => {\n\t// Generating entropy is faster than complex math operations, so we use the simplest way\n\tconst characterCount = characters.length;\n\tconst maxValidSelector = (Math.floor(0x10000 / characterCount) * characterCount) - 1; // Using values above this will ruin distribution when using modular division\n\tconst entropyLength = 2 * Math.ceil(1.1 * length); // Generating a bit more than required so chances we need more than one pass will be really low\n\tlet string = '';\n\tlet stringLength = 0;\n\n\twhile (stringLength < length) { // In case we had many bad values, which may happen for character sets of size above 0x8000 but close to it\n\t\tconst entropy = crypto.randomBytes(entropyLength);\n\t\tlet entropyPosition = 0;\n\n\t\twhile (entropyPosition < entropyLength && stringLength < length) {\n\t\t\tconst entropyValue = entropy.readUInt16LE(entropyPosition);\n\t\t\tentropyPosition += 2;\n\t\t\tif (entropyValue > maxValidSelector) { // Skip values which will ruin distribution when using modular division\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tstring += characters[entropyValue % characterCount];\n\t\t\tstringLength++;\n\t\t}\n\t}\n\n\treturn string;\n};\n\nconst generateForCustomCharactersAsync = async (length, characters) => {\n\t// Generating entropy is faster than complex math operations, so we use the simplest way\n\tconst characterCount = characters.length;\n\tconst maxValidSelector = (Math.floor(0x10000 / characterCount) * characterCount) - 1; // Using values above this will ruin distribution when using modular division\n\tconst entropyLength = 2 * Math.ceil(1.1 * length); // Generating a bit more than required so chances we need more than one pass will be really low\n\tlet string = '';\n\tlet stringLength = 0;\n\n\twhile (stringLength < length) { // In case we had many bad values, which may happen for character sets of size above 0x8000 but close to it\n\t\tconst entropy = await randomBytesAsync(entropyLength); // eslint-disable-line no-await-in-loop\n\t\tlet entropyPosition = 0;\n\n\t\twhile (entropyPosition < entropyLength && stringLength < length) {\n\t\t\tconst entropyValue = entropy.readUInt16LE(entropyPosition);\n\t\t\tentropyPosition += 2;\n\t\t\tif (entropyValue > maxValidSelector) { // Skip values which will ruin distribution when using modular division\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tstring += characters[entropyValue % characterCount];\n\t\t\tstringLength++;\n\t\t}\n\t}\n\n\treturn string;\n};\n\nconst generateRandomBytes = (byteLength, type, length) => crypto.randomBytes(byteLength).toString(type).slice(0, length);\n\nconst generateRandomBytesAsync = async (byteLength, type, length) => {\n\tconst buffer = await randomBytesAsync(byteLength);\n\treturn buffer.toString(type).slice(0, length);\n};\n\nconst allowedTypes = new Set([\n\tundefined,\n\t'hex',\n\t'base64',\n\t'url-safe',\n\t'numeric',\n\t'distinguishable',\n\t'ascii-printable',\n\t'alphanumeric'\n]);\n\nconst createGenerator = (generateForCustomCharacters, generateRandomBytes) => ({length, type, characters}) => {\n\tif (!(length >= 0 && Number.isFinite(length))) {\n\t\tthrow new TypeError('Expected a `length` to be a non-negative finite number');\n\t}\n\n\tif (type !== undefined && characters !== undefined) {\n\t\tthrow new TypeError('Expected either `type` or `characters`');\n\t}\n\n\tif (characters !== undefined && typeof characters !== 'string') {\n\t\tthrow new TypeError('Expected `characters` to be string');\n\t}\n\n\tif (!allowedTypes.has(type)) {\n\t\tthrow new TypeError(`Unknown type: ${type}`);\n\t}\n\n\tif (type === undefined && characters === undefined) {\n\t\ttype = 'hex';\n\t}\n\n\tif (type === 'hex' || (type === undefined && characters === undefined)) {\n\t\treturn generateRandomBytes(Math.ceil(length * 0.5), 'hex', length); // Need 0.5 byte entropy per character\n\t}\n\n\tif (type === 'base64') {\n\t\treturn generateRandomBytes(Math.ceil(length * 0.75), 'base64', length); // Need 0.75 byte of entropy per character\n\t}\n\n\tif (type === 'url-safe') {\n\t\treturn generateForCustomCharacters(length, urlSafeCharacters);\n\t}\n\n\tif (type === 'numeric') {\n\t\treturn generateForCustomCharacters(length, numericCharacters);\n\t}\n\n\tif (type === 'distinguishable') {\n\t\treturn generateForCustomCharacters(length, distinguishableCharacters);\n\t}\n\n\tif (type === 'ascii-printable') {\n\t\treturn generateForCustomCharacters(length, asciiPrintableCharacters);\n\t}\n\n\tif (type === 'alphanumeric') {\n\t\treturn generateForCustomCharacters(length, alphanumericCharacters);\n\t}\n\n\tif (characters.length === 0) {\n\t\tthrow new TypeError('Expected `characters` string length to be greater than or equal to 1');\n\t}\n\n\tif (characters.length > 0x10000) {\n\t\tthrow new TypeError('Expected `characters` string length to be less or equal to 65536');\n\t}\n\n\treturn generateForCustomCharacters(length, characters.split(''));\n};\n\nconst cryptoRandomString = createGenerator(generateForCustomCharacters, generateRandomBytes);\n\ncryptoRandomString.async = createGenerator(generateForCustomCharactersAsync, generateRandomBytesAsync);\n\nexport default cryptoRandomString;\n","import cryptoRandomString from 'crypto-random-string';\n\nexport default function uniqueString() {\n\treturn cryptoRandomString({length: 32});\n}\n","import {promises as fs} from 'node:fs';\nimport os from 'node:os';\n\nconst temporaryDirectory = await fs.realpath(os.tmpdir());\n\nexport default temporaryDirectory;\n","import fs from 'node:fs';\nimport fsPromises from 'node:fs/promises';\nimport path from 'node:path';\nimport stream from 'node:stream';\nimport {promisify} from 'node:util';\nimport uniqueString from 'unique-string';\nimport tempDir from 'temp-dir';\nimport {isStream} from 'is-stream';\n\nconst pipeline = promisify(stream.pipeline); // TODO: Use `node:stream/promises` when targeting Node.js 16.\n\nconst getPath = (prefix = '') => path.join(tempDir, prefix + uniqueString());\n\nconst writeStream = async (filePath, data) => pipeline(data, fs.createWriteStream(filePath));\n\nasync function runTask(temporaryPath, callback) {\n\ttry {\n\t\treturn await callback(temporaryPath);\n\t} finally {\n\t\tawait fsPromises.rm(temporaryPath, {recursive: true, force: true, maxRetries: 2});\n\t}\n}\n\nexport function temporaryFile({name, extension} = {}) {\n\tif (name) {\n\t\tif (extension !== undefined && extension !== null) {\n\t\t\tthrow new Error('The `name` and `extension` options are mutually exclusive');\n\t\t}\n\n\t\treturn path.join(temporaryDirectory(), name);\n\t}\n\n\treturn getPath() + (extension === undefined || extension === null ? '' : '.' + extension.replace(/^\\./, ''));\n}\n\nexport const temporaryFileTask = async (callback, options) => runTask(temporaryFile(options), callback);\n\nexport function temporaryDirectory({prefix = ''} = {}) {\n\tconst directory = getPath(prefix);\n\tfs.mkdirSync(directory);\n\treturn directory;\n}\n\nexport const temporaryDirectoryTask = async (callback, options) => runTask(temporaryDirectory(options), callback);\n\nexport async function temporaryWrite(fileContent, options) {\n\tconst filename = temporaryFile(options);\n\tconst write = isStream(fileContent) ? writeStream : fsPromises.writeFile;\n\tawait write(filename, fileContent);\n\treturn filename;\n}\n\nexport const temporaryWriteTask = async (fileContent, callback, options) => runTask(await temporaryWrite(fileContent, options), callback);\n\nexport function temporaryWriteSync(fileContent, options) {\n\tconst filename = temporaryFile(options);\n\tfs.writeFileSync(filename, fileContent);\n\treturn filename;\n}\n\nexport {default as rootTemporaryDirectory} from 'temp-dir';\n",null,null,null,null,null,null,null,null,null,null,"const pDebounce = (fn, wait, options = {}) => {\n\tif (!Number.isFinite(wait)) {\n\t\tthrow new TypeError('Expected `wait` to be a finite number');\n\t}\n\n\tlet leadingValue;\n\tlet timeout;\n\tlet resolveList = [];\n\n\treturn function (...arguments_) {\n\t\treturn new Promise(resolve => {\n\t\t\tconst shouldCallNow = options.before && !timeout;\n\n\t\t\tclearTimeout(timeout);\n\n\t\t\ttimeout = setTimeout(() => {\n\t\t\t\ttimeout = null;\n\n\t\t\t\tconst result = options.before ? leadingValue : fn.apply(this, arguments_);\n\n\t\t\t\tfor (resolve of resolveList) {\n\t\t\t\t\tresolve(result);\n\t\t\t\t}\n\n\t\t\t\tresolveList = [];\n\t\t\t}, wait);\n\n\t\t\tif (shouldCallNow) {\n\t\t\t\tleadingValue = fn.apply(this, arguments_);\n\t\t\t\tresolve(leadingValue);\n\t\t\t} else {\n\t\t\t\tresolveList.push(resolve);\n\t\t\t}\n\t\t});\n\t};\n};\n\npDebounce.promise = function_ => {\n\tlet currentPromise;\n\n\treturn async function (...arguments_) {\n\t\tif (currentPromise) {\n\t\t\treturn currentPromise;\n\t\t}\n\n\t\ttry {\n\t\t\tcurrentPromise = function_.apply(this, arguments_);\n\t\t\treturn await currentPromise;\n\t\t} finally {\n\t\t\tcurrentPromise = undefined;\n\t\t}\n\t};\n};\n\nexport default pDebounce;\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,"\"use strict\";\n/**\n * This is the Posix implementation of isexe, which uses the file\n * mode and uid/gid values.\n *\n * @module\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sync = exports.isexe = void 0;\nconst fs_1 = require(\"fs\");\nconst promises_1 = require(\"fs/promises\");\n/**\n * Determine whether a path is executable according to the mode and\n * current (or specified) user and group IDs.\n */\nconst isexe = async (path, options = {}) => {\n const { ignoreErrors = false } = options;\n try {\n return checkStat(await (0, promises_1.stat)(path), options);\n }\n catch (e) {\n const er = e;\n if (ignoreErrors || er.code === 'EACCES')\n return false;\n throw er;\n }\n};\nexports.isexe = isexe;\n/**\n * Synchronously determine whether a path is executable according to\n * the mode and current (or specified) user and group IDs.\n */\nconst sync = (path, options = {}) => {\n const { ignoreErrors = false } = options;\n try {\n return checkStat((0, fs_1.statSync)(path), options);\n }\n catch (e) {\n const er = e;\n if (ignoreErrors || er.code === 'EACCES')\n return false;\n throw er;\n }\n};\nexports.sync = sync;\nconst checkStat = (stat, options) => stat.isFile() && checkMode(stat, options);\nconst checkMode = (stat, options) => {\n const myUid = options.uid ?? process.getuid?.();\n const myGroups = options.groups ?? process.getgroups?.() ?? [];\n const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];\n if (myUid === undefined || myGid === undefined) {\n throw new Error('cannot get uid or gid');\n }\n const groups = new Set([myGid, ...myGroups]);\n const mod = stat.mode;\n const uid = stat.uid;\n const gid = stat.gid;\n const u = parseInt('100', 8);\n const g = parseInt('010', 8);\n const o = parseInt('001', 8);\n const ug = u | g;\n return !!(mod & o ||\n (mod & g && groups.has(gid)) ||\n (mod & u && uid === myUid) ||\n (mod & ug && myUid === 0));\n};\n//# sourceMappingURL=posix.js.map","\"use strict\";\n/**\n * This is the Windows implementation of isexe, which uses the file\n * extension and PATHEXT setting.\n *\n * @module\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sync = exports.isexe = void 0;\nconst fs_1 = require(\"fs\");\nconst promises_1 = require(\"fs/promises\");\n/**\n * Determine whether a path is executable based on the file extension\n * and PATHEXT environment variable (or specified pathExt option)\n */\nconst isexe = async (path, options = {}) => {\n const { ignoreErrors = false } = options;\n try {\n return checkStat(await (0, promises_1.stat)(path), path, options);\n }\n catch (e) {\n const er = e;\n if (ignoreErrors || er.code === 'EACCES')\n return false;\n throw er;\n }\n};\nexports.isexe = isexe;\n/**\n * Synchronously determine whether a path is executable based on the file\n * extension and PATHEXT environment variable (or specified pathExt option)\n */\nconst sync = (path, options = {}) => {\n const { ignoreErrors = false } = options;\n try {\n return checkStat((0, fs_1.statSync)(path), path, options);\n }\n catch (e) {\n const er = e;\n if (ignoreErrors || er.code === 'EACCES')\n return false;\n throw er;\n }\n};\nexports.sync = sync;\nconst checkPathExt = (path, options) => {\n const { pathExt = process.env.PATHEXT || '' } = options;\n const peSplit = pathExt.split(';');\n if (peSplit.indexOf('') !== -1) {\n return true;\n }\n for (let i = 0; i < peSplit.length; i++) {\n const p = peSplit[i].toLowerCase();\n const ext = path.substring(path.length - p.length).toLowerCase();\n if (p && ext === p) {\n return true;\n }\n }\n return false;\n};\nconst checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options);\n//# sourceMappingURL=win32.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=options.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sync = exports.isexe = exports.posix = exports.win32 = void 0;\nconst posix = __importStar(require(\"./posix.js\"));\nexports.posix = posix;\nconst win32 = __importStar(require(\"./win32.js\"));\nexports.win32 = win32;\n__exportStar(require(\"./options.js\"), exports);\nconst platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;\nconst impl = platform === 'win32' ? win32 : posix;\n/**\n * Determine whether a path is executable on the current platform.\n */\nexports.isexe = impl.isexe;\n/**\n * Synchronously determine whether a path is executable on the\n * current platform.\n */\nexports.sync = impl.sync;\n//# sourceMappingURL=index.js.map","const { isexe, sync: isexeSync } = require('isexe')\nconst { join, delimiter, sep, posix } = require('path')\n\nconst isWindows = process.platform === 'win32'\n\n// used to check for slashed in commands passed in. always checks for the posix\n// seperator on all platforms, and checks for the current separator when not on\n// a posix platform. don't use the isWindows check for this since that is mocked\n// in tests but we still need the code to actually work when called. that is also\n// why it is ignored from coverage.\n/* istanbul ignore next */\nconst rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? '' : sep}]`.replace(/(\\\\)/g, '\\\\$1'))\nconst rRel = new RegExp(`^\\\\.${rSlash.source}`)\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, {\n path: optPath = process.env.PATH,\n pathExt: optPathExt = process.env.PATHEXT,\n delimiter: optDelimiter = delimiter,\n}) => {\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(rSlash) ? [''] : [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(optPath || /* istanbul ignore next: very unusual */ '').split(optDelimiter),\n ]\n\n if (isWindows) {\n const pathExtExe = optPathExt ||\n ['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter)\n const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()])\n if (cmd.includes('.') && pathExt[0] !== '') {\n pathExt.unshift('')\n }\n return { pathEnv, pathExt, pathExtExe }\n }\n\n return { pathEnv, pathExt: [''] }\n}\n\nconst getPathPart = (raw, cmd) => {\n const pathPart = /^\".*\"$/.test(raw) ? raw.slice(1, -1) : raw\n const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : ''\n return prefix + join(pathPart, cmd)\n}\n\nconst which = async (cmd, opt = {}) => {\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (const envPart of pathEnv) {\n const p = getPathPart(envPart, cmd)\n\n for (const ext of pathExt) {\n const withExt = p + ext\n const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true })\n if (is) {\n if (!opt.all) {\n return withExt\n }\n found.push(withExt)\n }\n }\n }\n\n if (opt.all && found.length) {\n return found\n }\n\n if (opt.nothrow) {\n return null\n }\n\n throw getNotFoundError(cmd)\n}\n\nconst whichSync = (cmd, opt = {}) => {\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (const pathEnvPart of pathEnv) {\n const p = getPathPart(pathEnvPart, cmd)\n\n for (const ext of pathExt) {\n const withExt = p + ext\n const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true })\n if (is) {\n if (!opt.all) {\n return withExt\n }\n found.push(withExt)\n }\n }\n }\n\n if (opt.all && found.length) {\n return found\n }\n\n if (opt.nothrow) {\n return null\n }\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n","import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n","import path from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport {locatePath, locatePathSync} from 'locate-path';\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) || '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, options.stopAt || root);\n\tconst limit = options.limit || Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) || '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = options.stopAt || root;\n\tconst limit = options.limit || Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n","import {findUp, findUpSync} from 'find-up';\n\nexport async function pkgUp({cwd} = {}) {\n\treturn findUp('package.json', {cwd});\n}\n\nexport function pkgUpSync({cwd} = {}) {\n\treturn findUpSync('package.json', {cwd});\n}\n",null,null,null,null,null,null],"names":["CommanderError","Error","constructor","exitCode","code","message","super","captureStackTrace","this","name","nestedError","undefined","InvalidArgumentError","error","require$$0","Argument$3","Argument","description","variadic","parseArg","defaultValue","defaultValueDescription","argChoices","required","_name","slice","length","_concatValue","value","previous","Array","isArray","concat","argParser","fn","choices","values","arg","includes","join","argRequired","argOptional","humanReadableArgName","nameOutput","argument","Help$3","Help","helpWidth","sortSubcommands","sortOptions","showGlobalOptions","visibleCommands","cmd","commands","filter","_hidden","helpCommand","_getHelpCommand","push","sort","a","b","localeCompare","compareOptions","getSortKey","option","short","replace","long","visibleOptions","options","hidden","helpOption","_getHelpOption","removeShort","_findOption","removeLong","createOption","visibleGlobalOptions","globalOptions","ancestorCmd","parent","visibleArguments","_argsDescription","registeredArguments","forEach","find","subcommandTerm","args","map","_aliases","optionTerm","flags","argumentTerm","longestSubcommandTermLength","helper","reduce","max","command","Math","longestOptionTermLength","longestGlobalOptionTermLength","longestArgumentTermLength","commandUsage","cmdName","ancestorCmdNames","usage","commandDescription","subcommandDescription","summary","optionDescription","extraInfo","choice","JSON","stringify","showDefault","optional","isBoolean","presetArg","envVar","argumentDescription","extraDescripton","formatHelp","termWidth","padWidth","itemIndentWidth","itemSeparatorWidth","formatItem","term","fullText","padEnd","wrap","formatList","textArray","repeat","output","argumentList","optionList","globalOptionList","commandList","str","width","indent","minColumnWidth","indents","manualIndent","RegExp","match","columnWidth","leadingStr","columnText","indentString","zeroWidthSpace","breaks","regex","lines","line","i","trimEnd","help","Option$3","Option","test","mandatory","optionFlags","splitOptionFlags","shortFlag","longFlag","negate","startsWith","conflictsWith","implied","preset","conflicts","names","implies","impliedOptionValues","newImplied","Object","assign","env","makeOptionMandatory","hideHelp","hide","attributeName","camelcase","is","DualOptions$1","DualOptions","positiveOptions","Map","negativeOptions","dualOptions","Set","set","key","has","add","valueFromOption","optionKey","get","negativeValue","split","word","toUpperCase","flagParts","shift","maxDistance","editDistance","abs","d","j","cost","min","suggestSimilar","candidates","from","searchingOptions","candidate","similar","bestDistance","minSimilarity","distance","similarity","suggestSimilar_1","EventEmitter","childProcess","require$$1","path","require$$2","fs","require$$3","process","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9","Command","_allowUnknownOption","_allowExcessArguments","_args","rawArgs","processedArgs","_scriptPath","_optionValues","_optionValueSources","_storeOptionsAsProperties","_actionHandler","_executableHandler","_executableFile","_executableDir","_defaultCommandName","_exitCallback","_combineFlagAndOptionalValue","_description","_summary","_enablePositionalOptions","_passThroughOptions","_lifeCycleHooks","_showHelpAfterError","_showSuggestionAfterError","_outputConfiguration","writeOut","stdout","write","writeErr","stderr","getOutHelpWidth","isTTY","columns","getErrHelpWidth","outputError","_helpOption","_addImplicitHelpCommand","_helpCommand","_helpConfiguration","copyInheritedSettings","sourceCommand","_getCommandAndAncestors","result","nameAndArgs","actionOptsOrExecDesc","execOpts","desc","opts","createCommand","isDefault","noHelp","executableFile","arguments","_registerCommand","createHelp","configureHelp","configuration","configureOutput","showHelpAfterError","displayHelp","showSuggestionAfterError","displaySuggestion","addCommand","_checkForBrokenPassThrough","createArgument","default","addArgument","trim","detail","previousArgument","enableOrNameAndArgs","helpName","helpArgs","helpDescription","addHelpCommand","deprecatedDescription","hasImplicitHelpCommand","_findCommand","hook","event","listener","allowedValues","exitOverride","err","_exit","exit","action","expectedArgsCount","actionArgs","apply","_callParseArg","target","invalidArgumentMessage","_registerOption","matchingOption","matchingFlag","knownBy","aliases","alreadyUsed","existingCmd","newCmd","addOption","oname","positiveLongFlag","setOptionValueWithSource","handleOptionValue","val","invalidValueMessage","valueSource","oldValue","getOptionValue","on","_optionEx","config","def","m","exec","requiredOption","combineFlagAndOptionalValue","combine","allowUnknownOption","allowUnknown","allowExcessArguments","allowExcess","enablePositionalOptions","positional","passThroughOptions","passThrough","storeOptionsAsProperties","storeAsProperties","keys","setOptionValue","source","getOptionValueSource","getOptionValueSourceWithGlobals","_prepareUserArgs","argv","parseOptions","versions","electron","userArgs","defaultApp","nameFromFilename","parse","_parseCommand","parseAsync","_executeSubCommand","subcommand","launchWithNode","sourceExt","findFile","baseDir","baseName","localBin","resolve","existsSync","extname","foundExt","ext","_checkForMissingMandatoryOptions","_checkForConflictingOptions","executableDir","resolvedScriptPath","realpathSync","dirname","localFile","legacyName","basename","proc","platform","unshift","incrementNodeInspectorPort","execArgv","spawn","stdio","execPath","killed","signals","signal","kill","exitCallback","_signal","executableDirMessage","executableMissing","wrappedError","runningCommand","_dispatchSubcommand","commandName","operands","unknown","subCommand","promiseChain","_chainOrCallSubCommandHook","_chainOrCall","_dispatchHelpCommand","subcommandName","_checkNumberOfArguments","missingArgument","_excessArguments","_processArguments","myParseArg","parsedValue","declaredArg","index","processed","v","promise","then","_chainOrCallHooks","hooks","reverse","hookedCommand","callback","hookDetail","parsed","_parseOptionsEnv","_parseOptionsImplied","_outputHelpIfRequested","checkForUnknownOptions","unknownOption","commandEvent","emit","listenerCount","unknownCommand","anOption","missingMandatoryOptionValue","_checkForConflictingLocalOptions","definedNonDefaultOptions","optionsWithConflicting","conflictingAndDefined","defined","_conflictingOption","dest","maybeOption","activeVariadicOption","optionMissingArgument","indexOf","len","_versionOptionName","_version","optsWithGlobals","combinedOptions","errorOptions","outputHelp","dualHelper","hasCustomOptionValue","impliedKey","conflictingOption","findBestOptionFromValue","optionValue","negativeOption","positiveOption","getErrorMessage","bestOption","flag","suggestion","candidateFlags","moreFlags","receivedArgs","expected","s","forSubcommand","unknownName","candidateNames","alias","version","versionOption","argsDescription","matchingCommand","_usage","filename","helpInformation","contextOptions","_getHelpContext","context","deprecatedCallback","Buffer","isBuffer","addHelpOption","addHelpText","position","text","helpEvent","helpStr","helpRequested","debugOption","debugHost","debugPort","parseInt","commander","program","InvalidOptionArgumentError","defineProperty","thenable","typedArray","array","func","number","string","boolean","String","Number","stringArray","every","elem","check","messages","Message","NotificationType9","NotificationType8","NotificationType6","NotificationType5","NotificationType4","NotificationType3","NotificationType2","NotificationType1","NotificationType0","NotificationType","RequestType9","RequestType8","RequestType6","RequestType5","RequestType4","RequestType3","RequestType2","RequestType1","RequestType","RequestType0","AbstractMessageSignature","ParameterStructures","ResponseError","ErrorCodes","ParseError","InvalidRequest","MethodNotFound","InvalidParams","InternalError","jsonrpcReservedErrorRangeStart","serverErrorStart","MessageWriteError","MessageReadError","PendingResponseRejected","ConnectionInactive","ServerNotInitialized","UnknownErrorCode","jsonrpcReservedErrorRangeEnd","serverErrorEnd","data","setPrototypeOf","prototype","toJson","kind","auto","byName","byPosition","toString","method","numberOfParams","parameterStructures","_parameterStructures","RequestType7","NotificationType7","isRequest","id","isNotification","isResponse","_a","linkedMap","LRUCache","LinkedMap","Touch","None","First","AsOld","Last","AsNew","_map","_head","_tail","_size","_state","clear","isEmpty","size","first","last","touch","item","next","addItemLast","addItemFirst","remove","delete","removeItem","callbackfn","thisArg","state","current","bind","iterator","Symbol","done","entries","toStringTag","trimOld","newSize","currentSize","toJSON","fromJSON","limit","ratio","_limit","_ratio","checkTrim","peek","round","disposable","Disposable","create","dispose","ral","_ral","RAL","install","events","Emitter","Event","ral_1","_disposable","CallbackList","bucket","_callbacks","_contexts","foundCallbackWithDifferentContext","splice","invoke","ret","callbacks","contexts","e","console","_options","_event","thisArgs","disposables","onFirstListenerAdd","_noop","onLastListenerRemove","fire","call","cancellation","CancellationTokenSource","CancellationToken","Is","events_1","freeze","isCancellationRequested","onCancellationRequested","Cancelled","shortcutEvent","handle","timer","setTimeout","MutableToken","_isCancelled","cancel","_emitter","token","_token","sharedArrayCancellation","SharedArrayReceiverStrategy","SharedArraySenderStrategy","cancellation_1","CancellationState","Continue","buffers","enableCancellation","request","buffer","SharedArrayBuffer","Int32Array","$cancellationData","sendCancellation","_conn","Atomics","store","cleanup","SharedArrayBufferCancellationToken","load","SharedArrayBufferCancellationTokenSource","createCancellationTokenSource","semaphore","Semaphore","capacity","_capacity","_active","_waiting","lock","thunk","Promise","reject","runNext","active","setImmediate","doRunNext","messageReader","ReadableStreamMessageReader","AbstractMessageReader","semaphore_1","MessageReader","listen","onError","onClose","onPartialMessage","errorEmitter","closeEmitter","partialMessageEmitter","fireError","asError","fireClose","firePartialMessage","info","ResolvedMessageReaderOptions","fromOptions","charset","contentDecoder","contentDecoders","contentTypeDecoder","contentTypeDecoders","decoder","applicationJson","readable","messageBuffer","_partialMessageTimeout","nextMessageLength","messageToken","readSemaphore","partialMessageTimeout","timeout","partialMessageTimer","onData","append","headers","tryReadHeaders","contentLength","fromEntries","isNaN","body","tryReadBody","setPartialMessageTimer","clearPartialMessageTimer","async","bytes","decode","catch","waitingTime","messageWriter","WriteableStreamMessageWriter","AbstractMessageWriter","ContentLength","CRLF","MessageWriter","count","ResolvedMessageWriterOptions","contentTypeEncoder","encoder","contentEncoder","writable","errorCount","writeSemaphore","msg","payload","encode","byteLength","doWrite","handleError","end","AbstractMessageBuffer","CR","LF","encoding","_encoding","_chunks","_totalLength","chunk","toAppend","fromString","lowerCaseKeys","chunkIndex","offset","chunkBytesRead","row","_read","header","substr","toLowerCase","numberOfBytes","byteCount","emptyBuffer","asNative","allocNative","resultOffset","chunkPart","exports","createMessageConnection","ConnectionOptions","CancellationStrategy","CancellationSenderStrategy","RequestCancellationReceiverStrategy","IdCancellationReceiverStrategy","ConnectionError","ConnectionErrors","SetTraceNotification","TraceFormat","Trace","NullLogger","ProgressToken","messages_1","linkedMap_1","CancelNotification","type","ProgressNotification","ProgressType","StarRequestHandler","warn","log","TraceValues","Off","Messages","Compact","Verbose","Text","LogTraceNotification","ConnectionStrategy","cancelUndispatched","CancellationReceiverStrategy","_","conn","sendNotification","receiver","sender","MessageStrategy","handleMessage","cancellationStrategy","connectionStrategy","messageStrategy","ConnectionState","_logger","logger","sequenceNumber","notificationSequenceNumber","unknownResponseSequenceNumber","starRequestHandler","requestHandlers","starNotificationHandler","notificationHandlers","progressHandlers","messageQueue","responsePromises","knownCanceledRequests","requestTokens","trace","traceFormat","tracer","New","unhandledNotificationEmitter","unhandledProgressEmitter","disposeEmitter","createRequestQueueKey","createResponseQueueKey","createNotificationQueueKey","addMessageToQueue","queue","_message","isListening","Listening","isClosed","Closed","isDisposed","Disposed","closeHandler","readErrorHandler","writeErrorHandler","triggerMessageQueue","processMessageQueue","handleRequest","handleNotification","handleResponse","handleInvalidMessage","cancelId","params","toCancel","strategy","response","traceSendingResponse","Date","now","cancellationToken","traceReceivedNotification","requestMessage","reply","resultOrError","startTime","jsonrpc","replyError","replySuccess","traceReceivedRequest","element","requestHandler","handler","tokenKey","cancellationSource","handlerResult","responseMessage","responsePromise","traceReceivedResponse","notificationHandler","responseHandler","stringifyTrace","traceSendingRequest","logLSPMessage","traceSendingNotification","timerStart","lspMessage","isLSPMessage","timestamp","throwIfClosedOrDisposed","throwIfListening","AlreadyListening","throwIfNotListening","undefinedToNull","param","nullToUndefined","isNamedParam","computeSingleParam","computeMessageParams","connection","messageParams","paramStart","paramEnd","notificationMessage","onNotification","onProgress","_type","sendProgress","onUnhandledProgress","sendRequest","p","resolveWithCleanup","r","rejectWithCleanup","onRequest","hasPendingResponse","_value","_tracer","sendNotificationOrTraceOptions","_sendNotification","_traceFormat","onUnhandledNotification","onDispose","inspect","verbose","enumerable","disposable_1","sharedArrayCancellation_1","messageReader_1","messageWriter_1","messageBuffer_1","connection_1","require$$10","ril","util_1","api_1","MessageBuffer","TextDecoder","allocUnsafe","ReadableStreamWrapper","stream","off","onEnd","WritableStreamWrapper","_ril","asReadableStream","asWritableStream","ms","clearTimeout","clearImmediate","setInterval","clearInterval","RIL","__createBinding","o","k","k2","getOwnPropertyDescriptor","__esModule","configurable","__exportStar","hasOwnProperty","createServerSocketTransport","createClientSocketTransport","createServerPipeTransport","createClientPipeTransport","StreamMessageWriter","StreamMessageReader","SocketMessageWriter","SocketMessageReader","PortMessageReader","IPCMessageWriter","IPCMessageReader","ril_1","os","crypto_1","net_1","eventEmitter","send","port","PortMessageWriter","postMessage","socket","destroy","XDG_RUNTIME_DIR","safeIpcPathLengths","generateRandomPipeName","randomSuffix","randomBytes","tmpdir","pipeName","connectResolve","connected","_reject","server","createServer","close","removeListener","onConnected","createConnection","isReadableStream","read","addListener","isWritableStream","input","reader","writer","node","factory","require","module","TextDocument","EOL","WorkspaceFolder","InlineCompletionContext","SelectedCompletionInfo","InlineCompletionTriggerKind","InlineCompletionList","InlineCompletionItem","StringValue","InlayHint","InlayHintLabelPart","InlayHintKind","InlineValueContext","InlineValueEvaluatableExpression","InlineValueVariableLookup","InlineValueText","SemanticTokens","SemanticTokenModifiers","SemanticTokenTypes","SelectionRange","DocumentLink","FormattingOptions","CodeLens","CodeAction","CodeActionContext","CodeActionTriggerKind","CodeActionKind","DocumentSymbol","WorkspaceSymbol","SymbolInformation","SymbolTag","SymbolKind","DocumentHighlight","DocumentHighlightKind","SignatureInformation","ParameterInformation","Hover","MarkedString","CompletionList","CompletionItem","CompletionItemLabelDetails","InsertTextMode","InsertReplaceEdit","CompletionItemTag","InsertTextFormat","CompletionItemKind","MarkupContent","MarkupKind","TextDocumentItem","OptionalVersionedTextDocumentIdentifier","VersionedTextDocumentIdentifier","TextDocumentIdentifier","WorkspaceChange","WorkspaceEdit","DeleteFile","RenameFile","CreateFile","TextDocumentEdit","AnnotatedTextEdit","ChangeAnnotationIdentifier","ChangeAnnotation","TextEdit","Diagnostic","CodeDescription","DiagnosticTag","DiagnosticSeverity","DiagnosticRelatedInformation","FoldingRange","FoldingRangeKind","ColorPresentation","ColorInformation","Color","LocationLink","Location","Range","Position","uinteger","integer","URI","DocumentUri","MIN_VALUE","MAX_VALUE","character","objectLiteral","one","two","three","four","start","uri","range","targetUri","targetRange","targetSelectionRange","originSelectionRange","red","green","blue","alpha","numberRange","color","label","textEdit","additionalTextEdits","Comment","Imports","Region","startLine","endLine","startCharacter","endCharacter","collapsedText","location","Warning","Information","Hint","Unnecessary","Deprecated","href","severity","relatedInformation","codeDescription","title","_i","newText","insert","del","needsConfirmation","annotation","annotationId","textDocument","edits","overwrite","ignoreIfExists","oldUri","newUri","recursive","ignoreIfNotExists","changes","documentChanges","change","TextEditChangeImpl","changeAnnotations","edit","assertChangeAnnotations","manage","all","ChangeAnnotations","annotations","_annotations","_counter","idOrAnnotation","nextId","workspaceEdit","_this","_textEditChanges","_workspaceEdit","_changeAnnotations","textEditChange","initDocumentChanges","getTextEditChange","textDocumentEdit","initChanges","createFile","optionsOrAnnotation","operation","renameFile","deleteFile","languageId","PlainText","Markdown","Method","Function","Constructor","Field","Variable","Class","Interface","Module","Property","Unit","Value","Enum","Keyword","Snippet","File","Reference","Folder","EnumMember","Constant","Struct","Operator","TypeParameter","asIs","adjustIndentation","items","isIncomplete","fromPlainText","plainText","language","contents","documentation","parameters","Read","Write","Namespace","Package","Boolean","Key","Null","containerName","selectionRange","children","deprecated","tags","Empty","QuickFix","Refactor","RefactorExtract","RefactorInline","RefactorRewrite","Source","SourceOrganizeImports","SourceFixAll","Invoked","Automatic","diagnostics","only","triggerKind","kindOrCommandOrEdit","checkKind","isPreferred","tabSize","insertSpaces","resultId","variableName","caseSensitiveLookup","expression","frameId","stoppedLocation","Type","Parameter","tooltip","textEdits","paddingLeft","paddingRight","createSnippet","insertText","filterText","selectedCompletionInfo","content","FullTextDocument","lineCount","getText","positionAt","offsetAt","applyEdits","document","sortedEdits","mergeSort","diff","lastModifiedOffset","startOffset","endOffset","substring","compare","left","right","leftIdx","rightIdx","_uri","_languageId","_content","_lineOffsets","update","getLineOffsets","lineOffsets","isLineStart","ch","charAt","low","high","mid","floor","lineOffset","nextLineOffset","ProtocolNotificationType","ProtocolNotificationType0","ProtocolRequestType","ProtocolRequestType0","RegistrationType","MessageDirection","vscode_jsonrpc_1","protocol_implementation","ImplementationRequest","messageDirection","clientToServer","protocol_typeDefinition","TypeDefinitionRequest","protocol_workspaceFolder","DidChangeWorkspaceFoldersNotification","WorkspaceFoldersRequest","serverToClient","protocol_configuration","ConfigurationRequest","protocol_colorProvider","ColorPresentationRequest","DocumentColorRequest","protocol_foldingRange","FoldingRangeRefreshRequest","FoldingRangeRequest","protocol_declaration","DeclarationRequest","protocol_selectionRange","SelectionRangeRequest","protocol_progress","WorkDoneProgressCancelNotification","WorkDoneProgressCreateRequest","WorkDoneProgress","protocol_callHierarchy","CallHierarchyOutgoingCallsRequest","CallHierarchyIncomingCallsRequest","CallHierarchyPrepareRequest","protocol_semanticTokens","SemanticTokensRefreshRequest","SemanticTokensRangeRequest","SemanticTokensDeltaRequest","SemanticTokensRequest","SemanticTokensRegistrationType","TokenFormat","Relative","registrationMethod","protocol_showDocument","ShowDocumentRequest","protocol_linkedEditingRange","LinkedEditingRangeRequest","protocol_fileOperations","WillDeleteFilesRequest","DidDeleteFilesNotification","DidRenameFilesNotification","WillRenameFilesRequest","DidCreateFilesNotification","FileOperationPatternKind","file","folder","WillCreateFilesRequest","protocol_moniker","MonikerRequest","MonikerKind","UniquenessLevel","project","group","scheme","global","$import","$export","local","protocol_typeHierarchy","TypeHierarchySubtypesRequest","TypeHierarchySupertypesRequest","TypeHierarchyPrepareRequest","protocol_inlineValue","InlineValueRefreshRequest","InlineValueRequest","protocol_inlayHint","InlayHintRefreshRequest","InlayHintResolveRequest","InlayHintRequest","protocol_diagnostic","DiagnosticRefreshRequest","WorkspaceDiagnosticRequest","DocumentDiagnosticRequest","DocumentDiagnosticReportKind","DiagnosticServerCancellationData","retriggerRequest","Full","Unchanged","partialResult","protocol_notebook","DidCloseNotebookDocumentNotification","DidChangeNotebookDocumentNotification","NotebookCellArrayChange","NotebookDocumentSyncRegistrationType","NotebookDocument","ExecutionSummary","NotebookCellKind","vscode_languageserver_types_1","Markup","Code","executionOrder","success","equals","other","NotebookCell","metadata","executionSummary","equalsMetadata","oneArray","otherArray","oneKeys","otherKeys","prop","notebookType","cells","DidOpenNotebookDocumentNotification","deleteCount","DidSaveNotebookDocumentNotification","protocol_inlineCompletion","InlineCompletionRequest","WorkspaceSymbolRequest","CodeActionResolveRequest","DocumentSymbolRequest","DocumentHighlightRequest","DefinitionRequest","SignatureHelpRequest","SignatureHelpTriggerKind","HoverRequest","CompletionResolveRequest","CompletionRequest","PublishDiagnosticsNotification","WatchKind","RelativePattern","FileChangeType","DidChangeWatchedFilesNotification","WillSaveTextDocumentWaitUntilRequest","TextDocumentSaveReason","DidSaveTextDocumentNotification","DidCloseTextDocumentNotification","DidChangeTextDocumentNotification","TextDocumentContentChangeEvent","DidOpenTextDocumentNotification","TelemetryEventNotification","LogMessageNotification","ShowMessageRequest","ShowMessageNotification","MessageType","DidChangeConfigurationNotification","ShutdownRequest","InitializedNotification","InitializeErrorCodes","InitializeRequest","WorkDoneProgressOptions","TextDocumentRegistrationOptions","PositionEncodingKind","FailureHandlingKind","ResourceOperationKind","UnregistrationRequest","RegistrationRequest","DocumentSelector","NotebookDocumentFilter","TextDocumentFilter","ApplyWorkspaceEditRequest","ExecuteCommandRequest","PrepareRenameRequest","RenameRequest","PrepareSupportDefaultBehavior","DocumentRangesFormattingRequest","DocumentRangeFormattingRequest","DocumentFormattingRequest","DocumentLinkResolveRequest","DocumentLinkRequest","CodeLensRefreshRequest","CodeLensRequest","WorkspaceSymbolResolveRequest","protocol_implementation_1","protocol_typeDefinition_1","protocol_workspaceFolder_1","protocol_configuration_1","protocol_colorProvider_1","protocol_foldingRange_1","protocol_declaration_1","protocol_selectionRange_1","protocol_progress_1","require$$11","protocol_callHierarchy_1","require$$12","protocol_semanticTokens_1","require$$13","protocol_showDocument_1","require$$14","protocol_linkedEditingRange_1","require$$15","protocol_fileOperations_1","require$$16","protocol_moniker_1","require$$17","protocol_typeHierarchy_1","require$$18","protocol_inlineValue_1","require$$19","protocol_inlayHint_1","require$$20","protocol_diagnostic_1","require$$21","protocol_notebook_1","require$$22","protocol_inlineCompletion_1","require$$23","pattern","NotebookCellTextDocumentFilter","notebook","Create","Rename","Delete","Abort","Transactional","TextOnlyTransactional","Undo","UTF8","UTF16","UTF32","StaticRegistrationOptions","hasId","documentSelector","workDoneProgress","hasWorkDoneProgress","unknownProtocolVersion","ExitNotification","Info","Log","Debug","TextDocumentSyncKind","Incremental","isIncremental","rangeLength","isFull","Manual","AfterDelay","FocusOut","WillSaveTextDocumentNotification","Created","Changed","Deleted","baseUri","Change","CompletionTriggerKind","TriggerCharacter","TriggerForIncompleteCompletions","ContentChange","ReferencesRequest","CodeActionRequest","CodeLensResolveRequest","DocumentOnTypeFormattingRequest","Identifier","createProtocolConnection","LSPErrorCodes","lspReservedErrorRangeStart","RequestFailed","ServerCancelled","ContentModified","RequestCancelled","lspReservedErrorRangeEnd","node_1","uuid","generateUuid","isUUID","v4","empty","ValueUUID","asHex","V4UUID","_oneOf","random","_randomHex","_chars","_timeHighBits","_UUIDPattern","progress","attachPartialResult","ProgressFeature","attachWorkDone_1","vscode_languageserver_protocol_1","uuid_1","WorkDoneProgressReporterImpl","_connection","Instances","begin","percentage","cancellable","report","arg0","arg1","WorkDoneProgressServerReporterImpl","_source","NullProgressReporter","NullProgressServerReporter","attachWorkDone","workDoneToken","Base","_progressSupported","initialize","capabilities","window","attachWorkDoneProgress","createWorkDoneProgress","ResultProgress","ResultProgressReporterImpl","partialResultToken","ConfigurationFeature","getConfiguration","_getConfiguration","section","workspaceFolder","WorkspaceFoldersFeature","_notificationIsAutoRegistered","workspaceCapabilities","workspace","workspaceFolders","_onDidChangeWorkspaceFolders","fillServerCapabilities","changeNotifications","getWorkspaceFolders","onDidChangeWorkspaceFolders","_unregistration","client","register","callHierarchy","CallHierarchyFeature","onPrepare","onIncomingCalls","attachPartialResultProgress","onOutgoingCalls","semanticTokens","SemanticTokensBuilder","SemanticTokensDiff","SemanticTokensFeature","refresh","onDelta","onRange","originalSequence","modifiedSequence","computeDiff","originalLength","modifiedLength","startIndex","originalEndIndex","modifiedEndIndex","newData","_prevData","_id","_prevLine","_prevChar","_data","_dataLen","char","tokenType","tokenModifiers","pushLine","pushChar","previousResult","build","canBuildEdits","buildEdits","showDocument","ShowDocumentFeature","fileOperations","FileOperationsFeature","onDidCreateFiles","onDidRenameFiles","onDidDeleteFiles","onWillCreateFiles","onWillRenameFiles","onWillDeleteFiles","linkedEditingRange","LinkedEditingRangeFeature","onLinkedEditingRange","typeHierarchy","TypeHierarchyFeature","onSupertypes","onSubtypes","inlineValue","InlineValueFeature","foldingRange","FoldingRangeFeature","inlayHint","InlayHintFeature","diagnostic","DiagnosticFeature","onWorkspace","textDocuments","TextDocuments","_configuration","_syncedDocuments","_onDidChangeContent","_onDidOpen","_onDidClose","_onDidSave","_onWillSave","onDidOpen","onDidChangeContent","onWillSave","onWillSaveWaitUntil","_willSaveWaitUntil","onDidSave","onDidClose","__textDocumentSync","onDidOpenTextDocument","td","toFire","onDidChangeTextDocument","contentChanges","syncedDocument","onDidCloseTextDocument","onWillSaveTextDocument","reason","onWillSaveTextDocumentWaitUntil","onDidSaveTextDocument","NotebookDocuments","NotebookSyncFeature","textDocuments_1","synchronization","onDidOpenNotebookDocument","onDidChangeNotebookDocument","onDidSaveNotebookDocument","onDidCloseNotebookDocument","CellTextDocumentConnection","openHandler","openTextDocument","changeHandler","changeTextDocument","closeTextDocument","NULL_DISPOSE","configurationOrTextDocuments","_cellTextDocuments","notebookDocuments","notebookCellMap","_onDidChange","cellTextDocuments","getCellTextDocument","cell","getNotebookDocument","getNotebookCell","findNotebookDocumentForCell","onDidChange","cellTextDocumentConnection","notebooks","notebookDocument","cellTextDocument","updateCellMap","oldMetadata","metadataChanged","opened","closed","changedCells","structure","didOpen","open","didClose","cellUpdates","old","new","textContent","changeEvent","added","removed","changed","moniker","MonikerFeature","combineFeatures","combineNotebooksFeatures","combineLanguagesFeatures","combineWorkspaceFeatures","combineWindowFeatures","combineClientFeatures","combineTracerFeatures","combineTelemetryFeatures","combineConsoleFeatures","_NotebooksImpl","BulkUnregistration","BulkRegistration","ErrorMessageTracker","UUID","progress_1","configuration_1","workspaceFolder_1","callHierarchy_1","semanticTokens_1","showDocument_1","fileOperations_1","linkedEditingRange_1","typeHierarchy_1","inlineValue_1","foldingRange_1","inlayHint_1","diagnostic_1","notebook_1","moniker_1","null2Undefined","_messages","sendErrors","showErrorMessage","RemoteConsoleImpl","rawAttach","_rawConnection","attach","_capabilities","debug","_RemoteWindowImpl","actions","showWarningMessage","showInformationMessage","RemoteWindowImpl","BulkRegistrationImpl","_registrations","_registered","registerOptions","asRegistrationParams","registrations","BulkUnregistrationImpl","unregistrations","_unregistrations","unregistration","isAttached","unregisterations","disposeSingle","_error","RemoteClientImpl","typeOrRegistrations","registerOptionsOrType","registerMany","registerSingle1","registerSingle2","_result","unregisterSingle","registration","_RemoteWorkspaceImpl","applyEdit","paramOrEdit","isApplyWorkspaceEditParams","RemoteWorkspaceImpl","TracerImpl","_trace","TelemetryImpl","logEvent","_LanguagesImpl","LanguagesImpl","NotebooksImpl","__brand","telemetry","languages","connectionFactory","watchDog","factories","remoteWindow","allRemotes","asPromise","resolved","shutdownHandler","initializeHandler","exitHandler","protocolConnection","onInitialize","onInitialized","onShutdown","onExit","onDidChangeConfiguration","onDidChangeWatchedFiles","sendDiagnostics","onHover","onCompletion","onCompletionResolve","onSignatureHelp","onDeclaration","onDefinition","onTypeDefinition","onImplementation","onReferences","onDocumentHighlight","onDocumentSymbol","onWorkspaceSymbol","onWorkspaceSymbolResolve","onCodeAction","onCodeActionResolve","onCodeLens","onCodeLensResolve","onDocumentFormatting","onDocumentRangeFormatting","onDocumentOnTypeFormatting","onRenameRequest","onPrepareRename","onDocumentLinks","onDocumentLinkResolve","onDocumentColor","onColorPresentation","onFoldingRanges","onSelectionRanges","onExecuteCommand","remote","textDocumentSync","shutdownReceived","files","resolveModulePath","FileSystem","resolveGlobalYarnPath","resolveGlobalNodePath","uriToFilePath","url","child_process_1","protocol","segments","decodeURIComponent","second","normalize","isWindows","moduleName","nodePath","cwd","nodePathKey","app","newEnv","delimiter","cp","fork","pid","c","npmCommand","shell","spawnSync","prefix","yarnCommand","results","yarn","_isCaseSensitive","isCaseSensitive","__filename","isParent","child","workspaceRoot","isAbsolute","inlineCompletion_proposed","InlineCompletionFeature","inlineCompletion","ProposedFeatures","ic","Files","node_util_1","server_1","fm","endProtocolConnection","_shutdownReceived","exitTimer","setupExitTimer","argName","runTimer","processId","ex","arg2","arg3","arg4","_createConnection","stdin","transport","commandLineMessage","inputStream","patchConsole","serialize","counters","assert","assertion","rest","counter","countReset","dir","stack","LogLevel","level","LspClientLogger","sendMessage","messageObjects","overrideLevel","logMessage","logLevelToLspMessageType","lsp","logIgnoringVerbosity","data2String","PrefixingLogger","padLeft","getUTCHours","getMinutes","getUTCSeconds","getMilliseconds","n","pad","universalify","fromCallback","res","fromPromise","cb","pop","constants","origCwd","GRACEFUL_FS_PLATFORM","er","chdir","polyfills","patch","patchLchmod","lutimes","patchLutimes","chown","chownFix","fchown","lchown","chmod","chmodFix","fchmod","lchmod","chownSync","chownFixSync","fchownSync","lchownSync","chmodSync","chmodFixSync","fchmodSync","lchmodSync","stat","statFix","fstat","lstat","statSync","statFixSync","fstatSync","lstatSync","mode","nextTick","uid","gid","rename","fs$rename","to","backoff","CB","stater","st","fs$read","fd","callback_","eagCounter","__","readSync","fs$readSync","O_WRONLY","O_SYMLINK","err2","openSync","threw","closeSync","futimes","at","mt","er2","lutimesSync","futimesSync","_b","_c","orig","chownErOk","stats","nonroot","getuid","Stream","legacyStreams","legacy","ReadStream","WriteStream","self","paused","bufferSize","setEncoding","TypeError","Infinity","pos","bytesWritten","busy","_queue","_open","flush","clone_1","clone","getPrototypeOf","obj","__proto__","copy","getOwnPropertyNames","util","gracefulQueue","previousSymbol","for","noop","publishQueue","debuglog","NODE_DEBUG","format","fs$close","resetQueue","fs$closeSync","equal","gracefulFs","TEST_GRACEFUL_FS_GLOBAL_PATCH","__patched","gracefulify","createReadStream","createWriteStream","fs$readFile","readFile","go$readFile","enqueue","fs$writeFile","writeFile","go$writeFile","fs$appendFile","appendFile","go$appendFile","fs$copyFile","copyFile","src","go$copyFile","fs$readdir","readdir","noReaddirOptionVersions","go$readdir","fs$readdirCallback","legStreams","fs$ReadStream","ReadStream$open","fs$WriteStream","WriteStream$open","FileReadStream","FileWriteStream","that","autoClose","fs$open","go$open","retry","retryTimer","lastTime","sinceAttempt","sinceStart","desiredDelay","u","api","exists","bytesRead","readv","writev","realpath","native","emitWarning","utils","checkPath","pth","pathHasInvalidWinCharacters","root","getMode","defaults","makeDir","mkdir","makeDirSync","mkdirSync","_makeDir","mkdirs","mkdirsSync","mkdirp","mkdirpSync","ensureDir","ensureDirSync","pathExists","access","pathExists_1","pathExistsSync","utimesMillis","atime","mtime","closeErr","utimesMillisSync","utimes","getStats","statFunc","dereference","bigint","srcStat","destStat","getStatsSync","checkPaths","funcName","areIdentical","srcBaseName","destBaseName","isChangingCase","isDirectory","isSrcSubdir","errMsg","checkPathsSync","checkParentPaths","srcParent","destParent","checkParentPathsSync","ino","dev","srcArr","sep","destArr","cur","clobber","preserveTimestamps","arch","include","runFilter","dirExists","getStatsAndPerformCopy","statFn","onDir","isFile","isCharacterDevice","isBlockDevice","onFile","isSymbolicLink","onLink","isSocket","isFIFO","unlink","errorOnExist","fileIsNotWritable","makeFileWritable","updatedSrcStat","srcMode","srcItem","destItem","resolvedSrc","readlink","symlink","resolvedDest","copy_1","copySync","mayCopyFile","unlinkSync","copyFileSync","handleTimestamps","setDestMode","setDestTimestamps","mkDirAndCopy","copyDir","readdirSync","copyDirItem","readlinkSync","symlinkSync","copyLink","copySync_1","rm","force","removeSync","rmSync","remove_1","emptyDir","emptyDirSync","emptydirSync","emptydir","dirStats","createFileSync","writeFileSync","createLink","srcpath","dstpath","dstStat","link","createLinkSync","linkSync","symlinkPaths","toCwd","toDst","dstdir","relativeToDst","relative","symlinkPathsSync","srcExists","symlinkPaths_1","symlinkType","symlinkTypeSync","symlinkType_1","createSymlink","toType","createSymlinkSync","ensure","ensureFile","ensureFileSync","ensureLink","ensureLinkSync","ensureSymlink","ensureSymlinkSync","finalEOL","replacer","spaces","EOF","stripBom","_fs","_readFile","shouldThrow","throws","reviver","readFileSync","_writeFile","jsonfile","jsonfile_1","jsonFile","readJson","readJsonSync","writeJson","writeJsonSync","outputFile","outputFileSync","outputFile_1","outputJson","outputJson_1","outputJsonSync","outputJsonSync_1","outputJSON","outputJSONSync","writeJSON","writeJSONSync","readJSON","readJSONSync","json","move","parsedParentPath","doRename","moveAcrossDevice","move_1","moveSync","isParentRoot","parsedPath","renameSync","moveSync_1","lib","LIB","t","h","charCodeAt","lastIndexOf","f","l","g","_makeLong","base","win32","posix","Utils","P","navigator","userAgent","authority","query","fragment","isUri","fsPath","with","C","y","revive","_formatted","external","_fsPath","_sep","$mid","encodeURIComponent","fromCharCode","A","w","x","joinPath","resolvePath","getWellformedRange","addedLineOffsets","computeLineOffsets","getWellformedEdit","spans","isAtLineStart","textOffset","typescript","typescriptreact","javascript","javascriptreact","jsTsLanguageModes","isTypeScriptDocument","doc","TypeScriptRenameRequest","CommandTypes","HighlightSpanKind","JsxEmit","ModuleKind","ModuleResolutionKind","SemicolonPreference","ScriptElementKind","ScriptElementKindModifier","ScriptTarget","SymbolDisplayPartKind","OrganizeImportsMode","KindModifiers","dtsFile","tsFile","tsxFile","jsFile","jsxFile","fileExtensionKindModifiers","SYMBOL_DISPLAY_PART_KIND_MAP","aliasName","className","enumName","fieldName","interfaceName","keyword","lineBreak","numericLiteral","stringLiteral","localName","methodName","operator","parameterName","propertyName","punctuation","space","typeParameterName","enumMemberName","functionName","regularExpressionLiteral","linkName","linkText","toSymbolDisplayPartKind","ServerType","ServerResponse","NoContent","NoServer","ClientCapability","ClientCapabilities","capability","SEMVER_SPEC_VERSION","MAX_LENGTH","MAX_SAFE_INTEGER","MAX_SAFE_COMPONENT_LENGTH","MAX_SAFE_BUILD_LENGTH","RELEASE_TYPES","FLAG_INCLUDE_PRERELEASE","FLAG_LOOSE","debug_1","re","safeRe","R","LETTERDASHNUMBER","safeRegexReplacements","makeSafeRegex","createToken","isGlobal","safe","NUMERICIDENTIFIER","NUMERICIDENTIFIERLOOSE","NONNUMERICIDENTIFIER","PRERELEASEIDENTIFIER","PRERELEASEIDENTIFIERLOOSE","BUILDIDENTIFIER","MAINVERSION","PRERELEASE","BUILD","FULLPLAIN","MAINVERSIONLOOSE","PRERELEASELOOSE","LOOSEPLAIN","XRANGEIDENTIFIER","XRANGEIDENTIFIERLOOSE","GTLT","XRANGEPLAIN","XRANGEPLAINLOOSE","COERCEPLAIN","COERCE","COERCEFULL","LONETILDE","tildeTrimReplace","LONECARET","caretTrimReplace","comparatorTrimReplace","looseOption","loose","emptyOpts","parseOptions_1","numeric","compareIdentifiers","anum","bnum","rcompareIdentifiers","identifiers","SemVer$d","SemVer","includePrerelease","LOOSE","FULL","raw","major","minor","prerelease","num","compareMain","comparePre","compareBuild","inc","release","identifier","identifierBase","semver","throwErrors","parse_1","valid","valid_1","clean","clean_1","inc_1","version1","version2","v1","v2","comparison","v1Higher","highVersion","lowVersion","highHasPre","lowHasPre","diff_1","major_1","minor_1","patch_1","prerelease_1","compare_1","rcompare","rcompare_1","compareLoose","compareLoose_1","versionA","versionB","compareBuild_1","list","sort_1","rsort","rsort_1","gt","gt_1","lt","lt_1","eq","eq_1","neq","neq_1","gte","gte_1","lte","lte_1","cmp","op","cmp_1","coerce","rtl","coerceRtlRegex","COERCERTLFULL","COERCERTL","lastIndex","coerce_1","Yallist","walker","head","yallist","Node","tail","removeNode","prev","unshiftNode","pushNode","thisp","forEachReverse","getReverse","mapReverse","initial","acc","reduceReverse","toArray","arr","toArrayReverse","sliceReverse","nodes","inserted","MAX","LENGTH","LENGTH_CALCULATOR","ALLOW_STALE","MAX_AGE","DISPOSE","NO_DISPOSE_ON_SET","LRU_LIST","CACHE","UPDATE_AGE_ON_GET","naiveLength","lc","stale","maxAge","noDisposeOnSet","updateAgeOnGet","reset","mL","allowStale","mA","lengthCalculator","lC","hit","itemCount","rforEach","forEachStep","dump","isStale","dumpLru","Entry","expiresAt","prune","doUse","lruCache","Comparator","parseRange","isNullSet","isAny","comps","memoOpts","memoKey","cached","cache","hr","HYPHENRANGELOOSE","HYPHENRANGE","hyphenReplace","COMPARATORTRIM","TILDETRIM","CARETTRIM","rangeList","comp","parseComparator","replaceGTE0","COMPARATORLOOSE","rangeMap","comparators","intersects","some","thisComparators","isSatisfiable","rangeComparators","thisComparator","rangeComparator","testSet","LRU","remainingComparators","testComparator","otherComparator","replaceCarets","replaceTildes","replaceXRanges","replaceStars","isX","replaceTilde","TILDELOOSE","TILDE","M","pr","replaceCaret","CARETLOOSE","CARET","z","replaceXRange","XRANGELOOSE","XRANGE","gtlt","xM","xm","xp","anyX","STAR","GTE0PRE","GTE0","incPr","$0","fM","fp","fpr","fb","tM","tm","tp","tpr","tb","ANY","allowed","COMPARATOR","comparator","satisfies","satisfies_1","toComparators","toComparators_1","maxSatisfying","maxSV","rangeObj","maxSatisfying_1","minSatisfying","minSV","minSatisfying_1","minVersion","minver","setMin","compver","minVersion_1","validRange","outside","hilo","gtfn","ltefn","ltfn","ecomp","outside_1","gtr","gtr_1","ltr","ltr_1","r1","r2","intersects_1","simplify","included","ranges","simplified","original","subset","sub","dom","sawNonNull","OUTER","simpleSub","simpleDom","isSub","simpleSubset","minimumVersionWithPreRelease","minimumVersion","eqSet","higherGT","lowerLT","gtltComp","higher","lower","hasDomLT","hasDomGT","needDomLTPre","needDomGTPre","subset_1","internalRe","require$$24","require$$25","require$$26","require$$27","require$$28","require$$29","require$$30","require$$31","require$$32","require$$33","require$$34","require$$35","require$$36","require$$37","require$$38","simplifyRange","require$$39","require$$40","tokens","API","fromSimpleString","fromVersionString","versionString","displayName","fullVersionString","defaultVersion","v300","v310","v314","v320","v333","v340","v345","v350","v380","v381","v390","v400","v401","v420","v430","v440","v460","v470","v480","v490","v500","v510","itemEquals","coalesce","Delayer","defaultDelay","completionPromise","onSuccess","task","trigger","delay","cancelTimeout","makeRandomHexString","chars","idx","getRootTempDir","getInstanceTempDir","getTempFile","looksLikeAbsoluteWindowsPath","onCaseInsensitiveFileSystem","temp","ResourceMap","_normalizePath","defaultPathNormalizer","resource","toKey","entry","isCaseInsensitivePath","mode2ScriptKind","languageModeIds.typescript","languageModeIds.typescriptreact","languageModeIds.javascript","languageModeIds.javascriptreact","getModeFromFileUri","extension","PendingDiagnostics","getOrderedFileSet","orderedResources","GetErrRequest","executeGetErrRequest","onDone","_done","lsp.CancellationTokenSource","isErrorReportingEnabled","supportsSyntaxGetErr","apiVersion","allFiles","hasCapabilityForResource","Semantic","toTsFilePath","areProjectDiagnosticsEnabled","executeAsync","GeterrForProject","Geterr","finally","LspDocument","filepath","_document","_filepath","getLine","lineRange","getLineRange","lineStart","getLineStart","lineEnd","getLineEnd","lsp.Range","nextLine","getLineOffset","lsp.Position","getFullRange","newContent","lsp.TextDocumentContentChangeEvent","LspDocuments","lspClient","_validateJavaScript","_validateTypeScript","modeIds","_files","documents","pathNormalizer","pendingDiagnostics","diagnosticDelayer","allModeIds","documentsForTesting","detectedLanguageId","lsp.MessageType","executeWithoutWaitingForResponse","Open","fileContent","scriptKindName","projectRootPath","getProjectRootPath","requestDiagnostic","toOpenDocument","pendingGetErr","cancelInflightRequestsForResource","Close","requestAllDiagnostics","requestDiagnosticsForTesting","triggerDiagnostics","endPos","insertString","didTrigger","interruptGetErr","getWorkspaceRootForResource","handles","shouldValidate","hasPendingDiagnostics","getErr","resources","handledResources","sendPendingDiagnostics","ceil","orderedFileSet","untitled","git","github","azurerepos","zipfile","vsls","getSemanticSupportedSchemes","disabledSchemes","TypeScriptServerPlugin","arrays.equals","PluginManager","setPlugins","plugins","_plugins","readPlugins","newPlugins","plugin","TypeScriptServerError","serverId","parsedResult","parseErrorText","serverMessage","serverStack","serverErrorText","serverCommand","errorText","errorPrefix","prefixFreeErrorText","newlineIndex","randomBytesAsync","promisify","crypto","urlSafeCharacters","numericCharacters","distinguishableCharacters","asciiPrintableCharacters","alphanumericCharacters","generateForCustomCharacters","characters","characterCount","maxValidSelector","entropyLength","stringLength","entropy","entropyPosition","entropyValue","readUInt16LE","generateForCustomCharactersAsync","generateRandomBytes","generateRandomBytesAsync","allowedTypes","createGenerator","isFinite","cryptoRandomString","uniqueString","temporaryDirectory","pipeline","getPath","tempDir","temporaryFile","directory","NodeRequestCanceller","_serverId","cancellationPipeName","tryCancelOngoingRequest","seq","logTrace","nodeRequestCancellerFactory","RequestQueueingType","RequestQueue","queueingType","Normal","LowPriority","dequeue","tryDeletePendingRequest","createRequest","CallbackMap","_asyncCallbacks","cause","isAsync","fetch","ExecutionTarget","SingleTsServer","_serverSource","_process","_tsServerLogFile","_requestCanceller","_requestQueue","_pendingResponses","_eventHandlers","_exitHandlers","_errorHandlers","_stdErrHandlers","dispatchMessage","onStdErr","onEvent","tsServerLogFile","serverRequest","dispatchResponse","request_seq","traceRequestCompleted","traceEvent","sendNextRequests","tryCancelRequest","fetchCallback","traceResponse","executeImpl","executeInfo","requestInfo","expectsResponse","expectsResult","getQueueingType","lowPriority","queuingStartTime","requestItem","traceRequest","fenceCommands","Fence","RequestRouter","servers","delegate","execute","sharedCommands","executionTarget","requestStates","RequestState","Unresolved","Resolved","allRequests","serverIndex","erroredRequest","onFatalError","Errored","canRun","UpdateOpen","Configure","SyntaxRoutingTsServer","enableDynamicRouting","_projectLoading","syntaxServer","syntax","semanticServer","semantic","router","execInfo","Syntax","syntaxAlwaysCommands","semanticCommands","projectLoading","syntaxAllowedCommands","_handler","NavTree","GetOutliningSpans","JsxClosingTag","Format","Formatonkey","DocCommentTemplate","ProjectInfo","ConfigurePlugin","CompletionDetails","CompletionInfo","Definition","DefinitionAndBoundSpan","DocumentHighlights","Implementation","Navto","Quickinfo","References","SignatureHelp","NodeTsServerProcessFactory","tsServerPath","useIpc","runtimeArgs","ChildProcess","silent","generatePatchedEnv","getExecArgv","IpcChildServerProcess","StdioChildServerProcess","modulePath","NODE_PATH","PATH","getDebugPort","inspectFlag","getTssDebugBrk","maxTsServerMemory","getTssDebug","TSS_DEBUG","TSS_DEBUG_BRK","_reader","Reader","ProtocolBuffer","_onError","_onData","onLengthData","tryReadContentLength","tryReadContent","defaultSize","contentLengthSize","blank","backslashR","backslashN","sourceStart","TsServerLogLevel","Terse","RequestTime","toSyntaxServerConfiguration","TypeScriptServerSpawner","_apiVersion","_logDirectoryProvider","pluginManager","primaryServer","serverType","getCompositeServerType","spawnTsServer","useSyntaxServer","processFactory","canceller","getTsServerArgs","isLoggingEnabled","tsProcess","kindToServerType","tsServerTraceDirectory","disableAutomaticTypingAcquisition","locale","npmLocation","logDir","getNewLogDirectory","logVerbosity","pluginPaths","Tracer","responseExpected","queueLength","meta","ZipfileURI","components","_originalUri","_skipEncoding","_strict","ServerState","Running","tsserverVersion","languageServiceEnabled","toCancelOnResourceChange","updateTsserverVersion","updateLanguageServiceEnabled","enabled","getDignosticsKind","ServerInitializingIndicator","_task","reporter","startedLoadingProject","projectName","_loadingProjectName","createProgressReporter","finishedLoadingProject","emptyAuthority","inMemoryResourcePrefix","RE_IN_MEMORY_FILEPATH","TsClient","typescriptVersionSource","serverState","isNeovimHost","tsserverLogger","loadingIndicator","lastFileOrDummy","stringUri","fileSchemes.disabledSchemes","fileSchemes.file","textDocumentUri","suppressAlertOnFailure","toResource","parts","tsFilepath","fileUri","toResourceUri","EnhancedSyntax","fileSchemes.getSemanticSupportedSchemes","configurePlugin","pluginName","typescriptVersion","hostInfo","languageModeIds.jsTsLanguageModes","flatMap","tsServerSpawner","logDirectoryProvider","tsServer","fatalError","shutdown","serviceExited","dispatchEvent","openFiles","executions","cancelOnResourceChange","runningServerState","inFlight","nonRecoverable","logfile","pDebounce","wait","leadingValue","resolveList","arguments_","shouldCallNow","before","function_","currentPromise","fromTextSpan","span","fromLocations","toTextSpan","toLocation","LspRange","toFileRangeRequestArgs","toFormattingRequestArgs","intersection","Max","Min","isAfter","union","fromLocation","tslocation","toFileLocationRequestArgs","positions","isBefore","isEqual","isBeforeOrEqual","tsTextSpan","LspLocation","fileSpan","symbolKindsMapping","lsp.SymbolKind","class","const","enum","field","function","getter","interface","let","parameter","property","setter","var","toSymbolKind","tspKind","toDiagnosticSeverity","category","lsp.DiagnosticSeverity","toDiagnostic","features","lspDiagnostic","asRelatedInformation","diagnosticsTagSupport","getDiagnosticTags","reportsUnnecessary","lsp.DiagnosticTag","reportsDeprecated","lsp.DiagnosticRelatedInformation","toSelectionRange","lsp.SelectionRange","textSpan","toTextEdit","toTextDocumentEdit","fileName","textChanges","toDocumentHighlight","highlightSpans","toDocumentHighlightKind","definition","lsp.DocumentHighlightKind","reference","writtenReference","FileDiagnostics","onPublishDiagnostics","diagnosticsPerKind","firePublishDiagnostics","debounce","publishDiagnostics","diagnosticsSupport","getDiagnostics","waitForDiagnosticsForTesting","interval","DiagnosticEventQueue","ignoredDiagnosticCodes","updateDiagnostics","isDiagnosticIgnored","diagnosticsForFile","updateIgnoredDiagnosticCodes","ignoredCodes","getDiagnosticsForFile","onDidCloseFile","SourceDefinitionCommand","withProgress","FindSourceDefinition","Commands","APPLY_WORKSPACE_EDIT","APPLY_CODE_ACTION","APPLY_REFACTORING","CONFIGURE_PLUGIN","ORGANIZE_IMPORTS","APPLY_RENAME_FILE","APPLY_COMPLETION_CODE_ACTION","SELECT_REFACTORING","SOURCE_DEFINITION","TypescriptVersionNotification","lsp.NotificationType","MarkdownString","appendText","newlineStyle","escapeMarkdownSyntaxTokens","_match","g1","appendMarkdown","appendCodeblock","langId","toMarkupContent","replaceLinks","tag","processInlineTags","getTagBodyText","filePathConverter","makeCodeblock","convertLinkTags","captionTagMatches","emailMatch","getTagDocumentation","plainWithLinks","out","currentLink","part","escapeMarkdownSyntaxTokensForCode","linkcode","tagsMarkdownPreview","markdownDocumentation","addMarkdownDocumentation","converter","tagsPreview","SnippetString","isSnippetString","thing","_escape","_tabstop","appendTabstop","appendPlaceholder","nested","appendVariable","CompletionDataCache","lastCacheId","cacheId","asCompletionItems","completionDataCache","completionContext","completions","completion","asCompletionItem","entryNames","asCompletionItemKind","sortText","preselect","isRecommended","completionCommitCharactersSupport","commitCharacters","asCommitCharacters","completionLabelDetails","labelDetails","hasAction","isSnippet","replacementSpan","sourceDisplay","completionSnippets","canCreateSnippetOfFunctionCall","insertTextFormat","lsp.InsertTextFormat","Previewer.plainWithLinks","optionalReplacementRange","isMemberCompletion","dotAccessorContext","getRangeFromReplacementSpan","completionDisableFilterText","getFilterText","newInsertText","completionInsertReplaceSupport","kindModifiers","lsp.CompletionItemTag","scriptElement","extModifier","endsWith","lsp.InsertReplaceEdit","lsp.TextEdit","ensureRangeIsOnSingleLine","wordRange","wordStart","primitiveType","lsp.CompletionItemKind","constElement","letElement","variableElement","localVariableElement","parameterElement","memberVariableElement","memberGetAccessorElement","memberSetAccessorElement","functionElement","localFunctionElement","memberFunctionElement","constructSignatureElement","callSignatureElement","indexSignatureElement","enumElement","enumMemberElement","moduleElement","externalModuleName","classElement","typeElement","interfaceElement","warning","asResolvedCompletionItem","details","asDetail","Previewer.markdownDocumentation","codeActions","getCodeActions","shouldCompleteFunction","isValidFunctionCompletionContext","createSnippetOfFunctionCall","after","completeFunctionCalls","displayParts","parameterListParts","getParameterListParts","snippet","appendJoinedPlaceholders","hasOptionalParameters","isInMethod","parenCount","braceCount","outer","nameIsFollowedByOptionalIndicator","nameIsThis","joiner","paramterPart","hasRemainingCommandsOrEdits","tsAction","tsFileName","codeAction","deprecatedSource","getCompletionTriggerCharacter","asSignatureHelp","signatures","asSignatureInformation","activeSignature","getActiveSignature","activeParameter","getActiveParameter","activeSignatureHelp","previouslyActiveSignature","isRetrigger","existingIndex","findIndex","selectedItemIndex","isVariadic","argumentIndex","asParameterInformation","signature","prefixDisplayParts","separatorDisplayParts","suffixDisplayParts","toTsTriggerReason","lsp.SignatureHelpTriggerKind","triggerCharacter","provideQuickFix","fix","lsp.CodeAction","lsp.CodeActionKind","provideRefactors","inlineable","asSelectRefactoring","relevantActions","codeActionDisabledSupport","notApplicableReason","asApplyRefactoring","lsp.Command","asKind","disabled","refactor","contains","SourceAddMissingImportsTs","SourceFixAllTs","SourceOrganizeImportsTs","SourceRemoveUnusedImportsTs","SourceRemoveUnusedTs","SourceSortImportsTs","organizeImportsCommand","All","sortImportsCommand","SortAndCombine","removeUnusedImportsCommand","RemoveUnused","organizeImportsCommands","provideOrganizeImports","collectDocumentSymbols","symbols","collectDocumentSymbolsInRange","shouldInclude","shouldIncludeEntry","spanRange","childItems","childSpan","includedChild","nameSpan","nameRange","collectSymbolInformation","fromProtocolCallHierarchyItem","useFileName","isSourceFileItem","fromProtocolScriptElementKind","selectionSpan","parseKindModifier","deprecatedModifier","lsp.SymbolTag","fromProtocolCallHierarchyIncomingCall","fromRanges","fromSpans","fromProtocolCallHierarchyOutgoingCall","constructorImplementationElement","typeParameterElement","isMergeableObject","isNonNullObject","isSpecial","stringValue","isReactElement","canUseSymbol","REACT_ELEMENT_TYPE","$$typeof","emptyTarget","cloneUnlessOtherwiseSpecified","deepmerge","defaultArrayMerge","getMergeFunction","customMerge","getEnumerableOwnPropertySymbols","getOwnPropertySymbols","symbol","propertyIsEnumerable","getKeys","propertyIsOnObject","object","propertyIsUnsafe","mergeObject","destination","arrayMerge","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","deepmergeAll","deepmerge_1","cjs","array.equals","getInferredProjectCompilerOptions","workspaceConfig","projectConfig","ESNext","moduleResolution","ES2022","jsx","React","allowImportingTsExtensions","checkJs","allowJs","experimentalDecorators","strictNullChecks","strictFunctionTypes","sourceMap","DEFAULT_TSSERVER_PREFERENCES","allowIncompleteCompletions","allowRenameOfImportPath","allowTextChangesInNewFiles","autoImportFileExcludePatterns","disableLineTextInReferences","disableSuggestions","displayPartsForJSDoc","excludeLibrarySymbolsInNavTo","generateReturnInDocTemplate","importModuleSpecifierEnding","importModuleSpecifierPreference","includeAutomaticOptionalChainCompletions","includeCompletionsForImportStatements","includeCompletionsForModuleExports","includeCompletionsWithClassMemberSnippets","includeCompletionsWithInsertText","includeCompletionsWithObjectLiteralMethodSnippets","includeCompletionsWithSnippetText","includeInlayEnumMemberValueHints","includeInlayFunctionLikeReturnTypeHints","includeInlayFunctionParameterTypeHints","includeInlayParameterNameHints","includeInlayParameterNameHintsWhenArgumentMatchesName","includeInlayPropertyDeclarationTypeHints","includeInlayVariableTypeHints","includeInlayVariableTypeHintsWhenTypeMatchesName","includePackageJsonAutoImports","interactiveInlayHints","jsxAttributeCompletionStyle","lazyConfiguredProjectsFromExternalProject","organizeImportsAccentCollation","organizeImportsCaseFirst","organizeImportsCollation","organizeImportsCollationLocale","organizeImportsIgnoreCase","organizeImportsNumericCollation","providePrefixAndSuffixTextForRename","provideRefactorNotApplicableReason","quotePreference","useLabelDetailsInCompletionEntries","DEFAULT_IMPLICIT_PROJECT_CONFIGURATION","ES2020","DEFAULT_WORKSPACE_CONFIGURATION","implicitProjectConfiguration","areFileConfigurationsEqual","FileConfigurationManager","tsPreferences","workspaceConfiguration","formatOptions","documentUri","mergeTsPreferences","preferences","setWorkspaceConfiguration","setCompilerOptionsForInferredProjects","setGlobalConfiguration","newLineCharacter","getAutoImportFileExcludePatternsPreference","CompilerOptionsForInferredProjects","allowNonTsExtensions","allowSyntheticDefaultImports","resolveJsonModule","ensureConfigurationForDocument","ensureConfigurationOptions","currentOptions","getFileOptions","cachedOptions","cachedOptionsValue","setGlobalConfigurationFromDocument","getFormatOptions","getPreferences","formattingOptions","workspacePreferences","getWorkspacePreferencesForFile","convertTabsToSpaces","indentSize","inlayHints","getQuoteStylePreference","slashNormalized","isRelative","variableDeclaredButNeverUsed","unreachableCode","incorrectlyImplementsInterface","cannotFindName","asyncOnlyAllowedInAsyncFunctions","awaitInSyncFunction","classIncorrectlyImplementsInterface","unusedIdentifier","fixImport","buildIndividualFixes","fixes","codes","fixName","errorCodes","GetCodeFixes","buildCombinedFix","fixId","combinedArgs","scope","combinedResponse","GetCombinedCodeFix","SourceAction","errorCodes.incorrectlyImplementsInterface","fixNames.classIncorrectlyImplementsInterface","errorCodes.asyncOnlyAllowedInAsyncFunctions","fixNames.awaitInSyncFunction","errorCodes.unreachableCode","fixNames.unreachableCode","SourceRemoveUnused","errorCodes.variableDeclaredButNeverUsed","fixNames.unusedIdentifier","SourceAddMissingImports","errorCodes.cannotFindName","fixNames.fixImport","TypeScriptAutoFixProvider","kinds","kindProviders","provider","provideCodeActions","escapeRegExp","CodeLensType","TypeScriptBaseCodeLensProvider","cachedResponse","fileConfigurationManager","provideCodeLenses","implementationsCodeLens","referencesCodeLens","referenceableSpans","walkNavTree","extractSymbol","cancelledCommand","errorCommand","getSymbolRange","identifierMatch","prefixLength","TypeScriptImplementationsCodeLensProvider","resolveCodeLens","codeLens","typeConverters.Position","locations","typeConverters.Range","getCommand","getTitle","_parent","TypeScriptReferencesCodeLensProvider","refs","isDefinition","typeConverters.Location","getCodeLensLabel","showOnAllFunctions","TypeScriptInlayHintsProvider","provideInlayHints","areInlayHintsEnabledForFile","ProvideInlayHints","hint","lsp.InlayHint","convertInlayHintText","fromProtocolInlayHintKind","whitespaceBefore","whitespaceAfter","tsHint","lsp.InlayHintLabelPart","lsp.InlayHintKind","TokenEncodingConsts","transformSpans","lspSpans","previousLine","previousTokenStart","tokenStart","tokenLength","tokenTypeBitSet","tokenModifier","modifierMask","typeOffset","deltaLine","deltaStart","CachedResponse","matches","onDocumentClose","LogDirectoryProvider","rootPath","logDirectory","mkdtempSync","sync","isexe","fs_1","promises_1","ignoreErrors","checkStat","checkMode","myUid","myGroups","groups","getgroups","myGid","getgid","mod","ug","checkPathExt","pathExt","PATHEXT","peSplit","__setModuleDefault","__importStar","_ISEXE_TEST_PLATFORM_","impl","isexeSync","rSlash","rRel","getNotFoundError","getPathInfo","optPath","optPathExt","optDelimiter","pathEnv","pathExtExe","getPathPart","pathPart","which","opt","found","envPart","withExt","nothrow","whichSync","pathEnvPart","typeMappings","checkType","matchType","toPath","urlOrPath","URL","fileURLToPath","locatePathSync","paths","allowSymlinks","statFunction","path_","throwIfNoEntry","findUpStop","findUpMultipleSync","stopAt","POSITIVE_INFINITY","flat","runMatcher","locateOptions","foundPath","findUpSync","pkgUpSync","findPathToModule","moduleNames","TypeScriptVersion","_api","isValid","getTypeScriptVersion","serverPath","p2","MODULE_FOLDERS","TypeScriptVersionProvider","userTsserverPath","getUserSettingVersion","resolvedPath","binaryPath","packageJsonPath","getWorkspaceVersion","libFolder","bundledVersion","createRequire","LspServer","initializeParams","typeScriptAutoFixProvider","cachedNavTreeResponse","implementationsCodeLensProvider","referencesCodeLensProvider","tsClient","diagnosticQueue","closeAllForTesting","closeDocument","waitForDiagnosticsForFile","clientCapabilities","rootUri","userInitializationOptions","initializationOptions","tsserver","findTypescriptVersion","fallbackPath","disabledSupport","completionItem","commitCharactersSupport","insertReplaceSupport","labelDetailsSupport","snippetSupport","definitionLinkSupport","linkSupport","tagSupport","tsserverLogVerbosity","started","getLogDirectoryPath","onTsEvent","registerHandlers","prepareSupport","initializeResult","lsp.TextDocumentSyncKind","completionProvider","triggerCharacters","resolveProvider","codeActionProvider","codeActionLiteralSupport","codeActionKinds","codeLensProvider","definitionProvider","documentFormattingProvider","documentRangeFormattingProvider","documentHighlightProvider","documentSymbolProvider","executeCommandProvider","hoverProvider","inlayHintProvider","linkedEditingRangeProvider","renameProvider","prepareProvider","referencesProvider","selectionRangeProvider","signatureHelpProvider","retriggerCharacters","workspaceSymbolProvider","implementationProvider","typeDefinitionProvider","foldingRangeProvider","semanticTokensProvider","legend","tokenTypes","full","willRename","filters","glob","callHierarchyProvider","initialized","fallbackTsserverPath","typescriptVersionProvider","userSettingVersion","workspaceVersion","fallbackVersionProvider","fallbackSettingVersion","didChangeConfiguration","settings","didOpenTextDocument","didCloseTextDocument","didChangeTextDocument","didSaveTextDocument","_params","getDefinition","implementation","getSymbolLocations","typeDefinition","TypeDefinition","definitions","contextStart","contextEnd","documentSymbol","supportHierarchicalDocumentSymbol","hierarchicalDocumentSymbolSupport","lsp.CompletionList","completionOptions","optionalReplacementSpan","dotMatch","startPosition","completionResolve","hover","displayString","Previewer.addMarkdownDocumentation","prepareRename","renameInfo","canRename","localizedErrorMessage","triggerSpan","locs","spanGroup","prefixText","newName","suffixText","references","includeDeclaration","documentFormatting","documentRangeFormatting","selectionRanges","signatureHelp","triggerReason","fileRangeArgs","getCodeFixes","getRefactors","skipDestructiveCodeActions","isOrganizeImports","documentHasErrors","OrganizeImports","lsp.CodeActionTriggerKind","GetApplicableRefactors","executeCommand","applyWorkspaceEdit","applyFileCodeEdits","ApplyCodeActionCommand","GetEditsForRefactor","renameLocation","additionalArguments","sourceUri","applyRenameFile","applied","willRenameFiles","codeEdits","getEditsForFileRename","codeEdit","newFilePath","oldFilePath","GetEditsForFileRename","codeLensResolve","documentHighlight","filesToSearch","workspaceSymbol","searchValue","foldingRanges","asFoldingRange","asFoldingRangeKind","lsp.FoldingRangeKind","diagnosticEvent","prepareCallHierarchy","PrepareCallHierarchy","callHierarchyIncomingCalls","ProvideCallHierarchyIncomingCalls","callHierarchyOutgoingCalls","ProvideCallHierarchyOutgoingCalls","LinkedEditingRange","wordPattern","semanticTokensFull","getSemanticTokens","semanticTokensRange","EncodedSemanticClassificationsFull","SemanticTokens.transformSpans","nullProgressReporter","LspClientImpl","lsp.ShowMessageNotification","lsp.LogMessageNotification","createLspConnection","showMessageLevel","DEFAULT_LOG_LEVEL","logLevel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAIA,MAAMA,uBAAuBC;EAQ3B,WAAAC,CAAYC,UAAUC,MAAMC;IAC1BC,MAAMD;IAENJ,MAAMM,kBAAkBC,MAAMA,KAAKN;IACnCM,KAAKC,OAAOD,KAAKN,YAAYO;IAC7BD,KAAKJ,OAAOA;IACZI,KAAKL,WAAWA;IAChBK,KAAKE,cAAcC;AACpB;;;6BAOH,MAAMC,6BAA6BZ;EAMjC,WAAAE,CAAYG;IACVC,MAAM,GAAG,6BAA6BD;IAEtCJ,MAAMM,kBAAkBC,MAAMA,KAAKN;IACnCM,KAAKC,OAAOD,KAAKN,YAAYO;AAC9B;;;AAGmBI,QAAAb,iBAAGA;;AACzBa,QAAAD,uBAA+BA;;AC1C/B,OAAQA,sBAAAA,0BAAyBE;;AAEjC,IA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BnS,OAAO,0BAA0B,gGACjC6T,MAAMtJ,QAAQ+I;;AAEnB,MAAMjT,UAAU2c,QAAQnP;;AAExB,IAAIyvH,WAAWD;;AACf,IAAIh9H,QAAQi9H,UAAU;EAClBA,WAAWxgH,SAASzc,QAAQi9H,UAAU;EACtC,IAAIA,aAAaA,WAAW,KAAKA,WAAW,IAAI;IAC5Ch3G,QAAQ1pB,MAAM,wBAAwB0gI;IACtCA,WAAWD;AACd;AACL;;AAEAF,oBAAoB;EAChBC,kBAAkBE;GACnB1yG","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,175,176,177,178,189,206,221,222,223,224,225,226,227,228]} \ No newline at end of file diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/LICENSE.txt b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/LICENSE.txt new file mode 100644 index 00000000..8746124b --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/LICENSE.txt @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/README.md b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/README.md new file mode 100644 index 00000000..3314c58f --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/README.md @@ -0,0 +1,50 @@ + +# TypeScript + +[![GitHub Actions CI](https://github.com/microsoft/TypeScript/workflows/CI/badge.svg)](https://github.com/microsoft/TypeScript/actions?query=workflow%3ACI) +[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript) +[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/microsoft/TypeScript/badge)](https://securityscorecards.dev/viewer/?uri=github.com/microsoft/TypeScript) + + +[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescript). + +Find others who are using TypeScript at [our community page](https://www.typescriptlang.org/community/). + +## Installing + +For the latest stable version: + +```bash +npm install -D typescript +``` + +For our nightly builds: + +```bash +npm install -D typescript@next +``` + +## Contribute + +There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md) to TypeScript. +* [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in. +* Review the [source code changes](https://github.com/microsoft/TypeScript/pulls). +* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript). +* Help each other in the [TypeScript Community Discord](https://discord.gg/typescript). +* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter. +* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md). + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see +the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) +with any additional questions or comments. + +## Documentation + +* [TypeScript in 5 minutes](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html) +* [Programming handbook](https://www.typescriptlang.org/docs/handbook/intro.html) +* [Homepage](https://www.typescriptlang.org/) + +## Roadmap + +For details on our planned features and future direction, please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap). diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/SECURITY.md b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/SECURITY.md new file mode 100644 index 00000000..b3c89efc --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). + + diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/ThirdPartyNoticeText.txt b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/ThirdPartyNoticeText.txt new file mode 100644 index 00000000..a857fb3c --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/ThirdPartyNoticeText.txt @@ -0,0 +1,193 @@ +/*!----------------- TypeScript ThirdPartyNotices ------------------------------------------------------- + +The TypeScript software incorporates third party material from the projects listed below. The original copyright notice and the license under which Microsoft received such third party material are set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. + +--------------------------------------------- +Third Party Code Components +-------------------------------------------- + +------------------- DefinitelyTyped -------------------- +This file is based on or incorporates material from the projects listed below (collectively "Third Party Code"). Microsoft is not the original author of the Third Party Code. The original copyright notice and the license, under which Microsoft received such Third Party Code, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft, not the third party, licenses the Third Party Code to you under the terms set forth in the EULA for the Microsoft Product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. +DefinitelyTyped +This project is licensed under the MIT license. Copyrights are respective of each contributor listed at the beginning of each definition file. Provided for Informational Purposes Only + +MIT License +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------------- + +------------------- Unicode -------------------- +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +Unicode Data Files do not include PDF online code charts under the +directory http://www.unicode.org/Public/. + +Software includes any source code published in the Unicode Standard +or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. +------------------------------------------------------------------------------------- + +-------------------Document Object Model----------------------------- +DOM + +W3C License +This work is being provided by the copyright holders under the following license. +By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. +Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following +on ALL copies of the work or portions thereof, including modifications: +* The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. +* Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. +* Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived +from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." +Disclaimers +THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR +FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. +The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. +Title to copyright in this work will at all times remain with copyright holders. + +--------- + +DOM +Copyright © 2018 WHATWG (Apple, Google, Mozilla, Microsoft). This work is licensed under a Creative Commons Attribution 4.0 International License: Attribution 4.0 International +======================================================================= +Creative Commons Corporation ("Creative Commons") is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an "as-is" basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. Using Creative Commons Public Licenses Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC- licensed material, or material used under an exception or limitation to copyright. More considerations for licensors: + +wiki.creativecommons.org/Considerations_for_licensors Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor's permission is not necessary for any reason--for example, because of any applicable exception or limitation to copyright--then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More_considerations for the public: wiki.creativecommons.org/Considerations_for_licensees ======================================================================= +Creative Commons Attribution 4.0 International Public License By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. Section 1 -- Definitions. a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. Section 2 -- Scope. a. License grant. 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: a. reproduce and Share the Licensed Material, in whole or in part; and b. produce, reproduce, and Share Adapted Material. 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 3. Term. The term of this Public License is specified in Section 6(a). 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a) (4) never produces Adapted Material. 5. Downstream recipients. a. Offer from the Licensor -- Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. b. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). b. Other rights. 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 2. Patent and trademark rights are not licensed under this Public License. 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. Section 3 -- License Conditions. Your exercise of the Licensed Rights is expressly made subject to the following conditions. a. Attribution. 1. If You Share the Licensed Material (including in modified form), You must: a. retain the following if it is supplied by the Licensor with the Licensed Material: i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); ii. a copyright notice; iii. a notice that refers to this Public License; iv. a notice that refers to the disclaimer of warranties; v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; b. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and c. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. Section 4 -- Sui Generis Database Rights. Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. Section 5 -- Disclaimer of Warranties and Limitation of Liability. a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. Section 6 -- Term and Termination. a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 2. upon express reinstatement by the Licensor. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. Section 7 -- Other Terms and Conditions. a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. Section 8 -- Interpretation. a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. ======================================================================= Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the "Licensor." Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark "Creative Commons" or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. Creative Commons may be contacted at creativecommons.org. + +-------------------------------------------------------------------------------- + +----------------------Web Background Synchronization------------------------------ + +Web Background Synchronization Specification +Portions of spec © by W3C + +W3C Community Final Specification Agreement +To secure commitments from participants for the full text of a Community or Business Group Report, the group may call for voluntary commitments to the following terms; a "summary" is +available. See also the related "W3C Community Contributor License Agreement". +1. The Purpose of this Agreement. +This Agreement sets forth the terms under which I make certain copyright and patent rights available to you for your implementation of the Specification. +Any other capitalized terms not specifically defined herein have the same meaning as those terms have in the "W3C Patent Policy", and if not defined there, in the "W3C Process Document". +2. Copyrights. +2.1. Copyright Grant. I grant to you a perpetual (for the duration of the applicable copyright), worldwide, non-exclusive, no-charge, royalty-free, copyright license, without any obligation for accounting to me, to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, distribute, and implement the Specification to the full extent of my copyright interest in the Specification. +2.2. Attribution. As a condition of the copyright grant, you must include an attribution to the Specification in any derivative work you make based on the Specification. That attribution must include, at minimum, the Specification name and version number. +3. Patents. +3.1. Patent Licensing Commitment. I agree to license my Essential Claims under the W3C Community RF Licensing Requirements. This requirement includes Essential Claims that I own and any that I have the right to license without obligation of payment or other consideration to an unrelated third party. W3C Community RF Licensing Requirements obligations made concerning the Specification and described in this policy are binding on me for the life of the patents in question and encumber the patents containing Essential Claims, regardless of changes in participation status or W3C Membership. I also agree to license my Essential Claims under the W3C Community RF Licensing Requirements in derivative works of the Specification so long as all normative portions of the Specification are maintained and that this licensing commitment does not extend to any portion of the derivative work that was not included in the Specification. +3.2. Optional, Additional Patent Grant. In addition to the provisions of Section 3.1, I may also, at my option, make certain intellectual property rights infringed by implementations of the Specification, including Essential Claims, available by providing those terms via the W3C Web site. +4. No Other Rights. Except as specifically set forth in this Agreement, no other express or implied patent, trademark, copyright, or other property rights are granted under this Agreement, including by implication, waiver, or estoppel. +5. Antitrust Compliance. I acknowledge that I may compete with other participants, that I am under no obligation to implement the Specification, that each participant is free to develop competing technologies and standards, and that each party is free to license its patent rights to third parties, including for the purpose of enabling competing technologies and standards. +6. Non-Circumvention. I agree that I will not intentionally take or willfully assist any third party to take any action for the purpose of circumventing my obligations under this Agreement. +7. Transition to W3C Recommendation Track. The Specification developed by the Project may transition to the W3C Recommendation Track. The W3C Team is responsible for notifying me that a Corresponding Working Group has been chartered. I have no obligation to join the Corresponding Working Group. If the Specification developed by the Project transitions to the W3C Recommendation Track, the following terms apply: +7.1. If I join the Corresponding Working Group. If I join the Corresponding Working Group, I will be subject to all W3C rules, obligations, licensing commitments, and policies that govern that Corresponding Working Group. +7.2. If I Do Not Join the Corresponding Working Group. +7.2.1. Licensing Obligations to Resulting Specification. If I do not join the Corresponding Working Group, I agree to offer patent licenses according to the W3C Royalty-Free licensing requirements described in Section 5 of the W3C Patent Policy for the portions of the Specification included in the resulting Recommendation. This licensing commitment does not extend to any portion of an implementation of the Recommendation that was not included in the Specification. This licensing commitment may not be revoked but may be modified through the exclusion process defined in Section 4 of the W3C Patent Policy. I am not required to join the Corresponding Working Group to exclude patents from the W3C Royalty-Free licensing commitment, but must otherwise follow the normal exclusion procedures defined by the W3C Patent Policy. The W3C Team will notify me of any Call for Exclusion in the Corresponding Working Group as set forth in Section 4.5 of the W3C Patent Policy. +7.2.2. No Disclosure Obligation. If I do not join the Corresponding Working Group, I have no patent disclosure obligations outside of those set forth in Section 6 of the W3C Patent Policy. +8. Conflict of Interest. I will disclose significant relationships when those relationships might reasonably be perceived as creating a conflict of interest with my role. I will notify W3C of any change in my affiliation using W3C-provided mechanisms. +9. Representations, Warranties and Disclaimers. I represent and warrant that I am legally entitled to grant the rights and promises set forth in this Agreement. IN ALL OTHER RESPECTS THE SPECIFICATION IS PROVIDED “AS IS.” The entire risk as to implementing or otherwise using the Specification is assumed by the implementer and user. Except as stated herein, I expressly disclaim any warranties (express, implied, or otherwise), including implied warranties of merchantability, non-infringement, fitness for a particular purpose, or title, related to the Specification. IN NO EVENT WILL ANY PARTY BE LIABLE TO ANY OTHER PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF ACTION OF ANY KIND WITH RESPECT TO THIS AGREEMENT, WHETHER BASED ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND WHETHER OR NOT THE OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. All of my obligations under Section 3 regarding the transfer, successors in interest, or assignment of Granted Claims will be satisfied if I notify the transferee or assignee of any patent that I know contains Granted Claims of the obligations under Section 3. Nothing in this Agreement requires me to undertake a patent search. +10. Definitions. +10.1. Agreement. “Agreement” means this W3C Community Final Specification Agreement. +10.2. Corresponding Working Group. “Corresponding Working Group” is a W3C Working Group that is chartered to develop a Recommendation, as defined in the W3C Process Document, that takes the Specification as an input. +10.3. Essential Claims. “Essential Claims” shall mean all claims in any patent or patent application in any jurisdiction in the world that would necessarily be infringed by implementation of the Specification. A claim is necessarily infringed hereunder only when it is not possible to avoid infringing it because there is no non-infringing alternative for implementing the normative portions of the Specification. Existence of a non-infringing alternative shall be judged based on the state of the art at the time of the publication of the Specification. The following are expressly excluded from and shall not be deemed to constitute Essential Claims: +10.3.1. any claims other than as set forth above even if contained in the same patent as Essential Claims; and +10.3.2. claims which would be infringed only by: +portions of an implementation that are not specified in the normative portions of the Specification, or +enabling technologies that may be necessary to make or use any product or portion thereof that complies with the Specification and are not themselves expressly set forth in the Specification (e.g., semiconductor manufacturing technology, compiler technology, object-oriented technology, basic operating system technology, and the like); or +the implementation of technology developed elsewhere and merely incorporated by reference in the body of the Specification. +10.3.3. design patents and design registrations. +For purposes of this definition, the normative portions of the Specification shall be deemed to include only architectural and interoperability requirements. Optional features in the RFC 2119 sense are considered normative unless they are specifically identified as informative. Implementation examples or any other material that merely illustrate the requirements of the Specification are informative, rather than normative. +10.4. I, Me, or My. “I,” “me,” or “my” refers to the signatory. +10.5 Project. “Project” means the W3C Community Group or Business Group for which I executed this Agreement. +10.6. Specification. “Specification” means the Specification identified by the Project as the target of this agreement in a call for Final Specification Commitments. W3C shall provide the authoritative mechanisms for the identification of this Specification. +10.7. W3C Community RF Licensing Requirements. “W3C Community RF Licensing Requirements” license shall mean a non-assignable, non-sublicensable license to make, have made, use, sell, have sold, offer to sell, import, and distribute and dispose of implementations of the Specification that: +10.7.1. shall be available to all, worldwide, whether or not they are W3C Members; +10.7.2. shall extend to all Essential Claims owned or controlled by me; +10.7.3. may be limited to implementations of the Specification, and to what is required by the Specification; +10.7.4. may be conditioned on a grant of a reciprocal RF license (as defined in this policy) to all Essential Claims owned or controlled by the licensee. A reciprocal license may be required to be available to all, and a reciprocal license may itself be conditioned on a further reciprocal license from all. +10.7.5. may not be conditioned on payment of royalties, fees or other consideration; +10.7.6. may be suspended with respect to any licensee when licensor issued by licensee for infringement of claims essential to implement the Specification or any W3C Recommendation; +10.7.7. may not impose any further conditions or restrictions on the use of any technology, intellectual property rights, or other restrictions on behavior of the licensee, but may include reasonable, customary terms relating to operation or maintenance of the license relationship such as the following: choice of law and dispute resolution; +10.7.8. shall not be considered accepted by an implementer who manifests an intent not to accept the terms of the W3C Community RF Licensing Requirements license as offered by the licensor. +10.7.9. The RF license conforming to the requirements in this policy shall be made available by the licensor as long as the Specification is in effect. The term of such license shall be for the life of the patents in question. +I am encouraged to provide a contact from which licensing information can be obtained and other relevant licensing information. Any such information will be made publicly available. +10.8. You or Your. “You,” “you,” or “your” means any person or entity who exercises copyright or patent rights granted under this Agreement, and any person that person or entity controls. + +------------------------------------------------------------------------------------- + +------------------- WebGL ----------------------------- +Copyright (c) 2018 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +------------------------------------------------------ + +------------- End of ThirdPartyNotices ------------------------------------------- */ + diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/bin/tsc b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/bin/tsc new file mode 100755 index 00000000..19c62bf7 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/bin/tsc @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../lib/tsc.js') diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/bin/tsserver b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/bin/tsserver new file mode 100755 index 00000000..7143b6a7 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/bin/tsserver @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../lib/tsserver.js') diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/cancellationToken.js b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/cancellationToken.js new file mode 100644 index 00000000..cf2c258e --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/cancellationToken.js @@ -0,0 +1,90 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// src/cancellationToken/cancellationToken.ts +var fs = __toESM(require("fs")); +function pipeExists(name) { + return fs.existsSync(name); +} +function createCancellationToken(args) { + let cancellationPipeName; + for (let i = 0; i < args.length - 1; i++) { + if (args[i] === "--cancellationPipeName") { + cancellationPipeName = args[i + 1]; + break; + } + } + if (!cancellationPipeName) { + return { + isCancellationRequested: () => false, + setRequest: (_requestId) => void 0, + resetRequest: (_requestId) => void 0 + }; + } + if (cancellationPipeName.charAt(cancellationPipeName.length - 1) === "*") { + const namePrefix = cancellationPipeName.slice(0, -1); + if (namePrefix.length === 0 || namePrefix.includes("*")) { + throw new Error("Invalid name for template cancellation pipe: it should have length greater than 2 characters and contain only one '*'."); + } + let perRequestPipeName; + let currentRequestId; + return { + isCancellationRequested: () => perRequestPipeName !== void 0 && pipeExists(perRequestPipeName), + setRequest(requestId) { + currentRequestId = requestId; + perRequestPipeName = namePrefix + requestId; + }, + resetRequest(requestId) { + if (currentRequestId !== requestId) { + throw new Error(`Mismatched request id, expected ${currentRequestId}, actual ${requestId}`); + } + perRequestPipeName = void 0; + } + }; + } else { + return { + isCancellationRequested: () => pipeExists(cancellationPipeName), + setRequest: (_requestId) => void 0, + resetRequest: (_requestId) => void 0 + }; + } +} +module.exports = createCancellationToken; +//# sourceMappingURL=cancellationToken.js.map diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.d.ts b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.d.ts new file mode 100644 index 00000000..b6bb44b2 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.d.ts @@ -0,0 +1,22 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/// + +/// +/// +/// +/// diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.decorators.d.ts b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.decorators.d.ts new file mode 100644 index 00000000..5ac09b82 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.decorators.d.ts @@ -0,0 +1,386 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/// + +/** + * The decorator context types provided to class element decorators. + */ +type ClassMemberDecoratorContext = + | ClassMethodDecoratorContext + | ClassGetterDecoratorContext + | ClassSetterDecoratorContext + | ClassFieldDecoratorContext + | ClassAccessorDecoratorContext; + +/** + * The decorator context types provided to any decorator. + */ +type DecoratorContext = + | ClassDecoratorContext + | ClassMemberDecoratorContext; + +type DecoratorMetadataObject = Record & object; + +type DecoratorMetadata = typeof globalThis extends { Symbol: { readonly metadata: symbol; }; } ? DecoratorMetadataObject : DecoratorMetadataObject | undefined; + +/** + * Context provided to a class decorator. + * @template Class The type of the decorated class associated with this context. + */ +interface ClassDecoratorContext< + Class extends abstract new (...args: any) => any = abstract new (...args: any) => any, +> { + /** The kind of element that was decorated. */ + readonly kind: "class"; + + /** The name of the decorated class. */ + readonly name: string | undefined; + + /** + * Adds a callback to be invoked after the class definition has been finalized. + * + * @example + * ```ts + * function customElement(name: string): ClassDecoratorFunction { + * return (target, context) => { + * context.addInitializer(function () { + * customElements.define(name, this); + * }); + * } + * } + * + * @customElement("my-element") + * class MyElement {} + * ``` + */ + addInitializer(initializer: (this: Class) => void): void; + + readonly metadata: DecoratorMetadata; +} + +/** + * Context provided to a class method decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of the decorated class method. + */ +interface ClassMethodDecoratorContext< + This = unknown, + Value extends (this: This, ...args: any) => any = (this: This, ...args: any) => any, +> { + /** The kind of class element that was decorated. */ + readonly kind: "method"; + + /** The name of the decorated class element. */ + readonly name: string | symbol; + + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ + readonly static: boolean; + + /** A value indicating whether the class element has a private name. */ + readonly private: boolean; + + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + /** + * Gets the current value of the method from the provided object. + * + * @example + * let fn = context.access.get(instance); + */ + get(object: This): Value; + }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). + * + * @example + * ```ts + * const bound: ClassMethodDecoratorFunction = (value, context) { + * if (context.private) throw new TypeError("Not supported on private methods."); + * context.addInitializer(function () { + * this[context.name] = this[context.name].bind(this); + * }); + * } + * + * class C { + * message = "Hello"; + * + * @bound + * m() { + * console.log(this.message); + * } + * } + * ``` + */ + addInitializer(initializer: (this: This) => void): void; + + readonly metadata: DecoratorMetadata; +} + +/** + * Context provided to a class getter decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The property type of the decorated class getter. + */ +interface ClassGetterDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class element that was decorated. */ + readonly kind: "getter"; + + /** The name of the decorated class element. */ + readonly name: string | symbol; + + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ + readonly static: boolean; + + /** A value indicating whether the class element has a private name. */ + readonly private: boolean; + + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + /** + * Invokes the getter on the provided object. + * + * @example + * let value = context.access.get(instance); + */ + get(object: This): Value; + }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). + */ + addInitializer(initializer: (this: This) => void): void; + + readonly metadata: DecoratorMetadata; +} + +/** + * Context provided to a class setter decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of the decorated class setter. + */ +interface ClassSetterDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class element that was decorated. */ + readonly kind: "setter"; + + /** The name of the decorated class element. */ + readonly name: string | symbol; + + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ + readonly static: boolean; + + /** A value indicating whether the class element has a private name. */ + readonly private: boolean; + + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + /** + * Invokes the setter on the provided object. + * + * @example + * context.access.set(instance, value); + */ + set(object: This, value: Value): void; + }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). + */ + addInitializer(initializer: (this: This) => void): void; + + readonly metadata: DecoratorMetadata; +} + +/** + * Context provided to a class `accessor` field decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of decorated class field. + */ +interface ClassAccessorDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class element that was decorated. */ + readonly kind: "accessor"; + + /** The name of the decorated class element. */ + readonly name: string | symbol; + + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ + readonly static: boolean; + + /** A value indicating whether the class element has a private name. */ + readonly private: boolean; + + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + + /** + * Invokes the getter on the provided object. + * + * @example + * let value = context.access.get(instance); + */ + get(object: This): Value; + + /** + * Invokes the setter on the provided object. + * + * @example + * context.access.set(instance, value); + */ + set(object: This, value: Value): void; + }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). + */ + addInitializer(initializer: (this: This) => void): void; + + readonly metadata: DecoratorMetadata; +} + +/** + * Describes the target provided to class `accessor` field decorators. + * @template This The `this` type to which the target applies. + * @template Value The property type for the class `accessor` field. + */ +interface ClassAccessorDecoratorTarget { + /** + * Invokes the getter that was defined prior to decorator application. + * + * @example + * let value = target.get.call(instance); + */ + get(this: This): Value; + + /** + * Invokes the setter that was defined prior to decorator application. + * + * @example + * target.set.call(instance, value); + */ + set(this: This, value: Value): void; +} + +/** + * Describes the allowed return value from a class `accessor` field decorator. + * @template This The `this` type to which the target applies. + * @template Value The property type for the class `accessor` field. + */ +interface ClassAccessorDecoratorResult { + /** + * An optional replacement getter function. If not provided, the existing getter function is used instead. + */ + get?(this: This): Value; + + /** + * An optional replacement setter function. If not provided, the existing setter function is used instead. + */ + set?(this: This, value: Value): void; + + /** + * An optional initializer mutator that is invoked when the underlying field initializer is evaluated. + * @param value The incoming initializer value. + * @returns The replacement initializer value. + */ + init?(this: This, value: Value): Value; +} + +/** + * Context provided to a class field decorator. + * @template This The type on which the class element will be defined. For a static class element, this will be + * the type of the constructor. For a non-static class element, this will be the type of the instance. + * @template Value The type of the decorated class field. + */ +interface ClassFieldDecoratorContext< + This = unknown, + Value = unknown, +> { + /** The kind of class element that was decorated. */ + readonly kind: "field"; + + /** The name of the decorated class element. */ + readonly name: string | symbol; + + /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */ + readonly static: boolean; + + /** A value indicating whether the class element has a private name. */ + readonly private: boolean; + + /** An object that can be used to access the current value of the class element at runtime. */ + readonly access: { + /** + * Determines whether an object has a property with the same name as the decorated element. + */ + has(object: This): boolean; + + /** + * Gets the value of the field on the provided object. + */ + get(object: This): Value; + + /** + * Sets the value of the field on the provided object. + */ + set(object: This, value: Value): void; + }; + + /** + * Adds a callback to be invoked either before static initializers are run (when + * decorating a `static` element), or before instance initializers are run (when + * decorating a non-`static` element). + */ + addInitializer(initializer: (this: This) => void): void; + + readonly metadata: DecoratorMetadata; +} diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.decorators.legacy.d.ts b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.decorators.legacy.d.ts new file mode 100644 index 00000000..26fbcb52 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.decorators.legacy.d.ts @@ -0,0 +1,22 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/// + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void; diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.dom.asynciterable.d.ts b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.dom.asynciterable.d.ts new file mode 100644 index 00000000..28e1bfd8 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.dom.asynciterable.d.ts @@ -0,0 +1,33 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/// + +///////////////////////////// +/// Window Async Iterable APIs +///////////////////////////// + +interface FileSystemDirectoryHandle { + [Symbol.asyncIterator](): AsyncIterableIterator<[string, FileSystemHandle]>; + entries(): AsyncIterableIterator<[string, FileSystemHandle]>; + keys(): AsyncIterableIterator; + values(): AsyncIterableIterator; +} + +interface ReadableStream { + [Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): AsyncIterableIterator; + values(options?: ReadableStreamIteratorOptions): AsyncIterableIterator; +} diff --git a/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.dom.d.ts b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.dom.d.ts new file mode 100644 index 00000000..079a8615 --- /dev/null +++ b/blarify/vendor/multilspy/language_servers/typescript_language_server/static/ts-lsp/node_modules/typescript/lib/lib.dom.d.ts @@ -0,0 +1,28596 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/// + +///////////////////////////// +/// Window APIs +///////////////////////////// + +interface AddEventListenerOptions extends EventListenerOptions { + once?: boolean; + passive?: boolean; + signal?: AbortSignal; +} + +interface AesCbcParams extends Algorithm { + iv: BufferSource; +} + +interface AesCtrParams extends Algorithm { + counter: BufferSource; + length: number; +} + +interface AesDerivedKeyParams extends Algorithm { + length: number; +} + +interface AesGcmParams extends Algorithm { + additionalData?: BufferSource; + iv: BufferSource; + tagLength?: number; +} + +interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; +} + +interface AesKeyGenParams extends Algorithm { + length: number; +} + +interface Algorithm { + name: string; +} + +interface AnalyserOptions extends AudioNodeOptions { + fftSize?: number; + maxDecibels?: number; + minDecibels?: number; + smoothingTimeConstant?: number; +} + +interface AnimationEventInit extends EventInit { + animationName?: string; + elapsedTime?: number; + pseudoElement?: string; +} + +interface AnimationPlaybackEventInit extends EventInit { + currentTime?: CSSNumberish | null; + timelineTime?: CSSNumberish | null; +} + +interface AssignedNodesOptions { + flatten?: boolean; +} + +interface AudioBufferOptions { + length: number; + numberOfChannels?: number; + sampleRate: number; +} + +interface AudioBufferSourceOptions { + buffer?: AudioBuffer | null; + detune?: number; + loop?: boolean; + loopEnd?: number; + loopStart?: number; + playbackRate?: number; +} + +interface AudioConfiguration { + bitrate?: number; + channels?: string; + contentType: string; + samplerate?: number; + spatialRendering?: boolean; +} + +interface AudioContextOptions { + latencyHint?: AudioContextLatencyCategory | number; + sampleRate?: number; +} + +interface AudioNodeOptions { + channelCount?: number; + channelCountMode?: ChannelCountMode; + channelInterpretation?: ChannelInterpretation; +} + +interface AudioProcessingEventInit extends EventInit { + inputBuffer: AudioBuffer; + outputBuffer: AudioBuffer; + playbackTime: number; +} + +interface AudioTimestamp { + contextTime?: number; + performanceTime?: DOMHighResTimeStamp; +} + +interface AudioWorkletNodeOptions extends AudioNodeOptions { + numberOfInputs?: number; + numberOfOutputs?: number; + outputChannelCount?: number[]; + parameterData?: Record; + processorOptions?: any; +} + +interface AuthenticationExtensionsClientInputs { + appid?: string; + credProps?: boolean; + hmacCreateSecret?: boolean; + minPinLength?: boolean; +} + +interface AuthenticationExtensionsClientOutputs { + appid?: boolean; + credProps?: CredentialPropertiesOutput; + hmacCreateSecret?: boolean; +} + +interface AuthenticatorSelectionCriteria { + authenticatorAttachment?: AuthenticatorAttachment; + requireResidentKey?: boolean; + residentKey?: ResidentKeyRequirement; + userVerification?: UserVerificationRequirement; +} + +interface AvcEncoderConfig { + format?: AvcBitstreamFormat; +} + +interface BiquadFilterOptions extends AudioNodeOptions { + Q?: number; + detune?: number; + frequency?: number; + gain?: number; + type?: BiquadFilterType; +} + +interface BlobEventInit { + data: Blob; + timecode?: DOMHighResTimeStamp; +} + +interface BlobPropertyBag { + endings?: EndingType; + type?: string; +} + +interface CSSMatrixComponentOptions { + is2D?: boolean; +} + +interface CSSNumericType { + angle?: number; + flex?: number; + frequency?: number; + length?: number; + percent?: number; + percentHint?: CSSNumericBaseType; + resolution?: number; + time?: number; +} + +interface CSSStyleSheetInit { + baseURL?: string; + disabled?: boolean; + media?: MediaList | string; +} + +interface CacheQueryOptions { + ignoreMethod?: boolean; + ignoreSearch?: boolean; + ignoreVary?: boolean; +} + +interface CanvasRenderingContext2DSettings { + alpha?: boolean; + colorSpace?: PredefinedColorSpace; + desynchronized?: boolean; + willReadFrequently?: boolean; +} + +interface ChannelMergerOptions extends AudioNodeOptions { + numberOfInputs?: number; +} + +interface ChannelSplitterOptions extends AudioNodeOptions { + numberOfOutputs?: number; +} + +interface CheckVisibilityOptions { + checkOpacity?: boolean; + checkVisibilityCSS?: boolean; + contentVisibilityAuto?: boolean; + opacityProperty?: boolean; + visibilityProperty?: boolean; +} + +interface ClientQueryOptions { + includeUncontrolled?: boolean; + type?: ClientTypes; +} + +interface ClipboardEventInit extends EventInit { + clipboardData?: DataTransfer | null; +} + +interface ClipboardItemOptions { + presentationStyle?: PresentationStyle; +} + +interface CloseEventInit extends EventInit { + code?: number; + reason?: string; + wasClean?: boolean; +} + +interface CompositionEventInit extends UIEventInit { + data?: string; +} + +interface ComputedEffectTiming extends EffectTiming { + activeDuration?: CSSNumberish; + currentIteration?: number | null; + endTime?: CSSNumberish; + localTime?: CSSNumberish | null; + progress?: number | null; + startTime?: CSSNumberish; +} + +interface ComputedKeyframe { + composite: CompositeOperationOrAuto; + computedOffset: number; + easing: string; + offset: number | null; + [property: string]: string | number | null | undefined; +} + +interface ConstantSourceOptions { + offset?: number; +} + +interface ConstrainBooleanParameters { + exact?: boolean; + ideal?: boolean; +} + +interface ConstrainDOMStringParameters { + exact?: string | string[]; + ideal?: string | string[]; +} + +interface ConstrainDoubleRange extends DoubleRange { + exact?: number; + ideal?: number; +} + +interface ConstrainULongRange extends ULongRange { + exact?: number; + ideal?: number; +} + +interface ContentVisibilityAutoStateChangeEventInit extends EventInit { + skipped?: boolean; +} + +interface ConvolverOptions extends AudioNodeOptions { + buffer?: AudioBuffer | null; + disableNormalization?: boolean; +} + +interface CredentialCreationOptions { + publicKey?: PublicKeyCredentialCreationOptions; + signal?: AbortSignal; +} + +interface CredentialPropertiesOutput { + rk?: boolean; +} + +interface CredentialRequestOptions { + mediation?: CredentialMediationRequirement; + publicKey?: PublicKeyCredentialRequestOptions; + signal?: AbortSignal; +} + +interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +interface CustomEventInit extends EventInit { + detail?: T; +} + +interface DOMMatrix2DInit { + a?: number; + b?: number; + c?: number; + d?: number; + e?: number; + f?: number; + m11?: number; + m12?: number; + m21?: number; + m22?: number; + m41?: number; + m42?: number; +} + +interface DOMMatrixInit extends DOMMatrix2DInit { + is2D?: boolean; + m13?: number; + m14?: number; + m23?: number; + m24?: number; + m31?: number; + m32?: number; + m33?: number; + m34?: number; + m43?: number; + m44?: number; +} + +interface DOMPointInit { + w?: number; + x?: number; + y?: number; + z?: number; +} + +interface DOMQuadInit { + p1?: DOMPointInit; + p2?: DOMPointInit; + p3?: DOMPointInit; + p4?: DOMPointInit; +} + +interface DOMRectInit { + height?: number; + width?: number; + x?: number; + y?: number; +} + +interface DelayOptions extends AudioNodeOptions { + delayTime?: number; + maxDelayTime?: number; +} + +interface DeviceMotionEventAccelerationInit { + x?: number | null; + y?: number | null; + z?: number | null; +} + +interface DeviceMotionEventInit extends EventInit { + acceleration?: DeviceMotionEventAccelerationInit; + accelerationIncludingGravity?: DeviceMotionEventAccelerationInit; + interval?: number; + rotationRate?: DeviceMotionEventRotationRateInit; +} + +interface DeviceMotionEventRotationRateInit { + alpha?: number | null; + beta?: number | null; + gamma?: number | null; +} + +interface DeviceOrientationEventInit extends EventInit { + absolute?: boolean; + alpha?: number | null; + beta?: number | null; + gamma?: number | null; +} + +interface DisplayMediaStreamOptions { + audio?: boolean | MediaTrackConstraints; + video?: boolean | MediaTrackConstraints; +} + +interface DocumentTimelineOptions { + originTime?: DOMHighResTimeStamp; +} + +interface DoubleRange { + max?: number; + min?: number; +} + +interface DragEventInit extends MouseEventInit { + dataTransfer?: DataTransfer | null; +} + +interface DynamicsCompressorOptions extends AudioNodeOptions { + attack?: number; + knee?: number; + ratio?: number; + release?: number; + threshold?: number; +} + +interface EcKeyAlgorithm extends KeyAlgorithm { + namedCurve: NamedCurve; +} + +interface EcKeyGenParams extends Algorithm { + namedCurve: NamedCurve; +} + +interface EcKeyImportParams extends Algorithm { + namedCurve: NamedCurve; +} + +interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface EcdsaParams extends Algorithm { + hash: HashAlgorithmIdentifier; +} + +interface EffectTiming { + delay?: number; + direction?: PlaybackDirection; + duration?: number | CSSNumericValue | string; + easing?: string; + endDelay?: number; + fill?: FillMode; + iterationStart?: number; + iterations?: number; + playbackRate?: number; +} + +interface ElementCreationOptions { + is?: string; +} + +interface ElementDefinitionOptions { + extends?: string; +} + +interface EncodedVideoChunkInit { + data: AllowSharedBufferSource; + duration?: number; + timestamp: number; + type: EncodedVideoChunkType; +} + +interface EncodedVideoChunkMetadata { + decoderConfig?: VideoDecoderConfig; +} + +interface ErrorEventInit extends EventInit { + colno?: number; + error?: any; + filename?: string; + lineno?: number; + message?: string; +} + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; + composed?: boolean; +} + +interface EventListenerOptions { + capture?: boolean; +} + +interface EventModifierInit extends UIEventInit { + altKey?: boolean; + ctrlKey?: boolean; + metaKey?: boolean; + modifierAltGraph?: boolean; + modifierCapsLock?: boolean; + modifierFn?: boolean; + modifierFnLock?: boolean; + modifierHyper?: boolean; + modifierNumLock?: boolean; + modifierScrollLock?: boolean; + modifierSuper?: boolean; + modifierSymbol?: boolean; + modifierSymbolLock?: boolean; + shiftKey?: boolean; +} + +interface EventSourceInit { + withCredentials?: boolean; +} + +interface FilePropertyBag extends BlobPropertyBag { + lastModified?: number; +} + +interface FileSystemCreateWritableOptions { + keepExistingData?: boolean; +} + +interface FileSystemFlags { + create?: boolean; + exclusive?: boolean; +} + +interface FileSystemGetDirectoryOptions { + create?: boolean; +} + +interface FileSystemGetFileOptions { + create?: boolean; +} + +interface FileSystemRemoveOptions { + recursive?: boolean; +} + +interface FocusEventInit extends UIEventInit { + relatedTarget?: EventTarget | null; +} + +interface FocusOptions { + preventScroll?: boolean; +} + +interface FontFaceDescriptors { + ascentOverride?: string; + descentOverride?: string; + display?: FontDisplay; + featureSettings?: string; + lineGapOverride?: string; + stretch?: string; + style?: string; + unicodeRange?: string; + weight?: string; +} + +interface FontFaceSetLoadEventInit extends EventInit { + fontfaces?: FontFace[]; +} + +interface FormDataEventInit extends EventInit { + formData: FormData; +} + +interface FullscreenOptions { + navigationUI?: FullscreenNavigationUI; +} + +interface GainOptions extends AudioNodeOptions { + gain?: number; +} + +interface GamepadEffectParameters { + duration?: number; + leftTrigger?: number; + rightTrigger?: number; + startDelay?: number; + strongMagnitude?: number; + weakMagnitude?: number; +} + +interface GamepadEventInit extends EventInit { + gamepad: Gamepad; +} + +interface GetAnimationsOptions { + subtree?: boolean; +} + +interface GetNotificationOptions { + tag?: string; +} + +interface GetRootNodeOptions { + composed?: boolean; +} + +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; +} + +interface HkdfParams extends Algorithm { + hash: HashAlgorithmIdentifier; + info: BufferSource; + salt: BufferSource; +} + +interface HmacImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; +} + +interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: KeyAlgorithm; + length: number; +} + +interface HmacKeyGenParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; +} + +interface IDBDatabaseInfo { + name?: string; + version?: number; +} + +interface IDBIndexParameters { + multiEntry?: boolean; + unique?: boolean; +} + +interface IDBObjectStoreParameters { + autoIncrement?: boolean; + keyPath?: string | string[] | null; +} + +interface IDBTransactionOptions { + durability?: IDBTransactionDurability; +} + +interface IDBVersionChangeEventInit extends EventInit { + newVersion?: number | null; + oldVersion?: number; +} + +interface IIRFilterOptions extends AudioNodeOptions { + feedback: number[]; + feedforward: number[]; +} + +interface IdleRequestOptions { + timeout?: number; +} + +interface ImageBitmapOptions { + colorSpaceConversion?: ColorSpaceConversion; + imageOrientation?: ImageOrientation; + premultiplyAlpha?: PremultiplyAlpha; + resizeHeight?: number; + resizeQuality?: ResizeQuality; + resizeWidth?: number; +} + +interface ImageBitmapRenderingContextSettings { + alpha?: boolean; +} + +interface ImageDataSettings { + colorSpace?: PredefinedColorSpace; +} + +interface ImageEncodeOptions { + quality?: number; + type?: string; +} + +interface ImportMeta { + url: string; +} + +interface InputEventInit extends UIEventInit { + data?: string | null; + dataTransfer?: DataTransfer | null; + inputType?: string; + isComposing?: boolean; + targetRanges?: StaticRange[]; +} + +interface IntersectionObserverEntryInit { + boundingClientRect: DOMRectInit; + intersectionRatio: number; + intersectionRect: DOMRectInit; + isIntersecting: boolean; + rootBounds: DOMRectInit | null; + target: Element; + time: DOMHighResTimeStamp; +} + +interface IntersectionObserverInit { + root?: Element | Document | null; + rootMargin?: string; + threshold?: number | number[]; +} + +interface JsonWebKey { + alg?: string; + crv?: string; + d?: string; + dp?: string; + dq?: string; + e?: string; + ext?: boolean; + k?: string; + key_ops?: string[]; + kty?: string; + n?: string; + oth?: RsaOtherPrimesInfo[]; + p?: string; + q?: string; + qi?: string; + use?: string; + x?: string; + y?: string; +} + +interface KeyAlgorithm { + name: string; +} + +interface KeyboardEventInit extends EventModifierInit { + /** @deprecated */ + charCode?: number; + code?: string; + isComposing?: boolean; + key?: string; + /** @deprecated */ + keyCode?: number; + location?: number; + repeat?: boolean; +} + +interface Keyframe { + composite?: CompositeOperationOrAuto; + easing?: string; + offset?: number | null; + [property: string]: string | number | null | undefined; +} + +interface KeyframeAnimationOptions extends KeyframeEffectOptions { + id?: string; + timeline?: AnimationTimeline | null; +} + +interface KeyframeEffectOptions extends EffectTiming { + composite?: CompositeOperation; + iterationComposite?: IterationCompositeOperation; + pseudoElement?: string | null; +} + +interface LockInfo { + clientId?: string; + mode?: LockMode; + name?: string; +} + +interface LockManagerSnapshot { + held?: LockInfo[]; + pending?: LockInfo[]; +} + +interface LockOptions { + ifAvailable?: boolean; + mode?: LockMode; + signal?: AbortSignal; + steal?: boolean; +} + +interface MIDIConnectionEventInit extends EventInit { + port?: MIDIPort; +} + +interface MIDIMessageEventInit extends EventInit { + data?: Uint8Array; +} + +interface MIDIOptions { + software?: boolean; + sysex?: boolean; +} + +interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo { + configuration?: MediaDecodingConfiguration; +} + +interface MediaCapabilitiesEncodingInfo extends MediaCapabilitiesInfo { + configuration?: MediaEncodingConfiguration; +} + +interface MediaCapabilitiesInfo { + powerEfficient: boolean; + smooth: boolean; + supported: boolean; +} + +interface MediaConfiguration { + audio?: AudioConfiguration; + video?: VideoConfiguration; +} + +interface MediaDecodingConfiguration extends MediaConfiguration { + type: MediaDecodingType; +} + +interface MediaElementAudioSourceOptions { + mediaElement: HTMLMediaElement; +} + +interface MediaEncodingConfiguration extends MediaConfiguration { + type: MediaEncodingType; +} + +interface MediaEncryptedEventInit extends EventInit { + initData?: ArrayBuffer | null; + initDataType?: string; +} + +interface MediaImage { + sizes?: string; + src: string; + type?: string; +} + +interface MediaKeyMessageEventInit extends EventInit { + message: ArrayBuffer; + messageType: MediaKeyMessageType; +} + +interface MediaKeySystemConfiguration { + audioCapabilities?: MediaKeySystemMediaCapability[]; + distinctiveIdentifier?: MediaKeysRequirement; + initDataTypes?: string[]; + label?: string; + persistentState?: MediaKeysRequirement; + sessionTypes?: string[]; + videoCapabilities?: MediaKeySystemMediaCapability[]; +} + +interface MediaKeySystemMediaCapability { + contentType?: string; + encryptionScheme?: string | null; + robustness?: string; +} + +interface MediaMetadataInit { + album?: string; + artist?: string; + artwork?: MediaImage[]; + title?: string; +} + +interface MediaPositionState { + duration?: number; + playbackRate?: number; + position?: number; +} + +interface MediaQueryListEventInit extends EventInit { + matches?: boolean; + media?: string; +} + +interface MediaRecorderOptions { + audioBitsPerSecond?: number; + bitsPerSecond?: number; + mimeType?: string; + videoBitsPerSecond?: number; +} + +interface MediaSessionActionDetails { + action: MediaSessionAction; + fastSeek?: boolean; + seekOffset?: number; + seekTime?: number; +} + +interface MediaStreamAudioSourceOptions { + mediaStream: MediaStream; +} + +interface MediaStreamConstraints { + audio?: boolean | MediaTrackConstraints; + peerIdentity?: string; + preferCurrentTab?: boolean; + video?: boolean | MediaTrackConstraints; +} + +interface MediaStreamTrackEventInit extends EventInit { + track: MediaStreamTrack; +} + +interface MediaTrackCapabilities { + aspectRatio?: DoubleRange; + autoGainControl?: boolean[]; + channelCount?: ULongRange; + deviceId?: string; + displaySurface?: string; + echoCancellation?: boolean[]; + facingMode?: string[]; + frameRate?: DoubleRange; + groupId?: string; + height?: ULongRange; + noiseSuppression?: boolean[]; + sampleRate?: ULongRange; + sampleSize?: ULongRange; + width?: ULongRange; +} + +interface MediaTrackConstraintSet { + aspectRatio?: ConstrainDouble; + autoGainControl?: ConstrainBoolean; + channelCount?: ConstrainULong; + deviceId?: ConstrainDOMString; + displaySurface?: ConstrainDOMString; + echoCancellation?: ConstrainBoolean; + facingMode?: ConstrainDOMString; + frameRate?: ConstrainDouble; + groupId?: ConstrainDOMString; + height?: ConstrainULong; + noiseSuppression?: ConstrainBoolean; + sampleRate?: ConstrainULong; + sampleSize?: ConstrainULong; + width?: ConstrainULong; +} + +interface MediaTrackConstraints extends MediaTrackConstraintSet { + advanced?: MediaTrackConstraintSet[]; +} + +interface MediaTrackSettings { + aspectRatio?: number; + autoGainControl?: boolean; + channelCount?: number; + deviceId?: string; + displaySurface?: string; + echoCancellation?: boolean; + facingMode?: string; + frameRate?: number; + groupId?: string; + height?: number; + noiseSuppression?: boolean; + sampleRate?: number; + sampleSize?: number; + width?: number; +} + +interface MediaTrackSupportedConstraints { + aspectRatio?: boolean; + autoGainControl?: boolean; + channelCount?: boolean; + deviceId?: boolean; + displaySurface?: boolean; + echoCancellation?: boolean; + facingMode?: boolean; + frameRate?: boolean; + groupId?: boolean; + height?: boolean; + noiseSuppression?: boolean; + sampleRate?: boolean; + sampleSize?: boolean; + width?: boolean; +} + +interface MessageEventInit extends EventInit { + data?: T; + lastEventId?: string; + origin?: string; + ports?: MessagePort[]; + source?: MessageEventSource | null; +} + +interface MouseEventInit extends EventModifierInit { + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + movementX?: number; + movementY?: number; + relatedTarget?: EventTarget | null; + screenX?: number; + screenY?: number; +} + +interface MultiCacheQueryOptions extends CacheQueryOptions { + cacheName?: string; +} + +interface MutationObserverInit { + /** Set to a list of attribute local names (without namespace) if not all attribute mutations need to be observed and attributes is true or omitted. */ + attributeFilter?: string[]; + /** Set to true if attributes is true or omitted and target's attribute value before the mutation needs to be recorded. */ + attributeOldValue?: boolean; + /** Set to true if mutations to target's attributes are to be observed. Can be omitted if attributeOldValue or attributeFilter is specified. */ + attributes?: boolean; + /** Set to true if mutations to target's data are to be observed. Can be omitted if characterDataOldValue is specified. */ + characterData?: boolean; + /** Set to true if characterData is set to true or omitted and target's data before the mutation needs to be recorded. */ + characterDataOldValue?: boolean; + /** Set to true if mutations to target's children are to be observed. */ + childList?: boolean; + /** Set to true if mutations to not just target, but also target's descendants are to be observed. */ + subtree?: boolean; +} + +interface NavigationPreloadState { + enabled?: boolean; + headerValue?: string; +} + +interface NotificationOptions { + badge?: string; + body?: string; + data?: any; + dir?: NotificationDirection; + icon?: string; + lang?: string; + requireInteraction?: boolean; + silent?: boolean | null; + tag?: string; +} + +interface OfflineAudioCompletionEventInit extends EventInit { + renderedBuffer: AudioBuffer; +} + +interface OfflineAudioContextOptions { + length: number; + numberOfChannels?: number; + sampleRate: number; +} + +interface OptionalEffectTiming { + delay?: number; + direction?: PlaybackDirection; + duration?: number | string; + easing?: string; + endDelay?: number; + fill?: FillMode; + iterationStart?: number; + iterations?: number; + playbackRate?: number; +} + +interface OscillatorOptions extends AudioNodeOptions { + detune?: number; + frequency?: number; + periodicWave?: PeriodicWave; + type?: OscillatorType; +} + +interface PageTransitionEventInit extends EventInit { + persisted?: boolean; +} + +interface PannerOptions extends AudioNodeOptions { + coneInnerAngle?: number; + coneOuterAngle?: number; + coneOuterGain?: number; + distanceModel?: DistanceModelType; + maxDistance?: number; + orientationX?: number; + orientationY?: number; + orientationZ?: number; + panningModel?: PanningModelType; + positionX?: number; + positionY?: number; + positionZ?: number; + refDistance?: number; + rolloffFactor?: number; +} + +interface PaymentCurrencyAmount { + currency: string; + value: string; +} + +interface PaymentDetailsBase { + displayItems?: PaymentItem[]; + modifiers?: PaymentDetailsModifier[]; +} + +interface PaymentDetailsInit extends PaymentDetailsBase { + id?: string; + total: PaymentItem; +} + +interface PaymentDetailsModifier { + additionalDisplayItems?: PaymentItem[]; + data?: any; + supportedMethods: string; + total?: PaymentItem; +} + +interface PaymentDetailsUpdate extends PaymentDetailsBase { + paymentMethodErrors?: any; + total?: PaymentItem; +} + +interface PaymentItem { + amount: PaymentCurrencyAmount; + label: string; + pending?: boolean; +} + +interface PaymentMethodChangeEventInit extends PaymentRequestUpdateEventInit { + methodDetails?: any; + methodName?: string; +} + +interface PaymentMethodData { + data?: any; + supportedMethods: string; +} + +interface PaymentRequestUpdateEventInit extends EventInit { +} + +interface PaymentValidationErrors { + error?: string; + paymentMethod?: any; +} + +interface Pbkdf2Params extends Algorithm { + hash: HashAlgorithmIdentifier; + iterations: number; + salt: BufferSource; +} + +interface PerformanceMarkOptions { + detail?: any; + startTime?: DOMHighResTimeStamp; +} + +interface PerformanceMeasureOptions { + detail?: any; + duration?: DOMHighResTimeStamp; + end?: string | DOMHighResTimeStamp; + start?: string | DOMHighResTimeStamp; +} + +interface PerformanceObserverInit { + buffered?: boolean; + entryTypes?: string[]; + type?: string; +} + +interface PeriodicWaveConstraints { + disableNormalization?: boolean; +} + +interface PeriodicWaveOptions extends PeriodicWaveConstraints { + imag?: number[] | Float32Array; + real?: number[] | Float32Array; +} + +interface PermissionDescriptor { + name: PermissionName; +} + +interface PictureInPictureEventInit extends EventInit { + pictureInPictureWindow: PictureInPictureWindow; +} + +interface PlaneLayout { + offset: number; + stride: number; +} + +interface PointerEventInit extends MouseEventInit { + coalescedEvents?: PointerEvent[]; + height?: number; + isPrimary?: boolean; + pointerId?: number; + pointerType?: string; + predictedEvents?: PointerEvent[]; + pressure?: number; + tangentialPressure?: number; + tiltX?: number; + tiltY?: number; + twist?: number; + width?: number; +} + +interface PopStateEventInit extends EventInit { + state?: any; +} + +interface PositionOptions { + enableHighAccuracy?: boolean; + maximumAge?: number; + timeout?: number; +} + +interface ProgressEventInit extends EventInit { + lengthComputable?: boolean; + loaded?: number; + total?: number; +} + +interface PromiseRejectionEventInit extends EventInit { + promise: Promise; + reason?: any; +} + +interface PropertyDefinition { + inherits: boolean; + initialValue?: string; + name: string; + syntax?: string; +} + +interface PropertyIndexedKeyframes { + composite?: CompositeOperationOrAuto | CompositeOperationOrAuto[]; + easing?: string | string[]; + offset?: number | (number | null)[]; + [property: string]: string | string[] | number | null | (number | null)[] | undefined; +} + +interface PublicKeyCredentialCreationOptions { + attestation?: AttestationConveyancePreference; + authenticatorSelection?: AuthenticatorSelectionCriteria; + challenge: BufferSource; + excludeCredentials?: PublicKeyCredentialDescriptor[]; + extensions?: AuthenticationExtensionsClientInputs; + pubKeyCredParams: PublicKeyCredentialParameters[]; + rp: PublicKeyCredentialRpEntity; + timeout?: number; + user: PublicKeyCredentialUserEntity; +} + +interface PublicKeyCredentialDescriptor { + id: BufferSource; + transports?: AuthenticatorTransport[]; + type: PublicKeyCredentialType; +} + +interface PublicKeyCredentialEntity { + name: string; +} + +interface PublicKeyCredentialParameters { + alg: COSEAlgorithmIdentifier; + type: PublicKeyCredentialType; +} + +interface PublicKeyCredentialRequestOptions { + allowCredentials?: PublicKeyCredentialDescriptor[]; + challenge: BufferSource; + extensions?: AuthenticationExtensionsClientInputs; + rpId?: string; + timeout?: number; + userVerification?: UserVerificationRequirement; +} + +interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity { + id?: string; +} + +interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity { + displayName: string; + id: BufferSource; +} + +interface PushSubscriptionJSON { + endpoint?: string; + expirationTime?: EpochTimeStamp | null; + keys?: Record; +} + +interface PushSubscriptionOptionsInit { + applicationServerKey?: BufferSource | string | null; + userVisibleOnly?: boolean; +} + +interface QueuingStrategy { + highWaterMark?: number; + size?: QueuingStrategySize; +} + +interface QueuingStrategyInit { + /** + * Creates a new ByteLengthQueuingStrategy with the provided high water mark. + * + * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw. + */ + highWaterMark: number; +} + +interface RTCAnswerOptions extends RTCOfferAnswerOptions { +} + +interface RTCCertificateExpiration { + expires?: number; +} + +interface RTCConfiguration { + bundlePolicy?: RTCBundlePolicy; + certificates?: RTCCertificate[]; + iceCandidatePoolSize?: number; + iceServers?: RTCIceServer[]; + iceTransportPolicy?: RTCIceTransportPolicy; + rtcpMuxPolicy?: RTCRtcpMuxPolicy; +} + +interface RTCDTMFToneChangeEventInit extends EventInit { + tone?: string; +} + +interface RTCDataChannelEventInit extends EventInit { + channel: RTCDataChannel; +} + +interface RTCDataChannelInit { + id?: number; + maxPacketLifeTime?: number; + maxRetransmits?: number; + negotiated?: boolean; + ordered?: boolean; + protocol?: string; +} + +interface RTCDtlsFingerprint { + algorithm?: string; + value?: string; +} + +interface RTCEncodedAudioFrameMetadata { + contributingSources?: number[]; + payloadType?: number; + sequenceNumber?: number; + synchronizationSource?: number; +} + +interface RTCEncodedVideoFrameMetadata { + contributingSources?: number[]; + dependencies?: number[]; + frameId?: number; + height?: number; + payloadType?: number; + spatialIndex?: number; + synchronizationSource?: number; + temporalIndex?: number; + timestamp?: number; + width?: number; +} + +interface RTCErrorEventInit extends EventInit { + error: RTCError; +} + +interface RTCErrorInit { + errorDetail: RTCErrorDetailType; + httpRequestStatusCode?: number; + receivedAlert?: number; + sctpCauseCode?: number; + sdpLineNumber?: number; + sentAlert?: number; +} + +interface RTCIceCandidateInit { + candidate?: string; + sdpMLineIndex?: number | null; + sdpMid?: string | null; + usernameFragment?: string | null; +} + +interface RTCIceCandidatePair { + local: RTCIceCandidate; + remote: RTCIceCandidate; +} + +interface RTCIceCandidatePairStats extends RTCStats { + availableIncomingBitrate?: number; + availableOutgoingBitrate?: number; + bytesReceived?: number; + bytesSent?: number; + currentRoundTripTime?: number; + lastPacketReceivedTimestamp?: DOMHighResTimeStamp; + lastPacketSentTimestamp?: DOMHighResTimeStamp; + localCandidateId: string; + nominated?: boolean; + remoteCandidateId: string; + requestsReceived?: number; + requestsSent?: number; + responsesReceived?: number; + responsesSent?: number; + state: RTCStatsIceCandidatePairState; + totalRoundTripTime?: number; + transportId: string; +} + +interface RTCIceServer { + credential?: string; + urls: string | string[]; + username?: string; +} + +interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats { + audioLevel?: number; + bytesReceived?: number; + concealedSamples?: number; + concealmentEvents?: number; + decoderImplementation?: string; + estimatedPlayoutTimestamp?: DOMHighResTimeStamp; + fecPacketsDiscarded?: number; + fecPacketsReceived?: number; + firCount?: number; + frameHeight?: number; + frameWidth?: number; + framesDecoded?: number; + framesDropped?: number; + framesPerSecond?: number; + framesReceived?: number; + headerBytesReceived?: number; + insertedSamplesForDeceleration?: number; + jitterBufferDelay?: number; + jitterBufferEmittedCount?: number; + keyFramesDecoded?: number; + lastPacketReceivedTimestamp?: DOMHighResTimeStamp; + mid?: string; + nackCount?: number; + packetsDiscarded?: number; + pliCount?: number; + qpSum?: number; + remoteId?: string; + removedSamplesForAcceleration?: number; + silentConcealedSamples?: number; + totalAudioEnergy?: number; + totalDecodeTime?: number; + totalInterFrameDelay?: number; + totalProcessingDelay?: number; + totalSamplesDuration?: number; + totalSamplesReceived?: number; + totalSquaredInterFrameDelay?: number; + trackIdentifier: string; +} + +interface RTCLocalSessionDescriptionInit { + sdp?: string; + type?: RTCSdpType; +} + +interface RTCOfferAnswerOptions { +} + +interface RTCOfferOptions extends RTCOfferAnswerOptions { + iceRestart?: boolean; + offerToReceiveAudio?: boolean; + offerToReceiveVideo?: boolean; +} + +interface RTCOutboundRtpStreamStats extends RTCSentRtpStreamStats { + firCount?: number; + frameHeight?: number; + frameWidth?: number; + framesEncoded?: number; + framesPerSecond?: number; + framesSent?: number; + headerBytesSent?: number; + hugeFramesSent?: number; + keyFramesEncoded?: number; + mediaSourceId?: string; + nackCount?: number; + pliCount?: number; + qpSum?: number; + qualityLimitationResolutionChanges?: number; + remoteId?: string; + retransmittedBytesSent?: number; + retransmittedPacketsSent?: number; + rid?: string; + rtxSsrc?: number; + targetBitrate?: number; + totalEncodeTime?: number; + totalEncodedBytesTarget?: number; + totalPacketSendDelay?: number; +} + +interface RTCPeerConnectionIceErrorEventInit extends EventInit { + address?: string | null; + errorCode: number; + errorText?: string; + port?: number | null; + url?: string; +} + +interface RTCPeerConnectionIceEventInit extends EventInit { + candidate?: RTCIceCandidate | null; + url?: string | null; +} + +interface RTCReceivedRtpStreamStats extends RTCRtpStreamStats { + jitter?: number; + packetsLost?: number; + packetsReceived?: number; +} + +interface RTCRtcpParameters { + cname?: string; + reducedSize?: boolean; +} + +interface RTCRtpCapabilities { + codecs: RTCRtpCodecCapability[]; + headerExtensions: RTCRtpHeaderExtensionCapability[]; +} + +interface RTCRtpCodec { + channels?: number; + clockRate: number; + mimeType: string; + sdpFmtpLine?: string; +} + +interface RTCRtpCodecCapability extends RTCRtpCodec { +} + +interface RTCRtpCodecParameters extends RTCRtpCodec { + payloadType: number; +} + +interface RTCRtpCodingParameters { + rid?: string; +} + +interface RTCRtpContributingSource { + audioLevel?: number; + rtpTimestamp: number; + source: number; + timestamp: DOMHighResTimeStamp; +} + +interface RTCRtpEncodingParameters extends RTCRtpCodingParameters { + active?: boolean; + maxBitrate?: number; + maxFramerate?: number; + networkPriority?: RTCPriorityType; + priority?: RTCPriorityType; + scaleResolutionDownBy?: number; +} + +interface RTCRtpHeaderExtensionCapability { + uri: string; +} + +interface RTCRtpHeaderExtensionParameters { + encrypted?: boolean; + id: number; + uri: string; +} + +interface RTCRtpParameters { + codecs: RTCRtpCodecParameters[]; + headerExtensions: RTCRtpHeaderExtensionParameters[]; + rtcp: RTCRtcpParameters; +} + +interface RTCRtpReceiveParameters extends RTCRtpParameters { +} + +interface RTCRtpSendParameters extends RTCRtpParameters { + degradationPreference?: RTCDegradationPreference; + encodings: RTCRtpEncodingParameters[]; + transactionId: string; +} + +interface RTCRtpStreamStats extends RTCStats { + codecId?: string; + kind: string; + ssrc: number; + transportId?: string; +} + +interface RTCRtpSynchronizationSource extends RTCRtpContributingSource { +} + +interface RTCRtpTransceiverInit { + direction?: RTCRtpTransceiverDirection; + sendEncodings?: RTCRtpEncodingParameters[]; + streams?: MediaStream[]; +} + +interface RTCSentRtpStreamStats extends RTCRtpStreamStats { + bytesSent?: number; + packetsSent?: number; +} + +interface RTCSessionDescriptionInit { + sdp?: string; + type: RTCSdpType; +} + +interface RTCSetParameterOptions { +} + +interface RTCStats { + id: string; + timestamp: DOMHighResTimeStamp; + type: RTCStatsType; +} + +interface RTCTrackEventInit extends EventInit { + receiver: RTCRtpReceiver; + streams?: MediaStream[]; + track: MediaStreamTrack; + transceiver: RTCRtpTransceiver; +} + +interface RTCTransportStats extends RTCStats { + bytesReceived?: number; + bytesSent?: number; + dtlsCipher?: string; + dtlsState: RTCDtlsTransportState; + localCertificateId?: string; + remoteCertificateId?: string; + selectedCandidatePairId?: string; + srtpCipher?: string; + tlsVersion?: string; +} + +interface ReadableStreamGetReaderOptions { + /** + * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. + * + * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation. + */ + mode?: ReadableStreamReaderMode; +} + +interface ReadableStreamIteratorOptions { + /** + * Asynchronously iterates over the chunks in the stream's internal queue. + * + * Asynchronously iterating over the stream will lock it, preventing any other consumer from acquiring a reader. The lock will be released if the async iterator's return() method is called, e.g. by breaking out of the loop. + * + * By default, calling the async iterator's return() method will also cancel the stream. To prevent this, use the stream's values() method, passing true for the preventCancel option. + */ + preventCancel?: boolean; +} + +interface ReadableStreamReadDoneResult { + done: true; + value?: T; +} + +interface ReadableStreamReadValueResult { + done: false; + value: T; +} + +interface ReadableWritablePair { + readable: ReadableStream; + /** + * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use. + * + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. + */ + writable: WritableStream; +} + +interface RegistrationOptions { + scope?: string; + type?: WorkerType; + updateViaCache?: ServiceWorkerUpdateViaCache; +} + +interface ReportingObserverOptions { + buffered?: boolean; + types?: string[]; +} + +interface RequestInit { + /** A BodyInit object or null to set request's body. */ + body?: BodyInit | null; + /** A string indicating how the request will interact with the browser's cache to set request's cache. */ + cache?: RequestCache; + /** A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials. */ + credentials?: RequestCredentials; + /** A Headers object, an object literal, or an array of two-item arrays to set request's headers. */ + headers?: HeadersInit; + /** A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */ + integrity?: string; + /** A boolean to set request's keepalive. */ + keepalive?: boolean; + /** A string to set request's method. */ + method?: string; + /** A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode. */ + mode?: RequestMode; + priority?: RequestPriority; + /** A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */ + redirect?: RequestRedirect; + /** A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer. */ + referrer?: string; + /** A referrer policy to set request's referrerPolicy. */ + referrerPolicy?: ReferrerPolicy; + /** An AbortSignal to set request's signal. */ + signal?: AbortSignal | null; + /** Can only be null. Used to disassociate request from any Window. */ + window?: null; +} + +interface ResizeObserverOptions { + box?: ResizeObserverBoxOptions; +} + +interface ResponseInit { + headers?: HeadersInit; + status?: number; + statusText?: string; +} + +interface RsaHashedImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; +} + +interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: KeyAlgorithm; +} + +interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: HashAlgorithmIdentifier; +} + +interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: BigInteger; +} + +interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: BigInteger; +} + +interface RsaOaepParams extends Algorithm { + label?: BufferSource; +} + +interface RsaOtherPrimesInfo { + d?: string; + r?: string; + t?: string; +} + +interface RsaPssParams extends Algorithm { + saltLength: number; +} + +interface SVGBoundingBoxOptions { + clipped?: boolean; + fill?: boolean; + markers?: boolean; + stroke?: boolean; +} + +interface ScrollIntoViewOptions extends ScrollOptions { + block?: ScrollLogicalPosition; + inline?: ScrollLogicalPosition; +} + +interface ScrollOptions { + behavior?: ScrollBehavior; +} + +interface ScrollToOptions extends ScrollOptions { + left?: number; + top?: number; +} + +interface SecurityPolicyViolationEventInit extends EventInit { + blockedURI?: string; + columnNumber?: number; + disposition?: SecurityPolicyViolationEventDisposition; + documentURI?: string; + effectiveDirective?: string; + lineNumber?: number; + originalPolicy?: string; + referrer?: string; + sample?: string; + sourceFile?: string; + statusCode?: number; + violatedDirective?: string; +} + +interface ShadowRootInit { + delegatesFocus?: boolean; + mode: ShadowRootMode; + serializable?: boolean; + slotAssignment?: SlotAssignmentMode; +} + +interface ShareData { + files?: File[]; + text?: string; + title?: string; + url?: string; +} + +interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit { + error: SpeechSynthesisErrorCode; +} + +interface SpeechSynthesisEventInit extends EventInit { + charIndex?: number; + charLength?: number; + elapsedTime?: number; + name?: string; + utterance: SpeechSynthesisUtterance; +} + +interface StaticRangeInit { + endContainer: Node; + endOffset: number; + startContainer: Node; + startOffset: number; +} + +interface StereoPannerOptions extends AudioNodeOptions { + pan?: number; +} + +interface StorageEstimate { + quota?: number; + usage?: number; +} + +interface StorageEventInit extends EventInit { + key?: string | null; + newValue?: string | null; + oldValue?: string | null; + storageArea?: Storage | null; + url?: string; +} + +interface StreamPipeOptions { + preventAbort?: boolean; + preventCancel?: boolean; + /** + * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. + * + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. + * + * Errors and closures of the source and destination streams propagate as follows: + * + * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination. + * + * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source. + * + * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. + * + * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. + * + * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set. + */ + preventClose?: boolean; + signal?: AbortSignal; +} + +interface StructuredSerializeOptions { + transfer?: Transferable[]; +} + +interface SubmitEventInit extends EventInit { + submitter?: HTMLElement | null; +} + +interface TextDecodeOptions { + stream?: boolean; +} + +interface TextDecoderOptions { + fatal?: boolean; + ignoreBOM?: boolean; +} + +interface TextEncoderEncodeIntoResult { + read: number; + written: number; +} + +interface ToggleEventInit extends EventInit { + newState?: string; + oldState?: string; +} + +interface TouchEventInit extends EventModifierInit { + changedTouches?: Touch[]; + targetTouches?: Touch[]; + touches?: Touch[]; +} + +interface TouchInit { + altitudeAngle?: number; + azimuthAngle?: number; + clientX?: number; + clientY?: number; + force?: number; + identifier: number; + pageX?: number; + pageY?: number; + radiusX?: number; + radiusY?: number; + rotationAngle?: number; + screenX?: number; + screenY?: number; + target: EventTarget; + touchType?: TouchType; +} + +interface TrackEventInit extends EventInit { + track?: TextTrack | null; +} + +interface Transformer { + flush?: TransformerFlushCallback; + readableType?: undefined; + start?: TransformerStartCallback; + transform?: TransformerTransformCallback; + writableType?: undefined; +} + +interface TransitionEventInit extends EventInit { + elapsedTime?: number; + propertyName?: string; + pseudoElement?: string; +} + +interface UIEventInit extends EventInit { + detail?: number; + view?: Window | null; + /** @deprecated */ + which?: number; +} + +interface ULongRange { + max?: number; + min?: number; +} + +interface UnderlyingByteSource { + autoAllocateChunkSize?: number; + cancel?: UnderlyingSourceCancelCallback; + pull?: (controller: ReadableByteStreamController) => void | PromiseLike; + start?: (controller: ReadableByteStreamController) => any; + type: "bytes"; +} + +interface UnderlyingDefaultSource { + cancel?: UnderlyingSourceCancelCallback; + pull?: (controller: ReadableStreamDefaultController) => void | PromiseLike; + start?: (controller: ReadableStreamDefaultController) => any; + type?: undefined; +} + +interface UnderlyingSink { + abort?: UnderlyingSinkAbortCallback; + close?: UnderlyingSinkCloseCallback; + start?: UnderlyingSinkStartCallback; + type?: undefined; + write?: UnderlyingSinkWriteCallback; +} + +interface UnderlyingSource { + autoAllocateChunkSize?: number; + cancel?: UnderlyingSourceCancelCallback; + pull?: UnderlyingSourcePullCallback; + start?: UnderlyingSourceStartCallback; + type?: ReadableStreamType; +} + +interface ValidityStateFlags { + badInput?: boolean; + customError?: boolean; + patternMismatch?: boolean; + rangeOverflow?: boolean; + rangeUnderflow?: boolean; + stepMismatch?: boolean; + tooLong?: boolean; + tooShort?: boolean; + typeMismatch?: boolean; + valueMissing?: boolean; +} + +interface VideoColorSpaceInit { + fullRange?: boolean | null; + matrix?: VideoMatrixCoefficients | null; + primaries?: VideoColorPrimaries | null; + transfer?: VideoTransferCharacteristics | null; +} + +interface VideoConfiguration { + bitrate: number; + colorGamut?: ColorGamut; + contentType: string; + framerate: number; + hdrMetadataType?: HdrMetadataType; + height: number; + scalabilityMode?: string; + transferFunction?: TransferFunction; + width: number; +} + +interface VideoDecoderConfig { + codec: string; + codedHeight?: number; + codedWidth?: number; + colorSpace?: VideoColorSpaceInit; + description?: AllowSharedBufferSource; + displayAspectHeight?: number; + displayAspectWidth?: number; + hardwareAcceleration?: HardwareAcceleration; + optimizeForLatency?: boolean; +} + +interface VideoDecoderInit { + error: WebCodecsErrorCallback; + output: VideoFrameOutputCallback; +} + +interface VideoDecoderSupport { + config?: VideoDecoderConfig; + supported?: boolean; +} + +interface VideoEncoderConfig { + alpha?: AlphaOption; + avc?: AvcEncoderConfig; + bitrate?: number; + bitrateMode?: VideoEncoderBitrateMode; + codec: string; + displayHeight?: number; + displayWidth?: number; + framerate?: number; + hardwareAcceleration?: HardwareAcceleration; + height: number; + latencyMode?: LatencyMode; + scalabilityMode?: string; + width: number; +} + +interface VideoEncoderEncodeOptions { + keyFrame?: boolean; +} + +interface VideoEncoderInit { + error: WebCodecsErrorCallback; + output: EncodedVideoChunkOutputCallback; +} + +interface VideoEncoderSupport { + config?: VideoEncoderConfig; + supported?: boolean; +} + +interface VideoFrameBufferInit { + codedHeight: number; + codedWidth: number; + colorSpace?: VideoColorSpaceInit; + displayHeight?: number; + displayWidth?: number; + duration?: number; + format: VideoPixelFormat; + layout?: PlaneLayout[]; + timestamp: number; + visibleRect?: DOMRectInit; +} + +interface VideoFrameCallbackMetadata { + captureTime?: DOMHighResTimeStamp; + expectedDisplayTime: DOMHighResTimeStamp; + height: number; + mediaTime: number; + presentationTime: DOMHighResTimeStamp; + presentedFrames: number; + processingDuration?: number; + receiveTime?: DOMHighResTimeStamp; + rtpTimestamp?: number; + width: number; +} + +interface VideoFrameCopyToOptions { + layout?: PlaneLayout[]; + rect?: DOMRectInit; +} + +interface VideoFrameInit { + alpha?: AlphaOption; + displayHeight?: number; + displayWidth?: number; + duration?: number; + timestamp?: number; + visibleRect?: DOMRectInit; +} + +interface WaveShaperOptions extends AudioNodeOptions { + curve?: number[] | Float32Array; + oversample?: OverSampleType; +} + +interface WebGLContextAttributes { + alpha?: boolean; + antialias?: boolean; + depth?: boolean; + desynchronized?: boolean; + failIfMajorPerformanceCaveat?: boolean; + powerPreference?: WebGLPowerPreference; + premultipliedAlpha?: boolean; + preserveDrawingBuffer?: boolean; + stencil?: boolean; +} + +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; +} + +interface WebTransportCloseInfo { + closeCode?: number; + reason?: string; +} + +interface WebTransportErrorOptions { + source?: WebTransportErrorSource; + streamErrorCode?: number | null; +} + +interface WebTransportHash { + algorithm?: string; + value?: BufferSource; +} + +interface WebTransportOptions { + allowPooling?: boolean; + congestionControl?: WebTransportCongestionControl; + requireUnreliable?: boolean; + serverCertificateHashes?: WebTransportHash[]; +} + +interface WebTransportSendStreamOptions { + sendOrder?: number; +} + +interface WheelEventInit extends MouseEventInit { + deltaMode?: number; + deltaX?: number; + deltaY?: number; + deltaZ?: number; +} + +interface WindowPostMessageOptions extends StructuredSerializeOptions { + targetOrigin?: string; +} + +interface WorkerOptions { + credentials?: RequestCredentials; + name?: string; + type?: WorkerType; +} + +interface WorkletOptions { + credentials?: RequestCredentials; +} + +interface WriteParams { + data?: BufferSource | Blob | string | null; + position?: number | null; + size?: number | null; + type: WriteCommandType; +} + +type NodeFilter = ((node: Node) => number) | { acceptNode(node: Node): number; }; + +declare var NodeFilter: { + readonly FILTER_ACCEPT: 1; + readonly FILTER_REJECT: 2; + readonly FILTER_SKIP: 3; + readonly SHOW_ALL: 0xFFFFFFFF; + readonly SHOW_ELEMENT: 0x1; + readonly SHOW_ATTRIBUTE: 0x2; + readonly SHOW_TEXT: 0x4; + readonly SHOW_CDATA_SECTION: 0x8; + readonly SHOW_ENTITY_REFERENCE: 0x10; + readonly SHOW_ENTITY: 0x20; + readonly SHOW_PROCESSING_INSTRUCTION: 0x40; + readonly SHOW_COMMENT: 0x80; + readonly SHOW_DOCUMENT: 0x100; + readonly SHOW_DOCUMENT_TYPE: 0x200; + readonly SHOW_DOCUMENT_FRAGMENT: 0x400; + readonly SHOW_NOTATION: 0x800; +}; + +type XPathNSResolver = ((prefix: string | null) => string | null) | { lookupNamespaceURI(prefix: string | null): string | null; }; + +/** + * The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays) + */ +interface ANGLE_instanced_arrays { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawArraysInstancedANGLE) */ + drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawElementsInstancedANGLE) */ + drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/vertexAttribDivisorANGLE) */ + vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: 0x88FE; +} + +interface ARIAMixin { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaAtomic) */ + ariaAtomic: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaAutoComplete) */ + ariaAutoComplete: string | null; + ariaBrailleLabel: string | null; + ariaBrailleRoleDescription: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaBusy) */ + ariaBusy: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaChecked) */ + ariaChecked: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColCount) */ + ariaColCount: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColIndex) */ + ariaColIndex: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColSpan) */ + ariaColSpan: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaCurrent) */ + ariaCurrent: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDescription) */ + ariaDescription: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDisabled) */ + ariaDisabled: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaExpanded) */ + ariaExpanded: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaHasPopup) */ + ariaHasPopup: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaHidden) */ + ariaHidden: string | null; + ariaInvalid: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaKeyShortcuts) */ + ariaKeyShortcuts: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLabel) */ + ariaLabel: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLevel) */ + ariaLevel: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLive) */ + ariaLive: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaModal) */ + ariaModal: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaMultiLine) */ + ariaMultiLine: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaMultiSelectable) */ + ariaMultiSelectable: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaOrientation) */ + ariaOrientation: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPlaceholder) */ + ariaPlaceholder: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPosInSet) */ + ariaPosInSet: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPressed) */ + ariaPressed: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaReadOnly) */ + ariaReadOnly: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRequired) */ + ariaRequired: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRoleDescription) */ + ariaRoleDescription: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRowCount) */ + ariaRowCount: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRowIndex) */ + ariaRowIndex: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaRowSpan) */ + ariaRowSpan: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaSelected) */ + ariaSelected: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaSetSize) */ + ariaSetSize: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaSort) */ + ariaSort: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueMax) */ + ariaValueMax: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueMin) */ + ariaValueMin: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueNow) */ + ariaValueNow: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaValueText) */ + ariaValueText: string | null; + role: string | null; +} + +/** + * A controller object that allows you to abort one or more DOM requests as and when desired. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController) + */ +interface AbortController { + /** + * Returns the AbortSignal object associated with this object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal) + */ + readonly signal: AbortSignal; + /** + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort) + */ + abort(reason?: any): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignalEventMap { + "abort": Event; +} + +/** + * A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal) + */ +interface AbortSignal extends EventTarget { + /** + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted) + */ + readonly aborted: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */ + onabort: ((this: AbortSignal, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */ + readonly reason: any; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */ + throwIfAborted(): void; + addEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AbortSignal: { + prototype: AbortSignal; + new(): AbortSignal; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */ + abort(reason?: any): AbortSignal; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */ + any(signals: AbortSignal[]): AbortSignal; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */ + timeout(milliseconds: number): AbortSignal; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange) */ +interface AbstractRange { + /** + * Returns true if range is collapsed, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/collapsed) + */ + readonly collapsed: boolean; + /** + * Returns range's end node. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/endContainer) + */ + readonly endContainer: Node; + /** + * Returns range's end offset. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/endOffset) + */ + readonly endOffset: number; + /** + * Returns range's start node. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/startContainer) + */ + readonly startContainer: Node; + /** + * Returns range's start offset. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbstractRange/startOffset) + */ + readonly startOffset: number; +} + +declare var AbstractRange: { + prototype: AbstractRange; + new(): AbstractRange; +}; + +interface AbstractWorkerEventMap { + "error": ErrorEvent; +} + +interface AbstractWorker { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorker/error_event) */ + onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null; + addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +/** + * A node able to provide real-time frequency and time-domain analysis information. It is an AudioNode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio visualizations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode) + */ +interface AnalyserNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/fftSize) */ + fftSize: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/frequencyBinCount) */ + readonly frequencyBinCount: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/maxDecibels) */ + maxDecibels: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/minDecibels) */ + minDecibels: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/smoothingTimeConstant) */ + smoothingTimeConstant: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getByteFrequencyData) */ + getByteFrequencyData(array: Uint8Array): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getByteTimeDomainData) */ + getByteTimeDomainData(array: Uint8Array): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getFloatFrequencyData) */ + getFloatFrequencyData(array: Float32Array): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnalyserNode/getFloatTimeDomainData) */ + getFloatTimeDomainData(array: Float32Array): void; +} + +declare var AnalyserNode: { + prototype: AnalyserNode; + new(context: BaseAudioContext, options?: AnalyserOptions): AnalyserNode; +}; + +interface Animatable { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animate) */ + animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) */ + getAnimations(options?: GetAnimationsOptions): Animation[]; +} + +interface AnimationEventMap { + "cancel": AnimationPlaybackEvent; + "finish": AnimationPlaybackEvent; + "remove": Event; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation) */ +interface Animation extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/currentTime) */ + currentTime: CSSNumberish | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/effect) */ + effect: AnimationEffect | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/finished) */ + readonly finished: Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/id) */ + id: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/cancel_event) */ + oncancel: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/finish_event) */ + onfinish: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/remove_event) */ + onremove: ((this: Animation, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/pending) */ + readonly pending: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/playState) */ + readonly playState: AnimationPlayState; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/playbackRate) */ + playbackRate: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/ready) */ + readonly ready: Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/replaceState) */ + readonly replaceState: AnimationReplaceState; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/startTime) */ + startTime: CSSNumberish | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/timeline) */ + timeline: AnimationTimeline | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/cancel) */ + cancel(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/commitStyles) */ + commitStyles(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/finish) */ + finish(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/pause) */ + pause(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/persist) */ + persist(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/play) */ + play(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/reverse) */ + reverse(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/updatePlaybackRate) */ + updatePlaybackRate(playbackRate: number): void; + addEventListener(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var Animation: { + prototype: Animation; + new(effect?: AnimationEffect | null, timeline?: AnimationTimeline | null): Animation; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect) */ +interface AnimationEffect { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect/getComputedTiming) */ + getComputedTiming(): ComputedEffectTiming; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect/getTiming) */ + getTiming(): EffectTiming; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEffect/updateTiming) */ + updateTiming(timing?: OptionalEffectTiming): void; +} + +declare var AnimationEffect: { + prototype: AnimationEffect; + new(): AnimationEffect; +}; + +/** + * Events providing information related to animations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent) + */ +interface AnimationEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent/animationName) */ + readonly animationName: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent/elapsedTime) */ + readonly elapsedTime: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent/pseudoElement) */ + readonly pseudoElement: string; +} + +declare var AnimationEvent: { + prototype: AnimationEvent; + new(type: string, animationEventInitDict?: AnimationEventInit): AnimationEvent; +}; + +interface AnimationFrameProvider { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/cancelAnimationFrame) */ + cancelAnimationFrame(handle: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame) */ + requestAnimationFrame(callback: FrameRequestCallback): number; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationPlaybackEvent) */ +interface AnimationPlaybackEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationPlaybackEvent/currentTime) */ + readonly currentTime: CSSNumberish | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationPlaybackEvent/timelineTime) */ + readonly timelineTime: CSSNumberish | null; +} + +declare var AnimationPlaybackEvent: { + prototype: AnimationPlaybackEvent; + new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationTimeline) */ +interface AnimationTimeline { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationTimeline/currentTime) */ + readonly currentTime: CSSNumberish | null; +} + +declare var AnimationTimeline: { + prototype: AnimationTimeline; + new(): AnimationTimeline; +}; + +/** + * A DOM element's attribute as an object. In most DOM methods, you will probably directly retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g., Element.getAttributeNode()) or means of iterating give Attr types. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr) + */ +interface Attr extends Node { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/localName) */ + readonly localName: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/namespaceURI) */ + readonly namespaceURI: string | null; + readonly ownerDocument: Document; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/ownerElement) */ + readonly ownerElement: Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/prefix) */ + readonly prefix: string | null; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/specified) + */ + readonly specified: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Attr/value) */ + value: string; +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +}; + +/** + * A short audio asset residing in memory, created from an audio file using the AudioContext.decodeAudioData() method, or from raw data using AudioContext.createBuffer(). Once put into an AudioBuffer, the audio can then be played by being passed into an AudioBufferSourceNode. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer) + */ +interface AudioBuffer { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/duration) */ + readonly duration: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/length) */ + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/numberOfChannels) */ + readonly numberOfChannels: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/sampleRate) */ + readonly sampleRate: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/copyFromChannel) */ + copyFromChannel(destination: Float32Array, channelNumber: number, bufferOffset?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/copyToChannel) */ + copyToChannel(source: Float32Array, channelNumber: number, bufferOffset?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBuffer/getChannelData) */ + getChannelData(channel: number): Float32Array; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(options: AudioBufferOptions): AudioBuffer; +}; + +/** + * An AudioScheduledSourceNode which represents an audio source consisting of in-memory audio data, stored in an AudioBuffer. It's especially useful for playing back audio which has particularly stringent timing accuracy requirements, such as for sounds that must match a specific rhythm and can be kept in memory rather than being played from disk or the network. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode) + */ +interface AudioBufferSourceNode extends AudioScheduledSourceNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/buffer) */ + buffer: AudioBuffer | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/detune) */ + readonly detune: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/loop) */ + loop: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/loopEnd) */ + loopEnd: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/loopStart) */ + loopStart: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/playbackRate) */ + readonly playbackRate: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioBufferSourceNode/start) */ + start(when?: number, offset?: number, duration?: number): void; + addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioBufferSourceNode: { + prototype: AudioBufferSourceNode; + new(context: BaseAudioContext, options?: AudioBufferSourceOptions): AudioBufferSourceNode; +}; + +/** + * An audio-processing graph built from audio modules linked together, each represented by an AudioNode. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext) + */ +interface AudioContext extends BaseAudioContext { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/baseLatency) */ + readonly baseLatency: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/outputLatency) */ + readonly outputLatency: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/close) */ + close(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/createMediaElementSource) */ + createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/createMediaStreamDestination) */ + createMediaStreamDestination(): MediaStreamAudioDestinationNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/createMediaStreamSource) */ + createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/getOutputTimestamp) */ + getOutputTimestamp(): AudioTimestamp; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/resume) */ + resume(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioContext/suspend) */ + suspend(): Promise; + addEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioContext: { + prototype: AudioContext; + new(contextOptions?: AudioContextOptions): AudioContext; +}; + +/** + * AudioDestinationNode has no output (as it is the output, no more AudioNode can be linked after it in the audio graph) and one input. The number of channels in the input must be between 0 and the maxChannelCount value or an exception is raised. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDestinationNode) + */ +interface AudioDestinationNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDestinationNode/maxChannelCount) */ + readonly maxChannelCount: number; +} + +declare var AudioDestinationNode: { + prototype: AudioDestinationNode; + new(): AudioDestinationNode; +}; + +/** + * The position and orientation of the unique person listening to the audio scene, and is used in audio spatialization. All PannerNodes spatialize in relation to the AudioListener stored in the BaseAudioContext.listener attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener) + */ +interface AudioListener { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/forwardX) */ + readonly forwardX: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/forwardY) */ + readonly forwardY: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/forwardZ) */ + readonly forwardZ: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/positionX) */ + readonly positionX: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/positionY) */ + readonly positionY: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/positionZ) */ + readonly positionZ: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/upX) */ + readonly upX: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/upY) */ + readonly upY: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/upZ) */ + readonly upZ: AudioParam; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/setOrientation) + */ + setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioListener/setPosition) + */ + setPosition(x: number, y: number, z: number): void; +} + +declare var AudioListener: { + prototype: AudioListener; + new(): AudioListener; +}; + +/** + * A generic interface for representing an audio processing module. Examples include: + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode) + */ +interface AudioNode extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/channelCount) */ + channelCount: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/channelCountMode) */ + channelCountMode: ChannelCountMode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/channelInterpretation) */ + channelInterpretation: ChannelInterpretation; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/context) */ + readonly context: BaseAudioContext; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/numberOfInputs) */ + readonly numberOfInputs: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/numberOfOutputs) */ + readonly numberOfOutputs: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/connect) */ + connect(destinationNode: AudioNode, output?: number, input?: number): AudioNode; + connect(destinationParam: AudioParam, output?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect) */ + disconnect(): void; + disconnect(output: number): void; + disconnect(destinationNode: AudioNode): void; + disconnect(destinationNode: AudioNode, output: number): void; + disconnect(destinationNode: AudioNode, output: number, input: number): void; + disconnect(destinationParam: AudioParam): void; + disconnect(destinationParam: AudioParam, output: number): void; +} + +declare var AudioNode: { + prototype: AudioNode; + new(): AudioNode; +}; + +/** + * The Web Audio API's AudioParam interface represents an audio-related parameter, usually a parameter of an AudioNode (such as GainNode.gain). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam) + */ +interface AudioParam { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/automationRate) */ + automationRate: AutomationRate; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/defaultValue) */ + readonly defaultValue: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/maxValue) */ + readonly maxValue: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/minValue) */ + readonly minValue: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/value) */ + value: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/cancelAndHoldAtTime) */ + cancelAndHoldAtTime(cancelTime: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/cancelScheduledValues) */ + cancelScheduledValues(cancelTime: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/exponentialRampToValueAtTime) */ + exponentialRampToValueAtTime(value: number, endTime: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/linearRampToValueAtTime) */ + linearRampToValueAtTime(value: number, endTime: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/setTargetAtTime) */ + setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/setValueAtTime) */ + setValueAtTime(value: number, startTime: number): AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParam/setValueCurveAtTime) */ + setValueCurveAtTime(values: number[] | Float32Array, startTime: number, duration: number): AudioParam; +} + +declare var AudioParam: { + prototype: AudioParam; + new(): AudioParam; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioParamMap) */ +interface AudioParamMap { + forEach(callbackfn: (value: AudioParam, key: string, parent: AudioParamMap) => void, thisArg?: any): void; +} + +declare var AudioParamMap: { + prototype: AudioParamMap; + new(): AudioParamMap; +}; + +/** + * The Web Audio API events that occur when a ScriptProcessorNode input buffer is ready to be processed. + * @deprecated As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and is soon to be replaced by AudioWorklet. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioProcessingEvent) + */ +interface AudioProcessingEvent extends Event { + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioProcessingEvent/inputBuffer) + */ + readonly inputBuffer: AudioBuffer; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioProcessingEvent/outputBuffer) + */ + readonly outputBuffer: AudioBuffer; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioProcessingEvent/playbackTime) + */ + readonly playbackTime: number; +} + +/** @deprecated */ +declare var AudioProcessingEvent: { + prototype: AudioProcessingEvent; + new(type: string, eventInitDict: AudioProcessingEventInit): AudioProcessingEvent; +}; + +interface AudioScheduledSourceNodeEventMap { + "ended": Event; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode) */ +interface AudioScheduledSourceNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/ended_event) */ + onended: ((this: AudioScheduledSourceNode, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/start) */ + start(when?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/stop) */ + stop(when?: number): void; + addEventListener(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioScheduledSourceNode: { + prototype: AudioScheduledSourceNode; + new(): AudioScheduledSourceNode; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorklet) + */ +interface AudioWorklet extends Worklet { +} + +declare var AudioWorklet: { + prototype: AudioWorklet; + new(): AudioWorklet; +}; + +interface AudioWorkletNodeEventMap { + "processorerror": Event; +} + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode) + */ +interface AudioWorkletNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode/processorerror_event) */ + onprocessorerror: ((this: AudioWorkletNode, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode/parameters) */ + readonly parameters: AudioParamMap; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode/port) */ + readonly port: MessagePort; + addEventListener(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioWorkletNode: { + prototype: AudioWorkletNode; + new(context: BaseAudioContext, name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse) + */ +interface AuthenticatorAssertionResponse extends AuthenticatorResponse { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/authenticatorData) */ + readonly authenticatorData: ArrayBuffer; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/signature) */ + readonly signature: ArrayBuffer; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/userHandle) */ + readonly userHandle: ArrayBuffer | null; +} + +declare var AuthenticatorAssertionResponse: { + prototype: AuthenticatorAssertionResponse; + new(): AuthenticatorAssertionResponse; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse) + */ +interface AuthenticatorAttestationResponse extends AuthenticatorResponse { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/attestationObject) */ + readonly attestationObject: ArrayBuffer; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getAuthenticatorData) */ + getAuthenticatorData(): ArrayBuffer; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey) */ + getPublicKey(): ArrayBuffer | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKeyAlgorithm) */ + getPublicKeyAlgorithm(): COSEAlgorithmIdentifier; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getTransports) */ + getTransports(): string[]; +} + +declare var AuthenticatorAttestationResponse: { + prototype: AuthenticatorAttestationResponse; + new(): AuthenticatorAttestationResponse; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse) + */ +interface AuthenticatorResponse { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse/clientDataJSON) */ + readonly clientDataJSON: ArrayBuffer; +} + +declare var AuthenticatorResponse: { + prototype: AuthenticatorResponse; + new(): AuthenticatorResponse; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BarProp) */ +interface BarProp { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BarProp/visible) */ + readonly visible: boolean; +} + +declare var BarProp: { + prototype: BarProp; + new(): BarProp; +}; + +interface BaseAudioContextEventMap { + "statechange": Event; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext) */ +interface BaseAudioContext extends EventTarget { + /** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/audioWorklet) + */ + readonly audioWorklet: AudioWorklet; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/currentTime) */ + readonly currentTime: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/destination) */ + readonly destination: AudioDestinationNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/listener) */ + readonly listener: AudioListener; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/statechange_event) */ + onstatechange: ((this: BaseAudioContext, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/sampleRate) */ + readonly sampleRate: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/state) */ + readonly state: AudioContextState; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createAnalyser) */ + createAnalyser(): AnalyserNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBiquadFilter) */ + createBiquadFilter(): BiquadFilterNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBuffer) */ + createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createBufferSource) */ + createBufferSource(): AudioBufferSourceNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createChannelMerger) */ + createChannelMerger(numberOfInputs?: number): ChannelMergerNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createChannelSplitter) */ + createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createConstantSource) */ + createConstantSource(): ConstantSourceNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createConvolver) */ + createConvolver(): ConvolverNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createDelay) */ + createDelay(maxDelayTime?: number): DelayNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createDynamicsCompressor) */ + createDynamicsCompressor(): DynamicsCompressorNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createGain) */ + createGain(): GainNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createIIRFilter) */ + createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createOscillator) */ + createOscillator(): OscillatorNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPanner) */ + createPanner(): PannerNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createPeriodicWave) */ + createPeriodicWave(real: number[] | Float32Array, imag: number[] | Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createScriptProcessor) + */ + createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createStereoPanner) */ + createStereoPanner(): StereoPannerNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/createWaveShaper) */ + createWaveShaper(): WaveShaperNode; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/decodeAudioData) */ + decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback | null, errorCallback?: DecodeErrorCallback | null): Promise; + addEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var BaseAudioContext: { + prototype: BaseAudioContext; + new(): BaseAudioContext; +}; + +/** + * The beforeunload event is fired when the window, the document and its resources are about to be unloaded. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BeforeUnloadEvent) + */ +interface BeforeUnloadEvent extends Event { + /** @deprecated */ + returnValue: any; +} + +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +}; + +/** + * A simple low-order filter, and is created using the AudioContext.createBiquadFilter() method. It is an AudioNode that can represent different kinds of filters, tone control devices, and graphic equalizers. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode) + */ +interface BiquadFilterNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/Q) */ + readonly Q: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/detune) */ + readonly detune: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/frequency) */ + readonly frequency: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/gain) */ + readonly gain: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/type) */ + type: BiquadFilterType; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BiquadFilterNode/getFrequencyResponse) */ + getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; +} + +declare var BiquadFilterNode: { + prototype: BiquadFilterNode; + new(context: BaseAudioContext, options?: BiquadFilterOptions): BiquadFilterNode; +}; + +/** + * A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob) + */ +interface Blob { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */ + readonly size: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */ + readonly type: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */ + arrayBuffer(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */ + slice(start?: number, end?: number, contentType?: string): Blob; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */ + stream(): ReadableStream; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */ + text(): Promise; +} + +declare var Blob: { + prototype: Blob; + new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BlobEvent) */ +interface BlobEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BlobEvent/data) */ + readonly data: Blob; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BlobEvent/timecode) */ + readonly timecode: DOMHighResTimeStamp; +} + +declare var BlobEvent: { + prototype: BlobEvent; + new(type: string, eventInitDict: BlobEventInit): BlobEvent; +}; + +interface Body { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */ + readonly body: ReadableStream | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */ + readonly bodyUsed: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */ + arrayBuffer(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ + blob(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */ + formData(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */ + json(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */ + text(): Promise; +} + +interface BroadcastChannelEventMap { + "message": MessageEvent; + "messageerror": MessageEvent; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel) */ +interface BroadcastChannel extends EventTarget { + /** + * Returns the channel name (as passed to the constructor). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/name) + */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/message_event) */ + onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/messageerror_event) */ + onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; + /** + * Closes the BroadcastChannel object, opening it up to garbage collection. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/close) + */ + close(): void; + /** + * Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/postMessage) + */ + postMessage(message: any): void; + addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var BroadcastChannel: { + prototype: BroadcastChannel; + new(name: string): BroadcastChannel; +}; + +/** + * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy) + */ +interface ByteLengthQueuingStrategy extends QueuingStrategy { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */ + readonly highWaterMark: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */ + readonly size: QueuingStrategySize; +} + +declare var ByteLengthQueuingStrategy: { + prototype: ByteLengthQueuingStrategy; + new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; +}; + +/** + * A CDATA section that can be used within XML to include extended portions of unescaped text. The symbols < and & don’t need escaping as they normally do when inside a CDATA section. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CDATASection) + */ +interface CDATASection extends Text { +} + +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSAnimation) */ +interface CSSAnimation extends Animation { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSAnimation/animationName) */ + readonly animationName: string; + addEventListener(type: K, listener: (this: CSSAnimation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: CSSAnimation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var CSSAnimation: { + prototype: CSSAnimation; + new(): CSSAnimation; +}; + +/** + * A single condition CSS at-rule, which consists of a condition and a statement block. It is a child of CSSGroupingRule. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSConditionRule) + */ +interface CSSConditionRule extends CSSGroupingRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSConditionRule/conditionText) */ + readonly conditionText: string; +} + +declare var CSSConditionRule: { + prototype: CSSConditionRule; + new(): CSSConditionRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSContainerRule) */ +interface CSSContainerRule extends CSSConditionRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSContainerRule/containerName) */ + readonly containerName: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSContainerRule/containerQuery) */ + readonly containerQuery: string; +} + +declare var CSSContainerRule: { + prototype: CSSContainerRule; + new(): CSSContainerRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule) */ +interface CSSCounterStyleRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/additiveSymbols) */ + additiveSymbols: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/fallback) */ + fallback: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/name) */ + name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/negative) */ + negative: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/pad) */ + pad: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/prefix) */ + prefix: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/range) */ + range: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/speakAs) */ + speakAs: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/suffix) */ + suffix: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/symbols) */ + symbols: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSCounterStyleRule/system) */ + system: string; +} + +declare var CSSCounterStyleRule: { + prototype: CSSCounterStyleRule; + new(): CSSCounterStyleRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontFaceRule) */ +interface CSSFontFaceRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontFaceRule/style) */ + readonly style: CSSStyleDeclaration; +} + +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontFeatureValuesRule) */ +interface CSSFontFeatureValuesRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontFeatureValuesRule/fontFamily) */ + fontFamily: string; +} + +declare var CSSFontFeatureValuesRule: { + prototype: CSSFontFeatureValuesRule; + new(): CSSFontFeatureValuesRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontPaletteValuesRule) */ +interface CSSFontPaletteValuesRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontPaletteValuesRule/basePalette) */ + readonly basePalette: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontPaletteValuesRule/fontFamily) */ + readonly fontFamily: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontPaletteValuesRule/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSFontPaletteValuesRule/overrideColors) */ + readonly overrideColors: string; +} + +declare var CSSFontPaletteValuesRule: { + prototype: CSSFontPaletteValuesRule; + new(): CSSFontPaletteValuesRule; +}; + +/** + * Any CSS at-rule that contains other rules nested within it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSGroupingRule) + */ +interface CSSGroupingRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSGroupingRule/cssRules) */ + readonly cssRules: CSSRuleList; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSGroupingRule/deleteRule) */ + deleteRule(index: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSGroupingRule/insertRule) */ + insertRule(rule: string, index?: number): number; +} + +declare var CSSGroupingRule: { + prototype: CSSGroupingRule; + new(): CSSGroupingRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImageValue) */ +interface CSSImageValue extends CSSStyleValue { +} + +declare var CSSImageValue: { + prototype: CSSImageValue; + new(): CSSImageValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule) */ +interface CSSImportRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule/href) */ + readonly href: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule/layerName) */ + readonly layerName: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule/media) */ + readonly media: MediaList; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule/styleSheet) */ + readonly styleSheet: CSSStyleSheet | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImportRule/supportsText) */ + readonly supportsText: string | null; +} + +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +}; + +/** + * An object representing a set of style for a given keyframe. It corresponds to the contains of a single keyframe of a @keyframes at-rule. It implements the CSSRule interface with a type value of 8 (CSSRule.KEYFRAME_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframeRule) + */ +interface CSSKeyframeRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframeRule/keyText) */ + keyText: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframeRule/style) */ + readonly style: CSSStyleDeclaration; +} + +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +}; + +/** + * An object representing a complete set of keyframes for a CSS animation. It corresponds to the contains of a whole @keyframes at-rule. It implements the CSSRule interface with a type value of 7 (CSSRule.KEYFRAMES_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule) + */ +interface CSSKeyframesRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule/cssRules) */ + readonly cssRules: CSSRuleList; + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule/name) */ + name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule/appendRule) */ + appendRule(rule: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule/deleteRule) */ + deleteRule(select: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeyframesRule/findRule) */ + findRule(select: string): CSSKeyframeRule | null; + [index: number]: CSSKeyframeRule; +} + +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeywordValue) */ +interface CSSKeywordValue extends CSSStyleValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeywordValue/value) */ + value: string; +} + +declare var CSSKeywordValue: { + prototype: CSSKeywordValue; + new(value: string): CSSKeywordValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSLayerBlockRule) */ +interface CSSLayerBlockRule extends CSSGroupingRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSLayerBlockRule/name) */ + readonly name: string; +} + +declare var CSSLayerBlockRule: { + prototype: CSSLayerBlockRule; + new(): CSSLayerBlockRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSLayerStatementRule) */ +interface CSSLayerStatementRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSLayerStatementRule/nameList) */ + readonly nameList: ReadonlyArray; +} + +declare var CSSLayerStatementRule: { + prototype: CSSLayerStatementRule; + new(): CSSLayerStatementRule; +}; + +interface CSSMathClamp extends CSSMathValue { + readonly lower: CSSNumericValue; + readonly upper: CSSNumericValue; + readonly value: CSSNumericValue; +} + +declare var CSSMathClamp: { + prototype: CSSMathClamp; + new(lower: CSSNumberish, value: CSSNumberish, upper: CSSNumberish): CSSMathClamp; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathInvert) */ +interface CSSMathInvert extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathInvert/value) */ + readonly value: CSSNumericValue; +} + +declare var CSSMathInvert: { + prototype: CSSMathInvert; + new(arg: CSSNumberish): CSSMathInvert; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMax) */ +interface CSSMathMax extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMax/values) */ + readonly values: CSSNumericArray; +} + +declare var CSSMathMax: { + prototype: CSSMathMax; + new(...args: CSSNumberish[]): CSSMathMax; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMin) */ +interface CSSMathMin extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMin/values) */ + readonly values: CSSNumericArray; +} + +declare var CSSMathMin: { + prototype: CSSMathMin; + new(...args: CSSNumberish[]): CSSMathMin; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathNegate) */ +interface CSSMathNegate extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathNegate/value) */ + readonly value: CSSNumericValue; +} + +declare var CSSMathNegate: { + prototype: CSSMathNegate; + new(arg: CSSNumberish): CSSMathNegate; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathProduct) */ +interface CSSMathProduct extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathProduct/values) */ + readonly values: CSSNumericArray; +} + +declare var CSSMathProduct: { + prototype: CSSMathProduct; + new(...args: CSSNumberish[]): CSSMathProduct; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathSum) */ +interface CSSMathSum extends CSSMathValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathSum/values) */ + readonly values: CSSNumericArray; +} + +declare var CSSMathSum: { + prototype: CSSMathSum; + new(...args: CSSNumberish[]): CSSMathSum; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathValue) */ +interface CSSMathValue extends CSSNumericValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathValue/operator) */ + readonly operator: CSSMathOperator; +} + +declare var CSSMathValue: { + prototype: CSSMathValue; + new(): CSSMathValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMatrixComponent) */ +interface CSSMatrixComponent extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMatrixComponent/matrix) */ + matrix: DOMMatrix; +} + +declare var CSSMatrixComponent: { + prototype: CSSMatrixComponent; + new(matrix: DOMMatrixReadOnly, options?: CSSMatrixComponentOptions): CSSMatrixComponent; +}; + +/** + * A single CSS @media rule. It implements the CSSConditionRule interface, and therefore the CSSGroupingRule and the CSSRule interface with a type value of 4 (CSSRule.MEDIA_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMediaRule) + */ +interface CSSMediaRule extends CSSConditionRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMediaRule/media) */ + readonly media: MediaList; +} + +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +}; + +/** + * An object representing a single CSS @namespace at-rule. It implements the CSSRule interface, with a type value of 10 (CSSRule.NAMESPACE_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNamespaceRule) + */ +interface CSSNamespaceRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNamespaceRule/namespaceURI) */ + readonly namespaceURI: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNamespaceRule/prefix) */ + readonly prefix: string; +} + +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericArray) */ +interface CSSNumericArray { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericArray/length) */ + readonly length: number; + forEach(callbackfn: (value: CSSNumericValue, key: number, parent: CSSNumericArray) => void, thisArg?: any): void; + [index: number]: CSSNumericValue; +} + +declare var CSSNumericArray: { + prototype: CSSNumericArray; + new(): CSSNumericArray; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue) */ +interface CSSNumericValue extends CSSStyleValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/add) */ + add(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/div) */ + div(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/equals) */ + equals(...value: CSSNumberish[]): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/max) */ + max(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/min) */ + min(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/mul) */ + mul(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/sub) */ + sub(...values: CSSNumberish[]): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/to) */ + to(unit: string): CSSUnitValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/toSum) */ + toSum(...units: string[]): CSSMathSum; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/type) */ + type(): CSSNumericType; +} + +declare var CSSNumericValue: { + prototype: CSSNumericValue; + new(): CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/parse_static) */ + parse(cssText: string): CSSNumericValue; +}; + +/** + * CSSPageRule is an interface representing a single CSS @page rule. It implements the CSSRule interface with a type value of 6 (CSSRule.PAGE_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPageRule) + */ +interface CSSPageRule extends CSSGroupingRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPageRule/selectorText) */ + selectorText: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPageRule/style) */ + readonly style: CSSStyleDeclaration; +} + +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPerspective) */ +interface CSSPerspective extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPerspective/length) */ + length: CSSPerspectiveValue; +} + +declare var CSSPerspective: { + prototype: CSSPerspective; + new(length: CSSPerspectiveValue): CSSPerspective; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPropertyRule) */ +interface CSSPropertyRule extends CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/inherits) */ + readonly inherits: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/initialValue) */ + readonly initialValue: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPropertyRule/syntax) */ + readonly syntax: string; +} + +declare var CSSPropertyRule: { + prototype: CSSPropertyRule; + new(): CSSPropertyRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate) */ +interface CSSRotate extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/angle) */ + angle: CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/x) */ + x: CSSNumberish; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/y) */ + y: CSSNumberish; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/z) */ + z: CSSNumberish; +} + +declare var CSSRotate: { + prototype: CSSRotate; + new(angle: CSSNumericValue): CSSRotate; + new(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish, angle: CSSNumericValue): CSSRotate; +}; + +/** + * A single CSS rule. There are several types of rules, listed in the Type constants section below. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule) + */ +interface CSSRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/cssText) */ + cssText: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/parentRule) */ + readonly parentRule: CSSRule | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/parentStyleSheet) */ + readonly parentStyleSheet: CSSStyleSheet | null; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/type) + */ + readonly type: number; + readonly STYLE_RULE: 1; + readonly CHARSET_RULE: 2; + readonly IMPORT_RULE: 3; + readonly MEDIA_RULE: 4; + readonly FONT_FACE_RULE: 5; + readonly PAGE_RULE: 6; + readonly NAMESPACE_RULE: 10; + readonly KEYFRAMES_RULE: 7; + readonly KEYFRAME_RULE: 8; + readonly SUPPORTS_RULE: 12; + readonly COUNTER_STYLE_RULE: 11; + readonly FONT_FEATURE_VALUES_RULE: 14; +} + +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + readonly STYLE_RULE: 1; + readonly CHARSET_RULE: 2; + readonly IMPORT_RULE: 3; + readonly MEDIA_RULE: 4; + readonly FONT_FACE_RULE: 5; + readonly PAGE_RULE: 6; + readonly NAMESPACE_RULE: 10; + readonly KEYFRAMES_RULE: 7; + readonly KEYFRAME_RULE: 8; + readonly SUPPORTS_RULE: 12; + readonly COUNTER_STYLE_RULE: 11; + readonly FONT_FEATURE_VALUES_RULE: 14; +}; + +/** + * A CSSRuleList is an (indirect-modify only) array-like object containing an ordered collection of CSSRule objects. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRuleList) + */ +interface CSSRuleList { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRuleList/length) */ + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRuleList/item) */ + item(index: number): CSSRule | null; + [index: number]: CSSRule; +} + +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale) */ +interface CSSScale extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale/x) */ + x: CSSNumberish; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale/y) */ + y: CSSNumberish; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale/z) */ + z: CSSNumberish; +} + +declare var CSSScale: { + prototype: CSSScale; + new(x: CSSNumberish, y: CSSNumberish, z?: CSSNumberish): CSSScale; +}; + +interface CSSScopeRule extends CSSGroupingRule { + readonly end: string | null; + readonly start: string | null; +} + +declare var CSSScopeRule: { + prototype: CSSScopeRule; + new(): CSSScopeRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew) */ +interface CSSSkew extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew/ax) */ + ax: CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew/ay) */ + ay: CSSNumericValue; +} + +declare var CSSSkew: { + prototype: CSSSkew; + new(ax: CSSNumericValue, ay: CSSNumericValue): CSSSkew; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewX) */ +interface CSSSkewX extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewX/ax) */ + ax: CSSNumericValue; +} + +declare var CSSSkewX: { + prototype: CSSSkewX; + new(ax: CSSNumericValue): CSSSkewX; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewY) */ +interface CSSSkewY extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewY/ay) */ + ay: CSSNumericValue; +} + +declare var CSSSkewY: { + prototype: CSSSkewY; + new(ay: CSSNumericValue): CSSSkewY; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStartingStyleRule) */ +interface CSSStartingStyleRule extends CSSGroupingRule { +} + +declare var CSSStartingStyleRule: { + prototype: CSSStartingStyleRule; + new(): CSSStartingStyleRule; +}; + +/** + * An object that is a CSS declaration block, and exposes style information and various style-related methods and properties. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration) + */ +interface CSSStyleDeclaration { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/accent-color) */ + accentColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-content) */ + alignContent: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-items) */ + alignItems: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-self) */ + alignSelf: string; + alignmentBaseline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/all) */ + all: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation) */ + animation: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-composition) */ + animationComposition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-delay) */ + animationDelay: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-direction) */ + animationDirection: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-duration) */ + animationDuration: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-fill-mode) */ + animationFillMode: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-iteration-count) */ + animationIterationCount: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-name) */ + animationName: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-play-state) */ + animationPlayState: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-timing-function) */ + animationTimingFunction: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/appearance) */ + appearance: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/aspect-ratio) */ + aspectRatio: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/backdrop-filter) */ + backdropFilter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/backface-visibility) */ + backfaceVisibility: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background) */ + background: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-attachment) */ + backgroundAttachment: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-blend-mode) */ + backgroundBlendMode: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-clip) */ + backgroundClip: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-color) */ + backgroundColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-image) */ + backgroundImage: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-origin) */ + backgroundOrigin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-position) */ + backgroundPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-position-x) */ + backgroundPositionX: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-position-y) */ + backgroundPositionY: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-repeat) */ + backgroundRepeat: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-size) */ + backgroundSize: string; + baselineShift: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/baseline-source) */ + baselineSource: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/block-size) */ + blockSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border) */ + border: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block) */ + borderBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-color) */ + borderBlockColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-end) */ + borderBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-end-color) */ + borderBlockEndColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-end-style) */ + borderBlockEndStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-end-width) */ + borderBlockEndWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-start) */ + borderBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-start-color) */ + borderBlockStartColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-start-style) */ + borderBlockStartStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-start-width) */ + borderBlockStartWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-style) */ + borderBlockStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-block-width) */ + borderBlockWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom) */ + borderBottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-color) */ + borderBottomColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-left-radius) */ + borderBottomLeftRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-right-radius) */ + borderBottomRightRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-style) */ + borderBottomStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-width) */ + borderBottomWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-collapse) */ + borderCollapse: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-color) */ + borderColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-end-end-radius) */ + borderEndEndRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-end-start-radius) */ + borderEndStartRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image) */ + borderImage: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image-outset) */ + borderImageOutset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image-repeat) */ + borderImageRepeat: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image-slice) */ + borderImageSlice: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image-source) */ + borderImageSource: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-image-width) */ + borderImageWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline) */ + borderInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-color) */ + borderInlineColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-end) */ + borderInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-end-color) */ + borderInlineEndColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-end-style) */ + borderInlineEndStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-end-width) */ + borderInlineEndWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-start) */ + borderInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-start-color) */ + borderInlineStartColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-start-style) */ + borderInlineStartStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-start-width) */ + borderInlineStartWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-style) */ + borderInlineStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-inline-width) */ + borderInlineWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-left) */ + borderLeft: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-left-color) */ + borderLeftColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-left-style) */ + borderLeftStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-left-width) */ + borderLeftWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-radius) */ + borderRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-right) */ + borderRight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-right-color) */ + borderRightColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-right-style) */ + borderRightStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-right-width) */ + borderRightWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-spacing) */ + borderSpacing: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-start-end-radius) */ + borderStartEndRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-start-start-radius) */ + borderStartStartRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-style) */ + borderStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top) */ + borderTop: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-color) */ + borderTopColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-left-radius) */ + borderTopLeftRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-right-radius) */ + borderTopRightRadius: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-style) */ + borderTopStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-width) */ + borderTopWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-width) */ + borderWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/bottom) */ + bottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-shadow) */ + boxShadow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-sizing) */ + boxSizing: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/break-after) */ + breakAfter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/break-before) */ + breakBefore: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/break-inside) */ + breakInside: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/caption-side) */ + captionSide: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/caret-color) */ + caretColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/clear) */ + clear: string; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/clip) + */ + clip: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/clip-path) */ + clipPath: string; + clipRule: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/color) */ + color: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/color-interpolation) */ + colorInterpolation: string; + colorInterpolationFilters: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/color-scheme) */ + colorScheme: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-count) */ + columnCount: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-fill) */ + columnFill: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-gap) */ + columnGap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-rule) */ + columnRule: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-rule-color) */ + columnRuleColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-rule-style) */ + columnRuleStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-rule-width) */ + columnRuleWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-span) */ + columnSpan: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/column-width) */ + columnWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/columns) */ + columns: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain) */ + contain: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-contain-intrinsic-block-size) */ + containIntrinsicBlockSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-height) */ + containIntrinsicHeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-contain-intrinsic-inline-size) */ + containIntrinsicInlineSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-size) */ + containIntrinsicSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-width) */ + containIntrinsicWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/container) */ + container: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/container-name) */ + containerName: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/container-type) */ + containerType: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/content) */ + content: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/content-visibility) */ + contentVisibility: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/counter-increment) */ + counterIncrement: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/counter-reset) */ + counterReset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/counter-set) */ + counterSet: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/cssFloat) */ + cssFloat: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/cssText) */ + cssText: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/cursor) */ + cursor: string; + cx: string; + cy: string; + d: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/direction) */ + direction: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/display) */ + display: string; + dominantBaseline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/empty-cells) */ + emptyCells: string; + fill: string; + fillOpacity: string; + fillRule: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/filter) */ + filter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex) */ + flex: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-basis) */ + flexBasis: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-direction) */ + flexDirection: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-flow) */ + flexFlow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-grow) */ + flexGrow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-shrink) */ + flexShrink: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-wrap) */ + flexWrap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/float) */ + float: string; + floodColor: string; + floodOpacity: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font) */ + font: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-family) */ + fontFamily: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-feature-settings) */ + fontFeatureSettings: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-kerning) */ + fontKerning: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-optical-sizing) */ + fontOpticalSizing: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-palette) */ + fontPalette: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-size) */ + fontSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-size-adjust) */ + fontSizeAdjust: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-stretch) */ + fontStretch: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-style) */ + fontStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-synthesis) */ + fontSynthesis: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-synthesis-small-caps) */ + fontSynthesisSmallCaps: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-synthesis-style) */ + fontSynthesisStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-synthesis-weight) */ + fontSynthesisWeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant) */ + fontVariant: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-alternates) */ + fontVariantAlternates: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-caps) */ + fontVariantCaps: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-east-asian) */ + fontVariantEastAsian: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-ligatures) */ + fontVariantLigatures: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-numeric) */ + fontVariantNumeric: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variant-position) */ + fontVariantPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-variation-settings) */ + fontVariationSettings: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/font-weight) */ + fontWeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/forced-color-adjust) */ + forcedColorAdjust: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/gap) */ + gap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid) */ + grid: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-area) */ + gridArea: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-auto-columns) */ + gridAutoColumns: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-auto-flow) */ + gridAutoFlow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-auto-rows) */ + gridAutoRows: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-column) */ + gridColumn: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-column-end) */ + gridColumnEnd: string; + /** @deprecated This is a legacy alias of `columnGap`. */ + gridColumnGap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-column-start) */ + gridColumnStart: string; + /** @deprecated This is a legacy alias of `gap`. */ + gridGap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-row) */ + gridRow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-row-end) */ + gridRowEnd: string; + /** @deprecated This is a legacy alias of `rowGap`. */ + gridRowGap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-row-start) */ + gridRowStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-template) */ + gridTemplate: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-template-areas) */ + gridTemplateAreas: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-template-columns) */ + gridTemplateColumns: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/grid-template-rows) */ + gridTemplateRows: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/height) */ + height: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/hyphenate-character) */ + hyphenateCharacter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/hyphens) */ + hyphens: string; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/image-orientation) + */ + imageOrientation: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/image-rendering) */ + imageRendering: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inline-size) */ + inlineSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset) */ + inset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-block) */ + insetBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-block-end) */ + insetBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-block-start) */ + insetBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-inline) */ + insetInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-inline-end) */ + insetInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/inset-inline-start) */ + insetInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/isolation) */ + isolation: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/justify-content) */ + justifyContent: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/justify-items) */ + justifyItems: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/justify-self) */ + justifySelf: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/left) */ + left: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/length) */ + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/letter-spacing) */ + letterSpacing: string; + lightingColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/line-break) */ + lineBreak: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/line-height) */ + lineHeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/list-style) */ + listStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/list-style-image) */ + listStyleImage: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/list-style-position) */ + listStylePosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/list-style-type) */ + listStyleType: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin) */ + margin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-block) */ + marginBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-block-end) */ + marginBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-block-start) */ + marginBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-bottom) */ + marginBottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-inline) */ + marginInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-inline-end) */ + marginInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-inline-start) */ + marginInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-left) */ + marginLeft: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-right) */ + marginRight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/margin-top) */ + marginTop: string; + marker: string; + markerEnd: string; + markerMid: string; + markerStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask) */ + mask: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-clip) */ + maskClip: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-composite) */ + maskComposite: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-image) */ + maskImage: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-mode) */ + maskMode: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-origin) */ + maskOrigin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-position) */ + maskPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-repeat) */ + maskRepeat: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-size) */ + maskSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-type) */ + maskType: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/math-depth) */ + mathDepth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/math-style) */ + mathStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/max-block-size) */ + maxBlockSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/max-height) */ + maxHeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/max-inline-size) */ + maxInlineSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/max-width) */ + maxWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/min-block-size) */ + minBlockSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/min-height) */ + minHeight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/min-inline-size) */ + minInlineSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/min-width) */ + minWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mix-blend-mode) */ + mixBlendMode: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/object-fit) */ + objectFit: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/object-position) */ + objectPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset) */ + offset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset-anchor) */ + offsetAnchor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset-distance) */ + offsetDistance: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset-path) */ + offsetPath: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset-position) */ + offsetPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/offset-rotate) */ + offsetRotate: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/opacity) */ + opacity: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/order) */ + order: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/orphans) */ + orphans: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/outline) */ + outline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/outline-color) */ + outlineColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/outline-offset) */ + outlineOffset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/outline-style) */ + outlineStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/outline-width) */ + outlineWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow) */ + overflow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow-anchor) */ + overflowAnchor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow-clip-margin) */ + overflowClipMargin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow-wrap) */ + overflowWrap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow-x) */ + overflowX: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overflow-y) */ + overflowY: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior) */ + overscrollBehavior: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-block) */ + overscrollBehaviorBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-inline) */ + overscrollBehaviorInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-x) */ + overscrollBehaviorX: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-y) */ + overscrollBehaviorY: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding) */ + padding: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-block) */ + paddingBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-block-end) */ + paddingBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-block-start) */ + paddingBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-bottom) */ + paddingBottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-inline) */ + paddingInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-inline-end) */ + paddingInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-inline-start) */ + paddingInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-left) */ + paddingLeft: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-right) */ + paddingRight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/padding-top) */ + paddingTop: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page) */ + page: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-after) */ + pageBreakAfter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-before) */ + pageBreakBefore: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/page-break-inside) */ + pageBreakInside: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/paint-order) */ + paintOrder: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/parentRule) */ + readonly parentRule: CSSRule | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/perspective) */ + perspective: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/perspective-origin) */ + perspectiveOrigin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/place-content) */ + placeContent: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/place-items) */ + placeItems: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/place-self) */ + placeSelf: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/pointer-events) */ + pointerEvents: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/position) */ + position: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/print-color-adjust) */ + printColorAdjust: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/quotes) */ + quotes: string; + r: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/resize) */ + resize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/right) */ + right: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/rotate) */ + rotate: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/row-gap) */ + rowGap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/ruby-position) */ + rubyPosition: string; + rx: string; + ry: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scale) */ + scale: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-behavior) */ + scrollBehavior: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin) */ + scrollMargin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block) */ + scrollMarginBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block-end) */ + scrollMarginBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block-start) */ + scrollMarginBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-bottom) */ + scrollMarginBottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline) */ + scrollMarginInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline-end) */ + scrollMarginInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline-start) */ + scrollMarginInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-left) */ + scrollMarginLeft: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-right) */ + scrollMarginRight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-margin-top) */ + scrollMarginTop: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding) */ + scrollPadding: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block) */ + scrollPaddingBlock: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block-end) */ + scrollPaddingBlockEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block-start) */ + scrollPaddingBlockStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-bottom) */ + scrollPaddingBottom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline) */ + scrollPaddingInline: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline-end) */ + scrollPaddingInlineEnd: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline-start) */ + scrollPaddingInlineStart: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-left) */ + scrollPaddingLeft: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-right) */ + scrollPaddingRight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-padding-top) */ + scrollPaddingTop: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-snap-align) */ + scrollSnapAlign: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-snap-stop) */ + scrollSnapStop: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scroll-snap-type) */ + scrollSnapType: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scrollbar-color) */ + scrollbarColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scrollbar-gutter) */ + scrollbarGutter: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/scrollbar-width) */ + scrollbarWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/shape-image-threshold) */ + shapeImageThreshold: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/shape-margin) */ + shapeMargin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/shape-outside) */ + shapeOutside: string; + shapeRendering: string; + stopColor: string; + stopOpacity: string; + stroke: string; + strokeDasharray: string; + strokeDashoffset: string; + strokeLinecap: string; + strokeLinejoin: string; + strokeMiterlimit: string; + strokeOpacity: string; + strokeWidth: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/tab-size) */ + tabSize: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/table-layout) */ + tableLayout: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-align) */ + textAlign: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-align-last) */ + textAlignLast: string; + textAnchor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-combine-upright) */ + textCombineUpright: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration) */ + textDecoration: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration-color) */ + textDecorationColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration-line) */ + textDecorationLine: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip-ink) */ + textDecorationSkipInk: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration-style) */ + textDecorationStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-decoration-thickness) */ + textDecorationThickness: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-emphasis) */ + textEmphasis: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-emphasis-color) */ + textEmphasisColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-emphasis-position) */ + textEmphasisPosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-emphasis-style) */ + textEmphasisStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-indent) */ + textIndent: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-orientation) */ + textOrientation: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-overflow) */ + textOverflow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-rendering) */ + textRendering: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-shadow) */ + textShadow: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-transform) */ + textTransform: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-underline-offset) */ + textUnderlineOffset: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-underline-position) */ + textUnderlinePosition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-wrap) */ + textWrap: string; + textWrapMode: string; + textWrapStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/top) */ + top: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/touch-action) */ + touchAction: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform) */ + transform: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform-box) */ + transformBox: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform-origin) */ + transformOrigin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform-style) */ + transformStyle: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition) */ + transition: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-behavior) */ + transitionBehavior: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-delay) */ + transitionDelay: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-duration) */ + transitionDuration: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-property) */ + transitionProperty: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-timing-function) */ + transitionTimingFunction: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/translate) */ + translate: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/unicode-bidi) */ + unicodeBidi: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/user-select) */ + userSelect: string; + vectorEffect: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/vertical-align) */ + verticalAlign: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/visibility) */ + visibility: string; + /** + * @deprecated This is a legacy alias of `alignContent`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-content) + */ + webkitAlignContent: string; + /** + * @deprecated This is a legacy alias of `alignItems`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-items) + */ + webkitAlignItems: string; + /** + * @deprecated This is a legacy alias of `alignSelf`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/align-self) + */ + webkitAlignSelf: string; + /** + * @deprecated This is a legacy alias of `animation`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation) + */ + webkitAnimation: string; + /** + * @deprecated This is a legacy alias of `animationDelay`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-delay) + */ + webkitAnimationDelay: string; + /** + * @deprecated This is a legacy alias of `animationDirection`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-direction) + */ + webkitAnimationDirection: string; + /** + * @deprecated This is a legacy alias of `animationDuration`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-duration) + */ + webkitAnimationDuration: string; + /** + * @deprecated This is a legacy alias of `animationFillMode`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-fill-mode) + */ + webkitAnimationFillMode: string; + /** + * @deprecated This is a legacy alias of `animationIterationCount`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-iteration-count) + */ + webkitAnimationIterationCount: string; + /** + * @deprecated This is a legacy alias of `animationName`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-name) + */ + webkitAnimationName: string; + /** + * @deprecated This is a legacy alias of `animationPlayState`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-play-state) + */ + webkitAnimationPlayState: string; + /** + * @deprecated This is a legacy alias of `animationTimingFunction`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/animation-timing-function) + */ + webkitAnimationTimingFunction: string; + /** + * @deprecated This is a legacy alias of `appearance`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/appearance) + */ + webkitAppearance: string; + /** + * @deprecated This is a legacy alias of `backfaceVisibility`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/backface-visibility) + */ + webkitBackfaceVisibility: string; + /** + * @deprecated This is a legacy alias of `backgroundClip`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-clip) + */ + webkitBackgroundClip: string; + /** + * @deprecated This is a legacy alias of `backgroundOrigin`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-origin) + */ + webkitBackgroundOrigin: string; + /** + * @deprecated This is a legacy alias of `backgroundSize`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/background-size) + */ + webkitBackgroundSize: string; + /** + * @deprecated This is a legacy alias of `borderBottomLeftRadius`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-left-radius) + */ + webkitBorderBottomLeftRadius: string; + /** + * @deprecated This is a legacy alias of `borderBottomRightRadius`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-bottom-right-radius) + */ + webkitBorderBottomRightRadius: string; + /** + * @deprecated This is a legacy alias of `borderRadius`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-radius) + */ + webkitBorderRadius: string; + /** + * @deprecated This is a legacy alias of `borderTopLeftRadius`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-left-radius) + */ + webkitBorderTopLeftRadius: string; + /** + * @deprecated This is a legacy alias of `borderTopRightRadius`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/border-top-right-radius) + */ + webkitBorderTopRightRadius: string; + /** + * @deprecated This is a legacy alias of `boxAlign`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-align) + */ + webkitBoxAlign: string; + /** + * @deprecated This is a legacy alias of `boxFlex`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-flex) + */ + webkitBoxFlex: string; + /** + * @deprecated This is a legacy alias of `boxOrdinalGroup`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-ordinal-group) + */ + webkitBoxOrdinalGroup: string; + /** + * @deprecated This is a legacy alias of `boxOrient`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-orient) + */ + webkitBoxOrient: string; + /** + * @deprecated This is a legacy alias of `boxPack`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-pack) + */ + webkitBoxPack: string; + /** + * @deprecated This is a legacy alias of `boxShadow`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-shadow) + */ + webkitBoxShadow: string; + /** + * @deprecated This is a legacy alias of `boxSizing`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/box-sizing) + */ + webkitBoxSizing: string; + /** + * @deprecated This is a legacy alias of `filter`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/filter) + */ + webkitFilter: string; + /** + * @deprecated This is a legacy alias of `flex`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex) + */ + webkitFlex: string; + /** + * @deprecated This is a legacy alias of `flexBasis`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-basis) + */ + webkitFlexBasis: string; + /** + * @deprecated This is a legacy alias of `flexDirection`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-direction) + */ + webkitFlexDirection: string; + /** + * @deprecated This is a legacy alias of `flexFlow`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-flow) + */ + webkitFlexFlow: string; + /** + * @deprecated This is a legacy alias of `flexGrow`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-grow) + */ + webkitFlexGrow: string; + /** + * @deprecated This is a legacy alias of `flexShrink`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-shrink) + */ + webkitFlexShrink: string; + /** + * @deprecated This is a legacy alias of `flexWrap`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/flex-wrap) + */ + webkitFlexWrap: string; + /** + * @deprecated This is a legacy alias of `justifyContent`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/justify-content) + */ + webkitJustifyContent: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/-webkit-line-clamp) */ + webkitLineClamp: string; + /** + * @deprecated This is a legacy alias of `mask`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask) + */ + webkitMask: string; + /** + * @deprecated This is a legacy alias of `maskBorder`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border) + */ + webkitMaskBoxImage: string; + /** + * @deprecated This is a legacy alias of `maskBorderOutset`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border-outset) + */ + webkitMaskBoxImageOutset: string; + /** + * @deprecated This is a legacy alias of `maskBorderRepeat`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border-repeat) + */ + webkitMaskBoxImageRepeat: string; + /** + * @deprecated This is a legacy alias of `maskBorderSlice`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border-slice) + */ + webkitMaskBoxImageSlice: string; + /** + * @deprecated This is a legacy alias of `maskBorderSource`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border-source) + */ + webkitMaskBoxImageSource: string; + /** + * @deprecated This is a legacy alias of `maskBorderWidth`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-border-width) + */ + webkitMaskBoxImageWidth: string; + /** + * @deprecated This is a legacy alias of `maskClip`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-clip) + */ + webkitMaskClip: string; + /** + * @deprecated This is a legacy alias of `maskComposite`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-composite) + */ + webkitMaskComposite: string; + /** + * @deprecated This is a legacy alias of `maskImage`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-image) + */ + webkitMaskImage: string; + /** + * @deprecated This is a legacy alias of `maskOrigin`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-origin) + */ + webkitMaskOrigin: string; + /** + * @deprecated This is a legacy alias of `maskPosition`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-position) + */ + webkitMaskPosition: string; + /** + * @deprecated This is a legacy alias of `maskRepeat`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-repeat) + */ + webkitMaskRepeat: string; + /** + * @deprecated This is a legacy alias of `maskSize`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/mask-size) + */ + webkitMaskSize: string; + /** + * @deprecated This is a legacy alias of `order`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/order) + */ + webkitOrder: string; + /** + * @deprecated This is a legacy alias of `perspective`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/perspective) + */ + webkitPerspective: string; + /** + * @deprecated This is a legacy alias of `perspectiveOrigin`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/perspective-origin) + */ + webkitPerspectiveOrigin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/-webkit-text-fill-color) */ + webkitTextFillColor: string; + /** + * @deprecated This is a legacy alias of `textSizeAdjust`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/text-size-adjust) + */ + webkitTextSizeAdjust: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/-webkit-text-stroke) */ + webkitTextStroke: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/-webkit-text-stroke-color) */ + webkitTextStrokeColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/-webkit-text-stroke-width) */ + webkitTextStrokeWidth: string; + /** + * @deprecated This is a legacy alias of `transform`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform) + */ + webkitTransform: string; + /** + * @deprecated This is a legacy alias of `transformOrigin`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform-origin) + */ + webkitTransformOrigin: string; + /** + * @deprecated This is a legacy alias of `transformStyle`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transform-style) + */ + webkitTransformStyle: string; + /** + * @deprecated This is a legacy alias of `transition`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition) + */ + webkitTransition: string; + /** + * @deprecated This is a legacy alias of `transitionDelay`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-delay) + */ + webkitTransitionDelay: string; + /** + * @deprecated This is a legacy alias of `transitionDuration`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-duration) + */ + webkitTransitionDuration: string; + /** + * @deprecated This is a legacy alias of `transitionProperty`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-property) + */ + webkitTransitionProperty: string; + /** + * @deprecated This is a legacy alias of `transitionTimingFunction`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/transition-timing-function) + */ + webkitTransitionTimingFunction: string; + /** + * @deprecated This is a legacy alias of `userSelect`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/user-select) + */ + webkitUserSelect: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/white-space) */ + whiteSpace: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/white-space-collapse) */ + whiteSpaceCollapse: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/widows) */ + widows: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/width) */ + width: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/will-change) */ + willChange: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/word-break) */ + wordBreak: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/word-spacing) */ + wordSpacing: string; + /** @deprecated */ + wordWrap: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/writing-mode) */ + writingMode: string; + x: string; + y: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/z-index) */ + zIndex: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/zoom) */ + zoom: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyPriority) */ + getPropertyPriority(property: string): string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyValue) */ + getPropertyValue(property: string): string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/item) */ + item(index: number): string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/removeProperty) */ + removeProperty(property: string): string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/setProperty) */ + setProperty(property: string, value: string | null, priority?: string): void; + [index: number]: string; +} + +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +}; + +/** + * CSSStyleRule represents a single CSS style rule. It implements the CSSRule interface with a type value of 1 (CSSRule.STYLE_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleRule) + */ +interface CSSStyleRule extends CSSGroupingRule { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleRule/selectorText) */ + selectorText: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleRule/style) */ + readonly style: CSSStyleDeclaration; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleRule/styleMap) */ + readonly styleMap: StylePropertyMap; +} + +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +}; + +/** + * A single CSS style sheet. It inherits properties and methods from its parent, StyleSheet. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet) + */ +interface CSSStyleSheet extends StyleSheet { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/cssRules) */ + readonly cssRules: CSSRuleList; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/ownerRule) */ + readonly ownerRule: CSSRule | null; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/rules) + */ + readonly rules: CSSRuleList; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/addRule) + */ + addRule(selector?: string, style?: string, index?: number): number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/deleteRule) */ + deleteRule(index: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/insertRule) */ + insertRule(rule: string, index?: number): number; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/removeRule) + */ + removeRule(index?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/replace) */ + replace(text: string): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/replaceSync) */ + replaceSync(text: string): void; +} + +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(options?: CSSStyleSheetInit): CSSStyleSheet; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleValue) */ +interface CSSStyleValue { + toString(): string; +} + +declare var CSSStyleValue: { + prototype: CSSStyleValue; + new(): CSSStyleValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleValue/parse_static) */ + parse(property: string, cssText: string): CSSStyleValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleValue/parseAll_static) */ + parseAll(property: string, cssText: string): CSSStyleValue[]; +}; + +/** + * An object representing a single CSS @supports at-rule. It implements the CSSConditionRule interface, and therefore the CSSRule and CSSGroupingRule interfaces with a type value of 12 (CSSRule.SUPPORTS_RULE). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSupportsRule) + */ +interface CSSSupportsRule extends CSSConditionRule { +} + +declare var CSSSupportsRule: { + prototype: CSSSupportsRule; + new(): CSSSupportsRule; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent) */ +interface CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent/is2D) */ + is2D: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent/toMatrix) */ + toMatrix(): DOMMatrix; + toString(): string; +} + +declare var CSSTransformComponent: { + prototype: CSSTransformComponent; + new(): CSSTransformComponent; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue) */ +interface CSSTransformValue extends CSSStyleValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue/is2D) */ + readonly is2D: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue/length) */ + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue/toMatrix) */ + toMatrix(): DOMMatrix; + forEach(callbackfn: (value: CSSTransformComponent, key: number, parent: CSSTransformValue) => void, thisArg?: any): void; + [index: number]: CSSTransformComponent; +} + +declare var CSSTransformValue: { + prototype: CSSTransformValue; + new(transforms: CSSTransformComponent[]): CSSTransformValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransition) */ +interface CSSTransition extends Animation { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransition/transitionProperty) */ + readonly transitionProperty: string; + addEventListener(type: K, listener: (this: CSSTransition, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: CSSTransition, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var CSSTransition: { + prototype: CSSTransition; + new(): CSSTransition; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate) */ +interface CSSTranslate extends CSSTransformComponent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate/x) */ + x: CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate/y) */ + y: CSSNumericValue; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate/z) */ + z: CSSNumericValue; +} + +declare var CSSTranslate: { + prototype: CSSTranslate; + new(x: CSSNumericValue, y: CSSNumericValue, z?: CSSNumericValue): CSSTranslate; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnitValue) */ +interface CSSUnitValue extends CSSNumericValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnitValue/unit) */ + readonly unit: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnitValue/value) */ + value: number; +} + +declare var CSSUnitValue: { + prototype: CSSUnitValue; + new(value: number, unit: string): CSSUnitValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnparsedValue) */ +interface CSSUnparsedValue extends CSSStyleValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnparsedValue/length) */ + readonly length: number; + forEach(callbackfn: (value: CSSUnparsedSegment, key: number, parent: CSSUnparsedValue) => void, thisArg?: any): void; + [index: number]: CSSUnparsedSegment; +} + +declare var CSSUnparsedValue: { + prototype: CSSUnparsedValue; + new(members: CSSUnparsedSegment[]): CSSUnparsedValue; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSVariableReferenceValue) */ +interface CSSVariableReferenceValue { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSVariableReferenceValue/fallback) */ + readonly fallback: CSSUnparsedValue | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSVariableReferenceValue/variable) */ + variable: string; +} + +declare var CSSVariableReferenceValue: { + prototype: CSSVariableReferenceValue; + new(variable: string, fallback?: CSSUnparsedValue | null): CSSVariableReferenceValue; +}; + +/** + * Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache) + */ +interface Cache { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/add) */ + add(request: RequestInfo | URL): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/addAll) */ + addAll(requests: RequestInfo[]): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/delete) */ + delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/keys) */ + keys(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/match) */ + match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/matchAll) */ + matchAll(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/put) */ + put(request: RequestInfo | URL, response: Response): Promise; +} + +declare var Cache: { + prototype: Cache; + new(): Cache; +}; + +/** + * The storage for Cache objects. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage) + */ +interface CacheStorage { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/delete) */ + delete(cacheName: string): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/has) */ + has(cacheName: string): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/keys) */ + keys(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/match) */ + match(request: RequestInfo | URL, options?: MultiCacheQueryOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */ + open(cacheName: string): Promise; +} + +declare var CacheStorage: { + prototype: CacheStorage; + new(): CacheStorage; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasCaptureMediaStreamTrack) */ +interface CanvasCaptureMediaStreamTrack extends MediaStreamTrack { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasCaptureMediaStreamTrack/canvas) */ + readonly canvas: HTMLCanvasElement; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasCaptureMediaStreamTrack/requestFrame) */ + requestFrame(): void; + addEventListener(type: K, listener: (this: CanvasCaptureMediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: CanvasCaptureMediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var CanvasCaptureMediaStreamTrack: { + prototype: CanvasCaptureMediaStreamTrack; + new(): CanvasCaptureMediaStreamTrack; +}; + +interface CanvasCompositing { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/globalAlpha) */ + globalAlpha: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation) */ + globalCompositeOperation: GlobalCompositeOperation; +} + +interface CanvasDrawImage { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage) */ + drawImage(image: CanvasImageSource, dx: number, dy: number): void; + drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void; + drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void; +} + +interface CanvasDrawPath { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/beginPath) */ + beginPath(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clip) */ + clip(fillRule?: CanvasFillRule): void; + clip(path: Path2D, fillRule?: CanvasFillRule): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fill) */ + fill(fillRule?: CanvasFillRule): void; + fill(path: Path2D, fillRule?: CanvasFillRule): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInPath) */ + isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean; + isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInStroke) */ + isPointInStroke(x: number, y: number): boolean; + isPointInStroke(path: Path2D, x: number, y: number): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/stroke) */ + stroke(): void; + stroke(path: Path2D): void; +} + +interface CanvasFillStrokeStyles { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillStyle) */ + fillStyle: string | CanvasGradient | CanvasPattern; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/strokeStyle) */ + strokeStyle: string | CanvasGradient | CanvasPattern; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createConicGradient) */ + createConicGradient(startAngle: number, x: number, y: number): CanvasGradient; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createLinearGradient) */ + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern) */ + createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createRadialGradient) */ + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; +} + +interface CanvasFilters { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/filter) */ + filter: string; +} + +/** + * An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasGradient) + */ +interface CanvasGradient { + /** + * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end. + * + * Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a "SyntaxError" DOMException if the color cannot be parsed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasGradient/addColorStop) + */ + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +}; + +interface CanvasImageData { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createImageData) */ + createImageData(sw: number, sh: number, settings?: ImageDataSettings): ImageData; + createImageData(imagedata: ImageData): ImageData; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getImageData) */ + getImageData(sx: number, sy: number, sw: number, sh: number, settings?: ImageDataSettings): ImageData; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/putImageData) */ + putImageData(imagedata: ImageData, dx: number, dy: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void; +} + +interface CanvasImageSmoothing { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled) */ + imageSmoothingEnabled: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/imageSmoothingQuality) */ + imageSmoothingQuality: ImageSmoothingQuality; +} + +interface CanvasPath { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arc) */ + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arcTo) */ + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/bezierCurveTo) */ + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/closePath) */ + closePath(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/ellipse) */ + ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineTo) */ + lineTo(x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/moveTo) */ + moveTo(x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/quadraticCurveTo) */ + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rect) */ + rect(x: number, y: number, w: number, h: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect) */ + roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | (number | DOMPointInit)[]): void; +} + +interface CanvasPathDrawingStyles { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineCap) */ + lineCap: CanvasLineCap; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineDashOffset) */ + lineDashOffset: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineJoin) */ + lineJoin: CanvasLineJoin; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineWidth) */ + lineWidth: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/miterLimit) */ + miterLimit: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getLineDash) */ + getLineDash(): number[]; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash) */ + setLineDash(segments: number[]): void; +} + +/** + * An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasPattern) + */ +interface CanvasPattern { + /** + * Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasPattern/setTransform) + */ + setTransform(transform?: DOMMatrix2DInit): void; +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +}; + +interface CanvasRect { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clearRect) */ + clearRect(x: number, y: number, w: number, h: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillRect) */ + fillRect(x: number, y: number, w: number, h: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/strokeRect) */ + strokeRect(x: number, y: number, w: number, h: number): void; +} + +/** + * The CanvasRenderingContext2D interface, part of the Canvas API, provides the 2D rendering context for the drawing surface of a element. It is used for drawing shapes, text, images, and other objects. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D) + */ +interface CanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/canvas) */ + readonly canvas: HTMLCanvasElement; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getContextAttributes) */ + getContextAttributes(): CanvasRenderingContext2DSettings; +} + +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +}; + +interface CanvasShadowStyles { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowBlur) */ + shadowBlur: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowColor) */ + shadowColor: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowOffsetX) */ + shadowOffsetX: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowOffsetY) */ + shadowOffsetY: number; +} + +interface CanvasState { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/reset) */ + reset(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/restore) */ + restore(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/save) */ + save(): void; +} + +interface CanvasText { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillText) */ + fillText(text: string, x: number, y: number, maxWidth?: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/measureText) */ + measureText(text: string): TextMetrics; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/strokeText) */ + strokeText(text: string, x: number, y: number, maxWidth?: number): void; +} + +interface CanvasTextDrawingStyles { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/direction) */ + direction: CanvasDirection; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/font) */ + font: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fontKerning) */ + fontKerning: CanvasFontKerning; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fontStretch) */ + fontStretch: CanvasFontStretch; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fontVariantCaps) */ + fontVariantCaps: CanvasFontVariantCaps; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/letterSpacing) */ + letterSpacing: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/textAlign) */ + textAlign: CanvasTextAlign; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/textBaseline) */ + textBaseline: CanvasTextBaseline; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/textRendering) */ + textRendering: CanvasTextRendering; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/wordSpacing) */ + wordSpacing: string; +} + +interface CanvasTransform { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getTransform) */ + getTransform(): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/resetTransform) */ + resetTransform(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rotate) */ + rotate(angle: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/scale) */ + scale(x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setTransform) */ + setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void; + setTransform(transform?: DOMMatrix2DInit): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/transform) */ + transform(a: number, b: number, c: number, d: number, e: number, f: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/translate) */ + translate(x: number, y: number): void; +} + +interface CanvasUserInterface { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded) */ + drawFocusIfNeeded(element: Element): void; + drawFocusIfNeeded(path: Path2D, element: Element): void; +} + +/** + * The ChannelMergerNode interface, often used in conjunction with its opposite, ChannelSplitterNode, reunites different mono inputs into a single output. Each input is used to fill a channel of the output. This is useful for accessing each channels separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ChannelMergerNode) + */ +interface ChannelMergerNode extends AudioNode { +} + +declare var ChannelMergerNode: { + prototype: ChannelMergerNode; + new(context: BaseAudioContext, options?: ChannelMergerOptions): ChannelMergerNode; +}; + +/** + * The ChannelSplitterNode interface, often used in conjunction with its opposite, ChannelMergerNode, separates the different channels of an audio source into a set of mono outputs. This is useful for accessing each channel separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ChannelSplitterNode) + */ +interface ChannelSplitterNode extends AudioNode { +} + +declare var ChannelSplitterNode: { + prototype: ChannelSplitterNode; + new(context: BaseAudioContext, options?: ChannelSplitterOptions): ChannelSplitterNode; +}; + +/** + * The CharacterData abstract interface represents a Node object that contains characters. This is an abstract interface, meaning there aren't any object of type CharacterData: it is implemented by other interfaces, like Text, Comment, or ProcessingInstruction which aren't abstract. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData) + */ +interface CharacterData extends Node, ChildNode, NonDocumentTypeChildNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/data) */ + data: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/length) */ + readonly length: number; + readonly ownerDocument: Document; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData) */ + appendData(data: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData) */ + deleteData(offset: number, count: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData) */ + insertData(offset: number, data: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData) */ + replaceData(offset: number, count: number, data: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData) */ + substringData(offset: number, count: number): string; +} + +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +}; + +interface ChildNode extends Node { + /** + * Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. + * + * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/after) + */ + after(...nodes: (Node | string)[]): void; + /** + * Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. + * + * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/before) + */ + before(...nodes: (Node | string)[]): void; + /** + * Removes node. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) + */ + remove(): void; + /** + * Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. + * + * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) + */ + replaceWith(...nodes: (Node | string)[]): void; +} + +/** @deprecated */ +interface ClientRect extends DOMRect { +} + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Clipboard) + */ +interface Clipboard extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Clipboard/read) */ + read(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Clipboard/readText) */ + readText(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Clipboard/write) */ + write(data: ClipboardItems): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Clipboard/writeText) */ + writeText(data: string): Promise; +} + +declare var Clipboard: { + prototype: Clipboard; + new(): Clipboard; +}; + +/** + * Events providing information related to modification of the clipboard, that is cut, copy, and paste events. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardEvent) + */ +interface ClipboardEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardEvent/clipboardData) */ + readonly clipboardData: DataTransfer | null; +} + +declare var ClipboardEvent: { + prototype: ClipboardEvent; + new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardItem) + */ +interface ClipboardItem { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardItem/types) */ + readonly types: ReadonlyArray; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardItem/getType) */ + getType(type: string): Promise; +} + +declare var ClipboardItem: { + prototype: ClipboardItem; + new(items: Record>, options?: ClipboardItemOptions): ClipboardItem; +}; + +/** + * A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent) + */ +interface CloseEvent extends Event { + /** + * Returns the WebSocket connection close code provided by the server. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/code) + */ + readonly code: number; + /** + * Returns the WebSocket connection close reason provided by the server. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/reason) + */ + readonly reason: string; + /** + * Returns true if the connection closed cleanly; false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CloseEvent/wasClean) + */ + readonly wasClean: boolean; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(type: string, eventInitDict?: CloseEventInit): CloseEvent; +}; + +/** + * Textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Comment) + */ +interface Comment extends CharacterData { +} + +declare var Comment: { + prototype: Comment; + new(data?: string): Comment; +}; + +/** + * The DOM CompositionEvent represents events that occur due to the user indirectly entering text. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompositionEvent) + */ +interface CompositionEvent extends UIEvent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompositionEvent/data) */ + readonly data: string; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompositionEvent/initCompositionEvent) + */ + initCompositionEvent(typeArg: string, bubblesArg?: boolean, cancelableArg?: boolean, viewArg?: WindowProxy | null, dataArg?: string): void; +} + +declare var CompositionEvent: { + prototype: CompositionEvent; + new(type: string, eventInitDict?: CompositionEventInit): CompositionEvent; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */ +interface CompressionStream extends GenericTransformStream { +} + +declare var CompressionStream: { + prototype: CompressionStream; + new(format: CompressionFormat): CompressionStream; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ConstantSourceNode) */ +interface ConstantSourceNode extends AudioScheduledSourceNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ConstantSourceNode/offset) */ + readonly offset: AudioParam; + addEventListener(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var ConstantSourceNode: { + prototype: ConstantSourceNode; + new(context: BaseAudioContext, options?: ConstantSourceOptions): ConstantSourceNode; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContentVisibilityAutoStateChangeEvent) */ +interface ContentVisibilityAutoStateChangeEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContentVisibilityAutoStateChangeEvent/skipped) */ + readonly skipped: boolean; +} + +declare var ContentVisibilityAutoStateChangeEvent: { + prototype: ContentVisibilityAutoStateChangeEvent; + new(type: string, eventInitDict?: ContentVisibilityAutoStateChangeEventInit): ContentVisibilityAutoStateChangeEvent; +}; + +/** + * An AudioNode that performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect. A ConvolverNode always has exactly one input and one output. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ConvolverNode) + */ +interface ConvolverNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ConvolverNode/buffer) */ + buffer: AudioBuffer | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ConvolverNode/normalize) */ + normalize: boolean; +} + +declare var ConvolverNode: { + prototype: ConvolverNode; + new(context: BaseAudioContext, options?: ConvolverOptions): ConvolverNode; +}; + +/** + * This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy) + */ +interface CountQueuingStrategy extends QueuingStrategy { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/highWaterMark) */ + readonly highWaterMark: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CountQueuingStrategy/size) */ + readonly size: QueuingStrategySize; +} + +declare var CountQueuingStrategy: { + prototype: CountQueuingStrategy; + new(init: QueuingStrategyInit): CountQueuingStrategy; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential) + */ +interface Credential { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/id) */ + readonly id: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/type) */ + readonly type: string; +} + +declare var Credential: { + prototype: Credential; + new(): Credential; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CredentialsContainer) + */ +interface CredentialsContainer { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/create) */ + create(options?: CredentialCreationOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/get) */ + get(options?: CredentialRequestOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/preventSilentAccess) */ + preventSilentAccess(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/store) */ + store(credential: Credential): Promise; +} + +declare var CredentialsContainer: { + prototype: CredentialsContainer; + new(): CredentialsContainer; +}; + +/** + * Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto) + */ +interface Crypto { + /** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle) + */ + readonly subtle: SubtleCrypto; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */ + getRandomValues(array: T): T; + /** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID) + */ + randomUUID(): `${string}-${string}-${string}-${string}-${string}`; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +}; + +/** + * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey) + */ +interface CryptoKey { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */ + readonly algorithm: KeyAlgorithm; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */ + readonly extractable: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */ + readonly type: KeyType; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */ + readonly usages: KeyUsage[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry) */ +interface CustomElementRegistry { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/define) */ + define(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/get) */ + get(name: string): CustomElementConstructor | undefined; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/getName) */ + getName(constructor: CustomElementConstructor): string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/upgrade) */ + upgrade(root: Node): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/whenDefined) */ + whenDefined(name: string): Promise; +} + +declare var CustomElementRegistry: { + prototype: CustomElementRegistry; + new(): CustomElementRegistry; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent) */ +interface CustomEvent extends Event { + /** + * Returns any custom data event was created with. Typically used for synthetic events. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/detail) + */ + readonly detail: T; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomEvent/initCustomEvent) + */ + initCustomEvent(type: string, bubbles?: boolean, cancelable?: boolean, detail?: T): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new(type: string, eventInitDict?: CustomEventInit): CustomEvent; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CustomStateSet) */ +interface CustomStateSet { + forEach(callbackfn: (value: string, key: string, parent: CustomStateSet) => void, thisArg?: any): void; +} + +declare var CustomStateSet: { + prototype: CustomStateSet; + new(): CustomStateSet; +}; + +/** + * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException) + */ +interface DOMException extends Error { + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code) + */ + readonly code: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */ + readonly message: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */ + readonly name: string; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; +} + +declare var DOMException: { + prototype: DOMException; + new(message?: string, name?: string): DOMException; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; +}; + +/** + * An object providing methods which are not dependent on any particular document. Such an object is returned by the Document.implementation property. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMImplementation) + */ +interface DOMImplementation { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMImplementation/createDocument) */ + createDocument(namespace: string | null, qualifiedName: string | null, doctype?: DocumentType | null): XMLDocument; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMImplementation/createDocumentType) */ + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument) */ + createHTMLDocument(title?: string): Document; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMImplementation/hasFeature) + */ + hasFeature(...args: any[]): true; +} + +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrix) */ +interface DOMMatrix extends DOMMatrixReadOnly { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + invertSelf(): DOMMatrix; + multiplySelf(other?: DOMMatrixInit): DOMMatrix; + preMultiplySelf(other?: DOMMatrixInit): DOMMatrix; + rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrix; + rotateFromVectorSelf(x?: number, y?: number): DOMMatrix; + rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrix/scale3dSelf) */ + scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrix/scaleSelf) */ + scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + setMatrixValue(transformList: string): DOMMatrix; + skewXSelf(sx?: number): DOMMatrix; + skewYSelf(sy?: number): DOMMatrix; + translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix; +} + +declare var DOMMatrix: { + prototype: DOMMatrix; + new(init?: string | number[]): DOMMatrix; + fromFloat32Array(array32: Float32Array): DOMMatrix; + fromFloat64Array(array64: Float64Array): DOMMatrix; + fromMatrix(other?: DOMMatrixInit): DOMMatrix; +}; + +type SVGMatrix = DOMMatrix; +declare var SVGMatrix: typeof DOMMatrix; + +type WebKitCSSMatrix = DOMMatrix; +declare var WebKitCSSMatrix: typeof DOMMatrix; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly) */ +interface DOMMatrixReadOnly { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/a) */ + readonly a: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/b) */ + readonly b: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/c) */ + readonly c: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/d) */ + readonly d: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/e) */ + readonly e: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/f) */ + readonly f: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/is2D) */ + readonly is2D: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/isIdentity) */ + readonly isIdentity: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m11) */ + readonly m11: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m12) */ + readonly m12: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m13) */ + readonly m13: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m14) */ + readonly m14: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m21) */ + readonly m21: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m22) */ + readonly m22: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m23) */ + readonly m23: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m24) */ + readonly m24: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m31) */ + readonly m31: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m32) */ + readonly m32: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m33) */ + readonly m33: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m34) */ + readonly m34: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m41) */ + readonly m41: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m42) */ + readonly m42: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m43) */ + readonly m43: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m44) */ + readonly m44: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/flipX) */ + flipX(): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/flipY) */ + flipY(): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/inverse) */ + inverse(): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/multiply) */ + multiply(other?: DOMMatrixInit): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/rotate) */ + rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/rotateAxisAngle) */ + rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/rotateFromVector) */ + rotateFromVector(x?: number, y?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scale) */ + scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scale3d) */ + scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scaleNonUniform) + */ + scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/skewX) */ + skewX(sx?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/skewY) */ + skewY(sy?: number): DOMMatrix; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/toFloat32Array) */ + toFloat32Array(): Float32Array; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/toFloat64Array) */ + toFloat64Array(): Float64Array; + toJSON(): any; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/transformPoint) */ + transformPoint(point?: DOMPointInit): DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/translate) */ + translate(tx?: number, ty?: number, tz?: number): DOMMatrix; + toString(): string; +} + +declare var DOMMatrixReadOnly: { + prototype: DOMMatrixReadOnly; + new(init?: string | number[]): DOMMatrixReadOnly; + fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly; + fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly; + fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly; +}; + +/** + * Provides the ability to parse XML or HTML source code from a string into a DOM Document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMParser) + */ +interface DOMParser { + /** + * Parses string using either the HTML or XML parser, according to type, and returns the resulting Document. type can be "text/html" (which will invoke the HTML parser), or any of "text/xml", "application/xml", "application/xhtml+xml", or "image/svg+xml" (which will invoke the XML parser). + * + * For the XML parser, if string cannot be parsed, then the returned Document will contain elements describing the resulting error. + * + * Note that script elements are not evaluated during parsing, and the resulting document's encoding will always be UTF-8. + * + * Values other than the above for type will cause a TypeError exception to be thrown. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMParser/parseFromString) + */ + parseFromString(string: string, type: DOMParserSupportedType): Document; +} + +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint) */ +interface DOMPoint extends DOMPointReadOnly { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint/w) */ + w: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint/x) */ + x: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint/y) */ + y: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint/z) */ + z: number; +} + +declare var DOMPoint: { + prototype: DOMPoint; + new(x?: number, y?: number, z?: number, w?: number): DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPoint/fromPoint_static) */ + fromPoint(other?: DOMPointInit): DOMPoint; +}; + +type SVGPoint = DOMPoint; +declare var SVGPoint: typeof DOMPoint; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly) */ +interface DOMPointReadOnly { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/w) */ + readonly w: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/x) */ + readonly x: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/y) */ + readonly y: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/z) */ + readonly z: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/matrixTransform) */ + matrixTransform(matrix?: DOMMatrixInit): DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/toJSON) */ + toJSON(): any; +} + +declare var DOMPointReadOnly: { + prototype: DOMPointReadOnly; + new(x?: number, y?: number, z?: number, w?: number): DOMPointReadOnly; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/fromPoint_static) */ + fromPoint(other?: DOMPointInit): DOMPointReadOnly; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad) */ +interface DOMQuad { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p1) */ + readonly p1: DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p2) */ + readonly p2: DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p3) */ + readonly p3: DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p4) */ + readonly p4: DOMPoint; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/getBounds) */ + getBounds(): DOMRect; + toJSON(): any; +} + +declare var DOMQuad: { + prototype: DOMQuad; + new(p1?: DOMPointInit, p2?: DOMPointInit, p3?: DOMPointInit, p4?: DOMPointInit): DOMQuad; + fromQuad(other?: DOMQuadInit): DOMQuad; + fromRect(other?: DOMRectInit): DOMQuad; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRect) */ +interface DOMRect extends DOMRectReadOnly { + height: number; + width: number; + x: number; + y: number; +} + +declare var DOMRect: { + prototype: DOMRect; + new(x?: number, y?: number, width?: number, height?: number): DOMRect; + fromRect(other?: DOMRectInit): DOMRect; +}; + +type SVGRect = DOMRect; +declare var SVGRect: typeof DOMRect; + +interface DOMRectList { + readonly length: number; + item(index: number): DOMRect | null; + [index: number]: DOMRect; +} + +declare var DOMRectList: { + prototype: DOMRectList; + new(): DOMRectList; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly) */ +interface DOMRectReadOnly { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/bottom) */ + readonly bottom: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/height) */ + readonly height: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/left) */ + readonly left: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/right) */ + readonly right: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/top) */ + readonly top: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/width) */ + readonly width: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/x) */ + readonly x: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/y) */ + readonly y: number; + toJSON(): any; +} + +declare var DOMRectReadOnly: { + prototype: DOMRectReadOnly; + new(x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/fromRect_static) */ + fromRect(other?: DOMRectInit): DOMRectReadOnly; +}; + +/** + * A type returned by some APIs which contains a list of DOMString (strings). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMStringList) + */ +interface DOMStringList { + /** + * Returns the number of strings in strings. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMStringList/length) + */ + readonly length: number; + /** + * Returns true if strings contains string, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMStringList/contains) + */ + contains(string: string): boolean; + /** + * Returns the string with index index from strings. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMStringList/item) + */ + item(index: number): string | null; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +}; + +/** + * Used by the dataset HTML attribute to represent data for custom attributes added to elements. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMStringMap) + */ +interface DOMStringMap { + [name: string]: string | undefined; +} + +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +}; + +/** + * A set of space-separated tokens. Such a set is returned by Element.classList, HTMLLinkElement.relList, HTMLAnchorElement.relList, HTMLAreaElement.relList, HTMLIframeElement.sandbox, or HTMLOutputElement.htmlFor. It is indexed beginning with 0 as with JavaScript Array objects. DOMTokenList is always case-sensitive. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList) + */ +interface DOMTokenList { + /** + * Returns the number of tokens. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/length) + */ + readonly length: number; + /** + * Returns the associated set as string. + * + * Can be set, to change the associated attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/value) + */ + value: string; + toString(): string; + /** + * Adds all arguments passed, except those already present. + * + * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. + * + * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/add) + */ + add(...tokens: string[]): void; + /** + * Returns true if token is present, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/contains) + */ + contains(token: string): boolean; + /** + * Returns the token with index index. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/item) + */ + item(index: number): string | null; + /** + * Removes arguments passed, if they are present. + * + * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. + * + * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/remove) + */ + remove(...tokens: string[]): void; + /** + * Replaces token with newToken. + * + * Returns true if token was replaced with newToken, and false otherwise. + * + * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. + * + * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/replace) + */ + replace(token: string, newToken: string): boolean; + /** + * Returns true if token is in the associated attribute's supported tokens. Returns false otherwise. + * + * Throws a TypeError if the associated attribute has no supported tokens defined. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/supports) + */ + supports(token: string): boolean; + /** + * If force is not given, "toggles" token, removing it if it's present and adding it if it's not present. If force is true, adds token (same as add()). If force is false, removes token (same as remove()). + * + * Returns true if token is now present, and false otherwise. + * + * Throws a "SyntaxError" DOMException if token is empty. + * + * Throws an "InvalidCharacterError" DOMException if token contains any spaces. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMTokenList/toggle) + */ + toggle(token: string, force?: boolean): boolean; + forEach(callbackfn: (value: string, key: number, parent: DOMTokenList) => void, thisArg?: any): void; + [index: number]: string; +} + +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +}; + +/** + * Used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer) + */ +interface DataTransfer { + /** + * Returns the kind of operation that is currently selected. If the kind of operation isn't one of those that is allowed by the effectAllowed attribute, then the operation will fail. + * + * Can be set, to change the selected operation. + * + * The possible values are "none", "copy", "link", and "move". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/dropEffect) + */ + dropEffect: "none" | "copy" | "link" | "move"; + /** + * Returns the kinds of operations that are to be allowed. + * + * Can be set (during the dragstart event), to change the allowed operations. + * + * The possible values are "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", and "uninitialized", + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/effectAllowed) + */ + effectAllowed: "none" | "copy" | "copyLink" | "copyMove" | "link" | "linkMove" | "move" | "all" | "uninitialized"; + /** + * Returns a FileList of the files being dragged, if any. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/files) + */ + readonly files: FileList; + /** + * Returns a DataTransferItemList object, with the drag data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/items) + */ + readonly items: DataTransferItemList; + /** + * Returns a frozen array listing the formats that were set in the dragstart event. In addition, if any files are being dragged, then one of the types will be the string "Files". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/types) + */ + readonly types: ReadonlyArray; + /** + * Removes the data of the specified formats. Removes all data if the argument is omitted. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/clearData) + */ + clearData(format?: string): void; + /** + * Returns the specified data. If there is no such data, returns the empty string. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/getData) + */ + getData(format: string): string; + /** + * Adds the specified data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/setData) + */ + setData(format: string, data: string): void; + /** + * Uses the given element to update the drag feedback, replacing any previously specified feedback. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransfer/setDragImage) + */ + setDragImage(image: Element, x: number, y: number): void; +} + +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +}; + +/** + * One drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem) + */ +interface DataTransferItem { + /** + * Returns the drag data item kind, one of: "string", "file". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem/kind) + */ + readonly kind: string; + /** + * Returns the drag data item type string. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem/type) + */ + readonly type: string; + /** + * Returns a File object, if the drag data item kind is File. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem/getAsFile) + */ + getAsFile(): File | null; + /** + * Invokes the callback with the string data as the argument, if the drag data item kind is text. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem/getAsString) + */ + getAsString(callback: FunctionStringCallback | null): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry) */ + webkitGetAsEntry(): FileSystemEntry | null; +} + +declare var DataTransferItem: { + prototype: DataTransferItem; + new(): DataTransferItem; +}; + +/** + * A list of DataTransferItem objects representing items being dragged. During a drag operation, each DragEvent has a dataTransfer property and that property is a DataTransferItemList. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItemList) + */ +interface DataTransferItemList { + /** + * Returns the number of items in the drag data store. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/length) + */ + readonly length: number; + /** + * Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be provided also. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/add) + */ + add(data: string, type: string): DataTransferItem | null; + add(data: File): DataTransferItem | null; + /** + * Removes all the entries in the drag data store. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/clear) + */ + clear(): void; + /** + * Removes the indexth entry in the drag data store. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/remove) + */ + remove(index: number): void; + [index: number]: DataTransferItem; +} + +declare var DataTransferItemList: { + prototype: DataTransferItemList; + new(): DataTransferItemList; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */ +interface DecompressionStream extends GenericTransformStream { +} + +declare var DecompressionStream: { + prototype: DecompressionStream; + new(format: CompressionFormat): DecompressionStream; +}; + +/** + * A delay-line; an AudioNode audio-processing module that causes a delay between the arrival of an input data and its propagation to the output. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DelayNode) + */ +interface DelayNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DelayNode/delayTime) */ + readonly delayTime: AudioParam; +} + +declare var DelayNode: { + prototype: DelayNode; + new(context: BaseAudioContext, options?: DelayOptions): DelayNode; +}; + +/** + * The DeviceMotionEvent provides web developers with information about the speed of changes for the device's position and orientation. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEvent) + */ +interface DeviceMotionEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEvent/acceleration) */ + readonly acceleration: DeviceMotionEventAcceleration | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEvent/accelerationIncludingGravity) */ + readonly accelerationIncludingGravity: DeviceMotionEventAcceleration | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEvent/interval) */ + readonly interval: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEvent/rotationRate) */ + readonly rotationRate: DeviceMotionEventRotationRate | null; +} + +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(type: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventAcceleration) + */ +interface DeviceMotionEventAcceleration { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventAcceleration/x) */ + readonly x: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventAcceleration/y) */ + readonly y: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventAcceleration/z) */ + readonly z: number | null; +} + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate) + */ +interface DeviceMotionEventRotationRate { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/alpha) */ + readonly alpha: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/beta) */ + readonly beta: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceMotionEventRotationRate/gamma) */ + readonly gamma: number | null; +} + +/** + * The DeviceOrientationEvent provides web developers with information from the physical orientation of the device running the web page. + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent) + */ +interface DeviceOrientationEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent/absolute) */ + readonly absolute: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent/alpha) */ + readonly alpha: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent/beta) */ + readonly beta: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent/gamma) */ + readonly gamma: number | null; +} + +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(type: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; +}; + +interface DocumentEventMap extends GlobalEventHandlersEventMap { + "DOMContentLoaded": Event; + "fullscreenchange": Event; + "fullscreenerror": Event; + "pointerlockchange": Event; + "pointerlockerror": Event; + "readystatechange": Event; + "visibilitychange": Event; +} + +/** + * Any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document) + */ +interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEventHandlers, NonElementParentNode, ParentNode, XPathEvaluatorBase { + /** + * Sets or gets the URL for the current document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/URL) + */ + readonly URL: string; + /** + * Sets or gets the color of all active links in the document. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/alinkColor) + */ + alinkColor: string; + /** + * Returns a reference to the collection of elements contained by the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/all) + */ + readonly all: HTMLAllCollection; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/anchors) + */ + readonly anchors: HTMLCollectionOf; + /** + * Retrieves a collection of all applet objects in the document. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/applets) + */ + readonly applets: HTMLCollection; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/bgColor) + */ + bgColor: string; + /** + * Specifies the beginning and end of the document body. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/body) + */ + body: HTMLElement; + /** + * Returns document's encoding. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/characterSet) + */ + readonly characterSet: string; + /** + * Gets or sets the character set used to encode the object. + * @deprecated This is a legacy alias of `characterSet`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/characterSet) + */ + readonly charset: string; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/compatMode) + */ + readonly compatMode: string; + /** + * Returns document's content type. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/contentType) + */ + readonly contentType: string; + /** + * Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned. + * + * Can be set, to add a new cookie to the element's set of HTTP cookies. + * + * If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/cookie) + */ + cookie: string; + /** + * Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing. + * + * Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/currentScript) + */ + readonly currentScript: HTMLOrSVGScriptElement | null; + /** + * Returns the Window object of the active document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/defaultView) + */ + readonly defaultView: (WindowProxy & typeof globalThis) | null; + /** + * Sets or gets a value that indicates whether the document can be edited. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/designMode) + */ + designMode: string; + /** + * Sets or retrieves a value that indicates the reading order of the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/dir) + */ + dir: string; + /** + * Gets an object representing the document type declaration associated with the current document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/doctype) + */ + readonly doctype: DocumentType | null; + /** + * Gets a reference to the root node of the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/documentElement) + */ + readonly documentElement: HTMLElement; + /** + * Returns document's URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/documentURI) + */ + readonly documentURI: string; + /** + * Sets or gets the security domain of the document. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/domain) + */ + domain: string; + /** + * Retrieves a collection of all embed objects in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/embeds) + */ + readonly embeds: HTMLCollectionOf; + /** + * Sets or gets the foreground (text) color of the document. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fgColor) + */ + fgColor: string; + /** + * Retrieves a collection, in source order, of all form objects in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/forms) + */ + readonly forms: HTMLCollectionOf; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fullscreen) + */ + readonly fullscreen: boolean; + /** + * Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fullscreenEnabled) + */ + readonly fullscreenEnabled: boolean; + /** + * Returns the head element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/head) + */ + readonly head: HTMLHeadElement; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/hidden) */ + readonly hidden: boolean; + /** + * Retrieves a collection, in source order, of img objects in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/images) + */ + readonly images: HTMLCollectionOf; + /** + * Gets the implementation object of the current document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/implementation) + */ + readonly implementation: DOMImplementation; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + * @deprecated This is a legacy alias of `characterSet`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/characterSet) + */ + readonly inputEncoding: string; + /** + * Gets the date that the page was last modified, if the page supplies one. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/lastModified) + */ + readonly lastModified: string; + /** + * Sets or gets the color of the document links. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/linkColor) + */ + linkColor: string; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/links) + */ + readonly links: HTMLCollectionOf; + /** + * Contains information about the current URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/location) + */ + get location(): Location; + set location(href: string | Location); + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fullscreenchange_event) */ + onfullscreenchange: ((this: Document, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fullscreenerror_event) */ + onfullscreenerror: ((this: Document, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/pointerlockchange_event) */ + onpointerlockchange: ((this: Document, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/pointerlockerror_event) */ + onpointerlockerror: ((this: Document, ev: Event) => any) | null; + /** + * Fires when the state of the object has changed. + * @param ev The event + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/readystatechange_event) + */ + onreadystatechange: ((this: Document, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/visibilitychange_event) */ + onvisibilitychange: ((this: Document, ev: Event) => any) | null; + readonly ownerDocument: null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/pictureInPictureEnabled) */ + readonly pictureInPictureEnabled: boolean; + /** + * Return an HTMLCollection of the embed elements in the Document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/plugins) + */ + readonly plugins: HTMLCollectionOf; + /** + * Retrieves a value that indicates the current state of the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/readyState) + */ + readonly readyState: DocumentReadyState; + /** + * Gets the URL of the location that referred the user to the current page. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/referrer) + */ + readonly referrer: string; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/rootElement) + */ + readonly rootElement: SVGSVGElement | null; + /** + * Retrieves a collection of all script objects in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/scripts) + */ + readonly scripts: HTMLCollectionOf; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/scrollingElement) */ + readonly scrollingElement: Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/timeline) */ + readonly timeline: DocumentTimeline; + /** + * Contains the title of the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/title) + */ + title: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/visibilityState) */ + readonly visibilityState: DocumentVisibilityState; + /** + * Sets or gets the color of the links that the user has visited. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/vlinkColor) + */ + vlinkColor: string; + /** + * Moves node from another document and returns it. + * + * If node is a document, throws a "NotSupportedError" DOMException or, if node is a shadow root, throws a "HierarchyRequestError" DOMException. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/adoptNode) + */ + adoptNode(node: T): T; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/captureEvents) + */ + captureEvents(): void; + /** @deprecated */ + caretRangeFromPoint(x: number, y: number): Range | null; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/clear) + */ + clear(): void; + /** + * Closes an output stream and forces the sent data to display. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/close) + */ + close(): void; + /** + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createAttribute) + */ + createAttribute(localName: string): Attr; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createAttributeNS) */ + createAttributeNS(namespace: string | null, qualifiedName: string): Attr; + /** + * Returns a CDATASection node whose data is data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createCDATASection) + */ + createCDATASection(data: string): CDATASection; + /** + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createComment) + */ + createComment(data: string): Comment; + /** + * Creates a new document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createDocumentFragment) + */ + createDocumentFragment(): DocumentFragment; + /** + * Creates an instance of the element for the specified tag. + * @param tagName The name of an element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createElement) + */ + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + /** @deprecated */ + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; + createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; + /** + * Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName. + * + * If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown. + * + * If one of the following conditions is true a "NamespaceError" DOMException will be thrown: + * + * localName does not match the QName production. + * Namespace prefix is not null and namespace is the empty string. + * Namespace prefix is "xml" and namespace is not the XML namespace. + * qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace. + * namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns". + * + * When supplied, options's is can be used to create a customized built-in element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createElementNS) + */ + createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K]; + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement; + createElementNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", qualifiedName: K): MathMLElementTagNameMap[K]; + createElementNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", qualifiedName: string): MathMLElement; + createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element; + createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createEvent) */ + createEvent(eventInterface: "AnimationEvent"): AnimationEvent; + createEvent(eventInterface: "AnimationPlaybackEvent"): AnimationPlaybackEvent; + createEvent(eventInterface: "AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface: "BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface: "BlobEvent"): BlobEvent; + createEvent(eventInterface: "ClipboardEvent"): ClipboardEvent; + createEvent(eventInterface: "CloseEvent"): CloseEvent; + createEvent(eventInterface: "CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "ContentVisibilityAutoStateChangeEvent"): ContentVisibilityAutoStateChangeEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface: "DragEvent"): DragEvent; + createEvent(eventInterface: "ErrorEvent"): ErrorEvent; + createEvent(eventInterface: "Event"): Event; + createEvent(eventInterface: "Events"): Event; + createEvent(eventInterface: "FocusEvent"): FocusEvent; + createEvent(eventInterface: "FontFaceSetLoadEvent"): FontFaceSetLoadEvent; + createEvent(eventInterface: "FormDataEvent"): FormDataEvent; + createEvent(eventInterface: "GamepadEvent"): GamepadEvent; + createEvent(eventInterface: "HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface: "InputEvent"): InputEvent; + createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface: "MIDIConnectionEvent"): MIDIConnectionEvent; + createEvent(eventInterface: "MIDIMessageEvent"): MIDIMessageEvent; + createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent; + createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent; + createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent; + createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent; + createEvent(eventInterface: "MessageEvent"): MessageEvent; + createEvent(eventInterface: "MouseEvent"): MouseEvent; + createEvent(eventInterface: "MouseEvents"): MouseEvent; + createEvent(eventInterface: "MutationEvent"): MutationEvent; + createEvent(eventInterface: "MutationEvents"): MutationEvent; + createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface: "PaymentMethodChangeEvent"): PaymentMethodChangeEvent; + createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent; + createEvent(eventInterface: "PictureInPictureEvent"): PictureInPictureEvent; + createEvent(eventInterface: "PointerEvent"): PointerEvent; + createEvent(eventInterface: "PopStateEvent"): PopStateEvent; + createEvent(eventInterface: "ProgressEvent"): ProgressEvent; + createEvent(eventInterface: "PromiseRejectionEvent"): PromiseRejectionEvent; + createEvent(eventInterface: "RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; + createEvent(eventInterface: "RTCDataChannelEvent"): RTCDataChannelEvent; + createEvent(eventInterface: "RTCErrorEvent"): RTCErrorEvent; + createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent; + createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent; + createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent; + createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent; + createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; + createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent; + createEvent(eventInterface: "StorageEvent"): StorageEvent; + createEvent(eventInterface: "SubmitEvent"): SubmitEvent; + createEvent(eventInterface: "ToggleEvent"): ToggleEvent; + createEvent(eventInterface: "TouchEvent"): TouchEvent; + createEvent(eventInterface: "TrackEvent"): TrackEvent; + createEvent(eventInterface: "TransitionEvent"): TransitionEvent; + createEvent(eventInterface: "UIEvent"): UIEvent; + createEvent(eventInterface: "UIEvents"): UIEvent; + createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface: "WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createNodeIterator) + */ + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter | null): NodeIterator; + /** + * Returns a ProcessingInstruction node whose target is target and data is data. If target does not match the Name production an "InvalidCharacterError" DOMException will be thrown. If data contains "?>" an "InvalidCharacterError" DOMException will be thrown. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction) + */ + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + /** + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createRange) + */ + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createTextNode) + */ + createTextNode(data: string): Text; + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/createTreeWalker) + */ + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/execCommand) + */ + execCommand(commandId: string, showUI?: boolean, value?: string): boolean; + /** + * Stops document's fullscreen element from being displayed fullscreen and resolves promise when done. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/exitFullscreen) + */ + exitFullscreen(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/exitPictureInPicture) */ + exitPictureInPicture(): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/exitPointerLock) */ + exitPointerLock(): void; + /** + * Returns a reference to the first object with the specified value of the ID attribute. + * @param elementId String that specifies the ID value. + */ + getElementById(elementId: string): HTMLElement | null; + /** + * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByClassName) + */ + getElementsByClassName(classNames: string): HTMLCollectionOf; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByName) + */ + getElementsByName(elementName: string): NodeListOf; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagName) + */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + /** @deprecated */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + /** + * If namespace and localName are "*" returns a HTMLCollection of all descendant elements. + * + * If only namespace is "*" returns a HTMLCollection of all descendant elements whose local name is localName. + * + * If only localName is "*" returns a HTMLCollection of all descendant elements whose namespace is namespace. + * + * Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagNameNS) + */ + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getSelection) + */ + getSelection(): Selection | null; + /** + * Gets a value indicating whether the object currently has focus. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/hasFocus) + */ + hasFocus(): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/hasStorageAccess) */ + hasStorageAccess(): Promise; + /** + * Returns a copy of node. If deep is true, the copy also includes the node's descendants. + * + * If node is a document or a shadow root, throws a "NotSupportedError" DOMException. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/importNode) + */ + importNode(node: T, deep?: boolean): T; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/open) + */ + open(unused1?: string, unused2?: string): Document; + open(url: string | URL, name: string, features: string): WindowProxy | null; + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/queryCommandEnabled) + */ + queryCommandEnabled(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/queryCommandIndeterm) + */ + queryCommandIndeterm(commandId: string): boolean; + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/queryCommandState) + */ + queryCommandState(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/queryCommandSupported) + */ + queryCommandSupported(commandId: string): boolean; + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/queryCommandValue) + */ + queryCommandValue(commandId: string): string; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/releaseEvents) + */ + releaseEvents(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/requestStorageAccess) */ + requestStorageAccess(): Promise; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/write) + */ + write(...text: string[]): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/writeln) + */ + writeln(...text: string[]): void; + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var Document: { + prototype: Document; + new(): Document; + parseHTMLUnsafe(html: string): Document; +}; + +/** + * A minimal document object that has no parent. It is used as a lightweight version of Document that stores a segment of a document structure comprised of nodes just like a standard document. The key difference is that because the document fragment isn't part of the active document tree structure, changes made to the fragment don't affect the document, cause reflow, or incur any performance impact that can occur when changes are made. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentFragment) + */ +interface DocumentFragment extends Node, NonElementParentNode, ParentNode { + readonly ownerDocument: Document; + getElementById(elementId: string): HTMLElement | null; +} + +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +}; + +interface DocumentOrShadowRoot { + /** + * Returns the deepest element in the document through which or to which key events are being routed. This is, roughly speaking, the focused element in the document. + * + * For the purposes of this API, when a child browsing context is focused, its container is focused in the parent browsing context. For example, if the user moves the focus to a text control in an iframe, the iframe is the element returned by the activeElement API in the iframe's node document. + * + * Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/activeElement) + */ + readonly activeElement: Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/adoptedStyleSheets) */ + adoptedStyleSheets: CSSStyleSheet[]; + /** + * Returns document's fullscreen element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fullscreenElement) + */ + readonly fullscreenElement: Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/pictureInPictureElement) */ + readonly pictureInPictureElement: Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/pointerLockElement) */ + readonly pointerLockElement: Element | null; + /** + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/styleSheets) + */ + readonly styleSheets: StyleSheetList; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element | null; + elementsFromPoint(x: number, y: number): Element[]; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/getAnimations) */ + getAnimations(): Animation[]; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentTimeline) */ +interface DocumentTimeline extends AnimationTimeline { +} + +declare var DocumentTimeline: { + prototype: DocumentTimeline; + new(options?: DocumentTimelineOptions): DocumentTimeline; +}; + +/** + * A Node containing a doctype. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType) + */ +interface DocumentType extends Node, ChildNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType/name) */ + readonly name: string; + readonly ownerDocument: Document; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType/publicId) */ + readonly publicId: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DocumentType/systemId) */ + readonly systemId: string; +} + +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +}; + +/** + * A DOM event that represents a drag and drop interaction. The user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another DOM element). Applications are free to interpret a drag and drop interaction in an application-specific way. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DragEvent) + */ +interface DragEvent extends MouseEvent { + /** + * Returns the DataTransfer object for the event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DragEvent/dataTransfer) + */ + readonly dataTransfer: DataTransfer | null; +} + +declare var DragEvent: { + prototype: DragEvent; + new(type: string, eventInitDict?: DragEventInit): DragEvent; +}; + +/** + * Inherits properties from its parent, AudioNode. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode) + */ +interface DynamicsCompressorNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/attack) */ + readonly attack: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/knee) */ + readonly knee: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/ratio) */ + readonly ratio: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/reduction) */ + readonly reduction: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/release) */ + readonly release: AudioParam; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DynamicsCompressorNode/threshold) */ + readonly threshold: AudioParam; +} + +declare var DynamicsCompressorNode: { + prototype: DynamicsCompressorNode; + new(context: BaseAudioContext, options?: DynamicsCompressorOptions): DynamicsCompressorNode; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_blend_minmax) */ +interface EXT_blend_minmax { + readonly MIN_EXT: 0x8007; + readonly MAX_EXT: 0x8008; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_color_buffer_float) */ +interface EXT_color_buffer_float { +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_color_buffer_half_float) */ +interface EXT_color_buffer_half_float { + readonly RGBA16F_EXT: 0x881A; + readonly RGB16F_EXT: 0x881B; + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: 0x8211; + readonly UNSIGNED_NORMALIZED_EXT: 0x8C17; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_float_blend) */ +interface EXT_float_blend { +} + +/** + * The EXT_frag_depth extension is part of the WebGL API and enables to set a depth value of a fragment from within the fragment shader. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_frag_depth) + */ +interface EXT_frag_depth { +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_sRGB) */ +interface EXT_sRGB { + readonly SRGB_EXT: 0x8C40; + readonly SRGB_ALPHA_EXT: 0x8C42; + readonly SRGB8_ALPHA8_EXT: 0x8C43; + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: 0x8210; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_shader_texture_lod) */ +interface EXT_shader_texture_lod { +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_texture_compression_bptc) */ +interface EXT_texture_compression_bptc { + readonly COMPRESSED_RGBA_BPTC_UNORM_EXT: 0x8E8C; + readonly COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: 0x8E8D; + readonly COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: 0x8E8E; + readonly COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: 0x8E8F; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_texture_compression_rgtc) */ +interface EXT_texture_compression_rgtc { + readonly COMPRESSED_RED_RGTC1_EXT: 0x8DBB; + readonly COMPRESSED_SIGNED_RED_RGTC1_EXT: 0x8DBC; + readonly COMPRESSED_RED_GREEN_RGTC2_EXT: 0x8DBD; + readonly COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: 0x8DBE; +} + +/** + * The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_texture_filter_anisotropic) + */ +interface EXT_texture_filter_anisotropic { + readonly TEXTURE_MAX_ANISOTROPY_EXT: 0x84FE; + readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: 0x84FF; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EXT_texture_norm16) */ +interface EXT_texture_norm16 { + readonly R16_EXT: 0x822A; + readonly RG16_EXT: 0x822C; + readonly RGB16_EXT: 0x8054; + readonly RGBA16_EXT: 0x805B; + readonly R16_SNORM_EXT: 0x8F98; + readonly RG16_SNORM_EXT: 0x8F99; + readonly RGB16_SNORM_EXT: 0x8F9A; + readonly RGBA16_SNORM_EXT: 0x8F9B; +} + +interface ElementEventMap { + "fullscreenchange": Event; + "fullscreenerror": Event; +} + +/** + * Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element) + */ +interface Element extends Node, ARIAMixin, Animatable, ChildNode, InnerHTML, NonDocumentTypeChildNode, ParentNode, Slottable { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/attributes) */ + readonly attributes: NamedNodeMap; + /** + * Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/classList) + */ + readonly classList: DOMTokenList; + /** + * Returns the value of element's class content attribute. Can be set to change it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/className) + */ + className: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/clientHeight) */ + readonly clientHeight: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/clientLeft) */ + readonly clientLeft: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/clientTop) */ + readonly clientTop: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/clientWidth) */ + readonly clientWidth: number; + /** + * Returns the value of element's id content attribute. Can be set to change it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/id) + */ + id: string; + /** + * Returns the local name. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/localName) + */ + readonly localName: string; + /** + * Returns the namespace. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/namespaceURI) + */ + readonly namespaceURI: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/fullscreenchange_event) */ + onfullscreenchange: ((this: Element, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/fullscreenerror_event) */ + onfullscreenerror: ((this: Element, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/outerHTML) */ + outerHTML: string; + readonly ownerDocument: Document; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/part) */ + readonly part: DOMTokenList; + /** + * Returns the namespace prefix. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/prefix) + */ + readonly prefix: string | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollHeight) */ + readonly scrollHeight: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollLeft) */ + scrollLeft: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollTop) */ + scrollTop: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollWidth) */ + readonly scrollWidth: number; + /** + * Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/shadowRoot) + */ + readonly shadowRoot: ShadowRoot | null; + /** + * Returns the value of element's slot content attribute. Can be set to change it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/slot) + */ + slot: string; + /** + * Returns the HTML-uppercased qualified name. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/tagName) + */ + readonly tagName: string; + /** + * Creates a shadow root for element and returns it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) + */ + attachShadow(init: ShadowRootInit): ShadowRoot; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) */ + checkVisibility(options?: CheckVisibilityOptions): boolean; + /** + * Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/closest) + */ + closest(selector: K): HTMLElementTagNameMap[K] | null; + closest(selector: K): SVGElementTagNameMap[K] | null; + closest(selector: K): MathMLElementTagNameMap[K] | null; + closest(selectors: string): E | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) */ + computedStyleMap(): StylePropertyMapReadOnly; + /** + * Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttribute) + */ + getAttribute(qualifiedName: string): string | null; + /** + * Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNS) + */ + getAttributeNS(namespace: string | null, localName: string): string | null; + /** + * Returns the qualified names of all element's attributes. Can contain duplicates. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNames) + */ + getAttributeNames(): string[]; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) */ + getAttributeNode(qualifiedName: string): Attr | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) */ + getAttributeNodeNS(namespace: string | null, localName: string): Attr | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) */ + getBoundingClientRect(): DOMRect; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) */ + getClientRects(): DOMRectList; + /** + * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) + */ + getElementsByClassName(classNames: string): HTMLCollectionOf; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + /** @deprecated */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) */ + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + /** + * Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/hasAttribute) + */ + hasAttribute(qualifiedName: string): boolean; + /** + * Returns true if element has an attribute whose namespace is namespace and local name is localName. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/hasAttributeNS) + */ + hasAttributeNS(namespace: string | null, localName: string): boolean; + /** + * Returns true if element has attributes, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/hasAttributes) + */ + hasAttributes(): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/hasPointerCapture) */ + hasPointerCapture(pointerId: number): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) */ + insertAdjacentElement(where: InsertPosition, element: Element): Element | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) */ + insertAdjacentHTML(position: InsertPosition, text: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) */ + insertAdjacentText(where: InsertPosition, data: string): void; + /** + * Returns true if matching selectors against element's root yields element, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/matches) + */ + matches(selectors: string): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) */ + releasePointerCapture(pointerId: number): void; + /** + * Removes element's first attribute whose qualified name is qualifiedName. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/removeAttribute) + */ + removeAttribute(qualifiedName: string): void; + /** + * Removes element's attribute whose namespace is namespace and local name is localName. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNS) + */ + removeAttributeNS(namespace: string | null, localName: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) */ + removeAttributeNode(attr: Attr): Attr; + /** + * Displays element fullscreen and resolves promise when done. + * + * When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) + */ + requestFullscreen(options?: FullscreenOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) */ + requestPointerLock(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scroll) */ + scroll(options?: ScrollToOptions): void; + scroll(x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) */ + scrollBy(options?: ScrollToOptions): void; + scrollBy(x: number, y: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) */ + scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) */ + scrollTo(options?: ScrollToOptions): void; + scrollTo(x: number, y: number): void; + /** + * Sets the value of element's first attribute whose qualified name is qualifiedName to value. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttribute) + */ + setAttribute(qualifiedName: string, value: string): void; + /** + * Sets the value of element's attribute whose namespace is namespace and local name is localName to value. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNS) + */ + setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) */ + setAttributeNode(attr: Attr): Attr | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) */ + setAttributeNodeNS(attr: Attr): Attr | null; + setHTMLUnsafe(html: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture) */ + setPointerCapture(pointerId: number): void; + /** + * If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName. + * + * Returns true if qualifiedName is now present, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute) + */ + toggleAttribute(qualifiedName: string, force?: boolean): boolean; + /** + * @deprecated This is a legacy alias of `matches`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/matches) + */ + webkitMatchesSelector(selectors: string): boolean; + addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var Element: { + prototype: Element; + new(): Element; +}; + +interface ElementCSSInlineStyle { + readonly attributeStyleMap: StylePropertyMap; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/style) */ + readonly style: CSSStyleDeclaration; +} + +interface ElementContentEditable { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/contentEditable) */ + contentEditable: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/enterKeyHint) */ + enterKeyHint: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/inputMode) */ + inputMode: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/isContentEditable) */ + readonly isContentEditable: boolean; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals) */ +interface ElementInternals extends ARIAMixin { + /** + * Returns the form owner of internals's target element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/form) + */ + readonly form: HTMLFormElement | null; + /** + * Returns a NodeList of all the label elements that internals's target element is associated with. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/labels) + */ + readonly labels: NodeList; + /** + * Returns the ShadowRoot for internals's target element, if the target element is a shadow host, or null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/shadowRoot) + */ + readonly shadowRoot: ShadowRoot | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/states) */ + readonly states: CustomStateSet; + /** + * Returns the error message that would be shown to the user if internals's target element was to be checked for validity. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/validationMessage) + */ + readonly validationMessage: string; + /** + * Returns the ValidityState object for internals's target element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/validity) + */ + readonly validity: ValidityState; + /** + * Returns true if internals's target element will be validated when the form is submitted; false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/willValidate) + */ + readonly willValidate: boolean; + /** + * Returns true if internals's target element has no validity problems; false otherwise. Fires an invalid event at the element in the latter case. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity) + */ + checkValidity(): boolean; + /** + * Returns true if internals's target element has no validity problems; otherwise, returns false, fires an invalid event at the element, and (if the event isn't canceled) reports the problem to the user. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity) + */ + reportValidity(): boolean; + /** + * Sets both the state and submission value of internals's target element to value. + * + * If value is null, the element won't participate in form submission. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue) + */ + setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void; + /** + * Marks internals's target element as suffering from the constraints indicated by the flags argument, and sets the element's validation message to message. If anchor is specified, the user agent might use it to indicate problems with the constraints of internals's target element when the form owner is validated interactively or reportValidity() is called. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ElementInternals/setValidity) + */ + setValidity(flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement): void; +} + +declare var ElementInternals: { + prototype: ElementInternals; + new(): ElementInternals; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk) */ +interface EncodedVideoChunk { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk/byteLength) */ + readonly byteLength: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk/duration) */ + readonly duration: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk/timestamp) */ + readonly timestamp: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk/type) */ + readonly type: EncodedVideoChunkType; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EncodedVideoChunk/copyTo) */ + copyTo(destination: AllowSharedBufferSource): void; +} + +declare var EncodedVideoChunk: { + prototype: EncodedVideoChunk; + new(init: EncodedVideoChunkInit): EncodedVideoChunk; +}; + +/** + * Events providing information related to errors in scripts or in files. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent) + */ +interface ErrorEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */ + readonly colno: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */ + readonly error: any; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */ + readonly filename: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */ + readonly lineno: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */ + readonly message: string; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent; +}; + +/** + * An event which takes place in the DOM. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event) + */ +interface Event { + /** + * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles) + */ + readonly bubbles: boolean; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble) + */ + cancelBubble: boolean; + /** + * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable) + */ + readonly cancelable: boolean; + /** + * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed) + */ + readonly composed: boolean; + /** + * Returns the object whose event listener's callback is currently being invoked. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget) + */ + readonly currentTarget: EventTarget | null; + /** + * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented) + */ + readonly defaultPrevented: boolean; + /** + * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase) + */ + readonly eventPhase: number; + /** + * Returns true if event was dispatched by the user agent, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted) + */ + readonly isTrusted: boolean; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue) + */ + returnValue: boolean; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement) + */ + readonly srcElement: EventTarget | null; + /** + * Returns the object to which event is dispatched (its target). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target) + */ + readonly target: EventTarget | null; + /** + * Returns the event's timestamp as the number of milliseconds measured relative to the time origin. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp) + */ + readonly timeStamp: DOMHighResTimeStamp; + /** + * Returns the type of event, e.g. "click", "hashchange", or "submit". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type) + */ + readonly type: string; + /** + * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath) + */ + composedPath(): EventTarget[]; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/initEvent) + */ + initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void; + /** + * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault) + */ + preventDefault(): void; + /** + * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation) + */ + stopImmediatePropagation(): void; + /** + * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) + */ + stopPropagation(): void; + readonly NONE: 0; + readonly CAPTURING_PHASE: 1; + readonly AT_TARGET: 2; + readonly BUBBLING_PHASE: 3; +} + +declare var Event: { + prototype: Event; + new(type: string, eventInitDict?: EventInit): Event; + readonly NONE: 0; + readonly CAPTURING_PHASE: 1; + readonly AT_TARGET: 2; + readonly BUBBLING_PHASE: 3; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventCounts) */ +interface EventCounts { + forEach(callbackfn: (value: number, key: string, parent: EventCounts) => void, thisArg?: any): void; +} + +declare var EventCounts: { + prototype: EventCounts; + new(): EventCounts; +}; + +interface EventListener { + (evt: Event): void; +} + +interface EventListenerObject { + handleEvent(object: Event): void; +} + +interface EventSourceEventMap { + "error": Event; + "message": MessageEvent; + "open": Event; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource) */ +interface EventSource extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */ + onerror: ((this: EventSource, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */ + onmessage: ((this: EventSource, ev: MessageEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */ + onopen: ((this: EventSource, ev: Event) => any) | null; + /** + * Returns the state of this EventSource object's connection. It can have the values described below. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState) + */ + readonly readyState: number; + /** + * Returns the URL providing the event stream. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url) + */ + readonly url: string; + /** + * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials) + */ + readonly withCredentials: boolean; + /** + * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close) + */ + close(): void; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSED: 2; + addEventListener(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var EventSource: { + prototype: EventSource; + new(url: string | URL, eventSourceInitDict?: EventSourceInit): EventSource; + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSED: 2; +}; + +/** + * EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget) + */ +interface EventTarget { + /** + * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched. + * + * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture. + * + * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET. + * + * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners. + * + * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. + * + * If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. + * + * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) + */ + addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void; + /** + * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) + */ + dispatchEvent(event: Event): boolean; + /** + * Removes the event listener in target's event listener list with the same type, callback, and options. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) + */ + removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +}; + +/** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/External) + */ +interface External { + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/External/AddSearchProvider) + */ + AddSearchProvider(): void; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/External/IsSearchProviderInstalled) + */ + IsSearchProviderInstalled(): void; +} + +/** @deprecated */ +declare var External: { + prototype: External; + new(): External; +}; + +/** + * Provides information about files and allows JavaScript in a web page to access their content. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/File) + */ +interface File extends Blob { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */ + readonly lastModified: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/webkitRelativePath) */ + readonly webkitRelativePath: string; +} + +declare var File: { + prototype: File; + new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File; +}; + +/** + * An object of this type is returned by the files property of the HTML element; this lets you access the list of files selected with the element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileList) + */ +interface FileList { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileList/length) */ + readonly length: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileList/item) */ + item(index: number): File | null; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +}; + +interface FileReaderEventMap { + "abort": ProgressEvent; + "error": ProgressEvent; + "load": ProgressEvent; + "loadend": ProgressEvent; + "loadstart": ProgressEvent; + "progress": ProgressEvent; +} + +/** + * Lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader) + */ +interface FileReader extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/error) */ + readonly error: DOMException | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/abort_event) */ + onabort: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/error_event) */ + onerror: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/load_event) */ + onload: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/loadend_event) */ + onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/loadstart_event) */ + onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/progress_event) */ + onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/readyState) */ + readonly readyState: typeof FileReader.EMPTY | typeof FileReader.LOADING | typeof FileReader.DONE; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/result) */ + readonly result: string | ArrayBuffer | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/abort) */ + abort(): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/readAsArrayBuffer) */ + readAsArrayBuffer(blob: Blob): void; + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/readAsBinaryString) + */ + readAsBinaryString(blob: Blob): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/readAsDataURL) */ + readAsDataURL(blob: Blob): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileReader/readAsText) */ + readAsText(blob: Blob, encoding?: string): void; + readonly EMPTY: 0; + readonly LOADING: 1; + readonly DONE: 2; + addEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; + readonly EMPTY: 0; + readonly LOADING: 1; + readonly DONE: 2; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystem) */ +interface FileSystem { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystem/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystem/root) */ + readonly root: FileSystemDirectoryEntry; +} + +declare var FileSystem: { + prototype: FileSystem; + new(): FileSystem; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryEntry) */ +interface FileSystemDirectoryEntry extends FileSystemEntry { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryEntry/createReader) */ + createReader(): FileSystemDirectoryReader; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryEntry/getDirectory) */ + getDirectory(path?: string | null, options?: FileSystemFlags, successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryEntry/getFile) */ + getFile(path?: string | null, options?: FileSystemFlags, successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemDirectoryEntry: { + prototype: FileSystemDirectoryEntry; + new(): FileSystemDirectoryEntry; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle) + */ +interface FileSystemDirectoryHandle extends FileSystemHandle { + readonly kind: "directory"; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle) */ + getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/getFileHandle) */ + getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/removeEntry) */ + removeEntry(name: string, options?: FileSystemRemoveOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/resolve) */ + resolve(possibleDescendant: FileSystemHandle): Promise; +} + +declare var FileSystemDirectoryHandle: { + prototype: FileSystemDirectoryHandle; + new(): FileSystemDirectoryHandle; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader) */ +interface FileSystemDirectoryReader { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries) */ + readEntries(successCallback: FileSystemEntriesCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemDirectoryReader: { + prototype: FileSystemDirectoryReader; + new(): FileSystemDirectoryReader; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry) */ +interface FileSystemEntry { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/filesystem) */ + readonly filesystem: FileSystem; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/fullPath) */ + readonly fullPath: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/isDirectory) */ + readonly isDirectory: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/isFile) */ + readonly isFile: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemEntry/getParent) */ + getParent(successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemEntry: { + prototype: FileSystemEntry; + new(): FileSystemEntry; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileEntry) */ +interface FileSystemFileEntry extends FileSystemEntry { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileEntry/file) */ + file(successCallback: FileCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemFileEntry: { + prototype: FileSystemFileEntry; + new(): FileSystemFileEntry; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle) + */ +interface FileSystemFileHandle extends FileSystemHandle { + readonly kind: "file"; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle/createWritable) */ + createWritable(options?: FileSystemCreateWritableOptions): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle/getFile) */ + getFile(): Promise; +} + +declare var FileSystemFileHandle: { + prototype: FileSystemFileHandle; + new(): FileSystemFileHandle; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle) + */ +interface FileSystemHandle { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/kind) */ + readonly kind: FileSystemHandleKind; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/name) */ + readonly name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/isSameEntry) */ + isSameEntry(other: FileSystemHandle): Promise; +} + +declare var FileSystemHandle: { + prototype: FileSystemHandle; + new(): FileSystemHandle; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream) + */ +interface FileSystemWritableFileStream extends WritableStream { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/seek) */ + seek(position: number): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/truncate) */ + truncate(size: number): Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write) */ + write(data: FileSystemWriteChunkType): Promise; +} + +declare var FileSystemWritableFileStream: { + prototype: FileSystemWritableFileStream; + new(): FileSystemWritableFileStream; +}; + +/** + * Focus-related events like focus, blur, focusin, or focusout. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FocusEvent) + */ +interface FocusEvent extends UIEvent { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FocusEvent/relatedTarget) */ + readonly relatedTarget: EventTarget | null; +} + +declare var FocusEvent: { + prototype: FocusEvent; + new(type: string, eventInitDict?: FocusEventInit): FocusEvent; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace) */ +interface FontFace { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/ascentOverride) */ + ascentOverride: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/descentOverride) */ + descentOverride: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/display) */ + display: FontDisplay; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/family) */ + family: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/featureSettings) */ + featureSettings: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/lineGapOverride) */ + lineGapOverride: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/loaded) */ + readonly loaded: Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/status) */ + readonly status: FontFaceLoadStatus; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/stretch) */ + stretch: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/style) */ + style: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/unicodeRange) */ + unicodeRange: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/weight) */ + weight: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFace/load) */ + load(): Promise; +} + +declare var FontFace: { + prototype: FontFace; + new(family: string, source: string | BinaryData, descriptors?: FontFaceDescriptors): FontFace; +}; + +interface FontFaceSetEventMap { + "loading": Event; + "loadingdone": Event; + "loadingerror": Event; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet) */ +interface FontFaceSet extends EventTarget { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/loading_event) */ + onloading: ((this: FontFaceSet, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/loadingdone_event) */ + onloadingdone: ((this: FontFaceSet, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/loadingerror_event) */ + onloadingerror: ((this: FontFaceSet, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/ready) */ + readonly ready: Promise; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/status) */ + readonly status: FontFaceSetLoadStatus; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/check) */ + check(font: string, text?: string): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSet/load) */ + load(font: string, text?: string): Promise; + forEach(callbackfn: (value: FontFace, key: FontFace, parent: FontFaceSet) => void, thisArg?: any): void; + addEventListener(type: K, listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var FontFaceSet: { + prototype: FontFaceSet; + new(initialFaces: FontFace[]): FontFaceSet; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSetLoadEvent) */ +interface FontFaceSetLoadEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FontFaceSetLoadEvent/fontfaces) */ + readonly fontfaces: ReadonlyArray; +} + +declare var FontFaceSetLoadEvent: { + prototype: FontFaceSetLoadEvent; + new(type: string, eventInitDict?: FontFaceSetLoadEventInit): FontFaceSetLoadEvent; +}; + +interface FontFaceSource { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/fonts) */ + readonly fonts: FontFaceSet; +} + +/** + * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData) + */ +interface FormData { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append) */ + append(name: string, value: string | Blob): void; + append(name: string, value: string): void; + append(name: string, blobValue: Blob, filename?: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/delete) */ + delete(name: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/get) */ + get(name: string): FormDataEntryValue | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/getAll) */ + getAll(name: string): FormDataEntryValue[]; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has) */ + has(name: string): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set) */ + set(name: string, value: string | Blob): void; + set(name: string, value: string): void; + set(name: string, blobValue: Blob, filename?: string): void; + forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void; +} + +declare var FormData: { + prototype: FormData; + new(form?: HTMLFormElement, submitter?: HTMLElement | null): FormData; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormDataEvent) */ +interface FormDataEvent extends Event { + /** + * Returns a FormData object representing names and values of elements associated to the target form. Operations on the FormData object will affect form data to be submitted. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormDataEvent/formData) + */ + readonly formData: FormData; +} + +declare var FormDataEvent: { + prototype: FormDataEvent; + new(type: string, eventInitDict: FormDataEventInit): FormDataEvent; +}; + +/** + * A change in volume. It is an AudioNode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. A GainNode always has exactly one input and one output, both with the same number of channels. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GainNode) + */ +interface GainNode extends AudioNode { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GainNode/gain) */ + readonly gain: AudioParam; +} + +declare var GainNode: { + prototype: GainNode; + new(context: BaseAudioContext, options?: GainOptions): GainNode; +}; + +/** + * This Gamepad API interface defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad) + */ +interface Gamepad { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/axes) */ + readonly axes: ReadonlyArray; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/buttons) */ + readonly buttons: ReadonlyArray; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/connected) */ + readonly connected: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/id) */ + readonly id: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/index) */ + readonly index: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/mapping) */ + readonly mapping: GamepadMappingType; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Gamepad/timestamp) */ + readonly timestamp: DOMHighResTimeStamp; + readonly vibrationActuator: GamepadHapticActuator; +} + +declare var Gamepad: { + prototype: Gamepad; + new(): Gamepad; +}; + +/** + * An individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton) + */ +interface GamepadButton { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton/pressed) */ + readonly pressed: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton/touched) */ + readonly touched: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadButton/value) */ + readonly value: number; +} + +declare var GamepadButton: { + prototype: GamepadButton; + new(): GamepadButton; +}; + +/** + * This Gamepad API interface contains references to gamepads connected to the system, which is what the gamepad events Window.gamepadconnected and Window.gamepaddisconnected are fired in response to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadEvent) + */ +interface GamepadEvent extends Event { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadEvent/gamepad) */ + readonly gamepad: Gamepad; +} + +declare var GamepadEvent: { + prototype: GamepadEvent; + new(type: string, eventInitDict: GamepadEventInit): GamepadEvent; +}; + +/** + * This Gamepad API interface represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GamepadHapticActuator) + */ +interface GamepadHapticActuator { + playEffect(type: GamepadHapticEffectType, params?: GamepadEffectParameters): Promise; + reset(): Promise; +} + +declare var GamepadHapticActuator: { + prototype: GamepadHapticActuator; + new(): GamepadHapticActuator; +}; + +interface GenericTransformStream { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream/readable) */ + readonly readable: ReadableStream; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream/writable) */ + readonly writable: WritableStream; +} + +/** + * An object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Geolocation) + */ +interface Geolocation { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Geolocation/clearWatch) */ + clearWatch(watchId: number): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Geolocation/getCurrentPosition) */ + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Geolocation/watchPosition) */ + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions): number; +} + +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates) + */ +interface GeolocationCoordinates { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/accuracy) */ + readonly accuracy: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/altitude) */ + readonly altitude: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/altitudeAccuracy) */ + readonly altitudeAccuracy: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/heading) */ + readonly heading: number | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/latitude) */ + readonly latitude: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/longitude) */ + readonly longitude: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/speed) */ + readonly speed: number | null; +} + +declare var GeolocationCoordinates: { + prototype: GeolocationCoordinates; + new(): GeolocationCoordinates; +}; + +/** + * Available only in secure contexts. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPosition) + */ +interface GeolocationPosition { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPosition/coords) */ + readonly coords: GeolocationCoordinates; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPosition/timestamp) */ + readonly timestamp: EpochTimeStamp; +} + +declare var GeolocationPosition: { + prototype: GeolocationPosition; + new(): GeolocationPosition; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError) */ +interface GeolocationPositionError { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError/code) */ + readonly code: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError/message) */ + readonly message: string; + readonly PERMISSION_DENIED: 1; + readonly POSITION_UNAVAILABLE: 2; + readonly TIMEOUT: 3; +} + +declare var GeolocationPositionError: { + prototype: GeolocationPositionError; + new(): GeolocationPositionError; + readonly PERMISSION_DENIED: 1; + readonly POSITION_UNAVAILABLE: 2; + readonly TIMEOUT: 3; +}; + +interface GlobalEventHandlersEventMap { + "abort": UIEvent; + "animationcancel": AnimationEvent; + "animationend": AnimationEvent; + "animationiteration": AnimationEvent; + "animationstart": AnimationEvent; + "auxclick": MouseEvent; + "beforeinput": InputEvent; + "beforetoggle": Event; + "blur": FocusEvent; + "cancel": Event; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "close": Event; + "compositionend": CompositionEvent; + "compositionstart": CompositionEvent; + "compositionupdate": CompositionEvent; + "contextmenu": MouseEvent; + "copy": ClipboardEvent; + "cuechange": Event; + "cut": ClipboardEvent; + "dblclick": MouseEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": Event; + "error": ErrorEvent; + "focus": FocusEvent; + "focusin": FocusEvent; + "focusout": FocusEvent; + "formdata": FormDataEvent; + "gotpointercapture": PointerEvent; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "lostpointercapture": PointerEvent; + "mousedown": MouseEvent; + "mouseenter": MouseEvent; + "mouseleave": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "paste": ClipboardEvent; + "pause": Event; + "play": Event; + "playing": Event; + "pointercancel": PointerEvent; + "pointerdown": PointerEvent; + "pointerenter": PointerEvent; + "pointerleave": PointerEvent; + "pointermove": PointerEvent; + "pointerout": PointerEvent; + "pointerover": PointerEvent; + "pointerup": PointerEvent; + "progress": ProgressEvent; + "ratechange": Event; + "reset": Event; + "resize": UIEvent; + "scroll": Event; + "scrollend": Event; + "securitypolicyviolation": SecurityPolicyViolationEvent; + "seeked": Event; + "seeking": Event; + "select": Event; + "selectionchange": Event; + "selectstart": Event; + "slotchange": Event; + "stalled": Event; + "submit": SubmitEvent; + "suspend": Event; + "timeupdate": Event; + "toggle": Event; + "touchcancel": TouchEvent; + "touchend": TouchEvent; + "touchmove": TouchEvent; + "touchstart": TouchEvent; + "transitioncancel": TransitionEvent; + "transitionend": TransitionEvent; + "transitionrun": TransitionEvent; + "transitionstart": TransitionEvent; + "volumechange": Event; + "waiting": Event; + "webkitanimationend": Event; + "webkitanimationiteration": Event; + "webkitanimationstart": Event; + "webkittransitionend": Event; + "wheel": WheelEvent; +} + +interface GlobalEventHandlers { + /** + * Fires when the user aborts the download. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/abort_event) + */ + onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationcancel_event) */ + onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationend_event) */ + onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationiteration_event) */ + onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationstart_event) */ + onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/auxclick_event) */ + onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/beforeinput_event) */ + onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/beforetoggle_event) */ + onbeforetoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the object loses the input focus. + * @param ev The focus event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/blur_event) + */ + onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/cancel_event) */ + oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/canplay_event) + */ + oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/canplaythrough_event) */ + oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/change_event) + */ + onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/click_event) + */ + onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close_event) */ + onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/contextmenu_event) + */ + oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/copy_event) */ + oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTrackElement/cuechange_event) */ + oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/cut_event) */ + oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/dblclick_event) + */ + ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/drag_event) + */ + ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dragend_event) + */ + ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dragenter_event) + */ + ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dragleave_event) + */ + ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dragover_event) + */ + ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/dragstart_event) + */ + ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/drop_event) */ + ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/durationchange_event) + */ + ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/emptied_event) + */ + onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the end of playback is reached. + * @param ev The event + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/ended_event) + */ + onended: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/error_event) + */ + onerror: OnErrorEventHandler; + /** + * Fires when the object receives focus. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/focus_event) + */ + onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/formdata_event) */ + onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/gotpointercapture_event) */ + ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/input_event) */ + oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/invalid_event) */ + oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/keydown_event) + */ + onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/keypress_event) + */ + onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/keyup_event) + */ + onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGElement/load_event) + */ + onload: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/loadeddata_event) + */ + onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/loadedmetadata_event) + */ + onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/loadstart_event) + */ + onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/lostpointercapture_event) */ + onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mousedown_event) + */ + onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mouseenter_event) */ + onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mouseleave_event) */ + onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mousemove_event) + */ + onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mouseout_event) + */ + onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mouseover_event) + */ + onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/mouseup_event) + */ + onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/paste_event) */ + onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; + /** + * Occurs when playback is paused. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/pause_event) + */ + onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the play method is requested. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/play_event) + */ + onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/playing_event) + */ + onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointercancel_event) */ + onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerdown_event) */ + onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerenter_event) */ + onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerleave_event) */ + onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointermove_event) */ + onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerout_event) */ + onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerover_event) */ + onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/pointerup_event) */ + onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/progress_event) + */ + onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/ratechange_event) + */ + onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user resets a form. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/reset_event) + */ + onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement/resize_event) */ + onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/scroll_event) + */ + onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/scrollend_event) */ + onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/securitypolicyviolation_event) */ + onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null; + /** + * Occurs when the seek operation ends. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/seeked_event) + */ + onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/seeking_event) + */ + onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the current selection changes. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/select_event) + */ + onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/selectionchange_event) */ + onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/selectstart_event) */ + onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLSlotElement/slotchange_event) */ + onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the download has stopped. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/stalled_event) + */ + onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/submit_event) */ + onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null; + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/suspend_event) + */ + onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs to indicate the current playback position. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/timeupdate_event) + */ + ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLDetailsElement/toggle_event) */ + ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/touchcancel_event) */ + ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/touchend_event) */ + ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/touchmove_event) */ + ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/touchstart_event) */ + ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/transitioncancel_event) */ + ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/transitionend_event) */ + ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/transitionrun_event) */ + ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/transitionstart_event) */ + ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/volumechange_event) + */ + onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/waiting_event) + */ + onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * @deprecated This is a legacy alias of `onanimationend`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationend_event) + */ + onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * @deprecated This is a legacy alias of `onanimationiteration`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationiteration_event) + */ + onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * @deprecated This is a legacy alias of `onanimationstart`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/animationstart_event) + */ + onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * @deprecated This is a legacy alias of `ontransitionend`. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/transitionend_event) + */ + onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/wheel_event) */ + onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null; + addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAllCollection) */ +interface HTMLAllCollection { + /** + * Returns the number of elements in the collection. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAllCollection/length) + */ + readonly length: number; + /** + * Returns the item with index index from the collection (determined by tree order). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAllCollection/item) + */ + item(nameOrIndex?: string): HTMLCollection | Element | null; + /** + * Returns the item with ID or name name from the collection. + * + * If there are multiple matching items, then an HTMLCollection object containing all those elements is returned. + * + * Only button, form, iframe, input, map, meta, object, select, and textarea elements can have a name for the purpose of this method; their name is given by the value of their name attribute. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAllCollection/namedItem) + */ + namedItem(name: string): HTMLCollection | Element | null; + [index: number]: Element; +} + +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +}; + +/** + * Hyperlink elements and provides special properties and methods (beyond those of the regular HTMLElement object interface that they inherit from) for manipulating the layout and presentation of such elements. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement) + */ +interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { + /** + * Sets or retrieves the character set used to encode the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/charset) + */ + charset: string; + /** + * Sets or retrieves the coordinates of the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/coords) + */ + coords: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/download) */ + download: string; + /** + * Sets or retrieves the language code of the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/hreflang) + */ + hreflang: string; + /** + * Sets or retrieves the shape of the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/name) + */ + name: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/ping) */ + ping: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/referrerPolicy) */ + referrerPolicy: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/rel) + */ + rel: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/relList) */ + readonly relList: DOMTokenList; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/rev) + */ + rev: string; + /** + * Sets or retrieves the shape of the object. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/shape) + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/target) + */ + target: string; + /** + * Retrieves or sets the text of the object as a string. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/text) + */ + text: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/type) */ + type: string; + addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +}; + +/** + * Provides special properties and methods (beyond those of the regular object HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of elements. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement) + */ +interface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils { + /** + * Sets or retrieves a text alternative to the graphic. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/alt) + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/coords) + */ + coords: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/download) */ + download: string; + /** + * Sets or gets whether clicks in this region cause action. + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/noHref) + */ + noHref: boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/ping) */ + ping: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/referrerPolicy) */ + referrerPolicy: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/rel) */ + rel: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/relList) */ + readonly relList: DOMTokenList; + /** + * Sets or retrieves the shape of the object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/shape) + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLAreaElement/target) + */ + target: string; + addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +}; + +/** + * Provides access to the properties of