cogsbox-state 0.5.445 → 0.5.446

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogsbox-state",
3
- "version": "0.5.445",
3
+ "version": "0.5.446",
4
4
  "description": "React state management library with form controls and server sync",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/CogsState.tsx CHANGED
@@ -540,7 +540,7 @@ type UseCogsStateHook<
540
540
  > = <StateKey extends keyof TransformedStateType<T>>(
541
541
  stateKey: StateKey,
542
542
  options?: Prettify<
543
- OptionsType<TransformedStateType<T>[StateKey]> & { apiParams: apiParams }
543
+ OptionsType<TransformedStateType<T>[StateKey]> & { apiParams?: apiParams }
544
544
  >
545
545
  ) => StateObject<TransformedStateType<T>[StateKey]>;
546
546
 
@@ -696,9 +696,16 @@ export function createCogsStateFromSync<
696
696
  },
697
697
  >(
698
698
  syncSchema: TSyncSchema
699
- ): CogsApi<{
700
- [K in keyof TSyncSchema['schemas']]: TSyncSchema['schemas'][K]['schemas']['defaultValues'];
701
- }> {
699
+ ): CogsApi<
700
+ {
701
+ [K in keyof TSyncSchema['schemas']]: TSyncSchema['schemas'][K]['schemas']['defaultValues'];
702
+ },
703
+ {
704
+ [K in keyof TSyncSchema['schemas']]: TSyncSchema['schemas'][K]['apiParams'];
705
+ }[keyof {
706
+ [K in keyof TSyncSchema['schemas']]: TSyncSchema['schemas'][K]['apiParams'];
707
+ }]
708
+ > {
702
709
  const schemas = syncSchema.schemas;
703
710
  const initialState: any = {};
704
711