MUI Docs Infra

Warning

This is an internal project, and is not intended for public use. No support or stability guarantees are provided.

Abstract Create Types

The abstractCreateTypes function helps you create structured type documentation factories that work seamlessly with the loadPrecomputedTypes loader. It provides a standardized way to create type documentation components that display TypeScript type information extracted at build time.

Tip

For the underlying architectural rationale (URLs as identity, variant enumeration, precompute) see the Built Factories Pattern.

Overview

Type factories created with abstractCreateTypes automatically integrate with:

Implementation

To quickly implement these factory functions, use the abstractCreateTypes utilities:

import 'server-only'; // Omit if factories will be imported in client components or Pages Router
import {
  createTypesFactory,
  createMultipleTypesFactory,
} from '@mui/internal-docs-infra/abstractCreateTypes';
import type { AbstractCreateTypesOptions } from '@mui/internal-docs-infra/abstractCreateTypes';

import { TypesTable } from './TypesTable';
import { mdxComponents } from '@/mdx-components';
import { PreInline } from '@/components/PreInline';

const options = {
  TypesTable,
  components: mdxComponents,
  TypePre: PreInline,
} satisfies AbstractCreateTypesOptions;

/**
 * Creates a type documentation component for a single component.
 * @param url Depends on `import.meta.url` to determine the source file location.
 * @param component The component to extract types from.
 * @param [meta] Additional metadata for the types (injected by loader).
 */
export const createTypes = createTypesFactory(options);

/**
 * Creates type documentation components for multiple related components.
 * Useful for component families like Checkbox.Root, Checkbox.Indicator.
 * @param url Depends on `import.meta.url` to determine the source file location.
 * @param components Object with multiple component exports.
 * @param [meta] Additional metadata for the types (injected by loader).
 */
export const createMultipleTypes = createMultipleTypesFactory(options);

Usage

Single Component

// In types.ts
import { Button } from './Button';

export const TypesButton = createTypes(import.meta.url, Button);
// In page.mdx
import { TypesButton } from './types';

<TypesButton />;

Multiple Components

For components with multiple parts (e.g., Checkbox.Root, Checkbox.Indicator), export the types object directly and use dot notation in MDX:

// In types.ts
import { Checkbox } from './Checkbox';

const { types, AdditionalTypes } = createMultipleTypes(import.meta.url, Checkbox);

export const TypesCheckbox = types;
export const TypesCheckboxAdditional = AdditionalTypes;
// In page.mdx
import { TypesCheckbox } from './types';

### Root

<TypesCheckbox.Root />

### Indicator

<TypesCheckbox.Indicator />

This approach provides a cleaner API where:

  • A single import brings all component types
  • Dot notation mirrors the component's namespace (e.g., Checkbox.Root<TypesCheckbox.Root />)
  • Less verbose than exporting each type individually

Additional Types

The AdditionalTypes component displays types that don't belong to a specific namespace but are referenced across multiple parts of the component:

  • Namespace-specific types: Types like Checkbox.Root.State are automatically included when rendering <TypesCheckbox.Root />
  • Shared types: Types referenced by multiple namespaces (e.g., a shared CheckboxContextValue used by both Root and Indicator) appear in AdditionalTypes
// In page.mdx
import { TypesCheckbox, TypesCheckboxAdditional } from './types';

## API Reference

### Root

<TypesCheckbox.Root />

### Indicator

<TypesCheckbox.Indicator />

## Additional Types

<TypesCheckboxAdditional />

Variant-Only Groups (Types-Only Modules)

When a variant is a namespace import on a types-only module (i.e., it has no main export like a component, hook, or function), its types are treated as a variant-only group. This avoids duplication — types from variant-only groups are rendered by their own component, not pooled into AdditionalTypes.

// In types.ts
import { CodeHighlighter } from '@base-ui/react/code-highlighter';
import * as CodeHighlighterTypes from '@base-ui/react/code-highlighter/types';

const { types, AdditionalTypes } = createMultipleTypes(import.meta.url, {
  CodeHighlighter,
  CodeHighlighterTypes, // namespace import — types-only module, no main export
});

export const TypesCodeHighlighter = types;
export const TypesCodeHighlighterAdditional = AdditionalTypes;
// In page.mdx
import { TypesCodeHighlighter, TypesCodeHighlighterAdditional } from './types';

## API Reference

<TypesCodeHighlighter.CodeHighlighter />

## Supporting Types

{/* Renders types from the CodeHighlighterTypes variant-only group */}

<TypesCodeHighlighter.CodeHighlighterTypes />

## Additional Types

{/* Only shows types not already covered above */}

<TypesCodeHighlighterAdditional />

The pipeline detects that CodeHighlighterTypes has no matching export key and separates its types into variantOnlyAdditionalTypes. This means:

  • <TypesCodeHighlighter.CodeHighlighterTypes /> renders only the types from that variant
  • <TypesCodeHighlighterAdditional /> excludes those types, preventing duplication

Customizing Type Rendering

The components option provides the MDX component map used for rendering markdown descriptions and examples. Named slots control how specific fields are rendered:

  • TypePre (required) — pre component for type signatures. Type signatures are not precomputed, so this has a different contract from components.pre.
  • DetailedTypePre — pre component for expanded type details. Falls back to TypePre.
  • RawTypePre — pre component for raw type formatted code blocks (full interface/type alias definitions). Falls back to DetailedTypePre, then TypePre.
  • ShortTypeCode — code component for compact type summaries. Falls back to components.code.
  • DefaultCode — code component for default values. Falls back to components.code.
import { PreInline } from '@/components/PreInline';

const options = {
  TypesTable,
  components: mdxComponents,
  TypePre: PreInline,
  // ShortTypeCode: TableCode, // optional
  // DefaultCode: TableCode,   // optional
} satisfies AbstractCreateTypesOptions;

You can also override components and named slots per type:

// In your types.ts file
export const TypesButton = createTypes(import.meta.url, Button, {
  components: {
    pre: SpecialPreComponent, // Overrides factory-level component
  },
  TypePre: CustomInlinePre, // Overrides factory-level TypePre
});

The type-level metadata takes priority over factory-level options.

Enhancers

The enhancers option specifies rehype plugins to run on HAST before converting to JSX. By default, enhanceCodeInline is applied. When an anchorMap is available, enhanceCodeTypes is appended automatically.

Note

The anchorMap contains entries for all types from types.md, including every component part and additional types. When using createMultipleTypes, if you see links that don't resolve to a corresponding id on the page, you may be missing a component part (e.g., <TypesCheckbox.Indicator />) or the <TypesCheckboxAdditional /> component may need to be added to the page.

The enhancersInline option is the same concept but scoped to inline fields (shortType and default). It also defaults to [enhanceCodeInline]. This separation exists because inline fields typically don't need the full enhancer pipeline (e.g., export links).

Both options can be set at the factory level or overridden per type via TypesTableMeta.enhancers / TypesTableMeta.enhancersInline. Pass an empty array to disable all enhancers for that scope.

Build Integration

To make type extraction work at build time, configure the loadPrecomputedTypes webpack/Turbopack loader. The withDocsInfra Next.js plugin includes this automatically.

typeRefComponent

The typeRefComponent option enables interactive type references in code blocks. When set, the enhanceCodeTypes plugin emits custom elements instead of plain <a> tags, which are resolved to a React component you provide in the components map.

Tip

Rather than spreading TypeRef into the options here, consider adding it directly to mdxComponents in your mdx-components.tsx file. This way it's available everywhere — in MDX pages and type tables — without any extra configuration.

const options = {
  TypesTable,
  components: mdxComponents,
  TypePre: PreInline,
  typeRefComponent: 'TypeRef',
} satisfies AbstractCreateTypesOptions;

Important: The TypeRef component must be included in the components map (directly or via mdxComponents). The components map is used for rendering all markdown content including code blocks.

The TypeRef component receives href, name, and className properties from the HAST element. See useType for building an interactive TypeRef component that renders a popover with type documentation.

This option can be set at the factory level (applies to all types) or overridden per type via TypesTableMeta.typeRefComponent.

typePropRefComponent

The typePropRefComponent option extends property-level linking to use a custom component element instead of plain <span id> / <a href> elements. When combined with linkProps, properties in type definitions, object literals, function calls, and JSX attributes link to their documentation anchors.

const options = {
  TypesTable,
  components: mdxComponents,
  TypePre: PreInline,
  typeRefComponent: 'TypeRef',
  typePropRefComponent: 'TypePropRef',
  linkProps: 'shallow',
} satisfies AbstractCreateTypesOptions;

The TypePropRef component receives different properties depending on the site:

  • Definition sites (type definitions): id, name, prop, className
  • Reference sites (annotations, function calls, JSX): href, name, prop, className

See enhanceCodeTypes for more details on the property linking behavior and anchor format.

This option can be set at the factory level or overridden per type via TypesTableMeta.typePropRefComponent.

linkProps

The linkProps option controls property-level linking depth:

  • 'shallow' — link only top-level properties of known owners
  • 'deep' — link nested properties with dotted paths (e.g., address.street-name)
  • undefined (default) — no property linking
const options = {
  TypesTable,
  components: mdxComponents,
  TypePre: PreInline,
  linkProps: 'deep',
} satisfies AbstractCreateTypesOptions;

This option can be set at the factory level or overridden per type via TypesTableMeta.linkProps.

linkParams

The linkParams option enables function parameter linking. When true, parameter names (pl-v spans inside function parentheses) are linked to documentation anchors.

  • At definition sites (type definitions), parameters produce positional id anchors (optionally overridden by named anchors in anchorMap)
  • At reference sites (annotations, function calls), parameters produce positional href anchors resolved through anchorMap["Owner[N]"] named anchors
const options = {
  TypesTable,
  components: mdxComponents,
  TypePre: PreInline,
  linkParams: true,
} satisfies AbstractCreateTypesOptions;

See enhanceCodeTypes for more details on the parameter linking behavior, anchor format, and arrow confirmation.

This option can be set at the factory level or overridden per type via TypesTableMeta.linkParams.

linkScope

The linkScope option enables scope-based variable linking. When true, the plugin tracks variable declarations with type annotations and links later references (pl-smi spans) back to the type from their declaration.

  • Uses single-pass scope tracking with block scoping (const/let) and function scoping (var/params)
  • Only syntactically explicit bindings are tracked — uncertain cases stay unlinked
  • Supports closures, shadowing, destructured params, and positional callback inference
const options = {
  TypesTable,
  components: mdxComponents,
  TypePre: PreInline,
  linkScope: true,
} satisfies AbstractCreateTypesOptions;

See enhanceCodeTypes for more details on the scope linking behavior, design principles, and what stays unlinked.

This option can be set at the factory level or overridden per type via TypesTableMeta.linkScope.

typeParamRefComponent

The typeParamRefComponent option extends parameter-level linking to use a custom component element instead of plain <span id> / <a href> elements. When combined with linkParams, function parameters in type definitions and reference sites link to their documentation anchors.

const options = {
  TypesTable,
  components: mdxComponents,
  TypePre: PreInline,
  linkParams: true,
  typeParamRefComponent: 'TypeParamRef',
} satisfies AbstractCreateTypesOptions;

The TypeParamRef component receives different properties depending on the site:

  • Definition sites (type definitions): id, name, param, className
  • Reference sites (annotations, function calls): href, name, param, className

See enhanceCodeTypes for more details on the parameter linking behavior and anchor format.

This option can be set at the factory level or overridden per type via TypesTableMeta.typeParamRefComponent.

Factory Function Signatures

For reference, the loadPrecomputedTypes loader expects factory functions with these signatures:

// Single component types
type CreateTypes = (url: string, component: object, meta?: TypesTableMeta) => React.ComponentType;

// Multi-component types (e.g., Checkbox.Root, Checkbox.Indicator)
type CreateMultipleTypes = (
  url: string,
  components: Record<string, any>,
  meta?: TypesTableMeta,
) => { types: Record<string, React.ComponentType>; AdditionalTypes: React.ComponentType };

Advanced: Custom HOC Logic

Only needed when createTypesFactory or createMultipleTypesFactory don't provide enough flexibility:

import { abstractCreateTypes } from '@mui/internal-docs-infra/abstractCreateTypes';
import type { TypesTableMeta } from '@mui/internal-docs-infra/abstractCreateTypes';
import { MyTypesTable } from './MyTypesTable';

export function createMyTypes(url: string, typeDef: object, meta?: TypesTableMeta) {
  // Custom logic before creating the component
  const enhancedMeta = meta ? { ...meta, customFlag: true } : meta;

  // Wrap abstractCreateTypes with your custom behavior
  return abstractCreateTypes({ TypesTable: MyTypesTable }, url, enhancedMeta);
}

Custom Factory with TypeScript Generics

For even more flexibility, you can create a factory function that uses TypeScript generics so the loader can extract type information from the generic parameter instead of runtime arguments:

import { abstractCreateTypes } from '@mui/internal-docs-infra/abstractCreateTypes';
import type { TypesTableMeta } from '@mui/internal-docs-infra/abstractCreateTypes';
import { MyTypesTable } from './MyTypesTable';

export function createTypes<TComponent extends object>(url: string, meta?: TypesTableMeta) {
  return abstractCreateTypes({ TypesTable: MyTypesTable }, url, meta);
}
// Usage — the loader extracts types from the generic parameter
export const TypesButton = createTypes<typeof Button>(import.meta.url);

This enables:

  • Type-safe factory calls without runtime component arguments
  • Cleaner syntax when components are only used for type extraction

Next steps: Once your factories are set up, configure the build-time loader in loadPrecomputedTypes to extract and precompute type data during compilation.

Types

abstractCreateTypes

ParameterTypeDescription
options
AbstractCreateTypesOptions<{}>
url
string
meta
TypesTableMeta | undefined
exportName
string | undefined
Return Type
React.ComponentType<{}>

createTypesFactory

PropertyTypeDescription
TypesTable
React.ComponentType<TypesTableProps<{}>>
components
| {
    pre?: React.ComponentType<{
      'data-precompute'?: string;
    }>;
  }
| undefined
TypePre
React.ComponentType<{ children: React.ReactNode }>

Required pre component for type code blocks. Type signatures are not precomputed, so this has a different contract from components.pre. Can be overridden by TypesTableMeta.TypePre.

DetailedTypePre
| React.ComponentType<{ children: React.ReactNode }>
| undefined

Optional pre component for detailed type blocks. Falls back to TypePre when not provided. Can be overridden by TypesTableMeta.DetailedTypePre.

ShortTypeCode
| React.ComponentType<{
    children?: React.ReactNode;
    className?: string;
  }>
| undefined

Optional code component for shortType fields. Falls back to components.code when not provided. Can be overridden by TypesTableMeta.ShortTypeCode.

DefaultCode
| React.ComponentType<{
    children?: React.ReactNode;
    className?: string;
  }>
| undefined

Optional code component for default value fields. Falls back to components.code when not provided. Can be overridden by TypesTableMeta.DefaultCode.

RawTypePre
| React.ComponentType<{ children: React.ReactNode }>
| undefined

Optional pre component for raw type formatted code blocks. Falls back to DetailedTypePre, then TypePre when not provided. Can be overridden by TypesTableMeta.RawTypePre.

enhancers
Pluggable[] | undefined

Rehype plugins to run on HAST before converting to JSX. Can be overridden by TypesTableMeta.enhancers. Defaults to [enhanceCodeInline] when undefined. Pass an empty array to disable all enhancers.

enhancersInline
Pluggable[] | undefined

Rehype plugins to run on inline HAST fields (shortType and default). Can be overridden by TypesTableMeta.enhancersInline. Defaults to [enhanceCodeInline] when undefined. Pass an empty array to disable all inline enhancers.

typeRefComponent
string | undefined

Custom component tag name to use instead of <a> for type reference links. When set, enhanceCodeTypes emits elements with this tag name, adding a name property (the matched identifier) alongside href. Can be overridden by TypesTableMeta.typeRefComponent.

typePropRefComponent
string | undefined

Custom component tag name for property reference elements. Can be overridden by TypesTableMeta.typePropRefComponent.

typeParamRefComponent
string | undefined

Custom component tag name for function parameter reference elements. Can be overridden by TypesTableMeta.typeParamRefComponent.

linkProps
'shallow' | 'deep' | undefined

Opt-in property linking mode for enhanceCodeTypes. Can be overridden by TypesTableMeta.linkProps.

linkParams
boolean | undefined

Opt-in function parameter linking for enhanceCodeTypes. Can be overridden by TypesTableMeta.linkParams.

linkScope
boolean | undefined

Opt-in scope-based variable linking for enhanceCodeTypes. Can be overridden by TypesTableMeta.linkScope.

moduleLinkMap
| {
    js?: Record<string, ModuleLinkMapEntry>;
    css?: Record<string, ModuleLinkMapEntry>;
  }
| undefined

Module import linking map for enhanceCodeTypes. Can be overridden by TypesTableMeta.moduleLinkMap.

defaultImportSlug
string | undefined

Default anchor slug for default/namespace imports. Can be overridden by TypesTableMeta.defaultImportSlug.

Return Type
((url: string, typeDef: {}, meta?: TypesTableMeta) => React.ComponentType<{}>)

createMultipleTypesFactory

PropertyTypeDescription
TypesTable
React.ComponentType<TypesTableProps<{}>>
components
| {
    pre?: React.ComponentType<{
      'data-precompute'?: string;
    }>;
  }
| undefined
TypePre
React.ComponentType<{ children: React.ReactNode }>

Required pre component for type code blocks. Type signatures are not precomputed, so this has a different contract from components.pre. Can be overridden by TypesTableMeta.TypePre.

DetailedTypePre
| React.ComponentType<{ children: React.ReactNode }>
| undefined

Optional pre component for detailed type blocks. Falls back to TypePre when not provided. Can be overridden by TypesTableMeta.DetailedTypePre.

ShortTypeCode
| React.ComponentType<{
    children?: React.ReactNode;
    className?: string;
  }>
| undefined

Optional code component for shortType fields. Falls back to components.code when not provided. Can be overridden by TypesTableMeta.ShortTypeCode.

DefaultCode
| React.ComponentType<{
    children?: React.ReactNode;
    className?: string;
  }>
| undefined

Optional code component for default value fields. Falls back to components.code when not provided. Can be overridden by TypesTableMeta.DefaultCode.

RawTypePre
| React.ComponentType<{ children: React.ReactNode }>
| undefined

Optional pre component for raw type formatted code blocks. Falls back to DetailedTypePre, then TypePre when not provided. Can be overridden by TypesTableMeta.RawTypePre.

enhancers
Pluggable[] | undefined

Rehype plugins to run on HAST before converting to JSX. Can be overridden by TypesTableMeta.enhancers. Defaults to [enhanceCodeInline] when undefined. Pass an empty array to disable all enhancers.

enhancersInline
Pluggable[] | undefined

Rehype plugins to run on inline HAST fields (shortType and default). Can be overridden by TypesTableMeta.enhancersInline. Defaults to [enhanceCodeInline] when undefined. Pass an empty array to disable all inline enhancers.

typeRefComponent
string | undefined

Custom component tag name to use instead of <a> for type reference links. When set, enhanceCodeTypes emits elements with this tag name, adding a name property (the matched identifier) alongside href. Can be overridden by TypesTableMeta.typeRefComponent.

typePropRefComponent
string | undefined

Custom component tag name for property reference elements. Can be overridden by TypesTableMeta.typePropRefComponent.

typeParamRefComponent
string | undefined

Custom component tag name for function parameter reference elements. Can be overridden by TypesTableMeta.typeParamRefComponent.

linkProps
'shallow' | 'deep' | undefined

Opt-in property linking mode for enhanceCodeTypes. Can be overridden by TypesTableMeta.linkProps.

linkParams
boolean | undefined

Opt-in function parameter linking for enhanceCodeTypes. Can be overridden by TypesTableMeta.linkParams.

linkScope
boolean | undefined

Opt-in scope-based variable linking for enhanceCodeTypes. Can be overridden by TypesTableMeta.linkScope.

moduleLinkMap
| {
    js?: Record<string, ModuleLinkMapEntry>;
    css?: Record<string, ModuleLinkMapEntry>;
  }
| undefined

Module import linking map for enhanceCodeTypes. Can be overridden by TypesTableMeta.moduleLinkMap.

defaultImportSlug
string | undefined

Default anchor slug for default/namespace imports. Can be overridden by TypesTableMeta.defaultImportSlug.

Return Type
(<K extends Record<string, any>>(url: string, typeDef: K, meta?: TypesTableMeta) => { types: Record<string | number | symbol, React.ComponentType<T>>; AdditionalTypes: React.ComponentType<T> })

Additional Types

AbstractCreateTypesOptions
type AbstractCreateTypesOptions<T extends {} = {}> = {
  TypesTable: React.ComponentType<TypesTableProps<T>>;
  components?: { pre?: React.ComponentType<{ 'data-precompute'?: string }> };
  /**
   * Required pre component for type code blocks.
   * Type signatures are not precomputed, so this has a different
   * contract from `components.pre`.
   * Can be overridden by TypesTableMeta.TypePre.
   */
  TypePre: React.ComponentType<{ children: React.ReactNode }>;
  /**
   * Optional pre component for detailed type blocks.
   * Falls back to `TypePre` when not provided.
   * Can be overridden by TypesTableMeta.DetailedTypePre.
   */
  DetailedTypePre?: React.ComponentType<{ children: React.ReactNode }>;
  /**
   * Optional code component for shortType fields.
   * Falls back to `components.code` when not provided.
   * Can be overridden by TypesTableMeta.ShortTypeCode.
   */
  ShortTypeCode?: React.ComponentType<{ children?: React.ReactNode; className?: string }>;
  /**
   * Optional code component for default value fields.
   * Falls back to `components.code` when not provided.
   * Can be overridden by TypesTableMeta.DefaultCode.
   */
  DefaultCode?: React.ComponentType<{ children?: React.ReactNode; className?: string }>;
  /**
   * Optional pre component for raw type formatted code blocks.
   * Falls back to `DetailedTypePre`, then `TypePre` when not provided.
   * Can be overridden by TypesTableMeta.RawTypePre.
   */
  RawTypePre?: React.ComponentType<{ children: React.ReactNode }>;
  /**
   * Rehype plugins to run on HAST before converting to JSX.
   * Can be overridden by TypesTableMeta.enhancers.
   * Defaults to `[enhanceCodeInline]` when undefined.
   * Pass an empty array to disable all enhancers.
   */
  enhancers?: Pluggable[];
  /**
   * Rehype plugins to run on inline HAST fields (shortType and default).
   * Can be overridden by TypesTableMeta.enhancersInline.
   * Defaults to `[enhanceCodeInline]` when undefined.
   * Pass an empty array to disable all inline enhancers.
   */
  enhancersInline?: Pluggable[];
  /**
   * Custom component tag name to use instead of `<a>` for type reference links.
   * When set, enhanceCodeTypes emits elements with this tag name,
   * adding a `name` property (the matched identifier) alongside `href`.
   * Can be overridden by TypesTableMeta.typeRefComponent.
   */
  typeRefComponent?: string;
  /**
   * Custom component tag name for property reference elements.
   * Can be overridden by TypesTableMeta.typePropRefComponent.
   */
  typePropRefComponent?: string;
  /**
   * Custom component tag name for function parameter reference elements.
   * Can be overridden by TypesTableMeta.typeParamRefComponent.
   */
  typeParamRefComponent?: string;
  /**
   * Opt-in property linking mode for enhanceCodeTypes.
   * Can be overridden by TypesTableMeta.linkProps.
   */
  linkProps?: 'shallow' | 'deep';
  /**
   * Opt-in function parameter linking for enhanceCodeTypes.
   * Can be overridden by TypesTableMeta.linkParams.
   */
  linkParams?: boolean;
  /**
   * Opt-in scope-based variable linking for enhanceCodeTypes.
   * Can be overridden by TypesTableMeta.linkScope.
   */
  linkScope?: boolean;
  /**
   * Module import linking map for enhanceCodeTypes.
   * Can be overridden by TypesTableMeta.moduleLinkMap.
   */
  moduleLinkMap?: {
    js?: Record<string, ModuleLinkMapEntry>;
    css?: Record<string, ModuleLinkMapEntry>;
  };
  /**
   * Default anchor slug for default/namespace imports.
   * Can be overridden by TypesTableMeta.defaultImportSlug.
   */
  defaultImportSlug?: string;
}
defaultOrdering

Default ordering configuration using the arrays defined in this file.

type defaultOrdering = {
  /** Order of CSS custom properties in documentation output */
  cssVariables: string[];
  /** Order of data-* attributes in documentation output */
  dataAttributes: string[];
  /** Order of component props in documentation output */
  props: string[];
  /** Order of namespace member parts (e.g., Root, Trigger, Item) */
  namespaceParts: string[];
  /** Order of type suffixes (e.g., Props, State, DataAttributes) */
  typeSuffixes: string[];
}
ExportData

Export data structure containing a main type and its related additional types. Used in the precompute field for structured type data.

type ExportData = {
  /** The main component/hook/function type for this export */
  type: HighlightedTypesMeta;
  /** Related types like .Props, .State, .ChangeEventDetails for this export */
  additionalTypes: HighlightedTypesMeta[];
}
OrderingConfig

Configuration for the ordering of props, data attributes, CSS variables, component exports, namespace parts, and type suffixes in generated documentation.

Each array defines the order in which items should appear. Items not in the array are placed at the position of the __EVERYTHING_ELSE__ marker, sorted alphabetically.

type OrderingConfig = {
  /** Order of CSS custom properties in documentation output */
  cssVariables?: string[];
  /** Order of data-* attributes in documentation output */
  dataAttributes?: string[];
  /** Order of component props in documentation output */
  props?: string[];
  /** Order of namespace member parts (e.g., Root, Trigger, Item) */
  namespaceParts?: string[];
  /** Order of type suffixes (e.g., Props, State, DataAttributes) */
  typeSuffixes?: string[];
}
TypesTableMeta
type TypesTableMeta = {
  precompute?: {
    exports: Record<string, ExportData>;
    additionalTypes: HighlightedTypesMeta[];
    variantOnlyAdditionalTypes?: Record<string, HighlightedTypesMeta[]>;
    variantTypeNames?: Record<string, string[]>;
    singleComponentName?: string;
    anchorMap?: { js?: Record<string, string>; css?: Record<string, string> };
  };
  name?: string;
  displayName?: string;
  disableOptimization?: boolean;
  watchSourceDirectly?: boolean;
  /**
   * When true, excludes this component from the parent index page.
   * The component types will still be processed, but won't be added to the index.
   */
  excludeFromIndex?: boolean;
  components?: { pre?: React.ComponentType<{ 'data-precompute'?: string }> };
  /**
   * Override pre component for type code blocks.
   * When set, overrides the factory-level TypePre.
   */
  TypePre?: React.ComponentType<{ children: React.ReactNode }>;
  /**
   * Override pre component for detailed type blocks.
   * When set, overrides the factory-level DetailedTypePre.
   */
  DetailedTypePre?: React.ComponentType<{ children: React.ReactNode }>;
  /**
   * Override code component for shortType fields.
   * When set, overrides the factory-level ShortTypeCode.
   */
  ShortTypeCode?: React.ComponentType<{ children?: React.ReactNode; className?: string }>;
  /**
   * Override code component for default value fields.
   * When set, overrides the factory-level DefaultCode.
   */
  DefaultCode?: React.ComponentType<{ children?: React.ReactNode; className?: string }>;
  /**
   * Override pre component for raw type formatted code blocks.
   * When set, overrides the factory-level RawTypePre.
   */
  RawTypePre?: React.ComponentType<{ children: React.ReactNode }>;
  /**
   * Rehype plugins to run on HAST before converting to JSX.
   * If set, completely overrides enhancers from AbstractCreateTypesOptions.
   * Defaults to `[enhanceCodeInline]` when undefined.
   * Pass an empty array to disable all enhancers.
   */
  enhancers?: Pluggable[];
  /**
   * Rehype plugins to run on inline HAST fields (shortType and default).
   * If set, completely overrides enhancersInline from AbstractCreateTypesOptions.
   * Defaults to `[enhanceCodeInline]` when undefined.
   * Pass an empty array to disable all inline enhancers.
   */
  enhancersInline?: Pluggable[];
  /**
   * Custom component tag name to use instead of `<a>` for type reference links.
   * When set, enhanceCodeTypes emits elements with this tag name,
   * adding a `name` property (the matched identifier) alongside `href`.
   * This enables interactive type popovers via a `TypeRef` component.
   */
  typeRefComponent?: string;
  /**
   * Custom component tag name to use instead of a plain HTML element
   * for property references within type definitions, object literals, function calls, and JSX.
   * For definitions the element receives `id`, for references it receives `href`.
   * Both also receive `name` (owner) and `prop` (kebab-case property path).
   */
  typePropRefComponent?: string;
  /**
   * Custom component tag name to use instead of a plain HTML element
   * for function parameter references.
   * For definitions the element receives `id`, for references it receives `href`.
   * Both also receive `name` (owner) and `param` (parameter name).
   */
  typeParamRefComponent?: string;
  /**
   * Opt-in property linking mode for enhanceCodeTypes.
   * - `'shallow'`: Link only top-level properties of known owners.
   * - `'deep'`: Link nested properties with dotted paths (e.g., `address.street-name`).
   * - `undefined` (default): No property linking.
   */
  linkProps?: 'shallow' | 'deep';
  /**
   * Opt-in function parameter linking for enhanceCodeTypes.
   * When `true`, links function parameter names to documentation anchors.
   */
  linkParams?: boolean;
  /**
   * Opt-in scope-based variable linking for enhanceCodeTypes.
   * When `true`, links variable references to the type from their declaration
   * using single-pass scope tracking.
   */
  linkScope?: boolean;
  /**
   * Module import linking map for enhanceCodeTypes.
   * Maps module specifiers to their documentation page and exports.
   */
  moduleLinkMap?: {
    js?: Record<string, ModuleLinkMapEntry>;
    css?: Record<string, ModuleLinkMapEntry>;
  };
  /**
   * Default anchor slug for default/namespace imports when the module entry
   * in `moduleLinkMap` does not specify a `defaultSlug`.
   */
  defaultImportSlug?: string;
}