createAgentRef
Creates a typed agent handle.
import { createAgentRef } from '@threadplane/angular';Declaration · overload 1
export declare function createAgentRef<TSession extends AgentSessionLike = AgentSession>(debugName?: string): AgentRef<TSession>;Type parameters
TSessionAgentSessionLikeDefault:AgentSession
Parameters
debugName· optionalstringOptional name shown in Angular injection errors and in the warning about several refs at one injector level.
Returns
AgentRef<TSession>Examples
export const TRIP = createAgentRef<TripSession>('trip');
// app.config.ts: provideAgent(TRIP, { createSession: … })
// component: const agent = injectAgent(TRIP); // Agent<TripSession>