// 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 OwlCore.Events;
using StrixMusic.Sdk.BaseModels;
namespace StrixMusic.Sdk.CoreModels
{
///
/// A collection of URLs.
///
/// This interface should be implemented by a core.
public interface ICoreUrlCollection : ICoreCollection, IUrlCollectionBase, ICoreMember
{
///
/// Gets a requested number of s starting at the given offset in the backend.
///
/// The max number of items to return.
/// Get items starting at this index.
/// A cancellation token that may be used to cancel the ongoing task.
/// containing the requested items.
IAsyncEnumerable GetUrlsAsync(int limit, int offset, CancellationToken cancellationToken = default);
///
/// Adds a new url to the collection.
///
/// The url to insert.
/// the position to insert the url at.
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
Task AddUrlAsync(ICoreUrl url, int index, CancellationToken cancellationToken = default);
///
/// Fires when the urls are changed.
///
event CollectionChangedEventHandler? UrlsChanged;
}
}