match.d.ts 637 B

123456789
  1. import { State } from './State';
  2. import { StateValue, EventObject } from './types';
  3. export declare type ValueFromStateGetter<T, TContext, TEvent extends EventObject> = (state: State<TContext, TEvent>) => T;
  4. export declare type StatePatternTuple<T, TContext, TEvent extends EventObject> = [
  5. StateValue,
  6. ValueFromStateGetter<T, TContext, TEvent>
  7. ];
  8. export declare function matchState<T, TContext, TEvent extends EventObject>(state: State<TContext, TEvent> | StateValue, patterns: Array<StatePatternTuple<T, TContext, TEvent>>, defaultValue: ValueFromStateGetter<T, TContext, TEvent>): T;
  9. //# sourceMappingURL=match.d.ts.map