UNPKG

@duffel/components

Version:

Component library to build your travel product with Duffel.

25 lines (24 loc) 831 B
import React from "react"; export interface DuffelCardFormActions { saveCard: () => void; createCardForTemporaryUse: () => void; } export interface UseDuffelCardFormActionsHook { /** * The ref you should pass to the DuffelCardForm component. */ ref: React.RefObject<DuffelCardFormActions>; /** * Call this function to tell the component to save the card. */ saveCard: () => void; /** * Call this function to tell the component to create a card for temporary use. */ createCardForTemporaryUse: () => void; } /** * This hook abstracts the ref for convenience and readability. * Add `ref` to the `DuffelCardForm` `ref` prop and call the functions to trigger the actions you'd like. */ export declare function useDuffelCardFormActions(): UseDuffelCardFormActionsHook;