2020-05-20 19:59:11 +01:00
|
|
|
using System.Threading;
|
2020-05-05 04:26:37 +01:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using SpotifyAPI.Web.Http;
|
|
|
|
|
|
|
|
namespace SpotifyAPI.Web
|
|
|
|
{
|
|
|
|
public interface IPaginator
|
|
|
|
{
|
2020-05-20 19:59:11 +01:00
|
|
|
Task<List<T>> PaginateAll<T>(Paging<T> firstPage, IAPIConnector connector);
|
|
|
|
Task<List<T>> PaginateAll<T, TNext>(
|
|
|
|
Paging<T, TNext> firstPage,
|
|
|
|
Func<TNext, Paging<T, TNext>> mapper,
|
|
|
|
IAPIConnector connector
|
|
|
|
);
|
2020-05-05 16:52:23 +01:00
|
|
|
|
2020-05-20 19:59:11 +01:00
|
|
|
#if NETSTANDARD2_1
|
|
|
|
IAsyncEnumerable<T> Paginate<T>(Paging<T> firstPage, IAPIConnector connector, CancellationToken cancel = default);
|
|
|
|
IAsyncEnumerable<T> Paginate<T, TNext>(
|
|
|
|
Paging<T, TNext> firstPage,
|
|
|
|
Func<TNext, Paging<T, TNext>> mapper,
|
|
|
|
IAPIConnector connector,
|
|
|
|
CancellationToken cancel = default
|
|
|
|
);
|
|
|
|
#endif
|
2020-05-05 04:26:37 +01:00
|
|
|
}
|
|
|
|
}
|