Search Docs
Loading...
Skip to content

Type Alias: ComponentMatcher

type ComponentMatcher<C> =
| "first"
| "last"
| number
| C["id"]
| ComponentGlobPattern
| Partial<C>
| (component, index) => boolean;

Unified component matcher type supporting all matching strategies.

  • 'first' / 'last' - Match first or last component
  • number - Match by index (0, 1, -1, etc.)
  • C['id'] - Match by exact ID (with autocomplete for known IDs)
  • ComponentGlobPattern - Match by glob pattern (e.g., 'ly.img.*')
  • Partial<C> - Match by partial properties (e.g., { id: 'x', key: 'y' })
  • (component, index) => boolean - Custom predicate function

Type Parameters#

Type ParameterDefault type
C extends OrderComponentOrderComponent