Interface IMatcher<TData>
- Namespace
- Whim.CommandPalette
- Assembly
- Whim.CommandPalette.dll
A matcher is used by the command palette to find that match a given input.
public interface IMatcher<TData>
Type Parameters
TData
- The type of data the matcher matches.
Methods
LoadState(JsonElement)
Load the matcher's state from
state
.void LoadState(JsonElement state)
Parameters
state
JsonElement- The matcher's state.
Match(string, IReadOnlyList<IVariantRowModel<TData>>)
Matcher returns an ordered list of filtered matches for the
query
.IEnumerable<MatcherResult<TData>> Match(string query, IReadOnlyList<IVariantRowModel<TData>> items)
Parameters
query
stringitems
IReadOnlyList<IVariantRowModel<TData>>
Returns
- IEnumerable<MatcherResult<TData>>
OnMatchExecuted(IVariantRowModel<TData>)
Called when a match has been executed. This is used by the IMatcher<TData>
implementation to update relevant internal state.
void OnMatchExecuted(IVariantRowModel<TData> item)
Parameters
item
IVariantRowModel<TData>
SaveState()
Save the matcher's state as a JsonElement.
JsonElement? SaveState()
Returns
- JsonElement?
- The matcher's state.