@threadplane/renderFunctionv0.3.4

defineAngularRegistry

Build an AngularRegistry from a plain object mapping tool-call names to Angular components (or fully specified RenderViewEntry objects).

The returned registry is consumed by provideRender to drive dynamic component rendering.

Entry forms

  • Bare Type<unknown> — the component is paired with the built-in DefaultFallbackComponent while its props are still streaming.
  • RenderViewEntry object — lets you supply a custom fallback component, an optional Standard Schema (schema) used as a mount-readiness gate, and an optional description for model-facing tool registration.

Registry accessor The returned object exposes a single getEntry(name: string) accessor that returns the fully-normalized NormalizedEntry (component + fallback + optional schema + optional description) or undefined when the name is not registered. Use names() to enumerate all registered names.

import { defineAngularRegistry } from '@threadplane/render';

Declaration · overload 1

export declare function defineAngularRegistry(componentMap: RegistryInput): AngularRegistry;

Parameters

componentMap · required
RegistryInput

Object whose keys are tool-call names and whose values are either bare Angular component classes or RenderViewEntry objects.

Returns

AngularRegistry

An AngularRegistry with getEntry and names accessors.

Examples

import { defineAngularRegistry } from '@threadplane/render';
import { DayCardComponent } from './day-card.component';
import { LoadingSpinnerComponent } from './loading-spinner.component';
import { z } from 'zod';

export const registry = defineAngularRegistry({
  // Bare component — uses DefaultFallbackComponent while streaming.
  summary_card: SummaryCardComponent,

  // Full entry — custom fallback + schema-gated mounting.
  day_card: {
    component: DayCardComponent,
    fallback: LoadingSpinnerComponent,
    schema: z.object({ label: z.string(), day: z.number() }),
    description: 'Renders a single itinerary day card.',
  },
});

// Look up a registered entry at runtime:
const entry = registry.getEntry('day_card'); // NormalizedEntry | undefined