@qite/tide-booking-component
Version:
React Booking wizard & Booking product component for Tide
94 lines (93 loc) • 2.75 kB
TypeScript
import React, { ReactNode } from 'react';
import { FormikProps } from 'formik';
import { Country, RoomTraveler, Traveler, TravelersFormValues } from '../../booking-wizard/types';
import { CountryItem, PackagingEntry, PackagingEntryPax } from '@qite/tide-client';
export type TravelersFormField = {
type: string;
};
export type AgentOption = {
id: number | string;
name: string;
postalCode?: string;
location?: string;
};
export type TypeAheadOption = {
key: string;
value: string;
text: string;
};
export interface SharedTravelersSettings {
countries?: Country[];
formFields?: TravelersFormField[];
mainBookerFormFields?: TravelersFormField[];
}
export interface SharedTravelersFormProps {
formik: FormikProps<TravelersFormValues>;
translations: any;
travellersSettings?: SharedTravelersSettings;
countries?: CountryItem[];
agents?: AgentOption[];
bookingType?: string;
agentAdressId?: number;
travelersFirstStep?: boolean;
isUnavailable?: boolean;
useCompactForm?: boolean;
showAllCountries?: boolean;
showAgentSelection?: boolean;
initialShowAgents?: boolean;
renderPreviousButton?: () => ReactNode;
onBookingTypeChange?: (bookingType: string) => void;
}
export declare function createTraveler(
traveler: RoomTraveler,
followNumber: {
number: number;
},
personTranslation?: string,
isCompact?: boolean
): Traveler;
export declare function createInitialValuesFromRooms(
formRooms: {
adults: RoomTraveler[];
children: RoomTraveler[];
}[],
startDate?: string,
agentAdressId?: number,
personTranslation?: string,
isCompact?: boolean
): TravelersFormValues;
export declare function createInitialValuesFromEditablePackagingEntry(editablePackagingEntry: PackagingEntry, agentAdressId?: number): TravelersFormValues;
export declare function applyTravelersFormValuesToEditablePackagingEntry(
editablePackagingEntry: PackagingEntry,
values: TravelersFormValues
): {
pax: PackagingEntryPax[];
address: {
street: string;
houseNumber: string;
box: string;
zipCode: string;
place: string;
country: string;
travelAgentId: number;
phone: string;
email: string;
remarks?: string;
};
language?: string;
transactionId: string;
magicLink?: string;
dossierNumber: string;
bookingDate?: string | null;
price: number;
depositAmount: number;
rooms: import('@qite/tide-client').PackagingEntryRoom[];
lines: import('@qite/tide-client').PackagingEntryLine[];
status: import('@qite/tide-client').EntryStatus;
customStatusId?: number;
redirectUrl?: string;
returnPaymentUrl?: boolean;
remarks?: string;
};
declare const SharedTravelersForm: React.FC<SharedTravelersFormProps>;
export default SharedTravelersForm;