diff --git a/examples/react-map-gl-draw/style.js b/examples/react-map-gl-draw/style.js index e1f39f874..59f9ff60e 100644 --- a/examples/react-map-gl-draw/style.js +++ b/examples/react-map-gl-draw/style.js @@ -123,7 +123,7 @@ export function getEditHandleStyle({ feature, shape, index, state }) { switch (shape) { case 'circle': - //@ts-ignore + // @ts-ignore style.r = CIRCLE_RADIUS; break; case 'rect': diff --git a/modules/edit-modes/src/lib/draw-ellipse-by-bounding-box-mode.ts b/modules/edit-modes/src/lib/draw-ellipse-by-bounding-box-mode.ts index 3d0d0a3e3..4b8b3bf2d 100644 --- a/modules/edit-modes/src/lib/draw-ellipse-by-bounding-box-mode.ts +++ b/modules/edit-modes/src/lib/draw-ellipse-by-bounding-box-mode.ts @@ -19,7 +19,7 @@ export class DrawEllipseByBoundingBoxMode extends TwoClickPolygonMode { const xSemiAxis = Math.max(distance(point(polygonPoints[0]), point(polygonPoints[1])), 0.001); const ySemiAxis = Math.max(distance(point(polygonPoints[0]), point(polygonPoints[3])), 0.001); - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'Feature' ... Remove this comment to see the full error message return ellipse(centerCoordinates, xSemiAxis, ySemiAxis); } } diff --git a/modules/edit-modes/src/lib/draw-ellipse-using-three-points-mode.ts b/modules/edit-modes/src/lib/draw-ellipse-using-three-points-mode.ts index 5b5b5c482..499c0724e 100644 --- a/modules/edit-modes/src/lib/draw-ellipse-using-three-points-mode.ts +++ b/modules/edit-modes/src/lib/draw-ellipse-using-three-points-mode.ts @@ -17,7 +17,7 @@ export class DrawEllipseUsingThreePointsMode extends ThreeClickPolygonMode { const xSemiAxis = Math.max(distance(centerCoordinates, point(coord3)), 0.001); const ySemiAxis = Math.max(distance(coord1, coord2), 0.001) / 2; const options = { angle: bearing(coord1, coord2) }; - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'Feature' ... Remove this comment to see the full error message return ellipse(centerCoordinates, xSemiAxis, ySemiAxis, options); } } diff --git a/modules/edit-modes/src/lib/draw-line-string-mode.ts b/modules/edit-modes/src/lib/draw-line-string-mode.ts index 6f3010af4..acb111057 100644 --- a/modules/edit-modes/src/lib/draw-line-string-mode.ts +++ b/modules/edit-modes/src/lib/draw-line-string-mode.ts @@ -108,7 +108,7 @@ export class DrawLineStringMode extends GeoJsonEditMode { })); guides.features.push(...editHandles); - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type '{ type: string; features: any[]; }' is not a... Remove this comment to see the full error message return guides; } diff --git a/modules/edit-modes/src/lib/draw-point-mode.ts b/modules/edit-modes/src/lib/draw-point-mode.ts index bfbda5aa1..217b98f3d 100644 --- a/modules/edit-modes/src/lib/draw-point-mode.ts +++ b/modules/edit-modes/src/lib/draw-point-mode.ts @@ -24,7 +24,7 @@ export class DrawPointMode extends GeoJsonEditMode { type: 'Point', coordinates: mapCoords, }; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ type: string; coordinates: Pos... Remove this comment to see the full error message props.onEdit(this.getAddFeatureAction(geometry, props.data)); } diff --git a/modules/edit-modes/src/lib/draw-polygon-by-dragging-mode.ts b/modules/edit-modes/src/lib/draw-polygon-by-dragging-mode.ts index 1c8e2116f..22331087d 100644 --- a/modules/edit-modes/src/lib/draw-polygon-by-dragging-mode.ts +++ b/modules/edit-modes/src/lib/draw-polygon-by-dragging-mode.ts @@ -31,9 +31,9 @@ export class DrawPolygonByDraggingMode extends DrawPolygonMode { handleStopDragging(event: StopDraggingEvent, props: ModeProps) { this.addClickSequence(event); const clickSequence = this.getClickSequence(); - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'cancel' does not exist on type 'Dragging... Remove this comment to see the full error message if (this.handleDraggingThrottled && this.handleDraggingThrottled.cancel) { - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'cancel' does not exist on type 'Dragging... Remove this comment to see the full error message this.handleDraggingThrottled.cancel(); } diff --git a/modules/edit-modes/src/lib/draw-polygon-mode.ts b/modules/edit-modes/src/lib/draw-polygon-mode.ts index 7f6e38439..671fe0fc9 100644 --- a/modules/edit-modes/src/lib/draw-polygon-mode.ts +++ b/modules/edit-modes/src/lib/draw-polygon-mode.ts @@ -72,7 +72,7 @@ export class DrawPolygonMode extends GeoJsonEditMode { })); guides.features.push(...editHandles); - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type '{ type: string; features: any[]; }' is not a... Remove this comment to see the full error message return guides; } diff --git a/modules/edit-modes/src/lib/draw-rectangle-mode.ts b/modules/edit-modes/src/lib/draw-rectangle-mode.ts index ea6e2360e..01be38de5 100644 --- a/modules/edit-modes/src/lib/draw-rectangle-mode.ts +++ b/modules/edit-modes/src/lib/draw-rectangle-mode.ts @@ -8,7 +8,7 @@ export class DrawRectangleMode extends TwoClickPolygonMode { rectangle.properties = rectangle.properties || {}; rectangle.properties.shape = 'Rectangle'; - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'Feature' ... Remove this comment to see the full error message return rectangle; } } diff --git a/modules/edit-modes/src/lib/draw-square-from-center-mode.ts b/modules/edit-modes/src/lib/draw-square-from-center-mode.ts index 5e38da08d..47409c44c 100644 --- a/modules/edit-modes/src/lib/draw-square-from-center-mode.ts +++ b/modules/edit-modes/src/lib/draw-square-from-center-mode.ts @@ -40,7 +40,7 @@ export class DrawSquareFromCenterMode extends TwoClickPolygonMode { square.properties = square.properties || {}; square.properties.shape = 'Square'; - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'Feature' ... Remove this comment to see the full error message return square; } } diff --git a/modules/edit-modes/src/lib/elevation-mode.ts b/modules/edit-modes/src/lib/elevation-mode.ts index d8ef1538b..8a690c276 100644 --- a/modules/edit-modes/src/lib/elevation-mode.ts +++ b/modules/edit-modes/src/lib/elevation-mode.ts @@ -48,14 +48,14 @@ export class ElevationMode extends ModifyMode { handlePointerMove(event: PointerMoveEvent, props: ModeProps) { const editHandle = getPickedEditHandle(event.pointerDownPicks); const position = editHandle ? editHandle.geometry.coordinates : event.mapCoords; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Record' is not assi... Remove this comment to see the full error message super.handlePointerMove(this.makeElevatedEvent(event, position, props), props); } handleStopDragging(event: StopDraggingEvent, props: ModeProps) { const editHandle = getPickedEditHandle(event.picks); const position = editHandle ? editHandle.geometry.coordinates : event.mapCoords; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Record' is not assi... Remove this comment to see the full error message super.handleStopDragging(this.makeElevatedEvent(event, position, props), props); } diff --git a/modules/edit-modes/src/lib/extend-line-string-mode.ts b/modules/edit-modes/src/lib/extend-line-string-mode.ts index 754326a8e..a9b970b74 100644 --- a/modules/edit-modes/src/lib/extend-line-string-mode.ts +++ b/modules/edit-modes/src/lib/extend-line-string-mode.ts @@ -54,7 +54,7 @@ export class ExtendLineStringMode extends GeoJsonEditMode { const selectedLineString = this.getSingleSelectedLineString(props); if (!selectedLineString) { // nothing to do - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type '{ type: string; features: any[]; }' is not a... Remove this comment to see the full error message return guides; } @@ -79,7 +79,7 @@ export class ExtendLineStringMode extends GeoJsonEditMode { coordinates: [startPosition, mapCoords], }, }); - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type '{ type: string; features: any[]; }' is not a... Remove this comment to see the full error message return guides; } diff --git a/modules/edit-modes/src/lib/geojson-edit-mode.ts b/modules/edit-modes/src/lib/geojson-edit-mode.ts index a66d346e2..1318c9b0e 100644 --- a/modules/edit-modes/src/lib/geojson-edit-mode.ts +++ b/modules/edit-modes/src/lib/geojson-edit-mode.ts @@ -86,7 +86,7 @@ export class GeoJsonEditMode implements EditMode): TentativeFeature | null | undefined { const guides = this.getGuides(props); - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'Readonly' is not assignable to... Remove this comment to see the full error message return guides.features.find((f) => f.properties && f.properties.guideType === 'tentative'); } @@ -105,7 +105,7 @@ export class GeoJsonEditMode implements EditMode) { const propsWithoutEdit = { ...props, - // @ts-ignore onEdit: () => {}, }; @@ -33,7 +32,7 @@ export class MeasureAreaMode extends DrawPolygonMode { text = formatTooltip(area); } else { // By default, round to 2 decimal places and append units - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number' is not assignable to par... Remove this comment to see the full error message text = `${parseFloat(area).toFixed(2)} ${units}`; } diff --git a/modules/edit-modes/src/lib/measure-distance-mode.ts b/modules/edit-modes/src/lib/measure-distance-mode.ts index 72aba88de..26ebce059 100644 --- a/modules/edit-modes/src/lib/measure-distance-mode.ts +++ b/modules/edit-modes/src/lib/measure-distance-mode.ts @@ -159,7 +159,7 @@ export class MeasureDistanceMode extends GeoJsonEditMode { })); guides.features.push(...editHandles); - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type '{ type: string; features: any[]; }' is not a... Remove this comment to see the full error message return guides; } diff --git a/modules/edit-modes/src/lib/modify-mode.ts b/modules/edit-modes/src/lib/modify-mode.ts index 97b3a0e1c..0250b7f9a 100644 --- a/modules/edit-modes/src/lib/modify-mode.ts +++ b/modules/edit-modes/src/lib/modify-mode.ts @@ -64,7 +64,7 @@ export class ModifyMode extends GeoJsonEditMode { (lineString, prefix) => { const lineStringFeature = toLineString(lineString); const candidateIntermediatePoint = this.getNearestPoint( - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Feature { const lineStringFeature = toLineString(lineString); const candidateIntermediatePoint = this.getNearestPoint( - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Feature { const { features } = geometry || {}; if (Array.isArray(features) && features.length === 1) { - // @ts-ignore - const { type } = getGeom(features[0]); + const { type } = getGeom(features[0]); return type === 'Point'; } return false; @@ -61,7 +60,7 @@ export class RotateMode extends GeoJsonEditMode { coordEach(boundingBox, (coord) => { if (previousCoord) { - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number[]' is not assignable to p... Remove this comment to see the full error message const edgeMidpoint = getIntermediatePosition(coord, previousCoord); if (!topEdgeMidpointCoords || edgeMidpoint[1] > topEdgeMidpointCoords[1]) { // Get the top edge midpoint of the enveloping box @@ -86,15 +85,11 @@ export class RotateMode extends GeoJsonEditMode { guideType: 'editHandle', editHandleType: 'rotate', }); - // @ts-ignore return featureCollection([ - // @ts-ignore - polygonToLine(boundingBox), - // @ts-ignore + polygonToLine(boundingBox) as any, rotateHandle, - // @ts-ignore lineFromEnvelopeToRotateHandle, - ]); + ]) as any; } handleDragging(event: DraggingEvent, props: ModeProps) { @@ -175,9 +170,9 @@ export class RotateMode extends GeoJsonEditMode { const centroid = turfCentroid(this._geometryBeingRotated); const angle = getRotationAngle(centroid, startDragPoint, currentPoint); - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'AllGeoJSON' is not assignable to type 'Featu... Remove this comment to see the full error message const rotatedFeatures: FeatureCollection = turfTransformRotate( - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'FeatureCollection' is not assign... Remove this comment to see the full error message this._geometryBeingRotated, angle, { diff --git a/modules/edit-modes/src/lib/scale-mode.ts b/modules/edit-modes/src/lib/scale-mode.ts index 46e5db30e..5465f517f 100644 --- a/modules/edit-modes/src/lib/scale-mode.ts +++ b/modules/edit-modes/src/lib/scale-mode.ts @@ -33,8 +33,7 @@ export class ScaleMode extends GeoJsonEditMode { _isSinglePointGeometrySelected = (geometry: FeatureCollection | null | undefined): boolean => { const { features } = geometry || {}; if (Array.isArray(features) && features.length === 1) { - // @ts-ignore - const { type } = getGeom(features[0]); + const { type } = getGeom(features[0]); return type === 'Point'; } return false; @@ -85,11 +84,11 @@ export class ScaleMode extends GeoJsonEditMode { const oppositeHandle = this._getOppositeScaleHandle(this._selectedEditHandle); const origin = getCoord(oppositeHandle); - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number[]' is not assignable to p... Remove this comment to see the full error message const scaleFactor = getScaleFactor(origin, startDragPoint, currentPoint); - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'AllGeoJSON' is not assignable to type 'Featu... Remove this comment to see the full error message const scaledFeatures: FeatureCollection = turfTransformScale( - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'FeatureCollection' is not assign... Remove this comment to see the full error message this._geometryBeingScaled, scaleFactor, { origin } @@ -220,7 +219,7 @@ export class ScaleMode extends GeoJsonEditMode { }); this._cornerGuidePoints = cornerGuidePoints; - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'FeatureCollection 1 && tentativeFeature && !isPointInPolygon) { this.resetClickSequence(); - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'TentativeFeature' is not assigna... Remove this comment to see the full error message const isLineInterectingWithPolygon = lineIntersect(tentativeFeature, selectedGeometry); if (isLineInterectingWithPolygon.features.length === 0) { return; @@ -157,7 +157,7 @@ export class SplitPolygonMode extends GeoJsonEditMode { } const buffer = turfBuffer(tentativeFeature, gap, { units }); - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Geometry' is not assignable to p... Remove this comment to see the full error message const updatedGeometry = turfDifference(selectedGeometry, buffer); if (!updatedGeometry) { // eslint-disable-next-line no-console,no-undef @@ -169,11 +169,10 @@ export class SplitPolygonMode extends GeoJsonEditMode { let updatedCoordinates = []; if (type === 'Polygon') { // Update the coordinates as per Multipolygon - // @ts-ignore updatedCoordinates = coordinates.map((c) => [c]); } else { // Handle Case when Multipolygon has holes - // @ts-ignore + // @ts-expect-error ts-migrate(2349) FIXME: This expression is not callable. updatedCoordinates = coordinates.reduce((agg, prev) => { prev.forEach((p) => { agg.push([p]); diff --git a/modules/edit-modes/src/lib/transform-mode.ts b/modules/edit-modes/src/lib/transform-mode.ts index 36b7fffc1..bd5611fce 100644 --- a/modules/edit-modes/src/lib/transform-mode.ts +++ b/modules/edit-modes/src/lib/transform-mode.ts @@ -65,7 +65,7 @@ export class TransformMode extends CompositeMode { } return !guidesToFilterOut.includes('scale'); }); - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Readonly[]' is not... Remove this comment to see the full error message compositeGuides = featureCollection(nonEnvelopeGuides); } return compositeGuides; diff --git a/modules/edit-modes/src/lib/translate-mode.ts b/modules/edit-modes/src/lib/translate-mode.ts index 47dd040fc..b8c104985 100644 --- a/modules/edit-modes/src/lib/translate-mode.ts +++ b/modules/edit-modes/src/lib/translate-mode.ts @@ -97,7 +97,7 @@ export class TranslateMode extends GeoJsonEditMode { const direction = turfBearing(p1, p2); const movedFeatures = turfTransformTranslate( - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'FeatureCollection' is not assign... Remove this comment to see the full error message this._geometryBeforeTranslate, distanceMoved, direction @@ -108,6 +108,7 @@ export class TranslateMode extends GeoJsonEditMode { const selectedIndexes = props.selectedIndexes; for (let i = 0; i < selectedIndexes.length; i++) { const selectedIndex = selectedIndexes[i]; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'features' does not exist on type 'AllGeo... Remove this comment to see the full error message const movedFeature = movedFeatures.features[i]; updatedData = updatedData.replaceGeometry(selectedIndex, movedFeature.geometry); } diff --git a/modules/edit-modes/src/utils.ts b/modules/edit-modes/src/utils.ts index 74c0b97a3..133eaa6f5 100644 --- a/modules/edit-modes/src/utils.ts +++ b/modules/edit-modes/src/utils.ts @@ -118,7 +118,7 @@ export function nearestPointOnProjectedLine( // Project the line to viewport, then find the nearest point const coordinates: Array> = line.geometry.coordinates as any; const projectedCoords = coordinates.map(([x, y, z = 0]) => wmViewport.project([x, y, z])); - // @ts-ignore + // @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call. const [x, y] = wmViewport.project(inPoint.geometry.coordinates); // console.log('projectedCoords', JSON.stringify(projectedCoords)); @@ -153,7 +153,7 @@ export function nearestPointOnProjectedLine( }; } }); - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'index' does not exist on type '{}'. const { index, x0, y0 } = minPointInfo; const [x1, y1, z1 = 0] = projectedCoords[index - 1]; const [x2, y2, z2 = 0] = projectedCoords[index]; @@ -196,10 +196,10 @@ export function nearestPointOnLine( return closestPoint; } - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'FeatureOf' is not as... Remove this comment to see the full error message flattenEach(lines, (line: any) => { const coords: any = getCoords(line); - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'FeatureOf' is not assigna... Remove this comment to see the full error message const pointCoords: any = getCoords(inPoint); let minDist; @@ -425,7 +425,7 @@ export function getEditHandlesForGeometry( break; default: - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'type' does not exist on type 'never'. throw Error(`Unhandled geometry type: ${geometry.type}`); } diff --git a/modules/editor/package.json b/modules/editor/package.json index cb456b834..e0bd67c5e 100644 --- a/modules/editor/package.json +++ b/modules/editor/package.json @@ -49,8 +49,8 @@ "test-rendering": "(cd test/rendering-test && webpack-dev-server --config webpack.config.test-rendering.js --progress --hot --open)" }, "dependencies": { - "@loaders.gl/core": "^2.1.2", - "@loaders.gl/wkt": "^2.1.2", + "@loaders.gl/core": "^3.0.12", + "@loaders.gl/wkt": "^3.0.12", "@maphubs/tokml": "^0.5.2", "@nebula.gl/edit-modes": "0.23.8", "@tmcw/togeojson": "^3.2.0", diff --git a/modules/editor/src/icon.tsx b/modules/editor/src/icon.tsx index 056529464..510fb59f2 100644 --- a/modules/editor/src/icon.tsx +++ b/modules/editor/src/icon.tsx @@ -2,6 +2,6 @@ import * as React from 'react'; import 'boxicons'; export function Icon(props) { - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'box-icon' does not exist on type 'JSX.In... Remove this comment to see the full error message return ; } diff --git a/modules/editor/src/import-component.tsx b/modules/editor/src/import-component.tsx index d813b219f..29dc20cf8 100644 --- a/modules/editor/src/import-component.tsx +++ b/modules/editor/src/import-component.tsx @@ -179,7 +179,7 @@ export function ImportComponent(props: ImportComponentProps) { {isDataSet() && !parseResult.valid && - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'validationErrors' does not exist on type... Remove this comment to see the full error message parseResult.validationErrors.map((err, i) =>
{err}
)}
@@ -233,7 +233,7 @@ export function ImportComponent(props: ImportComponentProps) { type: 'FeatureCollection', properties: {}, // $FlowFixMe - can't be clicked if it is invalid, so features will be there - //@ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'features' does not exist on type 'Import... Remove this comment to see the full error message features: parseResult.features, }); flush(); diff --git a/modules/editor/src/lib/exporter.ts b/modules/editor/src/lib/exporter.ts index 07c5c8e84..b6547085b 100644 --- a/modules/editor/src/lib/exporter.ts +++ b/modules/editor/src/lib/exporter.ts @@ -2,7 +2,7 @@ import tokml from '@maphubs/tokml'; import { stringify as stringifyWkt } from 'wellknown'; -// @ts-ignore +// @ts-expect-error ts-migrate(2305) FIXME: Module '"@nebula.gl/edit-modes"' has no exported m... Remove this comment to see the full error message import { AnyGeoJson, Geometry, PolygonalGeometry } from '@nebula.gl/edit-modes'; export type ExportParameters = { @@ -42,13 +42,11 @@ export function toKml(geoJson: AnyGeoJson, filename: string): ExportParameters { export function toWkt(geoJson: AnyGeoJson, filename: string): ExportParameters { let wkt = ''; if (geoJson.type === 'Feature') { - // @ts-ignore wkt = stringifyWkt(geoJson); } else { // feature collection wkt = ''; for (const feature of geoJson.features) { - // @ts-ignore wkt += `${stringifyWkt(feature)}\n`; } if (wkt.length > 0) { diff --git a/modules/editor/src/lib/importer.ts b/modules/editor/src/lib/importer.ts index b7dc95a25..93e071d0f 100644 --- a/modules/editor/src/lib/importer.ts +++ b/modules/editor/src/lib/importer.ts @@ -58,14 +58,10 @@ function getCleanedFeature(feature: Feature): Feature { const properties = feature.properties || {}; let geometry = feature.geometry; - // @ts-ignore if (geometry.type === 'GeometryCollection' && geometry.geometries.length === 1) { // There's only one geometry - // @ts-ignore geometry = geometry.geometries[0]; - // @ts-ignore } else if (geometry.type === 'GeometryCollection' && geometry.geometries.length > 1) { - // @ts-ignore const types = new Set(geometry.geometries.map((g) => g.type)); if (types.size === 1) { // See if it can be combined into a Multi* geometry @@ -74,14 +70,12 @@ function getCleanedFeature(feature: Feature): Feature { // Combine all the Polygons into a single MultiPolygon geometry = { type: 'MultiPolygon', - // @ts-ignore coordinates: geometry.geometries.map((g) => g.coordinates), }; } else if (type === 'LineString') { // Combine all the LineStrings into a single MultiLineString geometry = { type: 'MultiLineString', - // @ts-ignore coordinates: geometry.geometries.map((g) => g.coordinates), }; } @@ -91,7 +85,6 @@ function getCleanedFeature(feature: Feature): Feature { } } - // @ts-ignore return { type: 'Feature', id, diff --git a/modules/editor/test/exporter.test.ts b/modules/editor/test/exporter.test.ts index ca5d67853..5c8e230b7 100644 --- a/modules/editor/test/exporter.test.ts +++ b/modules/editor/test/exporter.test.ts @@ -7,6 +7,7 @@ import { createRandomFeature } from './utils/test-features'; let feature: Feature; let featureCollection: FeatureCollection; +// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'beforeEach'. beforeEach(() => { feature = createRandomFeature(); feature.properties.name = 'My Feature'; @@ -21,7 +22,9 @@ beforeEach(() => { }; }); +// @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message describe('toGeoJson()', () => { + // @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'test'. Do you need to install ty... Remove this comment to see the full error message test('feature', () => { const expectedFilename = `myfile.geojson`; const expectedMimeType = 'application/json'; @@ -29,12 +32,16 @@ describe('toGeoJson()', () => { const actual = toGeoJson(feature, 'myfile'); const actualParsed = JSON.parse(actual.data); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.filename).toEqual(expectedFilename); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.mimetype).toEqual(expectedMimeType); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actualParsed.properties.name).toEqual(feature.properties.name); }); + // @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'test'. Do you need to install ty... Remove this comment to see the full error message test('feature collection', () => { const expectedFilename = `geojsonFeatures.geojson`; const expectedMimeType = 'application/json'; @@ -42,30 +49,40 @@ describe('toGeoJson()', () => { const actual = toGeoJson(featureCollection, 'geojsonFeatures'); const actualParsed: FeatureCollection = JSON.parse(actual.data); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.filename).toEqual(expectedFilename); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.mimetype).toEqual(expectedMimeType); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actualParsed.features[0].properties.name).toEqual( featureCollection.features[0].properties.name ); }); }); +// @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message describe('toKml()', () => { + // @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'test'. Do you need to install ty... Remove this comment to see the full error message test('feature', () => { const expectedFilename = `myfile.kml`; const expectedMimeType = 'application/xml'; const actual = toKml(feature, 'myfile'); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.filename).toEqual(expectedFilename); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.mimetype).toEqual(expectedMimeType); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.data).toContain(`${feature.properties.name}`); }); }); +// @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message describe('toWkt()', () => { + // @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'test'. Do you need to install ty... Remove this comment to see the full error message test('feature', () => { const expectedFilename = `llamallama.wkt`; const expectedMimeType = 'text/plain'; @@ -90,11 +107,15 @@ describe('toWkt()', () => { 'llamallama' ); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.filename).toEqual(expectedFilename); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.mimetype).toEqual(expectedMimeType); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.data).toEqual(expectedData); }); + // @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'test'. Do you need to install ty... Remove this comment to see the full error message test('feature collection', () => { const expectedFilename = `geojsonFeatures.wkt`; const expectedMimeType = 'text/plain'; @@ -141,11 +162,15 @@ describe('toWkt()', () => { 'geojsonFeatures' ); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.filename).toEqual(expectedFilename); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.mimetype).toEqual(expectedMimeType); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.data).toEqual(expectedData); }); + // @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'test'. Do you need to install ty... Remove this comment to see the full error message test('empty feature collection', () => { const expectedFilename = `geojsonFeatures.wkt`; const expectedMimeType = 'text/plain'; @@ -160,13 +185,18 @@ describe('toWkt()', () => { 'geojsonFeatures' ); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.filename).toEqual(expectedFilename); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.mimetype).toEqual(expectedMimeType); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.data).toEqual(expectedData); }); }); +// @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message describe('toStats()', () => { + // @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'test'. Do you need to install ty... Remove this comment to see the full error message test('when feature', () => { const expectedFilename = `mystats.txt`; const expectedMimeType = 'text/plain'; @@ -191,11 +221,15 @@ describe('toStats()', () => { 'mystats' ); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.filename).toEqual(expectedFilename); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.mimetype).toEqual(expectedMimeType); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.data).toEqual(expectedData); }); + // @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'test'. Do you need to install ty... Remove this comment to see the full error message test('feature collection', () => { const expectedFilename = `mystats.txt`; const expectedMimeType = 'text/plain'; @@ -258,8 +292,11 @@ describe('toStats()', () => { 'mystats' ); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.filename).toEqual(expectedFilename); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.mimetype).toEqual(expectedMimeType); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(actual.data).toEqual(expectedData); }); }); diff --git a/modules/layers/src/curve-utils.ts b/modules/layers/src/curve-utils.ts index b820a57ef..651987ab8 100644 --- a/modules/layers/src/curve-utils.ts +++ b/modules/layers/src/curve-utils.ts @@ -36,14 +36,14 @@ export function generateCurveFromControlPoints( const tangents = []; // first tangent - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Position[]' is not assignable to... Remove this comment to see the full error message tangents.push(calculateSingleTangent(coords[0], coords[1], knots[1] - knots[0])); // second to before last for (let i = 1; i < coords.length - 1; i++) { - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Position[]' is not assignable to... Remove this comment to see the full error message const A = calculateSingleTangent(coords[i], coords[i + 1], knots[i + 1] - knots[i]); - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Position[]' is not assignable to... Remove this comment to see the full error message const B = calculateSingleTangent(coords[i - 1], coords[i], knots[i] - knots[i - 1]); const x = (A[0] + B[0]) / 2.0; const y = (A[1] + B[1]) / 2.0; @@ -53,7 +53,7 @@ export function generateCurveFromControlPoints( // last tangent const last = coords.length - 1; tangents.push( - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Position[]' is not assignable to... Remove this comment to see the full error message calculateSingleTangent(coords[last - 1], coords[last], knots[last] - knots[last - 1]) ); diff --git a/modules/layers/src/layers/editable-geojson-layer.ts b/modules/layers/src/layers/editable-geojson-layer.ts index dd256e4d4..aec693aa0 100644 --- a/modules/layers/src/layers/editable-geojson-layer.ts +++ b/modules/layers/src/layers/editable-geojson-layer.ts @@ -218,36 +218,58 @@ export default class EditableGeoJsonLayer extends EditableLayer { // Proxy most GeoJsonLayer props as-is data: this.props.data, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'fp64' does not exist on type 'CompositeL... Remove this comment to see the full error message fp64: this.props.fp64, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'filled' does not exist on type 'Composit... Remove this comment to see the full error message filled: this.props.filled, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'stroked' does not exist on type 'Composi... Remove this comment to see the full error message stroked: this.props.stroked, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineWidthScale' does not exist on type '... Remove this comment to see the full error message lineWidthScale: this.props.lineWidthScale, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineWidthMinPixels' does not exist on ty... Remove this comment to see the full error message lineWidthMinPixels: this.props.lineWidthMinPixels, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineWidthMaxPixels' does not exist on ty... Remove this comment to see the full error message lineWidthMaxPixels: this.props.lineWidthMaxPixels, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineWidthUnits' does not exist on type '... Remove this comment to see the full error message lineWidthUnits: this.props.lineWidthUnits, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineJointRounded' does not exist on type... Remove this comment to see the full error message lineJointRounded: this.props.lineJointRounded, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineMiterLimit' does not exist on type '... Remove this comment to see the full error message lineMiterLimit: this.props.lineMiterLimit, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'pointRadiusScale' does not exist on type... Remove this comment to see the full error message pointRadiusScale: this.props.pointRadiusScale, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'pointRadiusMinPixels' does not exist on ... Remove this comment to see the full error message pointRadiusMinPixels: this.props.pointRadiusMinPixels, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'pointRadiusMaxPixels' does not exist on ... Remove this comment to see the full error message pointRadiusMaxPixels: this.props.pointRadiusMaxPixels, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getLineColor' does not exist on type 'Co... Remove this comment to see the full error message getLineColor: this.selectionAwareAccessor(this.props.getLineColor), + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getFillColor' does not exist on type 'Co... Remove this comment to see the full error message getFillColor: this.selectionAwareAccessor(this.props.getFillColor), + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getRadius' does not exist on type 'Compo... Remove this comment to see the full error message getRadius: this.selectionAwareAccessor(this.props.getRadius), + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getLineWidth' does not exist on type 'Co... Remove this comment to see the full error message getLineWidth: this.selectionAwareAccessor(this.props.getLineWidth), _subLayerProps: { 'line-strings': { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'billboard' does not exist on type 'Compo... Remove this comment to see the full error message billboard: this.props.billboard, }, 'polygons-stroke': { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'billboard' does not exist on type 'Compo... Remove this comment to see the full error message billboard: this.props.billboard, }, }, updateTriggers: { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectedFeatureIndexes' does not exist o... Remove this comment to see the full error message getLineColor: [this.props.selectedFeatureIndexes, this.props.mode], + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectedFeatureIndexes' does not exist o... Remove this comment to see the full error message getFillColor: [this.props.selectedFeatureIndexes, this.props.mode], + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectedFeatureIndexes' does not exist o... Remove this comment to see the full error message getRadius: [this.props.selectedFeatureIndexes, this.props.mode], + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectedFeatureIndexes' does not exist o... Remove this comment to see the full error message getLineWidth: [this.props.selectedFeatureIndexes, this.props.mode], }, }); @@ -278,6 +300,7 @@ export default class EditableGeoJsonLayer extends EditableLayer { return super.shouldUpdateState(opts) || opts.changeFlags.stateChanged; } + // @ts-expect-error ts-migrate(2416) FIXME: Property 'updateState' in type 'EditableGeoJsonLay... Remove this comment to see the full error message updateState({ props, oldProps, @@ -287,7 +310,7 @@ export default class EditableGeoJsonLayer extends EditableLayer { oldProps: Props; changeFlags: any; }) { - // @ts-ignore + // @ts-expect-error ts-migrate(2559) FIXME: Type 'Props' has no properties in common with type... Remove this comment to see the full error message super.updateState({ oldProps, props, changeFlags }); if (changeFlags.propsOrDataChanged) { @@ -356,17 +379,21 @@ export default class EditableGeoJsonLayer extends EditableLayer { return accessor; } return (feature: Record) => + // @ts-expect-error ts-migrate(2339) FIXME: Property 'mode' does not exist on type 'CompositeL... Remove this comment to see the full error message accessor(feature, this.isFeatureSelected(feature), this.props.mode); } isFeatureSelected(feature: Record) { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectedFeatureIndexes' does not exist o... Remove this comment to see the full error message if (!this.props.data || !this.props.selectedFeatureIndexes) { return false; } + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectedFeatureIndexes' does not exist o... Remove this comment to see the full error message if (!this.props.selectedFeatureIndexes.length) { return false; } const featureIndex = this.props.data.features.indexOf(feature); + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectedFeatureIndexes' does not exist o... Remove this comment to see the full error message return this.props.selectedFeatureIndexes.includes(featureIndex); } @@ -381,6 +408,7 @@ export default class EditableGeoJsonLayer extends EditableLayer { createGuidesLayers() { const mode = this.getActiveMode(); + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'CompositeLayerProps' is not... Remove this comment to see the full error message const guides: FeatureCollection = mode.getGuides(this.getModeProps(this.props)); if (!guides || !guides.features.length) { @@ -388,27 +416,43 @@ export default class EditableGeoJsonLayer extends EditableLayer { } let pointLayerProps; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'editHandleType' does not exist on type '... Remove this comment to see the full error message if (this.props.editHandleType === 'icon') { pointLayerProps = { type: IconLayer, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'editHandleIconAtlas' does not exist on t... Remove this comment to see the full error message iconAtlas: this.props.editHandleIconAtlas, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'editHandleIconMapping' does not exist on... Remove this comment to see the full error message iconMapping: this.props.editHandleIconMapping, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'editHandleIconSizeScale' does not exist ... Remove this comment to see the full error message sizeScale: this.props.editHandleIconSizeScale, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getEditHandleIcon' does not exist on typ... Remove this comment to see the full error message getIcon: guideAccessor(this.props.getEditHandleIcon), + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getEditHandleIconSize' does not exist on... Remove this comment to see the full error message getSize: guideAccessor(this.props.getEditHandleIconSize), + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getEditHandleIconColor' does not exist o... Remove this comment to see the full error message getColor: guideAccessor(this.props.getEditHandleIconColor), + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getEditHandleIconAngle' does not exist o... Remove this comment to see the full error message getAngle: guideAccessor(this.props.getEditHandleIconAngle), }; } else { pointLayerProps = { type: ScatterplotLayer, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'editHandlePointRadiusScale' does not exi... Remove this comment to see the full error message radiusScale: this.props.editHandlePointRadiusScale, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'editHandlePointOutline' does not exist o... Remove this comment to see the full error message stroked: this.props.editHandlePointOutline, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'editHandlePointStrokeWidth' does not exi... Remove this comment to see the full error message getLineWidth: this.props.editHandlePointStrokeWidth, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'editHandlePointRadiusMinPixels' does not... Remove this comment to see the full error message radiusMinPixels: this.props.editHandlePointRadiusMinPixels, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'editHandlePointRadiusMaxPixels' does not... Remove this comment to see the full error message radiusMaxPixels: this.props.editHandlePointRadiusMaxPixels, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getEditHandlePointRadius' does not exist... Remove this comment to see the full error message getRadius: guideAccessor(this.props.getEditHandlePointRadius), + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getEditHandlePointColor' does not exist ... Remove this comment to see the full error message getFillColor: guideAccessor(this.props.getEditHandlePointColor), + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getEditHandlePointOutlineColor' does not... Remove this comment to see the full error message getLineColor: guideAccessor(this.props.getEditHandlePointOutlineColor), }; } @@ -417,18 +461,28 @@ export default class EditableGeoJsonLayer extends EditableLayer { this.getSubLayerProps({ id: `guides`, data: guides, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'fp64' does not exist on type 'CompositeL... Remove this comment to see the full error message fp64: this.props.fp64, _subLayerProps: { points: pointLayerProps, }, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineWidthScale' does not exist on type '... Remove this comment to see the full error message lineWidthScale: this.props.lineWidthScale, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineWidthMinPixels' does not exist on ty... Remove this comment to see the full error message lineWidthMinPixels: this.props.lineWidthMinPixels, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineWidthMaxPixels' does not exist on ty... Remove this comment to see the full error message lineWidthMaxPixels: this.props.lineWidthMaxPixels, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineWidthUnits' does not exist on type '... Remove this comment to see the full error message lineWidthUnits: this.props.lineWidthUnits, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineJointRounded' does not exist on type... Remove this comment to see the full error message lineJointRounded: this.props.lineJointRounded, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineMiterLimit' does not exist on type '... Remove this comment to see the full error message lineMiterLimit: this.props.lineMiterLimit, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getTentativeLineColor' does not exist on... Remove this comment to see the full error message getLineColor: guideAccessor(this.props.getTentativeLineColor), + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getTentativeLineWidth' does not exist on... Remove this comment to see the full error message getLineWidth: guideAccessor(this.props.getTentativeLineWidth), + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getTentativeFillColor' does not exist on... Remove this comment to see the full error message getFillColor: guideAccessor(this.props.getTentativeFillColor), }) ); @@ -438,6 +492,7 @@ export default class EditableGeoJsonLayer extends EditableLayer { createTooltipsLayers() { const mode = this.getActiveMode(); + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'CompositeLayerProps' is not... Remove this comment to see the full error message const tooltips = mode.getTooltips(this.getModeProps(this.props)); const layer = new TextLayer( @@ -451,27 +506,33 @@ export default class EditableGeoJsonLayer extends EditableLayer { } onLayerClick(event: ClickEvent) { + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'CompositeLayerProps' is not... Remove this comment to see the full error message this.getActiveMode().handleClick(event, this.getModeProps(this.props)); } onLayerKeyUp(event: KeyboardEvent) { + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'CompositeLayerProps' is not... Remove this comment to see the full error message this.getActiveMode().handleKeyUp(event, this.getModeProps(this.props)); } onStartDragging(event: StartDraggingEvent) { + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'CompositeLayerProps' is not... Remove this comment to see the full error message this.getActiveMode().handleStartDragging(event, this.getModeProps(this.props)); } onDragging(event: DraggingEvent) { + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'CompositeLayerProps' is not... Remove this comment to see the full error message this.getActiveMode().handleDragging(event, this.getModeProps(this.props)); } onStopDragging(event: StopDraggingEvent) { + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'CompositeLayerProps' is not... Remove this comment to see the full error message this.getActiveMode().handleStopDragging(event, this.getModeProps(this.props)); } onPointerMove(event: PointerMoveEvent) { this.setState({ lastPointerMoveEvent: event }); + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'CompositeLayerProps' is not... Remove this comment to see the full error message this.getActiveMode().handlePointerMove(event, this.getModeProps(this.props)); } diff --git a/modules/layers/src/layers/editable-h3-cluster-layer.ts b/modules/layers/src/layers/editable-h3-cluster-layer.ts index 1424110f2..98395690c 100644 --- a/modules/layers/src/layers/editable-h3-cluster-layer.ts +++ b/modules/layers/src/layers/editable-h3-cluster-layer.ts @@ -57,11 +57,13 @@ export default class EditableH3ClusterLayer extends EditableLayer { // convert array of (lng, lat) coords to cluster of hexes getDerivedHexagonIDs(coords) { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'resolution' does not exist on type 'Comp... Remove this comment to see the full error message return polyfill(coords, this.props.resolution, true); } // convert pair of (lng, lat) coords into single hex getDerivedHexagonID(coords) { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'resolution' does not exist on type 'Comp... Remove this comment to see the full error message return geoToH3(coords[1], coords[0], this.props.resolution); } @@ -71,6 +73,7 @@ export default class EditableH3ClusterLayer extends EditableLayer { this.getSubLayerProps({ id: 'editable-geojson', + // @ts-expect-error ts-migrate(2339) FIXME: Property 'mode' does not exist on type 'CompositeL... Remove this comment to see the full error message mode: this.props.mode, data: EMPTY_FEATURE_COLLECTION, selectedFeatureIndexes: [], @@ -95,13 +98,16 @@ export default class EditableH3ClusterLayer extends EditableLayer { break; case 'addFeature': const updatedData = [...this.props.data]; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'modeConfig' does not exist on type 'Comp... Remove this comment to see the full error message const { modeConfig } = this.props; if (!modeConfig || !modeConfig.booleanOperation) { // add new h3 cluster updatedData.push( + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getEditedCluster' does not exist on type... Remove this comment to see the full error message this.props.getEditedCluster(this.state.tentativeHexagonIDs, null) ); + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectedIndexes' does not exist on type ... Remove this comment to see the full error message } else if (this.props.selectedIndexes.length !== 1) { // eslint-disable-next-line no-console,no-undef console.warn('booleanOperation only supported for single cluster selection'); @@ -130,8 +136,10 @@ export default class EditableH3ClusterLayer extends EditableLayer { break; } + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectedIndexes' does not exist on type ... Remove this comment to see the full error message const selectedIndex = this.props.selectedIndexes[0]; const existingCluster = this.props.data[selectedIndex]; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getEditedCluster' does not exist on type... Remove this comment to see the full error message updatedData[selectedIndex] = this.props.getEditedCluster( finalHexagonIDs, existingCluster @@ -142,6 +150,7 @@ export default class EditableH3ClusterLayer extends EditableLayer { tentativeHexagonIDs: [], }); + // @ts-expect-error ts-migrate(2339) FIXME: Property 'onEdit' does not exist on type 'Composit... Remove this comment to see the full error message this.props.onEdit({ updatedData }); break; @@ -156,6 +165,7 @@ export default class EditableH3ClusterLayer extends EditableLayer { this.getSubLayerProps({ id: 'hexagons', data: this.props.data, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getHexagons' does not exist on type 'Com... Remove this comment to see the full error message getHexagons: this.props.getHexagons, }) ), @@ -178,8 +188,10 @@ export default class EditableH3ClusterLayer extends EditableLayer { // using props.getHexagons to support multiple data types getSelectedHexIDs() { let cumulativeHexIDs = []; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectedIndexes' does not exist on type ... Remove this comment to see the full error message this.props.selectedIndexes.forEach((index) => { const selectedCluster = this.props.data[index]; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getHexagons' does not exist on type 'Com... Remove this comment to see the full error message const hexIDs = this.props.getHexagons(selectedCluster); cumulativeHexIDs = cumulativeHexIDs.concat(hexIDs); }); diff --git a/modules/layers/src/layers/editable-layer.ts b/modules/layers/src/layers/editable-layer.ts index 0aa819229..3fcc63f10 100644 --- a/modules/layers/src/layers/editable-layer.ts +++ b/modules/layers/src/layers/editable-layer.ts @@ -62,7 +62,7 @@ export default class EditableLayer extends CompositeLayer { } _addEventHandlers() { - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'eventManager' does not exist on type 'De... Remove this comment to see the full error message const { eventManager } = this.context.deck; const { eventHandler } = this.state._editableLayerState; @@ -75,7 +75,7 @@ export default class EditableLayer extends CompositeLayer { } _removeEventHandlers() { - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'eventManager' does not exist on type 'De... Remove this comment to see the full error message const { eventManager } = this.context.deck; const { eventHandler } = this.state._editableLayerState; @@ -102,12 +102,13 @@ export default class EditableLayer extends CompositeLayer { _onanyclick({ srcEvent }: any) { const screenCoords = this.getScreenCoords(srcEvent); const mapCoords = this.getMapCoords(screenCoords); - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number[]' is not assignable to p... Remove this comment to see the full error message const picks = this.getPicks(screenCoords); this.onLayerClick({ + // @ts-expect-error ts-migrate(2322) FIXME: Type 'any[]' is not assignable to type 'Position'. mapCoords, - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'number[]' is not assignable to type 'ScreenC... Remove this comment to see the full error message screenCoords, picks, sourceEvent: srcEvent, @@ -121,7 +122,7 @@ export default class EditableLayer extends CompositeLayer { _onpanstart(event: any) { const screenCoords = this.getScreenCoords(event.srcEvent); const mapCoords = this.getMapCoords(screenCoords); - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number[]' is not assignable to p... Remove this comment to see the full error message const picks = this.getPicks(screenCoords); this.setState({ @@ -135,12 +136,13 @@ export default class EditableLayer extends CompositeLayer { this.onStartDragging({ picks, - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'number[]' is not assignable to type 'ScreenC... Remove this comment to see the full error message screenCoords, - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'any[]' is not assignable to type 'Position'. mapCoords, - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'number[]' is not assignable to type 'ScreenC... Remove this comment to see the full error message pointerDownScreenCoords: screenCoords, + // @ts-expect-error ts-migrate(2322) FIXME: Type 'any[]' is not assignable to type 'Position'. pointerDownMapCoords: mapCoords, cancelPan: event.stopImmediatePropagation, sourceEvent: event.srcEvent, @@ -157,12 +159,13 @@ export default class EditableLayer extends CompositeLayer { pointerDownScreenCoords, pointerDownMapCoords, } = this.state._editableLayerState; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number[]' is not assignable to p... Remove this comment to see the full error message const picks = this.getPicks(screenCoords); this.onDragging({ - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'number[]' is not assignable to type 'ScreenC... Remove this comment to see the full error message screenCoords, + // @ts-expect-error ts-migrate(2322) FIXME: Type 'any[]' is not assignable to type 'Position'. mapCoords, picks, pointerDownPicks, @@ -187,13 +190,14 @@ export default class EditableLayer extends CompositeLayer { pointerDownScreenCoords, pointerDownMapCoords, } = this.state._editableLayerState; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number[]' is not assignable to p... Remove this comment to see the full error message const picks = this.getPicks(screenCoords); this.onStopDragging({ picks, - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'number[]' is not assignable to type 'ScreenC... Remove this comment to see the full error message screenCoords, + // @ts-expect-error ts-migrate(2322) FIXME: Type 'any[]' is not assignable to type 'Position'. mapCoords, pointerDownPicks, pointerDownScreenCoords, @@ -221,12 +225,13 @@ export default class EditableLayer extends CompositeLayer { pointerDownScreenCoords, pointerDownMapCoords, } = this.state._editableLayerState; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number[]' is not assignable to p... Remove this comment to see the full error message const picks = this.getPicks(screenCoords); this.onPointerMove({ - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'number[]' is not assignable to type 'ScreenC... Remove this comment to see the full error message screenCoords, + // @ts-expect-error ts-migrate(2322) FIXME: Type 'any[]' is not assignable to type 'Position'. mapCoords, picks, pointerDownPicks, @@ -237,12 +242,13 @@ export default class EditableLayer extends CompositeLayer { } getPicks(screenCoords: [number, number]) { - // @ts-ignore return this.context.deck.pickMultipleObjects({ x: screenCoords[0], y: screenCoords[1], layerIds: [this.props.id], + // @ts-expect-error ts-migrate(2339) FIXME: Property 'pickingRadius' does not exist on type 'C... Remove this comment to see the full error message radius: this.props.pickingRadius, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'pickingDepth' does not exist on type 'Co... Remove this comment to see the full error message depth: this.props.pickingDepth, }); } @@ -257,7 +263,6 @@ export default class EditableLayer extends CompositeLayer { } getMapCoords(screenCoords: number[]) { - // @ts-ignore return this.context.viewport.unproject([screenCoords[0], screenCoords[1]]); } } diff --git a/modules/layers/src/layers/elevated-edit-handle-layer.ts b/modules/layers/src/layers/elevated-edit-handle-layer.ts index 7e0b183ba..12dc3e102 100644 --- a/modules/layers/src/layers/elevated-edit-handle-layer.ts +++ b/modules/layers/src/layers/elevated-edit-handle-layer.ts @@ -17,6 +17,7 @@ export default class ElevatedEditHandleLayer extends CompositeLayer { ); const lines = new LineLayer( + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'CompositeLayerProps & { id:... Remove this comment to see the full error message Object.assign({}, this.props, { id: `${this.props.id}-LineLayer`, data: this.props.data, diff --git a/modules/layers/src/layers/junction-scatterplot-layer.ts b/modules/layers/src/layers/junction-scatterplot-layer.ts index f9fd6f920..084ff4555 100644 --- a/modules/layers/src/layers/junction-scatterplot-layer.ts +++ b/modules/layers/src/layers/junction-scatterplot-layer.ts @@ -4,7 +4,6 @@ import { ScatterplotLayer } from '@deck.gl/layers'; export default class JunctionScatterplotLayer extends CompositeLayer { static layerName = 'JunctionScatterplotLayer'; static defaultProps = { - // @ts-ignore ...ScatterplotLayer.defaultProps, getFillColor: (d) => [0, 0, 0, 255], getStrokeColor: (d) => [255, 255, 255, 255], @@ -12,6 +11,7 @@ export default class JunctionScatterplotLayer extends CompositeLayer { }; renderLayers() { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getFillColor' does not exist on type 'Co... Remove this comment to see the full error message const { id, getFillColor, getStrokeColor, getInnerRadius, updateTriggers } = this.props; // data needs to be passed explicitly after deck.gl 5.3 diff --git a/modules/layers/src/layers/path-marker-layer/create-path-markers.ts b/modules/layers/src/layers/path-marker-layer/create-path-markers.ts index e288bb2d6..c07d96072 100644 --- a/modules/layers/src/layers/path-marker-layer/create-path-markers.ts +++ b/modules/layers/src/layers/path-marker-layer/create-path-markers.ts @@ -34,7 +34,7 @@ export default function createPathMarkers({ const lineLength = getLineLength(vPoints); // Ask for where to put markers - // @ts-ignore + // @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 2. const percentages = getMarkerPercentages(object, { lineLength }); // Create the markers diff --git a/modules/layers/src/layers/path-marker-layer/path-marker-layer.ts b/modules/layers/src/layers/path-marker-layer/path-marker-layer.ts index bc4cec427..b0c345ea7 100644 --- a/modules/layers/src/layers/path-marker-layer/path-marker-layer.ts +++ b/modules/layers/src/layers/path-marker-layer/path-marker-layer.ts @@ -47,7 +47,6 @@ export default class PathMarkerLayer extends CompositeLayer { closestPoint: null, }; } - // @ts-ignore projectFlat(xyz, viewport, coordinateSystem, coordinateOrigin) { if (coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS) { const [dx, dy] = viewport.metersToLngLatDelta(xyz); @@ -66,14 +65,17 @@ export default class PathMarkerLayer extends CompositeLayer { if (changeFlags.dataChanged || changeFlags.updateTriggersChanged) { const { data, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getPath' does not exist on type 'Composi... Remove this comment to see the full error message getPath, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getDirection' does not exist on type 'Co... Remove this comment to see the full error message getDirection, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getMarkerColor' does not exist on type '... Remove this comment to see the full error message getMarkerColor, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getMarkerPercentages' does not exist on ... Remove this comment to see the full error message getMarkerPercentages, coordinateSystem, coordinateOrigin, } = this.props; - // @ts-ignore const { viewport } = this.context; const projectFlat = (o) => this.projectFlat(o, viewport, coordinateSystem, coordinateOrigin); this.state.markers = createPathMarkers({ @@ -94,9 +96,11 @@ export default class PathMarkerLayer extends CompositeLayer { } _recalculateClosestPoint() { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'highlightPoint' does not exist on type '... Remove this comment to see the full error message const { highlightPoint, highlightIndex } = this.props; if (highlightPoint && highlightIndex >= 0) { const object = this.props.data[highlightIndex]; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getPath' does not exist on type 'Composi... Remove this comment to see the full error message const points = this.props.getPath(object); const { point } = getClosestPointOnPolyline({ points, p: highlightPoint }); this.state.closestPoints = [ @@ -120,21 +124,25 @@ export default class PathMarkerLayer extends CompositeLayer { return [ new PathOutlineLayer( this.props, - // @ts-ignore + // @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 2. this.getSubLayerProps({ id: 'paths', // Note: data has to be passed explicitly like this to avoid being empty data: this.props.data, }) ), + // @ts-expect-error ts-migrate(2339) FIXME: Property 'MarkerLayer' does not exist on type 'Com... Remove this comment to see the full error message new this.props.MarkerLayer( this.getSubLayerProps( + // @ts-expect-error ts-migrate(2339) FIXME: Property 'markerLayerProps' does not exist on type... Remove this comment to see the full error message Object.assign({}, this.props.markerLayerProps, { id: 'markers', data: this.state.markers, getOrientation: (x) => [0, -x.angle, 0], getColor: (x) => x.color, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'sizeScale' does not exist on type 'Compo... Remove this comment to see the full error message sizeScale: this.props.sizeScale, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'fp64' does not exist on type 'CompositeL... Remove this comment to see the full error message fp64: this.props.fp64, pickable: false, parameters: { @@ -148,7 +156,7 @@ export default class PathMarkerLayer extends CompositeLayer { new ScatterplotLayer({ id: `${this.props.id}-highlight`, data: this.state.closestPoints, - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'fp64' does not exist on type 'CompositeL... Remove this comment to see the full error message fp64: this.props.fp64, }), ]; diff --git a/modules/layers/src/layers/path-marker-layer/polyline.ts b/modules/layers/src/layers/path-marker-layer/polyline.ts index 846721786..b1d994d26 100644 --- a/modules/layers/src/layers/path-marker-layer/polyline.ts +++ b/modules/layers/src/layers/path-marker-layer/polyline.ts @@ -8,7 +8,7 @@ export function getClosestPointOnLine({ p, p1, p2, clampToLine = true }) { if (clampToLine) { dotProduct = clamp(dotProduct, 0, 1); } - // @ts-ignore + // @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 1. return lineVector.lerp(dotProduct); } diff --git a/modules/layers/src/layers/path-outline-layer/path-outline-layer.ts b/modules/layers/src/layers/path-outline-layer/path-outline-layer.ts index ccb68345d..693b29c21 100644 --- a/modules/layers/src/layers/path-outline-layer/path-outline-layer.ts +++ b/modules/layers/src/layers/path-outline-layer/path-outline-layer.ts @@ -61,11 +61,13 @@ export default class PathOutlineLayer extends PathLayer { draw({ moduleParameters = {}, parameters, uniforms, context }) { // Need to calculate same uniforms as base layer const { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'rounded' does not exist on type 'PathLay... Remove this comment to see the full error message rounded, miterLimit, widthScale, widthMinPixels, widthMaxPixels, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'dashJustified' does not exist on type 'P... Remove this comment to see the full error message dashJustified, } = this.props; @@ -120,6 +122,7 @@ export default class PathOutlineLayer extends PathLayer { } calculateZLevels(attribute) { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'getZLevel' does not exist on type 'PathL... Remove this comment to see the full error message const { getZLevel } = this.props; const { pathTesselator } = this.state; diff --git a/modules/layers/src/layers/selection-layer.ts b/modules/layers/src/layers/selection-layer.ts index fbef86dea..214322fa7 100644 --- a/modules/layers/src/layers/selection-layer.ts +++ b/modules/layers/src/layers/selection-layer.ts @@ -65,12 +65,10 @@ export default class SelectionLayer extends CompositeLayer { static defaultProps = defaultProps; _selectRectangleObjects(coordinates: any) { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'layerIds' does not exist on type 'Compos... Remove this comment to see the full error message const { layerIds, onSelect } = this.props; - // @ts-ignore const [x1, y1] = this.context.viewport.project(coordinates[0][0]); - // @ts-ignore const [x2, y2] = this.context.viewport.project(coordinates[0][2]); - // @ts-ignore const pickingInfos = this.context.deck.pickObjects({ x: Math.min(x1, x2), y: Math.min(y1, y2), @@ -83,8 +81,8 @@ export default class SelectionLayer extends CompositeLayer { } _selectPolygonObjects(coordinates: any) { + // @ts-expect-error ts-migrate(2339) FIXME: Property 'layerIds' does not exist on type 'Compos... Remove this comment to see the full error message const { layerIds, onSelect } = this.props; - // @ts-ignore const mousePoints = coordinates[0].map((c) => this.context.viewport.project(c)); const allX = mousePoints.map((mousePoint) => mousePoint[0]); @@ -119,7 +117,6 @@ export default class SelectionLayer extends CompositeLayer { // HACK, find a better way setTimeout(() => { - // @ts-ignore const pickingInfos = this.context.deck.pickObjects({ x, y, @@ -137,7 +134,9 @@ export default class SelectionLayer extends CompositeLayer { renderLayers() { const { pendingPolygonSelection } = this.state; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectionType' does not exist on type 'C... Remove this comment to see the full error message const mode = MODE_MAP[this.props.selectionType] || ViewMode; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectionType' does not exist on type 'C... Remove this comment to see the full error message const modeConfig = MODE_CONFIG_MAP[this.props.selectionType]; const inheritedProps = {}; @@ -158,8 +157,10 @@ export default class SelectionLayer extends CompositeLayer { if (editType === 'addFeature') { const { coordinates } = updatedData.features[0].geometry; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectionType' does not exist on type 'C... Remove this comment to see the full error message if (this.props.selectionType === SELECTION_TYPE.RECTANGLE) { this._selectRectangleObjects(coordinates); + // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectionType' does not exist on type 'C... Remove this comment to see the full error message } else if (this.props.selectionType === SELECTION_TYPE.POLYGON) { this._selectPolygonObjects(coordinates); } @@ -173,8 +174,8 @@ export default class SelectionLayer extends CompositeLayer { if (pendingPolygonSelection) { const { bigPolygon } = pendingPolygonSelection; layers.push( + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'PolygonLayer' is not assi... Remove this comment to see the full error message return super.handlePointerMove(this.makeElevatedEvent(event, position)); } handleStopDragging(event: StopDraggingEvent): EditAction | null | undefined { const editHandle = getPickedEditHandle(event.picks); const position = editHandle ? editHandle.position : event.groundCoords; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Record' is not assi... Remove this comment to see the full error message return super.handleStopDragging(this.makeElevatedEvent(event, position)); } diff --git a/modules/layers/src/mode-handlers/mode-handler.ts b/modules/layers/src/mode-handlers/mode-handler.ts index 91d700a0c..13201ca45 100644 --- a/modules/layers/src/mode-handlers/mode-handler.ts +++ b/modules/layers/src/mode-handlers/mode-handler.ts @@ -229,10 +229,10 @@ export class ModeHandler { if (modeConfig.booleanOperation === 'union') { updatedGeometry = turfUnion(selectedFeature, feature); } else if (modeConfig.booleanOperation === 'difference') { - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Feature' is not assignable to pa... Remove this comment to see the full error message updatedGeometry = turfDifference(selectedFeature, feature); } else if (modeConfig.booleanOperation === 'intersection') { - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Feature' is not assignable to pa... Remove this comment to see the full error message updatedGeometry = turfIntersect(selectedFeature, feature); } else { // eslint-disable-next-line no-console,no-undef @@ -302,7 +302,7 @@ export function getIntermediatePosition(position1: Position, position2: Position (position1[0] + position2[0]) / 2.0, (position1[1] + position2[1]) / 2.0, ]; - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'number[]' is not assignable to type 'Positio... Remove this comment to see the full error message return intermediatePosition; } @@ -365,7 +365,7 @@ export function getEditHandlesForGeometry( break; default: - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'type' does not exist on type 'never'. throw Error(`Unhandled geometry type: ${geometry.type}`); } diff --git a/modules/layers/src/mode-handlers/modify-handler.ts b/modules/layers/src/mode-handlers/modify-handler.ts index e5bea5582..b000125ba 100644 --- a/modules/layers/src/mode-handlers/modify-handler.ts +++ b/modules/layers/src/mode-handlers/modify-handler.ts @@ -62,7 +62,7 @@ export class ModifyHandler extends ModeHandler { const lineStringFeature = toLineString(lineString); const candidateIntermediatePoint = this.nearestPointOnLine( - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Feature, snapPoint: Position): PointerMoveEvent { - // @ts-ignore + // @ts-expect-error ts-migrate(2740) FIXME: Type 'Record & { groundCoords: Positi... Remove this comment to see the full error message return Object.assign({}, event, { groundCoords: snapPoint, pointerDownGroundCoords: this._startDragSnapHandlePosition, @@ -152,7 +152,7 @@ export class SnappableHandler extends ModeHandler { } handleStopDragging(event: StopDraggingEvent): EditAction | null | undefined { - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Record' is not assi... Remove this comment to see the full error message const modeActionSummary = this._handler.handleStopDragging(this._getSnapAwareEvent(event)); this._editHandlePicks = null; @@ -171,7 +171,7 @@ export class SnappableHandler extends ModeHandler { if (enableSnapping) { this._editHandlePicks = this._getEditHandlePicks(event); } - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Record' is not assi... Remove this comment to see the full error message const modeActionSummary = this._handler.handlePointerMove(this._getSnapAwareEvent(event)); const { editAction } = modeActionSummary; if (editAction) { diff --git a/modules/layers/src/mode-handlers/split-polygon-handler.ts b/modules/layers/src/mode-handlers/split-polygon-handler.ts index 5cef70bde..6ba32ebf3 100644 --- a/modules/layers/src/mode-handlers/split-polygon-handler.ts +++ b/modules/layers/src/mode-handlers/split-polygon-handler.ts @@ -23,7 +23,7 @@ export class SplitPolygonHandler extends ModeHandler { // if first point is clicked, then find closest polygon point and build ~90deg vector const firstPoint = clickSequence[0]; const selectedGeometry = this.getSelectedGeometry(); - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Geometry' is not assignable to p... Remove this comment to see the full error message const feature = turfPolygonToLine(selectedGeometry); const lines = feature.type === 'FeatureCollection' ? feature.features : [feature]; @@ -82,11 +82,11 @@ export class SplitPolygonHandler extends ModeHandler { type: 'Point', coordinates: clickSequence[clickSequence.length - 1], }; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ type: string; coordinates: Pos... Remove this comment to see the full error message const isPointInPolygon = booleanPointInPolygon(pt, selectedGeometry); if (clickSequence.length > 1 && tentativeFeature && !isPointInPolygon) { this.resetClickSequence(); - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Feature' is not assignable to pa... Remove this comment to see the full error message const isLineInterectingWithPolygon = lineIntersect(tentativeFeature, selectedGeometry); if (isLineInterectingWithPolygon.features.length === 0) { this._setTentativeFeature(null); @@ -132,9 +132,9 @@ export class SplitPolygonHandler extends ModeHandler { gap = 0.1; units = 'centimeters'; } - // @ts-ignore + // @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call. const buffer = turfBuffer(tentativeFeature, gap, { units }); - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Geometry' is not assignable to p... Remove this comment to see the full error message const updatedGeometry = turfDifference(selectedGeometry, buffer); this._setTentativeFeature(null); if (!updatedGeometry) { @@ -147,11 +147,10 @@ export class SplitPolygonHandler extends ModeHandler { let updatedCoordinates = []; if (type === 'Polygon') { // Update the coordinates as per Multipolygon - // @ts-ignore updatedCoordinates = coordinates.map((c) => [c]); } else { // Handle Case when Multipolygon has holes - // @ts-ignore + // @ts-expect-error ts-migrate(2349) FIXME: This expression is not callable. updatedCoordinates = coordinates.reduce((agg, prev) => { prev.forEach((p) => { agg.push([p]); diff --git a/modules/layers/src/mode-handlers/translate-handler.ts b/modules/layers/src/mode-handlers/translate-handler.ts index e308fdb37..d6ddb5b78 100644 --- a/modules/layers/src/mode-handlers/translate-handler.ts +++ b/modules/layers/src/mode-handlers/translate-handler.ts @@ -83,7 +83,7 @@ export class TranslateHandler extends ModeHandler { const direction = turfBearing(p1, p2); const movedFeatures = turfTransformTranslate( - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'FeatureCollection' is not assign... Remove this comment to see the full error message this._geometryBeforeTranslate, distanceMoved, direction @@ -94,6 +94,7 @@ export class TranslateHandler extends ModeHandler { const selectedIndexes = this.getSelectedFeatureIndexes(); for (let i = 0; i < selectedIndexes.length; i++) { const selectedIndex = selectedIndexes[i]; + // @ts-expect-error ts-migrate(2339) FIXME: Property 'features' does not exist on type 'AllGeo... Remove this comment to see the full error message const movedFeature = movedFeatures.features[i]; updatedData = updatedData.replaceGeometry(selectedIndex, movedFeature.geometry); } diff --git a/modules/layers/src/utils.ts b/modules/layers/src/utils.ts index 958077054..46e480eef 100644 --- a/modules/layers/src/utils.ts +++ b/modules/layers/src/utils.ts @@ -94,7 +94,7 @@ export function generatePointsParallelToLinePoints( // Add the distance as the current position moves away from the lineString const p3 = destination(p2, ddistance, orthogonalBearing); const p4 = destination(p1, ddistance, orthogonalBearing); - //@ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'import("/Users/adam.thomann/dev/nebula.gl/no... Remove this comment to see the full error message return [p3.geometry.coordinates, p4.geometry.coordinates]; } @@ -117,7 +117,7 @@ export function nearestPointOnProjectedLine( // Project the line to viewport, then find the nearest point const coordinates: Array> = line.geometry.coordinates as any; const projectedCoords = coordinates.map(([x, y, z = 0]) => wmViewport.project([x, y, z])); - //@ts-ignore + // @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call. const [x, y] = wmViewport.project(inPoint.geometry.coordinates); // console.log('projectedCoords', JSON.stringify(projectedCoords)); @@ -152,7 +152,7 @@ export function nearestPointOnProjectedLine( }; } }); - //@ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'index' does not exist on type '{}'. const { index, x0, y0 } = minPointInfo; const [x1, y1, z1 = 0] = projectedCoords[index - 1]; const [x2, y2, z2 = 0] = projectedCoords[index]; diff --git a/modules/layers/test/lib/layers/elevated-edit-handle-layer.test.ts b/modules/layers/test/lib/layers/elevated-edit-handle-layer.test.ts index cda4edc73..75f195f57 100644 --- a/modules/layers/test/lib/layers/elevated-edit-handle-layer.test.ts +++ b/modules/layers/test/lib/layers/elevated-edit-handle-layer.test.ts @@ -2,12 +2,16 @@ import ElevatedEditHandleLayer from '../../../src/layers/elevated-edit-handle-layer'; +// @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message describe('ElevatedEditHandleLayer tests', () => { + // @ts-expect-error ts-migrate(2593) FIXME: Cannot find name 'test'. Do you need to install ty... Remove this comment to see the full error message test('renderLayers()', () => { - // @ts-ignore + // @ts-expect-error ts-migrate(2555) FIXME: Expected at least 1 arguments, but got 0. const layer = new ElevatedEditHandleLayer(); const render = layer.renderLayers(); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(Array.isArray(render)).toBeTruthy(); + // @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'expect'. expect(render.length).toBe(2); }); }); diff --git a/modules/layers/test/lib/test-utils.ts b/modules/layers/test/lib/test-utils.ts index 5cc2d68df..3d452438d 100644 --- a/modules/layers/test/lib/test-utils.ts +++ b/modules/layers/test/lib/test-utils.ts @@ -314,7 +314,7 @@ export function createPointerDragEvent( screenCoords: [-1, -1], groundCoords, picks, - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type '{ screenCoords: [number, number]; groundCoor... Remove this comment to see the full error message isDragging: true, pointerDownPicks: null, pointerDownScreenCoords: [-1, -1], diff --git a/modules/main/src/lib/deck-renderer/deck-drawer.ts b/modules/main/src/lib/deck-renderer/deck-drawer.ts index 461977127..d68c14a91 100644 --- a/modules/main/src/lib/deck-renderer/deck-drawer.ts +++ b/modules/main/src/lib/deck-renderer/deck-drawer.ts @@ -99,7 +99,7 @@ export default class DeckDrawer { ): { redraw: boolean; deactivate: boolean } { // capture all events (mouse-up is needed to prevent us stuck in moving map) if (event.type !== 'mouseup') event.stopPropagation(); - // @ts-ignore + // @ts-expect-error ts-migrate(2367) FIXME: This condition will always return 'false' since th... Remove this comment to see the full error message this.usePolygon = selectionType === SELECTION_TYPE.POLYGON; let redraw = false; @@ -158,7 +158,7 @@ export default class DeckDrawer { _makeStartPointHighlight(center: [number, number]): number[] { const buffer = turfBuffer(point(center), POLYGON_THRESHOLD / 4.0); - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'Position[][]' is not assignable to type 'num... Remove this comment to see the full error message return turfBboxPolygon(turfBbox(buffer)).geometry.coordinates; } @@ -230,7 +230,6 @@ export default class DeckDrawer { new PolygonLayer({ id: LAYER_ID_VIEW, data, - // @ts-ignore fp64: false, opacity: 1.0, pickable: false, @@ -238,26 +237,25 @@ export default class DeckDrawer { lineWidthMaxPixels: POLYGON_LINE_WIDTH, lineDashJustified: true, getLineDashArray: (x) => POLYGON_DASHES, - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineColor' does not exist on type 'unkno... Remove this comment to see the full error message getLineColor: (obj) => obj.lineColor || [0, 0, 0, 255], - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'fillColor' does not exist on type 'unkno... Remove this comment to see the full error message getFillColor: (obj) => obj.fillColor || [0, 0, 0, 255], - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'polygon' does not exist on type 'unknown... Remove this comment to see the full error message getPolygon: (o) => o.polygon, }), new PolygonLayer({ id: LAYER_ID_PICK, data: dataPick, - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'lineColor' does not exist on type 'unkno... Remove this comment to see the full error message getLineColor: (obj) => obj.lineColor || [0, 0, 0, 255], - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'fillColor' does not exist on type 'unkno... Remove this comment to see the full error message getFillColor: (obj) => obj.fillColor || [0, 0, 0, 255], - // @ts-ignore fp64: false, opacity: 1.0, stroked: false, pickable: true, - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'polygon' does not exist on type 'unknown... Remove this comment to see the full error message getPolygon: (o) => o.polygon, }), ]; diff --git a/modules/main/src/lib/feature.ts b/modules/main/src/lib/feature.ts index 17ecf669c..8ac6cc570 100644 --- a/modules/main/src/lib/feature.ts +++ b/modules/main/src/lib/feature.ts @@ -22,7 +22,7 @@ export default class Feature { } getCoords(): any { - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'coordinates' does not exist on type 'Geo... Remove this comment to see the full error message return this.geoJson.geometry.coordinates; } } diff --git a/modules/main/src/lib/layers/junctions-layer.ts b/modules/main/src/lib/layers/junctions-layer.ts index 91ed60c25..39b9e2fb8 100644 --- a/modules/main/src/lib/layers/junctions-layer.ts +++ b/modules/main/src/lib/layers/junctions-layer.ts @@ -20,7 +20,7 @@ export default class JunctionsLayer extends NebulaLayer { id: `junctions-${this.id}`, data: objects, opacity: 1, - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ id: string; data: any[]; opaci... Remove this comment to see the full error message fp64: false, pickable: true, getPosition: (nf) => nf.geoJson.geometry.coordinates, diff --git a/modules/main/src/lib/layers/segments-layer.ts b/modules/main/src/lib/layers/segments-layer.ts index 4edea565d..439bfda3c 100644 --- a/modules/main/src/lib/layers/segments-layer.ts +++ b/modules/main/src/lib/layers/segments-layer.ts @@ -75,7 +75,7 @@ export default class SegmentsLayer extends NebulaLayer { id: `segments-${this.id}`, data: objects, opacity: 1, - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ id: string; data: any[]; opaci... Remove this comment to see the full error message fp64: false, rounded: this.rounded, pickable: true, @@ -86,12 +86,12 @@ export default class SegmentsLayer extends NebulaLayer { blendEquation: GL.MAX, }, getPath: (nf: any) => nf.geoJson.geometry.coordinates, - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number[]' is not assignable to p... Remove this comment to see the full error message getColor: (nf: any) => toDeckColor(nf.style.lineColor, defaultColor), getWidth: (nf: any) => nf.style.lineWidthMeters || 1, getZLevel: (nf: any) => nf.style.zLevel * 255, getDirection: (nf: any) => NEBULA_TO_DECK_DIRECTIONS[nf.style.arrowStyle], - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number[]' is not assignable to p... Remove this comment to see the full error message getMarkerColor: (nf: any) => toDeckColor(nf.style.arrowColor, defaultColor), getMarkerPercentages: this._calcMarkerPercentages, updateTriggers: { all: updateTrigger }, diff --git a/modules/main/src/lib/layers/texts-layer.ts b/modules/main/src/lib/layers/texts-layer.ts index 01158ae14..4e4d45cd9 100644 --- a/modules/main/src/lib/layers/texts-layer.ts +++ b/modules/main/src/lib/layers/texts-layer.ts @@ -25,9 +25,11 @@ export default class TextsLayer extends NebulaLayer { fp64: false, pickable: false, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'style' does not exist on type 'unknown'. getText: (nf) => nf.style.text, + // @ts-expect-error ts-migrate(2339) FIXME: Property 'geoJson' does not exist on type 'unknown... Remove this comment to see the full error message getPosition: (nf) => nf.geoJson.geometry.coordinates, - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type '(nf: unknown) => number[]' is not assignable... Remove this comment to see the full error message getColor: (nf) => toDeckColor(nf.style.fillColor) || defaultColor, // TODO: layer should offer option to scale with zoom diff --git a/modules/main/src/lib/nebula-layer.ts b/modules/main/src/lib/nebula-layer.ts index dc2aa741a..0f83ed6bf 100644 --- a/modules/main/src/lib/nebula-layer.ts +++ b/modules/main/src/lib/nebula-layer.ts @@ -23,7 +23,6 @@ export default class NebulaLayer extends Event.EventEmitter { this.helperLayers = []; if (on) { - // @ts-ignore Object.keys(on).forEach((key) => this.on(key, on[key])); } } diff --git a/modules/main/src/lib/nebula.ts b/modules/main/src/lib/nebula.ts index 066befde1..e71c5c917 100644 --- a/modules/main/src/lib/nebula.ts +++ b/modules/main/src/lib/nebula.ts @@ -43,7 +43,7 @@ export default class Nebula { _mouseWasDown: boolean; wmViewport: WebMercatorViewport; queryObjectEvents: EventEmitter = new EventEmitter(); - forceUpdate: Function; + forceUpdate: () => void; inited: boolean; log(message: string) { @@ -152,7 +152,7 @@ export default class Nebula { } unprojectMousePosition(mousePosition: [number, number]): [number, number] { - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'any[]' is not assignable to type '[number, n... Remove this comment to see the full error message return this.wmViewport.unproject(mousePosition); } @@ -169,7 +169,7 @@ export default class Nebula { const lngLat = this.getMouseGroundPosition(event); if (eventFilter && !eventFilter(lngLat, event)) return; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'any[]' is not assignable to para... Remove this comment to see the full error message const drawerResult = this._deckDrawer.handleEvent(event, lngLat, selectionType); if (drawerResult.redraw) this.forceUpdate(); return; @@ -215,7 +215,7 @@ export default class Nebula { if (original) { this.deckglMouseOverInfo = { originalLayer: deckLayer.props.nebulaLayer, index }; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Record' is not assi... Remove this comment to see the full error message const nebulaMouseEvent = new LayerMouseEvent(event, { data: original, metadata: object.metadata, @@ -241,7 +241,7 @@ export default class Nebula { if (eventFilter && !eventFilter(lngLat, event)) return; // send to layers first - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Record' is not assi... Remove this comment to see the full error message const nebulaMouseEvent = new LayerMouseEvent(event, { groundPoint: lngLat, nebula: this, diff --git a/modules/overlays/src/html-overlay-item.tsx b/modules/overlays/src/html-overlay-item.tsx index 1161aa9cc..8a7f02347 100644 --- a/modules/overlays/src/html-overlay-item.tsx +++ b/modules/overlays/src/html-overlay-item.tsx @@ -23,7 +23,7 @@ export default class HtmlOverlayItem extends React.Component { const { x, y, children, style, coordinates, ...props } = this.props; return ( - //@ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type '{ left: number; top: number; position: strin... Remove this comment to see the full error message
{children}
diff --git a/modules/overlays/src/html-overlay.tsx b/modules/overlays/src/html-overlay.tsx index 194e7fa56..189f733d7 100644 --- a/modules/overlays/src/html-overlay.tsx +++ b/modules/overlays/src/html-overlay.tsx @@ -71,5 +71,5 @@ export default class HtmlOverlay extends React.Component< } // This is needed for Deck.gl 8.0+ -//@ts-ignore +// @ts-expect-error ts-migrate(2339) FIXME: Property 'deckGLViewProps' does not exist on type ... Remove this comment to see the full error message HtmlOverlay.deckGLViewProps = true; diff --git a/modules/react-map-gl-draw/src/edit-modes/base-mode.ts b/modules/react-map-gl-draw/src/edit-modes/base-mode.ts index 3b04a4a95..d280b807f 100644 --- a/modules/react-map-gl-draw/src/edit-modes/base-mode.ts +++ b/modules/react-map-gl-draw/src/edit-modes/base-mode.ts @@ -63,7 +63,7 @@ export default class BaseMode implements EditMode { return { type: 'Feature', @@ -85,7 +85,6 @@ export default class BaseMode implements EditMode, featureIndex: number | null | undefined) { const { data, selectedIndexes } = props; - // @ts-ignore const features = data && data.features; const selectedIndex = isNumeric(featureIndex) diff --git a/modules/react-map-gl-draw/src/edit-modes/editing-mode.ts b/modules/react-map-gl-draw/src/edit-modes/editing-mode.ts index f1ecc520b..07faeffd0 100644 --- a/modules/react-map-gl-draw/src/edit-modes/editing-mode.ts +++ b/modules/react-map-gl-draw/src/edit-modes/editing-mode.ts @@ -22,12 +22,12 @@ export default class EditingMode extends BaseMode { handleClick(event: ClickEvent, props: ModeProps) { const picked = event.picks && event.picks[0]; const selectedFeatureIndex = props.selectedIndexes && props.selectedIndexes[0]; - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'featureIndex' does not exist on type 'Pi... Remove this comment to see the full error message if (!picked || !picked.object || picked.featureIndex !== selectedFeatureIndex) { return; } - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'type' does not exist on type 'Pick'. const { type: objectType, featureIndex, index } = picked; const feature = this.getSelectedFeature(props, featureIndex); @@ -41,14 +41,14 @@ export default class EditingMode extends BaseMode { if (!coordinates) { return; } - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'length' does not exist on type 'number |... Remove this comment to see the full error message const insertIndex = (index + 1) % coordinates.length; const positionIndexes = feature.geometry.type === SHAPE.POLYGON ? [0, insertIndex] : [insertIndex]; const insertMapCoords = this._getPointOnSegment(feature, picked, event.mapCoords); const updatedData = new ImmutableFeatureCollection(props.data) - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number[]' is not assignable to p... Remove this comment to see the full error message .addPosition(featureIndex, positionIndexes, insertMapCoords) .getObject(); @@ -59,7 +59,7 @@ export default class EditingMode extends BaseMode { { featureIndex, editHandleIndex: insertIndex, - // @ts-ignore + // @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call. screenCoords: props.viewport && props.viewport.project(insertMapCoords), mapCoords: insertMapCoords, }, @@ -72,7 +72,7 @@ export default class EditingMode extends BaseMode { // replace point const picked = event.picks && event.picks[0]; - // @ts-ignore + // @ts-expect-error ts-migrate(2551) FIXME: Property 'Object' does not exist on type 'Pick'. D... Remove this comment to see the full error message if (!picked || !picked.Object || !isNumeric(picked.featureIndex)) { return; } @@ -94,20 +94,20 @@ export default class EditingMode extends BaseMode { props: ModeProps ) { const { onEdit } = props; - // @ts-ignore + // @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. const selectedFeature = this.getSelectedFeature(props); // nothing clicked - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'isDragging' does not exist on type 'Poin... Remove this comment to see the full error message const { isDragging, pointerDownPicks, screenCoords } = event; const { lastPointerMoveEvent } = props; const clicked = pointerDownPicks && pointerDownPicks[0]; - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'featureIndex' does not exist on type 'Pi... Remove this comment to see the full error message if (!clicked || !clicked.object || !isNumeric(clicked.featureIndex)) { return; } - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'type' does not exist on type 'Pick'. const { type: objectType, index: editHandleIndex } = clicked; // not dragging @@ -154,12 +154,12 @@ export default class EditingMode extends BaseMode { handlePointerMove(event: PointerMoveEvent, props: ModeProps) { // no selected feature - // @ts-ignore + // @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. const selectedFeature = this.getSelectedFeature(props); if (!selectedFeature) { return; } - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'isDragging' does not exist on type 'Poin... Remove this comment to see the full error message if (!event.isDragging) { return; } @@ -180,6 +180,7 @@ export default class EditingMode extends BaseMode { return null; } + // @ts-expect-error ts-migrate(2548) FIXME: Type 'number | [number, number] | [number, number,... Remove this comment to see the full error message let newCoordinates = [...coordinates]; switch (type) { @@ -196,10 +197,8 @@ export default class EditingMode extends BaseMode { case 'feature': const { dx, dy } = options; - // @ts-ignore newCoordinates = newCoordinates .map((mapCoords) => { - // @ts-ignore const pixels = viewport && viewport.project(mapCoords); if (pixels) { pixels[0] += dx; @@ -226,7 +225,7 @@ export default class EditingMode extends BaseMode { case 'rectangle': // moved editHandleIndex and destination mapCoords newCoordinates = updateRectanglePosition( - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Feature' is not assignable to pa... Remove this comment to see the full error message feature, options.editHandleIndex, options.mapCoords @@ -253,7 +252,6 @@ export default class EditingMode extends BaseMode { const srcVertexIndex = picked.index; const targetVertexIndex = picked.index + 1; return findClosestPointOnLineSegment( - // @ts-ignore coordinates[srcVertexIndex], coordinates[targetVertexIndex], pickedMapCoords @@ -268,11 +266,11 @@ export default class EditingMode extends BaseMode { return null; } - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'isDragging' does not exist on type 'Poin... Remove this comment to see the full error message const { isDragging, picks } = event; // if not pick segment const picked = picks && picks[0]; - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'featureIndex' does not exist on type 'Pi... Remove this comment to see the full error message if (!picked || !isNumeric(picked.featureIndex) || picked.type !== ELEMENT_TYPE.SEGMENT) { return null; } @@ -306,9 +304,9 @@ export default class EditingMode extends BaseMode { }, }; } - // @ts-ignore + // @ts-expect-error ts-migrate(2416) FIXME: Property 'getGuides' in type 'EditingMode' is not ... Remove this comment to see the full error message getGuides(props: ModeProps) { - // @ts-ignore + // @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. const selectedFeature = this.getSelectedFeature(props); const selectedFeatureIndex = props.selectedIndexes && props.selectedIndexes[0]; @@ -324,7 +322,6 @@ export default class EditingMode extends BaseMode { // cursor editHandle const cursorEditHandle = this._getCursorEditHandle(event, selectedFeature); if (cursorEditHandle) { - // @ts-ignore editHandles.push(cursorEditHandle); } diff --git a/modules/react-map-gl-draw/src/edit-modes/utils.ts b/modules/react-map-gl-draw/src/edit-modes/utils.ts index 1ff51a6e7..855d3c12b 100644 --- a/modules/react-map-gl-draw/src/edit-modes/utils.ts +++ b/modules/react-map-gl-draw/src/edit-modes/utils.ts @@ -102,7 +102,7 @@ export function updateRectanglePosition( if (!coordinates) { return null; } - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'slice' does not exist on type 'number | ... Remove this comment to see the full error message const points = coordinates.slice(0, 4); points[editHandleIndex % 4] = mapCoords; diff --git a/modules/react-map-gl-draw/src/editor.tsx b/modules/react-map-gl-draw/src/editor.tsx index e0bceb156..7aeed6128 100644 --- a/modules/react-map-gl-draw/src/editor.tsx +++ b/modules/react-map-gl-draw/src/editor.tsx @@ -71,7 +71,7 @@ export default class Editor extends ModeHandler { ) { return RENDER_STATE.SELECTED; } - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'type' does not exist on type 'Pick'. if (hovered && hovered.type === ELEMENT_TYPE.EDIT_HANDLE) { if (hovered.index === editHandleIndex) { return RENDER_STATE.HOVERED; @@ -99,7 +99,7 @@ export default class Editor extends ModeHandler { if (index === selectedFeatureIndex) { return RENDER_STATE.SELECTED; } - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'type' does not exist on type 'Pick'. if (hovered && hovered.type === ELEMENT_TYPE.FEATURE && hovered.featureIndex === index) { return RENDER_STATE.HOVERED; } @@ -133,7 +133,7 @@ export default class Editor extends ModeHandler { feature: feature || editHandle, index, featureIndex, - // @ts-ignore + // @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. state: this._getEditHandleState(editHandle), }); @@ -142,7 +142,7 @@ export default class Editor extends ModeHandler { index, featureIndex, shape, - // @ts-ignore + // @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. state: this._getEditHandleState(editHandle), }); @@ -301,7 +301,7 @@ export default class Editor extends ModeHandler { let committedPath; let uncommittedPath; let closingPath; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type '[number, number] | [number, numb... Remove this comment to see the full error message const fill = this._renderFill('tentative', coordinates, uncommittedStyle); const type = shape || geojsonType; @@ -314,24 +314,22 @@ export default class Editor extends ModeHandler { }); if (cursorEditHandle) { - // @ts-ignore const cursorCoords = coordinates[coordinates.length - 2]; committedPath = this._renderSegments( 'tentative', - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number[] | (Position | LineStrin... Remove this comment to see the full error message coordinates.slice(0, coordinates.length - 1), committedStyle ); uncommittedPath = this._renderSegment( 'tentative-uncommitted', - // @ts-ignore coordinates.length - 2, - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'number | Position | LineStringCoordinates | ... Remove this comment to see the full error message [cursorCoords, lastCoords], uncommittedStyle ); } else { - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type '[number, number] | [number, numb... Remove this comment to see the full error message committedPath = this._renderSegments('tentative', coordinates, committedStyle); } @@ -344,9 +342,8 @@ export default class Editor extends ModeHandler { closingPath = this._renderSegment( 'tentative-closing', - // @ts-ignore coordinates.length - 1, - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'number | Position | LineStringCoordinates | ... Remove this comment to see the full error message [lastCoords, firstCoords], closingStyle ); @@ -357,7 +354,7 @@ export default class Editor extends ModeHandler { case SHAPE.RECTANGLE: uncommittedPath = this._renderSegments( 'tentative', - // @ts-ignore + // @ts-expect-error ts-migrate(2322) FIXME: Type 'number | Position | LineStringCoordinates | ... Remove this comment to see the full error message [...coordinates, firstCoords], uncommittedStyle ); @@ -403,7 +400,7 @@ export default class Editor extends ModeHandler { }; _renderPoint = (feature: Feature, index: number, path: string) => { - // @ts-ignore + // @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. const renderState = this._getFeatureRenderState(index); const { featureStyle, featureShape, clickRadius } = this.props; const shape = this._getStyleProp(featureShape, { feature, index, state: renderState }); @@ -465,14 +462,14 @@ export default class Editor extends ModeHandler { const { featureStyle, clickRadius } = this.props; const selectedFeatureIndex = this._getSelectedFeatureIndex(); const selected = index === selectedFeatureIndex; - // @ts-ignore + // @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. const renderState = this._getFeatureRenderState(index); const style = this._getStyleProp(featureStyle, { feature, index, state: renderState }); const elemKey = `feature.${index}`; if (selected) { return ( - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'Position | LineStringCoordinates... Remove this comment to see the full error message {this._renderSegments(index, feature.geometry.coordinates, style)} ); } @@ -507,7 +504,7 @@ export default class Editor extends ModeHandler { const { featureStyle } = this.props; const selectedFeatureIndex = this._getSelectedFeatureIndex(); const selected = index === selectedFeatureIndex; - // @ts-ignore + // @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. const renderState = this._getFeatureRenderState(index); const style = this._getStyleProp(featureStyle, { feature, index, state: renderState }); @@ -520,10 +517,10 @@ export default class Editor extends ModeHandler { return ( {// eslint-disable-next-line prettier/prettier - //@ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number | [number, number] | [num... Remove this comment to see the full error message this._renderFill(index, coordinates, style)} {// eslint-disable-next-line prettier/prettier - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number | [number, number] | [num... Remove this comment to see the full error message this._renderSegments(index, coordinates, style)} ); @@ -542,7 +539,7 @@ export default class Editor extends ModeHandler { _renderFeature = (feature: Feature, index: number) => { const coordinates = getFeatureCoordinates(feature); - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'length' does not exist on type 'number |... Remove this comment to see the full error message if (!coordinates || !coordinates.length) { return null; } @@ -552,7 +549,7 @@ export default class Editor extends ModeHandler { } = feature; const shape = properties?.shape; - // @ts-ignore + // @ts-expect-error ts-migrate(2345) FIXME: Argument of type '"Point" | "LineString" | "Polygo... Remove this comment to see the full error message const path = this._getPathInScreenCoords(coordinates, geojsonType); if (!path) { return null; @@ -595,7 +592,7 @@ export default class Editor extends ModeHandler { _render = () => { const viewport = (this._context && this._context.viewport) || {}; const { style } = this.props; - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'width' does not exist on type '{}'. const { width = 0, height = 0 } = viewport; return (
{ const modeProps = this.getModeProps(); // TODO refactor EditingMode - // @ts-ignore if (this._modeHandler instanceof EditingMode || this.props.selectable) { const { mapCoords, screenCoords } = event; const pickedObject = event.picks && event.picks[0]; const selectedEditHandleIndexes = [...this.state.selectedEditHandleIndexes]; - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'featureIndex' does not exist on type 'Pi... Remove this comment to see the full error message if (pickedObject && isNumeric(pickedObject.featureIndex)) { const handleIndex = - // @ts-ignore + // @ts-expect-error ts-migrate(2339) FIXME: Property 'type' does not exist on type 'Pick'. pickedObject.type === ELEMENT_TYPE.EDIT_HANDLE ? pickedObject.index : null; const index = selectedEditHandleIndexes.indexOf(handleIndex); if (handleIndex !== null) { @@ -356,14 +355,13 @@ export default class ModeHandler extends React.PureComponent | null | undefined; features?: Feature[] | null | undefined; selectedFeatureIndex?: number | null | undefined; - selectable?: Boolean; + selectable?: boolean; clickRadius?: number; - featureShape?: Function | string; - editHandleShape?: Function | string; - editHandleStyle?: Function | any; - featureStyle?: Function | any; + featureShape?: () => void | string; + editHandleShape?: () => void | string; + editHandleStyle?: () => void | any; + featureStyle?: () => void | any; featuresDraggable?: boolean | null | undefined; - onUpdate?: Function; - onSelect?: Function; - onUpdateCursor?: Function; + onUpdate?: (any) => void; + onSelect?: (selected: any) => void; + onUpdateCursor?: () => void; modeConfig?: any; };