export type CacheTypeReducer<
State extends CacheType,
CachedType,
RawType = CachedType,
PresentType = CachedType | RawType,
Fallback = PresentType | null,
> = [State] extends ['cached']
? CachedType
: [State] extends ['raw']
? RawType
: [State] extends ['raw' | 'cached']
? PresentType
: Fallback;