import type Route from "../../../classes/Route"; import ValueCollection from "../../../classes/ValueCollection"; import type { Implementation } from "../../implementation"; import type { FullServerOptions } from "../../structures/ServerOptions"; import type { ClassContexts, EndFn, ErrorCallbacks, FinishCallbacks, RatelimitCallbacks, RealAny } from ".."; import Logger from "../../../classes/Logger"; import type Channel from "../../../classes/Channel"; import type { CompressionAlgorithm } from "../../global"; import type HttpRequestContext from "../../../classes/request/HttpRequestContext"; export default class GlobalContext { implementation: Implementation; constructor(options: FullServerOptions, implementation: Implementation, classContexts: ClassContexts); /** * The Routes available for searching * @since 9.0.0 */ routes: { http: Route<'http'>[]; ws: Route<'ws'>[]; static: Route<'static'>[]; }; /** * The Options for the Server * @since 9.0.0 */ options: FullServerOptions; /** * The Logger for Internal Events * @since 9.0.0 */ logger: Logger; /** * Channels that were used with the server * @since 9.0.0 */ channels: Channel[]; /** * Class Contexts used to create the ctr object * @since 9.0.0 */ classContexts: ClassContexts; /** * The Error handlers * @since 9.0.0 */ errorHandlers: ErrorCallbacks; /** * The Finish handlers * @since 9.0.0 */ finishHandlers: FinishCallbacks; /** * The Ratelimit Handlers * @since 9.0.0 */ rateLimitHandlers: RatelimitCallbacks; /** * The Not Found handler * @since 9.0.0 */ notFoundHandler: ((ctr: HttpRequestContext) => RealAny) | null; /** * The HTTP callback handler * @since 9.0.0 */ httpHandler: ((ctr: HttpRequestContext, end: EndFn) => RealAny) | null; /** * Content Type Mappings * @since 9.0.0 */ contentTypes: ValueCollection; /** * Rate Limit Store * @since 9.0.0 */ rateLimits: ValueCollection<`http+${string}-${number}` | `ws+${string}-${number}`, { hits: number; end: number; }, { hits: number; end: number; }>; /** * Internal Request Identifiers * @since 9.3.0 */ internalRequestIdentifiers: Set; /** * Internal Channel String Identifiers * @since 9.8.0 */ internalChannelStringIdentifiers: Map>; /** * Caches for various methods * @since 9.0.0 */ cache: { /** * The Cached base64 encoded proxy credentials * @since 9.0.0 */ proxyCredentials: string; /** * An Empty ArrayBuffer * @since 9.7.0 */ emptyArrayBuffer: ArrayBuffer; /** * Cached ArrayBuffer Texts * @since 9.0.0 */ arrayBufferTexts: { proxy_auth_invalid: ArrayBuffer; proxy_auth_required: ArrayBuffer; route_not_found: ArrayBuffer; rate_limit_exceeded: ArrayBuffer; }; /** * The Cache for the Compression Methods Header parsing * @since 9.0.0 */ compressionMethods: ValueCollection; /** * The Cache for static files * @since 9.0.0 */ staticFiles: ValueCollection], [path: string, route: Route<"static">]>; }; }