///
import { IncomingMessage, ServerResponse } from 'http';
import { Directive, Middleware, MiddlewareContext, MiddlewareReturn, Pipeline } from '@cardboardrobots/pipeline';
import { Context } from '../context';
import { AutoDirective, ErrorDirective, JsonDirective, RawDirective, TextDirective, ViewDirective } from '../directive';
import { LogLevel } from './LogLevel';
export declare type ViewContext = CONTEXT & {
view: ViewDirective;
};
export declare type ErrorContext = CONTEXT & {
error: Error;
};
export declare class Handler {
pipeline: Pipeline;
errorPipeline: Pipeline, any, any, any>;
viewPipeline: Pipeline, RESULT, any, any>;
logging: LogLevel;
defaultTemplate: string;
callback: (request: IncomingMessage, response: ServerResponse) => Promise;
sendJson(context: CONTEXT, directive: JsonDirective): Promise;
sendRaw(context: CONTEXT, directive: RawDirective): Promise;
sendText(context: CONTEXT, directive: TextDirective): Promise;
sendView(context: CONTEXT, directive: ViewDirective): Promise;
sendAuto(context: CONTEXT, directive: AutoDirective): Promise;
sendError(context: CONTEXT, directive: ErrorDirective): Promise;
send(context: CONTEXT, directive: Directive): Promise | Promise;
log(context: Context, status?: number): void;
use(middleware: Middleware): this;
use, NEWRESULT = RESULT>(middleware: Middleware>, RESULT, NEWRESULT>): Handler, NEWRESULT>;
use>(middleware: MIDDLEWARE): Handler, MiddlewareReturn>;
useError(middlware: Middleware, Error, NEWRESULT>): Pipeline, any, any, NEWRESULT>;
useView(middlware: Middleware, RESULT, NEWRESULT>): Pipeline, RESULT, any, NEWRESULT>;
private write;
}
export declare function errorTemplate(error: any): string;
export declare function colorStatus(status: number): string;
export declare function getAccept(request: IncomingMessage): string[];
//# sourceMappingURL=Handler.d.ts.map