11import type { IR } from '~/ir/types' ;
22import type { DefinePlugin , Plugin } from '~/plugins' ;
33import type { PluginValidatorNames } from '~/plugins/types' ;
4+ import type { NamingConfig , NamingRule } from '~/utils/naming' ;
45
56export type UserConfig = Plugin . Name < '@orpc/contract' > &
67 Plugin . Hooks & {
@@ -36,12 +37,24 @@ export type UserConfig = Plugin.Name<'@orpc/contract'> &
3637 */
3738 operationKeyBuilder ?: ( operationId : string , groupKey : string ) => string ;
3839 /**
39- * Name of the router export.
40- * The type export will be the capitalized version (e.g., 'router' → 'Router').
40+ * Naming rule for the router export.
41+ * The type export will be the PascalCase version (e.g., 'router' → 'Router').
4142 *
4243 * @default 'router'
44+ *
45+ * @example
46+ * // Simple string
47+ * routerName: 'contract'
48+ *
49+ * @example
50+ * // Template string
51+ * routerName: '{{name}}Contract'
52+ *
53+ * @example
54+ * // With casing
55+ * routerName: { name: '{{name}}Contract', casing: 'camelCase' }
4356 */
44- routerName ?: string ;
57+ routerName ?: NamingRule ;
4558 /**
4659 * Validator plugin to use for input/output schemas.
4760 *
@@ -61,7 +74,7 @@ export type Config = Plugin.Name<'@orpc/contract'> &
6174 groupKeyBuilder : ( operation : IR . OperationObject ) => string ;
6275 operationKeyBuilder : ( operationId : string , groupKey : string ) => string ;
6376 output : string ;
64- routerName : string ;
77+ routerName : NamingConfig ;
6578 validator : PluginValidatorNames ;
6679 } ;
6780
0 commit comments