jmapcloud-ng-core-types 0.0.4

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.
@@ -0,0 +1,197 @@
1
+ // ALL_MAP_CONTEXT_APPLY_TYPES in all-enum.ts
2
+ declare const enum JMAP_CONTEXT_APPLY_TYPES {
3
+ STANDARD = "standard",
4
+ DEFAULT = "default",
5
+ SHARED = "shared"
6
+ }
7
+
8
+ // ALL_MAP_CONTEXT_TAB in all-enum.ts
9
+ declare const enum JMAP_CONTEXT_TABS {
10
+ LIST = "list",
11
+ CREATE = "create"
12
+ }
13
+
14
+ // ALL_MAP_CONTEXT_SORT_BY_OPTIONS in all-enum.ts
15
+ declare const enum JMAP_CONTEXT_SORT_BY_OPTIONS {
16
+ ALPHABETIC = "alphabetic",
17
+ LAST_UPDATE = "lastUpdate"
18
+ }
19
+
20
+ // ALL_MAP_CONTEXT_SORT_BY_DIRECTIONS in all-enum.ts
21
+ declare const enum JMAP_CONTEXT_SORT_BY_DIRECTIONS {
22
+ ASC = "asc",
23
+ DESC = "desc"
24
+ }
25
+
26
+ // ALL_MAP_CONTEXT_VERSIONS in all-enum.ts
27
+ declare const enum JMAP_CONTEXT_VERSIONS {
28
+ V0 = 0,
29
+ V1 = 1
30
+ }
31
+
32
+ declare type JMapContextVersions = JMapContext | JMapContextV0 | JMapContextV1
33
+
34
+ declare interface JMapContextEditResponse {
35
+ id: JId
36
+ uuid: string
37
+ modificationDate: string
38
+ }
39
+
40
+ declare interface JMapContextMetaData {
41
+ title?: string
42
+ shareLink?: boolean
43
+ description?: string
44
+ thumbnailUrl?: string
45
+ }
46
+
47
+ /**
48
+ * Never change this interface !!!
49
+ * This is the picture of a map-context in version 0
50
+ * Use for mapcontext migrations
51
+ */
52
+ declare interface JMapContextDataV0 {
53
+ layerElements: Array<{
54
+ id: string | number
55
+ isGroup: boolean
56
+ isVisible: boolean
57
+ }>
58
+ mapCenter: { x: number; y: number }
59
+ mapZoom: number
60
+ mapPitch: number
61
+ mapBearing: number
62
+ baseMap: string | undefined
63
+ selection: {
64
+ [key in string | number]: GeoJSON.Feature[]
65
+ }
66
+ measures: Array<{
67
+ id: string
68
+ type: "polygon" | "line_string" | "circle"
69
+ feature: GeoJSON.Feature<GeoJSON.LineString | GeoJSON.Polygon>
70
+ totalEdges: number
71
+ centroid: JPoint
72
+ edges: Array<{
73
+ popupLocation: JPoint
74
+ distance: number
75
+ }>
76
+ area: number
77
+ radius: number
78
+ }>
79
+ thumbnail: string
80
+ annotations: Array<{
81
+ id: string
82
+ type: "point" | "polygon" | "line_string" | "rectangle" | "circle" | "text"
83
+ feature: any
84
+ }>
85
+ annotationsTextMarkersProperties: Array<{
86
+ id: string
87
+ location: mapboxgl.LngLatLike
88
+ textSize: number
89
+ textColor: string
90
+ textRotation: number
91
+ label: string
92
+ zoomRef: number
93
+ shapeType: string
94
+ }>
95
+ extensionData?: { [extensionId: string]: any }
96
+ }
97
+
98
+ declare interface JMapContextData {
99
+ version: JMAP_CONTEXT_VERSIONS
100
+ layerElements: JMapContextDataLayerElement[]
101
+ mapCenter: JLocation
102
+ mapZoom: number
103
+ mapPitch: number
104
+ mapBearing: number
105
+ baseMap: string | undefined
106
+ selection: JMapSelection
107
+ thumbnailUrl: string
108
+ extensionData: { [extensionId: string]: any }
109
+ }
110
+
111
+ declare interface JMapContextDataLayerElement {
112
+ id: JId
113
+ isGroup: boolean
114
+ isVisible: boolean
115
+ }
116
+
117
+ declare interface JMapContextDataLayer extends JMapContextDataLayerElement {
118
+ selectable: boolean
119
+ thematics: JMapContextDataThematic[]
120
+ dynamicFilterConditions: JDynamicFilterCondition[]
121
+ dynamicFilterIsActive: boolean
122
+ transparency?: number
123
+ }
124
+
125
+ declare interface JMapContextDataThematic {
126
+ id: JId
127
+ isVisible: boolean
128
+ hiddenCategoryIndexes?: number[]
129
+ hiddenConditionIds?: string[]
130
+ }
131
+
132
+ declare interface JMapContext {
133
+ id?: JId
134
+ title: string
135
+ description: string
136
+ shared: boolean
137
+ origin: "web-ng"
138
+ uuid?: string
139
+ author?: string
140
+ creationDate?: string
141
+ modificationDate?: string
142
+ projectId?: string
143
+ data: JMapContextData
144
+ }
145
+
146
+ declare interface JMapContextV0 {
147
+ id?: number | string
148
+ title: string
149
+ description: string
150
+ shared: boolean
151
+ origin: "web-ng"
152
+ uuid?: string
153
+ author?: string
154
+ creationDate?: string
155
+ modificationDate?: string
156
+ projectId?: string
157
+ data: JMapContextDataV0
158
+ }
159
+
160
+ declare interface JMapContextV1 extends JMapContext {
161
+ // nothing to change here
162
+ }
163
+
164
+ declare interface JMapContextEventParams {
165
+ context: JMapContext
166
+ isExtensionDataSetById(extensionId: string): boolean
167
+ getExtensionDataById(extensionId: string): any
168
+ }
169
+
170
+ declare interface JMapContextMapDataEventParams extends JMapContextEventParams {
171
+ isCreation: boolean
172
+ }
173
+
174
+ declare interface JMapContextBeforeMapDataChangeEventParams extends JMapContextMapDataEventParams {
175
+ setExtensionDataById(extensionId: string, data: any): void
176
+ removeExtensionDataById(extensionId: string): void
177
+ }
178
+
179
+ declare interface JMapContextAfterMapDataChangeEventParams extends JMapContextMapDataEventParams {
180
+ // nothing else
181
+ }
182
+
183
+ declare interface JMapContextBeforeApplyEventParams extends JMapContextEventParams {
184
+ applyType: JMAP_CONTEXT_APPLY_TYPES
185
+ }
186
+
187
+ declare interface JMapContextAfterApplyEventParams extends JMapContextEventParams {
188
+ applyType: JMAP_CONTEXT_APPLY_TYPES
189
+ }
190
+
191
+ declare interface JMapContextSetActiveResult {
192
+ hasBeanInitialized: boolean
193
+ hasLoadedDefault: boolean
194
+ hasLoadedShared: boolean
195
+ hasLoadingDefaultError?: boolean
196
+ hasLoadingSharedError?: boolean
197
+ }