import { Router, Express } from 'express';

type CodeSnippetFn = (config: {
    spreadParams: string[];
    slugParams: string[];
    allParams: string[];
}) => string;
type RouteGenIfEmpty = Boolean | ({
    codeSnippet?: string;
    codeSnippetFn?: CodeSnippetFn;
}) | undefined;

/**
 * Configuration options for setting up application routes.
 *
 * @property baseDir - The base directory where route files are located.
 * @property routeGenIfEmpty - Automatically sets up startup code if the file is empty.
 * @property app - An optional Express application instance to use for routing.
 */
interface RouteConfigWithApp {
    baseDir: string;
    routeGenIfEmpty?: RouteGenIfEmpty;
    /**
     * @deprecated Use `routeGenIfEmpty` instead.
     */
    autoSetup?: boolean;
    /**
     * @deprecated skip to pass app.
     */
    app: Express;
}
type RouteConfigWithoutApp = string | {
    baseDir: string;
    routeGenIfEmpty?: RouteGenIfEmpty;
    /**
     * @deprecated Use `routeGenIfEmpty` instead.
     */
    autoSetup?: boolean;
    app?: undefined;
};
interface RouteConfig {
    baseDir: string;
    routeGenIfEmpty?: RouteGenIfEmpty;
    /**
     * @deprecated Use `routeGenIfEmpty` instead.
     */
    autoSetup?: boolean;
    /**
     * @deprecated skip to pass app.
     */
    app?: Express;
}
type RoutesProps = string | RouteConfig;
declare function routes(config: RouteConfigWithoutApp): Router;
declare function routes(config: string): Router;
declare function routes(config: RouteConfigWithApp): void;

declare const rg: typeof routes & {
    routes: typeof routes;
};

export { rg as default, routes };
export type { RouteGenIfEmpty, RoutesProps };
