@h4wldev/react-naver-maps
Version:
React Navermaps API integration for modern development.
108 lines (105 loc) • 3.44 kB
TypeScript
import * as react from 'react';
import { ReactNode } from 'react';
type MapPaddingOptions = {
top?: number;
right?: number;
bottom?: number;
left?: number;
};
type MapOptions = {
background?: string;
baseTileOpacity?: number;
/**
* @type naver.maps.Bounds | naver.maps.BoundsLiteral | null
*/
bounds?: naver.maps.Bounds | naver.maps.BoundsLiteral | null;
/**
* @type naver.maps.Coord | naver.maps.CoordLiteral
*/
center?: naver.maps.Coord | naver.maps.CoordLiteral;
disableDoubleClickZoom?: boolean;
disableDoubleTapZoom?: boolean;
disableKineticPan?: boolean;
disableTwoFingerTapZoom?: boolean;
draggable?: boolean;
keyboardShortcuts?: boolean;
logoControl?: boolean;
logoControlOptions?: naver.maps.LogoControlOptions;
mapDataControl?: boolean;
mapDataControlOptions?: naver.maps.MapDataControlOptions;
mapTypeControl?: boolean;
mapTypeControlOptions?: naver.maps.MapTypeControlOptions;
mapTypeId?: string;
mapTypes?: naver.maps.MapTypeRegistry;
maxBounds?: naver.maps.Bounds | naver.maps.BoundsLiteral | null;
maxZoom?: number;
minZoom?: number;
padding?: MapPaddingOptions;
pinchZoom?: boolean;
resizeOrigin?: naver.maps.Position;
scaleControl?: boolean;
scaleControlOptions?: naver.maps.ScaleControlOptions;
scrollWheel?: boolean;
size?: naver.maps.Size | naver.maps.SizeLiteral;
overlayZoomEffect?: string | null;
tileSpare?: number;
tileTransition?: boolean;
zoom?: number;
zoomControl?: boolean;
zoomControlOptions?: naver.maps.ZoomControlOptions;
zoomOrigin?: naver.maps.Coord | naver.maps.CoordLiteral | null;
blankTileImage?: string | null;
centerPoint?: naver.maps.Point | naver.maps.PointLiteral;
};
type Uncontrolled = {
/**
* Uncontrolled prop of mapTypeId
*/
defaultMapTypeId?: MapOptions['mapTypeId'];
/**
* Uncontrolled prop of size
* @type naver.maps.Coord | naver.maps.CoordLiteral
*/
defaultSize?: MapOptions['size'];
/**
* Uncontrolled prop of bounds
* @type naver.maps.Bounds | naver.maps.BoundsLiteral | null
*/
defaultBounds?: MapOptions['bounds'];
/**
* Uncontrolled prop of center
* @type naver.maps.Coord | naver.maps.CoordLiteral
*/
defaultCenter?: MapOptions['center'];
/**
* Uncontrolled prop of zoom
*/
defaultZoom?: MapOptions['zoom'];
/**
* Uncontrolled prop of centerPoint
* @type naver.maps.Point | naver.maps.PointLiteral
*/
defaultCenterPoint?: MapOptions['centerPoint'];
};
type MapEventCallbacks = {
onMapTypeIdChanged?: (value: string) => void;
onMapTypeChanged?: (value: naver.maps.MapType) => void;
onSizeChanged?: (value: naver.maps.Size) => void;
onBoundsChanged?: (value: naver.maps.Bounds) => void;
onCenterChanged?: (value: naver.maps.Coord) => void;
onCenterPointChanged?: (value: naver.maps.Point) => void;
onZoomChanged?: (value: number) => void;
};
type Props = Uncontrolled & {
/**
* Map 관련 components
*/
children?: ReactNode;
} & MapOptions & MapEventCallbacks;
declare const NaverMap: react.ForwardRefExoticComponent<Uncontrolled & {
/**
* Map 관련 components
*/
children?: ReactNode;
} & MapOptions & MapEventCallbacks & react.RefAttributes<naver.maps.Map | null>>;
export { NaverMap, Props };