@mappedin/events 6.6.0-beta.0 → 6.7.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { AnnotationCollection, AnnotationSymbol, AreaCollection, AreaId, Category as MVFCategory, CategoryId, Connection as MVFConnection, Details, EnterpriseCategory as MVFEnterpriseCategory, EnterpriseCategory as MvfEnterpriseCategory, EnterpriseCategoryId as MVFEnterpriseCategoryId, EnterpriseLocation as MVFEnterpriseLocation, EnterpriseLocation as MvfEnterpriseLocation, EnterpriseLocationId as MVFEnterpriseLocationId, EnterpriseLocationInstance, EnterpriseVenue as MVFEnterpriseVenue, EntranceCollection, EntranceFeature, Facade as MVFFacade, Feature, Feature as MVFFeature, FeatureCollection, FloorCollection, FloorProperties as MVFFloor, FloorProperties as MvfFloor, FloorStack as MVFFloorStack, FloorStack as MvfFloorStack, Geometry, Hyperlink as MVFHyperlink, Image as MVFImage, Language, LineStringStyle as TMVFLineStringStyle, Location as MVFLocation, LocationId, LocationLink, LocationSocial, LocationState, MultiPolygon, NavigationFlagDeclarations, NodeCollection, NodeCollection as MVFNodeCollection, NodeId, ObstructionCollection, ObstructionFeature, ObstructionId, ObstructionProperties, OpeningHoursSpecification, OperationHours, ParsedMVF, ParsedMVF as TMVF, ParsedMVFLocalePack, Point, PointStyle as TMVFPointStyle, Polygon, PolygonStyle as TMVFPolygonStyle, SiblingGroup, SpaceCollection, SpaceFeature, SpaceId, SpaceProperties, Style as TMVFStyle, StyleCollection as TMVFStyleCollection, TilesetStyle } from '@mappedin/mvf-v2';
1
+ import { AnnotationCollection, AnnotationSymbol, AreaCollection, AreaId, Category as MVFCategory, CategoryId, Connection as MVFConnection, Details, EnterpriseCategory as MVFEnterpriseCategory, EnterpriseCategory as MvfEnterpriseCategory, EnterpriseCategoryId as MVFEnterpriseCategoryId, EnterpriseLocation as MVFEnterpriseLocation, EnterpriseLocation as MvfEnterpriseLocation, EnterpriseLocationId as MVFEnterpriseLocationId, EnterpriseLocationInstance, EnterpriseVenue as MVFEnterpriseVenue, EnterpriseVenueType, EntranceCollection, EntranceFeature, Facade as MVFFacade, Feature, Feature as MVFFeature, FeatureCollection, FloorCollection, FloorProperties as MVFFloor, FloorProperties as MvfFloor, FloorStack as MVFFloorStack, FloorStack as MvfFloorStack, Geometry, Hyperlink as MVFHyperlink, Image as MVFImage, Language, LineStringStyle as TMVFLineStringStyle, Location as MVFLocation, LocationId, LocationLink, LocationSocial, LocationState, MultiPolygon, NavigationFlagDeclarations, NodeCollection, NodeCollection as MVFNodeCollection, NodeId, ObstructionCollection, ObstructionFeature, ObstructionId, ObstructionProperties, OpeningHoursSpecification, OperationHours, ParsedMVF, ParsedMVF as TMVF, ParsedMVFLocalePack, Point, PointStyle as TMVFPointStyle, Polygon, PolygonStyle as TMVFPolygonStyle, SiblingGroup, SpaceCollection, SpaceFeature, SpaceId, SpaceProperties, Style as TMVFStyle, StyleCollection as TMVFStyleCollection, TilesetStyle } from '@mappedin/mvf-v2';
2
2
  import { ParsedMVF } from '@mappedin/mvf-v2/no-validator';
3
3
 
4
4
  declare const VALID_CONTEXTS: readonly [
@@ -3918,13 +3918,37 @@ declare class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EV
3918
3918
  /**
3919
3919
  * @private
3920
3920
  * @internal
3921
+ * AbortController for managing lifecycle and cleanup
3921
3922
  */
3922
- private _destroyed;
3923
+ private _abortController;
3924
+ /**
3925
+ * @protected
3926
+ * @internal
3927
+ * Tracks all cleanup functions for subscriptions made via on()
3928
+ */
3929
+ protected _cleanupFunctions: Array<() => void>;
3930
+ /**
3931
+ * Returns the AbortSignal for this PubSub instance.
3932
+ * Use this signal with APIs that support cancellation (fetch, addEventListener, etc.)
3933
+ * When the PubSub is destroyed, the signal will be aborted and all listeners using it will be automatically removed.
3934
+ *
3935
+ * @example
3936
+ * ```typescript
3937
+ * // Automatically cleaned up when PubSub is destroyed
3938
+ * pubsub.addEventListener(window, 'resize', handler, { signal: pubsub.signal });
3939
+ * ```
3940
+ */
3941
+ get signal(): AbortSignal;
3923
3942
  /**
3924
3943
  * @private
3925
3944
  * @internal
3926
3945
  */
3927
3946
  publish<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, data?: EVENT_PAYLOAD[EVENT_NAME]): void;
3947
+ /**
3948
+ * Subscribe a function to be called when the signal is aborted.
3949
+ * @param fn The function to call when the signal is aborted.
3950
+ */
3951
+ onAbort<T extends (...args: any[]) => void>(fn: T): void;
3928
3952
  /**
3929
3953
  * Subscribe a function to an event.
3930
3954
  *
@@ -3932,6 +3956,9 @@ declare class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EV
3932
3956
  * function.
3933
3957
  * @param fn A callback that gets called when the corresponding event is fired. The
3934
3958
  * callback will get passed an argument with a type that's one of event payloads.
3959
+ * @param options Optional options object. If a signal is provided, the subscription will be
3960
+ * automatically cleaned up when that signal is aborted.
3961
+ * @returns A cleanup function that unsubscribes the event listener when called.
3935
3962
  * @example
3936
3963
  * // Subscribe to the 'click' event
3937
3964
  * const handler = (event) => {
@@ -3943,7 +3970,9 @@ declare class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EV
3943
3970
  */
3944
3971
  on<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME] extends {
3945
3972
  data: null;
3946
- } ? EVENT_PAYLOAD[EVENT_NAME]["data"] : EVENT_PAYLOAD[EVENT_NAME]) => void): void;
3973
+ } ? EVENT_PAYLOAD[EVENT_NAME]["data"] : EVENT_PAYLOAD[EVENT_NAME]) => void, options?: {
3974
+ signal?: AbortSignal;
3975
+ }): () => void;
3947
3976
  /**
3948
3977
  * Unsubscribe a function previously subscribed with {@link on}
3949
3978
  *
@@ -3964,6 +3993,7 @@ declare class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EV
3964
3993
  /**
3965
3994
  * @private
3966
3995
  * @internal
3996
+ * Destroys the PubSub instance and automatically unsubscribes all listeners registered via on().
3967
3997
  */
3968
3998
  destroy(): void;
3969
3999
  }
@@ -4129,6 +4159,12 @@ type GreedyLosOptions = BaseSimplifyOptions & {
4129
4159
  };
4130
4160
  type RdpOptions = BaseSimplifyOptions & {
4131
4161
  __EXPERIMENTAL_METHOD: "rdp";
4162
+ /**
4163
+ * Whether to include door-adjacent nodes (predecessor/successor of doors) in the must-include set.
4164
+ * When true, nodes immediately before and after doors are preserved during simplification.
4165
+ * @default true
4166
+ */
4167
+ mustIncludeDoorBufferNodes?: boolean;
4132
4168
  };
4133
4169
  type DpOptimalOptions = BaseSimplifyOptions & {
4134
4170
  __EXPERIMENTAL_METHOD: "dp-optimal";
@@ -4663,6 +4699,13 @@ type TGetDirectionsOptions = {
4663
4699
  * Always uses line-of-sight validation (cannot be disabled).
4664
4700
  */
4665
4701
  __EXPERIMENTAL_METHOD: "rdp";
4702
+ /**
4703
+ * @experimental
4704
+ * Whether to include door-adjacent nodes (predecessor/successor of doors) in the must-include set.
4705
+ * When true (default), nodes immediately before and after doors are preserved during simplification.
4706
+ * @default true
4707
+ */
4708
+ __EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES?: boolean;
4666
4709
  } | {
4667
4710
  /**
4668
4711
  * Enable or disable path smoothing.
@@ -6684,6 +6727,10 @@ declare class EnterpriseVenue extends BaseMetaData implements MVFEnterpriseVenue
6684
6727
  * The default map of the venue.
6685
6728
  */
6686
6729
  get defaultMap(): string;
6730
+ /**
6731
+ * The enterprise venue type.
6732
+ */
6733
+ get enterpriseType(): EnterpriseVenueType | undefined;
6687
6734
  /**
6688
6735
  * Serializes the EnterpriseVenue data to JSON.
6689
6736
  *