UNPKG

react-canada-map

Version:

react module for an interactive map of Canada

46 lines (45 loc) 1.06 kB
import { Component, MouseEvent } from "react"; interface Props { onClick: (province: Provinces, event: MouseEvent) => void; width: number; height: number; fillColor: string; onHoverColor: string; customize: { [key in Provinces]?: ProvinceCustomizations; }; } export declare enum Provinces { BC = "BC", AB = "AB", SK = "SK", MB = "MB", ON = "ON", QC = "QC", NB = "NB", NS = "NS", PE = "PE", NL = "NL", YT = "YT", NT = "NT", NU = "NU" } export interface ProvinceCustomizations { fillColor?: string; onHoverColor?: string; } declare class Canada extends Component<Props> { static defaultProps: { onClick: () => void; width: number; height: number; fillColor: string; onHoverColor: string; customize: {}; }; fillProvinceColor: (province: string) => string; fillProvinceHoverColor: (province: string) => string; buildProvinces: () => JSX.Element[]; render(): JSX.Element; } export default Canada;