// Generated by dts-bundle-generator v9.5.1 import { Serve, Server, ServerWebSocket, ServerWebSocketSendStatus } from 'bun'; import { LRUCache } from 'lru-cache'; import { BrotliOptions, ZlibOptions, ZstdOptions } from 'node:zlib'; import { RequireAtLeastOne, TypedArray } from 'type-fest'; export type Registration = { matcher: (subject: string) => null | Record; pattern: string; regex: RegExp; methodFilter: null | ((subject: string) => boolean); target: T; }; export type Result = Array<[ T, Record ]>; declare class RouteMatcher { registered: Registration[]; match(method: string, subject: string, fallbacks?: Target[]): Result; add(method: string, pattern: string | RegExp, target: Target): this; detectPotentialDos(detector: any, config?: any): void; } declare class MatcherWithCache extends RouteMatcher { cache: LRUCache; constructor(size?: number); match(method: string, subject: string, fallbacks?: Target[]): any; } declare class SocketContext> { ws?: ServerWebSocket>; server: Server; url: URL; params: ParamsShape; data: UpgradeShape; type: SocketEventName; /** * Construct a new SocketContext instance for a WebSocket connection lifecycle. * * @param server - The Bun server handling this connection. * @param url - The request URL for this socket route. * @param params - Route params extracted from the URL pattern. * @param data - Arbitrary data attached during the upgrade handler. */ constructor(server: Server, url: URL, params: ParamsShape, data: UpgradeShape); /** * The client or load balancer IP address for this connection. */ get remoteAddress(): string; /** * The current ready state of the WebSocket. * 0 = connecting, 1 = open, 2 = closing, 3 = closed */ get readyState(): Bun.WebSocketReadyState; /** * Set the preferred binary type for received messages. * * @param type - 'nodebuffer' | 'arraybuffer' | 'uint8array' */ set binaryType(type: "nodebuffer" | "arraybuffer" | "uint8array"); /** * Get the preferred binary type for received messages. */ get binaryType(): "nodebuffer" | "arraybuffer" | "uint8array" | undefined; /** * Send a message to the connected client. * * - Strings are sent as text frames. * - Buffers/typed arrays are sent as binary frames. * - Other objects are JSON.stringified and sent as text frames. * * @param message - The payload to send. * @param compress - Whether to apply permessage-deflate compression. */ send(message: any, compress?: boolean): number; /** * Close the connection with an optional status code and reason. * * @param status - WebSocket close code (1000-4999). Optional. * @param reason - Human-readable reason for closing. Optional. * @returns This SocketContext for chaining. */ close(status?: number, reason?: string): this; /** * Immediately terminate the connection without a close frame. * * Use sparingly; the client will see an abrupt disconnect with no reason. * * @returns This SocketContext for chaining. */ terminate(): this; /** * Subscribe this connection to a pub-sub topic. * * @param topic - The topic name. * @returns This SocketContext for chaining. */ subscribe(topic: string): this; /** * Unsubscribe this connection from a pub-sub topic. * * @param topic - The topic name. * @returns This SocketContext for chaining. */ unsubscribe(topic: string): this; /** * Check whether this connection is subscribed to a topic. * * @param topic - The topic name. * @returns True if subscribed. */ isSubscribed(topic: string): boolean; /** * Cork batches multiple sends into a single frame flush. Most users do not need this. * * If a callback is provided, all sends within the callback are batched. * * @param callback - Function within which to perform batched sends. */ cork(callback: (ctx: SocketContext) => void): void; /** * Publish a message to all clients subscribed to a topic. * * - Strings and binary data are sent as-is. * - Other objects are JSON.stringified before publishing. * * @param topic - The topic name. * @param message - The payload to publish. * @param compress - Whether to apply compression for supported payloads. */ publish(topic: string, message: any, compress?: boolean): number; /** * Send a ping frame (optionally with data) to keep the connection alive. * * If data is not a string or BufferSource, it is JSON.stringified. * * @param data - Optional ping payload. * @returns The send status from Bun. */ ping(data?: string | BufferSource | any): ServerWebSocketSendStatus; /** * Send a pong frame (optionally with data) in response to a ping. * * If data is not a string or BufferSource, it is JSON.stringified. * * @param data - Optional pong payload. * @returns The send status from Bun. */ pong(data?: string | BufferSource | any): ServerWebSocketSendStatus; } export type SocketEventName = "upgrade" | "open" | "message" | "close" | "drain" | "ping" | "pong" | "error"; declare class SocketMessage { readonly type: T; private readonly _rawMessage; /** * Create a SocketMessage for a given event type. * * @param type - The socket event type that produced this message. * @param rawMessage - The raw payload: a string (text frame) or Buffer (binary frame). */ constructor(type: T, rawMessage: string | Buffer); /** * Get the original raw payload (string or Buffer) without conversion. */ raw(): string | Buffer; /** * Get the payload as text using the specified encoding. * * @param encoding - The string encoding to use. Defaults to 'utf-8'. * @returns The payload as a string. */ text(encoding?: BufferEncoding): string; /** * Alias for text(); allows using template string coercion as well. * * @param encoding - The string encoding to use. Defaults to 'utf-8'. * @returns The payload as a string. */ toString(encoding?: BufferEncoding): string; /** * Get the payload as a Node/Bun Buffer. * * If the original payload was a string, a new Buffer is created. */ buffer(): Buffer; /** * Get the payload as a tightly-sized ArrayBuffer copy. * * This method copies only the message bytes to a new ArrayBuffer. */ arrayBuffer(): ArrayBuffer; /** * Get the payload as a ReadableStream. */ readableStream(): ReadableStream>; /** * Attempt to parse the payload as JSON. * * @returns The parsed object, or undefined if JSON.parse fails. */ json(): any; } export type WsDataShape> = { sc: SocketContext; }; export type SocketUpgradeHandler = Record> = (context: Context

, next: NextFunction) => U | Promise; export type SocketPlainHandler = (context: SocketContext) => void; export type SocketMessageHandler = (context: SocketContext, message: SocketMessage) => void; export type SocketErrorHandler = (context: SocketContext, error: Error) => void; export type SocketCloseHandler = (context: SocketContext, status: number, reason: string) => void; export type BunshineHandlers = Record> = RequireAtLeastOne<{ upgrade: SocketUpgradeHandler; error: SocketErrorHandler; open: SocketPlainHandler; message: SocketMessageHandler; close: SocketCloseHandler; drain: SocketPlainHandler; ping: SocketMessageHandler; pong: SocketMessageHandler; }>; export type BunHandlers = { open: (ws: ServerWebSocket) => void; message: (ws: ServerWebSocket, data: any) => void; close: (ws: ServerWebSocket, code: number, reason: string) => void; drain: (ws: ServerWebSocket) => void; ping: (ws: ServerWebSocket, data: any) => void; pong: (ws: ServerWebSocket, data: any) => void; }; export type SocketEventType = "open" | "message" | "close" | "drain" | "ping" | "pong"; export declare class SocketRouter { httpRouter: HttpRouter; routeMatcher: RouteMatcher>; handlers: BunHandlers; constructor(router: HttpRouter); at:

= Record, U = any>(path: string, handlers: BunshineHandlers) => this; private _fallbackError; private _createHandler; } export type NextFunction = () => Promise; export type SingleHandler = Record> = (context: Context, next: NextFunction) => Response | void | Promise; export type Handler = Record> = SingleHandler | Handler[]; export type Middleware = Record> = SingleHandler | Handler[]; export type ListenOptions = Omit, "fetch" | "websocket"> | number; declare const httpMethods: string[]; export type HttpMethods = (typeof httpMethods)[number]; export type HttpRouterOptions = { cacheSize?: number; }; export type EmitUrlOptions = { verbose?: boolean; to?: (message: string) => void; date?: boolean; }; export declare class HttpRouter { readonly version: string; locals: Record; server: Server | undefined; routeMatcher: MatcherWithCache; _wsRouter?: SocketRouter; onNotFound: (...handlers: Handler[]) => HttpRouter; onError: (...handlers: Handler[]) => HttpRouter; private _on404Handlers; private _on500Handlers; startupTook: number; /** * Create a new HttpRouter instance. * * @param options Optional configuration. * @param options.cacheSize Maximum number of compiled matchers to cache. Defaults to 4000. */ constructor(options?: HttpRouterOptions); /** * Start the HTTP server. * * You can pass either a port number or a Bun.Serve options object (without fetch/websocket). * * @param portOrOptions Port number or Bun.serve options. Defaults to {}. * Use port 0 or empty arguments to use a random port * @returns The created Bun server instance. */ listen(portOrOptions?: ListenOptions): Server; /** * Stop the HTTP server */ close(closeActiveConnections: boolean): Promise; /** * Emit the server URL to a logger function once the server is started. * * @param options Verbosity and formatting options. * @param options.verbose When true, include environment/runtime details. * @param options.to Logger function to write the message to. Defaults to console.log. * @param options.date When true, prefix the message with an ISO timestamp. */ emitUrl({ verbose, to, date, }?: EmitUrlOptions): void; /** * Build a Bun.serve configuration object using this router's handlers. * * If a SocketRouter has been initialized, its websocket handlers are attached. * * @param options Bun.serve options (except fetch/websocket which bunshine adds). * @returns A Bun.Serve.Options object ready to be passed to Bun.serve. */ getExport(options?: Omit, "fetch" | "websocket">): Serve.Options; /** * Access the WebSocket router for this HTTP router. * * Lazily initializes a SocketRouter on first access and returns it. * * @returns The SocketRouter instance. */ get socket(): SocketRouter; /** * Dynamically import and register route files from a directory using a glob. * * Each matched module whose default export is a function will be invoked with this router. * * @param scanPath Absolute or relative directory path to scan. * @param glob Glob pattern for files to include. Defaults to a recursive TypeScript glob. * @returns List of absolute file paths that were registered. */ registerFileRoutes({ path: scanPath, glob, }: { path: string; glob?: string; }): Promise; /** * Register one or more handlers for a route path and HTTP method(s). * * Handlers can be nested arrays; they will be flattened and added in order. * * @template ParamsShape The shape of route params available on the Context. * @param verbOrVerbs Single HTTP method or array of methods. * @param path Path pattern as a string or RegExp. RegExp is discouraged * because you may introduce Regex Denial of Service vulnerabilities * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ on = Record>(verbOrVerbs: HttpMethods | HttpMethods[], path: string | RegExp, ...handlers: Handler[]): this; /** * Register handlers for all HTTP methods on a path. * * @template ParamsShape The shape of route params available on the Context. * @param path Path pattern as a string or RegExp. RegExp is discouraged * because you may introduce Regex Denial of Service vulnerabilities * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ all = Record>(path: string | RegExp, ...handlers: Handler[]): this; /** * Register handlers for HTTP GET on a path. * * @template ParamsShape The shape of route params available on the Context. * @param path Path pattern as a string or RegExp. * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ get = Record>(path: string | RegExp, ...handlers: Handler[]): this; /** * Register handlers for HTTP PUT on a path. * * @template ParamsShape The shape of route params available on the Context. * @param path Path pattern as a string or RegExp. * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ put = Record>(path: string | RegExp, ...handlers: Handler[]): this; /** * Register handlers for HTTP HEAD on a path. * * @template ParamsShape The shape of route params available on the Context. * @param path Path pattern as a string or RegExp. * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ head = Record>(path: string | RegExp, ...handlers: Handler[]): this; /** * Register handlers for HTTP POST on a path. * * @template ParamsShape The shape of route params available on the Context. * @param path Path pattern as a string or RegExp. * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ post = Record>(path: string | RegExp, ...handlers: Handler[]): this; /** * Register handlers for HTTP PATCH on a path. * * @template ParamsShape The shape of route params available on the Context. * @param path Path pattern as a string or RegExp. * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ patch = Record>(path: string | RegExp, ...handlers: Handler[]): this; /** * Register handlers for HTTP TRACE on a path. * * @template ParamsShape The shape of route params available on the Context. * @param path Path pattern as a string or RegExp. * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ trace = Record>(path: string | RegExp, ...handlers: Handler[]): this; /** * Register handlers for HTTP DELETE on a path. * * @template ParamsShape The shape of route params available on the Context. * @param path Path pattern as a string or RegExp. * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ delete = Record>(path: string | RegExp, ...handlers: Handler[]): this; /** * Register handlers for HTTP OPTIONS on a path. * * @template ParamsShape The shape of route params available on the Context. * @param path Path pattern as a string or RegExp. * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ options = Record>(path: string | RegExp, ...handlers: Handler[]): this; /** * Register handlers for HTTP HEAD and GET on a path. * * Useful for resources where HEAD should resolve to the same handlers as GET. * * @template ParamsShape The shape of route params available on the Context. * @param path Path pattern as a string or RegExp. * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ headGet = Record>(path: string | RegExp, ...handlers: Handler[]): this; /** * Register global middleware for all routes and methods. * * This is equivalent to calling router.all('*', handlers). * * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ use: (...handlers: Handler[]) => this; /** * Register handlers to run when no route matches (404). * * Handlers are executed in order; call next() to run the next 404 handler. * If none produce a Response, a default 404 response is returned. * * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ on404: (...handlers: Handler[]) => this; /** * Register handlers to run when an error occurs (500). * * If a handler throws a Response, it will be sent to the client immediately. * Handlers are executed in order until one returns a Response or all run. * * @param handlers One or more handler functions or arrays of handlers. * @returns This HttpRouter instance for chaining. */ on500: (...handlers: Handler[]) => this; /** * Bun.serve fetch handler bound to this router. * * Creates a Context for the incoming request and dispatches it based on the * HTTP method and URL pathname. Supports X-HTTP-Method-Override header. * * @param request The incoming Request object. * @param server The Bun server instance. * @returns A Response resolved from route or error handlers. */ fetch: (request: Request, server: Server) => Promise; /** * Internal request dispatcher that runs matching route handlers and error handlers. * * - Routes are matched using the method and pathname against the route matcher. * - Handlers are invoked sequentially via a next() function until one returns a Response. * - If a handler throws a Response, it is returned directly to the client. * - If an error is thrown, 500 handlers registered via on500 are executed in order. * - If no route matches, 404 handlers registered via on404 are considered, otherwise a default 404 is returned. * * @param method HTTP method for the request. * @param pathname URL pathname to match. * @param context Request context object. * @returns A Response from a route, a 404 fallback, or a 500 fallback. */ dispatch: (method: HttpMethods, pathname: string, context: Context) => Promise; } export type FileLike = string | Blob | Uint8Array | ArrayBuffer; export type FileResponseOptions = { chunkSize?: number; disposition?: "inline" | "attachment" | "form-data"; acceptRanges?: boolean; sendLastModified?: boolean; headers?: HeadersInit; }; /** A shorthand for `new Response(JSON.stringify(data), { headers: { 'Content-type': 'application/json' } })` */ export function jsonResponse(data: any, init?: ResponseInit): Response; declare function redirect(url: string, status?: number): Response; export type SseSend = (eventName: string, data?: string | object, id?: string, retry?: number) => void | Promise; export type SseClose = () => void | Promise; export type SseSetupFunction = (send: SseSend, close: SseClose) => void | (() => void); export type Factory = (body: string, init?: ResponseInit) => Response; export function factory(contentType: string): Factory; /** A shorthand for `new Response(text, { headers: { 'Content-type': 'text/plain' } })` */ export declare const plaintextResponse: Factory; /** A shorthand for `new Response(js, { headers: { 'Content-type': 'text/javascript' } })` */ export declare const jsResponse: Factory; /** A shorthand for `new Response(html, { headers: { 'Content-type': 'text/html' } })` */ export declare const htmlResponse: Factory; /** A shorthand for `new Response(xml, { headers: { 'Content-type': 'text/xml' } })` */ export declare const xmlResponse: Factory; /** A shorthand for `new Response(html, { headers: { 'Content-type': 'text/css' } })` */ export declare const cssResponse: Factory; /** * Context is created per incoming request and is passed to every route handler and middleware. * It provides convenient access to the Request, related server/router objects, parsed URL, * route params, a locals bag for per-request state, and several response factory helpers. * * Generics: * - ParamsShape: shape of the `params` object extracted from the matched route placeholders. * * Typical usage: * * app.get('/hello/:name', (c) => { * const { name } = c.params; * return c.text(`Hello ${name}!`); * }); */ export declare class Context = Record> { /** The raw request object */ request: Request; /** * Alias for `request`. * Provided for convenience if you prefer shorter property names. */ req: Request; /** * The Bun server instance that accepted this request. * Useful for low-level information like `c.ip` via `server.requestIP()`. */ server: Server; /** * The HttpRouter instance handling this request. * You typically won't need this inside handlers, but it can be useful for advanced patterns. */ app: HttpRouter; /** * The request params parsed from the matched route's placeholder segments. * Example: for route "/users/:id" and path "/users/123", params.id === "123". */ params: ParamsShape; /** * A per-request mutable store for middleware/handlers to share data. * Cleared after the request is completed. */ locals: Record; /** * A URL object constructed with `new URL(request.url)`. * Handy for accessing pathname, searchParams, origin, etc. */ url: URL; /** * The Date when the request was received and the Context was created. * Useful for logging and response headers. */ date: Date; /** Epoch milliseconds captured when the request was received (from Date.now()) */ now: number; /** * If an error was thrown while handling the request, it can be stored here * by error-handling middleware for inspection/logging. */ error: Error | null; /** * Construct a new Context for a single incoming request. * * @param request - The native Request object received by the server. * @param server - The Bun Server instance handling the request. * @param app - The HttpRouter instance your routes are registered on. */ constructor(request: Request, server: Server, app: HttpRouter); /** * Get the client's remote address information, if available. * * Returns null when Bun cannot determine the client IP (e.g., Unix sockets). * Note: If your app is behind a reverse proxy or load balancer, prefer * using the appropriate forwarded headers from `c.request.headers`. */ get ip(): { address: string; family: string; port: number; } | null; /** * Create a plain text Response with Content-Type: text/plain; charset=utf-8. * * @param body - The response body as a string. * @param init - Optional ResponseInit (headers, status, etc). Existing headers are preserved. * @returns Response */ text: Factory; /** * Create a JavaScript Response with Content-Type: text/javascript; charset=utf-8. * * @param body - The JS source as a string. * @param init - Optional ResponseInit to override status/headers. * @returns Response */ js: Factory; /** * Create an HTML Response with Content-Type: text/html; charset=utf-8. * * @param body - The HTML markup as a string. * @param init - Optional ResponseInit to override status/headers. * @returns Response */ html: Factory; /** * Create a CSS Response with Content-Type: text/css; charset=utf-8. * * @param body - The CSS stylesheet as a string. * @param init - Optional ResponseInit to override status/headers. * @returns Response */ css: Factory; /** * Create an XML Response with Content-Type: text/xml; charset=utf-8. * * @param body - The XML document as a string. * @param init - Optional ResponseInit to override status/headers. * @returns Response */ xml: Factory; /** * Create a JSON Response with Content-Type: application/json; charset=utf-8. * * Internally stringifies the provided data with JSON.stringify. * @param data - Any JSON-serializable value. * @param init - Optional ResponseInit to override status/headers. * @returns Response */ json: typeof jsonResponse; /** * Create a redirect Response with a Location header. * * @param url - The absolute or relative URL to redirect to. * @param status - HTTP status code (default 302). Common values: 301, 302, 303, 307, 308. * @returns Response */ redirect: typeof redirect; /** * Send a file or arbitrary binary/text content with appropriate headers. * * - Supports HTTP range requests automatically when the incoming request * contains a `Range` header. * - When given a file path or BunFile, will infer Content-Type from extension * if not provided in options. * * @param pathOrData - A filesystem path, BunFile, Blob, ArrayBuffer, or string content. * @param fileOptions - Options such as contentType, downloadName, etag, cache control, etc. * @returns Response */ file: (pathOrData: FileLike, fileOptions?: FileResponseOptions) => Promise; /** * Create a Server-Sent Events (SSE) Response with Content-Type: text/event-stream. * * The provided setup callback will be invoked with an SSE controller that lets you * send events. The stream will close automatically when the request's AbortSignal * is aborted (client disconnect) or when you close it from the setup. * * @param setup - A function to set up event emission and lifecycle. * @param init - Optional ResponseInit to add/override headers such as Cache-Control. * @returns Response */ sse: (setup: SseSetupFunction, init?: ResponseInit) => Response; /** * Get the elapsed time in milliseconds since the Context was created. * * @param precision - Number of decimal places to include (default 0). * @returns Milliseconds elapsed, rounded to the given precision. */ took: (precision?: number) => number; } export type ApplyHandlerIfArgs = { requestCondition?: (c: Context) => Promise | boolean; responseCondition?: (c: Context, resp: Response) => Promise | boolean; handler: Handler; }; export declare function applyHandlerIf(conditions: ApplyHandlerIfArgs): Middleware; export type CompressionOptions = { prefer: "zstd" | "br" | "gzip" | "none"; br: BrotliOptions; gzip: ZlibOptions; zstd: ZstdOptions; minSize: number; maxSize: number; exceptWhen: (context: Context, response: Response) => boolean | Promise; }; export declare const compressionDefaults: { prefer: "gzip"; br: BrotliOptions; gzip: ZlibOptions; zstd: ZstdOptions; minSize: number; maxSize: number; exceptWhen: () => boolean; }; export declare function compression(options?: Partial): Middleware; export type CorsOptions = { origin?: string | RegExp | Array | boolean | ((incomingOrigin: string, context: Context) => string | string[] | boolean | undefined | null); allowMethods?: string[]; allowHeaders?: string[]; maxAge?: number; credentials?: boolean; exposeHeaders?: string[]; exceptWhen?: (context: Context, response: Response) => boolean | Promise; }; export declare const corsDefaults: { origin: string; allowMethods: string[]; maxAge: undefined; credentials: undefined; allowHeaders: never[]; exposeHeaders: never[]; exceptWhen: () => boolean; }; export declare function cors(options?: CorsOptions): Middleware; export type LoggerOptions = { writer?: (msg: string) => void; exceptWhen?: (context: Context, response: Response | null) => boolean | Promise; }; export declare function devLogger(options?: LoggerOptions): Middleware; export type EtagHashCalculator = (context: Context, response: Response) => Promise<{ buffer: ArrayBuffer | TypedArray | Buffer; hash: string; }>; export type EtagOptions = { calculator?: EtagHashCalculator; maxSize?: number; exceptWhen?: (context: Context, response: Response) => boolean; overwrite?: boolean; }; export declare function etags({ calculator, maxSize, // 2GB exceptWhen, overwrite, }?: EtagOptions): Middleware; export declare function defaultEtagsCalculator(_: Context, resp: Response): Promise<{ buffer: ArrayBuffer; hash: string; }>; export type HeaderValue = string | ((c: Context, resp: Response) => string | null | Promise); export type HeaderValues = Record; export type HeaderCondition = (c: Context, resp: Response) => boolean | Promise; export declare function headers(headers: HeaderValues, condition?: HeaderCondition): Middleware; export declare function performanceHeader(headerName?: string): Middleware; export declare function prodLogger(options?: LoggerOptions): Middleware; export type ServeFilesOptions = { acceptRanges?: boolean; dotfiles?: "allow" | "deny" | "ignore"; extensions?: string[]; fallthrough?: boolean; immutable?: boolean; index?: string[]; lastModified?: boolean; maxAge?: number | string; exceptWhen?: (context: Context, response: Response | null) => boolean; }; export declare function serveFiles(directory: string, { acceptRanges, dotfiles, extensions, fallthrough, immutable, index, lastModified, maxAge, exceptWhen, }?: ServeFilesOptions): Middleware; export declare function trailingSlashes(mode: "add" | "remove"): Middleware; export function ms(expression: string | number): number; export type RangeInformation = { rangeHeader?: string | null | false; totalFileSize: number; defaultChunkSize?: number; }; export function parseRangeHeader({ rangeHeader, totalFileSize, defaultChunkSize, }: RangeInformation): { slice: null; contentLength: number; status: number; } | { slice: null; contentLength: null; status: number; } | { slice: { start: number; end: number; }; contentLength: number; status: number; }; export {};