From 455254aa7204192e7f7fbe50266d2313cefdf6c9 Mon Sep 17 00:00:00 2001 From: "typescript-automation[bot]" <290192711+typescript-automation[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2026 08:33:16 +0000 Subject: [PATCH 01/12] =?UTF-8?q?=F0=9F=A4=96=20Update=20CODEOWNERS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/CODEOWNERS | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b6e9d62d4dbdca..f2c2564f6dd6d3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2992,7 +2992,6 @@ /types/gulp-coffeelint/ @tkQubo /types/gulp-concat/ @k-kagurazaka /types/gulp-concat-css/ @snakeego -/types/gulp-cond/ @martin-badin /types/gulp-connect/ @andrewiggins /types/gulp-connect-php/ @MysteryBlokHed /types/gulp-copy/ @aravindarun @@ -3159,6 +3158,7 @@ /types/heic-decode/ @hieyou1 /types/hellojs/ @PavelPZ @vuorinem @baywet @batuhanw /types/hellosign-embedded/ @xt0rted @alizhdanov +/types/helpscout-beacon/ @bawerbozdag /types/hepburn/ @peterblazejewicz /types/heredatalens/ @denyo /types/heremaps/ @Josh-ES @denyo @fx88 @life777 @DaSchTour @@ -4615,7 +4615,6 @@ /types/lrc-parser/ @alexthemaster /types/lscache/ @c-py /types/lsofi/ @oof2win2 -/types/ltijs/ @paulschwoerer /types/ltx/ @BendingBender /types/lua-format/ @dnrovs /types/lua-json/ @bitomic @@ -4792,7 +4791,6 @@ /types/memorystorage/ @Zephyr-Blessed /types/memorystream/ @bangbang93 @geniou /types/memwatch-next/ @cyrilschumacher -/types/mercadopago/ @danieldspx /types/merge-deep/ @forivall /types/merge-descriptors/ @danny8002 /types/merge-env/ @BendingBender @@ -5490,7 +5488,6 @@ /types/pager__jackrabbit/ @dagams /types/paho-mqtt/ @amikhalev /types/palx/ @mikefowler -/types/pangu/ @plantain-00 @AH-dark /types/pannellum/ @zhirzh @k-yle /types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly @albertorestifo @jliuhtonen @peterblazejewicz @emmanuelgautier @OpportunityLiu @matsuby /types/parallel-transform/ @djcsdy @@ -5706,7 +5703,6 @@ /types/pipes-and-filters/ @mrnkr @FdBn1999 /types/piwik-react-router/ @canserkanuren /types/piwik-tracker/ @lbguilherme -/types/pixelmatch/ @iamolegga @peterblazejewicz @damianfrizzi /types/pixl-xml/ @evanshortiss /types/pixrem/ @MysteryBlokHed /types/pizzicato/ @mattsoulanille @@ -5798,7 +5794,6 @@ /types/postcss-page-break/ @MysteryBlokHed /types/postcss-plugins/ @peterblazejewicz /types/postcss-prefix-keyframe/ @nsaunders -/types/postcss-prefix-selector/ @robertmaier /types/postcss-prefixer/ @nsaunders /types/postcss-pxtorem/ @bassettsj /types/postcss-reporter/ @peterblazejewicz @@ -7628,7 +7623,6 @@ /types/supertest-as-promised/ @tkrotoff /types/surma__rollup-plugin-off-main-thread/ @NotWoods /types/svelte-leafletjs/ @k-yle -/types/svelte-range-slider-pips/ @i7N3 /types/svg-arc-to-cubic-bezier/ @fcaylus /types/svg-baker-runtime/ @vagusX /types/svg-injector/ @poke From f76d35a2057a4e4a81978504f76f03a82b6f40de Mon Sep 17 00:00:00 2001 From: "typescript-automation[bot]" <290192711+typescript-automation[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2026 16:15:18 +0000 Subject: [PATCH 02/12] =?UTF-8?q?=F0=9F=A4=96=20Update=20support=20window?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/support-window.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/support-window.svg b/docs/support-window.svg index 210e709d18db6b..6d3174d2141e58 100644 --- a/docs/support-window.svg +++ b/docs/support-window.svg @@ -2,4 +2,4 @@ #gh-dark-mode-only:target { color: #ffffff; } -20252026202720285.65.75.85.96.07.05.65.75.85.96.07.02024-092024-112025-022025-072026-032026-072026-092026-112027-022027-072028-032028-07 \ No newline at end of file +2026202720285.75.85.96.07.05.75.85.96.07.02024-112025-022025-072026-032026-072026-112027-022027-072028-032028-07 \ No newline at end of file From 8e17004f4ac025f87d56674d6bc326616e300452 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2026 11:10:40 -0700 Subject: [PATCH 03/12] build(deps): bump the github-actions group across 2 directories with 1 update (#75572) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/actions/setup-for-scripts/action.yml | 2 +- .github/workflows/CI.yml | 4 ++-- .github/workflows/pnpm-cache.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-for-scripts/action.yml b/.github/actions/setup-for-scripts/action.yml index 54b238d0d087e9..23c323359bbdc5 100644 --- a/.github/actions/setup-for-scripts/action.yml +++ b/.github/actions/setup-for-scripts/action.yml @@ -7,7 +7,7 @@ runs: - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: '24' - - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: run_install: | - args: [--filter, ., --filter, '{./scripts}...'] diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 49a55cf22fcf85..16775941523f44 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -39,7 +39,7 @@ jobs: with: node-version: '24' - - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 - id: matrix run: | @@ -79,7 +79,7 @@ jobs: printf "Aborting: symlinks found:\n%s" "$symlinks"; exit 1 fi - - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 - name: Get pnpm cache info id: pnpm-cache diff --git a/.github/workflows/pnpm-cache.yml b/.github/workflows/pnpm-cache.yml index 457e774beed889..1109189e9e5347 100644 --- a/.github/workflows/pnpm-cache.yml +++ b/.github/workflows/pnpm-cache.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: '24' - - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 - name: Get pnpm cache info id: pnpm-cache From 85ddc4b01c1c5336833ec9604ac706e31e6a2c82 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 14 Sep 2026 11:10:53 -0700 Subject: [PATCH 04/12] Remove contributors with deleted accounts (#75570) Co-authored-by: typescript-automation[bot] <290192711+typescript-automation[bot]@users.noreply.github.com> --- types/video-name-parser/package.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/types/video-name-parser/package.json b/types/video-name-parser/package.json index be3cde5ccb8594..12344b3a59c65f 100644 --- a/types/video-name-parser/package.json +++ b/types/video-name-parser/package.json @@ -8,10 +8,5 @@ "devDependencies": { "@types/video-name-parser": "workspace:." }, - "owners": [ - { - "name": "Kira Oakley", - "githubUsername": "hackergrrl" - } - ] + "owners": [] } From dcba98d39cefcfcee0f07ffaf9dd1c9deebfed19 Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Tue, 15 Sep 2026 02:33:11 +0800 Subject: [PATCH 05/12] feat(itowns): remove types (#75547) --- attw.json | 1 - notNeededPackages.json | 4 + types/itowns/.npmignore | 5 - types/itowns/index.d.ts | 3 - types/itowns/itowns-tests.ts | 23 --- types/itowns/package.json | 29 ---- .../src/Controls/FirstPersonControls.d.ts | 55 ------ types/itowns/src/Controls/FlyControls.d.ts | 21 --- types/itowns/src/Controls/GlobeControls.d.ts | 157 ------------------ types/itowns/src/Controls/PlanarControls.d.ts | 76 --------- types/itowns/src/Controls/StreetControls.d.ts | 61 ------- types/itowns/src/Converter/Feature2Mesh.d.ts | 18 -- .../src/Core/3DTiles/C3DTBatchTable.d.ts | 20 --- .../C3DTBatchTableHierarchyExtension.d.ts | 13 -- .../src/Core/3DTiles/C3DTBoundingVolume.d.ts | 69 -------- .../src/Core/3DTiles/C3DTExtensions.d.ts | 10 -- .../itowns/src/Core/3DTiles/C3DTFeature.d.ts | 17 -- .../src/Core/3DTiles/C3DTilesEnums.d.ts | 11 -- types/itowns/src/Core/3DTiles/C3DTileset.d.ts | 19 --- types/itowns/src/Core/Feature.d.ts | 131 --------------- .../src/Core/Geographic/Coordinates.d.ts | 42 ----- types/itowns/src/Core/Geographic/Crs.d.ts | 32 ---- types/itowns/src/Core/Geographic/Extent.d.ts | 78 --------- .../itowns/src/Core/Geographic/GeoidGrid.d.ts | 21 --- types/itowns/src/Core/Label.d.ts | 56 ------- types/itowns/src/Core/MainLoop.d.ts | 30 ---- types/itowns/src/Core/Math/Ellipsoid.d.ts | 55 ------ .../src/Core/Prefab/Globe/GlobeLayer.d.ts | 11 -- types/itowns/src/Core/Prefab/GlobeView.d.ts | 46 ----- .../src/Core/Prefab/Planar/PlanarLayer.d.ts | 11 -- types/itowns/src/Core/Prefab/PlanarView.d.ts | 30 ---- types/itowns/src/Core/Style.d.ts | 92 ---------- .../itowns/src/Core/System/Capabilities.d.ts | 12 -- types/itowns/src/Core/View.d.ts | 145 ---------------- types/itowns/src/Layer/C3DTilesLayer.d.ts | 82 --------- types/itowns/src/Layer/ColorLayer.d.ts | 49 ------ types/itowns/src/Layer/ElevationLayer.d.ts | 42 ----- .../src/Layer/EntwinePointTileLayer.d.ts | 16 -- .../src/Layer/FeatureGeometryLayer.d.ts | 21 --- types/itowns/src/Layer/GeoidLayer.d.ts | 18 -- types/itowns/src/Layer/GeometryLayer.d.ts | 43 ----- types/itowns/src/Layer/LabelLayer.d.ts | 29 ---- types/itowns/src/Layer/Layer.d.ts | 91 ---------- .../itowns/src/Layer/LayerUpdateStrategy.d.ts | 18 -- .../itowns/src/Layer/OrientedImageLayer.d.ts | 10 -- types/itowns/src/Layer/PointCloudLayer.d.ts | 43 ----- types/itowns/src/Layer/PotreeLayer.d.ts | 20 --- .../itowns/src/Layer/TiledGeometryLayer.d.ts | 54 ------ types/itowns/src/Main.d.ts | 117 ------------- types/itowns/src/Parser/B3dmParser.d.ts | 20 --- .../src/Parser/CameraCalibrationParser.d.ts | 21 --- types/itowns/src/Parser/GDFParser.d.ts | 11 -- types/itowns/src/Parser/GTXParser.d.ts | 16 -- types/itowns/src/Parser/GeoJsonParser.d.ts | 13 -- types/itowns/src/Parser/GpxParser.d.ts | 13 -- types/itowns/src/Parser/ISGParser.d.ts | 15 -- types/itowns/src/Parser/KMLParser.d.ts | 11 -- types/itowns/src/Parser/LASParser.d.ts | 15 -- types/itowns/src/Parser/ShapefileParser.d.ts | 9 - .../itowns/src/Process/3dTilesProcessing.d.ts | 20 --- .../itowns/src/Process/FeatureProcessing.d.ts | 5 - .../LayeredMaterialNodeProcessing.d.ts | 8 - types/itowns/src/Provider/Fetcher.d.ts | 35 ---- types/itowns/src/Renderer/Camera.d.ts | 49 ------ .../src/Renderer/ColorLayersOrdering.d.ts | 12 -- .../itowns/src/Renderer/LayeredMaterial.d.ts | 75 --------- types/itowns/src/Renderer/OBB.d.ts | 27 --- .../src/Renderer/OrientedImageCamera.d.ts | 33 ---- types/itowns/src/Renderer/PointsMaterial.d.ts | 66 -------- .../src/Renderer/Shader/ShaderChunk.d.ts | 16 -- .../itowns/src/Source/C3DTilesIonSource.d.ts | 18 -- types/itowns/src/Source/C3DTilesSource.d.ts | 16 -- .../src/Source/EntwinePointTileSource.d.ts | 48 ------ types/itowns/src/Source/FileSource.d.ts | 27 --- .../src/Source/OrientedImageSource.d.ts | 27 --- types/itowns/src/Source/PotreeSource.d.ts | 36 ---- types/itowns/src/Source/Source.d.ts | 59 ------- types/itowns/src/Source/TMSSource.d.ts | 28 ---- .../itowns/src/Source/VectorTilesSource.d.ts | 27 --- types/itowns/src/Source/WFSSource.d.ts | 25 --- types/itowns/src/Source/WMSSource.d.ts | 40 ----- types/itowns/src/Source/WMTSSource.d.ts | 16 -- types/itowns/src/Utils/CameraUtils.d.ts | 62 ------- types/itowns/src/Utils/DEMUtils.d.ts | 59 ------- types/itowns/src/Utils/FeaturesUtils.d.ts | 11 -- types/itowns/src/Utils/OrientationUtils.d.ts | 109 ------------ types/itowns/test/3DTiles25D.ts | 109 ------------ types/itowns/test/3DTilesBasic.ts | 49 ------ types/itowns/test/3DTilesBatchTable.ts | 49 ------ types/itowns/test/3DTilesIon.ts | 92 ---------- types/itowns/test/Entwine3DLoader.ts | 80 --------- types/itowns/test/EntwineSimpleLoader.ts | 90 ---------- types/itowns/test/GeoidGeoidLayer.ts | 65 -------- types/itowns/test/Potree3DMap.ts | 48 ------ types/itowns/test/SourceFileFromFormat.ts | 61 ------- types/itowns/test/SourceFileFromMethods.ts | 63 ------- types/itowns/test/VectorTile3DMesh.ts | 116 ------------- types/itowns/test/VectorTileDragNDrop.ts | 60 ------- types/itowns/test/VectorTileRaster2D.ts | 45 ----- types/itowns/test/VectorTileRaster3D.ts | 47 ------ types/itowns/test/View25DMap.ts | 94 ----------- types/itowns/test/View2DMap.ts | 58 ------- types/itowns/test/View3DMap.ts | 47 ------ types/itowns/test/View3DmnsMap.ts | 45 ----- types/itowns/test/jsonLayers.ts | 85 ---------- types/itowns/tsconfig.json | 21 --- 106 files changed, 4 insertions(+), 4475 deletions(-) delete mode 100644 types/itowns/.npmignore delete mode 100644 types/itowns/index.d.ts delete mode 100644 types/itowns/itowns-tests.ts delete mode 100644 types/itowns/package.json delete mode 100644 types/itowns/src/Controls/FirstPersonControls.d.ts delete mode 100644 types/itowns/src/Controls/FlyControls.d.ts delete mode 100644 types/itowns/src/Controls/GlobeControls.d.ts delete mode 100644 types/itowns/src/Controls/PlanarControls.d.ts delete mode 100644 types/itowns/src/Controls/StreetControls.d.ts delete mode 100644 types/itowns/src/Converter/Feature2Mesh.d.ts delete mode 100644 types/itowns/src/Core/3DTiles/C3DTBatchTable.d.ts delete mode 100644 types/itowns/src/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts delete mode 100644 types/itowns/src/Core/3DTiles/C3DTBoundingVolume.d.ts delete mode 100644 types/itowns/src/Core/3DTiles/C3DTExtensions.d.ts delete mode 100644 types/itowns/src/Core/3DTiles/C3DTFeature.d.ts delete mode 100644 types/itowns/src/Core/3DTiles/C3DTilesEnums.d.ts delete mode 100644 types/itowns/src/Core/3DTiles/C3DTileset.d.ts delete mode 100644 types/itowns/src/Core/Feature.d.ts delete mode 100644 types/itowns/src/Core/Geographic/Coordinates.d.ts delete mode 100644 types/itowns/src/Core/Geographic/Crs.d.ts delete mode 100644 types/itowns/src/Core/Geographic/Extent.d.ts delete mode 100644 types/itowns/src/Core/Geographic/GeoidGrid.d.ts delete mode 100644 types/itowns/src/Core/Label.d.ts delete mode 100644 types/itowns/src/Core/MainLoop.d.ts delete mode 100644 types/itowns/src/Core/Math/Ellipsoid.d.ts delete mode 100644 types/itowns/src/Core/Prefab/Globe/GlobeLayer.d.ts delete mode 100644 types/itowns/src/Core/Prefab/GlobeView.d.ts delete mode 100644 types/itowns/src/Core/Prefab/Planar/PlanarLayer.d.ts delete mode 100644 types/itowns/src/Core/Prefab/PlanarView.d.ts delete mode 100644 types/itowns/src/Core/Style.d.ts delete mode 100644 types/itowns/src/Core/System/Capabilities.d.ts delete mode 100644 types/itowns/src/Core/View.d.ts delete mode 100644 types/itowns/src/Layer/C3DTilesLayer.d.ts delete mode 100644 types/itowns/src/Layer/ColorLayer.d.ts delete mode 100644 types/itowns/src/Layer/ElevationLayer.d.ts delete mode 100644 types/itowns/src/Layer/EntwinePointTileLayer.d.ts delete mode 100644 types/itowns/src/Layer/FeatureGeometryLayer.d.ts delete mode 100644 types/itowns/src/Layer/GeoidLayer.d.ts delete mode 100644 types/itowns/src/Layer/GeometryLayer.d.ts delete mode 100644 types/itowns/src/Layer/LabelLayer.d.ts delete mode 100644 types/itowns/src/Layer/Layer.d.ts delete mode 100644 types/itowns/src/Layer/LayerUpdateStrategy.d.ts delete mode 100644 types/itowns/src/Layer/OrientedImageLayer.d.ts delete mode 100644 types/itowns/src/Layer/PointCloudLayer.d.ts delete mode 100644 types/itowns/src/Layer/PotreeLayer.d.ts delete mode 100644 types/itowns/src/Layer/TiledGeometryLayer.d.ts delete mode 100644 types/itowns/src/Main.d.ts delete mode 100644 types/itowns/src/Parser/B3dmParser.d.ts delete mode 100644 types/itowns/src/Parser/CameraCalibrationParser.d.ts delete mode 100644 types/itowns/src/Parser/GDFParser.d.ts delete mode 100644 types/itowns/src/Parser/GTXParser.d.ts delete mode 100644 types/itowns/src/Parser/GeoJsonParser.d.ts delete mode 100644 types/itowns/src/Parser/GpxParser.d.ts delete mode 100644 types/itowns/src/Parser/ISGParser.d.ts delete mode 100644 types/itowns/src/Parser/KMLParser.d.ts delete mode 100644 types/itowns/src/Parser/LASParser.d.ts delete mode 100644 types/itowns/src/Parser/ShapefileParser.d.ts delete mode 100644 types/itowns/src/Process/3dTilesProcessing.d.ts delete mode 100644 types/itowns/src/Process/FeatureProcessing.d.ts delete mode 100644 types/itowns/src/Process/LayeredMaterialNodeProcessing.d.ts delete mode 100644 types/itowns/src/Provider/Fetcher.d.ts delete mode 100644 types/itowns/src/Renderer/Camera.d.ts delete mode 100644 types/itowns/src/Renderer/ColorLayersOrdering.d.ts delete mode 100644 types/itowns/src/Renderer/LayeredMaterial.d.ts delete mode 100644 types/itowns/src/Renderer/OBB.d.ts delete mode 100644 types/itowns/src/Renderer/OrientedImageCamera.d.ts delete mode 100644 types/itowns/src/Renderer/PointsMaterial.d.ts delete mode 100644 types/itowns/src/Renderer/Shader/ShaderChunk.d.ts delete mode 100644 types/itowns/src/Source/C3DTilesIonSource.d.ts delete mode 100644 types/itowns/src/Source/C3DTilesSource.d.ts delete mode 100644 types/itowns/src/Source/EntwinePointTileSource.d.ts delete mode 100644 types/itowns/src/Source/FileSource.d.ts delete mode 100644 types/itowns/src/Source/OrientedImageSource.d.ts delete mode 100644 types/itowns/src/Source/PotreeSource.d.ts delete mode 100644 types/itowns/src/Source/Source.d.ts delete mode 100644 types/itowns/src/Source/TMSSource.d.ts delete mode 100644 types/itowns/src/Source/VectorTilesSource.d.ts delete mode 100644 types/itowns/src/Source/WFSSource.d.ts delete mode 100644 types/itowns/src/Source/WMSSource.d.ts delete mode 100644 types/itowns/src/Source/WMTSSource.d.ts delete mode 100644 types/itowns/src/Utils/CameraUtils.d.ts delete mode 100644 types/itowns/src/Utils/DEMUtils.d.ts delete mode 100644 types/itowns/src/Utils/FeaturesUtils.d.ts delete mode 100644 types/itowns/src/Utils/OrientationUtils.d.ts delete mode 100644 types/itowns/test/3DTiles25D.ts delete mode 100644 types/itowns/test/3DTilesBasic.ts delete mode 100644 types/itowns/test/3DTilesBatchTable.ts delete mode 100644 types/itowns/test/3DTilesIon.ts delete mode 100644 types/itowns/test/Entwine3DLoader.ts delete mode 100644 types/itowns/test/EntwineSimpleLoader.ts delete mode 100644 types/itowns/test/GeoidGeoidLayer.ts delete mode 100644 types/itowns/test/Potree3DMap.ts delete mode 100644 types/itowns/test/SourceFileFromFormat.ts delete mode 100644 types/itowns/test/SourceFileFromMethods.ts delete mode 100644 types/itowns/test/VectorTile3DMesh.ts delete mode 100644 types/itowns/test/VectorTileDragNDrop.ts delete mode 100644 types/itowns/test/VectorTileRaster2D.ts delete mode 100644 types/itowns/test/VectorTileRaster3D.ts delete mode 100644 types/itowns/test/View25DMap.ts delete mode 100644 types/itowns/test/View2DMap.ts delete mode 100644 types/itowns/test/View3DMap.ts delete mode 100644 types/itowns/test/View3DmnsMap.ts delete mode 100644 types/itowns/test/jsonLayers.ts delete mode 100644 types/itowns/tsconfig.json diff --git a/attw.json b/attw.json index ef9f7a81594b1f..85be3496f84ad8 100644 --- a/attw.json +++ b/attw.json @@ -149,7 +149,6 @@ "intl-unofficial-duration-unit-format", "iput", "itemsjs", - "itowns", "jackrabbit", "jasmine", "jcof", diff --git a/notNeededPackages.json b/notNeededPackages.json index 503bc676a88077..5754d5b772d11b 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -3493,6 +3493,10 @@ "libraryName": "it-pushable", "asOfVersion": "1.4.0" }, + "itowns": { + "libraryName": "itowns", + "asOfVersion": "2.46.0" + }, "jasmine-expect": { "libraryName": "jasmine-expect", "asOfVersion": "3.8.1" diff --git a/types/itowns/.npmignore b/types/itowns/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/itowns/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/itowns/index.d.ts b/types/itowns/index.d.ts deleted file mode 100644 index f680abcabc8133..00000000000000 --- a/types/itowns/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./src/Main"; - -export as namespace itowns; diff --git a/types/itowns/itowns-tests.ts b/types/itowns/itowns-tests.ts deleted file mode 100644 index c34b47e90ea32d..00000000000000 --- a/types/itowns/itowns-tests.ts +++ /dev/null @@ -1,23 +0,0 @@ -import "./test/View3DMap"; -import "./test/View25DMap"; -import "./test/View2DMap"; -import "./test/View3DmnsMap"; - -import "./test/GeoidGeoidLayer"; - -import "./test/3DTilesBasic"; -import "./test/3DTiles25D"; -import "./test/3DTilesBatchTable"; -import "./test/3DTilesIon"; - -import "./test/Potree3DMap"; -import "./test/EntwineSimpleLoader"; -import "./test/Entwine3DLoader"; - -import "./test/VectorTileRaster3D"; -import "./test/VectorTileRaster2D"; -import "./test/VectorTile3DMesh"; -import "./test/VectorTileDragNDrop"; - -import "./test/SourceFileFromFormat"; -import "./test/SourceFileFromMethods"; diff --git a/types/itowns/package.json b/types/itowns/package.json deleted file mode 100644 index a02c55f3d6aa9a..00000000000000 --- a/types/itowns/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "private": true, - "name": "@types/itowns", - "version": "2.42.9999", - "projects": [ - "https://itowns.github.io/" - ], - "dependencies": { - "@types/three": "*" - }, - "devDependencies": { - "@types/itowns": "workspace:.", - "proj4": "^2.19.0" - }, - "owners": [ - { - "name": "Bouillaguet Quentin", - "githubUsername": "desplandis" - }, - { - "name": "Madec Germerie", - "githubUsername": "mgermerie" - }, - { - "name": "Raphaƫl Duhen", - "githubUsername": "HoloTheDrunk" - } - ] -} diff --git a/types/itowns/src/Controls/FirstPersonControls.d.ts b/types/itowns/src/Controls/FirstPersonControls.d.ts deleted file mode 100644 index 065235215e92fc..00000000000000 --- a/types/itowns/src/Controls/FirstPersonControls.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import * as THREE from "three"; - -import View from "../Core/View"; - -// TODO: Define public API - -export interface FirstPersonControlsOptions { - focusOnClick?: boolean; - focusOnMouseOver?: boolean; - moveSpeed?: number; - verticalFOV?: number; - panoramaRatio?: number; - disableEventListeners?: boolean; -} - -declare class FirstPersonControls extends THREE.EventDispatcher { - constructor(view: View, options?: FirstPersonControlsOptions); - - readonly isFirstPersonControls: boolean; - - camera: THREE.Camera; - view: View; - moves: Set; // TODO - options: FirstPersonControlsOptions; - // eventListeners: boolean; TODO - focusOnMouseOver: boolean; - focusOnClick: boolean; - // moveCameraVertical: typeof moveCameraVerticalGlobe; - - // isUserInteracting(): boolean; - - reset(preserveRotationOnX?: boolean): void; - - // update(dt: number, updateLoopRestarted: boolean, force: boolean): void; - - // onMouseDown(event: any): void; - - // onMouseUp(event: any): void; - - // onMouseMove(event: any): void; - - // onMouseWheel(event: any): void; - - // onKeyUp(e: any): void; - - // onKeyDown(e: any): void; - - // onContextMenu(event: any): void; - - // dispose(): void; -} - -export default FirstPersonControls; - -// declare function moveCameraVerticalGlobe(value: any): void; diff --git a/types/itowns/src/Controls/FlyControls.d.ts b/types/itowns/src/Controls/FlyControls.d.ts deleted file mode 100644 index 923cf364d216d0..00000000000000 --- a/types/itowns/src/Controls/FlyControls.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import * as THREE from "three"; -import View from "../Core/View"; - -export interface FlyControlsOptions { - focusOnClick?: boolean; - focusOnMouseOver?: boolean; -} - -declare class FlyControls extends THREE.EventDispatcher { - constructor(view: View, options?: FlyControlsOptions); - - view: View; - options: FlyControlsOptions; - moves: Set; // TODO: typecheck - moveSpeed: number; - - // isUserInteracting(): boolean; - // update(dt: number, updateLoopRestarted: boolean): void; -} - -export default FlyControls; diff --git a/types/itowns/src/Controls/GlobeControls.d.ts b/types/itowns/src/Controls/GlobeControls.d.ts deleted file mode 100644 index 405d5a6ae1d244..00000000000000 --- a/types/itowns/src/Controls/GlobeControls.d.ts +++ /dev/null @@ -1,157 +0,0 @@ -import * as THREE from "three"; -import Coordinates from "../Core/Geographic/Coordinates"; -import Extent from "../Core/Geographic/Extent"; -import GlobeView from "../Core/Prefab/GlobeView"; -import CameraUtils from "../Utils/CameraUtils"; - -// TODO: Define public API - -export enum CONTROL_EVENTS { - PAN_CHANGED = "pan-changed", - ORIENTATION_CHANGED = "orientation-changed", - RANGE_CHANGED = "range-changed", - CAMERA_TARGET_CHANGED = "camera-target-changed", -} - -interface GlobeControls { - zoomFactor: number; - minDistance: number; - maxDistance: number; - minZoom: number; - maxZoom: number; - rotateSpeed: number; - keyPanSpeed: number; - minPolarAngle: number; - maxPolarAngle: number; - minAzimuthAngle: number; - maxAzimuthAngle: number; - handleCollision: boolean; - enableDamping: boolean; - dampingMoveFactor: number; -} - -export type GlobeControlsOptions = Partial; - -declare class GlobeControls extends THREE.EventDispatcher { - constructor( - view: GlobeView, - placement: CameraUtils.CameraTransformOptions | Extent, - options?: GlobeControlsOptions, - ); - - // player: AnimationPlayer; - // view: View - // camera: THREE.Camera; - // states: StateControl; - // minDistanceCollision: number; - // startEvent: { - // type: string; - // }; - // endEvent: { - // type: string; - // }; - // updateHelper: (position: any, helper: any) => void; - - // get dollyInScale(): number; - - // get dollyOutScale(): number; - - // get isPaused(): boolean; - - // onEndingMove(current: any): void; - - // rotateLeft(angle?: number): void; - - // rotateUp(angle?: number): void; - - // panLeft(distance: any): void; - - // panUp(distance: any): void; - - // mouseToPan(deltaX: any, deltaY: any): void; - - // dolly(delta: any): void; - - // getMinDistanceCameraBoundingSphereObbsUp(tile: any): void; - - // update(state?: any): void; - - // onStateChange(event: any): void; - - // handleRotation(event: any): void; - - // handleDrag(event: any): void; - - // handleDolly(event: any): void; - - // handlePan(event: any): void; - - // handlePanoramic(event: any): void; - - // handleEndMovement(event?: {}): void; - - // updateTarget(): void; - - // handlingEvent(current: any): void; - - // travel(event: any): Promise | undefined; - - // handleZoom(event: any): void; - - // onTouchStart(event: any): void; - - // onTouchMove(event: any): void; - - // onTouchEnd(): void; - - // dispose(): void; - - setTilt(tilt: number, isAnimated: boolean): Promise; - - setHeading(heading: number, isAnimated: boolean): Promise; - - setRange(range: number, isAnimated: boolean): Promise; - - getCameraTargetPosition(): THREE.Vector3; - - getRange(position?: THREE.Vector3): number; - - getTilt(position?: THREE.Vector3): number; - - getHeading(position?: THREE.Vector3): number; - - pan(pVector: THREE.Vector2): Promise; - - getCameraOrientation(): number[]; - - getCameraCoordinate(): Coordinates; - - getLookAtCoordinate(): Coordinates; - - setAnimationEnabled(enable: boolean): void; - - isAnimationEnabled(): boolean; - - getZoom(): number; - - setZoom(zoom: number, isAnimated: boolean): Promise; - - getScale(pitch: number): number; - - pixelsToMeters(pixels: number, pixelPitch?: number): number; - - pixelsToDegrees(pixels: number, pixelPitch?: number): number; - - metersToPixels(value: number, pixelPitch?: number): number; - - setScale(scale: number, pitch: number, isAnimated: boolean): Promise; - - lookAtCoordinate( - params?: CameraUtils.CameraTransformOptions | Extent, - isAnimated?: boolean, - ): Promise; - - pickGeoPosition(windowCoords: THREE.Vector3): Coordinates; -} - -export default GlobeControls; diff --git a/types/itowns/src/Controls/PlanarControls.d.ts b/types/itowns/src/Controls/PlanarControls.d.ts deleted file mode 100644 index c8dcb44622cd3b..00000000000000 --- a/types/itowns/src/Controls/PlanarControls.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import * as THREE from "three"; -import PlanarView from "../Core/Prefab/PlanarView"; - -// TODO: Define public API - -// export enum keys { -// CTRL = 17, -// SPACE = 32, -// T = 84, -// Y = 89, -// } - -export enum STATE { - NONE = -1, - DRAG = 0, - PAN = 1, - ROTATE = 2, - TRAVEL = 3, - ORTHO_ZOOM = 4, -} - -export enum PLANAR_CONTROL_EVENT { - MOVED = "moved", -} - -interface PlanarControls { - enabled: boolean; - enableRotation: boolean; - enableSmartTravel: boolean; - enablePan: boolean; - rotateSpeed: number; - maxPanSpeed: number; - minPanSpeed: number; - zoomTravelTime: number; - maxResolution: number; - minResolution: number; - maxAltitude: number; - groundLevel: number; - autoTravelTimeMin: number; - autoTravelTimeMax: number; - autoTravelTimeDist: number; - smartTravelHeightMin: number; - smartTravelHeightMax: number; - instantTravel: number; - minZenithAngle: number; - maxZenithAngle: number; - handleCollision: boolean; -} - -export interface PlanarControlsOptions extends Partial { - zoomFactor?: number; -} - -declare class PlanarControls extends THREE.EventDispatcher { - constructor(view: PlanarView, options?: {}); // TODO - - // view: PlanarView; - // camera: THREE.Camera; - // zoomInFactor: number; - // zoomOutFactor: number; - // minDistanceCollision: number; - // state: STATE; - // cursor: { - // default: string; - // drag: string; - // pan: string; - // travel: string; - // rotate: string; - // ortho_zoom: string; - // }; - - // dispose(): void; - // update(dt: number, updateLoopRestarted: boolean): void; -} - -export default PlanarControls; diff --git a/types/itowns/src/Controls/StreetControls.d.ts b/types/itowns/src/Controls/StreetControls.d.ts deleted file mode 100644 index d6bba01d9103d8..00000000000000 --- a/types/itowns/src/Controls/StreetControls.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as THREE from "three"; -import View from "../Core/View"; -import FirstPersonControls, { FirstPersonControlsOptions } from "./FirstPersonControls"; - -// TODO: Define public API - -interface StreetControls { - wallMaxDistance: number; - animationDurationWall: number; - surfaceGround: THREE.Mesh; - surfaceWall: THREE.Mesh; - buildingsLayer?: string; - computeTime: (distance: number) => number; - offset: number; - // transformationPositionPickOnTheGround: (position: number) => number; -} - -export type StreetControlsOptions = Partial; - -declare class StreetControls extends FirstPersonControls { - constructor(view: View, options?: StreetControlsOptions); - - readonly isStreetControls: boolean; - - // previousPosition: any; - // currentPosition: any; - // nextPosition: any; - keyGoToNextPosition: number; - keyGoToPreviousPosition: number; - keySetCameraToCurrentPositionAndLookAtNext: number; - keySetCameraToCurrentPositionAndLookAtPrevious: number; - // tweenGroup: any; - // surfaces: THREE.Object3D; - // end: any; - // tween: any; - // animationFrameRequester: (() => void) | (() => void) | null | undefined; - - // setCurrentPosition(newCurrentPosition: any): void; - - // setNextPosition(newNextPosition: any): void; - - // setPreviousPosition(newPreviousPosition: any): void; - - setCameraToCurrentPosition(lookAtPrevious: boolean): void; - - setCameraOnPosition(position: THREE.Vector3, lookAt: THREE.Vector3): void; - - onClickOnGround(position: THREE.Vector3): void; - - onClickOnWall(position: THREE.Vector3): void; - - animateCameraLookAt(position: THREE.Vector3, time: number): void; - - moveCameraTo(position: THREE.Vector3, time?: number): Promise; - - // stopAnimations(): void; - - moveCameraToCurrentPosition(): void; -} - -export default StreetControls; diff --git a/types/itowns/src/Converter/Feature2Mesh.d.ts b/types/itowns/src/Converter/Feature2Mesh.d.ts deleted file mode 100644 index 22308e44d91bf8..00000000000000 --- a/types/itowns/src/Converter/Feature2Mesh.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import * as THREE from "three"; -import { FeatureCollection } from "../Core/Feature"; -import Style from "../Core/Style"; - -export interface Feature2MeshOptions { - batchId?: (props: unknown, featureId: number) => number; - // pointsMaterial?: THREE.Material; - // lineMaterial?: THREE.Material; - // polygonMaterial?: THREE.Material; - style?: Style; -} - -type Feature2Mesh = (collection: FeatureCollection) => THREE.Object3D; - -declare namespace _default { - function convert(options?: Feature2MeshOptions): Feature2Mesh; -} -export default _default; diff --git a/types/itowns/src/Core/3DTiles/C3DTBatchTable.d.ts b/types/itowns/src/Core/3DTiles/C3DTBatchTable.d.ts deleted file mode 100644 index 4b5b83954aca46..00000000000000 --- a/types/itowns/src/Core/3DTiles/C3DTBatchTable.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { C3DTilesTypes } from "./C3DTilesEnums"; - -declare class C3DTBatchTable { - constructor( - buffer: ArrayBuffer, - jsonLength: number, - binaryLength: number, - batchLength: number, - registeredExtensions: any, - ); // TODO - - type: C3DTilesTypes; - batchLength: number; - extensions?: any; // TODO - content: any; // TODO - - getInfoById(batchID: number): any; // TODO (maybe unknown) -} - -export default C3DTBatchTable; diff --git a/types/itowns/src/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts b/types/itowns/src/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts deleted file mode 100644 index 62edfc21891c7c..00000000000000 --- a/types/itowns/src/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare class C3DTBatchTableHierarchyExtension { - constructor(json: object); // TODO - - classes: any; // TODO - inverseHierarchy: any; // TODO - instancesIdxs: Array<{ // TODO - classId: any; - instanceIdx: any; - }>; - getInfoById(featureId: number): any; // TODO -} - -export default C3DTBatchTableHierarchyExtension; diff --git a/types/itowns/src/Core/3DTiles/C3DTBoundingVolume.d.ts b/types/itowns/src/Core/3DTiles/C3DTBoundingVolume.d.ts deleted file mode 100644 index d7f3d5ac6786d3..00000000000000 --- a/types/itowns/src/Core/3DTiles/C3DTBoundingVolume.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import * as THREE from "three"; -import Camera from "../../Renderer/Camera"; -import OBB from "../../Renderer/OBB"; -import C3DTExtensions from "./C3DTExtensions"; -import { C3DTilesTypes } from "./C3DTilesEnums"; - -interface BoundingBox { - box: [ - number, - number, - number, // x, y and z values of the center of the box - number, - number, - number, // x axis direction and half-length - number, - number, - number, // y axis direction and half-length - number, - number, - number, // z axis direction and half-length - ]; -} - -interface BoundingRegion { - region: [ - /* west */ number, - /* south */ number, - /* east */ number, - /* north */ number, - /* minimum height */ number, - /* maximum height */ number, - ]; -} - -interface BoundingSphere { - sphere: [ - /* x */ number, - /* y */ number, - /* z */ number, - /* center */ number, - ]; -} - -export type BoundingVolume = BoundingBox | BoundingRegion | BoundingSphere; - -declare class C3DTBoundingVolume { - constructor( - json: BoundingVolume, - inverseTileTransform: THREE.Matrix4, - registeredExtensions: C3DTExtensions, - ); - - readonly type: "boundingvolume"; - readonly initialVolume: "region" | "box" | "sphere"; - volume: /* THREE.Sphere | THREE.Box3 */ any; - extensions: unknown; - - boundingVolumeCulling( - camera: Camera, - tileMatrixWorld: THREE.Matrix4, - ): boolean; - - viewerRequestVolumeCulling( - camera: Camera, - tileMatrixWorld: THREE.Matrix4, - ): boolean; -} - -export default C3DTBoundingVolume; diff --git a/types/itowns/src/Core/3DTiles/C3DTExtensions.d.ts b/types/itowns/src/Core/3DTiles/C3DTExtensions.d.ts deleted file mode 100644 index 1b0b9bf2d64cd6..00000000000000 --- a/types/itowns/src/Core/3DTiles/C3DTExtensions.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { C3DTilesTypes } from "./C3DTilesEnums"; - -declare class C3DTExtensions { - registerExtension(extensionName: string, extensionManagers: any): void; // TODO - getExtension(extensionName: string, type: C3DTilesTypes): object; // TODO - isExtensionRegistered(extensionName: string): boolean; - parseExtensions(extensionsJSON: object, type: C3DTilesTypes): object; // TODO -} - -export default C3DTExtensions; diff --git a/types/itowns/src/Core/3DTiles/C3DTFeature.d.ts b/types/itowns/src/Core/3DTiles/C3DTFeature.d.ts deleted file mode 100644 index 96bd2eb2a7b50c..00000000000000 --- a/types/itowns/src/Core/3DTiles/C3DTFeature.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -declare class C3DTFeature { - constructor( - tileId: number, - batchId: number, - groups: Array<{ start: number; count: number }>, - info: object, // TODO - userData?: object, - ); // TODO - - tileId: number; - batchId: number; - groups: Array<{ start: number; count: number }>; - userData: object; // TODO - getInfo(): object; // TODO -} - -export default C3DTFeature; diff --git a/types/itowns/src/Core/3DTiles/C3DTilesEnums.d.ts b/types/itowns/src/Core/3DTiles/C3DTilesEnums.d.ts deleted file mode 100644 index cab1fc3a538156..00000000000000 --- a/types/itowns/src/Core/3DTiles/C3DTilesEnums.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export enum C3DTilesTypes { - tileset = "tileset", - batchtable = "batchtable", - boundingvolume = "boundingvolume", -} - -export enum C3DTilesBoundingVolumeTypes { - region = "region", - box = "box", - sphere = "sphere", -} diff --git a/types/itowns/src/Core/3DTiles/C3DTileset.d.ts b/types/itowns/src/Core/3DTiles/C3DTileset.d.ts deleted file mode 100644 index 25ac576f28c24a..00000000000000 --- a/types/itowns/src/Core/3DTiles/C3DTileset.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { C3DTilesTypes } from "./C3DTilesEnums"; - -declare class C3DTileset { - constructor(json: any, baseURL: string, registeredExtensions: any); // TODO - - type: C3DTilesTypes; - asset: any; // TODO - properties: any; // TODO - geometricError: number; - extensionsUsed: string[]; - extensionsRequired: string[]; - tiles: any[]; // TODO - extensions?: any; // TODO - - parseTiles(tile: object, baseURL: string, parent: object, registeredExtensions: object): void; // TODO - extendTileset(tileset: any, nodeId: any, baseURL: any, registeredExtensions: any): void; // TODO -} - -export default C3DTileset; diff --git a/types/itowns/src/Core/Feature.d.ts b/types/itowns/src/Core/Feature.d.ts deleted file mode 100644 index 0cdf5d553a4d96..00000000000000 --- a/types/itowns/src/Core/Feature.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -import * as THREE from "three"; -import Layer from "../Layer/Layer"; -import Coordinates from "./Geographic/Coordinates"; -import Extent from "./Geographic/Extent"; -import Style from "./Style"; - -// TODO: Document public API - -export enum FEATURE_TYPES { - POINT = 0, - LINE = 1, - POLYGON = 2, -} - -export interface FeatureBuildingOptions { // TODO - crs: string; - structure?: "2d" | "3d"; - filteringExtent?: any; // Event | boolean - buildExtent?: any; // boolean - forcedExtentCrs?: string; - filter?: any; // function - mergeFeatures?: boolean; - style?: Style; -} - -type FeatureType = "point" | "line" | "polygon"; - -export class FeatureGeometry { // TODO - constructor(feature: Feature); - - extent?: Extent; - indices: any[]; // { offset: number, count: number, extent: Extent } - properties: unknown; - // size: number; - // altitude: { - // min: number; - // max: number; - // }; - - // startSubGeometry(count: number, feature: Feature): void; - - // closeSubGeometry(count: number, feature: Feature): void; - - // getLastSubGeometry(): any; - - // baseAltitude(feature: any, coordinates: any): any; - - // pushCoordinates(coordIn: Coordinates, feature: Feature): void; - - // pushCoordinatesValues( - // feature: Feature, - // long: number, - // lat: number, - // normal?: THREE.Vector3, - // ): void; - - // updateExtent(): void; -} - -declare class Feature { // TODO - constructor( - type: FeatureType, - collection: FeatureCollection, - ); - - type: FeatureType; - vertices: number[]; - normals?: number[]; - size: number; - hasRawElevationData: boolean; - crs: string; - geometries: FeatureGeometry[]; - extent?: Extent; - // transformToLocalSystem: (coordinates: Coordinates) => Coordinates; - // useCrsOut: boolean | undefined; - // style: Style; - // altitude: { - // min: number; - // max: number; - // }; - - // bindNewGeometry(): FeatureGeometry; - - // updateExtent(geometry: FeatureGeometry): void; - - get geometryCount(): number; -} - -export default Feature; - -export class FeatureCollection extends THREE.Object3D { // TODO - constructor(options: FeatureBuildingOptions | Layer); - - readonly isFeatureCollection: true; - - features: Feature[]; - extent: Extent; - crs: string; - size: number; - style: Style; - isInverted: boolean; - matrixWorldInverse: THREE.Matrix4; - center: Coordinates; - // mergeFeatures: boolean; - // filterExtent: any; - // normalMatrixInverse: THREE.Matrix3; - // altitude: { - // min: number; - // max: number; - // }; - - // transformToLocalSystem(coordinates: Coordinates): Coordinates; - - // updateExtent(extent: Extent): void; - - // updateMatrixWorld(force: boolean): void; - - // removeEmptyFeature(): void; - - // pushFeature(feature: Feature): void; - - // requestFeature(type: FeatureType, callback: any): any; - - // requestFeatureByType(type: string): Feature; - - // requestFeatureById(id: string, type: FeatureType): Feature; - - // newFeatureByReference(feature: Feature): Feature; - - // setParentStyle(style: any): void; -} diff --git a/types/itowns/src/Core/Geographic/Coordinates.d.ts b/types/itowns/src/Core/Geographic/Coordinates.d.ts deleted file mode 100644 index 72a670e7811238..00000000000000 --- a/types/itowns/src/Core/Geographic/Coordinates.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import * as THREE from "three"; - -declare class Coordinates { - // TODO: Reformulate type - constructor(crs: string, v0?: number | THREE.Vector3 | Coordinates | number[], v1?: number, v2?: number); - - readonly isCoordinates: true; - - crs: string; - x: number; - y: number; - z: number; - - setCrs(crs: string): void; - setFromValues(x?: number, y?: number, z?: number): this; - setFromArray(array: ArrayLike, offset?: number): this; - setFromVector3(v0: THREE.Vector3Like): this; - - clone(): this; - copy(src: Coordinates): this; - - get longitude(): number; - get latitude(): number; - get altitude(): number; - - set altitude(value: number); - - get geodesicNormal(): THREE.Vector3; - - toVector3(target?: THREE.Vector3): THREE.Vector3; - toArray(target?: number[], offset?: number): number[]; - - planarDistanceTo(coord: Coordinates): number; - geodeticDistanceTo(coord: Coordinates): number; - spatialEuclideanDistanceTo(coord: Coordinates): number; - - applyMatrix4(mat: THREE.Matrix4): this; - - as(crs: string, target?: Coordinates): this; -} - -export default Coordinates; diff --git a/types/itowns/src/Core/Geographic/Crs.d.ts b/types/itowns/src/Core/Geographic/Crs.d.ts deleted file mode 100644 index 84fba9191fbd4f..00000000000000 --- a/types/itowns/src/Core/Geographic/Crs.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -declare enum UNIT { - DEGREE = 1, - METER = 2, -} - -declare const _default: { - UNIT: UNIT; - - isValid(crs: string): void; - isGeographic(crs: string): boolean; - isMetricUnit(crs: string): boolean; - - toUnit(crs: string): UNIT | undefined; - - is4326(crs: string): boolean; - isGeocentric(crs: string): boolean; - - reasonnableEpsilon(crs: string): number; - - formatToEPSG(crs: string): string; - formatToTms(crs: string): string; - - isTms(crs: string): boolean; - isEpsg(crs: string): boolean; - - tms_3857: string; - tms_4326: string; - - defs(code: string, proj4def: string): void; -}; - -export default _default; diff --git a/types/itowns/src/Core/Geographic/Extent.d.ts b/types/itowns/src/Core/Geographic/Extent.d.ts deleted file mode 100644 index 740cf377aaa17b..00000000000000 --- a/types/itowns/src/Core/Geographic/Extent.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -import * as THREE from "three"; -import Coordinates from "./Coordinates"; - -// export const globalExtentTMS: Map; -// export const schemeTiles: Map; - -declare class Extent { - static fromBox3(crs: string, box: THREE.Box3): Extent; - - // TODO: Explicit constructor type - constructor(crs: string, v0: number | number[] | Coordinates, v1?: number | Coordinates, v2?: number, v3?: number); - - readonly isExtent: true; - - crs: string; - zoom: number; - row: number | undefined; - col: number | undefined; - west: number | undefined; - east: number | undefined; - south: number | undefined; - north: number | undefined; - - clone(): Extent; - - tiledCovering(crs: string): Extent[]; - - as(crs: string, target: Extent): Extent; - - center(target?: Coordinates): Coordinates; - - dimensions(target?: THREE.Vector2): THREE.Vector2; - - planarDimensions(target?: THREE.Vector2): THREE.Vector2; - - geodeticDimensions(target?: THREE.Vector2): THREE.Vector2; - - spatialEuclideanDimensions(target?: THREE.Vector2): THREE.Vector2; - - isPointInside(coord: Coordinates, epsilon?: number): boolean; - - isInside(extent: Extent, epsilon: number): boolean; - - offsetToParent(extent: Extent, target?: THREE.Vector4): THREE.Vector4; - - tiledExtentParent(levelParent: number): Extent; - - intersectsExtent(extent: Extent): boolean; - - intersect(extent: Extent): Extent; - - // TODO: Explicit constructor type - set(v0: number | number[] | Coordinates | Extent, v1?: number | Coordinates, v2?: number, v3?: number): Extent; - - copy(extent: Extent): Extent; - - union(extent: Extent): void; - - expandByCoordinates(coordinates: Coordinates): void; - - expandByValuesCoordinates(we: number, sn: number): void; - - toString(separator?: string): string; - - subdivision(): Extent[]; - - subdivisionByScheme(scheme?: THREE.Vector2): Extent[]; - - applyMatrix4(matrix: THREE.Matrix4): Extent; - - clampSouthNorth(south?: number, north?: number): Extent; - - clampWestEast(west?: number, east?: number): Extent; - - clampByExtent(extent: Extent): Extent; -} - -export default Extent; diff --git a/types/itowns/src/Core/Geographic/GeoidGrid.d.ts b/types/itowns/src/Core/Geographic/GeoidGrid.d.ts deleted file mode 100644 index f1223989a18815..00000000000000 --- a/types/itowns/src/Core/Geographic/GeoidGrid.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import * as THREE from "three"; -import Coordinates from "./Coordinates"; -import Extent from "./Extent"; - -declare class GeoidGrid { - constructor( - extent: Extent, - step: THREE.Vector2, - getData: (x: number, y: number) => number, - ); - - extent: Extent; - step: THREE.Vector2; - dimensions: THREE.Vector2; - dataSize: THREE.Vector2; - getData: (x: number, y: number) => number; - - getHeightAtCoordinates(coordinates: Coordinates): number; -} - -export default GeoidGrid; diff --git a/types/itowns/src/Core/Label.d.ts b/types/itowns/src/Core/Label.d.ts deleted file mode 100644 index 5b6c475fa2b38d..00000000000000 --- a/types/itowns/src/Core/Label.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import * as THREE from "three"; -import Coordinates from "./Geographic/Coordinates"; -import Style from "./Style"; - -// TODO: Define public API -declare class Label extends THREE.Object3D { - constructor( - content: string | Element, - coordinates: Coordinates, - style?: Style, - ); - - readonly isLabel: true; - - // content: Element; - // // TODO positon: THREE.Vector3 - // padding: number; - // coordinates: Coordinates; - // order: number; - - // projectedPosition: { - // x: number; - // y: number; - // }; - // boundaries: { - // left: number; - // right: number; - // top: number; - // bottom: number; - // }; - // baseContent: string | Element; - // anchor: any; - // styleOffset: any; - // icon: any; - // iconOffset: { - // left: number; - // right: number; - // top: number; - // bottom: number; - // }; - // zoom: { - // min: any; - // max: any; - // }; - // updateProjectedPosition(x: number, y: number): void; - // updateCSSPosition(): void; - // initDimensions(): void; - // offset: { - // left: any; - // top: any; - // } | undefined; - // update3dPosition(crs: any): void; - // updateElevationFromLayer(layer: any): true | undefined; - // updateHorizonCullingPoint(): void; -} -export default Label; diff --git a/types/itowns/src/Core/MainLoop.d.ts b/types/itowns/src/Core/MainLoop.d.ts deleted file mode 100644 index f56825c248385d..00000000000000 --- a/types/itowns/src/Core/MainLoop.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import * as THREE from "three"; -import View from "./View"; - -export const RENDERING_PAUSED: 0; -export const RENDERING_SCHEDULED: 1; -export type RenderingState = typeof RENDERING_SCHEDULED | typeof RENDERING_SCHEDULED; - -export enum MAIN_LOOP_EVENTS { - UPDATE_START = "update_start", - BEFORE_CAMERA_UPDATE = "before_camera_update", - AFTER_CAMERA_UPDATE = "after_camera_update", - BEFORE_LAYER_UPDATE = "before_layer_update", - AFTER_LAYER_UPDATE = "after_layer_update", - BEFORE_RENDER = "before_render", - AFTER_RENDER = "after_render", - UPDATE_END = "update_end", -} - -// TODO: THREE.Event or MAIN_LOOP_EVENTS? -// TODO: Usefulness of THREE.EventDispatcher? -declare class MainLoop extends THREE.EventDispatcher { - renderingState: RenderingState; - scheduler: any; // TODO - gfxEngine: any; // TODO - - scheduleViewUpdate(view: View, forceRedraw: boolean): void; - // step(view: any, timestamp: number): void; // TODO -} - -export default MainLoop; diff --git a/types/itowns/src/Core/Math/Ellipsoid.d.ts b/types/itowns/src/Core/Math/Ellipsoid.d.ts deleted file mode 100644 index fb30583c103308..00000000000000 --- a/types/itowns/src/Core/Math/Ellipsoid.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import * as THREE from "three"; -import Coordinates from "../Geographic/Coordinates"; - -export const ellipsoidSizes: THREE.Vector3; - -declare class Ellipsoid { - // TODO: Not documented in API - constructor(size?: THREE.Vector3); - - // TODO: Not documented in API - size: THREE.Vector3; - // TODO: Not documented in API - eccentricity: number; - - // TODO: Not documented in API - // geodeticSurfaceNormal( - // cartesian: Coordinates, - // target?: THREE.Vector3, - // ): THREE.Vector3; - - // TODO: Not documented in API - // geodeticSurfaceNormalCartographic( - // coordCarto: Coordinates, - // target?: THREE.Vector3, - // ): THREE.Vector3; - - // TODO: Not documented in API - setSize(size: THREE.Vector3Like): void; - - // TODO: Not documented in API - cartographicToCartesian( - coordCarto: Coordinates, - target?: THREE.Vector3, - ): THREE.Vector3; - - cartesianToCartographic( - position: THREE.Vector3Like, - target?: Coordinates, - ): Coordinates; - - // TODO: Not documented in API - // cartographicToCartesianArray( - // coordCartoArray: Coordinates[], - // ): THREE.Vector3[]; - - // TODO: Not documented in API - // intersection(ray: THREE.Ray): THREE.Vector3 | false; - - geodesicDistance( - coordCarto1: Coordinates, - coordCarto2: Coordinates, - ): number; -} - -export default Ellipsoid; diff --git a/types/itowns/src/Core/Prefab/Globe/GlobeLayer.d.ts b/types/itowns/src/Core/Prefab/Globe/GlobeLayer.d.ts deleted file mode 100644 index db175613dab521..00000000000000 --- a/types/itowns/src/Core/Prefab/Globe/GlobeLayer.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as THREE from "three"; -import Layer from "../../../Layer/Layer"; - -export type GlobeLayerOptions = any; - -// TODO: Define public API -declare class GlobeLayer extends Layer { - constructor(id: string, object3d: THREE.Object3D, config: GlobeLayerOptions); -} - -export default GlobeLayer; diff --git a/types/itowns/src/Core/Prefab/GlobeView.d.ts b/types/itowns/src/Core/Prefab/GlobeView.d.ts deleted file mode 100644 index 74eb47e8f4f5c6..00000000000000 --- a/types/itowns/src/Core/Prefab/GlobeView.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import * as THREE from "three"; - -import GlobeControls, { GlobeControlsOptions } from "../../Controls/GlobeControls"; -import Layer from "../../Layer/Layer"; -import CameraUtils from "../../Utils/CameraUtils"; -import Extent from "../Geographic/Extent"; -import View, { VIEW_EVENTS, ViewOptions } from "../View"; -import GlobeLayer from "./Globe/GlobeLayer"; - -export enum GLOBE_VIEW_EVENTS { - GLOBE_INITIALIZED = "initialized", - LAYER_ADDED = "layer-added", - LAYER_REMOVED = "layer-removed", - COLOR_LAYERS_ORDER_CHANGED = "layers-order-changed", -} - -export interface GlobeViewOptions extends ViewOptions { - // object3d?: THREE.Object3D; // TODO: Not documented - // TODO: options passed to GlobeLayer - // noControls?: boolean; // TODO: Not documented - controls?: GlobeControlsOptions; - handleCollision?: boolean; // TODO: Not documented - // atmosphere?: any; TODO: options passed to Atmosphere - // diffuse?: THREE.Color; // TODO: documented but still used? -} - -declare class GlobeView extends View { - constructor( - viewerDiv: HTMLDivElement, - placement?: CameraUtils.CameraTransformOptions | Extent, - options?: GlobeViewOptions, - ); - - readonly isGlobeView: true; - - tileLayer: /* GlobeLayer */ any; - controls?: GlobeControls; - - addLayer(layer: L): Promise; - // TODO: screenCoord is optional and same type as gfxEngin.getWindowSize() - getPixelsToDegrees(pixels?: number, screenCoord?: any): number; - getPixelsToDegreesFromDistance(pixels?: number, distance?: number): number; - getMetersToDegrees(meters?: number): number; -} - -export default GlobeView; diff --git a/types/itowns/src/Core/Prefab/Planar/PlanarLayer.d.ts b/types/itowns/src/Core/Prefab/Planar/PlanarLayer.d.ts deleted file mode 100644 index 1e1ef6bf472c6a..00000000000000 --- a/types/itowns/src/Core/Prefab/Planar/PlanarLayer.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as THREE from "three"; -import Layer from "../../../Layer/Layer"; - -export type PlanarLayerOptions = any; - -// TODO: Define public API -declare class PlanarLayer extends Layer { - constructor(id: string, object3d: THREE.Object3D, config: PlanarLayerOptions); -} - -export default PlanarLayer; diff --git a/types/itowns/src/Core/Prefab/PlanarView.d.ts b/types/itowns/src/Core/Prefab/PlanarView.d.ts deleted file mode 100644 index 6da0b10ef8ec22..00000000000000 --- a/types/itowns/src/Core/Prefab/PlanarView.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import Extent from "../Geographic/Extent"; -import View, { ViewOptions } from "../View"; - -import PlanarControls, { PlanarControlsOptions } from "../../Controls/PlanarControls"; -import Layer from "../../Layer/Layer"; -import CameraUtils from "../../Utils/CameraUtils"; - -export interface PlanarViewOptions extends ViewOptions { - noControls?: boolean; - controls?: PlanarControlsOptions; - placement?: CameraUtils.CameraTransformOptions | Extent; - disableSkirt?: boolean; // TODO: Not documented - maxSubdivisionLevel?: number; // TODO: Not documented -} - -declare class PlanarView extends View { - constructor( - viewerDiv: HTMLDivElement, - extent: Extent, - options?: PlanarViewOptions, - ); - - readonly isPlanarView: true; - - controls?: PlanarControls; - tileLayer: /* PlanarLayer */ any; // TODO - addLayer(layer: L): Promise; -} - -export default PlanarView; diff --git a/types/itowns/src/Core/Style.d.ts b/types/itowns/src/Core/Style.d.ts deleted file mode 100644 index 44839a97f2ff47..00000000000000 --- a/types/itowns/src/Core/Style.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -import * as THREE from "three"; - -// export const cacheStyle = new Cache(); -// export function readExpression(property, ctx); -// export class StyleContext {} - -// TODO: Type later -export type StyleContext = any; - -// TODO: Access to property as value between brackets -export type StyleParameter = T | ((prop?: any, ctx?: StyleContext) => T); - -export interface ImagePattern { - source: HTMLImageElement | string; - cropValues: { x: number; y: number; width: number; height: number }; -} - -export interface ColorPattern { - color: string | THREE.Color; -} - -export type Pattern = ImagePattern | ColorPattern; - -export interface FillStyle { - color: StyleParameter; - pattern: StyleParameter; - opacity: StyleParameter; - base_altitude: StyleParameter; - extrusion_height: StyleParameter; -} - -export interface StrokeStyle { - color: StyleParameter; - opacity: StyleParameter; - width: StyleParameter; - base_altitude: StyleParameter; -} - -export interface PointStyle { - color: StyleParameter; - radius: StyleParameter; - line: StyleParameter; - width: StyleParameter; - opacity: StyleParameter; - base_altitude: StyleParameter; - model: StyleParameter; // TODO: Update iTowns doc -} - -export interface TextStyle { - field: StyleParameter; - color: StyleParameter; - anchor: StyleParameter; - offset: StyleParameter<[number, number]>; - padding: StyleParameter; - size: StyleParameter; - wrap: StyleParameter; - spacing: StyleParameter; - transform: StyleParameter; - justify: StyleParameter; - opacity: StyleParameter; - font: StyleParameter; - haloColor: StyleParameter; - haloWidth: StyleParameter; - haloBlur: StyleParameter; -} - -export interface IconStyle { - source: string; - id: string; - cropValues: string; - anchor: string; // TODO: Restrict type to values - size: number; - color: StyleParameter; - opacity: StyleParameter; -} - -export default interface Style { - order?: number; - zoom?: { min?: number; max?: number }; - fill?: Partial; - stroke?: Partial; - point?: Partial; - text?: Partial; - icon?: Partial; -} - -// // TODO: Define style public API -// export default class Style { -// constructor(params?: any); -// -// readonly isStyle: boolean; -// } diff --git a/types/itowns/src/Core/System/Capabilities.d.ts b/types/itowns/src/Core/System/Capabilities.d.ts deleted file mode 100644 index f69e5800a26481..00000000000000 --- a/types/itowns/src/Core/System/Capabilities.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as THREE from "three"; - -declare namespace _default { - function isLogDepthBufferSupported(): boolean; - function isFirefox(): boolean; - function isInternetExplorer(): boolean; - function getMaxTextureUnitsCount(): number; - function getMaxTextureSize(): number; - function updateCapabilities(renderer: THREE.WebGLRenderer): void; -} - -export default _default; diff --git a/types/itowns/src/Core/View.d.ts b/types/itowns/src/Core/View.d.ts deleted file mode 100644 index e8a893aaad3f86..00000000000000 --- a/types/itowns/src/Core/View.d.ts +++ /dev/null @@ -1,145 +0,0 @@ -import * as THREE from "three"; -import Coordinates from "../Core/Geographic/Coordinates"; -import type Layer from "../Layer/Layer"; -import Camera, { CameraOptions } from "../Renderer/Camera"; -import MainLoop, { MAIN_LOOP_EVENTS } from "./MainLoop"; - -export enum VIEW_EVENTS { - LAYERS_INITIALIZED = "layers-initialized", - LAYER_REMOVED = "layer-removed", - LAYER_ADDED = "layer-added", - INITIALIZED = "initialized", - COLOR_LAYERS_ORDER_CHANGED = "layers-order-changed", - CAMERA_MOVED = "camera-moved", -} - -export interface ViewEventMap { - "layers-initialized": {}; - "layer-removed": { layerId: string }; - "layer-added": { layerId: string }; - "initialized": {}; - "layers-order-changed": { - previous: { sequence: string[] }; - new: { sequence: string[] }; - }; - "camera-moved": { - coord: Coordinates; - range: number; - heading: number; - tilt: number; - }; -} - -export interface RendererOptions { - antialias?: boolean; - alpha?: boolean; - // webxr?: { // TODO: Experimental option - // scale: number; - // }; - logarithmicDepthBuffer?: boolean; -} - -export interface ViewOptions { - camera?: CameraOptions; - mainLoop?: MainLoop; - renderer?: RendererOptions | THREE.WebGLRenderer; - scene3D?: THREE.Scene; - diffuse?: THREE.Color; - disableFocusOnStart?: boolean; -} - -export type FrameRequester = (dt: number, updateLoopRestarted: boolean, ...args: any) => void; - -// TODO: Define public API -export default class View extends THREE.EventDispatcher { - constructor(crs: string, viewerDiv: HTMLElement, options?: ViewOptions); - - domElement: HTMLElement; - referenceCrs: string; - mainLoop: MainLoop; - scene: THREE.Scene; - camera: Camera; - // controls?: any; // TODO: References in dispose - // tileLayer: any; // TODO: References in readDepthBuffer - - get renderer(): THREE.WebGLRenderer; - get camera3D(): THREE.Camera; - - dispose(clearCache?: boolean): void; - - addLayer(layer: L, parentLayer?: Layer): Promise; - removeLayer(layerId: string, clearCache?: boolean): boolean; - - notifyChange(changeSource?: any, needsRedraw?: boolean): void; - - getLayers(filter: (layer: Layer, root: Layer) => boolean): Layer[]; - getLayerById(layerId: string): Layer; - - addFrameRequester( - when: MAIN_LOOP_EVENTS, - frameRequester: FrameRequester, - ): void; - removeFrameRequester(when: string, frameRequester: FrameRequester): void; - removeAllFrameRequesters(): void; - removeAllEvents(): void; - execFrameRequesters( - when: MAIN_LOOP_EVENTS, - dt: number, - updateLoopRestarted: boolean, - ...args: any[] - ): void; - - eventToViewCoords( - event: MouseEvent | TouchEvent, - target?: THREE.Vector2, - touchIdx?: number, - ): THREE.Vector2; - eventToNormalizedCoords( - event: MouseEvent | TouchEvent, - touchIdx?: number, - ): THREE.Vector2; - - viewToNormalizedCoords( - viewCoords: THREE.Vector2, - target?: THREE.Vector2, - ): THREE.Vector2; - normalizedToViewCoords(ndcCoords: THREE.Vector2): THREE.Vector2; - - pickObjectsAt( - mouseOrEvt: THREE.Vector2 | MouseEvent | TouchEvent, - radius?: number, - ...where: any[] - ): any[]; // TODO - - getScale(pitch?: number): number; - // getScaleFromDistance(pitch?: number, distance?: number): number; // TODO: Not documented - - getDistanceFromCamera(screenCoord?: THREE.Vector2): number; - - getPixelsToMeters(pixels?: number, screenCoord?: THREE.Vector2): number; - // getPixelsToMetersFromDistance(pixels?: number, distance?: number): number; // TODO: Not documented - - getMetersToPixels(meters?: number, screenCoord?: THREE.Vector2): number; - // getMetersToPixelsFromDistance(meters?: number, distance?: number): number; // TODO: Not documented - - pickFeaturesAt( - mouseOrEvt: THREE.Vector2 | MouseEvent | TouchEvent, - radius?: number, - ...where: string[] | Layer[] - ): any /* Record */; // TODO: Result type - - // readDepthBuffer(x: number, y: number, width: number, height: number, buffer: any): any; // TODO: Not documented - - getPickingPositionFromDepth( - mouse: THREE.Vector2, - target?: THREE.Vector3, - ): THREE.Vector3; - - pickTerrainCoordinates( - mouse: THREE.Vector2 | MouseEvent | TouchEvent, - target?: Coordinates, - ): Coordinates; - // pickCoordinates(mouse?: THREE.Vector2 | Event, target?: Coordinates): Coordinates; // Deprecated - - resize(width?: number, height?: number): void; -} diff --git a/types/itowns/src/Layer/C3DTilesLayer.d.ts b/types/itowns/src/Layer/C3DTilesLayer.d.ts deleted file mode 100644 index 4207ce5514b167..00000000000000 --- a/types/itowns/src/Layer/C3DTilesLayer.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import * as THREE from "three"; -import type C3DTBatchTable from "../Core/3DTiles/C3DTBatchTable"; -import C3DTExtensions from "../Core/3DTiles/C3DTExtensions"; -import type C3DTFeature from "../Core/3DTiles/C3DTFeature"; -import C3DTileset from "../Core/3DTiles/C3DTileset"; -import type Style from "../Core/Style"; -import type View from "../Core/View"; -import { PNTS_MODE, PNTS_SHAPE, PNTS_SIZE_MODE } from "../Renderer/PointsMaterial"; -import type C3DTileSource from "../Source/C3DTilesSource"; -import GeometryLayer from "./GeometryLayer"; - -export interface C3DTilesLayerOptions { - source: C3DTileSource; - name?: string; - sseThreshold?: number; - cleanupDelay?: number; - registeredExtensions?: C3DTExtensions; - pntsMode?: PNTS_MODE; - pntsShape?: PNTS_SHAPE; - pntsSizeMode?: PNTS_SIZE_MODE; - pntsMinAttenuatedSize?: number; - pntsMaxAttenuatedSize?: number; - style?: Style; -} - -export enum C3DTILES_LAYER_EVENTS { - ON_TILE_CONTENT_LOADED = "on-tile-content-loaded", - ON_TILE_REQUESTED = "on-tile-requested", -} - -// TODO: Define public API -declare class C3DTilesLayer extends GeometryLayer { - constructor(id: string, config: C3DTilesLayerOptions, view: View); - - readonly isC3DTilesLayer: boolean; - readonly protocol: "3d-tiles"; - - sseThreshold: number; - cleanupDelay: number; - name?: string; - registeredExtensions: C3DTExtensions; - pntsMode?: PNTS_MODE; - pntsShape?: PNTS_SHAPE; - // classification: any; - pntsSizeMode?: PNTS_SIZE_MODE; - pntsMinAttenuatedSize?: number; - pntsMaxAttenuatedSize?: number; - tilesC3DTileFeatures: Map>; - tileset: C3DTileset; - - // preUpdate(): any[]; - - // update(context: any, layer: any, node: any): any; - - // getObjectToUpdateForAttachedLayers(meta: any): { - // elements: any[]; - // parent: any; - // } | { - // elements: any[]; - // parent?: undefined; - // } | undefined; - - findBatchTable(object: THREE.Object3D): C3DTBatchTable; - - getC3DTileFeatureFromIntersectsArray(intersects: any[]): C3DTFeature; - - onTileContentLoaded(tileContent: THREE.Object3D): void; - - initC3DTileFeatures(tileContent: THREE.Object3D): void; - - computeWorldBox3(c3DTFeature: C3DTFeature, target: THREE.Box3): THREE.Box3; - - updateStyle(allowTileIdList?: number[]): boolean; - - get materialCount(): number; - - set style(value: Style); - - get style(): Style; -} - -export default C3DTilesLayer; diff --git a/types/itowns/src/Layer/ColorLayer.d.ts b/types/itowns/src/Layer/ColorLayer.d.ts deleted file mode 100644 index 4e4481aa79cea7..00000000000000 --- a/types/itowns/src/Layer/ColorLayer.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import * as THREE from "three"; -import Style from "../Core/Style"; -import { Extent, FeatureCollection } from "../Main"; -import Layer, { LayerOptions } from "./Layer"; -// import { RasterColorTile } from "../Renderer/RasterTile"; - -type EffectType = 0 | 1 | 2 | 3; // TODO: enum - -// TODO: Define public API -export interface ColorLayerOptions extends LayerOptions { - style?: Style; - visible?: boolean; - opacity?: number; - transparent?: boolean; - magFilter?: THREE.MagnificationTextureFilter; - minFilter?: THREE.MinificationTextureFilter; - effect_type?: EffectType; - effect_parameter?: number; - noTextureParentOutsideLimit?: boolean; -} - -declare class ColorLayer extends Layer { - constructor(id: string, config?: ColorLayerOptions); - - readonly isColorLayer: boolean; - - style: Style; - visible: boolean; // TODO: event - opacity: number; // TODO: event - sequence: number; // TODO: event - transparent: boolean; - noTextureParentOutsideLimit: boolean; - // buildExtent: boolean; - // structure: string; - magFilter?: THREE.MagnificationTextureFilter; - minFilter?: THREE.MinificationTextureFilter; - effect_type?: EffectType; - effect_parameter?: number; - - convert( - data: FeatureCollection | THREE.Texture, - extentDestination: Extent, - ): THREE.Texture; - - // setupRasterNode(node: TileMesh): RasterColorTile; // TODO - - // update(context: any, layer: any, node: any, parent: any): any; -} -export default ColorLayer; diff --git a/types/itowns/src/Layer/ElevationLayer.d.ts b/types/itowns/src/Layer/ElevationLayer.d.ts deleted file mode 100644 index 33c9bcd30221a3..00000000000000 --- a/types/itowns/src/Layer/ElevationLayer.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import Layer, { LayerOptions } from "./Layer"; - -// TODO: Missing properties - -export interface ElevationLayerOptions extends LayerOptions { - noDataValue?: number; - clampValues?: { - min?: number; - max?: number; - }; - scale?: number; - useColorTextureElevation?: boolean; - colorTextureElevationMinZ?: number; - colorTextureElevationMaxZ?: number; -} - -// TODO: Define public API -declare class ElevationLayer extends Layer { - constructor(id: string, config?: ElevationLayerOptions); - - readonly isElevationLayer: boolean; - - noDataValue?: number; - scale: number; - - // setupRasterNode(node: TileMesh): RasterElevationTile; TODO in doc -} - -export default ElevationLayer; - -// RasterElevationTile -// id: boolean -// opacity: boolean -// visible: boolean -// useRgbaTextureElevation: boolean -// useColorTextureElevation: boolean -// bias: number -// mode: MODE -// noDataValue: number; -// zmin: number -// zmax: number -// scale: number diff --git a/types/itowns/src/Layer/EntwinePointTileLayer.d.ts b/types/itowns/src/Layer/EntwinePointTileLayer.d.ts deleted file mode 100644 index 9efdce99e746be..00000000000000 --- a/types/itowns/src/Layer/EntwinePointTileLayer.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// import EntwinePointTileNode from "../Core/EntwinePointTileNode"; -import Extent from "../Core/Geographic/Extent"; -import PointCloudLayer, { PointCloudLayerOptions } from "./PointCloudLayer"; - -declare class EntwinePointTileLayer extends PointCloudLayer { - constructor(id: string, config: PointCloudLayerOptions); - - readonly isEntwinePointTileLayer: boolean; - - root: /* EntwinePointTileNode */ any; - extent: Extent; - - get spacing(): number; -} - -export default EntwinePointTileLayer; diff --git a/types/itowns/src/Layer/FeatureGeometryLayer.d.ts b/types/itowns/src/Layer/FeatureGeometryLayer.d.ts deleted file mode 100644 index c3e8b8ede2f1ba..00000000000000 --- a/types/itowns/src/Layer/FeatureGeometryLayer.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import * as THREE from "three"; -import Style from "../Core/Style"; -import GeometryLayer, { GeometryLayerOptions } from "./GeometryLayer"; - -export interface FeatureGeometryLayerOptions extends GeometryLayerOptions { - batchId?: any; // TODO: function - object3d?: THREE.Object3D; - style?: Style; - onMeshCreated?: (featureMesh: any, context: any) => void; - accurate?: boolean; -} - -declare class FeatureGeometryLayer extends GeometryLayer { - constructor(id: string, options?: FeatureGeometryLayerOptions); - - readonly isFeatureGeometryLayer: boolean; - - accurate: boolean; - buildExtent: boolean; -} -export default FeatureGeometryLayer; diff --git a/types/itowns/src/Layer/GeoidLayer.d.ts b/types/itowns/src/Layer/GeoidLayer.d.ts deleted file mode 100644 index 3937d51c9d7e59..00000000000000 --- a/types/itowns/src/Layer/GeoidLayer.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import Layer, { LayerOptions } from "./Layer"; - -export function geoidLayerIsVisible(tilelayer: any): boolean; - -// TODO: Define public API -declare class GeoidLayer extends Layer { - constructor(id: string, config?: LayerOptions); - - readonly isGeoidLayer: boolean; - - visible: boolean; - - // updateNodeZ(node: any): void; - - // update(context: any, layer: any, node: any, parent: any): any; -} - -export default GeoidLayer; diff --git a/types/itowns/src/Layer/GeometryLayer.d.ts b/types/itowns/src/Layer/GeometryLayer.d.ts deleted file mode 100644 index a7e616ffc86514..00000000000000 --- a/types/itowns/src/Layer/GeometryLayer.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import * as THREE from "three"; -import View from "../Core/View"; -import Layer, { LayerOptions } from "./Layer"; - -export interface GeometryLayerOptions extends LayerOptions { - visible?: boolean; -} - -// TODO: Define public API -declare class GeometryLayer extends Layer { - constructor( - id: string, - object3d: THREE.Object3D, - config?: GeometryLayerOptions, - ); - - readonly isGeometryLayer: boolean; - readonly object3d: THREE.Object3D; - - opacity: number; - wireframe: boolean; - attachedLayers: Layer[]; - - get visible(): boolean; - set visible(value: boolean); // TODO visible-property-changed - // getObjectToUpdateForAttachedLayers(obj: any): { - // element: any; - // parent: any; - // } | undefined; - postUpdate(): void; - culling(node: any, camera: any): boolean; - - attach(layer: Layer): void; - detach(layer: Layer): boolean; - - pickObjectsAt( - view: View, - coordinates: { x: number; y: number }, - radius?: number, - target?: any[], - ): any[]; // TODO: any is THREE.Object3D ? -} -export default GeometryLayer; diff --git a/types/itowns/src/Layer/LabelLayer.d.ts b/types/itowns/src/Layer/LabelLayer.d.ts deleted file mode 100644 index 675e69d0003c31..00000000000000 --- a/types/itowns/src/Layer/LabelLayer.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import Extent from "../Core/Geographic/Extent"; -import Label from "../Core/Label"; -import GeometryLayer from "./GeometryLayer"; - -type LabelLayerOptions = any; - -// TODO: Define public API -declare class LabelLayer extends GeometryLayer { - constructor(id: string, config?: LabelLayerOptions); - - readonly isLabelLayer: boolean; - - // domElement: HTMLDivElement; - // buildExtent: boolean; - // labelDomelement: any; - // margin: any; - - // convert(data: FeatureCollection, extent: Extent): Label[]; - - // preUpdate(): void; - - // update(context: any, layer: any, node: any, parent: any): any; - - // removeLabelsFromNodeRecursive(node: any): void; - - // removeNodeDomElement(node: any): void; -} - -export default LabelLayer; diff --git a/types/itowns/src/Layer/Layer.d.ts b/types/itowns/src/Layer/Layer.d.ts deleted file mode 100644 index e34f0068900b91..00000000000000 --- a/types/itowns/src/Layer/Layer.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -import * as THREE from "three"; -import Extent from "../Core/Geographic/Extent"; -import Style from "../Core/Style"; -import Source from "../Source/Source"; -import type { Strategy } from "./LayerUpdateStrategy"; - -export interface LayerOptions { - source: Source | false; - style?: Style; - // options: any; - crs?: string; - cacheLifeTime?: number; - addLabelLayer?: { - performance?: boolean; - forceClampToTerrain?: boolean; - }; - zoom?: { - max?: number; - min?: number; - }; - updateStrategy?: { - type: Strategy; - options?: any; - }; - // mergeFeatures: boolean; -} - -// TODO: Define public API -export class Layer extends THREE.EventDispatcher { - protected constructor(id: string, config: LayerOptions); - - readonly isLayer: boolean; - readonly id: string; - - source: Source; - ready: boolean; - whenReady: Promise; - zoom: { max: number; min: number }; - frozen: boolean; // TODO: event - // cache: Cache; - // info: InfoLayer; - // options: unknown; - - addLabelLayer?: { - performance: boolean; - forceClampToTerrain: boolean; - }; - // updateStrategy?: { - // type: number; - // options: any; - // }; // TODO: STRATEGY_MIN_NETWORK_TRAFFIC enum - // mergeFeatures: boolean; - - // addInitializationStep(): Promise; - - defineLayerProperty( - propertyName: K, - defaultValue: V, - onChange?: (o: this & Record, prop: K) => void, - ): asserts this is Record; - - convert(data: any, extentDestination: Extent): any; - - // getData(from: any, to: any): any; - - isValidData(feature: any): any; - - delete(clearCache?: boolean): void; - - // TODO: update on all layers - - // TODO: preUpdate on children (GeometryLayer) - - // TODO postUpdate on inherited (GeometryLayer) -} - -export default Layer; - -export const ImageryLayers: { // TODO - moveLayerToIndex( - layer: any, - newIndex: number, - imageryLayers: any, - ): void; - - moveLayerDown(layer: any, imageryLayers: any): void; - - moveLayerUp(layer: any, imageryLayers: any): void; - - getColorLayersIdOrderedBySequence(imageryLayers: any): any[]; -}; diff --git a/types/itowns/src/Layer/LayerUpdateStrategy.d.ts b/types/itowns/src/Layer/LayerUpdateStrategy.d.ts deleted file mode 100644 index ae639a30b5860b..00000000000000 --- a/types/itowns/src/Layer/LayerUpdateStrategy.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export const STRATEGY_MIN_NETWORK_TRAFFIC: 0; -export const STRATEGY_GROUP: 1; -export const STRATEGY_PROGRESSIVE: 2; -export const STRATEGY_DICHOTOMY: 3; -export type Strategy = - | typeof STRATEGY_MIN_NETWORK_TRAFFIC - | typeof STRATEGY_GROUP - | typeof STRATEGY_PROGRESSIVE - | typeof STRATEGY_DICHOTOMY; - -export function chooseNextLevelToFetch( - strategy: any, - node: any, - nodeLevel: any, - currentLevel: any, - layer: any, - failureParams: any, -): any; diff --git a/types/itowns/src/Layer/OrientedImageLayer.d.ts b/types/itowns/src/Layer/OrientedImageLayer.d.ts deleted file mode 100644 index 909368e43c85c5..00000000000000 --- a/types/itowns/src/Layer/OrientedImageLayer.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import GeometryLayer from "./GeometryLayer"; - -export type OrientedImageLayerOptions = any; - -// TODO: Define public API -declare class OrientedImageLayer extends GeometryLayer { - constructor(id: string, config: OrientedImageLayerOptions); -} - -export default OrientedImageLayer; diff --git a/types/itowns/src/Layer/PointCloudLayer.d.ts b/types/itowns/src/Layer/PointCloudLayer.d.ts deleted file mode 100644 index d49817b2e468e0..00000000000000 --- a/types/itowns/src/Layer/PointCloudLayer.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import * as THREE from "three"; -import { PNTS_MODE } from "../Renderer/PointsMaterial"; -import GeometryLayer, { GeometryLayerOptions } from "./GeometryLayer"; - -interface PointCloudLayer { - group: THREE.Group; - bboxes: THREE.Group; - octreeDepthLimit: number; - pointBudget: number; - sseThreshold: number; - pointSize: number; - material: THREE.Material; - mode: PNTS_MODE; - minIntensityRange: number; - maxIntensityRange: number; -} - -export type PointCloudLayerOptions = Partial & GeometryLayerOptions; // TODO: check output type - -// TODO: Define public API -declare class PointCloudLayer extends GeometryLayer { - constructor(id: string, config?: PointCloudLayerOptions); - - readonly isPointCloudLayer: true; - readonly protocol: "pointcloud"; - - root: any; // TODO - - displayedCount: number; - - // preUpdate(context: any, changeSources: any): any[]; - // update(context: any, layer: any, elt: any): any; - // pickObjectsAt(view: any, mouse: any, radius: any, target?: any[]): any[] | undefined; - // getObjectToUpdateForAttachedLayers(meta: any): { - // element: any; - // parent: any; - // } | { - // element: any; - // parent?: undefined; - // } | undefined; -} - -export default PointCloudLayer; diff --git a/types/itowns/src/Layer/PotreeLayer.d.ts b/types/itowns/src/Layer/PotreeLayer.d.ts deleted file mode 100644 index 0a271b6cb97aa0..00000000000000 --- a/types/itowns/src/Layer/PotreeLayer.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as THREE from "three"; -import PointCloudLayer, { PointCloudLayerOptions } from "./PointCloudLayer"; -// import PotreeNode from "../Core/PotreeNode"; -import Extent from "../Core/Geographic/Extent"; - -declare class PotreeLayer extends PointCloudLayer { - constructor(id: string, config: PointCloudLayerOptions); - - readonly isPotreeLayer: boolean; - - scale: THREE.Vector3; - spacing: number; - hierarchyStepSize: number; - supportsProgressiveDisplay: boolean; - - root: /* PotreeNode */ any; - extent: Extent; // TODO: defined in layer? -} - -export default PotreeLayer; diff --git a/types/itowns/src/Layer/TiledGeometryLayer.d.ts b/types/itowns/src/Layer/TiledGeometryLayer.d.ts deleted file mode 100644 index 2bf4495b9cf8ba..00000000000000 --- a/types/itowns/src/Layer/TiledGeometryLayer.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import * as THREE from "three"; -import GeometryLayer from "./GeometryLayer"; -import Layer from "./Layer"; -// import { InfoTiledGeometryLayer } from "./InfoLayer"; - -export type TiledGeometryLayerOptions = any; - -// TODO: Define public API -declare class TiledGeometryLayer extends GeometryLayer { - static hasEnoughTexturesToSubdivide( - context: any, - node: /* TileMesh */ any, - ): boolean; - - constructor( - id: string, - object3d: THREE.Object3D, - schemeTile: any[], - builder: any, - config?: TiledGeometryLayerOptions, - ); - - readonly isTiledGeometryLayer: boolean; - readonly protocol: "tile"; - - sseSubdivisionThreshold: number; - schemeTile: any[]; - builder: object; - info: /* InfoTiledGeometryLayer */ any; - level0Nodes: any[]; - colorLayersOrder?: any[]; - - preUpdate( - context: object, - sources: Set, - ): /* TileMesh */ any[]; - - update(context: object, layer: Layer, node: /* TileMesh */ any): object; - - convert(requester: any, extent: any): any; - - countColorLayersTextures(...layers: any[]): number; - - culling(node: any, camera: any): boolean; - - subdivideNode(context: object, node: /* TileMesh */ any): Promise; - - subdivision( - context: object, - layer: /* PlanarLayer */ any, - node: /* TileMesh */ any, - ): boolean; -} -export default TiledGeometryLayer; diff --git a/types/itowns/src/Main.d.ts b/types/itowns/src/Main.d.ts deleted file mode 100644 index 288521903abd9c..00000000000000 --- a/types/itowns/src/Main.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -export const REVISION = "2.42.0"; - -// Geographic tools -export { default as Coordinates } from "./Core/Geographic/Coordinates"; -export { default as CRS } from "./Core/Geographic/Crs"; -export { default as Extent } from "./Core/Geographic/Extent"; -export { default as GeoidGrid } from "./Core/Geographic/GeoidGrid"; - -export { default as FirstPersonControls } from "./Controls/FirstPersonControls"; -export { default as FlyControls } from "./Controls/FlyControls"; -export { default as GlobeControls } from "./Controls/GlobeControls"; -export { CONTROL_EVENTS } from "./Controls/GlobeControls"; -export { default as PlanarControls } from "./Controls/PlanarControls"; -export { PLANAR_CONTROL_EVENT } from "./Controls/PlanarControls"; -export { default as StreetControls } from "./Controls/StreetControls"; -export { default as Feature2Mesh } from "./Converter/Feature2Mesh"; -export { MAIN_LOOP_EVENTS } from "./Core/MainLoop"; -export { default as Ellipsoid, ellipsoidSizes } from "./Core/Math/Ellipsoid"; -export { default as GlobeView, GLOBE_VIEW_EVENTS } from "./Core/Prefab/GlobeView"; -export { default as PlanarView } from "./Core/Prefab/PlanarView"; -export { default as Capabilities } from "./Core/System/Capabilities"; -export { default as View } from "./Core/View"; -export { VIEW_EVENTS } from "./Core/View"; -export { default as FeatureProcessing } from "./Process/FeatureProcessing"; -export { - updateLayeredMaterialNodeElevation, - updateLayeredMaterialNodeImagery, -} from "./Process/LayeredMaterialNodeProcessing"; -export { default as Fetcher } from "./Provider/Fetcher"; -export { CAMERA_TYPE } from "./Renderer/Camera"; -export { colorLayerEffects, getMaxColorSamplerUnitsCount } from "./Renderer/LayeredMaterial"; -export { default as OrientedImageCamera } from "./Renderer/OrientedImageCamera"; -export { - ClassificationScheme, - default as PointsMaterial, - PNTS_MODE, - PNTS_SHAPE, - PNTS_SIZE_MODE, -} from "./Renderer/PointsMaterial"; -export { default as ShaderChunk } from "./Renderer/Shader/ShaderChunk"; -export { default as CameraUtils } from "./Utils/CameraUtils"; -export { default as DEMUtils } from "./Utils/DEMUtils"; -export { default as FeaturesUtils } from "./Utils/FeaturesUtils"; -export { default as OrientationUtils } from "./Utils/OrientationUtils"; - -// Internal itowns format -export { default as Feature, FEATURE_TYPES, FeatureCollection, FeatureGeometry } from "./Core/Feature"; -export { default as Label } from "./Core/Label"; -export { default as Style } from "./Core/Style"; - -// Layers provided by default in iTowns -// A custom layer should at least implements Layer -// See http://www.itowns-project.org/itowns/docs/#api/Layer/Layer -export { default as GlobeLayer } from "./Core/Prefab/Globe/GlobeLayer"; -export { default as PlanarLayer } from "./Core/Prefab/Planar/PlanarLayer"; -export { C3DTILES_LAYER_EVENTS, default as C3DTilesLayer } from "./Layer/C3DTilesLayer"; -export { default as ColorLayer } from "./Layer/ColorLayer"; -export { default as ElevationLayer } from "./Layer/ElevationLayer"; -export { default as EntwinePointTileLayer } from "./Layer/EntwinePointTileLayer"; -export { default as FeatureGeometryLayer } from "./Layer/FeatureGeometryLayer"; -export { default as GeoidLayer } from "./Layer/GeoidLayer"; -export { default as GeometryLayer } from "./Layer/GeometryLayer"; -export { default as LabelLayer } from "./Layer/LabelLayer"; -export { default as Layer, ImageryLayers } from "./Layer/Layer"; -export { - STRATEGY_DICHOTOMY, - STRATEGY_GROUP, - STRATEGY_MIN_NETWORK_TRAFFIC, - STRATEGY_PROGRESSIVE, -} from "./Layer/LayerUpdateStrategy"; -export { default as OrientedImageLayer } from "./Layer/OrientedImageLayer"; -export { default as PointCloudLayer } from "./Layer/PointCloudLayer"; -export { default as PotreeLayer } from "./Layer/PotreeLayer"; -export { default as TiledGeometryLayer } from "./Layer/TiledGeometryLayer"; -export { default as ColorLayersOrdering } from "./Renderer/ColorLayersOrdering"; - -// Sources provided by default in iTowns -// A custom source should at least implements Source -// See http://www.itowns-project.org/itowns/docs/#api/Source/Source -export { default as C3DTilesIonSource } from "./Source/C3DTilesIonSource"; -export { default as C3DTilesSource } from "./Source/C3DTilesSource"; -export { default as EntwinePointTileSource } from "./Source/EntwinePointTileSource"; -export { default as FileSource } from "./Source/FileSource"; -export { default as OrientedImageSource } from "./Source/OrientedImageSource"; -export { default as PotreeSource } from "./Source/PotreeSource"; -export { default as Source } from "./Source/Source"; -export { default as TMSSource } from "./Source/TMSSource"; -export { default as VectorTilesSource } from "./Source/VectorTilesSource"; -export { default as WFSSource } from "./Source/WFSSource"; -export { default as WMSSource } from "./Source/WMSSource"; -export { default as WMTSSource } from "./Source/WMTSSource"; - -// Parsers provided by default in iTowns -// Custom parser can be implemented as wanted, as long as the main function -// takes the data as the first argument and options as the second. -export { enableDracoLoader, enableKtx2Loader, glTFLoader, legacyGLTFLoader } from "./Parser/B3dmParser"; // TODO -export { default as CameraCalibrationParser } from "./Parser/CameraCalibrationParser"; -export { default as GDFParser } from "./Parser/GDFParser"; -export { default as GeoJsonParser } from "./Parser/GeoJsonParser"; -export { default as GpxParser } from "./Parser/GpxParser"; -export { default as GTXParser } from "./Parser/GTXParser"; -export { default as ISGParser } from "./Parser/ISGParser"; -export { default as KMLParser } from "./Parser/KMLParser"; -export { default as LASParser } from "./Parser/LASParser"; -export { default as ShapefileParser } from "./Parser/ShapefileParser"; - -// 3D Tiles classes and extensions -// Exported to allow one to implement its own 3D Tiles extension which needs to -// know the classes it extends -export { default as C3DTBatchTable } from "./Core/3DTiles/C3DTBatchTable"; -export { default as C3DTBatchTableHierarchyExtension } from "./Core/3DTiles/C3DTBatchTableHierarchyExtension"; -export { default as C3DTBoundingVolume } from "./Core/3DTiles/C3DTBoundingVolume"; -export { default as C3DTExtensions } from "./Core/3DTiles/C3DTExtensions"; -export { default as C3DTFeature } from "./Core/3DTiles/C3DTFeature"; -export { C3DTilesBoundingVolumeTypes, C3DTilesTypes } from "./Core/3DTiles/C3DTilesEnums"; -export { default as C3DTileset } from "./Core/3DTiles/C3DTileset"; -export { $3dTilesCulling, $3dTilesSubdivisionControl, process3dTilesNode } from "./Process/3dTilesProcessing"; diff --git a/types/itowns/src/Parser/B3dmParser.d.ts b/types/itowns/src/Parser/B3dmParser.d.ts deleted file mode 100644 index 7374587c003d6c..00000000000000 --- a/types/itowns/src/Parser/B3dmParser.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as THREE from "three"; - -export function enableDracoLoader(path: string, config?: object): void; -export function enableKtx2Loader(path: string, renderer: THREE.WebGLRenderer): void; - -export const glTFLoader: any; -export const legacyGLTFLoader: any; - -// TODO: rework all -declare namespace _default { - function parse(buffer: ArrayBuffer, options: { - gltfUpAxis?: string; - urlBase: string; - doNotPatchMaterial?: boolean; - opacity?: any; - overrideMaterials?: any; - }): Promise; -} - -export default _default; diff --git a/types/itowns/src/Parser/CameraCalibrationParser.d.ts b/types/itowns/src/Parser/CameraCalibrationParser.d.ts deleted file mode 100644 index 851f2f28eaa0cd..00000000000000 --- a/types/itowns/src/Parser/CameraCalibrationParser.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -declare namespace _default { - interface CameraCalibrationJson { - projection: number[]; - size: number[]; - position: number[]; - rotation: number[]; - distorsion?: { - pps?: number[]; - poly357?: number[]; - limit: number[]; - l1l2: number[]; - etat: number[]; - }; - } - - function parse( - json: string | CameraCalibrationJson, - options?: { near?: string; far?: string }, - ): Promise; -} -export default _default; diff --git a/types/itowns/src/Parser/GDFParser.d.ts b/types/itowns/src/Parser/GDFParser.d.ts deleted file mode 100644 index 159684dfc635cc..00000000000000 --- a/types/itowns/src/Parser/GDFParser.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import GeoidGrid from "../Core/Geographic/GeoidGrid"; - -declare namespace _default { - interface ParsingOptions { - in?: { crs?: string }; - out?: {}; - } - - function parse(gdf: string, options?: ParsingOptions): Promise; -} -export default _default; diff --git a/types/itowns/src/Parser/GTXParser.d.ts b/types/itowns/src/Parser/GTXParser.d.ts deleted file mode 100644 index 13982aee524e2d..00000000000000 --- a/types/itowns/src/Parser/GTXParser.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import GeoidGrid from "../Core/Geographic/GeoidGrid"; - -declare namespace _default { - interface ParsingOptions { - in?: { - crs?: string; - dataType: "float" | "double"; - }; - out?: {}; - } - - function parse(gtx: ArrayBuffer, options?: { - in?: ParsingOptions; - }): Promise; -} -export default _default; diff --git a/types/itowns/src/Parser/GeoJsonParser.d.ts b/types/itowns/src/Parser/GeoJsonParser.d.ts deleted file mode 100644 index 58e193ea52562f..00000000000000 --- a/types/itowns/src/Parser/GeoJsonParser.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { FeatureCollection } from "../Core/Feature"; - -export interface ParsingOptions { - in: { - crs?: string; - }; - out: any; -} - -declare namespace _default { - function parse(json: string, options?: ParsingOptions): Promise; -} -export default _default; diff --git a/types/itowns/src/Parser/GpxParser.d.ts b/types/itowns/src/Parser/GpxParser.d.ts deleted file mode 100644 index 95d2b5df8fc094..00000000000000 --- a/types/itowns/src/Parser/GpxParser.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { FeatureCollection } from "../Core/Feature"; - -export interface ParsingOptions { - in: { - crs: string; - }; - out: any; -} - -declare namespace _default { - function parse(gpxFile: XMLDocument, options: ParsingOptions): Promise; -} -export default _default; diff --git a/types/itowns/src/Parser/ISGParser.d.ts b/types/itowns/src/Parser/ISGParser.d.ts deleted file mode 100644 index 5bcf0bb7c33254..00000000000000 --- a/types/itowns/src/Parser/ISGParser.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import GeoidGrid from "../Core/Geographic/GeoidGrid"; - -declare namespace _default { - interface ParsingOptions { - in?: { - crs?: string; - }; - out?: {}; - } - - function parse(isg: string, options?: { - in?: ParsingOptions; - }): Promise; -} -export default _default; diff --git a/types/itowns/src/Parser/KMLParser.d.ts b/types/itowns/src/Parser/KMLParser.d.ts deleted file mode 100644 index 7d5fe3db1e7e19..00000000000000 --- a/types/itowns/src/Parser/KMLParser.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { FeatureCollection } from "../Core/Feature"; - -export interface ParsingOptions { - in: any; - out: any; -} - -declare namespace _default { - function parse(kmlFile: XMLDocument, options: ParsingOptions): Promise; -} -export default _default; diff --git a/types/itowns/src/Parser/LASParser.d.ts b/types/itowns/src/Parser/LASParser.d.ts deleted file mode 100644 index 1597d0f17794bf..00000000000000 --- a/types/itowns/src/Parser/LASParser.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as THREE from "three"; - -declare namespace _default { - interface ParsingOptions { - in?: { - colorDepth?: 8 | 16; - }; - } - - function parse( - data: ArrayBuffer, - options?: ParsingOptions, - ): Promise; -} -export default _default; diff --git a/types/itowns/src/Parser/ShapefileParser.d.ts b/types/itowns/src/Parser/ShapefileParser.d.ts deleted file mode 100644 index c9efe7eaab0c8a..00000000000000 --- a/types/itowns/src/Parser/ShapefileParser.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -declare namespace _default { - function parse(data: { - shp: ArrayBuffer; - shx: ArrayBuffer; - dbf: ArrayBuffer; - prj?: string; - }, options?: any): Promise; // TODO: FeatureCollection -} -export default _default; diff --git a/types/itowns/src/Process/3dTilesProcessing.d.ts b/types/itowns/src/Process/3dTilesProcessing.d.ts deleted file mode 100644 index e42c16bc54df3e..00000000000000 --- a/types/itowns/src/Process/3dTilesProcessing.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as THREE from "three"; -import Camera from "../Renderer/Camera"; - -export function $3dTilesCulling( - layer: /*C3DTilesLayer*/ any, // TODO - camera: Camera, - node: THREE.Object3D, - tileMatrixWorld: THREE.Matrix4, -): boolean; - -export function $3dTilesSubdivisionControl( - context: { camera: Camera }, - layer: /* C3DTilesLayer */ any, // TODO - node: THREE.Object3D, -): boolean; - -export function process3dTilesNode( - cullingTest?: typeof $3dTilesCulling, - subdivisionTest?: typeof $3dTilesSubdivisionControl, -): (context: any, layer: any, node: any) => void; // TODO diff --git a/types/itowns/src/Process/FeatureProcessing.d.ts b/types/itowns/src/Process/FeatureProcessing.d.ts deleted file mode 100644 index bceb05480fd975..00000000000000 --- a/types/itowns/src/Process/FeatureProcessing.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare namespace _default { - function update(context: any, layer: any, node: any): any; // TODO: Missing types -} - -export default _default; diff --git a/types/itowns/src/Process/LayeredMaterialNodeProcessing.d.ts b/types/itowns/src/Process/LayeredMaterialNodeProcessing.d.ts deleted file mode 100644 index 80f9b03c7d5618..00000000000000 --- a/types/itowns/src/Process/LayeredMaterialNodeProcessing.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -// export const SIZE_TEXTURE_TILE: number; -// export const SIZE_DIAGONAL_TEXTURE: number; - -export function updateLayeredMaterialNodeImagery(context: any, layer: any, node: any, parent: any): any; // TODO - -export function updateLayeredMaterialNodeElevation(context: any, layer: any, node: any, parent: any): any; // TODO - -// export function removeLayeredMaterialNodeLayer(layerId: any): (node: any) => void; diff --git a/types/itowns/src/Provider/Fetcher.d.ts b/types/itowns/src/Provider/Fetcher.d.ts deleted file mode 100644 index 3dfd8432e59980..00000000000000 --- a/types/itowns/src/Provider/Fetcher.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type * as THREE from "three"; - -type FetcherOptions = RequestInit & { crossOrigin?: string }; - -declare namespace _default { - function text(url: string, options?: RequestInit): Promise; - - function json(url: string, options?: RequestInit): Promise; - - function xml(url: string, options?: RequestInit): Promise; - - function texture( - url: string, - options?: { crossOrigin?: boolean }, - ): Promise; - - function arrayBuffer( - url: string, - options?: RequestInit, - ): Promise; - - function textureFloat( - url: string, - options?: RequestInit, - ): Promise; - - // TODO: Stronger typing for multiple - function multiple( - baseUrl: string, - extensions: Record, - options?: FetcherOptions, - ): Promise; -} - -export default _default; diff --git a/types/itowns/src/Renderer/Camera.d.ts b/types/itowns/src/Renderer/Camera.d.ts deleted file mode 100644 index 84b8ec3e3ab1f5..00000000000000 --- a/types/itowns/src/Renderer/Camera.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import * as THREE from "three"; -import Coordinates from "../Core/Geographic/Coordinates"; - -export type CameraOptions = - | { cameraThree: THREE.Camera } - | { type: CAMERA_TYPE }; - -export enum CAMERA_TYPE { - PERSPECTIVE = 0, - ORTHOGRAPHIC = 1, -} - -// type Camera3DType = -// T extends Camera ? T : -// T extends CAMERA_TYPE.ORTHOGRAPHIC ? THREE.PerspectiveCamera : -// T extends CAMERA_TYPE.PERSPECTIVE ? THREE.OrthographicCamera : -// never - -declare class Camera { - constructor( - crs: string, - width: number, - height: number, - options?: CameraOptions, - ); - - crs: string; - camera3D: THREE.Camera; // TODO: type wizardry =P - width: number; - height: number; - - resize(width: number, height: number): void; - - update(): void; - - position(crs?: string): Coordinates; - - setPosition(position: Coordinates): void; - - isBox3Visible(box3: THREE.Box3, matrixWorld: THREE.Matrix4): boolean; - - isSphereVisible(sphere: THREE.Sphere, matrixWorld: THREE.Matrix4): boolean; - - box3SizeOnScreen(box3: THREE.Box3, matrixWorld: THREE.Matrix4): THREE.Box3; - - // TODO adjustAltitudeToAvoidCollisionWithLayer(view: View, elevationLayer: ElevationLayer, minDistanceCollision: number): void; -} - -export default Camera; diff --git a/types/itowns/src/Renderer/ColorLayersOrdering.d.ts b/types/itowns/src/Renderer/ColorLayersOrdering.d.ts deleted file mode 100644 index 05f31515d08b21..00000000000000 --- a/types/itowns/src/Renderer/ColorLayersOrdering.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import View from "../Core/View"; - -export const COLOR_LAYERS_ORDER_CHANGED: "layers-order-changed"; - -declare namespace _default { - function moveLayerUp(view: View, layerId: string): void; - - function moveLayerDown(view: View, layerId: string): void; - - function moveLayerToIndex(view: View, layerId: string, index: number): void; -} -export default _default; diff --git a/types/itowns/src/Renderer/LayeredMaterial.d.ts b/types/itowns/src/Renderer/LayeredMaterial.d.ts deleted file mode 100644 index 2f082ef5132e51..00000000000000 --- a/types/itowns/src/Renderer/LayeredMaterial.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import * as THREE from "three"; - -// TODO: Document public API - -export function unpack1K(color: any, factor: any): number; - -export function getMaxColorSamplerUnitsCount(): number; - -export enum colorLayerEffects { - noEffect = 0, - removeLightColor = 1, - removeWhiteColor = 2, - customEffect = 3, -} - -export enum ELEVATION_MODES { - RGBA = 0, - COLOR = 1, - DATA = 2, -} - -// TODO: hidden properties - -declare class LayeredMaterial extends THREE.RawShaderMaterial { - constructor(options?: THREE.ShaderMaterialParameters, crsCount?: number); // TODO: Change order in itowns - - // mode: RenderMode; - // vertexShader: string; - // fragmentShader: string; - // diffuse: THREE.Color; - // opacity: number; - // lightingEnabled: boolean; - // lightPosition: THREE.Vector3; - // fogDistance: number; - // fogColor: THREE.Color; - // overlayAlpha: number; - // overlayColor: THREE.Color; - // objectId: number; - // geoidHeight: number; - // minBorderDistance: number; - // layers: any[]; - // elevationLayerIds: any[]; - // colorLayerIds: any[]; - // visible: boolean; - // layersNeedUpdate?: boolean; - - // onBeforeCompile(shader: any, renderer: any): void; - - // getUniformByType(type: any): { - // layers: THREE.IUniform; - // textures: THREE.IUniform; - // offsetScales: THREE.IUniform; - // textureCount: THREE.IUniform; - // }; - - // updateLayersUniforms(): void; - - // setSequence(sequenceLayer: any): void; - - // setSequenceElevation(layerId: any): void; - - // removeLayer(layerId: any): void; - - // addLayer(rasterNode: any): void; - - // getLayer(id: any): any; - - // getLayers(ids: any): any[]; - - // getElevationLayer(): any; - - // setElevationScale(scale: any): void; -} - -export default LayeredMaterial; diff --git a/types/itowns/src/Renderer/OBB.d.ts b/types/itowns/src/Renderer/OBB.d.ts deleted file mode 100644 index 3f3cf6a673c8ea..00000000000000 --- a/types/itowns/src/Renderer/OBB.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import * as THREE from "three"; -import Extent from "../Core/Geographic/Extent"; - -declare class OBB extends THREE.Object3D { - constructor(min?: THREE.Vector3, max?: THREE.Vector3); - - box3D: THREE.Box3; - natBox: THREE.Box3; - z: { - min: number; - max: number; - scale: number; - }; - - clone(): this; - copy(cOBB: this): this; - updateZ(elevation?: { - min?: number; - max?: number; - scale?: number; - geoidHeight?: number; - }): void; - isSphereAboveXYBox(sphere: THREE.Sphere): boolean; - setFromExtent(extent: Extent, minHeight?: number, maxHeight?: number): this; -} - -export default OBB; diff --git a/types/itowns/src/Renderer/OrientedImageCamera.d.ts b/types/itowns/src/Renderer/OrientedImageCamera.d.ts deleted file mode 100644 index b403cdb842f349..00000000000000 --- a/types/itowns/src/Renderer/OrientedImageCamera.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as THREE from "three"; - -declare class Distortion { - size: THREE.Vector2; - pps?: THREE.Vector2; - polynom?: THREE.Vector4; - l1l2?: THREE.Vector3; - setFromMicmacCalibration(distortion: any, imageYDown?: boolean): void; - clone(): Distortion; -} - -declare class OrientedImageCamera extends THREE.PerspectiveCamera { - constructor( - size?: number | THREE.Vector2, - focal?: number | THREE.Vector2, - center?: THREE.Vector2, - near?: number, - far?: number, - skew?: number, - aspect?: number, - ); - - size: THREE.Vector2; - focal: THREE.Vector2; - center: THREE.Vector2; - skew: number; - textureMatrixWorldInverse: THREE.Matrix4; - distortion: Distortion; - maskPath?: any; - mask?: any; -} - -export default OrientedImageCamera; diff --git a/types/itowns/src/Renderer/PointsMaterial.d.ts b/types/itowns/src/Renderer/PointsMaterial.d.ts deleted file mode 100644 index 8902232808865f..00000000000000 --- a/types/itowns/src/Renderer/PointsMaterial.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import * as THREE from "three"; - -interface Classification { - visible: boolean; - name: string; - color: THREE.Color; - opacity: number; -} - -type ClassificationScheme = Record; - -export enum PNTS_MODE { - COLOR = 0, - INTENSITY = 1, - CLASSIFICATION = 2, - NORMAL = 3, -} - -export enum PNTS_SHAPE { - CIRCLE = 0, - SQUARE = 1, -} - -export enum PNTS_SIZE_MODE { - VALUE = 0, - ATTENUATED = 1, -} - -export const ClassificationScheme: ClassificationScheme; - -export interface PointsMaterialOptions extends THREE.ShaderMaterialParameters { - size?: number; - mode?: PNTS_MODE; - shape?: PNTS_SHAPE; - sizeMode?: PNTS_SIZE_MODE; - minAttenuatedSize?: number; - maxAttenuatedSize?: number; - overlayColor?: THREE.Vector4; - intensityRange?: THREE.Vector2; - applyOpacityClassication?: boolean; - classification?: ClassificationScheme; - // orientedImageMaterial: THREE.Material; - // scale: number; - // overlayColor: THREE.Vector4; -} - -declare class PointsMaterial extends THREE.RawShaderMaterial { - constructor(options?: PointsMaterialOptions); - - size: number; - scale: number; - opacity: number; - mode: PNTS_MODE; - shape: PNTS_SHAPE; - sizeMode: PNTS_SIZE_MODE; - classification: Classification; - intensityRange: THREE.Vector2; - picking: boolean; - overlayColor: THREE.Vector4; - applyOpacityClassication: boolean; - - recomputeClassification(): void; - enablePicking(picking: boolean): void; -} - -export default PointsMaterial; diff --git a/types/itowns/src/Renderer/Shader/ShaderChunk.d.ts b/types/itowns/src/Renderer/Shader/ShaderChunk.d.ts deleted file mode 100644 index 6b711b991b90b1..00000000000000 --- a/types/itowns/src/Renderer/Shader/ShaderChunk.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// TODO: Public API? - -declare class ShaderChunkManager { - constructor(target: any, path?: string); // TODO - - path: string | undefined; - target: any; - - customHeaderColorLayer(header: string): void; - customBodyColorLayer(body: string): void; - install(target?: any, chunks?: any, path?: string): any; // TODO -} - -declare const ShaderChunk: ShaderChunkManager; - -export default ShaderChunk; diff --git a/types/itowns/src/Source/C3DTilesIonSource.d.ts b/types/itowns/src/Source/C3DTilesIonSource.d.ts deleted file mode 100644 index 6aa4ed2a5dbeea..00000000000000 --- a/types/itowns/src/Source/C3DTilesIonSource.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import C3DTilesSource, { C3DTilesSourceOptions } from "./C3DTilesSource"; - -export interface C3DTilesIonSourceOptions extends Omit { - accessToken: string; - assetId: number; -} - -declare class C3DTilesIonSource extends C3DTilesSource { - constructor(source: C3DTilesIonSourceOptions); - - readonly isC3DTilesIonSource: boolean; - - accessToken: string; - assetId: number; - - // whenReady: Promise; -} -export default C3DTilesIonSource; diff --git a/types/itowns/src/Source/C3DTilesSource.d.ts b/types/itowns/src/Source/C3DTilesSource.d.ts deleted file mode 100644 index 270329d7a90eb1..00000000000000 --- a/types/itowns/src/Source/C3DTilesSource.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Extent } from "../Main"; -import Source, { SourceOptions } from "./Source"; - -export type C3DTilesSourceOptions = SourceOptions; - -declare class C3DTilesSource extends Source { - constructor(source: C3DTilesSourceOptions); - - readonly isC3DTilesSource: boolean; - baseUrl: string; - // whenReady: Promise; - - extentInsideLimit(extent: Extent, zoom: number): boolean; - urlFromExtent(extent: Extent): string; -} -export default C3DTilesSource; diff --git a/types/itowns/src/Source/EntwinePointTileSource.d.ts b/types/itowns/src/Source/EntwinePointTileSource.d.ts deleted file mode 100644 index 1061b24545143a..00000000000000 --- a/types/itowns/src/Source/EntwinePointTileSource.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import * as THREE from "three"; -import Extent from "../Core/Geographic/Extent"; -import Source, { SourceOptions } from "./Source"; - -interface EntwinePointTileSourceOptions extends SourceOptions { - colorDepth?: 8 | 16 | "auto"; -} - -interface ParsingOptionsLAS { - in?: { - colorDepth?: 8 | 16 | "auto"; - }; - out?: { - skip?: number; - }; -} - -interface ParsingOptionsBin { - in?: { - pointAttributes?: string[]; - }; -} - -type ParsingOptions = ParsingOptionsLAS | ParsingOptionsBin; - -declare class EntwinePointTileSource extends Source { - constructor(config: EntwinePointTileSourceOptions); - - readonly isEntwinePointTileSource: boolean; - - colorDepth?: 8 | 16 | "auto"; - extension: "laz" | "bin"; - spacing: number; - boundsConforming: [number, number, number, number, number, number]; - span: number; - - // TODO: Maybe templating on Source - fetcher: (url: string, options?: RequestInit) => Promise; - // TODO: Maybe templating on Source - parse: (buffer: ArrayBuffer, options: ParsingOptions) => Promise; - // TODO: Maybe templating on Source on whenReady promise - whenReady: Promise; - - extentInsideLimit(extent: Extent, zoom: number): boolean; - urlFromExtent(extent: Extent): string; -} - -export default EntwinePointTileSource; diff --git a/types/itowns/src/Source/FileSource.d.ts b/types/itowns/src/Source/FileSource.d.ts deleted file mode 100644 index ebb774c896fcf6..00000000000000 --- a/types/itowns/src/Source/FileSource.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Extent } from "../Main"; -import Source, { SourceOptions } from "./Source"; - -export interface FileSourceOptions extends SourceOptions { - crs: string; - fetchedData: any; - features: any; -} -// fetchedData: T | fetcher(string, InitRequest): T | features: T - -declare class FileSource extends Source { - // constructor(source: FileSourceOptions); - - readonly isFileSource: true; - - fetchedData: any; // T - whenReady: any; // Promise - zoom: { - min: number; - max: number; - }; - - extentInsideLimit(extent: Extent, zoom: number): boolean; - urlFromExtent(extent: Extent): string; -} - -export default FileSource; diff --git a/types/itowns/src/Source/OrientedImageSource.d.ts b/types/itowns/src/Source/OrientedImageSource.d.ts deleted file mode 100644 index 5b8fa8cb76aac5..00000000000000 --- a/types/itowns/src/Source/OrientedImageSource.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import Extent from "../Core/Geographic/Extent"; -import Source from "./Source"; - -declare class OrientedImageSource extends Source { - constructor(source: { - url: string; - orientationsUrl: string; - calibrationUrl: string; - }); - - readonly isOrientedImageSource: boolean; - - extentInsideLimit(extent: Extent, zoom: number): boolean; - urlFromExtent(extent: Extent): string; - - // whenReady: Promise<{ - // orientation: void | Object; - // calibration: void | Object; - // }>; - // urlFromExtent(imageInfo: { - // camera: string; - // pano: string; - // }): string; - // imageUrl(cameraId: string, panoId: string): string; -} - -export default OrientedImageSource; diff --git a/types/itowns/src/Source/PotreeSource.d.ts b/types/itowns/src/Source/PotreeSource.d.ts deleted file mode 100644 index 4ab3fb31a8cbf3..00000000000000 --- a/types/itowns/src/Source/PotreeSource.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import * as THREE from "three"; -import Extent from "../Core/Geographic/Extent"; -import Source, { SourceOptions } from "./Source"; - -export interface PotreeSourceOptions extends SourceOptions { - file: string; -} - -// TODO: Use ParsingOptions template? -interface ParsingOptions { - in: { - pointAttributes: "LAS" | "LAZ" | string[]; - }; -} - -declare class PotreeSource extends Source { - constructor(source: PotreeSourceOptions); - - file: string; - extensionOctree: string; - pointAttributes: "LAS" | "LAZ" | string[]; - baseurl: string; - extension: "cin" | "bin"; - - // TODO: Maybe templating on Source - fetcher: (url: string, options?: RequestInit) => Promise; - // TODO: Maybe templating on Source - parse: (buffer: ArrayBuffer, options: ParsingOptions) => Promise; - // TODO: Maybe templating on Source on whenReady promise - whenReady: Promise; - - extentInsideLimit(extent: Extent, zoom: number): boolean; - urlFromExtent(extent: Extent): string; -} - -export default PotreeSource; diff --git a/types/itowns/src/Source/Source.d.ts b/types/itowns/src/Source/Source.d.ts deleted file mode 100644 index 3ce463e2a4b91b..00000000000000 --- a/types/itowns/src/Source/Source.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import Extent from "../Core/Geographic/Extent"; - -// export const supportedFetchers: Map Promise>; -// export const supportedParsers: Map; - -export interface InformationsData { - crs: string; - isInverted: boolean; -} - -export interface ParsingOptions { - in: any; - out: any; -} // TODO - -// TODO: same type as openlayers -type AttributionLike = any; /* string | string[]; */ - -export interface SourceOptions { - crs?: string; - url: string; - format?: string; - fetcher?: (...params: any) => any; // TODO (Maybe templating) - parser?: (...params: any) => any; // TODO (Maybe templating) - networkOptions?: RequestInit & { crossOrigin: string }; - attribution?: AttributionLike; - extent?: Extent; -} - -declare abstract class Source implements InformationsData { - constructor(source: SourceOptions); // TODO: Only url is mandatory, maybe crs ??? - - readonly isSource: true; - readonly uid: number; - - crs: string; - isInverted: boolean; - url: string; - format: string; - fetcher: (...params: any) => any; // TODO (Maybe templating) - parser: (...params: any) => any; // TODO (Maybe templating) - networkOptions: RequestInit & { crossOrigin: string }; - attribution: AttributionLike; - whenReady: Promise; // TODO: Does not seem to be consistent in itowns - extent: Extent; - - // handlingError(err: Error): void; // TODO: Check type - abstract urlFromExtent(extent: Extent): string; - // requestToKey(extent: Extent): any[]; // TODO: Always tuple type ??? See inherited - // TODO: Templating, check type, etc... - loadData(extent: Extent, out: any): any; - // TODO: Add type for options, only options.out.crs defined - onLayerAdded(options: object): void; - // TODO: Add type for options, only options.unusedCrs defined - onLayerRemoved(options?: any): void; - abstract extentInsideLimit(extent: Extent, zoom: number): boolean; -} - -export default Source; diff --git a/types/itowns/src/Source/TMSSource.d.ts b/types/itowns/src/Source/TMSSource.d.ts deleted file mode 100644 index 59fd868fbe669f..00000000000000 --- a/types/itowns/src/Source/TMSSource.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import Source, { SourceOptions } from "./Source"; - -export interface TMSSourceOptions extends SourceOptions { - url: string; - tileMatrixSetLimits?: any; - tileMatrixCallback?: (level: number) => string; - isInverted?: boolean; - zoom?: { min: number; max: number }; -} - -declare class TMSSource extends Source { - constructor(source: TMSSourceOptions); - - readonly isTMSSource: true; - - // TODO: tileMatrixSet: string - - isInverted: boolean; - tileMatrixSetLimits: any; - extentSetlimits: any; - zoom: { min: number; max: number }; - tileMatrixCallback: (zoomLevel: number) => string; - - urlFromExtent(extent: any): string; - extentInsideLimit(extent: any, zoom: any): any; -} - -export default TMSSource; diff --git a/types/itowns/src/Source/VectorTilesSource.d.ts b/types/itowns/src/Source/VectorTilesSource.d.ts deleted file mode 100644 index 3981a5f33a3c29..00000000000000 --- a/types/itowns/src/Source/VectorTilesSource.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import TMSSource, { TMSSourceOptions } from "./TMSSource"; - -export interface VectorTilesSourceOptions extends Omit { - filter?: (layer: any) => boolean; - style: any; // string | any; - sprite?: string; - url?: string; - accessToken?: string; -} - -declare class VectorTilesSource extends TMSSource { - constructor(source: VectorTilesSourceOptions); - - // TODO: filter: function - // TODO: symbolToCircle: boolean - - // layers: {}; - // styles: {}; - // whenReady: Promise; - // jsonStyle: Object; - // sprites: Object; - // backgroundLayer: any; - - // accessToken: string | undefined; -} - -export default VectorTilesSource; diff --git a/types/itowns/src/Source/WFSSource.d.ts b/types/itowns/src/Source/WFSSource.d.ts deleted file mode 100644 index 87bcbd9a1a70ef..00000000000000 --- a/types/itowns/src/Source/WFSSource.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import Source, { SourceOptions } from "./Source"; - -export interface WFSSourceOptions extends SourceOptions { - // Mandatory: url, typeName, crs - url: string; - typeName: string; - crs: string; - version?: string; - zoom?: { min: number; max: number }; - vendorSpecific?: Record; -} - -declare class WFSSource extends Source { - constructor(source: WFSSourceOptions); - - readonly isWFSSource: boolean; - typeName: string; - version: string; - zoom: { min: number; max: number }; - vendorSpecific?: Record; - - urlFromExtent(extent: any): string; - extentInsideLimit(extent: any): any; -} -export default WFSSource; diff --git a/types/itowns/src/Source/WMSSource.d.ts b/types/itowns/src/Source/WMSSource.d.ts deleted file mode 100644 index dff660d73a5a7e..00000000000000 --- a/types/itowns/src/Source/WMSSource.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import Extent from "../Core/Geographic/Extent"; -import Source, { SourceOptions } from "./Source"; - -export type AxisOrder = "wsen" | "swne"; - -export interface WMSSourceOptions extends SourceOptions { - // Mandatory: url, name, extent, crs - url: string; - name: string; - extent: Extent; - crs: string; - - version?: string; - style?: string; - width?: number; - height?: number; - axisOrder?: AxisOrder; - transparent?: boolean; - vendorSpecific?: Record; -} - -declare class WMSSource extends Source { - constructor(source: WMSSourceOptions); - - readonly isWMSSource: boolean; - name: string; - version: string; - style: string; - width: number; - height: number; - axisOrder: AxisOrder; - transparent: boolean; - zoom: { min: number; max: number }; - vendorSpecific: Record; - - urlFromExtent(extent: any): string; - extentInsideLimit(extent: any): any; -} - -export default WMSSource; diff --git a/types/itowns/src/Source/WMTSSource.d.ts b/types/itowns/src/Source/WMTSSource.d.ts deleted file mode 100644 index 39c1d84367ef71..00000000000000 --- a/types/itowns/src/Source/WMTSSource.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import TMSSource, { TMSSourceOptions } from "./TMSSource"; - -export interface WMTSSourceOptions extends TMSSourceOptions { - name: string; - tileMatrixSet: string; - version?: string; - style?: string; - vendorSpecific?: Record; -} - -declare class WMTSSource extends TMSSource { - constructor(source: WMTSSourceOptions); - - readonly isWMTSSource: boolean; -} -export default WMTSSource; diff --git a/types/itowns/src/Utils/CameraUtils.d.ts b/types/itowns/src/Utils/CameraUtils.d.ts deleted file mode 100644 index 0f9a15d4569a3c..00000000000000 --- a/types/itowns/src/Utils/CameraUtils.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import * as THREE from "three"; -import Coordinates from "../Core/Geographic/Coordinates"; -import Extent from "../Core/Geographic/Extent"; -import View from "../Core/View"; - -// export function getLookAtFromMath(view: any, camera: any): any; -// export function getrig(camera: any): any; - -declare namespace _default { - interface CameraTransformOptions { - coord?: Coordinates; - tilt?: number; - heading?: number; - range?: number; - time?: number; - proxy?: boolean; - easing?: number; - // callback?: any; // TODO: Not documented - stopPlaceOnGroundAtEnd?: boolean; - } - - const defaultStopPlaceOnGroundAtEnd: boolean; - // const Easing: TWEEN.Easing; - - function stop(view: View, camera: THREE.Camera): void; - - function getTransformCameraLookingAtTarget( - view: View, - camera: THREE.Camera, - target?: THREE.Vector3, - ): CameraTransformOptions; - - function transformCameraToLookAtTarget( - view: View, - camera: THREE.Camera, - params?: CameraTransformOptions, - ): Promise; - - function getCameraTransformOptionsFromExtent( - view: View, - camera: THREE.Camera, - extent: Extent, - ): CameraTransformOptions; - - function animateCameraToLookAtTarget( - view: View, - camera: THREE.Camera, - params?: CameraTransformOptions, - ): Promise; - - function sequenceAnimationsToLookAtTarget( - view: View, - camera: THREE.Camera, - params?: CameraTransformOptions[], - ): Promise; - - function getDiffParams( - first: CameraTransformOptions, - second: CameraTransformOptions, - ): CameraTransformOptions; -} -export default _default; diff --git a/types/itowns/src/Utils/DEMUtils.d.ts b/types/itowns/src/Utils/DEMUtils.d.ts deleted file mode 100644 index 70149cdf865799..00000000000000 --- a/types/itowns/src/Utils/DEMUtils.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import * as THREE from "three"; -import Coordinates from "../Core/Geographic/Coordinates"; - -// TODO: Document and type public API - -declare namespace _default { - function getElevationValueAt( - layer: /* TiledGeometryLayer */ any, - coord: Coordinates, - method?: READ_Z_METHOD, - tileHint?: /* TileMesh */ any[], - ): number; - - function getTerrainObjectAt( - layer: /* TiledGeometryLayer */ any, - coord: Coordinates, - method?: READ_Z_METHOD, - tileHint?: /* TileMesh */ any[], - cache?: object, - ): { - /** - * - Pick coordinate with the elevation in coord.z. - */ - coord: Coordinates; - /** - * - the picked elevation texture. - * The texture where the `z` value has been read from - */ - texture: THREE.Texture; - /** - * - the picked tile and the tile containing the texture - */ - tile: /* TileMesh */ any; - }; - - const FAST_READ_Z: 0; - const PRECISE_READ_Z: 1; - type READ_Z_METHOD = typeof FAST_READ_Z | typeof PRECISE_READ_Z; - - function placeObjectOnGround( - layer: /* TiledGeometryLayer */ any, - crs: string, - obj: THREE.Object3D, - options?: { - method?: READ_Z_METHOD; - modifyGeometry: boolean; - }, - tileHint?: /* TileMesh */ any[], - ): boolean; -} - -export default _default; - -export function readTextureValueWithBilinearFiltering( - metadata: any, - texture: any, - vertexU: any, - vertexV: any, -): any; diff --git a/types/itowns/src/Utils/FeaturesUtils.d.ts b/types/itowns/src/Utils/FeaturesUtils.d.ts deleted file mode 100644 index ac9771538054db..00000000000000 --- a/types/itowns/src/Utils/FeaturesUtils.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import Feature, { FeatureCollection } from "../Core/Feature"; -import Coordinates from "../Core/Geographic/Coordinates"; - -declare namespace _default { - function filterFeaturesUnderCoordinate( - coordinate: Coordinates, - collection: Feature | FeatureCollection, - epsilon?: number, - ): Feature[]; -} -export default _default; diff --git a/types/itowns/src/Utils/OrientationUtils.d.ts b/types/itowns/src/Utils/OrientationUtils.d.ts deleted file mode 100644 index 9c1e7d8694bf09..00000000000000 --- a/types/itowns/src/Utils/OrientationUtils.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -import * as THREE from "three"; -import Coordinates from "../Core/Geographic/Coordinates"; - -declare namespace _default { - interface Attitude { - omega: number; - phi: number; - kappa: number; - roll: number; - pitch: number; - heading: number; - } - - function quaternionFromRollPitchHeading( - roll?: number, - pitch?: number, - heading?: number, - target?: THREE.Quaternion, - ): THREE.Quaternion; - - function quaternionFromOmegaPhiKappa( - omega?: number, - phi?: number, - kappa?: number, - target?: THREE.Quaternion, - ): THREE.Quaternion; - - function quaternionFromAttitude( - attitude: Attitude, - target?: THREE.Quaternion, - ): THREE.Quaternion; - - type FunctionOrQuaternion = any; // TODO - - interface Projection { - projName: string; - } - - function quaternionFromEnuToGeocent( - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; - - function quaternionFromGeocentToEnu( - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; - - function quaternionFromLCCToEnu( - proj: Projection, - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; - - function quaternionFromEnuToLCC( - proj: Projection, - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; - - function quaternionFromTMercToEnu( - proj: Projection, - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; - - function quaternionFromEnuToTMerc( - proj: Projection, - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; - - function quaternionFromLongLatToEnu( - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; - - function quaternionFromEnuToLongLat( - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; - - function quaternionUnimplemented( - proj: Projection, - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; - - function quaternionFromEnuToCRS( - crsOrProj: string | Projection, - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; - - function quaternionFromCRSToEnu( - crsOrProj: string | Projection, - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; - - function quaternionFromCRSToCRS( - crsIn: string, - crsOut: string, - coordinates?: Coordinates, - target?: THREE.Quaternion, - ): FunctionOrQuaternion; -} - -export default _default; diff --git a/types/itowns/test/3DTiles25D.ts b/types/itowns/test/3DTiles25D.ts deleted file mode 100644 index cabcbdad25e210..00000000000000 --- a/types/itowns/test/3DTiles25D.ts +++ /dev/null @@ -1,109 +0,0 @@ -import * as itowns from "itowns"; -import proj4 from "proj4"; -import * as THREE from "three"; - -// Define crs projection that we will use (taken from https://epsg.io/3946, Proj4js section) -proj4.defs( - "EPSG:3946", - "+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs", -); - -// Define geographic extent: CRS, min/max X, min/max Y -const extent = new itowns.Extent( - "EPSG:3946", - 1837816.94334, - 1847692.32501, - 5170036.4587, - 5178412.82698, -); - -// `viewerDiv` will contain iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Instanciate PlanarView* -const cameraCoord = new itowns.Coordinates( - "EPSG:3946", - 1841980, - 5175682, - 3000, -); -const view = new itowns.PlanarView(viewerDiv, extent, { - placement: { - coord: cameraCoord, - heading: 30, - range: 4000, - tilt: 30, - }, -}); - -// Add a WMS imagery source -const wmsImagerySource = new itowns.WMSSource({ - extent, - name: "Ortho2009_vue_ensemble_16cm_CC46", - url: "https://download.data.grandlyon.com/wms/grandlyon", - version: "1.3.0", - crs: "EPSG:3946", - format: "image/jpeg", -}); - -// Add a WMS imagery layer -const wmsImageryLayer = new itowns.ColorLayer("wms_imagery", { - updateStrategy: { - type: itowns.STRATEGY_DICHOTOMY, - options: {}, - }, - source: wmsImagerySource, -}); - -view.addLayer(wmsImageryLayer); - -// Add a WMS elevation source -const wmsElevationSource = new itowns.WMSSource({ - extent, - url: "https://download.data.grandlyon.com/wms/grandlyon", - name: "MNT2012_Altitude_10m_CC46", - crs: "EPSG:3946", - width: 256, - format: "image/jpeg", -}); - -// Add a WMS elevation layer -const wmsElevationLayer = new itowns.ElevationLayer("wms_elevation", { - useColorTextureElevation: true, - colorTextureElevationMinZ: 144, - colorTextureElevationMaxZ: 622, - source: wmsElevationSource, -}); - -view.addLayer(wmsElevationLayer); - -// Add 3D Tiles layer -// This 3D Tiles tileset uses the draco compression that is an -// extension of gltf. We need to enable it. -itowns.enableDracoLoader("./libs/draco/"); - -const $3dTilesLayer = new itowns.C3DTilesLayer( - "3d-tiles-layer-building", - { - name: "Lyon-2015-building", - source: new itowns.C3DTilesSource({ - url: "https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/" - + "3DTiles/lyon_1_3946_textured_draco/tileset.json", - }), - }, - view, -); - -// Lights -const dirLight = new THREE.DirectionalLight(0xffffff, 1); -dirLight.position.set(-0.9, 0.3, 1); -dirLight.updateMatrixWorld(); -view.scene.add(dirLight); - -const ambLight = new THREE.AmbientLight(0xffffff, 0.2); -view.scene.add(ambLight); - -itowns.View.prototype.addLayer.call(view, $3dTilesLayer); - -// Request redraw -view.notifyChange(); diff --git a/types/itowns/test/3DTilesBasic.ts b/types/itowns/test/3DTilesBasic.ts deleted file mode 100644 index aa02a49cee9b6a..00000000000000 --- a/types/itowns/test/3DTilesBasic.ts +++ /dev/null @@ -1,49 +0,0 @@ -import * as itowns from "itowns"; -import * as THREE from "three"; -import { OpenSM } from "./jsonLayers"; - -const placement = { - coord: new itowns.Coordinates("EPSG:4326", -75.6114, 40.03428, 0), - range: 4000, - tilt: 22, - heading: 180, -}; - -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -const view = new itowns.GlobeView(viewerDiv, placement); -(view.camera.camera3D as THREE.PerspectiveCamera).near = 5; - -itowns.Fetcher.json("./layers/JSONLayers/OPENSM.json").then(function _(json: OpenSM) { - const config = { - ...json, - source: new itowns.TMSSource(json.source), - }; - const layer = new itowns.ColorLayer("Ortho", config); - view.addLayer(layer); -}); - -// Create a new Layer 3d-tiles For DiscreteLOD -// ------------------------------------------- -const $3dTilesLayerDiscreteLOD = new itowns.C3DTilesLayer("3d-tiles-discrete-lod", { - name: "DiscreteLOD", - sseThreshold: 0.05, - source: new itowns.C3DTilesSource({ - url: "https://raw.githubusercontent.com/CesiumGS/3d-tiles-samples/master/1.0/TilesetWithDiscreteLOD/tileset.json", - }), -}, view); - -itowns.View.prototype.addLayer.call(view, $3dTilesLayerDiscreteLOD); - -// Create a new Layer 3d-tiles For Viewer Request Volume -// ----------------------------------------------------- - -const $3dTilesLayerRequestVolume = new itowns.C3DTilesLayer("3d-tiles-request-volume", { - name: "RequestVolume", - source: new itowns.C3DTilesSource({ - url: "https://raw.githubusercontent.com/CesiumGS/3d-tiles-samples/master/1.0/TilesetWithRequestVolume/tileset.json", - }), - sseThreshold: 1, -}, view); - -itowns.View.prototype.addLayer.call(view, $3dTilesLayerRequestVolume); diff --git a/types/itowns/test/3DTilesBatchTable.ts b/types/itowns/test/3DTilesBatchTable.ts deleted file mode 100644 index a8ae7394b602d0..00000000000000 --- a/types/itowns/test/3DTilesBatchTable.ts +++ /dev/null @@ -1,49 +0,0 @@ -import * as itowns from "itowns"; -import { OpenSM } from "./jsonLayers"; - -// Note: The following positions and camera parameters have been -// obtained manually using view.controls.getCameraCoordinate() ; -// view.controls.getCameraTargetPosition() ; -// view.controls.getCameraOrientation() -const placement = { - coord: new itowns.Coordinates("EPSG:4326", -75.61349, 40.044259), - range: 200, - tilt: 10, - heading: 145, -}; - -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -const view = new itowns.GlobeView(viewerDiv, placement); - -// Add Open Street Map orthographic layer -itowns.Fetcher.json("./layers/JSONLayers/OPENSM.json") - .then(function _(json: any) { - const config = { - ...json as OpenSM, - source: new itowns.TMSSource((json as OpenSM).source), - }; - const layer = new itowns.ColorLayer("Ortho", config); - view.addLayer(layer); - }); - -// Create a new 3D tiles layer with batch table hierarchy extension -const extensions = new itowns.C3DTExtensions(); -extensions.registerExtension("3DTILES_batch_table_hierarchy", { - [itowns.C3DTilesTypes.batchtable]: itowns.C3DTBatchTableHierarchyExtension, -}); - -// Create the 3D Tiles layer -const $3dTilesLayerBTHierarchy = new itowns.C3DTilesLayer( - "3d-tiles-bt-hierarchy", - { - name: "BTHierarchy", - source: new itowns.C3DTilesSource({ - url: "https://raw.githubusercontent.com/AnalyticalGraphicsInc/cesium/master/Apps/SampleData/Cesium3DTiles/Hierarchy/BatchTableHierarchy/tileset.json", - }), - registeredExtensions: extensions, - }, - view, -); - -itowns.View.prototype.addLayer.call(view, $3dTilesLayerBTHierarchy); diff --git a/types/itowns/test/3DTilesIon.ts b/types/itowns/test/3DTilesIon.ts deleted file mode 100644 index f605782b18ee8f..00000000000000 --- a/types/itowns/test/3DTilesIon.ts +++ /dev/null @@ -1,92 +0,0 @@ -import * as itowns from "itowns"; -import * as THREE from "three"; -import { IgnMNTHighres, OpenSM, WorldDTM } from "./jsonLayers"; - -// ---------- CREATE A GlobeView FOR SUPPORTING DATA VISUALIZATION : ---------- - -// Define camera initial position -const placement = { - coord: new itowns.Coordinates("EPSG:4326", 2.351323, 48.856712), - range: 25000000, -}; -// `viewerDiv` will contain iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Create a GlobeView -const viewOptions = { - diffuse: new THREE.Color(0xa0d5fc), -}; -const view = new itowns.GlobeView(viewerDiv, placement, viewOptions); - -// ---------- ADD A BASEMAP: ---------- - -// Add one imagery layer to the scene. This layer's properties are defined in a json file, but it could be -// defined as a plain js object. See `Layer` documentation for more info. -itowns.Fetcher.json("./layers/JSONLayers/OPENSM.json").then(function _(json: any) { - const config = { - ...json as OpenSM, - source: new itowns.TMSSource((json as OpenSM).source), - }; - const layer = new itowns.ColorLayer("Ortho", config); - view.addLayer(layer); -}); - -// ---------- ADD DIGITAL ELEVATION MODELS : ---------- - -// Add two elevation layers, each with a different level of detail. Here again, each layer's properties are -// defined in a json file. -function addElevationLayerFromConfig(json: WorldDTM | IgnMNTHighres) { - const config = { - ...json, - source: new itowns.WMTSSource(json.source), - }; - view.addLayer( - new itowns.ElevationLayer(config.id, config), - ); -} -itowns.Fetcher.json("./layers/JSONLayers/IGN_MNT_HIGHRES.json") - .then((json: any) => addElevationLayerFromConfig(json as IgnMNTHighres)); -itowns.Fetcher.json("./layers/JSONLayers/WORLD_DTM.json") - .then((json: any) => addElevationLayerFromConfig(json as WorldDTM)); - -// ---------- ADD 3D TILES MODEL FROM CESIUM ION SERVER : ---------- - -// Enable draco compression (used by this tileset) -itowns.enableDracoLoader("./libs/draco/"); - -// Create a new 3D Tiles batch table hierarchy extension manager and add it to the tileset since this tileset -// uses this extension -const extensions = new itowns.C3DTExtensions(); -extensions.registerExtension("3DTILES_batch_table_hierarchy", { - [itowns.C3DTilesTypes.batchtable]: itowns.C3DTBatchTableHierarchyExtension, -}); - -// Create a 3D Tiles layer from Cesium ion server with Cesium default access token and assetId of the -// OSM buildings dataset. -const threeDTilesIonSource = new itowns.C3DTilesIonSource({ - accessToken: "myAccessToken", - assetId: 96188, -}); -threeDTilesIonSource.whenReady.then(displayAttributions); // Add attributions returned by cesium ion server -const threeDTilesIonLayer = new itowns.C3DTilesLayer("3d-tiles-cesium-ion", { - name: "3D Tiles from Cesium Ion", - source: threeDTilesIonSource, - registeredExtensions: extensions, -}, view); - -itowns.View.prototype.addLayer.call(view, threeDTilesIonLayer); - -// Automatically convert cesium html attributions into html node elements and append them to the -// attributions div -function displayAttributions() { - const attribDiv = document.getElementById("attribution") as HTMLDivElement; - for (const attrib of threeDTilesIonSource.attribution) { - const attribElt = document.createElement("template"); - attribElt.innerHTML = attrib.html; - attribDiv.appendChild(attribElt.content.firstChild as Node); - } -} - -// ---------- ADD LIGHTS: ---------- -const ambLight = new THREE.AmbientLight(0xffffff, 1); -view.scene.add(ambLight); diff --git a/types/itowns/test/Entwine3DLoader.ts b/types/itowns/test/Entwine3DLoader.ts deleted file mode 100644 index 30a99204160ac8..00000000000000 --- a/types/itowns/test/Entwine3DLoader.ts +++ /dev/null @@ -1,80 +0,0 @@ -import * as itowns from "itowns"; -import * as THREE from "three"; - -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -const view = new itowns.GlobeView(viewerDiv); - -// Add one imagery layer to the scene and the miniView -// This layer is defined in a json file but it could be defined as a plain js -// object. See Layer* for more info. -itowns.Fetcher.json("./layers/JSONLayers/Ortho.json").then(function _(json: any) { - const config = { - ...json, - source: new itowns.WMTSSource(json.source), - }; - const layer = new itowns.ColorLayer("Ortho", config); - view.addLayer(layer); -}); -// Add two elevation layers. -// These will deform iTowns globe geometry to represent terrain elevation. -function addElevationLayerFromConfig(json: any) { - const config = { - ...json, - source: new itowns.WMTSSource(json.source), - }; - const layer = new itowns.ElevationLayer(config.id, config); - view.addLayer(layer); -} -itowns.Fetcher.json("./layers/JSONLayers/IGN_MNT_HIGHRES.json").then(addElevationLayerFromConfig); -itowns.Fetcher.json("./layers/JSONLayers/WORLD_DTM.json").then(addElevationLayerFromConfig); - -let eptLayer: itowns.EntwinePointTileLayer; -let eptSource: itowns.EntwinePointTileSource; - -function onLayerReady() { - const lookAt = new THREE.Vector3(); - eptLayer.root.bbox.getCenter(lookAt); - const coordLookAt = new itowns.Coordinates(view.referenceCrs, lookAt); - - const size = new THREE.Vector3(); - eptLayer.root.bbox.getSize(size); - - view.controls?.lookAtCoordinate({ - coord: coordLookAt, - range: 2 * size.length(), - }, false); -} - -function readEPTURL() { - const url = (document.getElementById("ept_url") as HTMLInputElement).value - || new URL(location.href).searchParams.get("ept"); - - if (url) { - loadEPT(url); - - // tslint:disable-next-line:prefer-template - (document.getElementById("share") as HTMLDivElement).innerHTML = "Link to share this view"; - (document.getElementById("ept_url") as HTMLInputElement).value = url; - } -} - -function loadEPT(url: string) { - eptSource = new itowns.EntwinePointTileSource({ url }); - - if (eptLayer) { - view.removeLayer("ept"); - view.notifyChange(); - } - - eptLayer = new itowns.EntwinePointTileLayer("Entwine Point Tile", { - source: eptSource, - crs: view.referenceCrs, - }); - - itowns.View.prototype.addLayer.call(view, eptLayer).then(onLayerReady); -} - -readEPTURL(); diff --git a/types/itowns/test/EntwineSimpleLoader.ts b/types/itowns/test/EntwineSimpleLoader.ts deleted file mode 100644 index aa7d20e12a3e66..00000000000000 --- a/types/itowns/test/EntwineSimpleLoader.ts +++ /dev/null @@ -1,90 +0,0 @@ -import * as itowns from "itowns"; -import * as THREE from "three"; - -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; -viewerDiv.style.display = "block"; -const view = new itowns.View("EPSG:3946", viewerDiv); -view.mainLoop.gfxEngine.renderer.setClearColor(0xcccccc); - -const controls = new itowns.FirstPersonControls(view, { focusOnClick: true }); - -let eptLayer: itowns.EntwinePointTileLayer; -let eptSource: itowns.EntwinePointTileSource; - -function onLayerReady() { - const camera = view.camera.camera3D as THREE.PerspectiveCamera; - - const lookAt = new THREE.Vector3(); - const size = new THREE.Vector3(); - eptLayer.root.bbox.getSize(size); - eptLayer.root.bbox.getCenter(lookAt); - - camera.far = 2.0 * size.length(); - - const position = eptLayer.root.bbox.min.clone() - .add(size.multiply(new THREE.Vector3(0, 0, size.x / size.z))); - - camera.position.copy(position); - camera.lookAt(lookAt); - - controls.options.moveSpeed = size.length(); - - view.notifyChange(camera); - controls.reset(); -} - -function readEPTURL() { - const url = (document.getElementById("ept_url") as HTMLInputElement).value - || new URL(location.href).searchParams.get("ept"); - - if (url) { - loadEPT(url); - - // tslint:disable-next-line:prefer-template - (document.getElementById("share") as HTMLDivElement).innerHTML = "Link to share this view"; - (document.getElementById("ept_url") as HTMLInputElement).value = url; - } -} - -function loadEPT(url: string) { - eptSource = new itowns.EntwinePointTileSource({ url }); - - if (eptLayer) { - view.removeLayer("Entwine Point Tile"); - view.notifyChange(); - } - - eptLayer = new itowns.EntwinePointTileLayer("Entwine Point Tile", { - source: eptSource, - crs: view.referenceCrs, - }); - - view.addLayer(eptLayer).then(onLayerReady); - - function dblClickHandler(event: MouseEvent) { - const pick = view.pickObjectsAt(event, 5, eptLayer); - - for (const p of pick) { - console.info( - // tslint:disable-next-line:prefer-template - "Selected point #" + p.index + " in position (" - + p.object.position.x + ", " - + p.object.position.y + ", " - + p.object.position.z - + ") - node " + p.object.userData.node.id, - ); - } - } - view.domElement.addEventListener("dblclick", dblClickHandler); -} - -function loadGrandLyon() { - (document.getElementById("ept_url") as HTMLInputElement).value = - "https://download.data.grandlyon.com/files/grandlyon/imagerie/mnt2018/lidar/ept/"; - readEPTURL(); -} - -readEPTURL(); diff --git a/types/itowns/test/GeoidGeoidLayer.ts b/types/itowns/test/GeoidGeoidLayer.ts deleted file mode 100644 index 4ec1b74c861903..00000000000000 --- a/types/itowns/test/GeoidGeoidLayer.ts +++ /dev/null @@ -1,65 +0,0 @@ -import * as itowns from "itowns"; -import { IgnMNTHighres, Ortho, WorldDTM } from "./jsonLayers"; - -// ---------- CREATE A GlobeView FOR SUPPORTING DATA VISUALIZATION : ---------- - -// Define camera initial position -const placement = { - coord: new itowns.Coordinates("EPSG:4326", 2.351323, 48.856712), - range: 25000000, -}; - -// `viewerDiv` contains iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Create a GlobeView -const view = new itowns.GlobeView(viewerDiv, placement); - -// ---------- DISPLAY CONTEXTUAL DATA : ---------- - -// Add one imagery layer to the scene. This layer's properties are defined in a json file, but it could be -// defined as a plain js object. See `Layer` documentation for more info. -itowns.Fetcher.json("layers/JSONLayers/Ortho.json").then((json: any) => { - const config = { - ...json as Ortho, - source: new itowns.WMTSSource((json as Ortho).source), - }; - view.addLayer( - new itowns.ColorLayer(config.id, config), - ); -}); - -// Add two elevaion layers, each with a different level of detail. Here again, each layer's properties are -// defined in a json file. -function addElevationLayerFromConfig(json: IgnMNTHighres | WorldDTM) { - const config = { - ...json, - source: new itowns.WMTSSource(json.source), - }; - view.addLayer(new itowns.ElevationLayer(config.id, config)); -} -itowns.Fetcher.json("layers/JSONLayers/IGN_MNT_HIGHRES.json").then(addElevationLayerFromConfig); -itowns.Fetcher.json("layers/JSONLayers/WORLD_DTM.json").then(addElevationLayerFromConfig); - -// ---------- DISPLAY GEOID HEIGHT DATA : ---------- - -// As both ElevationLayers data consist in altitudes, and as iTowns GlobeView displays elevation data as -// ellipsoid heights, we must add a GeoidLayer to display the altitudes correctly. - -// Define the source of a geoid height grid, which serves as a conversion grid between altitudes and -// ellipsoid heights. -const geoidSource = new itowns.FileSource({ - url: "https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/altitude-conversion-grids/" - + "RAF20_float.gtx", - crs: "EPSG:4326", - format: "application/gtx", -}); -// Specify the type geoid height data are encoded with. See GTXParser documentation at -// http://www.itowns-project.org/itowns/docs/#api/Parser/GTXParser for more. -// geoidSource.dataType = 'float'; TODO - -// Create a Layer to support geoid height data and add it to the view. -const geoidLayer = new itowns.GeoidLayer("geoid", { - source: geoidSource, -}); -view.addLayer(geoidLayer); diff --git a/types/itowns/test/Potree3DMap.ts b/types/itowns/test/Potree3DMap.ts deleted file mode 100644 index fede91d260ee34..00000000000000 --- a/types/itowns/test/Potree3DMap.ts +++ /dev/null @@ -1,48 +0,0 @@ -import * as itowns from "itowns"; - -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; -viewerDiv.style.display = "block"; - -const placement = { - coord: new itowns.Coordinates("EPSG:4326", 4.631512, 43.675626), - range: 100, - tilt: 45, - heading: -60, -}; - -const view = new itowns.GlobeView(viewerDiv, placement, { - handleCollision: false, -}); - -view.controls!.minDistance = 50; - -// Configure Point Cloud layer -const potreeLayer = new itowns.PotreeLayer("eglise_saint_blaise_arles", { - source: new itowns.PotreeSource({ - file: "eglise_saint_blaise_arles.js", - url: "https://raw.githubusercontent.com/gmaillet/dataset/master/", - crs: view.referenceCrs, - }), -}); - -// add potreeLayer to scene -function onLayerReady() { - // update stats window - const info = document.getElementById("info") as HTMLDivElement; - view.addFrameRequester(itowns.MAIN_LOOP_EVENTS.AFTER_RENDER, () => { - info.textContent = potreeLayer.displayedCount.toLocaleString() + " points"; - }); -} - -itowns.View.prototype.addLayer.call(view, potreeLayer).then(onLayerReady); - -itowns.Fetcher.json("./layers/JSONLayers/IGN_MNT_HIGHRES.json").then(function _(config: any) { - config.source = new itowns.WMTSSource(config.source); - const layer = new itowns.ElevationLayer(config.id, config); - view.addLayer(layer); -}); -itowns.Fetcher.json("./layers/JSONLayers/Ortho.json").then(function _(config: any) { - config.source = new itowns.WMTSSource(config.source); - const layer = new itowns.ColorLayer(config.id, config); - view.addLayer(layer); -}); diff --git a/types/itowns/test/SourceFileFromFormat.ts b/types/itowns/test/SourceFileFromFormat.ts deleted file mode 100644 index 751e1a8031e820..00000000000000 --- a/types/itowns/test/SourceFileFromFormat.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as itowns from "itowns"; - -// ---------- CREATE A GlobeView : ---------- - -// Define camera initial position -const placement = { - coord: new itowns.Coordinates("EPSG:4326", 3.05, 48.95), - range: 70000, -}; - -// `viewerDiv` will contain iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Instantiate iTowns GlobeView -const view = new itowns.GlobeView(viewerDiv, placement); - -// ---------- DISPLAY CONTEXTUAL DATA : ---------- - -// Add one imagery layer to the scene -// This layer is defined in a json file but it could be defined as a plain js -// object. See Layer* for more info. -itowns.Fetcher.json("./layers/JSONLayers/Ortho.json").then(function _(json: any) { - const config = { - ...json, - source: new itowns.WMTSSource(json.source), - }; - const layer = new itowns.ColorLayer("Ortho", config); - view.addLayer(layer); -}); - -// ---------- DEFINE DATA SOURCE SPECIFYING ITS FORMAT : ---------- - -const sourceFromFormat = new itowns.FileSource({ - url: "https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/lyon-ZU.geojson", - crs: "EPSG:4326", - format: "application/json", -}); - -view.addLayer( - new itowns.ColorLayer("Urban Area", { - source: sourceFromFormat, - style: { - fill: { color: "red", opacity: 0.5 }, - stroke: { color: "red" }, - }, - }), -); - -// ---------- REORDER ColorLayers AND MOVE CAMERA : ---------- - -view.addEventListener(itowns.GLOBE_VIEW_EVENTS.GLOBE_INITIALIZED, () => { - // Organize the order with which layers are superposing. - itowns.ColorLayersOrdering.moveLayerToIndex(view, "Ortho", 0); - // Move the camera to visualize all data. - view.controls?.lookAtCoordinate(sourceFromFormat.extent, false); -}); - -view.addEventListener(itowns.GLOBE_VIEW_EVENTS.COLOR_LAYERS_ORDER_CHANGED, (event) => { - event.previous.sequence; // $ExpectType string[] - event.new.sequence; // $ExpectType string[] -}); diff --git a/types/itowns/test/SourceFileFromMethods.ts b/types/itowns/test/SourceFileFromMethods.ts deleted file mode 100644 index 124d3a725fb303..00000000000000 --- a/types/itowns/test/SourceFileFromMethods.ts +++ /dev/null @@ -1,63 +0,0 @@ -import * as itowns from "itowns"; - -// ---------- CREATE A GlobeView : ---------- - -// Define camera initial position -const placement = { - coord: new itowns.Coordinates("EPSG:4326", 3.05, 48.95), - range: 70000, -}; - -// `viewerDiv` will contain iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Instantiate iTowns GlobeView -const view = new itowns.GlobeView(viewerDiv, placement); - -// ---------- DISPLAY CONTEXTUAL DATA : ---------- - -// Add one imagery layer to the scene -// This layer is defined in a json file but it could be defined as a plain js -// object. See Layer* for more info. -itowns.Fetcher.json("./layers/JSONLayers/Ortho.json").then(function _(json: any) { - const config = { - ...json, - source: new itowns.WMTSSource(json.source), - }; - const layer = new itowns.ColorLayer("Ortho", config); - view.addLayer(layer); -}); - -// ---------- DEFINE DATA SOURCE SPECIFYING FETCHER AND PARSER METHODS : ---------- - -const sourceFromFetcherAndParser = new itowns.FileSource({ - url: "https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/lyon-hydro.geojson", - crs: "EPSG:4326", - // Specify fetcher and parser methods. Should you implement some custom ones, they would need to be called here. - fetcher: itowns.Fetcher.json, - parser: itowns.GeoJsonParser.parse, -}); - -view.addLayer( - new itowns.ColorLayer("Hydro", { - source: sourceFromFetcherAndParser, - style: { - fill: { color: "cyan", opacity: 0.5 }, - stroke: { color: "blue" }, - }, - }), -); - -// ---------- REORDER ColorLayers AND MOVE CAMERA : ---------- - -view.addEventListener(itowns.GLOBE_VIEW_EVENTS.GLOBE_INITIALIZED, () => { - // Organize the order with which layers are superposing. - itowns.ColorLayersOrdering.moveLayerToIndex(view, "Ortho", 0); - // Move the camera to visualize all data. - view.controls?.lookAtCoordinate(sourceFromFetcherAndParser.extent, false); -}); - -view.addEventListener(itowns.VIEW_EVENTS.COLOR_LAYERS_ORDER_CHANGED, (event) => { - event.previous.sequence; // $ExpectType string[] - event.new.sequence; // $ExpectType string[] -}); diff --git a/types/itowns/test/VectorTile3DMesh.ts b/types/itowns/test/VectorTile3DMesh.ts deleted file mode 100644 index 5d65d0002ce044..00000000000000 --- a/types/itowns/test/VectorTile3DMesh.ts +++ /dev/null @@ -1,116 +0,0 @@ -import * as itowns from "itowns"; -import * as THREE from "three"; - -interface BDAltiProp { - alti_sol: number; - hauteur: number; -} - -// ---------- CREATE A GlobeView FOR SUPPORTING DATA VISUALIZATION : ---------- - -// Define camera initial position -const placement = { - coord: new itowns.Coordinates("EPSG:4326", 2.351323, 48.856712), - range: 5000, - tilt: 45, -}; - -// `viewerDiv` will contain iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Create a GlobeView -const view = new itowns.GlobeView(viewerDiv, placement); - -// Define poles texture -view.tileLayer.noTextureColor = new THREE.Color(0x95c1e1); - -// Disable atmosphere lighting -// view.getLayerById('atmosphere').visible = false; // TODO -// view.getLayerById('atmosphere').fog.enable = false; // TODO - -// ---------- DISPLAY CONTEXTUAL DATA : ---------- - -// Add two elevation layers, each with a different level of detail. Each layer's properties are defined in -// a json file. -function addElevationLayerFromConfig(json: any) { - const config = { - ...json, - source: new itowns.WMTSSource(json.source), - }; - view.addLayer(new itowns.ElevationLayer(config.id, config)); -} -itowns.Fetcher.json("./layers/JSONLayers/IGN_MNT_HIGHRES.json").then(addElevationLayerFromConfig); -itowns.Fetcher.json("./layers/JSONLayers/WORLD_DTM.json").then(addElevationLayerFromConfig); - -// ---------- DISPLAY VECTOR TILED MAP DATA AS A ColorLayer : ---------- - -// Define the source of the ColorLayer data : a vector tiled map from the geoportail. -const mapSource = new itowns.VectorTilesSource({ - style: "https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/standard.json", - // We don't display mountains and parcels related data to ease visualisation. Also, we don't display - // buildings related data as it will be displayed in another Layer. - filter: (layer: any) => { - return !layer["source-layer"].includes("bati_surf") - && !layer["source-layer"].includes("oro_") - && !layer["source-layer"].includes("routier_ponc") - && !layer["source-layer"].includes("parcellaire"); - }, -}); - -// Create a ColorLayer to support map data. -const mapLayer = new itowns.ColorLayer("MVT", { - source: mapSource, - effect_type: itowns.colorLayerEffects.removeLightColor, - effect_parameter: 2.5, - addLabelLayer: { performance: true }, - style: { - text: { - color: "#000000", - haloColor: "#ffffff", - haloWidth: 3, - haloBlur: 2, - }, - }, -}); - -// Add the ColorLayer to the scene and to the debug menu. -view.addLayer(mapLayer); - -// ---------- DISPLAY ORTHO-IMAGES : ---------- - -const ortho = itowns.Fetcher.json("./layers/JSONLayers/Ortho.json").then(function _(json: any) { - const config = { - ...json, - source: new itowns.WMTSSource(json.source), - }; - const layer = new itowns.ColorLayer("Ortho", config); - return view.addLayer(layer); -}); - -// ---------- DISPLAY VECTOR TILED BUILDING DATA AS 3D MESHES : ---------- - -// Define the source of the building data : those are vector tiled data from the geoportail. -const buildingsSource = new itowns.VectorTilesSource({ - style: "https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/standard.json", - // We only want to display buildings related data. - filter: (layer: any) => { - return layer["source-layer"].includes("bati_surf") - && layer.paint["fill-color"]; - }, -}); - -// Create a FeatureGeometryLayer to support building data. -const buildingsLayer = new itowns.FeatureGeometryLayer("VTBuilding", { - source: buildingsSource, - zoom: { min: 15 }, - accurate: false, - style: { - fill: { - base_altitude: (p: BDAltiProp) => p.alti_sol || 0, - extrusion_height: (p: BDAltiProp) => p.hauteur || 0, - }, - }, -}); - -// Add the FeatureGeometryLayer to the scene and to the debug menu. -view.addLayer(buildingsLayer); diff --git a/types/itowns/test/VectorTileDragNDrop.ts b/types/itowns/test/VectorTileDragNDrop.ts deleted file mode 100644 index e2d15977d4fc5f..00000000000000 --- a/types/itowns/test/VectorTileDragNDrop.ts +++ /dev/null @@ -1,60 +0,0 @@ -import * as itowns from "itowns"; - -const placement = { - coord: new itowns.Coordinates("EPSG:4326", 2.475, 48.807), - range: 120000, -}; - -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; -const view = new itowns.GlobeView(viewerDiv, placement); - -let currentLayer: itowns.ColorLayer; - -// Drag and drop handler -const fileReader = new FileReader(); - -let id = 0; -fileReader.onload = function onload(e) { - id++; - currentLayer.visible = false; - const style = JSON.parse(e.target?.result as string); - console.log(style); - - const source = new itowns.VectorTilesSource({ style }); - - const layer = new itowns.ColorLayer(`${style.name} ${id}`, { - source, - noTextureParentOutsideLimit: true, - // addLabelLayer: true, // TODO: Error on example - }); - - view.addLayer(layer); - currentLayer = layer; -}; - -// Load the file -function loadStyle(event: Event, files?: FileList) { - event.preventDefault(); - if (!files) return; - - // Take one at a time - const file = files[0]; - fileReader.readAsText(file); -} - -// Listen to drag and drop actions -document.addEventListener("dragenter", function _(e) { - e.preventDefault(); -}, false); -document.addEventListener("dragover", function _(e) { - e.preventDefault(); -}, false); -document.addEventListener("dragleave", function _(e) { - e.preventDefault(); -}, false); -document.addEventListener("drop", function _(e) { - loadStyle(e, e.dataTransfer?.files); -}, false); -document.addEventListener("paste", function _(e) { - loadStyle(e, e.clipboardData?.files); -}, false); diff --git a/types/itowns/test/VectorTileRaster2D.ts b/types/itowns/test/VectorTileRaster2D.ts deleted file mode 100644 index d2d66b0813330a..00000000000000 --- a/types/itowns/test/VectorTileRaster2D.ts +++ /dev/null @@ -1,45 +0,0 @@ -import * as itowns from "itowns"; - -// # Planar view with one single layer of vector tile - -// Define geographic extent: CRS, min/max X, min/max Y -const extent = new itowns.Extent( - "EPSG:3857", - -20037508.342789244, - 20037508.342789244, - -20037508.342789255, - 20037508.342789244, -); - -// `viewerDiv` will contain iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Instanciate PlanarView -const view = new itowns.PlanarView(viewerDiv, extent, { - maxSubdivisionLevel: 20, - controls: { - // We do not want the user to zoom out too much - maxAltitude: 40000000, - // We want to keep the rotation disabled, to only have a view from the top - enableRotation: false, - // Don't zoom too much on smart zoom - smartTravelHeightMax: 100000, - }, -}); - -// Defines a VectorTilesSource to load Vector Tiles data from the geoportail -const mvtSource = new itowns.VectorTilesSource({ - style: "https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/standard.json", - // We don't display mountains related data to ease visualisation - filter: (layer: any) => !layer["source-layer"].includes("oro_") && !layer["source-layer"].includes("parcellaire"), -}); - -const mvtLayer = new itowns.ColorLayer("MVT", { - source: mvtSource, - addLabelLayer: { performance: true }, -}); - -view.addLayer(mvtLayer); - -// Request redraw -view.notifyChange(true); diff --git a/types/itowns/test/VectorTileRaster3D.ts b/types/itowns/test/VectorTileRaster3D.ts deleted file mode 100644 index b77a0c62571d5e..00000000000000 --- a/types/itowns/test/VectorTileRaster3D.ts +++ /dev/null @@ -1,47 +0,0 @@ -import * as itowns from "itowns"; -import * as THREE from "three"; - -// # Simple Globe viewer + a vector tile layer - -// Define initial camera position -const placement = { - coord: new itowns.Coordinates("EPSG:4326", 2.475, 48.807), - range: 12000000, -}; -const promises = []; - -// `viewerDiv` will contain iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Instanciate iTowns GlobeView* -const view = new itowns.GlobeView(viewerDiv, placement); - -// define pole texture -view.tileLayer.noTextureColor = new THREE.Color(0x95c1e1); - -// view.getLayerById('atmosphere').visible = false; // TODO -// view.getLayerById('atmosphere').fog.enable = false; // TODO - -promises.push( - itowns.Fetcher.json("./layers/JSONLayers/Ortho.json").then(function _(config: any) { - config.source = new itowns.WMTSSource(config.source); - const layer = new itowns.ColorLayer("Ortho", config); - return view.addLayer(layer); - }), -); - -// Define a VectorTilesSource to load Vector Tiles data from the geoportail -const mvtSource = new itowns.VectorTilesSource({ - style: "https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/standard.json", - // We don't display mountains related data to ease visualisation - filter: (layer: any) => !layer["source-layer"].includes("oro_") && !layer["source-layer"].includes("parcellaire"), -}); - -const mvtLayer = new itowns.ColorLayer("MVT", { - source: mvtSource, - effect_type: itowns.colorLayerEffects.removeLightColor, - effect_parameter: 2.5, - addLabelLayer: { performance: true }, -}); - -view.addLayer(mvtLayer); diff --git a/types/itowns/test/View25DMap.ts b/types/itowns/test/View25DMap.ts deleted file mode 100644 index c6bfa46fc0fd9c..00000000000000 --- a/types/itowns/test/View25DMap.ts +++ /dev/null @@ -1,94 +0,0 @@ -import * as itowns from "itowns"; - -// 2.5D map example -// https://github.com/iTowns/itowns/blob/master/examples/view_25d_map.html - -// Define geographic extent: CRS, min/max X, min/max Y -const extent = new itowns.Extent( - "EPSG:3946", - 1837816.94334, - 1847692.32501, - 5170036.4587, - 5178412.82698, -); - -// `viewerDiv` will contain iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Instanciate PlanarView* -const view = new itowns.PlanarView( - viewerDiv, - extent, - { placement: { heading: 49.6, range: 6200, tilt: 17 } }, -); - -// Add a WMS imagery source -const wmsImagerySource = new itowns.WMSSource({ - extent, - name: "Ortho2009_vue_ensemble_16cm_CC46", - url: "https://download.data.grandlyon.com/wms/grandlyon", - version: "1.3.0", - crs: "EPSG:3946", - format: "image/jpeg", -}); - -// Add a WMS imagery layer -const wmsImageryLayer = new itowns.ColorLayer("wms_imagery", { - updateStrategy: { - type: itowns.STRATEGY_DICHOTOMY, - options: {}, - }, - source: wmsImagerySource, -}); - -view.addLayer(wmsImageryLayer); - -// Add a WMS elevation source -const wmsElevationSource = new itowns.WMSSource({ - extent, - url: "https://download.data.grandlyon.com/wms/grandlyon", - name: "MNT2012_Altitude_10m_CC46", - crs: "EPSG:3946", - width: 256, - format: "image/jpeg", -}); - -// Add a WMS elevation layer -const wmsElevationLayer = new itowns.ElevationLayer("wms_elevation", { - useColorTextureElevation: true, - colorTextureElevationMinZ: 144, - colorTextureElevationMaxZ: 622, - source: wmsElevationSource, -}); - -view.addLayer(wmsElevationLayer); - -const wfsCartoSource = new itowns.WFSSource({ - url: "https://wxs.ign.fr/cartovecto/geoportail/wfs?", - version: "2.0.0", - typeName: "BDCARTO_BDD_WLD_WGS84G:zone_habitat_mairie", - crs: "EPSG:3946", - format: "application/json", -}); - -const wfsCartoStyle = { - zoom: { min: 0, max: 20 }, - text: { - field: "{toponyme}", - color: "white", - transform: "uppercase", - size: 15, - haloColor: "rgba(20,20,20, 0.8)", - haloWidth: 3, - }, -}; - -const wfsCartoLayer = new itowns.LabelLayer("wfsCarto", { - source: wfsCartoSource, - style: wfsCartoStyle, -}); - -view.addLayer(wfsCartoLayer); - -// Request redraw -view.notifyChange(); diff --git a/types/itowns/test/View2DMap.ts b/types/itowns/test/View2DMap.ts deleted file mode 100644 index 70f6da0605bc74..00000000000000 --- a/types/itowns/test/View2DMap.ts +++ /dev/null @@ -1,58 +0,0 @@ -import * as itowns from "itowns"; - -// # Orthographic viewer - -// Define geographic extent: CRS, min/max X, min/max Y -const extent = new itowns.Extent( - "EPSG:3857", - -20026376.39, - 20026376.39, - -20048966.10, - 20048966.10, -); - -// `viewerDiv` will contain iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Instanciate PlanarView -// By default itowns' tiles geometry have a "skirt" (ie they have a height), -// but in case of orthographic we don't need this feature, so disable it -const view = new itowns.PlanarView(viewerDiv, extent, { - disableSkirt: true, - maxSubdivisionLevel: 10, - camera: { type: itowns.CAMERA_TYPE.ORTHOGRAPHIC }, - placement: new itowns.Extent("EPSG:3857", -20000000, 20000000, -8000000, 20000000), - controls: { - // Faster zoom in/out speed - zoomFactor: 3, - // prevent from zooming in too much - maxResolution: 0.005, // a pixel shall not represent a metric size smaller than 5 mm - }, -}); - -// Add a TMS imagery source -const opensmSource = new itowns.TMSSource({ - isInverted: true, - // tslint:disable-next-line: no-invalid-template-strings - url: "http://c.tile.stamen.com/watercolor/${z}/${x}/${y}.jpg", - networkOptions: { crossOrigin: "anonymous" }, - extent, - crs: "EPSG:3857", - attribution: { - name: "OpenStreetMap", - url: "http://www.openstreetmap.org/", - }, -}); - -// Add a TMS imagery layer -const opensmLayer = new itowns.ColorLayer("OPENSM", { - updateStrategy: { - type: itowns.STRATEGY_DICHOTOMY, - }, - source: opensmSource, -}); - -view.addLayer(opensmLayer); - -// Request redraw -view.notifyChange(); diff --git a/types/itowns/test/View3DMap.ts b/types/itowns/test/View3DMap.ts deleted file mode 100644 index 34656b52f732ef..00000000000000 --- a/types/itowns/test/View3DMap.ts +++ /dev/null @@ -1,47 +0,0 @@ -import * as itowns from "itowns"; -import { IgnMNTHighres, Ortho, WorldDTM } from "./jsonLayers"; - -// ---------- CREATE A GlobeView FOR SUPPORTING DATA VISUALIZATION : ---------- - -// Define camera initial position -const placement = { - coord: new itowns.Coordinates("EPSG:4326", 2.351323, 48.856712), - range: 25000000, -}; - -// `viewerDiv` will contain iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Create a GlobeView -const view = new itowns.GlobeView(viewerDiv, placement); - -// ---------- DISPLAY ORTHO-IMAGES : ---------- - -// Add one imagery layer to the scene. This layer's properties are defined in a json file, but it could be -// defined as a plain js object. See `Layer` documentation for more info. -itowns.Fetcher.json("./layers/JSONLayers/Ortho.json").then(function _(json: Ortho) { - const config = { - ...json, - source: new itowns.WMTSSource(json.source), - }; - view.addLayer(new itowns.ColorLayer("Ortho", config)); -}); - -// ---------- DISPLAY A DIGITAL ELEVATION MODEL : ---------- - -// Add two elevation layers, each with a different level of detail. Here again, each layer's properties are -// defined in a json file. -function addElevationLayerFromConfig(json: IgnMNTHighres | WorldDTM) { - const config = { - ...json, - source: new itowns.WMTSSource(json.source), - }; - view.addLayer(new itowns.ElevationLayer(config.id, config)); -} -itowns.Fetcher.json("./layers/JSONLayers/IGN_MNT_HIGHRES.json").then(addElevationLayerFromConfig); -itowns.Fetcher.json("./layers/JSONLayers/WORLD_DTM.json").then(addElevationLayerFromConfig); - -// ---------- DISPLAY ATMOSPHERIC LIGHTING : ---------- - -const atmosphere = view.getLayerById("atmosphere"); -// atmosphere.setRealisticOn(!view.isDebugMode); TODO diff --git a/types/itowns/test/View3DmnsMap.ts b/types/itowns/test/View3DmnsMap.ts deleted file mode 100644 index b3fc64ec9be52d..00000000000000 --- a/types/itowns/test/View3DmnsMap.ts +++ /dev/null @@ -1,45 +0,0 @@ -import * as itowns from "itowns"; -import { IgnMNTHighres } from "./jsonLayers"; - -// ---------- CREATE A GlobeView FOR SUPPORTING DATA VISUALIZATION : ---------- - -// Define camera initial position -const placement = { - coord: new itowns.Coordinates("EPSG:4326", 6.3486, 45.39023), - range: 1500, - tilt: 14, - heading: 25, -}; - -// `viewerDiv` will contain iTowns' rendering area (``) -const viewerDiv = document.getElementById("viewerDiv") as HTMLDivElement; - -// Create a GlobeView -const view = new itowns.GlobeView(viewerDiv, placement); - -// ---------- DISPLAY ORTHO-IMAGES : ---------- - -// Add one imagery layer to the scene. This layer's properties are defined in a json file, but it could be -// defined as a plain js object. See `Layer` documentation for more info. -itowns.Fetcher.json("./layers/JSONLayers/Ortho.json").then(function _(config: any) { - config.source = new itowns.WMTSSource(config.source); - view.addLayer(new itowns.ColorLayer("Ortho", config)); -}); - -// ---------- DISPLAY A DIGITAL ELEVATION MODEL : ---------- - -// Add two elevation layers, each with a different level of detail. Here again, each layer's properties are -// defined in a json file. -function addElevationLayerFromConfig(json: IgnMNTHighres) { - const config = { - ...json, - source: new itowns.WMTSSource(json.source), - }; - view.addLayer(new itowns.ElevationLayer(config.id, config)); -} -itowns.Fetcher.json("./layers/JSONLayers/IGN_MNS_HIGHRES.json").then(addElevationLayerFromConfig); - -// ---------- DISPLAY ATMOSPHERIC LIGHTING : ---------- - -const atmosphere = view.getLayerById("atmosphere"); -// atmosphere.setRealisticOn(!view.isDebugMode); // TODO diff --git a/types/itowns/test/jsonLayers.ts b/types/itowns/test/jsonLayers.ts deleted file mode 100644 index c100b743587639..00000000000000 --- a/types/itowns/test/jsonLayers.ts +++ /dev/null @@ -1,85 +0,0 @@ -interface TileMatrixSetLimit { - minTileRow: number; - maxTileRow: number; - minTileCol: number; - maxTileCol: number; -} - -export interface IgnMNTHighres { - id: string; - noDataValue: number; - clampValues: { - min: number; - }; - updateStrategy: { - type: 1; - options: { - groups: number[]; - }; - }; - source: { - url: string; - crs: string; - format: string; - attribution: { - name: string; - url: string; - }; - name: string; - tileMatrixSet: string; - tileMatrixSetLimits: Record; - }; -} - -export interface OpenSM { - id: string; - source: { - crs: string; - isInverted: boolean; - format: string; - url: string; - attribution: { - name: string; - url: string; - }; - tileMatrixSet: string; - }; -} - -export interface Ortho { - id: string; - source: { - url: string; - crs: string; - networkOptions: { - crossOrigin: "anonymous"; - }; - format: string; - attribution: { - name: string; - url: string; - }; - name: string; - tileMatrixSet: string; - tileMatrixSetLimits: Record; - }; -} - -export interface WorldDTM { - id: string; - noDataValue: number; - updateStrategy: { - type: 1; - options: { - groups: number[]; - }; - }; - source: { - format: string; - crs: string; - url: string; - name: string; - tileMatrixSet: string; - tileMatrixSetLimits: Record; - }; -} diff --git a/types/itowns/tsconfig.json b/types/itowns/tsconfig.json deleted file mode 100644 index b5046b021fc991..00000000000000 --- a/types/itowns/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "esModuleInterop": true - }, - "files": [ - "index.d.ts", - "itowns-tests.ts" - ] -} From eb6ee2cd936ce0f6aee15926c0268f11fbd9ea35 Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Tue, 15 Sep 2026 02:33:29 +0800 Subject: [PATCH 06/12] feat(gulp-autoprefixer): remove types (#75546) --- notNeededPackages.json | 4 +++ types/gulp-autoprefixer/.npmignore | 5 ---- .../gulp-autoprefixer-tests.ts | 18 ------------- types/gulp-autoprefixer/index.d.ts | 20 --------------- types/gulp-autoprefixer/package.json | 25 ------------------- types/gulp-autoprefixer/tsconfig.json | 19 -------------- 6 files changed, 4 insertions(+), 87 deletions(-) delete mode 100644 types/gulp-autoprefixer/.npmignore delete mode 100644 types/gulp-autoprefixer/gulp-autoprefixer-tests.ts delete mode 100644 types/gulp-autoprefixer/index.d.ts delete mode 100644 types/gulp-autoprefixer/package.json delete mode 100644 types/gulp-autoprefixer/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 5754d5b772d11b..c6ed9961190b02 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -2761,6 +2761,10 @@ "libraryName": "@guardian/prosemirror-invisibles", "asOfVersion": "1.3.3" }, + "gulp-autoprefixer": { + "libraryName": "gulp-autoprefixer", + "asOfVersion": "10.0.0" + }, "gulp-cond": { "libraryName": "gulp-cond", "asOfVersion": "2.0.0" diff --git a/types/gulp-autoprefixer/.npmignore b/types/gulp-autoprefixer/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/gulp-autoprefixer/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/gulp-autoprefixer/gulp-autoprefixer-tests.ts b/types/gulp-autoprefixer/gulp-autoprefixer-tests.ts deleted file mode 100644 index a0df42f5f0e12d..00000000000000 --- a/types/gulp-autoprefixer/gulp-autoprefixer-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ -import * as gulp from "gulp"; -import autoprefixer = require("gulp-autoprefixer"); - -gulp.src("test.css") - .pipe(autoprefixer()) - .pipe(gulp.dest("build")); - -gulp.src("test.css") - .pipe(autoprefixer({ browsers: ["Chrome"] })) - .pipe(gulp.dest("build")); - -gulp.src("test.css") - .pipe(autoprefixer({ cascade: false })) - .pipe(gulp.dest("build")); - -gulp.src("test.css") - .pipe(autoprefixer({ remove: false })) - .pipe(gulp.dest("build")); diff --git a/types/gulp-autoprefixer/index.d.ts b/types/gulp-autoprefixer/index.d.ts deleted file mode 100644 index 2dab89194c52d7..00000000000000 --- a/types/gulp-autoprefixer/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// - -declare namespace autoPrefixer { - interface Options { - env?: string | undefined; - cascade?: boolean | undefined; - add?: boolean | undefined; - remove?: boolean | undefined; - supports?: boolean | undefined; - flexbox?: boolean | "no-2009" | undefined; - grid?: false | "autoplace" | "no-autoplace" | undefined; - stats?: object | undefined; - browsers?: string[] | undefined; - ignoreUnknownVersions?: boolean | undefined; - } -} - -declare function autoPrefixer(opts?: autoPrefixer.Options): NodeJS.ReadWriteStream; - -export = autoPrefixer; diff --git a/types/gulp-autoprefixer/package.json b/types/gulp-autoprefixer/package.json deleted file mode 100644 index decc20999c36a5..00000000000000 --- a/types/gulp-autoprefixer/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "private": true, - "name": "@types/gulp-autoprefixer", - "version": "0.0.9999", - "projects": [ - "https://github.com/sindresorhus/gulp-autoprefixer" - ], - "dependencies": { - "@types/node": "*" - }, - "devDependencies": { - "@types/gulp": "*", - "@types/gulp-autoprefixer": "workspace:." - }, - "owners": [ - { - "name": "Asana", - "url": "https://asana.com" - }, - { - "name": "Jordy van Dortmont", - "githubUsername": "jordyvandortmont" - } - ] -} diff --git a/types/gulp-autoprefixer/tsconfig.json b/types/gulp-autoprefixer/tsconfig.json deleted file mode 100644 index 59ede24f372f82..00000000000000 --- a/types/gulp-autoprefixer/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-autoprefixer-tests.ts" - ] -} From d3aabadf634519293cf5487fa0601fc8cbf7f094 Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Tue, 15 Sep 2026 02:33:54 +0800 Subject: [PATCH 07/12] feat(express-sse): remove types (#75545) --- notNeededPackages.json | 4 ++++ types/express-sse/.npmignore | 5 ----- types/express-sse/express-sse-tests.ts | 17 ----------------- types/express-sse/index.d.ts | 24 ------------------------ types/express-sse/package.json | 20 -------------------- types/express-sse/tsconfig.json | 19 ------------------- 6 files changed, 4 insertions(+), 85 deletions(-) delete mode 100644 types/express-sse/.npmignore delete mode 100644 types/express-sse/express-sse-tests.ts delete mode 100644 types/express-sse/index.d.ts delete mode 100644 types/express-sse/package.json delete mode 100644 types/express-sse/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index c6ed9961190b02..e517d61180a1db 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -2169,6 +2169,10 @@ "libraryName": "express-slow-down", "asOfVersion": "2.0.0" }, + "express-sse": { + "libraryName": "express-sse", + "asOfVersion": "0.6.0" + }, "express-unless": { "libraryName": "express-unless", "asOfVersion": "2.0.1" diff --git a/types/express-sse/.npmignore b/types/express-sse/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/express-sse/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/express-sse/express-sse-tests.ts b/types/express-sse/express-sse-tests.ts deleted file mode 100644 index 2d5681d41a6f50..00000000000000 --- a/types/express-sse/express-sse-tests.ts +++ /dev/null @@ -1,17 +0,0 @@ -import express = require("express"); -import SSE = require("express-sse"); - -const app = express(); -let sse = new SSE(); -sse = new SSE(["array", "containing", "initial", "content", "(optional)"], { - isSerialized: false, - initialEvent: "optional initial event name", -}); - -app.get("/stream", sse.init); - -sse.send({ username: "test" }); -sse.send({ username: "test" }, "userconnect"); -sse.send({ username: "test" }, "usermessage", 1); -sse.updateInit(["array", "containing", "new", "content"]); -sse.serialize(["array", "to", "be", "sent", "as", "serialized", "events"]); diff --git a/types/express-sse/index.d.ts b/types/express-sse/index.d.ts deleted file mode 100644 index 7fd78f5b8bfb95..00000000000000 --- a/types/express-sse/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { EventEmitter } from "events"; -import { Request, Response } from "express"; - -export as namespace SSE; - -export = SSE; - -declare class SSE extends EventEmitter { - constructor(initial?: unknown, options?: Partial); - - init(req: Request, res: Response): void; - updateInit(data: unknown): void; - dropInit(): void; - send(data: unknown, event?: string, id?: string | number): void; - serialize(data: unknown): void; -} - -declare namespace SSE { - interface SSEOptions { - isSerialized: boolean; - isCompressed: boolean; - initialEvent: string; - } -} diff --git a/types/express-sse/package.json b/types/express-sse/package.json deleted file mode 100644 index a72dc1e1482bf1..00000000000000 --- a/types/express-sse/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "name": "@types/express-sse", - "version": "0.5.9999", - "projects": [ - "https://github.com/dpskvn/express-sse" - ], - "dependencies": { - "@types/express": "*" - }, - "devDependencies": { - "@types/express-sse": "workspace:." - }, - "owners": [ - { - "name": "Aleksei Pokoev", - "githubUsername": "powerleks" - } - ] -} diff --git a/types/express-sse/tsconfig.json b/types/express-sse/tsconfig.json deleted file mode 100644 index c48ce7c255a9b9..00000000000000 --- a/types/express-sse/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "express-sse-tests.ts" - ] -} From 221078d4e75343ab0d8a1b4d17d83f4172e4210e Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Tue, 15 Sep 2026 02:34:38 +0800 Subject: [PATCH 08/12] feat(current-git-branch): remove types (#75543) --- notNeededPackages.json | 4 ++++ types/current-git-branch/.npmignore | 5 ----- .../current-git-branch-tests.ts | 12 ------------ types/current-git-branch/index.d.ts | 15 --------------- types/current-git-branch/package.json | 17 ----------------- types/current-git-branch/tsconfig.json | 19 ------------------- 6 files changed, 4 insertions(+), 68 deletions(-) delete mode 100644 types/current-git-branch/.npmignore delete mode 100644 types/current-git-branch/current-git-branch-tests.ts delete mode 100644 types/current-git-branch/index.d.ts delete mode 100644 types/current-git-branch/package.json delete mode 100644 types/current-git-branch/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index e517d61180a1db..1dbaec342ef572 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1477,6 +1477,10 @@ "libraryName": "cuid", "asOfVersion": "2.0.1" }, + "current-git-branch": { + "libraryName": "current-git-branch", + "asOfVersion": "2.0.0" + }, "cuss": { "libraryName": "cuss", "asOfVersion": "2.0.0" diff --git a/types/current-git-branch/.npmignore b/types/current-git-branch/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/current-git-branch/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/current-git-branch/current-git-branch-tests.ts b/types/current-git-branch/current-git-branch-tests.ts deleted file mode 100644 index 7a39dedfb179e9..00000000000000 --- a/types/current-git-branch/current-git-branch-tests.ts +++ /dev/null @@ -1,12 +0,0 @@ -import getBranchName, { CurrentGitBranchOptions } from "current-git-branch"; - -// test data -const emptyOptions: CurrentGitBranchOptions = {}; -const filledOptions: CurrentGitBranchOptions = { altPath: "", branchOptions: "" }; - -// tests -getBranchName(); -getBranchName(emptyOptions); -getBranchName(filledOptions); -getBranchName(""); -getBranchName([""]); diff --git a/types/current-git-branch/index.d.ts b/types/current-git-branch/index.d.ts deleted file mode 100644 index d37e72e5cc3b10..00000000000000 --- a/types/current-git-branch/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare namespace CurrentGitBranch { - type CurrentGitBranchOptions = CurrentGitBranchOptionsObject | string[] | string; - type CurrentGitBranchResult = string | false; - - interface CurrentGitBranchOptionsObject { - altPath?: string | undefined; - branchOptions?: string | undefined; - } -} - -declare function CurrentGitBranch( - args?: CurrentGitBranch.CurrentGitBranchOptions, -): CurrentGitBranch.CurrentGitBranchResult; - -export = CurrentGitBranch; diff --git a/types/current-git-branch/package.json b/types/current-git-branch/package.json deleted file mode 100644 index 26f53325796d96..00000000000000 --- a/types/current-git-branch/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "private": true, - "name": "@types/current-git-branch", - "version": "1.1.9999", - "projects": [ - "https://www.npmjs.com/package/current-git-branch" - ], - "devDependencies": { - "@types/current-git-branch": "workspace:." - }, - "owners": [ - { - "name": "Max Boguslavskiy", - "githubUsername": "maxbogus" - } - ] -} diff --git a/types/current-git-branch/tsconfig.json b/types/current-git-branch/tsconfig.json deleted file mode 100644 index 7c7c1bec969c81..00000000000000 --- a/types/current-git-branch/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "current-git-branch-tests.ts" - ] -} From af5d73f6ca778b37594548e1cfbe7390484669ed Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Tue, 15 Sep 2026 02:35:39 +0800 Subject: [PATCH 09/12] feat(logrocket-react): remove types (#75542) --- notNeededPackages.json | 4 ++++ types/logrocket-react/.npmignore | 5 ----- types/logrocket-react/index.d.ts | 7 ------- .../logrocket-react/logrocket-react-tests.tsx | 6 ------ types/logrocket-react/package.json | 20 ------------------- types/logrocket-react/tsconfig.json | 20 ------------------- 6 files changed, 4 insertions(+), 58 deletions(-) delete mode 100644 types/logrocket-react/.npmignore delete mode 100644 types/logrocket-react/index.d.ts delete mode 100644 types/logrocket-react/logrocket-react-tests.tsx delete mode 100644 types/logrocket-react/package.json delete mode 100644 types/logrocket-react/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 1dbaec342ef572..3d1b57ad27758a 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -4109,6 +4109,10 @@ "libraryName": "loglevel", "asOfVersion": "1.6.2" }, + "logrocket-react": { + "libraryName": "logrocket-react", + "asOfVersion": "7.0.0" + }, "long": { "libraryName": "long", "asOfVersion": "5.0.0" diff --git a/types/logrocket-react/.npmignore b/types/logrocket-react/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/logrocket-react/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/logrocket-react/index.d.ts b/types/logrocket-react/index.d.ts deleted file mode 100644 index f27e403fcdf7d4..00000000000000 --- a/types/logrocket-react/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import LogRocket = require("logrocket"); - -type LR = typeof LogRocket; - -declare function setupLogRocketReact(logRocket: LR): void; - -export = setupLogRocketReact; diff --git a/types/logrocket-react/logrocket-react-tests.tsx b/types/logrocket-react/logrocket-react-tests.tsx deleted file mode 100644 index 20f5a5d684a472..00000000000000 --- a/types/logrocket-react/logrocket-react-tests.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import LogRocket from "logrocket"; -import setupLogRocketReact from "logrocket-react"; - -LogRocket.init("example-environment"); - -setupLogRocketReact(LogRocket); diff --git a/types/logrocket-react/package.json b/types/logrocket-react/package.json deleted file mode 100644 index bcfa742119147b..00000000000000 --- a/types/logrocket-react/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "name": "@types/logrocket-react", - "version": "3.0.9999", - "projects": [ - "https://github.com/LogRocket/logrocket-react" - ], - "dependencies": { - "logrocket": "1.0.1" - }, - "devDependencies": { - "@types/logrocket-react": "workspace:." - }, - "owners": [ - { - "name": "Nivesh Ravindran", - "githubUsername": "Nibblesh" - } - ] -} diff --git a/types/logrocket-react/tsconfig.json b/types/logrocket-react/tsconfig.json deleted file mode 100644 index c2a20b0387aeac..00000000000000 --- a/types/logrocket-react/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "strictFunctionTypes": true - }, - "files": [ - "index.d.ts", - "logrocket-react-tests.tsx" - ] -} From bc331254f6acc3254877ea49d4e17bfadc877b56 Mon Sep 17 00:00:00 2001 From: Jan Hildebrandt <32014057+janHildebrandt98@users.noreply.github.com> Date: Mon, 14 Sep 2026 20:37:19 +0200 Subject: [PATCH 10/12] [k6] websocket module: Align typedefs with spec and Go implementation (#75439) --- types/k6/test/websockets.ts | 20 +++++- types/k6/websockets/index.d.ts | 115 +++++---------------------------- 2 files changed, 33 insertions(+), 102 deletions(-) diff --git a/types/k6/test/websockets.ts b/types/k6/test/websockets.ts index 01f6ea4243efbc..e8317e1bd2a6ba 100644 --- a/types/k6/test/websockets.ts +++ b/types/k6/test/websockets.ts @@ -1,5 +1,5 @@ import { CookieJar } from "k6/http"; -import { Blob, CompressionAlgorithm, EventName, WebSocket } from "k6/websockets"; +import { Blob, WebSocket } from "k6/websockets"; let str: string; let ab: ArrayBuffer; @@ -18,7 +18,7 @@ new WebSocket("wss://test-api.k6.io/ws/crocochat/1", null, { tags: { user: "zbt" }, }); new WebSocket("wss://test-api.k6.io/ws/crocochat/1", null, { - compression: CompressionAlgorithm.Deflate, + compression: "deflate", }); new WebSocket("wss://test-api.k6.io/ws/crocochat/1", null, { jar: new CookieJar(), @@ -84,7 +84,7 @@ ws.addEventListener(); ws.addEventListener("open"); // @ts-expect-error ws.addEventListener("open", 5); -ws.addEventListener(EventName.Open, () => {}); // $ExpectType void +ws.addEventListener("open", () => {}); // $ExpectType void // // WebSocket.close @@ -154,3 +154,17 @@ ws.onping = () => {}; // @ts-expect-error ws.onpong = "lorem"; ws.onpong = () => {}; + +// +// WebSocket ready state constants +// + +WebSocket.CONNECTING; // $ExpectType 0 +WebSocket.OPEN; // $ExpectType 1 +WebSocket.CLOSING; // $ExpectType 2 +WebSocket.CLOSED; // $ExpectType 3 + +ws.CONNECTING; // $ExpectType 0 +ws.OPEN; // $ExpectType 1 +ws.CLOSING; // $ExpectType 2 +ws.CLOSED; // $ExpectType 3 diff --git a/types/k6/websockets/index.d.ts b/types/k6/websockets/index.d.ts index 9c4dcb8fadab2e..da742c9d2ae2ef 100644 --- a/types/k6/websockets/index.d.ts +++ b/types/k6/websockets/index.d.ts @@ -122,6 +122,16 @@ export class WebSocket { * https://grafana.com/docs/k6/latest/javascript-api/k6-websockets/websocket/websocket-onpong/ */ onpong: () => void; + + static readonly CONNECTING: 0; + static readonly OPEN: 1; + static readonly CLOSING: 2; + static readonly CLOSED: 3; + + readonly CONNECTING: 0; + readonly OPEN: 1; + readonly CLOSING: 2; + readonly CLOSED: 3; } export type BlobPart = ArrayBuffer | ArrayBufferView | Blob | string; @@ -171,72 +181,19 @@ export interface Params { /** * ReadyState describes the possible states of a WebSocket connection. */ -export enum ReadyState { - /** - * Socket has been created. The connection is not yet open. - */ - Connecting = 0, - - /** - * The connection is open and ready to communicate. - */ - Open = 1, - - /** - * The connection is in the process of closing. - */ - Closing = 2, - - /** - * The connection is closed or couldn't be opened. - */ - Closed = 3, -} +export type ReadyState = 0 | 1 | 2 | 3; /** * BinaryType describes the possible types of binary data that can be * transmitted over a Websocket connection. */ -export enum BinaryType { - Blob = "blob", - ArrayBuffer = "arraybuffer", -} +export type BinaryType = "blob" | "arraybuffer"; /** * EventName describes the possible events that can be emitted * by a Websocket connection. */ -export enum EventName { - /** - * Event fired when the connection is opened and ready to communicate. - */ - Open = "open", - - /** - * Event fired when the connection has been closed. - */ - Close = "close", - - /** - * Event fired when a connection has been closed due to an error. - */ - Error = "error", - - /** - * Event fired when a message has been received from the server. - */ - Message = "message", - - /** - * Event fired when a ping message has been received from the server. - */ - Ping = "ping", - - /** - * Event fired when a pong message has been received from the server. - */ - Pong = "pong", -} +export type EventName = "open" | "close" | "error" | "message" | "ping" | "pong"; /** * MessageEvent is a simple interface that holds the data of a message received from the server. @@ -250,7 +207,7 @@ export interface MessageEvent { /** * the type of the event. */ - type: MessageType; + type: EventName; /** * The read-only property that returns the time (in milliseconds) at which the event was created. @@ -258,40 +215,6 @@ export interface MessageEvent { timestamp: number; } -/** - * WebSocket message types, as defined in RFC 6455, section 11.8. - */ -export enum MessageType { - /** - * The message is a text message. The text message payload is - * interpreted as UTF-8 encodedtext data. - */ - Text = 1, - - /** - * The message is a binary message. - */ - Binary = 2, - - /** - * The message is a close control message. The optional message - * payload contains a numeric code and a text reason. - */ - Close = 8, - - /** - * The message is a ping control message. The optional message - * payload is UTF-8 encoded text. - */ - PingMessage = 9, - - /** - * The message is a pong control message. The optional message - * payload is UTF-8 encoded text. - */ - PongMessage = 10, -} - /** * ErrorEvent is a simple interface that holds the data of an error event. */ @@ -299,7 +222,7 @@ export interface ErrorEvent { /** * the type of the event. */ - type: MessageType; + type: EventName; /** * The read-only property that returns the error message. @@ -315,10 +238,4 @@ export interface ErrorEvent { /** * CompressionAlgorithm describes the possible compression algorithms. */ -export enum CompressionAlgorithm { - /** - * Deflate compression algorithm. - * k6 supports only this compression algorithm. - */ - Deflate = "deflate", -} +export type CompressionAlgorithm = "deflate"; From 1b0aa8e2feb5168bfbe904220d815f3ba03c34cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=E2=84=93e=20Hensel?= Date: Tue, 15 Sep 2026 02:38:43 +0800 Subject: [PATCH 11/12] [d3-selection] Implement type-safe events (#75438) --- types/d3-selection/d3-selection-tests.ts | 148 +++++++++++++++++++++++ types/d3-selection/index.d.ts | 43 ++++++- types/d3-selection/package.json | 4 + 3 files changed, 192 insertions(+), 3 deletions(-) diff --git a/types/d3-selection/d3-selection-tests.ts b/types/d3-selection/d3-selection-tests.ts index 794f3a36b64513..f25485095622fd 100644 --- a/types/d3-selection/d3-selection-tests.ts +++ b/types/d3-selection/d3-selection-tests.ts @@ -1119,6 +1119,152 @@ if (listener) { // remove listener body = body.on("click", null); // check chaining return type by re-assigning +// Utils -------------------------------------------- + +let test_ExtractEventNames: [ + // $ExpectType 'a' + d3Selection.Selection.ExtractEventNames<"a">, + // $ExpectType 'a' + d3Selection.Selection.ExtractEventNames<"a.1">, + // $ExpectType 'a' | 'b' + d3Selection.Selection.ExtractEventNames<"a b">, + // $ExpectType 'a' | 'b' | 'c' + d3Selection.Selection.ExtractEventNames<"a b c">, + // $ExpectType 'a' | 'b' + d3Selection.Selection.ExtractEventNames<"a.1 b">, + // $ExpectType 'a' | 'b' + d3Selection.Selection.ExtractEventNames<"a.1 b.2">, + // $ExpectType 'a' | 'b' + d3Selection.Selection.ExtractEventNames<"a b.2">, + // $ExpectType 'a' + d3Selection.Selection.ExtractEventNames<"a ">, + // $ExpectType 'a' + d3Selection.Selection.ExtractEventNames<" a">, + // $ExpectType 'a' + d3Selection.Selection.ExtractEventNames<" a ">, + // $ExpectType 'a' | 'b' + d3Selection.Selection.ExtractEventNames<" a b ">, +]; + +let test_GetEventMapForElement: [ + // $ExpectType HTMLElementEventMap + d3Selection.Selection.GetEventMapForElement, + // $ExpectType SVGElementEventMap + d3Selection.Selection.GetEventMapForElement, + // $ExpectType ElementEventMap & GlobalEventHandlersEventMap + d3Selection.Selection.GetEventMapForElement, + // $ExpectType GlobalEventHandlersEventMap + d3Selection.Selection.GetEventMapForElement, + // $ExpectType GlobalEventHandlersEventMap + d3Selection.Selection.GetEventMapForElement, + // $ExpectType WindowEventMap + d3Selection.Selection.GetEventMapForElement, + // $ExpectType DocumentEventMap + d3Selection.Selection.GetEventMapForElement, + // $ExpectType never + d3Selection.Selection.GetEventMapForElement, + // $ExpectType HTMLElementEventMap | GlobalEventHandlersEventMap | SVGElementEventMap | (ElementEventMap & GlobalEventHandlersEventMap) | WindowEventMap | DocumentEventMap + d3Selection.Selection.GetEventMapForElement, + // $ExpectType GlobalEventHandlersEventMap + d3Selection.Selection.GetEventMapForElement, +]; + +let test_EventNameToInterface: [ + // $ExpectType MouseEvent + d3Selection.Selection.EventNameToInterface<"mousedown", HTMLDialogElement>, + // $ExpectType CustomEvent + d3Selection.Selection.EventNameToInterface<"visibilitychange", HTMLDialogElement>, + // $ExpectType Event + d3Selection.Selection.EventNameToInterface<"visibilitychange", Document>, + // $ExpectType never + d3Selection.Selection.EventNameToInterface, + // $ExpectType any + d3Selection.Selection.EventNameToInterface, + // $ExpectType CustomEvent + d3Selection.Selection.EventNameToInterface, +]; + +// Events -------------------------------------------- + +// inferred from a trivial typename +body.on("drop", (event) => { + // $ExpectType DragEvent + event; +}); + +// inferred from a typename with a label +body.on("drop.label", (event) => { + // $ExpectType DragEvent + event; +}); + +// inferred from multiple typenames with labels +body.on("drop.label keydown mousedown.otherLabel", (event) => { + // $ExpectType DragEvent | KeyboardEvent | MouseEvent + event; +}); + +// invalid +body.on("", (event) => { + // $ExpectType never + event; +}); + +// invalid value +body.on("invalidddd", (event) => { + // $ExpectType CustomEvent + event; +}); + +// generic string +body.on("" as string, (event) => { + // $ExpectType any + event; +}); + +// type-annotations are still allowed (exactly correct) +body.on("drop", (event: DragEvent) => {}); + +// type-annotations are still allowed (exactly correct) +body.on("drop keydown", (event: DragEvent | KeyboardEvent) => {}); + +// type-annotations are still allowed (wider type) +body.on("drop", (event: Event) => {}); + +// type-annotations are still allowed (union with excessive members) +body.on("drop", (event: DragEvent | KeyboardEvent) => {}); + +// @ts-expect-error -- incorrect type-annotations are not allowed (missing union member) +body.on("drop keydown", (event: DragEvent) => {}); + +// @ts-expect-error -- incorrect type-annotations are not allowed (mismatch) +body.on("mousedown", (event: DragEvent) => {}); + +// a listener may be declared with a wider event type +body.on("drop", (event: Event) => {}); + +// fallbacks to CustomEvent for types that are not valid for this element +// (visibilitychange only exists on `Document`, not `HTMLElement`) +body.on("visibilitychange", (event) => { + // $ExpectType CustomEvent + event; +}); + +// works with non-DOM events +d3Selection.select(document).on("visibilitychange", (event) => { + // $ExpectType Event + event; +}); + +// event options +body.on("click", () => {}, { capture: true, passive: true }); +body.on("click", () => {}, true); +body.on("click", () => {}, { + once: true, + // @ts-expect-error -- invalid property + invalidddd: true, +}); + // dispatch(...) ------------------------------------------------------------------------- const fooEventParam: d3Selection.CustomEventParameters = { @@ -1156,6 +1302,8 @@ body = body.on("click", (event) => { position = d3Selection.pointer(event, event.currentTarget); positions = d3Selection.pointers(event); positions = d3Selection.pointers(event, event.currentTarget); + + event.buttons; // specific to PointerEvent }); // --------------------------------------------------------------------------------------- diff --git a/types/d3-selection/index.d.ts b/types/d3-selection/index.d.ts index 1187c250114db6..1998a75aad0efc 100644 --- a/types/d3-selection/index.d.ts +++ b/types/d3-selection/index.d.ts @@ -161,6 +161,37 @@ export function selectAll( nodes: GElement[] | ArrayLike | Iterable, ): Selection; +export namespace Selection { + /** (helper) given a string like `a.1 b c.2`, it returns a union like `'a' | 'b' | 'c'` */ + type ExtractEventNames = Input extends "" ? never + : Input extends `${infer A} ${infer B}` // multiple events + ? ExtractEventNames | ExtractEventNames + : Input extends `${infer A}.${string}` // single event with a name + ? A + : Input; // single event with no name + + /** (helper) given a `select`able element, returns the EventMap for that element */ + type GetEventMapForElement = GElement extends Window ? WindowEventMap + : GElement extends Document ? DocumentEventMap + : GElement extends SVGElement ? SVGElementEventMap + : GElement extends HTMLElement ? HTMLElementEventMap + : GElement extends Element ? ElementEventMap & GlobalEventHandlersEventMap + : GlobalEventHandlersEventMap; + + /** (helper) converts an event name to the event class (e.g. `'mouseup'` -> `MouseEvent`) */ + type EventNameToInterface = Name extends keyof GetEventMapForElement + ? GetEventMapForElement[Name] + : CustomEvent; + + /** + * (helper) given a typenames like `mouseup.a mousedown.b`, this helper will: + * 1. extract the types from the string (`mouseup` | `mousedown`) + * 2. convert the names to type (`MouseEvent` | `MouseEvent`) + */ + type EventOf = string extends Source ? any + : EventNameToInterface, GElement>; +} + /** * A D3 Selection of elements. * @@ -843,7 +874,9 @@ export interface Selection void) | undefined; + on( + typenames: Source, + ): ((this: GElement, event: Selection.EventOf, d: Datum) => void) | undefined; /** * Remove a listener for the specified event type names. To remove all listeners for a given name, * pass null as the listener and ".foo" as the typename, where foo is the name; to remove all listeners with no name, specify "." as the typename. @@ -870,9 +903,13 @@ export interface Selection void, options?: any): this; + on( + typenames: Source, + listener: (this: GElement, event: Selection.EventOf, d: Datum) => void, + options?: boolean | AddEventListenerOptions, + ): this; /** * Dispatches a custom event of the specified type to each selected element, in order. diff --git a/types/d3-selection/package.json b/types/d3-selection/package.json index c3dd99fe487c3c..c70cc5896a4185 100644 --- a/types/d3-selection/package.json +++ b/types/d3-selection/package.json @@ -33,6 +33,10 @@ { "name": "Ambar Mutha", "githubUsername": "ambar-arkin" + }, + { + "name": "Kyle Hensel", + "githubUsername": "k-yle" } ] } From a542a0b0a0332f463dd42042f5bfb6cf36a61747 Mon Sep 17 00:00:00 2001 From: Arlo O'Keeffe Date: Mon, 14 Sep 2026 20:40:52 +0200 Subject: [PATCH 12/12] [selenium-webdriver] add missing WebElement W3C commands (#75437) --- types/selenium-webdriver/index.d.ts | 74 ++++++++++++++++++++++++++ types/selenium-webdriver/test/index.ts | 9 ++++ 2 files changed, 83 insertions(+) diff --git a/types/selenium-webdriver/index.d.ts b/types/selenium-webdriver/index.d.ts index 607f8e5dcd9c71..14e32ade8f32d1 100644 --- a/types/selenium-webdriver/index.d.ts +++ b/types/selenium-webdriver/index.d.ts @@ -1171,6 +1171,43 @@ export interface IWebElement { */ getAttribute(attributeName: string): Promise; + /** + * Get the value of the given attribute of the element. + * + * This method, unlike {@link getAttribute}, returns the value of the attribute with the + * given name but not the property with the same name. + * + * See the [W3C WebDriver specification](https://w3c.github.io/webdriver/#get-element-attribute) + * for more details. + * + * @param {string} attributeName The name of the attribute to query. + * @return {!Promise} A promise that will be resolved with the + * attribute's value, or null if the attribute is not set. + */ + getDomAttribute(attributeName: string): Promise; + + /** + * Get the given property of the referenced web element. + * @param {string} propertyName The name of the property to query. + * @return {!Promise} A promise that will be resolved with the + * element's property value. + */ + getProperty(propertyName: string): Promise; + + /** + * Get the computed WAI-ARIA role of the element. + * @return {!Promise} A promise that will be resolved with the + * element's computed role. + */ + getAriaRole(): Promise; + + /** + * Get the computed WAI-ARIA label of the element. + * @return {!Promise} A promise that will be resolved with the + * element's computed label. + */ + getAccessibleName(): Promise; + /** * Get the visible (i.e. not hidden by CSS) innerText of this element, * including sub-elements, without any leading or trailing whitespace. @@ -1566,6 +1603,43 @@ export class WebElement implements Serializable { */ getAttribute(attributeName: string): Promise; + /** + * Get the value of the given attribute of the element. + * + * This method, unlike {@link getAttribute}, returns the value of the attribute with the + * given name but not the property with the same name. + * + * See the [W3C WebDriver specification](https://w3c.github.io/webdriver/#get-element-attribute) + * for more details. + * + * @param {string} attributeName The name of the attribute to query. + * @return {!Promise} A promise that will be resolved with the + * attribute's value, or null if the attribute is not set. + */ + getDomAttribute(attributeName: string): Promise; + + /** + * Get the given property of the referenced web element. + * @param {string} propertyName The name of the property to query. + * @return {!Promise} A promise that will be resolved with the + * element's property value. + */ + getProperty(propertyName: string): Promise; + + /** + * Get the computed WAI-ARIA role of the element. + * @return {!Promise} A promise that will be resolved with the + * element's computed role. + */ + getAriaRole(): Promise; + + /** + * Get the computed WAI-ARIA label of the element. + * @return {!Promise} A promise that will be resolved with the + * element's computed label. + */ + getAccessibleName(): Promise; + /** * Get the visible (i.e. not hidden by CSS) innerText of this element, * including sub-elements, without any leading or trailing whitespace. diff --git a/types/selenium-webdriver/test/index.ts b/types/selenium-webdriver/test/index.ts index ddfb9e3923aaaf..4ff2d434ab09ec 100644 --- a/types/selenium-webdriver/test/index.ts +++ b/types/selenium-webdriver/test/index.ts @@ -519,6 +519,15 @@ function TestWebElement() { v.toUpperCase(); } }); + const maybeDomAttr: Promise = element.getDomAttribute("class"); + maybeDomAttr.then(v => { + if (v !== null) { + v.toUpperCase(); + } + }); + stringPromise = element.getProperty("value"); + stringPromise = element.getAriaRole(); + stringPromise = element.getAccessibleName(); stringPromise = element.getCssValue("display"); driver = element.getDriver(); element.getLocation().then((location: webdriver.ILocation) => {});