UNPKG

@iminside/react-yandex-maps

Version:
92 lines (91 loc) 2.86 kB
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 PanoramaOptions { autoFitToViewport?: 'none' | 'ifNull' | 'always' | undefined; controls?: string[] | undefined; direction?: number[] | string | undefined; hotkeysEnabled?: boolean | undefined; scrollZoomBehavior?: boolean | undefined; span?: number[] | string | undefined; suppressMapOpenBlock?: boolean | undefined; } interface PanoramaProps { /** * [Panorama options](https://tech.yandex.com/maps/doc/jsapi/2.1/ref/reference/panorama.Player-docpage/#panorama.Player__param-options) */ options?: PanoramaOptions; /** * Uncontrolled [Panorama options](https://tech.yandex.com/maps/doc/jsapi/2.1/ref/reference/panorama.Player-docpage/#panorama.Player__param-options) */ defaultOptions?: PanoramaOptions; /** * The point for searching for nearby panoramas. */ point?: number[]; /** * Uncontrolled point for searching for nearby panoramas. */ defaultPoint?: number[]; /** * Panorama [locate options](https://tech.yandex.com/maps/doc/jsapi/2.1/ref/reference/panorama.locate-docpage/#panorama.locate__param-options) */ locateOptions?: { layer: ymaps.panorama.Layer; }; /** * Yandex.Maps Panorama parent element should have at least * some size set to it, otherwise the panorama is rendered * into the container with size 0 * * To avoid this we will use `width` and `height` props as default * way of sizing the panorama element, but then if we see that * the library user also provides `style` or `className` prop, * we will assume that the panorama is sized by those and will * not use these */ /** * Panorama container width */ width?: string | number; /** * Panorama container height */ height?: string | number; /** * Panorama container style */ style?: CSSProperties; /** * Panorama container className */ className?: string; } export declare class Panorama extends React.Component< PanoramaProps & WithYMapsProps & WithInstanceRef & ErrorBoundaryProps > { constructor(); componentDidMount(): void; componentDidUpdate(prevProps: any): void; componentWillUnmount(): void; render(): JSX.Element; static mountObject( parentElement: any, panorama: any, props: any ): Promise<unknown>; static updateObject(instance: any, oldProps: any, newProps: any): void; static unmountObject(instance: any, props: any): void; } declare const YMapsPanorama: React.FC< React.PropsWithChildren< PanoramaProps & WithYMapsProps & WithInstanceRef & AnyObject & ErrorBoundaryProps > >; export default YMapsPanorama;