export enum Status { Continue = 100, SwitchingProtocols = 101, Processing = 102, EarlyHints = 103,
OK = 200, Created = 201, Accepted = 202, NonAuthoritativeInfo = 203, NoContent = 204, ResetContent = 205, PartialContent = 206, MultiStatus = 207, AlreadyReported = 208, IMUsed = 226,
MultipleChoices = 300, MovedPermanently = 301, Found = 302, SeeOther = 303, NotModified = 304, UseProxy = 305, TemporaryRedirect = 307, PermanentRedirect = 308,
BadRequest = 400, Unauthorized = 401, PaymentRequired = 402, Forbidden = 403, NotFound = 404, MethodNotAllowed = 405, NotAcceptable = 406, ProxyAuthRequired = 407, RequestTimeout = 408, Conflict = 409, Gone = 410, LengthRequired = 411, PreconditionFailed = 412, RequestEntityTooLarge = 413, RequestURITooLong = 414, UnsupportedMediaType = 415, RequestedRangeNotSatisfiable = 416, ExpectationFailed = 417, Teapot = 418, MisdirectedRequest = 421, UnprocessableEntity = 422, Locked = 423, FailedDependency = 424, TooEarly = 425, UpgradeRequired = 426, PreconditionRequired = 428, TooManyRequests = 429, RequestHeaderFieldsTooLarge = 431, UnavailableForLegalReasons = 451,
InternalServerError = 500, NotImplemented = 501, BadGateway = 502, ServiceUnavailable = 503, GatewayTimeout = 504, HTTPVersionNotSupported = 505, VariantAlsoNegotiates = 506, InsufficientStorage = 507, LoopDetected = 508, NotExtended = 510, NetworkAuthenticationRequired = 511,}
export const STATUS_TEXT: Readonly<Record<Status, string>> = { [Status.Accepted]: "Accepted", [Status.AlreadyReported]: "Already Reported", [Status.BadGateway]: "Bad Gateway", [Status.BadRequest]: "Bad Request", [Status.Conflict]: "Conflict", [Status.Continue]: "Continue", [Status.Created]: "Created", [Status.EarlyHints]: "Early Hints", [Status.ExpectationFailed]: "Expectation Failed", [Status.FailedDependency]: "Failed Dependency", [Status.Forbidden]: "Forbidden", [Status.Found]: "Found", [Status.GatewayTimeout]: "Gateway Timeout", [Status.Gone]: "Gone", [Status.HTTPVersionNotSupported]: "HTTP Version Not Supported", [Status.IMUsed]: "IM Used", [Status.InsufficientStorage]: "Insufficient Storage", [Status.InternalServerError]: "Internal Server Error", [Status.LengthRequired]: "Length Required", [Status.Locked]: "Locked", [Status.LoopDetected]: "Loop Detected", [Status.MethodNotAllowed]: "Method Not Allowed", [Status.MisdirectedRequest]: "Misdirected Request", [Status.MovedPermanently]: "Moved Permanently", [Status.MultiStatus]: "Multi Status", [Status.MultipleChoices]: "Multiple Choices", [Status.NetworkAuthenticationRequired]: "Network Authentication Required", [Status.NoContent]: "No Content", [Status.NonAuthoritativeInfo]: "Non Authoritative Info", [Status.NotAcceptable]: "Not Acceptable", [Status.NotExtended]: "Not Extended", [Status.NotFound]: "Not Found", [Status.NotImplemented]: "Not Implemented", [Status.NotModified]: "Not Modified", [Status.OK]: "OK", [Status.PartialContent]: "Partial Content", [Status.PaymentRequired]: "Payment Required", [Status.PermanentRedirect]: "Permanent Redirect", [Status.PreconditionFailed]: "Precondition Failed", [Status.PreconditionRequired]: "Precondition Required", [Status.Processing]: "Processing", [Status.ProxyAuthRequired]: "Proxy Auth Required", [Status.RequestEntityTooLarge]: "Request Entity Too Large", [Status.RequestHeaderFieldsTooLarge]: "Request Header Fields Too Large", [Status.RequestTimeout]: "Request Timeout", [Status.RequestURITooLong]: "Request URI Too Long", [Status.RequestedRangeNotSatisfiable]: "Requested Range Not Satisfiable", [Status.ResetContent]: "Reset Content", [Status.SeeOther]: "See Other", [Status.ServiceUnavailable]: "Service Unavailable", [Status.SwitchingProtocols]: "Switching Protocols", [Status.Teapot]: "I'm a teapot", [Status.TemporaryRedirect]: "Temporary Redirect", [Status.TooEarly]: "Too Early", [Status.TooManyRequests]: "Too Many Requests", [Status.Unauthorized]: "Unauthorized", [Status.UnavailableForLegalReasons]: "Unavailable For Legal Reasons", [Status.UnprocessableEntity]: "Unprocessable Entity", [Status.UnsupportedMediaType]: "Unsupported Media Type", [Status.UpgradeRequired]: "Upgrade Required", [Status.UseProxy]: "Use Proxy", [Status.VariantAlsoNegotiates]: "Variant Also Negotiates",};
export type InformationalStatus = | Status.Continue | Status.SwitchingProtocols | Status.Processing | Status.EarlyHints;
export type SuccessfulStatus = | Status.OK | Status.Created | Status.Accepted | Status.NonAuthoritativeInfo | Status.NoContent | Status.ResetContent | Status.PartialContent | Status.MultiStatus | Status.AlreadyReported | Status.IMUsed;
export type RedirectStatus = | Status.MultipleChoices | Status.MovedPermanently | Status.Found | Status.SeeOther | Status.UseProxy | Status.TemporaryRedirect | Status.PermanentRedirect;
export type ClientErrorStatus = | Status.BadRequest | Status.Unauthorized | Status.PaymentRequired | Status.Forbidden | Status.NotFound | Status.MethodNotAllowed | Status.NotAcceptable | Status.ProxyAuthRequired | Status.RequestTimeout | Status.Conflict | Status.Gone | Status.LengthRequired | Status.PreconditionFailed | Status.RequestEntityTooLarge | Status.RequestURITooLong | Status.UnsupportedMediaType | Status.RequestedRangeNotSatisfiable | Status.ExpectationFailed | Status.Teapot | Status.MisdirectedRequest | Status.UnprocessableEntity | Status.Locked | Status.FailedDependency | Status.UpgradeRequired | Status.PreconditionRequired | Status.TooManyRequests | Status.RequestHeaderFieldsTooLarge | Status.UnavailableForLegalReasons;
export type ServerErrorStatus = | Status.InternalServerError | Status.NotImplemented | Status.BadGateway | Status.ServiceUnavailable | Status.GatewayTimeout | Status.HTTPVersionNotSupported | Status.VariantAlsoNegotiates | Status.InsufficientStorage | Status.LoopDetected | Status.NotExtended | Status.NetworkAuthenticationRequired;
export type ErrorStatus = ClientErrorStatus | ServerErrorStatus;
export function isInformationalStatus( status: Status,): status is InformationalStatus { return status >= 100 && status < 200;}
export function isSuccessfulStatus(status: Status): status is SuccessfulStatus { return status >= 200 && status < 300;}
export function isRedirectStatus(status: Status): status is RedirectStatus { return status >= 300 && status < 400;}
export function isClientErrorStatus( status: Status,): status is ClientErrorStatus { return status >= 400 && status < 500;}
export function isServerErrorStatus( status: Status,): status is ServerErrorStatus { return status >= 500 && status < 600;}
export function isErrorStatus(status: Status): status is ErrorStatus { return status >= 400 && status < 600;}