import EventEmitter from 'node:events';
import type { ServerOptions } from '../types.js';
import type { DataStore, CancellationContext } from '@tus/utils';
import { type Upload } from '@tus/utils';
export declare class BaseHandler extends EventEmitter {
    options: ServerOptions;
    store: DataStore;
    constructor(store: DataStore, options: ServerOptions);
    write(status: number, headers?: {}, body?: string): import("undici-types").Response;
    generateUrl(req: Request, id: string): string;
    getFileIdFromRequest(req: Request): string | undefined;
    static extractHostAndProto(headers: Headers, respectForwardedHeaders?: boolean): {
        host: string;
        proto: string;
    };
    protected getLocker(req: Request): Promise<import("@tus/utils").Locker>;
    protected acquireLock(req: Request, id: string, context: CancellationContext): Promise<import("@tus/utils").Lock>;
    protected writeToStore(webStream: ReadableStream | null, upload: Upload, maxFileSize: number, context: CancellationContext): Promise<number>;
    getConfiguredMaxSize(req: Request, id: string | null): number | Promise<number>;
    /**
     * Calculates the maximum allowed size for the body of an upload request.
     * This function considers both the server's configured maximum size and
     * the specifics of the upload, such as whether the size is deferred or fixed.
     */
    calculateMaxBodySize(req: Request, file: Upload, configuredMaxSize?: number): Promise<number>;
}
//# sourceMappingURL=BaseHandler.d.ts.map