Skip to content

Commit

Permalink
More TS error suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
athomann committed Oct 15, 2021
1 parent 1972c61 commit 1f906f8
Show file tree
Hide file tree
Showing 29 changed files with 655 additions and 722 deletions.
12 changes: 6 additions & 6 deletions examples/advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"styled-components": "^4.3.2"
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-export-default-from": "^7.8.3",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "7.9.0",
"@babel/core": "^7.15.8",
"@babel/plugin-proposal-class-properties": "7.14.5",
"@babel/plugin-proposal-export-default-from": "7.14.5",
"@babel/preset-env": "7.15.8",
"@babel/preset-react": "7.14.5",
"@babel/preset-typescript": "7.15.0",
"babel-loader": "^8.1.0",
"html-webpack-plugin": "^3.2.0",
"url-loader": "^1.0.1",
Expand Down
11 changes: 8 additions & 3 deletions examples/advanced/src/example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function getEditHandleTypeFromEitherLayer(handleOrFeature) {
return handleOrFeature.type;
}

function getEditHandleColor(handle: {}) {
function getEditHandleColor(handle: object) {
switch (getEditHandleTypeFromEitherLayer(handle)) {
case 'existing':
return [0xff, 0x80, 0x00, 0xff];
Expand All @@ -204,7 +204,7 @@ function getEditHandleColor(handle: {}) {
}

export default class Example extends React.Component<
{},
unknown,
{
viewport: Record<string, any>;
testFeatures: any;
Expand All @@ -223,7 +223,7 @@ export default class Example extends React.Component<
};
}
> {
constructor(props: {}) {
constructor(props: unknown) {
super(props);

this.state = {
Expand Down Expand Up @@ -594,6 +594,7 @@ export default class Example extends React.Component<
if (POLYGON_DRAWING_MODES.indexOf(this.state.mode) > -1) {
controls.push(this._renderBooleanOperationControls());
}
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'typeof GeoJsonEditMode' is not a... Remove this comment to see the full error message
if (TWO_CLICK_POLYGON_MODES.indexOf(this.state.mode) > -1) {
controls.push(this._renderTwoClickPolygonControls());
}
Expand Down Expand Up @@ -918,6 +919,7 @@ export default class Example extends React.Component<
});
}

// @ts-expect-error expected 0 arguments, but got 1
const editableGeoJsonLayer = new EditableGeoJsonLayer({
id: 'geojson',
data: testFeatures,
Expand Down Expand Up @@ -1000,8 +1002,10 @@ export default class Example extends React.Component<

if (this.state.selectionTool) {
layers.push(
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'SelectionLayer' is not assignabl... Remove this comment to see the full error message
new SelectionLayer({
id: 'selection',
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ id: string; selectionType: str... Remove this comment to see the full error message
selectionType: this.state.selectionTool,
onSelect: ({ pickingInfos }) => {
this.setState({ selectedFeatureIndexes: pickingInfos.map((pi) => pi.index) });
Expand All @@ -1024,6 +1028,7 @@ export default class Example extends React.Component<
// @ts-expect-error ts-migrate(2559) FIXME: Type '{ height: any; width: any; }' has no propert... Remove this comment to see the full error message
viewState={viewport}
getCursor={editableGeoJsonLayer.getCursor.bind(editableGeoJsonLayer)}
// @ts-expect-error ts-migrate(2322) FIXME: Type 'EditableGeoJsonLayer[]' is not assignable to... Remove this comment to see the full error message
layers={layers}
height="100%"
width="100%"
Expand Down
Loading

0 comments on commit 1f906f8

Please sign in to comment.