Class CRPCBuilder<TContext, TMeta>
Type Parameters
- TContext extends object
- TMeta extends object
Constructors
Methods
create
- create<TOptions extends RuntimeConfigOptions<TContext, TMeta>>(
opts?: ValidateShape<TOptions, RuntimeConfigOptions<TContext, TMeta>>,
): {
_config: RootConfig<
{
ctx: TContext;
errorShape: undefined extends TOptions["errorFormatter"]
? DefaultErrorShape
: inferErrorFormatterShape<TOptions["errorFormatter"]>;
meta: TMeta;
transformer: undefined extends TOptions["transformer"] ? false : true;
},
>;
mergeRouters: <TRouters extends AnyRouter[]>(
...routerList: [...TRouters[]],
) => MergeRouters<TRouters>;
middleware: <$ContextOverrides>(
fn: MiddlewareFunction<
TContext,
TMeta,
object,
$ContextOverrides,
unknown,
>,
) => MiddlewareBuilder<TContext, TMeta, $ContextOverrides, TInputOut>;
procedure: ProcedureBuilder<
TContext,
TMeta,
object,
typeof unsetMarker,
typeof unsetMarker,
typeof unsetMarker,
typeof unsetMarker,
false,
>;
router: {
<TInput extends RouterRecord>(
input: TInput,
): BuiltRouter<TRoot, TInput>;
<TInput extends CreateRouterOptions>(
input: TInput,
): BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput>>;
};
} Returns {
_config: RootConfig<
{
ctx: TContext;
errorShape: undefined extends TOptions["errorFormatter"]
? DefaultErrorShape
: inferErrorFormatterShape<TOptions["errorFormatter"]>;
meta: TMeta;
transformer: undefined extends TOptions["transformer"] ? false : true;
},
>;
mergeRouters: <TRouters extends AnyRouter[]>(
...routerList: [...TRouters[]],
) => MergeRouters<TRouters>;
middleware: <$ContextOverrides>(
fn: MiddlewareFunction<
TContext,
TMeta,
object,
$ContextOverrides,
unknown,
>,
) => MiddlewareBuilder<TContext, TMeta, $ContextOverrides, TInputOut>;
procedure: ProcedureBuilder<
TContext,
TMeta,
object,
typeof unsetMarker,
typeof unsetMarker,
typeof unsetMarker,
typeof unsetMarker,
false,
>;
router: {
<TInput extends RouterRecord>(
input: TInput,
): BuiltRouter<TRoot, TInput>;
<TInput extends CreateRouterOptions>(
input: TInput,
): BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput>>;
};
}
Internal
_config: RootConfig<
{
ctx: TContext;
errorShape: undefined extends TOptions["errorFormatter"]
? DefaultErrorShape
: inferErrorFormatterShape<TOptions["errorFormatter"]>;
meta: TMeta;
transformer: undefined extends TOptions["transformer"] ? false : true;
},
>
mergeRouters: <TRouters extends AnyRouter[]>(
...routerList: [...TRouters[]],
) => MergeRouters<TRouters>
procedure: ProcedureBuilder<
TContext,
TMeta,
object,
typeof unsetMarker,
typeof unsetMarker,
typeof unsetMarker,
typeof unsetMarker,
false,
>
router: {
<TInput extends RouterRecord>(input: TInput): BuiltRouter<TRoot, TInput>;
<TInput extends CreateRouterOptions>(
input: TInput,
): BuiltRouter<TRoot, DecorateCreateRouterOptions<TInput>>;
}
Add a context shape as a generic to the root object