Skip to content

Commit

Permalink
Merge pull request #16 from mover96/master
Browse files Browse the repository at this point in the history
Typing changes & commonjs
  • Loading branch information
NishargShah authored Jul 12, 2021
2 parents 77d4328 + 65842d7 commit acd2d1b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
"author": "Nisharg Shah",
"main": "dist/ImageMapper.js",
"types": "dist/ImageMapper.d.ts",
"type": "commonjs",
"scripts": {
"build": "tsc",
"lint": "eslint . --ext .tsx",
"lint-fix": "eslint . --ext .tsx --fix",
"prepublishOnly": "npm run build"
"prepublishOnly": "npm run build",
"prepare": "npm run build"
},
"husky": {
"hooks": {
Expand Down
2 changes: 1 addition & 1 deletion src/ImageMapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const ImageMapper: React.FC<ImageMapperProps> = (props: ImageMapperProps) => {
}
};

const scaleCoords = (coords: []): number[] => {
const scaleCoords = (coords: number[]): number[] => {
const scale =
widthProp && imageWidthProp && imageWidthProp > 0
? (widthProp as number) / imageWidthProp
Expand Down
18 changes: 9 additions & 9 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export interface Container extends HTMLDivElement {

export interface MapAreas {
id?: string;
shape: string;
coords: [];
active: boolean;
disabled: boolean;
href: string;
fillColor: string;
strokeColor: string;
lineWidth: number;
preFillColor: string;
shape: 'rect' | 'circle' | 'poly';
coords: number[];
active?: boolean;
disabled?: boolean;
href?: string;
fillColor?: string;
strokeColor?: string;
lineWidth?: number;
preFillColor?: string;
}

export interface Map {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"module": "commonjs",
"lib": [
"dom",
"dom.iterable",
Expand Down

0 comments on commit acd2d1b

Please sign in to comment.