import type { Server } from 'bun';
import type { StxOptions } from './types';
/**
 * Create an HTML response helper
 */
export declare function htmlResponse(html: string, status?: number, headers?: Record<string, string>): Response;
/**
 * Serve a directory of stx templates and markdown files
 * This is the main function for programmatic usage
 */
export declare function serve(options?: ServeOptions): Promise<ServeResult>;
/**
 * Serve a single stx or markdown file
 */
export declare function serveFile(filePath: string, options?: Omit<ServeOptions, 'root'>): Promise<ServeResult>;
/**
 * Create a middleware function
 */
export declare function createMiddleware(handler: (request: Request, next: () => Response | Promise<Response>) => Response | Promise<Response>): (request: Request, next: () => Response | Promise<Response>) => Response | Promise<Response>;
/**
 * Helper to create a route handler
 */
export declare function createRoute(handler: (request: Request) => Response | Promise<Response>): (request: Request) => Response | Promise<Response>;
export declare interface ServeOptions {
  port?: number
  root?: string
  stxOptions?: StxOptions
  watch?: boolean
  onRequest?: (request: Request) => Response | Promise<Response> | null | undefined
  routes?: Record<string, (request: Request) => Response | Promise<Response>>
  middleware?: Array<(request: Request, next: () => Response | Promise<Response>) => Response | Promise<Response>>
  on404?: (request: Request) => Response | Promise<Response>
  onError?: (error: Error, request: Request) => Response | Promise<Response>
}
export declare interface ServeResult {
  server: Server<any>
  stop: () => void
  url: string
}
