Skip to content

Commit 1eea091

Browse files
committed
cleanup
1 parent c105af3 commit 1eea091

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/infra/src/api/routing/DynamicMiddleware.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
/* eslint-disable @typescript-eslint/no-unsafe-return */
33
/* eslint-disable @typescript-eslint/no-explicit-any */
44
import { type Array, type Context, Effect, type Layer, type Request, type S, type Scope } from "effect-app"
5-
import type { RPCContextMap } from "effect-app/client/req"
5+
import type { GetEffectContext, RPCContextMap } from "effect-app/client/req"
66

77
import type * as EffectRequest from "effect/Request"
88

9-
export type RPCHandlerFactory<CTXMap extends Record<string, RPCContextMap.Any>> = <
9+
export type RPCHandlerFactory<MiddlewareContext, CTXMap extends Record<string, RPCContextMap.Any>> = <
1010
T extends {
1111
config?: Partial<Record<keyof CTXMap, any>>
1212
},
@@ -25,7 +25,7 @@ export type RPCHandlerFactory<CTXMap extends Record<string, RPCContextMap.Any>>
2525
) => Effect.Effect<
2626
Request.Request.Success<Req>,
2727
Request.Request.Error<Req>,
28-
any // smd
28+
MiddlewareContext | Exclude<R, GetEffectContext<CTXMap, T["config"]>>
2929
>
3030

3131
export type ContextProviderOut<RRet> = Effect<Context.Context<RRet>, never, Scope>
@@ -49,7 +49,7 @@ export interface Middleware<
4949
Default: Layer.Layer<CtxId, RErr, RCtx>
5050
}
5151
execute: Effect<
52-
RPCHandlerFactory<CTXMap>,
52+
RPCHandlerFactory<MiddlewareContext, CTXMap>,
5353
never,
5454
R
5555
>

0 commit comments

Comments
 (0)