You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
567 B
23 lines
567 B
type BaseObject<T = unknown> = Record<number | string | symbol, T>; |
|
|
|
type ObjectStatePropGuard<S extends BaseObject> = ( |
|
previous: S, |
|
key: keyof S, |
|
value?: S[keyof S], |
|
) => boolean; |
|
|
|
type ObjectStatePropSetter<S extends BaseObject> = ( |
|
result: S, |
|
key: keyof S, |
|
value?: S[keyof S], |
|
) => void; |
|
|
|
type BuildObjectStateSetterCallbackOptions<S extends BaseObject> = { |
|
guard?: ObjectStatePropGuard<S>; |
|
isOverwrite?: boolean; |
|
set?: ObjectStatePropSetter<S>; |
|
}; |
|
|
|
type BuildObjectStateSetterCallbackReturnType<S extends BaseObject> = ( |
|
previous: S, |
|
) => S;
|
|
|