// Copyright (c) Arlo Godfrey. All Rights Reserved.
// Licensed under the GNU Lesser General Public License, Version 3.0 with additional terms.
// See the LICENSE, LICENSE.LESSER and LICENSE.ADDITIONAL files in the project root for more information.
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using StrixMusic.Sdk.AdapterModels;
using StrixMusic.Sdk.BaseModels;
using StrixMusic.Sdk.CoreModels;
namespace StrixMusic.Sdk.AppModels
{
///
/// Provides various search-related activities.
///
/// Instances of this class may contain data merged from one or more sources.
public interface ISearch : ISearchBase, IAppModel, IMerged
{
///
/// Gets search results for a given query.
///
/// The search query.
/// A cancellation token that may be used to cancel the ongoing task.
/// A task representing the async operation. Value is .
Task GetSearchResultsAsync(string query, CancellationToken cancellationToken = default);
///
/// Gets the recent search queries.
///
/// A cancellation token that may be used to cancel the ongoing task.
/// The recent search queries.
public IAsyncEnumerable GetRecentSearchQueries(CancellationToken cancellationToken = default);
///
/// Contains items that the user has recently selected from the search results.
///
#warning TODO needs a changed event to facilitate merging in new sources with non-null values.
ISearchHistory? SearchHistory { get; }
}
}