import type { Middleware } from 'redux' ; internal export type IsAny < T , True , False = never > = true | false extends ( T extends never ? true : false ) ? True : False ; internal export type IsUnknown < T , True , False = never > = unknown extends T ? IsAny < T , False , True > : False ; export type FallbackIfUnknown < T , Fallback > = IsUnknown < T , Fallback , T > ; internal export type IfMaybeUndefined < P , True , False > = [ undefined ] extends [ P ] ? True : False ; internal export type IfVoid < P , True , False > = [ void ] extends [ P ] ? True : False ; internal export type IsEmptyObj < T , True , False = never > = T extends any ? keyof T extends never ? IsUnknown < T , False , IfMaybeUndefined < T , False , IfVoid < T , False , True > > > : False : never ; internal export type AtLeastTS35 < True , False > = [ True , False ] [ IsUnknown < ReturnType < T > ( ) => T > , 0 , 1 > ] ; internal export type IsUnknownOrNonInferrable < T , True , False > = AtLeastTS35 < IsUnknown < T , True , False > , IsEmptyObj < T , True , IsUnknown < T , True , False > > > ; /**
 * Combines all dispatch signatures of all middlewares in the array `M` into
 * one intersected dispatch signature.
 */ export type DispatchForMiddlewares < M > = M extends ReadonlyArray < any > ? UnionToIntersection < M [ number ] extends infer MiddlewareValues ? MiddlewareValues extends Middleware < infer DispatchExt , any , any > ? DispatchExt extends Function ? IsAny < DispatchExt , never , DispatchExt > : never : never : never > : never ; /**
 * Convert a Union type `(A|B)` to an intersection type `(A&B)`
 */ export type UnionToIntersection < U > = ( U extends any ? ( k : U ) => void : never ) extends ( k : infer I ) => void ? I : never ; internal export type NoInfer < T > = [ T ] [ T extends any ? 0 : never ] ; export type Omit < T , K extends keyof any > = Pick < T , Exclude < keyof T , K > > ; export interface HasMatchFunction < T > { match : ( v : any ) => v is T ; } export const hasMatchFunction = < T > ( v ) : v is HasMatchFunction < T > => { return v && typeof ( v as HasMatchFunction < T > ) . match === 'function' ; } ; public export type Matcher < T > = HasMatchFunction < T > | ( ( v : any ) => v is T ) ; public export type ActionFromMatcher < M extends Matcher < any > > = M extends Matcher < infer T > ? T : never ;