@cloudnux/core-cloud-provider 0.3.0 → 0.5.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +36 -6
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -144,6 +144,11 @@ interface Coordinates {
144
144
  lat: number;
145
145
  lng: number;
146
146
  }
147
+ interface RoutePoint {
148
+ lat: number;
149
+ lng: number;
150
+ distanceFromStartKm: number;
151
+ }
147
152
  interface SuggestionParams {
148
153
  query: string;
149
154
  maxResults?: number;
@@ -152,6 +157,11 @@ interface SuggestionParams {
152
157
  biasPosition?: Coordinates;
153
158
  placeTypes?: string[];
154
159
  }
160
+ interface ReverseGeocodeParams {
161
+ coordinates: Coordinates;
162
+ language?: string;
163
+ maxResults?: number;
164
+ }
155
165
  interface LocationSuggestion {
156
166
  title: string;
157
167
  subtitle?: string;
@@ -163,11 +173,6 @@ interface LocationSuggestion {
163
173
  provider: string;
164
174
  rawData?: any;
165
175
  }
166
- interface ReverseGeocodeParams {
167
- coordinates: Coordinates;
168
- language?: string;
169
- maxResults?: number;
170
- }
171
176
  interface LocationAddress {
172
177
  fullAddress: string;
173
178
  street?: string;
@@ -184,6 +189,26 @@ interface LocationAddress {
184
189
  provider: string;
185
190
  rawData?: any;
186
191
  }
192
+ interface RouteResult {
193
+ totalDistanceKm: number;
194
+ totalDurationMinutes: number;
195
+ /** Route coordinates as [lng, lat] pairs for GeoJSON */
196
+ /** TODO: convert array to coordinates */
197
+ coordinates: Coordinates[];
198
+ /** Sampled points along route for corridor search */
199
+ sampledPoints: RoutePoint[];
200
+ /** Bounding box [minLng, minLat, maxLng, maxLat] */
201
+ bbox: [number, number, number, number];
202
+ /** Individual leg data */
203
+ legs: Array<{
204
+ distanceKm: number;
205
+ durationMinutes: number;
206
+ /** TODO: convert array to coordinates */
207
+ coordinates: Coordinates[];
208
+ startPosition: Coordinates;
209
+ endPosition: Coordinates;
210
+ }>;
211
+ }
187
212
  interface LocationService {
188
213
  /**
189
214
  * Get autocomplete suggestions for search box
@@ -195,6 +220,11 @@ interface LocationService {
195
220
  * Use case: User clicks "Get my location" → Show "Drottninggatan 10, Stockholm"
196
221
  */
197
222
  reverseGeocode(params: ReverseGeocodeParams): Promise<LocationAddress>;
223
+ /**
224
+ * Calculate route between origin and destination with optional waypoints
225
+ * Use case: User plans trip → Show route on map + details
226
+ */
227
+ calculateRoute(origin: Coordinates, destination: Coordinates, waypoints?: Coordinates[], avoidTolls?: boolean): Promise<RouteResult>;
198
228
  /**
199
229
  * Optional: Get detailed location info if suggestion doesn't have coordinates
200
230
  * Use case: User selects suggestion → Need full coordinates
@@ -379,4 +409,4 @@ interface CloudProvider {
379
409
  createFunctionsService(): FunctionsService;
380
410
  }
381
411
 
382
- export { type BaseEntry, type CloudProvider, type Coordinates, type Entry, type Entrypoint, ErrorCode, type EventBrokerService, type EventEntry, type EventFunctionContext, type EventMessage, type EventRequest, type EventResponse, type EventTrigger, type FunctionContext, type FunctionsService, type HTTPAuth, type HTTPRequest, type HTTPResponse, type HandlerType, type HttpEntry, type HttpFunctionContext, type HttpMethod, type HttpTrigger, type LocationAddress, type LocationProviderConfig, type LocationService, type LocationSuggestion, type MessageFilter, type PeekOptions, type PublishOptions, type ReadOptions, type ReverseGeocodeParams, type ScheduleEntry, type ScheduleFunctionContext, type ScheduleRequest, type ScheduleResponse, type ScheduleTrigger, type StorageService, type StorageWriteOptions, type StorageWriteResult, type SuggestionParams };
412
+ export { type BaseEntry, type CloudProvider, type Coordinates, type Entry, type Entrypoint, ErrorCode, type EventBrokerService, type EventEntry, type EventFunctionContext, type EventMessage, type EventRequest, type EventResponse, type EventTrigger, type FunctionContext, type FunctionsService, type HTTPAuth, type HTTPRequest, type HTTPResponse, type HandlerType, type HttpEntry, type HttpFunctionContext, type HttpMethod, type HttpTrigger, type LocationAddress, type LocationProviderConfig, type LocationService, type LocationSuggestion, type MessageFilter, type PeekOptions, type PublishOptions, type ReadOptions, type ReverseGeocodeParams, type RoutePoint, type RouteResult, type ScheduleEntry, type ScheduleFunctionContext, type ScheduleRequest, type ScheduleResponse, type ScheduleTrigger, type StorageService, type StorageWriteOptions, type StorageWriteResult, type SuggestionParams };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudnux/core-cloud-provider",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "CloudNux core interfaces and types for multi-cloud abstraction",
5
5
  "license": "MIT",
6
6
  "type": "module",