This commit is contained in:
@@ -6,7 +6,9 @@ import type { IncomingMessage } from "node:http"
|
||||
import type { WebSocket } from "ws"
|
||||
|
||||
|
||||
export interface TRPCContext<R> {
|
||||
export interface TRPCContext<R> extends TRPCContextRuntime<R>, TRPCContextTransaction {}
|
||||
|
||||
export interface TRPCContextRuntime<R> {
|
||||
readonly runtime: Runtime.Runtime<R>
|
||||
|
||||
readonly run: <A, E>(
|
||||
@@ -18,12 +20,14 @@ export interface TRPCContext<R> {
|
||||
effect: Effect.Effect<A, E, R>,
|
||||
options?: Runtime.RunForkOptions,
|
||||
) => RuntimeFiber<A, TRPCError>
|
||||
}
|
||||
|
||||
readonly transaction: TRPCContextTransaction
|
||||
export interface TRPCContextTransaction {
|
||||
readonly transaction: TRPCTransaction
|
||||
}
|
||||
|
||||
|
||||
export type TRPCContextTransaction = Data.TaggedEnum<{
|
||||
export type TRPCTransaction = Data.TaggedEnum<{
|
||||
readonly Express: {
|
||||
readonly req: express.Request
|
||||
readonly res: express.Response
|
||||
@@ -35,4 +39,4 @@ export type TRPCContextTransaction = Data.TaggedEnum<{
|
||||
}
|
||||
}>
|
||||
|
||||
export const TRPCContextTransactionEnum = Data.taggedEnum<TRPCContextTransaction>()
|
||||
export const TRPCTransactionEnum = Data.taggedEnum<TRPCTransaction>()
|
||||
|
||||
Reference in New Issue
Block a user