type ActionFunction<T, C> = T extends keyof RegisteredActions ? RegisteredActions[T] : C;
Type helper for retrieving the correct action function type based on the action ID. Returns the strongly-typed action for known actions, or a custom action type for unknown IDs.
Type Parameters#
Type Parameter | Default type | Description |
---|---|---|
T extends ActionId | - | The action ID type |
C | CustomActionFunction | The custom action function type (defaults to CustomActionFunction) |