@action-land/component
Version:
Basic interface for a component
14 lines (13 loc) • 407 B
TypeScript
import { Action } from '@action-land/core';
/**
* Infer type of action for given action or action union type
*
* ```typescript
* import {Action} from '@action-land/core'
*
* LActionTypes<Action<10, 't1'> | Action<20, 't2'>> // outputs 't1' | 't2'
* ```
* @typeparam A Action union type
* @category ComponentNext
*/
export declare type LActionTypes<A> = A extends Action<any, infer T> ? T : never;