@quantaroute/checkout 1.7.3 → 1.8.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.
@@ -50,7 +50,8 @@ export declare interface AddressFormProps {
50
50
  lng: number;
51
51
  apiKey: string;
52
52
  apiBaseUrl?: string;
53
- onAddressComplete: (address: CompleteAddress) => void;
53
+ /** May return a promise; the form stays in its submitting state until it settles. */
54
+ onAddressComplete: (address: CompleteAddress) => void | Promise<void>;
54
55
  onBack: () => void;
55
56
  onError?: (error: Error) => void;
56
57
  theme?: 'light' | 'dark';
@@ -318,6 +319,11 @@ export declare interface CheckoutWidgetProps {
318
319
  * when the host loads MapLibre from a CDN (e.g. Shopify theme extensions).
319
320
  */
320
321
  embedMode?: MapEmbedMode;
322
+ /**
323
+ * Public `dp_` key with the maps scope. Passed through to the map step.
324
+ * Shopify and other third-party hosts must set this; first-party sites can omit it.
325
+ */
326
+ mapsKey?: string;
321
327
  /**
322
328
  * Show the smart search bar on the map step (default: true).
323
329
  * Supports address search (API) and DigiPin lookup (100% offline).
@@ -780,6 +786,12 @@ export declare interface MapPinSelectorProps {
780
786
  * `external` waits for `window.maplibregl` (CDN script loaded by the host).
781
787
  */
782
788
  embedMode?: MapEmbedMode;
789
+ /**
790
+ * Public `dp_` key with the maps scope. Required when the style is on
791
+ * maps.quantaroute.com and the page is not a first-party origin. MapLibre
792
+ * `transformRequest` attaches it to the style, sprite, font and tile URLs.
793
+ */
794
+ mapsKey?: string;
783
795
  }
784
796
 
785
797
  /** Subset of maplibre-gl used by the web MapPinSelector. */
@@ -790,6 +802,10 @@ export declare interface MapRuntime {
790
802
  NavigationControl?: new (options?: ConstructorParameters<NonNullable<NavigationControl>>[0]) => NavigationControl;
791
803
  }
792
804
 
805
+ export declare function mapsTransformRequest(key?: string): ((url: string) => {
806
+ url: string;
807
+ }) | undefined;
808
+
793
809
  /**
794
810
  * Normalise user input to a 10-character DigiPin body (no separators).
795
811
  * Accepts dashed, spaced, or compact forms — e.g. `4P3-J68-637F`, `4P3 J68 637F`, `4P3J68637F`.
@@ -1149,4 +1165,7 @@ export declare function verifyPayment(config: CheckoutApiConfig, sessionToken: s
1149
1165
  */
1150
1166
  export declare function waitForExternalMapRuntime(onReady: (runtime: MapRuntime) => void, onUnavailable: () => void, waitMs?: number, retryMs?: number): () => void;
1151
1167
 
1168
+ /** Attach `?key=` for MapLibre requests to maps.quantaroute.com. No-op for other hosts or a missing key. */
1169
+ export declare function withMapsKey(url: string, key?: string): string;
1170
+
1152
1171
  export { }