hashbrown

exposeComponent

Creates an object used to expose a component for use by the LLM.

API

export declare function exposeComponent<
  T extends  ComponentType <any>,
>(
  component: T,
  config:  ɵtypes.Prettify <
     Omit <
       ExposedComponent <T>,
      "component"
    >
  >,
):  ExposedComponent <T>;
exposeComponent
ExposedComponent<T>
@paramcomponent:
T
@paramconfig:
ɵtypes.Prettify<Omit<ExposedComponent<T>, 'component'>>
@typeT
ComponentType<any>
@returns
ExposedComponent<T>

Examples

exposeComponent(
  CardComponent, // The React component to be exposed.
  { // The exposed component configuration.
    name: 'CardComponent',
    description: 'Show a card with children components to the user',
    children: 'any',
    props: {
      title: s.string('The title of the card'),
      description: s.streaming.string('The description of the card'),
    },
  },
});