UNPKG

@nexica/nestjs-trpc

Version:
11 lines (10 loc) 866 B
import { ContextOptions, TRPCContext, EnhancedContext } from '../interfaces/context.interface'; export declare class EnhancedContextFactory implements TRPCContext<EnhancedContext> { create(opts: ContextOptions): EnhancedContext; } export declare class GenericEnhancedContextFactory<TCustomContext = Record<string, unknown>> implements TRPCContext<EnhancedContext & TCustomContext> { private readonly customContextCreator?; constructor(customContextCreator?: ((opts: ContextOptions) => TCustomContext | Promise<TCustomContext>) | undefined); create(opts: ContextOptions): Promise<EnhancedContext & TCustomContext>; } export declare function createEnhancedContextFactory<TCustomContext = Record<string, unknown>>(customContextCreator?: (opts: ContextOptions) => TCustomContext | Promise<TCustomContext>): GenericEnhancedContextFactory<TCustomContext>;