Skip to content

Commit

Permalink
Remove node types and introduce custom any types
Browse files Browse the repository at this point in the history
  • Loading branch information
alex3165 committed Feb 8, 2017
1 parent 425de49 commit 2ea4e37
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"devDependencies": {
"@types/jest": "^18.1.1",
"@types/mapbox-gl": "^0.29.0",
"@types/node": "^7.0.5",
"@types/react": "^15.0.6",
"@types/react-addons-test-utils": "^0.14.17",
"@types/recompose": "^0.20.3",
Expand Down
3 changes: 1 addition & 2 deletions src/cluster.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import * as React from 'react';
import * as MapboxGL from 'mapbox-gl';
import { Props as MarkerProps } from './marker';

const supercluster = require('supercluster'); //tslint:disable-line
import supercluster from 'supercluster';

export interface Props {
ClusterMarkerFactory: (coordinates: number[], pointCount: number) => JSX.Element;
Expand Down
3 changes: 1 addition & 2 deletions src/layer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from 'react';
import * as MapboxGL from 'mapbox-gl';

const isEqual = require('deep-equal'); // tslint:disable-line
import isEqual from 'deep-equal';
import diff from './util/diff';

let index = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/map.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as MapboxGl from 'mapbox-gl/dist/mapbox-gl';
import * as React from 'react';
const isEqual = require('deep-equal'); // tslint:disable-line
import isEqual from 'deep-equal';

const events = {
onStyleLoad: 'style.load', // Should remain first
Expand Down
2 changes: 1 addition & 1 deletion src/util/diff.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const reduce = require('reduce-object'); // tslint:disable-line
import reduce from 'reduce-object';

const find = (obj: any, predicate: (...args: any[]) => boolean) => (
Object.keys(obj).filter((key) => predicate(obj[key], key))[0]
Expand Down
14 changes: 14 additions & 0 deletions src/util/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
declare module 'supercluster' {
const supercluster: any;
export default supercluster;
}

declare module 'deep-equal' {
const isEqual: any;
export default isEqual;
}

declare module 'reduce-object' {
const reduce: any;
export default reduce;
}

0 comments on commit 2ea4e37

Please sign in to comment.