import type { Middleware, StoreEnhancer } from 'redux'; import type { EnhancerArray, MiddlewareArray } from './utils'; /** * return True if T is `any`, otherwise return False * taken from https://github.com/joonhocho/tsdef * * @internal */ export declare type IsAny = true | false extends (T extends never ? true : false) ? True : False; /** * return True if T is `unknown`, otherwise return False * taken from https://github.com/joonhocho/tsdef * * @internal */ export declare type IsUnknown = unknown extends T ? IsAny : False; export declare type FallbackIfUnknown = IsUnknown; /** * @internal */ export declare type IfMaybeUndefined = [undefined] extends [P] ? True : False; /** * @internal */ export declare type IfVoid = [void] extends [P] ? True : False; /** * @internal */ export declare type IsEmptyObj = T extends any ? keyof T extends never ? IsUnknown>> : False : never; /** * returns True if TS version is above 3.5, False if below. * uses feature detection to detect TS version >= 3.5 * * versions below 3.5 will return `{}` for unresolvable interference * * versions above will return `unknown` * * @internal */ export declare type AtLeastTS35 = [True, False][IsUnknown() => T)>, 0, 1>]; /** * @internal */ export declare type IsUnknownOrNonInferrable = AtLeastTS35, IsEmptyObj>>; /** * Convert a Union type `(A|B)` to an intersection type `(A&B)` */ export declare type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; export declare type ExcludeFromTuple = T extends [ infer Head, ...infer Tail ] ? ExcludeFromTuple : Acc; declare type ExtractDispatchFromMiddlewareTuple = MiddlewareTuple extends [infer Head, ...infer Tail] ? ExtractDispatchFromMiddlewareTuple ? IsAny : {})> : Acc; export declare type ExtractDispatchExtensions = M extends MiddlewareArray ? ExtractDispatchFromMiddlewareTuple : M extends ReadonlyArray ? ExtractDispatchFromMiddlewareTuple<[...M], {}> : never; declare type ExtractStoreExtensionsFromEnhancerTuple = EnhancerTuple extends [infer Head, ...infer Tail] ? ExtractStoreExtensionsFromEnhancerTuple ? IsAny : {})> : Acc; export declare type ExtractStoreExtensions = E extends EnhancerArray ? ExtractStoreExtensionsFromEnhancerTuple : E extends ReadonlyArray ? UnionToIntersection ? Ext extends {} ? IsAny : {} : {}> : never; declare type ExtractStateExtensionsFromEnhancerTuple = EnhancerTuple extends [infer Head, ...infer Tail] ? ExtractStateExtensionsFromEnhancerTuple ? IsAny : {})> : Acc; export declare type ExtractStateExtensions = E extends EnhancerArray ? ExtractStateExtensionsFromEnhancerTuple : E extends ReadonlyArray ? UnionToIntersection ? StateExt extends {} ? IsAny : {} : {}> : never; /** * Helper type. Passes T out again, but boxes it in a way that it cannot * "widen" the type by accident if it is a generic that should be inferred * from elsewhere. * * @internal */ export declare type NoInfer = [T][T extends any ? 0 : never]; export declare type Omit = Pick>; export interface TypeGuard { (value: any): value is T; } export interface HasMatchFunction { match: TypeGuard; } export declare const hasMatchFunction: (v: Matcher) => v is HasMatchFunction; /** @public */ export declare type Matcher = HasMatchFunction | TypeGuard; /** @public */ export declare type ActionFromMatcher> = M extends Matcher ? T : never; export declare type Id = { [K in keyof T]: T[K]; } & {}; export {};