type ExistingStateType = State extends { type?: infer Type extends string; } ? NonNullable : never; type StateWithType = State & { type: ExistingStateType | Type; }; export declare function ensureStateType(state: State & { type?: string; }, type: Type): StateWithType; export {};