@duffel/components 3.6.4 → 3.6.5
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.
- package/components/DuffelCardForm/DuffelCardFormCustomElement.d.ts +32 -0
- package/components/DuffelCardForm/lib/types.d.ts +4 -2
- package/custom-elements.d.ts +4 -3
- package/custom-elements.js +23 -23
- package/custom-elements.js.map +4 -4
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DuffelCardFormProps } from "./lib/types";
|
|
3
|
+
declare const CUSTOM_ELEMENT_TAG = "duffel-card-form";
|
|
4
|
+
type DuffelCardFormCustomElementRenderArguments = Pick<DuffelCardFormProps, "clientKey" | "intent" | "savedCardData" | "styles" | "tokenProxyEnvironment">;
|
|
5
|
+
declare global {
|
|
6
|
+
namespace JSX {
|
|
7
|
+
interface IntrinsicElements {
|
|
8
|
+
[CUSTOM_ELEMENT_TAG]: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
interface Window {
|
|
12
|
+
renderDuffelCardFormCustomElement: typeof renderDuffelCardFormCustomElement;
|
|
13
|
+
saveCard: typeof saveCard;
|
|
14
|
+
createCardForTemporaryUse: typeof createCardForTemporaryUse;
|
|
15
|
+
onValidateSuccess: typeof onValidateSuccess;
|
|
16
|
+
onValidateFailure: typeof onValidateFailure;
|
|
17
|
+
onSaveCardSuccess: typeof onSaveCardSuccess;
|
|
18
|
+
onSaveCardFailure: typeof onSaveCardFailure;
|
|
19
|
+
onCreateCardForTemporaryUseSuccess: typeof onCreateCardForTemporaryUseSuccess;
|
|
20
|
+
onCreateCardForTemporaryUseFailure: typeof onCreateCardForTemporaryUseFailure;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export declare function renderDuffelCardFormCustomElement(props: DuffelCardFormCustomElementRenderArguments): void;
|
|
24
|
+
export declare function saveCard(): void;
|
|
25
|
+
export declare function createCardForTemporaryUse(): void;
|
|
26
|
+
export declare const onValidateSuccess: (callback: () => void) => void;
|
|
27
|
+
export declare const onValidateFailure: (callback: () => void) => void;
|
|
28
|
+
export declare const onSaveCardSuccess: (callback: (data: import("./lib/types").SaveCardData) => void) => void;
|
|
29
|
+
export declare const onSaveCardFailure: (callback: (error: import("./lib/types").SaveCardError) => void) => void;
|
|
30
|
+
export declare const onCreateCardForTemporaryUseSuccess: (callback: (data: import("./lib/types").CreateCardForTemporaryUseData) => void) => void;
|
|
31
|
+
export declare const onCreateCardForTemporaryUseFailure: (callback: (error: import("./lib/types").CreateCardForTemporaryUseError) => void) => void;
|
|
32
|
+
export {};
|
|
@@ -16,8 +16,10 @@ export interface SaveCardData extends CommonCardData {
|
|
|
16
16
|
saved: true;
|
|
17
17
|
unavailable_at: null;
|
|
18
18
|
}
|
|
19
|
-
export
|
|
20
|
-
|
|
19
|
+
export interface SaveCardError extends CardActionError {
|
|
20
|
+
}
|
|
21
|
+
export interface CreateCardForTemporaryUseError extends CardActionError {
|
|
22
|
+
}
|
|
21
23
|
/**
|
|
22
24
|
* An object where each key value pair is a style to be applied.
|
|
23
25
|
* e.g. { 'background-image': 'red', 'color': '#000', 'margin-inline': '8px' }
|
package/custom-elements.d.ts
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* If you'd like to expose other custom element functions, please add them here.
|
|
4
4
|
*/
|
|
5
5
|
export { onDuffelAncillariesPayloadReady, renderDuffelAncillariesCustomElement, } from "./components/DuffelAncillaries/DuffelAncillariesCustomElement";
|
|
6
|
+
export { createCardForTemporaryUse, onCreateCardForTemporaryUseFailure, onCreateCardForTemporaryUseSuccess, onSaveCardFailure, onSaveCardSuccess, renderDuffelCardFormCustomElement, saveCard, } from "./components/DuffelCardForm/DuffelCardFormCustomElement";
|
|
6
7
|
export { onDuffelPaymentsFailedPayment, onDuffelPaymentsSuccessfulPayment, renderDuffelPaymentsCustomElement, } from "./components/DuffelPayments/DuffelPaymentsCustomElement";
|
|
7
|
-
export {
|
|
8
|
+
export { onMapboxPlacesLookupPlaceSelected, renderMapboxPlacesLookupCustomElement, } from "./components/MapboxPlacesLookup/MapboxPlacesLookupCustomElement";
|
|
8
9
|
export { renderDuffelStaysAmenitiesCustomElement } from "./components/Stays/StaysAmenitiesCustomElement";
|
|
9
|
-
export {
|
|
10
|
+
export { renderDuffelStaysRatingCustomElement } from "./components/Stays/StaysRatingCustomElement";
|
|
10
11
|
export { renderDuffelStaysRoomRateCardCustomElement } from "./components/Stays/StaysRoomRateCardCustomElement";
|
|
11
|
-
export {
|
|
12
|
+
export { renderDuffelStaysSummaryCustomElement } from "./components/Stays/StaysSummaryCustomElement";
|