@yandex/ymaps3-types
Version:
Types for ymaps3 maps library
44 lines (43 loc) • 1.34 kB
TypeScript
import type { RasterLayerOptions } from "../../common/types";
import { YMapEntity } from "../YMapEnities";
import type { LayerImplementationClasses } from "../../common/types/layer-implementation";
/**
* YMapLayer props
*/
type YMapLayerProps = {
/** Layer id */
id?: string;
/** Layer type. For tile data sources should use 'ground' */
type: string;
/** Layer source */
source?: string;
/** Layer z-index to control order. Default is 1500 */
zIndex?: number;
/** Layer id to control order in parent group */
grouppedWith?: string;
/** Layer options */
options?: {
raster?: RasterLayerOptions;
};
/** Method, allows you to define your own implementation of the layer */
implementation?: LayerImplementationClasses;
};
declare const defaultProps: Readonly<{
zIndex: 1500;
}>;
type DefaultProps = typeof defaultProps & {
id: string;
};
/**
* Map layer.
*/
declare class YMapLayer extends YMapEntity<YMapLayerProps, DefaultProps> {
static defaultProps: Readonly<{
zIndex: 1500;
}>;
protected _getDefaultProps(props: YMapLayerProps): DefaultProps;
protected _onAttach(): void;
protected _onDetach(): void;
protected _onUpdate(propsDiff: Partial<YMapLayerProps>, oldProps: YMapLayerProps): void;
}
export { YMapLayer, YMapLayerProps };