using System.Collections.Generic;
using System.Threading.Tasks;
using MarkdownEditor.Models;

namespace MarkdownEditor.Services;

/// <summary>
/// Interface for session persistence operations.
/// Handles saving and restoring application session state (open files, tabs, etc.).
/// </summary>
public interface ISessionService
{
    /// <summary>
    /// Saves the current session state (open tabs with their file paths and unsaved content).
    /// </summary>
    /// <param name="tabs">Collection of tab information including file paths and content.</param>
    /// <param name="selectedTabIndex">Index of the currently selected tab.</param>
    /// <returns>Task representing the async operation.</returns>
    Task SaveSessionAsync(IEnumerable<SessionTabInfo> tabs, int selectedTabIndex);

    /// <summary>
    /// Loads the previously saved session state.
    /// </summary>
    /// <returns>The saved session data, or null if no session exists or loading fails.</returns>
    Task<SessionData?> LoadSessionAsync();

    /// <summary>
    /// Clears the saved session data.
    /// </summary>
    /// <returns>Task representing the async operation.</returns>
    Task ClearSessionAsync();
}
