Skip to content

Commit

Permalink
fix(types): missing PolygonPressEvent type export (react-native-maps#…
Browse files Browse the repository at this point in the history
  • Loading branch information
anhtrlive committed Apr 16, 2023
1 parent 0262602 commit d3557a3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
25 changes: 3 additions & 22 deletions src/MapPolygon.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import {NativeSyntheticEvent, View, ViewProps} from 'react-native';
import {View, ViewProps} from 'react-native';
import decorateMapComponent, {
USES_DEFAULT_IMPLEMENTATION,
SUPPORTED,
Expand All @@ -8,7 +8,8 @@ import decorateMapComponent, {
MapManagerCommand,
UIManagerCommand,
} from './decorateMapComponent';
import {LatLng, LineCapType, LineJoinType, Point} from './sharedTypes';
import {PolygonPressEvent} from './MapPolygon.types';
import {LatLng, LineCapType, LineJoinType} from './sharedTypes';

export type MapPolygonProps = ViewProps & {
/**
Expand Down Expand Up @@ -184,23 +185,3 @@ export default decorateMapComponent(MapPolygon, 'Polygon', {
android: USES_DEFAULT_IMPLEMENTATION,
},
});

type PolygonPressEvent = NativeSyntheticEvent<{
action: 'polygon-press';

/**
* @platform iOS: Google Maps
*/
id?: string;

/**
* @platform iOS: Apple Maps
* @platform Android
*/
coordinate?: LatLng;

/**
* @platform Android
*/
position?: Point;
}>;
25 changes: 25 additions & 0 deletions src/MapPolygon.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {NativeSyntheticEvent} from 'react-native';
import {LatLng, Point} from './sharedTypes';

// All types in this file are directly exported with the package for external
// use.

export type PolygonPressEvent = NativeSyntheticEvent<{
action: 'polygon-press';

/**
* @platform iOS: Google Maps
*/
id?: string;

/**
* @platform iOS: Apple Maps
* @platform Android
*/
coordinate?: LatLng;

/**
* @platform Android
*/
position?: Point;
}>;
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export {Animated, MAP_TYPES, enableLatestRenderer};

export * from './ProviderConstants';
export * from './MapView.types';
export * from './MapPolygon.types';
export * from './sharedTypes';

export const MarkerAnimated = Marker.Animated;
Expand Down

0 comments on commit d3557a3

Please sign in to comment.