UNPKG

@mojojs/core

Version:

Real-time web framework

53 lines (52 loc) 1.23 kB
import type { Readable } from 'node:stream'; import { Body } from '../body.js'; interface UserAgentResponseOptions { body: Readable; headers: string[]; httpVersion: string; statusCode: number; statusMessage: string; } /** * User-agent response class. */ export declare class UserAgentResponse extends Body { /** * HTTP version. */ httpVersion: string; /** * Response status code. */ statusCode: number; /** * Response status message. */ statusMessage: string; constructor(options: UserAgentResponseOptions); /** * Check if response has a `4xx` response status code. */ get isClientError(): boolean; /** * Check if response has a `4xx` or `5xx` response status code. */ get isError(): boolean; /** * Check if response has a `3xx` response status code. */ get isRedirect(): boolean; /** * Check if response has a `5xx` response status code. */ get isServerError(): boolean; /** * Check if response has a `2xx` response status code. */ get isSuccess(): boolean; /** * Get `Content-Type` header value. */ get type(): string | null; } export {};