Skip to content

Commit

Permalink
Export constants and lib through MapboxDraw (#1100) (h/t @thaddmt)
Browse files Browse the repository at this point in the history
  • Loading branch information
thaddmt authored Jan 25, 2023
1 parent b4c4138 commit f1c3d59
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import runSetup from './src/setup';
import setupOptions from './src/options';
import setupAPI from './src/api';
import * as Constants from './src/constants';
import * as lib from './src/lib';

const setupDraw = function(options, api) {
options = setupOptions(options);
Expand Down Expand Up @@ -29,5 +30,7 @@ function MapboxDraw(options) {

import modes from './src/modes/index';
MapboxDraw.modes = modes;
MapboxDraw.constants = Constants;
MapboxDraw.lib = lib;

export default MapboxDraw;
43 changes: 43 additions & 0 deletions src/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import * as CommonSelectors from "./common_selectors";
import constrainFeatureMovement from "./constrain_feature_movement";
import createMidPoint from "./create_midpoint";
import createSupplementaryPoints from "./create_supplementary_points";
import createVertex from "./create_vertex";
import doubleClickZoom from "./double_click_zoom";
import euclideanDistance from "./euclidean_distance";
import featuresAt from "./features_at";
import getFeatureAtAndSetCursors from "./get_features_and_set_cursor";
import isClick from "./is_click";
import isEventAtCoordinates from "./is_event_at_coordinates";
import isTap from "./is_tap";
import mapEventToBoundingBox from "./map_event_to_bounding_box";
import ModeHandler from "./mode_handler";
import moveFeatures from "./move_features";
import sortFeatures from "./sort_features";
import StringSet from "./string_set";
import stringSetsAreEqual from "./string_sets_are_equal";
import theme from "./theme";
import toDenseArray from "./to_dense_array";

export {
CommonSelectors,
constrainFeatureMovement,
createMidPoint,
createSupplementaryPoints,
createVertex,
doubleClickZoom,
euclideanDistance,
featuresAt,
getFeatureAtAndSetCursors,
isClick,
isEventAtCoordinates,
isTap,
mapEventToBoundingBox,
ModeHandler,
moveFeatures,
sortFeatures,
stringSetsAreEqual,
StringSet,
theme,
toDenseArray,
};

0 comments on commit f1c3d59

Please sign in to comment.