From 1d91b443723533fda659005e69c1b8bf0150032f Mon Sep 17 00:00:00 2001 From: Buddy Date: Sat, 22 Aug 2026 14:47:40 -0700 Subject: [PATCH] feat: export core primitives for third-party plugin components WithProps and its types (ElementOptions, Attach, LeafletElement, LeafletElementConstructor, LeafletAddEventListener/LeafletRemoveEventListener), the shared-props.ts fragments (pathProps, latLngProps, tileLayerProps, urlProp, style, getBounds, Positioned/Styleable/Sourced/Bounded), and all of event-types.ts are now part of the public API surface, not just internal to this package's own components. The registration protocol (instanceof Layer/Popup/Tooltip against Leaflet's own base classes) and the icon-changed protocol were already plugin-friendly by design -- a third-party layer, control, or icon component built on Leaflet's own class hierarchy integrates with what's here without any special-casing. This closes the one real gap: those same primitives weren't reachable from the package root, only via undocumented dist/core/* deep imports. A plugin author can now build a component the same way this package's own components are built. --- src/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/index.ts b/src/index.ts index 55f6748..249256e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,6 +21,13 @@ // can go anywhere. export * from './core/register.ts'; export * from './core/props.ts'; +// WithProps, the prop-fragment helpers, and the event-map fragments are the +// same toolkit our own components are built from -- exported so a +// third-party plugin component can be built the same way, rather than +// reaching into dist/core/* directly (undocumented, not a stable contract). +export * from './core/with-props.ts'; +export * from './core/shared-props.ts'; +export * from './core/event-types.ts'; export { LeafletMap } from './components/leaflet-map.ts'; export { LeafletControlLayers } from './components/leaflet-control-layers.ts'; export { LeafletLayerGroup } from './components/leaflet-layer-group.ts';