import type { CompletionRequest } from '../types/messages.js'; import type { NexusResponse } from '../types/response.js'; import type { PipelineConfig, PipelineContext, PipelineHookName, PipelineShapes, PipelineStep, PipelineStepName } from './types.js'; /** * Runs the request pipeline's hooks and custom steps, and times each stage into the request's * trace. Generic over the request and response; without `shapes` it runs a completion's. */ export declare class PipelineRunner { private config; private steps; private readonly shapes; constructor(config?: PipelineConfig, shapes?: PipelineShapes); /** Adds a custom step, run after the built-in stages. Returns the runner, for chaining. */ use(step: PipelineStep): this; /** Runs every handler registered for a hook, in order. */ runHook(name: PipelineHookName, context: PipelineContext): Promise>; /** Runs the custom steps, in order. */ runCustomSteps(context: PipelineContext): Promise>; /** * Runs one stage and records its timing, unless tracing is off. `custom` names a custom step, * recorded with `name` set to `customStep`. */ trace(context: PipelineContext, name: PipelineStepName, fn: () => T | Promise, metadata?: Record, custom?: string): Promise; /** Stamps the trace's end time and duration. */ finish(context: PipelineContext): PipelineContext; private runMiddleware; private handlersForHook; } /** A fresh pipeline context for a request. */ export declare function createPipelineContext(request: Req): PipelineContext;