ai-tool-elements ships TypeScript declarations alongside its JavaScript output. All public types are re-exported from the main entry point (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/omavashia2005/ai-tool-elements/llms.txt
Use this file to discover all available pages before exploring further.
ai-tool-elements) — no separate @types/ package is needed. Consuming the library in a TypeScript project gives you full type safety on tool definitions, card props, and catalog entries.
Exported types
The following types are declared insrc/types.ts and re-exported from the package root.
ToolField
A single configuration field on a tool, rendered as a row inside the card’s content area.
ToolImage
The logo for a tool — either inline SVG markup or a hosted URL. The card renders images through a standard <img> element, so SVG content must be complete and self-contained.
Tool
The core connector definition. Every catalog entry and application-defined connector satisfies this shape.
ToolCatalogItem
An alias for Tool. Used to annotate entries in the built-in catalog — semantically it signals that the object is part of the published catalog rather than a one-off application definition.
Using the Tool type
Define custom connectors withas const satisfies Tool to get the narrowest possible literal types while still being checked against the Tool shape. TypeScript will then enforce that all required fields are present and that extra fields do not violate the readonly constraint.
as const makes every string literal and nested property a narrow readonly type. satisfies Tool validates the shape at the point of definition without widening the type to Tool, so later code still benefits from the exact literal types.
ToolCard generics
ToolCard is generic over any subtype of Tool. If you define a connector type that adds fields beyond the base Tool shape, those extra properties remain accessible through the tool prop inside the component tree.
Tool-shaped object, T defaults to Tool and no explicit type parameter is needed.
ToolCardProps
ToolCardProps is the full props type for the ToolCard component. It extends the underlying shadcn/ui Card props (minus children, which the card manages internally) and adds three ai-tool-elements-specific props.
| Prop | Type | Description |
|---|---|---|
tool | T | The connector definition to render |
actions | ReactNode | Optional controls rendered in the card header (e.g. a connect button) |
footer | ReactNode | Optional content rendered below the fields, separated by a top border |
className | string | Forwarded to the root Card element for style overrides |
Card component (such as style, aria-*, data-*) pass through unchanged.
Importing types
All types can be imported from the single package entry point. Useimport type to ensure zero runtime overhead — the imports are erased entirely during compilation.