@ndwnu/map 0.0.1-beta.1 → 0.0.1-beta.3

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,101 +0,0 @@
1
- import { MapElement } from './map-element';
2
- /**
3
- * Repository for managing map elements.
4
- * Provides methods to add, remove, show, hide, and toggle map elements.
5
- * Also tracks element visibility state and provides observable streams for elements.
6
- *
7
- * @typeparam TElementType - The type of ID used for the map elements
8
- */
9
- export declare abstract class MapElementRepository<TElementType> {
10
- /** Subject that holds the current array of map elements */
11
- private readonly mapElementsSubject;
12
- /** Observable stream of all map elements */
13
- private readonly mapElements$;
14
- /** Observable stream of only visible map elements */
15
- private readonly visibleMapElements$;
16
- /**
17
- * Gets the ids (TElementType) as an array of all map element
18
- * @returns Array of TElementType
19
- */
20
- mapElementIds$: import("rxjs").Observable<TElementType[]>;
21
- /**
22
- * Gets the ids (TElementType) as an array of all visible map element
23
- * @returns Array of TElementType
24
- */
25
- visibleMapElementIds$: import("rxjs").Observable<TElementType[]>;
26
- /**
27
- * Gets the current array of all map elements
28
- * @returns Array of map elements
29
- */
30
- get mapElements(): MapElement<TElementType>[];
31
- /**
32
- * Gets only the currently visible map elements
33
- * @returns Array of visible map elements
34
- */
35
- get visibleMapElements(): MapElement<TElementType>[];
36
- /**
37
- * Finds a map element by its ID
38
- *
39
- * @param elementId - The ID of the element to find
40
- * @returns The map element if found, undefined otherwise
41
- */
42
- getMapElementById(elementId: TElementType): MapElement<TElementType> | undefined;
43
- /**
44
- * Checks if a map element is currently visible
45
- *
46
- * @param elementId - The ID of the element to check
47
- * @returns True if the element is visible, false otherwise
48
- */
49
- isMapElementVisible(elementId: TElementType): boolean;
50
- /**
51
- * Adds a new map element to the repository and initializes it.
52
- * Sets the element's visibility based on its configuration.
53
- *
54
- * @param mapElement - The map element to add
55
- */
56
- addMapElement(mapElement: MapElement<TElementType>): void;
57
- /**
58
- * Removes a map element from the repository and destroys it.
59
- *
60
- * @param mapElement - The map element to remove
61
- */
62
- removeMapElement(mapElement: MapElement<TElementType>): void;
63
- /**
64
- * Removes all map elements from the repository and destroys them.
65
- */
66
- removeAllMapElements(): void;
67
- /**
68
- * Sets the visibility of a map element by its ID and updates the subject with the new state.
69
- *
70
- * @param elementId - The ID of the element to update
71
- * @param visible - Whether the element should be visible or hidden
72
- */
73
- private setMapElementVisibility;
74
- /**
75
- * Shows a map element by its ID and updates the subject with the new state.
76
- *
77
- * @param elementId - The ID of the element to show
78
- */
79
- showMapElement(elementId: TElementType): void;
80
- /**
81
- * Hides a map element by its ID and updates the subject with the new state.
82
- *
83
- * @param elementId - The ID of the element to hide
84
- */
85
- hideMapElement(elementId: TElementType): void;
86
- /**
87
- * Toggles the visibility of a map element by its ID.
88
- * If the element is currently visible, it will be hidden, and vice versa.
89
- *
90
- * @param elementId - The ID of the element to toggle visibility
91
- */
92
- toggleMapElement(elementId: TElementType): void;
93
- /**
94
- * Gets the ID of the layer that should come before the specified element's layers
95
- * in the map's layer stack. This is used for maintaining proper layer ordering.
96
- *
97
- * @param elementId - The ID of the element to find a "before" reference for
98
- * @returns The ID of the first layer of the next element in order, or undefined if none exists
99
- */
100
- getBeforeId(elementId: TElementType): string | undefined;
101
- }