@duffel/components 3.1.6--canary.7 → 3.1.6--canary.9
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/DuffelCardForm.d.ts +14 -10
- package/components/DuffelCardForm/DuffelCardFormCustomElement.d.ts +3 -1
- package/components/DuffelCardForm/lib/getTokenFromClientKey.d.ts +1 -0
- package/custom-elements.d.ts +1 -1
- package/custom-elements.js +15 -15
- package/custom-elements.js.map +4 -4
- package/index.js +15 -15
- package/index.js.map +4 -4
- package/package.json +2 -2
- package/stories/DuffelCardForm.stories.d.ts +0 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/types/index.d.ts +1 -0
- /package/{types → tests/lib}/getSegmentDates.d.ts +0 -0
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { CustomStyles } from "../../types";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
export interface TokenisedCardError {
|
|
4
|
+
status: number;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TokenisedCardData {
|
|
8
|
+
id: string;
|
|
9
|
+
live_mode: false;
|
|
10
|
+
}
|
|
11
|
+
export type DuffelCardFormStyles = Pick<CustomStyles, "fontFamily"> & {
|
|
12
|
+
stylesheetUrl?: string;
|
|
13
|
+
};
|
|
3
14
|
export interface DuffelCardFormProps {
|
|
4
15
|
clientKey: string;
|
|
5
|
-
styles?:
|
|
6
|
-
stylesheetUrl?: string;
|
|
7
|
-
};
|
|
8
|
-
submitButtonLabel?: string;
|
|
9
|
-
onSubmit?: (data: TokenisedCardData) => void;
|
|
16
|
+
styles?: DuffelCardFormStyles;
|
|
10
17
|
shouldUseLocalTokenProxy?: boolean;
|
|
18
|
+
onCardIdCreated: (data: TokenisedCardData) => void;
|
|
19
|
+
onCardIdCreationError: (error: TokenisedCardError) => void;
|
|
11
20
|
}
|
|
12
21
|
export declare const DuffelCardForm: React.FC<DuffelCardFormProps>;
|
|
13
|
-
interface TokenisedCardData {
|
|
14
|
-
id: string;
|
|
15
|
-
live_mode: false;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -6,6 +6,8 @@ declare global {
|
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
type DuffelCardFormCustomElementRenderArguments = DuffelCardFormProps
|
|
9
|
+
type DuffelCardFormCustomElementRenderArguments = Pick<DuffelCardFormProps, "clientKey" | "styles" | "shouldUseLocalTokenProxy">;
|
|
10
10
|
export declare function renderDuffelCardFormCustomElement(props: DuffelCardFormCustomElementRenderArguments): void;
|
|
11
|
+
export declare function onDuffelCardFormCardIdCreated(onCardIdCreated: DuffelCardFormProps["onCardIdCreated"]): void;
|
|
12
|
+
export declare function onDuffelCardFormCardIdCreationError(onCardIdCreationError: DuffelCardFormProps["onCardIdCreationError"]): void;
|
|
11
13
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getTokenFromClientKey(clientKey: string): string;
|
package/custom-elements.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { onDuffelAncillariesPayloadReady, renderDuffelAncillariesCustomElement, } from "./components/DuffelAncillaries/DuffelAncillariesCustomElement";
|
|
6
6
|
export { onDuffelPaymentsFailedPayment, onDuffelPaymentsSuccessfulPayment, renderDuffelPaymentsCustomElement, } from "./components/DuffelPayments/DuffelPaymentsCustomElement";
|
|
7
|
-
export { renderDuffelCardFormCustomElement } from "./components/DuffelCardForm/DuffelCardFormCustomElement";
|
|
7
|
+
export { renderDuffelCardFormCustomElement, onDuffelCardFormCardIdCreated, onDuffelCardFormCardIdCreationError, } from "./components/DuffelCardForm/DuffelCardFormCustomElement";
|