diff --git a/index.d.ts b/index.d.ts index 4e03686da3..1e3804ae97 100644 --- a/index.d.ts +++ b/index.d.ts @@ -53,16 +53,17 @@ declare const $CombinedState: unique symbol * typed as always undefined, so its never expected to have a meaningful * value anyway. It just makes this type distinquishable from plain `{}`. */ -export type CombinedState = { readonly [$CombinedState]?: undefined } & S +interface EmptyObject { + readonly [$CombinedState]?: undefined +} +export type CombinedState = EmptyObject & S /** * Recursively makes combined state objects partial. Only combined state _root * objects_ (i.e. the generated higher level object with keys mapping to * individual reducers) are partial. */ -export type PreloadedState = Required extends { - [$CombinedState]: undefined -} +export type PreloadedState = Required extends EmptyObject ? S extends CombinedState ? { [K in keyof S1]?: S1[K] extends object ? PreloadedState : S1[K]