import { IHttpRequest, IHttpResponse, IRoute } from './interfaces'; import { StatusCode } from './status-code'; import { Readable } from 'stream'; declare type Class = new (...args: any) => any; export interface IOutputBuilder { build(models: readonly T[], ...args: unknown[]): Promise; } interface ISimpleValidator { validate(value: T): true | readonly string[]; } interface IValidatorWithOptions { validate(value: T, options?: X & { restrictExtraFields?: boolean; }): true | readonly string[]; } type IValidator = ISimpleValidator | IValidatorWithOptions; export interface ETaggable { readonly uid: string; readonly lastModified: Date; readonly version?: number; } export declare abstract class Route implements IRoute { protected readonly request: IHttpRequest; protected readonly response: IHttpResponse; protected redirect(url: string): Promise; protected redirect(url: string, statusCode: number): Promise; protected redirect(url: string, html: true): Promise; protected redirect(url: string, javascript: string): Promise; protected empty(statusCode?: number): Promise; protected jsonAsync(content: Promise, outputBuilder: IOutputBuilder): Promise; protected jsonAsync(content: Promise, outputBuilder: IOutputBuilder): Promise; protected jsonAsync(content: Promise, statusCode?: StatusCode): Promise; protected jsonAsync(content: Promise, statusCode?: StatusCode): Promise; protected jsonAsync(content: Promise, Model: [Class]): Promise; protected jsonAsync(content: Promise, Model: Class): Promise; protected jsonAsync(content: Promise, statusCode: StatusCode, Model: [Class]): Promise; protected jsonAsync(content: Promise, statusCode: StatusCode, Model: Class): Promise; protected json(content: readonly T[], statusCode: StatusCode, outputBuilder: IOutputBuilder): Promise; protected json(content: readonly T[], outputBuilder: IOutputBuilder): Promise; protected json(content: T, statusCode: StatusCode, outputBuilder: IOutputBuilder): Promise; protected json(content: T, outputBuilder: IOutputBuilder): Promise; protected json(content: readonly unknown[], Model: [Class]): Promise; protected json(content: unknown, Model: Class): Promise; protected json(content: readonly unknown[], statusCode: StatusCode, Model: [Class]): Promise; protected json(content: unknown, statusCode: StatusCode, Model: Class): Promise; protected json(content: readonly unknown[], statusCode?: StatusCode): Promise; protected json(content: unknown, statusCode?: StatusCode): Promise; protected text(content: TResponse, statusCode?: StatusCode | number): Promise; protected stream(content: TResponse, size?: number, contentType?: string, statusCode?: StatusCode | number): Promise; private profileResponse; protected ensureRequestMedia(expected: string): void; protected getRequestMediaPriority(contentType: string): number | null; protected getPreferredRequestMedia(...contentTypes: string[]): string | null; protected ensureCacheControl(): void; protected setHeader(name: string, value: string): this; protected isNewerContent(etag: string, lastModified?: Date): boolean; protected isSameContent(etag: string, lastModified?: Date): boolean; protected isNewerModel(model: ETaggable): boolean; protected isNewerModel(uid: string, lastModified: Date, version?: number): boolean; protected isSameModel(model: ETaggable): boolean; protected isSameModel(uid: string, lastModified: Date, version?: number): boolean; protected isNewerList(list: readonly ETaggable[] | Iterable): boolean; protected isSameList(list: readonly ETaggable[] | Iterable): boolean; protected ensureModelETag(model: ETaggable): void; protected ensureModelETag(uid: string, lastModified: Date, version?: number): void; protected setModelETag(model: ETaggable): void; protected setModelETag(uid: string, lastModified: Date, version?: number): void; protected setListETag(list: readonly ETaggable[] | Iterable): void; protected setContentETag(etag: string, lastModified?: Date): void; protected validate(validator: IValidator, value: T, message?: string): void; protected validate(validator: IValidatorWithOptions, value: T, message?: string, options?: X): void; protected validate(validator: IValidator, value: T[], message?: string): void; protected validate(validator: IValidatorWithOptions, value: T[], message?: string, options?: X): void; private sendProfilingData; abstract handle(...args: any[]): Promise; } export {};