@akanjs/store 0.9.58 → 0.9.59

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": "@akanjs/store",
3
- "version": "0.9.58",
3
+ "version": "0.9.59",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -105,6 +105,7 @@ export interface NewOption {
105
105
  type PartialOrNull<O> = {
106
106
  [K in keyof O]?: O[K] | null;
107
107
  };
108
+ type OptionalArgs<T extends any[]> = T extends [infer Head, ...infer Tail] ? [arg?: Head | null, ...OptionalArgs<Tail>] : [];
108
109
  type BaseAction<T extends string, Input, Full extends {
109
110
  id: string;
110
111
  }, Light, _CapitalizedT extends string = Capitalize<T>, _CreateOption = CreateOption<Full>> = {
@@ -145,7 +146,7 @@ type SliceAction<T extends string, Input, Full extends {
145
146
  }, Light, QueryArgs extends any[], Filter extends FilterInstance, _CapitalizedT extends string = Capitalize<T>, _Sort = ExtractSort<Filter>, _FetchInitFormWithFetchPolicy = FetchInitForm<Input, Full, Filter> & FetchPolicy> = {
146
147
  [K in `init${_CapitalizedT}`]: (...args: [...args: QueryArgs, initForm?: _FetchInitFormWithFetchPolicy]) => Promise<void>;
147
148
  } & {
148
- [K in `refresh${_CapitalizedT}`]: (...args: [...args: QueryArgs, initForm?: _FetchInitFormWithFetchPolicy]) => Promise<void>;
149
+ [K in `refresh${_CapitalizedT}`]: (...args: [...args: OptionalArgs<QueryArgs>, initForm?: _FetchInitFormWithFetchPolicy]) => Promise<void>;
149
150
  } & {
150
151
  [K in `select${_CapitalizedT}`]: (model: Light | Light[], options?: {
151
152
  refresh?: boolean;