Skip to content

Commit

Permalink
feat(typings): improve IPlacemarkOptions, add constructor for geometr…
Browse files Browse the repository at this point in the history
…yEditor.Point and layout.Image (#148)

* feat(typings): add constructor in geometryEditor.Point class

#144

* feat(typings): add constructor in layout.Image class

#144

* feat(typings): change extended interface for IPlacemarkOptions, make Placemark.properties optional

closes #144

* fix(typings): replace layout.ImageWithContent with layout.IImageWithContentOptionsWithIconPrefix

#144
  • Loading branch information
ddubrava committed Oct 29, 2021
1 parent 549d0c1 commit 1397284
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions projects/angular8-yandex-maps/src/lib/typings/yandex-maps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1984,6 +1984,15 @@ declare namespace ymaps {
}

class Point implements IGeometryEditor {
constructor(
geometry: IPointGeometry,
options?: {
dblClickHandler?: (ref: any) => void;
drawingCursor?: string;
drawOver?: boolean;
},
);

events: IEventManager;

geometry: IGeometry;
Expand Down Expand Up @@ -2203,7 +2212,25 @@ declare namespace ymaps {
}
}

interface IImageOptions {
imageClipRect?: number[][] | undefined;
imageHref?: string | undefined;
imageOffset?: number[] | undefined;
imageSize?: number[] | undefined;
shape?: IShape | object | null | undefined;
}

interface IImageOptionsWithIconPrefix {
iconImageClipRect?: number[][] | undefined;
iconImageHref?: string | undefined;
iconImageOffset?: number[] | undefined;
iconImageSize?: number[] | undefined;
iconShape?: IShape | object | null | undefined;
}

class Image implements ILayout {
constructor(data: { options?: IImageOptions });

events: IEventManager;

destroy(): void;
Expand All @@ -2221,14 +2248,6 @@ declare namespace ymaps {
setParentElement(parent: HTMLElement | null): void;
}

interface IImageOptionsWithIconPrefix {
iconImageClipRect?: number[][] | undefined;
iconImageHref?: string | undefined;
iconImageOffset?: number[] | undefined;
iconImageSize?: number[] | undefined;
iconShape?: IShape | object | null | undefined;
}

class ImageWithContent extends Image {}

interface IImageWithContentOptionsWithIconPrefix extends IImageOptionsWithIconPrefix {
Expand Down Expand Up @@ -4177,7 +4196,7 @@ declare namespace ymaps {
hintLayout?: IClassConstructor<ILayout> | string;
hintOffset?: number[];
hintOpenTimeout?: number;
hintPage?: string;
hintPane?: string;
hintZIndex?: number;
}

Expand Down Expand Up @@ -4326,7 +4345,7 @@ declare namespace ymaps {
class Placemark extends GeoObject<IPointGeometry, geometry.Point> {
constructor(
geometry: number[] | object | IPointGeometry,
properties: IPlacemarkProperties | IDataManager,
properties?: IPlacemarkProperties | IDataManager,
options?: IPlacemarkOptions,
);
}
Expand All @@ -4339,14 +4358,14 @@ declare namespace ymaps {
balloonContentHeader?: string;
balloonContentBody?: string;
balloonContentFooter?: string;

[key: string]: any;
}

interface IPlacemarkOptions
extends IBalloonOptionsWithBalloonPrefix,
extends layout.IImageOptionsWithIconPrefix,
layout.IImageWithContentOptionsWithIconPrefix,
layout.IPieChartOptionsWithIconPrefix {
IBalloonOptionsWithBalloonPrefix,
IHintOptionsWithHintPrefix {
cursor?: string;
draggable?: boolean;
hasBalloon?: boolean;
Expand All @@ -4372,6 +4391,8 @@ declare namespace ymaps {
zIndexActive?: number;
zIndexDrag?: number;
zIndexHover?: number;

[key: string]: any;
}

class Polygon extends GeoObject<IPolygonGeometry> {
Expand Down Expand Up @@ -5063,7 +5084,6 @@ declare namespace ymaps {
coordinates: number[] | number[][] | number[][][];
fillRule?: 'evenOdd' | 'nonZero';
radius?: number;

[key: string]: any;
}

Expand Down

0 comments on commit 1397284

Please sign in to comment.