realmap-react
Version:
Wooritech map chart component library
55 lines (51 loc) • 1.53 kB
TypeScript
import React from 'react';
import * as Realmap from 'realmap';
import { ChartConfiguration, LoadCallbackArgs, MapChart } from 'realmap';
type TemplateMap = Record<string, React.ReactNode>;
/**
* RealMapReact 컴포넌트의 props 타입 정의
*/
interface RealMapProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'id'> {
/**
* 라이선스 키를 설정한다.
* 해당 Props로 라이선스 키를 설정하지 않으면 전역 객체에 `realMapLic`가 존재해야 한다.
*/
license?: string;
/**
* Realmap 모듈을 외부에서 주입받아 사용할 수 있도록 한다.
*/
realmap: typeof Realmap;
/**
* 차트의 ID를 지정한다.
*/
id?: string;
/**
* 차트의 너비를 지정한다.
*/
w?: React.CSSProperties['width'];
/**
* 차트의 높이를 지정한다.
*/
h?: React.CSSProperties['height'];
/**
* 차트를 생성하기 위한 설정 객체.
*/
config: ChartConfiguration;
/**
* animation 적용 여부
*/
animate?: boolean;
/**
* 차트가 로드된 후 호출되는 콜백 함수.
*/
onChartLoaded?: (param: LoadCallbackArgs) => void;
/**
* html 타입의 Annotation을 위한 탬플릿 객체
*/
templates: TemplateMap;
}
interface RealMapRef {
realmap: MapChart;
}
declare const RealMapReact: React.NamedExoticComponent<RealMapProps & React.RefAttributes<RealMapRef>>;
export { RealMapProps, RealMapReact, RealMapRef };