2023-07-03 23:24:35 -04:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Net.Http;
|
|
|
|
using System.Text.Json.Serialization.Metadata;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Luski.net.JsonTypes.BaseTypes;
|
|
|
|
using Luski.net.Structures;
|
|
|
|
using Luski.net.Structures.Public;
|
2024-03-20 23:18:34 -04:00
|
|
|
using Luski.Shared.PublicServers.V1.ServerToClient.HTTP;
|
2023-07-03 23:24:35 -04:00
|
|
|
|
|
|
|
namespace Luski.net.Interfaces;
|
|
|
|
|
|
|
|
public interface IServer
|
|
|
|
{
|
|
|
|
public IAppUser IAppUser { get; }
|
|
|
|
public string Cache { get; }
|
|
|
|
public void SendServer<Tvalue>(Tvalue Payload, JsonTypeInfo<Tvalue> jsonTypeInfo) where Tvalue : IncomingWSS;
|
|
|
|
|
|
|
|
public HttpResponseMessage GetFromServer(string Path, CancellationToken CancellationToken,
|
|
|
|
params KeyValuePair<string, string?>[] Headers);
|
|
|
|
|
|
|
|
public Task GetFromServer(string Path, string File, CancellationToken CancellationToken,
|
|
|
|
params KeyValuePair<string, string?>[] Headers);
|
|
|
|
|
|
|
|
public Task<Tresult> GetFromServer<Tresult>(string Path, JsonTypeInfo<Tresult> Type,
|
|
|
|
CancellationToken CancellationToken, params KeyValuePair<string, string?>[] Headers)
|
2024-03-20 23:18:34 -04:00
|
|
|
where Tresult : STC, new();
|
2023-07-03 23:24:35 -04:00
|
|
|
|
|
|
|
public Task<Tresult> SendServer<Tvalue, Tresult>(string Path, Tvalue Payload,
|
|
|
|
JsonTypeInfo<Tvalue> jsonTypeInfo, JsonTypeInfo<Tresult> ReturnjsonTypeInfo,
|
|
|
|
CancellationToken CancellationToken, params KeyValuePair<string, string?>[] Headers)
|
2024-03-20 23:18:34 -04:00
|
|
|
where Tvalue : IWebRequest where Tresult : STC, new();
|
2023-07-03 23:24:35 -04:00
|
|
|
|
|
|
|
public Task<Tresult> SendServer<Tresult>(string Path, string File, JsonTypeInfo<Tresult> ReturnjsonTypeInfo,
|
|
|
|
CancellationToken CancellationToken, params KeyValuePair<string, string?>[] Headers)
|
2024-03-20 23:18:34 -04:00
|
|
|
where Tresult : STC, new();
|
2023-07-03 23:24:35 -04:00
|
|
|
|
|
|
|
}
|