import { type IncomingMessage, type ServerResponse } from "node:http";
import { type Server, type ServerOptions, type ToolDefinition, type CallToolResult, type ToolReturn, type TypedSchema } from "../../tiny-stdio-mcp-server/dist/index.js";
import { type AuthenticatedIncomingMessage, type TokenVerifier, type VerifiedAccessToken, type RequestAuthInfo } from "./auth.js";
import { type HttpObservabilityEvent, type StreamableHttpTransportOptions } from "./http-transport.js";
export interface ProtectedResourceMetadataOptions {
    resource: string | URL;
    authorizationServers: readonly (string | URL)[];
    bearerMethodsSupported?: readonly string[];
    scopesSupported?: readonly string[];
}
export interface TinyHttpMcpServerOAuthOptions extends ProtectedResourceMetadataOptions {
    requiredScopes?: readonly string[];
    verifier: TokenVerifier;
}
export type HttpTransportOptions = StreamableHttpTransportOptions & {
    oauth?: TinyHttpMcpServerOAuthOptions;
};
export interface HttpListenOptions {
    port?: number;
    hostname?: string;
    path?: string;
    signal?: AbortSignal;
    requestTimeoutMs?: number;
    headersTimeoutMs?: number;
    keepAliveTimeoutMs?: number;
}
export interface HttpServerHandle {
    url: string;
    port: number;
    close(): Promise<void>;
}
export interface HttpServer extends Omit<Server, "tool" | "registerTool"> {
    tool<TIn, TOut = never>(name: string, description: string, inputSchema: TypedSchema<TIn>, handler: HttpToolHandler<TIn, TOut>, outputSchema?: TypedSchema<TOut>): HttpServer;
    registerTool<TIn, TOut = never>(definition: Omit<ToolDefinition<TIn, TOut>, "handler">, handler: HttpToolHandler<TIn, TOut>): HttpServer;
    listenHttp(options?: HttpListenOptions): Promise<HttpServerHandle>;
    handleRequest(req: IncomingMessage, res: ServerResponse): Promise<void>;
}
export interface HttpToolContext {
    request: AuthenticatedIncomingMessage;
}
export type HttpToolHandler<T = Record<string, unknown>, TOut = ToolReturn> = (args: T, context: HttpToolContext) => Promise<TOut | CallToolResult> | TOut | CallToolResult;
export declare function createProtectedResourceMetadataDocument(options: ProtectedResourceMetadataOptions): Record<string, unknown>;
export declare function createHttpServer(options: ServerOptions & HttpTransportOptions): HttpServer;
export type { RequestAuthInfo, TokenVerifier, VerifiedAccessToken };
export type { HttpObservabilityEvent };
