import type { CurrentRequestObject } from "../request"; import { type PresetGenericResponse } from "../response"; import { type DuploseDefinition, type DuploseBuildedFunctionContext, Duplose } from "."; import { ResultIsNotAResponseError } from "../error/resultIsNotAResponseError"; import { type BuildedHooksRouteLifeCycle } from "../hook/routeLifeCycle"; import { type PreflightStep } from "../step/preflight"; import { type GetPropsWithTrueValue } from "@duplojs/utils"; import { type BuildedPreflightStep } from "../step/builded/preflight"; import { HttpDuplose } from "./http"; export interface HttpMethods { DELETE: true; GET: true; HEAD: true; OPTIONS: true; PATCH: true; POST: true; PUT: true; } export type HttpMethod = GetPropsWithTrueValue; export interface RouteBuildedFunctionContext extends DuploseBuildedFunctionContext { hooks: BuildedHooksRouteLifeCycle; preflightSteps: BuildedPreflightStep[]; ResultIsNotAResponseError: typeof ResultIsNotAResponseError; } export interface RouteBuildedFunction { (request: CurrentRequestObject): Promise; context: RouteBuildedFunctionContext; } export type GetRouteGeneric = T extends Route ? { preflightSteps: InferedRouteDefinition["preflightSteps"]; step: InferedRouteDefinition["steps"]; request: inferedRequest; floor: inferedFloorData; } : never; export interface RouteDefinition extends DuploseDefinition { preflightSteps: PreflightStep[]; method: HttpMethod; paths: string[]; } export declare class Route extends HttpDuplose { get fullPaths(): string[]; constructor(definiton: GenericRouteDefinition); getAllHooks(): import("../hook/routeLifeCycle").HooksRouteLifeCycle; hasDuplose(duplose: Duplose, deep?: number): boolean; build(): Promise; static methodsWithBody: HttpMethod[]; static insertBlockName: { beforeHookBeforeRouteExecution: >() => string; beforeTreatResultHookBeforeRouteExecution: >() => string; afterHookBeforeRouteExecution: >() => string; beforeHookParsingBody: >() => string; beforeTreatResultHookParsingBody: >() => string; afterHookParsingBody: >() => string; beforePreflightSteps: >() => string; afterPreflightSteps: >() => string; beforeSteps: >() => string; afterSteps: >() => string; beforeDefaultResponse: >() => string; beforeHookOnError: >() => string; afterHookOnError: >() => string; beforeTreatResult: >() => string; afterTreatResult: >() => string; }; }