@reactables/forms 0.7.0-alpha.15 → 0.7.0-alpha.17

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.
@@ -1,4 +1,4 @@
1
- import { Reactable, EffectsAndSources, Action, Effect, ScopedEffects } from '@reactables/core';
1
+ import { Reactable, EffectsAndSources, Action, Effect, ScopedEffects, ActionMap } from '@reactables/core';
2
2
  import { UpdateValuesPayload, AddControlPayload, MarkTouchedPayload, PushControlPayload } from '../Models/Payloads';
3
3
  import { ControlRef } from '../Models';
4
4
  import { FormControlConfig, FormArrayConfig, FormGroupConfig, AbstractControlConfig } from '../Models/Configs';
@@ -33,11 +33,13 @@ export type CustomReducer = CustomReducerFunc | {
33
33
  reducer: CustomReducerFunc;
34
34
  effects?: ((payload?: unknown) => ScopedEffects<unknown>) | Effect<unknown, unknown>[];
35
35
  };
36
- export interface CustomReducers {
37
- [key: string]: CustomReducer;
38
- }
39
- export interface RxFormOptions<T extends CustomReducers> extends EffectsAndSources {
40
- reducers?: T;
36
+ export type CustomReducers<T> = {
37
+ [key in keyof (T & {
38
+ [key: string]: CustomReducer;
39
+ })]: CustomReducer;
40
+ };
41
+ export interface RxFormOptions extends EffectsAndSources {
42
+ reducers?: CustomReducers<unknown>;
41
43
  providers?: RxFormProviders;
42
44
  name?: string;
43
45
  }
@@ -53,6 +55,6 @@ export interface RxFormProviders {
53
55
  [key: string]: ValidatorAsyncFn;
54
56
  };
55
57
  }
56
- export declare const build: <T extends CustomReducers>(config: AbstractControlConfig, options?: RxFormOptions<T>) => Reactable<Form<unknown>, { [K in keyof T]: (payload?: any) => void; } & RxFormActions>;
57
- export declare const load: <T extends CustomReducers>(state: Form<unknown>, options?: RxFormOptions<T>) => Reactable<Form<unknown>, { [K in keyof T]: (payload?: any) => void; } & RxFormActions>;
58
+ export declare const build: (config: AbstractControlConfig, options?: RxFormOptions) => Reactable<Form<unknown>, ActionMap & RxFormActions>;
59
+ export declare const load: (state: Form<unknown>, options?: RxFormOptions) => Reactable<Form<unknown>, ActionMap & RxFormActions>;
58
60
  export {};
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "author": "David Lai",
15
15
  "license": "ISC",
16
16
  "dependencies": {
17
- "@reactables/core": "^0.7.0-alpha.15",
17
+ "@reactables/core": "^0.7.0-alpha.17",
18
18
  "lodash.isequal": "^4.5.0"
19
19
  },
20
20
  "peerDependencies": {
@@ -23,5 +23,5 @@
23
23
  "devDependencies": {
24
24
  "lodash.clonedeep": "^4.5.0"
25
25
  },
26
- "version": "0.7.0-alpha.15"
26
+ "version": "0.7.0-alpha.17"
27
27
  }