import { RouteGroupSource } from "./types/basic.cjs"; import { RouteGroup } from "./RouteGroup.cjs"; //#region src/RouteRegistrar.d.ts /** * Factory used by the registrar to build a route group while carrying the * accumulated attributes (domain, prefix, middlewares). */ type RouteRegistrarGroupFactory = (prefix: string, source: RouteGroupSource, middlewares: any[] | undefined, extra: { domain?: string; }) => RouteGroup; /** * @class clear-router RouteRegistrar * @description Fluent builder returned by `Router.domain()` that lets routes be * grouped under a shared host pattern (and optionally a prefix/middlewares), * mirroring Laravel's route attribute registrar. * @author 3m1n3nc3 * @repository https://github.com/arkstack-hq/clear-router */ declare class RouteRegistrar { private readonly makeGroup; private attributes; constructor(makeGroup: RouteRegistrarGroupFactory, attributes?: { domain?: string; prefix?: string; middlewares?: any[]; }); /** * Constrain the grouped routes to a host pattern such as `{account}.example.com`. * * @param pattern * @returns */ domain(pattern: string): this; /** * Prepend a path prefix to the grouped routes. * * @param prefix * @returns */ prefix(prefix: string): this; /** * Register one or more middleware shared by the grouped routes. * * @param middlewares * @returns */ middleware(middlewares: any[] | any): this; /** * Register the grouped routes. A leading string is treated as a path prefix * (matching `Router.group(prefix, source, middlewares?)`); otherwise the first * argument is the source and the registrar's own prefix is used. * * @param source * @param middlewares * @returns */ group(source: S, middlewares?: any[]): RouteGroup; group(prefix: string, source: S, middlewares?: any[]): RouteGroup; } //#endregion export { RouteRegistrar, RouteRegistrarGroupFactory };