@duffel/components 3.5.0--canary-6 → 3.5.0--canary-7
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 +0 -5
- package/components/DuffelCardForm/lib/useDuffelCardFormActions.d.ts +11 -10
- package/custom-elements.js +2 -2
- package/custom-elements.js.map +1 -1
- package/index.js +2 -2
- package/index.js.map +3 -3
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { DuffelCardFormProps } from "./lib/types";
|
|
3
|
-
type DuffelCardFormActions = {
|
|
4
|
-
saveCard: () => void;
|
|
5
|
-
createCardForTemporaryUse: () => void;
|
|
6
|
-
};
|
|
7
3
|
export declare const DuffelCardForm: React.ForwardRefExoticComponent<DuffelCardFormProps & React.RefAttributes<DuffelCardFormActions>>;
|
|
8
|
-
export {};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface DuffelCardFormActions {
|
|
3
|
+
saveCard: () => void;
|
|
4
|
+
createCardForTemporaryUse: () => void;
|
|
5
|
+
}
|
|
2
6
|
export interface UseDuffelCardFormActionsHook {
|
|
3
7
|
/**
|
|
4
|
-
* The
|
|
5
|
-
* You do not have have to modify this array directly, instead rely on `triggerSaveCard` and `triggerCreateCardForTemporaryUse` to update the array.
|
|
8
|
+
* The ref you should pass to the DuffelCardForm component.
|
|
6
9
|
*/
|
|
7
|
-
|
|
10
|
+
ref: React.RefObject<DuffelCardFormActions>;
|
|
8
11
|
/**
|
|
9
12
|
* Call this function to tell the component to save the card.
|
|
10
13
|
*/
|
|
11
|
-
|
|
14
|
+
saveCard: () => void;
|
|
12
15
|
/**
|
|
13
16
|
* Call this function to tell the component to create a card for temporary use.
|
|
14
17
|
*/
|
|
15
|
-
|
|
18
|
+
createCardForTemporaryUse: () => void;
|
|
16
19
|
}
|
|
17
20
|
/**
|
|
18
|
-
* This hook
|
|
19
|
-
* Add `
|
|
20
|
-
*
|
|
21
|
-
* In the background, this hook is setting the state on actions prop and the component's useEffect hook will trigger the action.
|
|
21
|
+
* This hook abstracts the ref for convinience and readability.
|
|
22
|
+
* Add `ref` to the `DuffelCardForm` `ref` prop and call the functions to trigger the actions you'd like.
|
|
22
23
|
*/
|
|
23
24
|
export declare function useDuffelCardFormActions(): UseDuffelCardFormActionsHook;
|