Skip to content

Commit

Permalink
add types for map package
Browse files Browse the repository at this point in the history
  • Loading branch information
rejas committed May 8, 2024
1 parent 4d8fc44 commit 8a7d146
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"version": "10.1.0",
"module": "lib/index.esm.js",
"main": "lib/index.js",
"types": "types/index.d.ts",
"sideEffects": false,
"scripts": {
"reinstall": "rm -rf node_modules && yarn install",
Expand Down
42 changes: 42 additions & 0 deletions packages/map/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
declare module '@goodhood/map' {
import { ReactNode } from 'react';

export interface MapProps {
attribution: 'default' | 'hidden' | 'compact';
children?: ReactNode;
className?: string;
credentials: {
key: string;
map_id: string;
};
locked?: boolean;
lockedMobile?: boolean;
}

export const EyecatcherMarker: React.ComponentType<{
children?: ReactNode;
className?: string;
options?: {
zIndexOffset: number;
};
position: number[];
}>;

export const InfoMarker: React.ComponentType<{
children?: ReactNode;
className?: string;
onClick?: () => void;
position: number[];
small?: boolean;
}>;

export const Map: React.ComponentType<MapProps>;

export const POLYGON_ACTIVE: string;
export const POLYGON_SOLID: string;

export const Polygon: React.ComponentType<{
area: [number, number][];
type: string;
}>;
}

0 comments on commit 8a7d146

Please sign in to comment.