Skip to content

Commit

Permalink
fix(typing): Fix typing issues in geometry controls (#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbourget authored Mar 17, 2022
1 parent e726b0b commit c167a77
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions packages/geo/src/lib/geometry/shared/controls/draw.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { EventsKey } from 'ol/events';
import OlMap from 'ol/Map';
import OlFeature from 'ol/Feature';
import * as OlStyle from 'ol/style';
import { StyleLike as OlStyleLike } from 'ol/style/Style';
import type { default as OlGeometryType } from 'ol/geom/GeometryType';
import OlVectorSource from 'ol/source/Vector';
import OlVectorLayer from 'ol/layer/Vector';
Expand All @@ -23,8 +22,8 @@ export interface DrawControlOptions {
geometryType: typeof OlGeometryType | string;
drawingLayerSource?: OlVectorSource<OlGeometry>;
drawingLayer?: OlVectorLayer<OlVectorSource<OlGeometry>>;
drawingLayerStyle?: OlStyle.Style | ((olFeature: OlFeature<OlGeometry>) => OlStyle.Style);
interactionStyle?: OlStyle.Style | ((olFeature: OlFeature<OlGeometry>) => OlStyle.Style);
drawingLayerStyle?: OlStyleLike;
interactionStyle?: OlStyleLike;
maxPoints?: number;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/geo/src/lib/geometry/shared/controls/modify.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import OlMap from 'ol/Map';
import OlFeature from 'ol/Feature';
import * as OlStyle from 'ol/style';
import { StyleLike as OlStyleLike } from 'ol/style/Style';
import OlVectorSource from 'ol/source/Vector';
import OlVectorLayer from 'ol/layer/Vector';
import OlModify from 'ol/interaction/Modify';
Expand Down Expand Up @@ -31,9 +32,8 @@ import {
export interface ModifyControlOptions {
source?: OlVectorSource<any>;
layer?: OlVectorLayer<any>;
layerStyle?: OlStyle.Style | ((olfeature: OlFeature<any>) => OlStyle.Style);
drawStyle?: OlStyle.Style | ((olfeature: OlFeature<any>) => OlStyle.Style) | OlStyle.Circle |
((olfeature: OlFeature<OlGeometry>) => OlStyle.Circle);
layerStyle?: OlStyleLike;
drawStyle?: OlStyleLike;
modify?: boolean;
translate?: boolean;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/geo/src/lib/geometry/shared/controls/slice.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlMap from 'ol/Map';
import OlFeature from 'ol/Feature';
import OlStyle from 'ol/style/Style';
import { StyleLike as OlStyleLike } from 'ol/style/Style';
import OlVectorSource from 'ol/source/Vector';
import OlVectorLayer from 'ol/layer/Vector';
import type { default as OlGeometry } from 'ol/geom/Geometry';
Expand All @@ -15,8 +15,8 @@ import { DrawControl } from './draw';
export interface SliceControlOptions {
source?: OlVectorSource<OlGeometry>;
layer?: OlVectorLayer<OlVectorSource<OlGeometry>>;
layerStyle?: OlStyle | ((olfeature: OlFeature<OlGeometry>) => OlStyle);
drawStyle?: OlStyle | ((olfeature: OlFeature<OlGeometry>) => OlStyle);
layerStyle?: OlStyleLike;
drawStyle?: OlStyleLike;
}

/**
Expand Down

0 comments on commit c167a77

Please sign in to comment.