import { RoomstaySession } from '../../models/RoomstaySession';
/**
 * Session provider is in charge of handling the loading, saving and passing of the current Engine Session.
 *
 * Desired flow:
 *   * App Opened
 *   * Session Provider loaded
 *   * New User Session Created
 *   * User moves through the app, updating the session with vital details (current step, basket context )
 *   * User refreshes browser - session is re-loaded and user resumes where they left off
 *   * User proceeds to checkout.
 *   * Session is saved.
 *
 * Mini Booking Widget:
 *   * User loads mini booking widget, selects dates, people
 *   * Rates are loaded, and user selects a rate, redirecting to Full Booking Engine
 *   * Session Provider creates a SessionID to pass to redirected path
 *   * Session Provider loads the passed SessionID and loads the correct session
 *   * Resume to Desired Flow
 *
 * Re-targeting:
 * ---Since re-targeting will happen on client site, under client domain, localStorage will be preserved, ergo we can load the previous incomplete sessions back to the user
 *   * User lands on client Homepage
 *   * Session Provider loads previous incomplete sessions
 *   * A slider with details of previous baskets is shown back to the user
 *   * User clicks on a previous session and is brought to the Booking Engine
 *   * Resume to Desired Flow
 */
export default class SessionProvider {
    private currentSessionID;
    private hotelID;
    private cachedSession;
    private syncSession;
    private debouncedUpdateSession;
    private updateSessionWithAsync;
    setHotelID(hotelID: string): Promise<void>;
    initialize(sessionID?: number, source?: string): Promise<void>;
    setSessionID(sessionID?: number, source?: string): Promise<void>;
    /**
     * @returns the current session ID
     */
    getCurrentSessionID(): number;
    getSession(): RoomstaySession;
    saveSession(changedSession: RoomstaySession): Promise<void>;
    updateSession(partialSession: Partial<RoomstaySession>): Promise<void>;
    updateSessionAsync(partialSession: Partial<RoomstaySession>): Promise<void>;
    deleteSession(): Promise<void>;
    getAllSessions(): Promise<RoomstaySession[]>;
    /**
     * Function to find the right session from session storage, or local storage
     *
     * If one isn't found it is then created.
     */
    private findOrCreateSessionID;
    private findSession;
    private generateNewSession;
    private serializeSession;
    private unSerializeSession;
    private getSessionKey;
}
