Skip to content

Improve typings by adding strict tsconfig.json #363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -267,7 +267,6 @@
noClear: this.props.noClear,
styles: this.props.styles,
gestureHandling: this.props.gestureHandling,
draggableCursor: this.props.draggableCursor,
draggingCursor: this.props.draggingCursor
});

@@ -408,7 +407,6 @@
fullscreenControl: _propTypes2.default.bool,
scrollwheel: _propTypes2.default.bool,
draggable: _propTypes2.default.bool,
draggableCursor: _propTypes2.default.string,
keyboardShortcuts: _propTypes2.default.bool,
disableDoubleClickZoom: _propTypes2.default.bool,
noClear: _propTypes2.default.bool,
7 changes: 4 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -24,9 +24,9 @@ export interface IProvidedProps {
loaded?: boolean
}

type mapEventHandler = (mapProps?: IMapProps, map?: google.maps.Map, event?) => any
type mapEventHandler = (mapProps?: IMapProps, map?: google.maps.Map, event?: google.maps.MouseEvent) => void

type Style = Object<string, string | number | boolean>
type Style = Record<string, string | number | boolean>

export interface IMapProps extends google.maps.MapOptions {
google: GoogleAPI
@@ -39,6 +39,7 @@ export interface IMapProps extends google.maps.MapOptions {
centerAroundCurrentLocation?: boolean
initialCenter?: google.maps.LatLngLiteral
center?: google.maps.LatLngLiteral
zoom?: number

visible?: boolean

@@ -64,7 +65,7 @@ export interface IMapProps extends google.maps.MapOptions {
onZoomChanged?: mapEventHandler
}

type markerEventHandler = (props?: IMarkerProps, marker?: google.maps.Marker, event?) => any
type markerEventHandler = (props?: IMarkerProps, marker?: google.maps.Marker, event?: google.maps.MouseEvent) => any

export interface IMarkerProps extends Partial<google.maps.MarkerOptions> {
mapCenter?: google.maps.LatLng | google.maps.LatLngLiteral
116 changes: 73 additions & 43 deletions package-lock.json
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -27,7 +27,8 @@
"lintfix": "eslint ./src --fix",
"testonly": "NODE_ENV=test mocha $npm_package_options_mocha",
"test": "npm run lint && npm run testonly",
"test-watch": "npm run testonly -- --watch --watch-extensions js"
"test-watch": "npm run testonly -- --watch --watch-extensions js",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@types/googlemaps": "^3",
@@ -74,6 +75,7 @@
"react-router-dom": "^4.2.2",
"sinon": "^1.17.3",
"style-loader": "^0.13.1",
"typescript": "^3.5.3",
"url-loader": "^0.5.7",
"webpack": "^1.13.0"
},
8 changes: 8 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"module": "commonjs",
"strict": true,
"noEmit": true
},
"files": ["index.d.ts"]
}