import { ControllerRegisterProps } from './controller.js'; import { Http } from './http.js'; export type LoaderConflictStrategy = 'error' | 'warn' | 'override'; export type LoaderConflictResolution = 'error' | 'keep' | 'override'; export type LoaderConflictContext = { routeKey: string; method: string; url: string; strategy: LoaderConflictStrategy; resolution: LoaderConflictResolution; }; export interface LoaderCompileOptions { defaultSuffix?: string; prefix?: string; conflict?: LoaderConflictStrategy; onConflict?: (ctx: LoaderConflictContext) => void; } export type LoaderFromOptions = { suffix?: string; } & LoaderCompileOptions; export declare class Loader { private readonly http; private readonly registeredRoutes; constructor(http: Http); /** * 单个路由绑定编译 */ compile(path: string, controllers: ControllerRegisterProps | ControllerRegisterProps[], options?: LoaderCompileOptions): () => void; /** * 文件夹批量路由绑定编译 */ from(directory: string, options?: LoaderFromOptions): Promise<() => void>; }