import type { Duplose, DuploseEvaler } from "./duplose"; import type { CurrentRequestObject } from "./request"; import type { PresetGenericResponse } from "./response"; import { type BuildedHooksInstanceLifeCycle, HooksInstanceifeCycle } from "./hook/instanceLifeCycle"; import { type BuildedHooksRouteLifeCycle, HooksRouteLifeCycle } from "./hook/routeLifeCycle"; import type { RecieveFormDataOptions } from "./parser"; import type { HookEvaler } from "./hook"; import type { BuildedRouter, RouterEvaler } from "./router"; import type { ExtractErrorFunction } from "./step/extract"; import { type BytesInString, type GetPropsWithTrueValue, type PartialKeys, type RequiredKeys, type SimplifyType } from "@duplojs/utils"; export interface Environments { DEV: true; PROD: true; TEST: true; } export type Environment = GetPropsWithTrueValue; export type DuploPlugins = (instance: Duplo) => void; export interface DuploConfig { environment: Environment; disabledRuntimeEndPointCheck: boolean; disabledZodAccelerator: boolean; keyToInformationInHeaders: string; plugins: DuploPlugins[]; bodySizeLimit: number; recieveFormDataOptions: RequiredKeys; prefix: string[]; keepDescriptions: boolean; } export type DuploInputConfig = SimplifyType, "bodySizeLimit" | "recieveFormDataOptions" | "prefix"> & { bodySizeLimit?: number | BytesInString; recieveFormDataOptions?: Partial; prefix?: string | string[]; }>; export type NotfoundHandler = (request: CurrentRequestObject) => PresetGenericResponse; export type DuploHooks = BuildedHooksInstanceLifeCycle & BuildedHooksRouteLifeCycle; export interface Evalers { duplose?: DuploseEvaler; hook?: HookEvaler; router?: RouterEvaler; } export declare class Duplo { config: DuploConfig; duploses: Duplose[]; hooksRouteLifeCycle: HooksRouteLifeCycle; hooksInstanceLifeCycle: HooksInstanceifeCycle; buildedRouter?: BuildedRouter; evalers: Evalers; constructor(inputConfig: GenericDuploInputConfig); extractError: ExtractErrorFunction; notfoundHandler: NotfoundHandler; setNotfoundHandler(notfoundHandler: Duplo["notfoundHandler"]): this; setExtractError(extractError: Duplo["extractError"]): this; hook(hookName: T, subscriber: DuploHooks[T]): this; register(...duplose: Duplose[]): this; }