Type Loader API
Programmatic access to component type definitions
Type Loader API
The type loader provides utilities for loading, parsing, and working with component type definitions from MDX files.
Installation
Importing
Types
ComponentType
The parsed representation of a component type definition.
PropDef
A parsed property definition.
PartDef
A parsed CSS part definition.
CSSVariableDef
A parsed CSS variable definition.
JSONLDMapping
Schema.org mapping for Thing components.
Loading Functions
loadComponentTypes
Load all component types from a directory.
Example:
getComponentType
Get a single component type by name.
Example:
Filtering Functions
getTypesByCategory
Filter types by category.
Example:
getTypeCategories
Get all unique categories from types.
Example:
Parsing Functions
parseComponentType
Parse MDX content into a ComponentType.
Example:
parseFrontmatter
Parse frontmatter from MDX content.
Example:
parsePropDef
Parse a single prop definition line.
Example:
parsePartDef
Parse a CSS part definition line.
Example:
parseCSSVariableDef
Parse a CSS variable definition line.
Example:
Code Generation
generateTypeScriptInterface
Generate a TypeScript interface from a component type.
Example: