Skip to content

How-to guides

This section contains task-oriented guides that show how to achieve specific goals. Use these when you know what you want to do and need to find out how.

By task

Working with metadata

These guides cover MetadataCollection operations:

Task Guide
Find metadata by type Querying metadata
Apply custom predicates Filtering metadata
Combine and sort collections Transforming metadata
Real-world patterns Metadata recipes

Traversing and configuring

Task Guide
Visit all nodes in a type Walking the type graph
Filter with type narrowing Filtering with walk()
Control inspection behavior Configuration options

Helper functions

Task Guide
Work with optionals, unions Common helper functions
Handle union types in depth Working with unions

All guides

Querying metadata
Find, get, and count metadata items by type using MetadataCollection's query methods.
Filtering metadata
Filter collections using predicates, type constraints, and runtime-checkable protocols.
Transforming metadata
Combine, sort, deduplicate, and transform metadata collections.
Metadata recipes
Real-world patterns for validation extraction, documentation generation, and troubleshooting.
Walking the type graph
Traverse the type graph recursively using the children() method to process nested types.
Filtering with walk()
Filter type graphs using walk() with built-in type guards, custom TypeIs predicates, and depth limits.
Configuration options
Customize inspection behavior with InspectConfig, forward reference modes, and cache management.
Common helper functions
Use built-in helpers for optional types, union extraction, and class detection.
Working with unions
Detect unions, extract members, handle optionals, build dispatch logic, and control normalization.