import { createNylasExistingBookingSession } from './services/api/scheduling'; import { FormSubmissionResult } from './types/submissions'; import { SchedulingBooking } from './services/schedulingHandlers'; declare function getSchedulingFormSubmissionResult(submissionId: string, schedulingBooking: SchedulingBooking): Promise; /** * Pass in query string parameters after a redirect back to your app after a * booking is processed. Will return a SchedulingBooking and the submission * result from the original submission before redirecting to * `scheduling.bookingUrl`. If the booking has been rescheduled, the submission * result will not be returned. * * #### Example * * ```js * import queryString from 'query-string' * * const query = queryString.parse(window.location.search) * * const { booking, formSubmissionResult } = * await schedulingService.handleSchedulingQuerystring(query) * ``` * * @param options * @returns */ declare function handleSchedulingQuerystring({ start_time, end_time, location, submissionId, isReschedule, }: Record): Promise<{ booking: SchedulingBooking; formSubmissionResult?: FormSubmissionResult; }>; /** * Pass in query string parameters after navigation to your app via a valid * cancellation link. * * #### Example * * ```js * import queryString from 'query-string' * * const query = queryString.parse(window.location.search) * * const bookingToCancel = * await schedulingService.handleCancelSchedulingBookingQuerystring(query) * ``` * * @param options * @returns */ declare function handleCancelSchedulingBookingQuerystring({ nylasEditHash, submissionId, startTime, endTime, eventName, location, timezone, cancellationPolicy, }: Record): { /** The nylas edit hash associated with the booking */ nylasEditHash: string; /** The unique identifier for the submission associated with the booking */ submissionId: string; /** The start time of the booking */ startTime: Date; /** The end time of the booking */ endTime: Date; /** The event name */ eventName: string; /** The location of the event */ location: string; /** The timezone the booking was booked in */ timezone: string; /** * The policy to display to users when asked why they are cancelling the * booking */ cancellationPolicy?: string; }; /** * Create a Nylas Session * * #### Example * * ```js * const { * sessionId, * configurationId, * bookingRef, * name, * email, * formSubmissionResult, * } = await schedulingService.createNylasNewBookingSession( * '89c6e98e-f56f-45fc-84fe-c4fc62331d34', * ) * // use sessionId and configurationId/bookingRef to create or modify nylas bookings * // use formSubmissionResult to execute post submission action for form * ``` * * @param submissionId * @param abortSignal * @returns */ declare function createNylasNewBookingSession(submissionId: string, abortSignal: AbortSignal): Promise> & { /** * A callback function run after the booking has been confirmed to prevent * the user from making another booking against this form submission and * execute post submission action. */ onBookingConfirmed: (schedulingBooking: SchedulingBooking) => Promise; }>; export { SchedulingBooking, handleSchedulingQuerystring, handleCancelSchedulingBookingQuerystring, createNylasExistingBookingSession, createNylasNewBookingSession, getSchedulingFormSubmissionResult, };