type BaseObject = Record; type ObjectStatePropGuard = ( previous: S, key: keyof S, value?: S[keyof S], ) => boolean; type ObjectStatePropSetter = ( previous: S, result: S, key: keyof S, value?: S[keyof S], ) => void; type BuildObjectStateSetterCallbackOptions = { guard?: ObjectStatePropGuard; isOverwrite?: boolean; set?: ObjectStatePropSetter; }; type BuildObjectStateSetterCallbackReturnType = ( previous: S, ) => S;