@iminside/react-yandex-maps
Version:
Yandex.Maps API bindings for React
69 lines (68 loc) • 2.26 kB
TypeScript
import React, { CSSProperties } from 'react';
import { WithYMapsProps } from './hocs/withYMaps';
import ymaps from 'yandex-maps';
import { AnyObject, WithInstanceRef } from './util/typing';
import { ErrorBoundaryProps } from './hocs/with-error-boundary';
interface MapProps {
/**
* [Map state parameters](https://tech.yandex.com/maps/doc/jsapi/2.1/ref/reference/Map-docpage/#param-state)
*/
state?: ymaps.IMapState;
/**
* Uncontrolled [Map state parameters](https://tech.yandex.com/maps/doc/jsapi/2.1/ref/reference/Map-docpage/#param-state)
*/
defaultState?: ymaps.IMapState;
/**
* [Map options](https://tech.yandex.com/maps/doc/jsapi/2.1/ref/reference/Map-docpage/#Map__param-options)
*/
options?: ymaps.IMapOptions;
/**
* Uncontrolled [Map options](https://tech.yandex.com/maps/doc/jsapi/2.1/ref/reference/Map-docpage/#Map__param-options)
*/
defaultOptions?: ymaps.IMapOptions;
/**
* Yandex.Maps Map parent element should have at least
* some size set to it, otherwise the map is rendered
* into the container with size 0
*
* To avoid this we will use `width` and `height` props as default
* way of sizing the map element, but then if we see that
* the library user also provides `style` or `className` prop,
* we will assume that the Map is sized by those and will
* not use these
*/
/**
* Map container width
*/
width?: string | number;
/**
* Map container height
*/
height?: string | number;
/**
* Map container style
*/
style?: CSSProperties;
/**
* Map container className
*/
className?: string;
}
export declare class Map extends React.Component<
MapProps & WithYMapsProps & WithInstanceRef & ErrorBoundaryProps
> {
constructor();
componentDidMount(): void;
componentDidUpdate(prevProps: any): void;
componentWillUnmount(): void;
render(): JSX.Element;
static mountObject(parentElement: any, Map: any, props: any): any;
static updateObject(instance: any, oldProps: any, newProps: any): void;
static unmountObject(instance: any, props: any): void;
}
declare const YMapsMap: React.FC<
React.PropsWithChildren<
MapProps & WithYMapsProps & WithInstanceRef & AnyObject & ErrorBoundaryProps
>
>;
export default YMapsMap;