Add missing types for module 'ol/interaction/extent' for openlayers@4.6.5

This commit is contained in:
SirMcPotato
2018-12-26 23:33:46 +01:00
parent 72810f1a57
commit f41cb80557
2 changed files with 81 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
import * as ol from 'openlayers';
export default ol.interaction.Extent;
+78
View File
@@ -5349,6 +5349,76 @@ export namespace interaction {
static createRegularPolygon(opt_sides?: number, opt_angle?: number): ol.DrawGeometryFunctionType;
}
namespace Extent {
/**
* @classdesc
* Events emitted by {@link ol.interaction.Extent} instances are instances of
* this type.
*
* @param extent the new extent
*/
class Event extends events.Event {
/**
* @classdesc
* Events emitted by {@link ol.interaction.Extent} instances are instances of
* this type.
*
* @param type Type.
* @param feature The feature drawn.
*/
constructor(type: ExtentEventType, extent: ol.Extent);
/**
* The current extent.
* @api stable
*/
extent: ol.Extent;
}
}
type ExtentEventType = string;
/**
* @classdesc
* Interaction for drawing feature geometries.
*
* @fires ol.interaction.DrawEvent
* @param options Options.
* @api stable
*/
class Extent extends Pointer {
/**
* @classdesc
* Interaction for drawing feature geometries.
*
* @fires ol.interaction.DrawEvent
* @param options Options.
* @api stable
*/
constructor(options: olx.interaction.ExtentOptions);
/**
* @inheritDoc
*/
setMap(map: ol.Map): void;
/**
* Returns the current drawn extent in the view projection
*
* @return Drawn extent in the view projection.
* @api
*/
getExtent(): ol.Extent;
/**
* Manually sets the drawn extent, using the view projection.
*
* @param extent Extent
* @api
*/
setExtent(extent: ol.Extent): void;
}
/**
* Set of interactions included in maps by default. Specific interactions can be
* excluded by setting the appropriate option to false in the constructor
@@ -11788,6 +11858,14 @@ export namespace olx {
wrapX?: boolean;
}
interface ExtentOptions {
extent?: ol.Extent;
boxStyle?: (ol.style.Style | ol.style.Style[] | ol.StyleFunction);
pixelTolerance?: number;
pointerStyle?: (ol.style.Style | ol.style.Style[] | ol.StyleFunction);
wrapX?: boolean;
}
interface TranslateOptions {
features?: ol.Collection<ol.Feature>;
layers?: (ol.layer.Layer[] | ((layer: ol.layer.Layer) => boolean));