using System.IO;
using xCommons.Models;
using System.Threading;
using xCommons.Constants;
using System.Threading.Tasks;
namespace xCommons.Interfaces
{
public interface IXFileTypeDetector
{
///
/// Detect MIME Type based on File Name ...
///
///
///
string DetectFromExtension(string fileName);
///
/// Detect XFileExtensions based on File Name ...
///
///
///
XFileExtensions? DetectExtension(string fileName);
///
/// Detect Type based on File's Magic Byte ...
///
///
///
///
Task DetectFromMagicBytesAsync(
Stream stream,
CancellationToken cancellationToken = default
);
///
/// Complexity Detect Type ...
///
///
///
///
///
///
Task DetectAsync(
string fileName,
string providedMimeType,
Stream stream,
CancellationToken cancellationToken = default
);
///
/// Check a File Extension is Known or not ...
///
///
///
bool IsKnownExtension(string fileName);
}
}