@@ -38,7 +38,7 @@ export type StrictSchema<Target = any, Source = any> = {
38
38
| ActionString < Source >
39
39
| ActionFunction < Target , Source , Target [ destinationProperty ] >
40
40
| ActionAggregator < Source >
41
- | ActionSelector < Source , Target [ destinationProperty ] >
41
+ | ActionSelector < Source , Target >
42
42
| StrictSchema < Target [ destinationProperty ] , Source >
43
43
} & { [ SCHEMA_OPTIONS_SYMBOL ] ?: SchemaOptions < Target > } ;
44
44
export type Schema < Target = any , Source = any > = {
@@ -47,7 +47,7 @@ export type Schema<Target = any, Source = any> = {
47
47
| ActionString < Source >
48
48
| ActionFunction < Target , Source , Target [ destinationProperty ] >
49
49
| ActionAggregator < Source >
50
- | ActionSelector < Source , Target [ destinationProperty ] >
50
+ | ActionSelector < Source , Target >
51
51
| Schema < Target [ destinationProperty ] , Source >
52
52
} & { [ SCHEMA_OPTIONS_SYMBOL ] ?: SchemaOptions < Target | any > } ;
53
53
@@ -110,7 +110,7 @@ export interface ActionFunction<D = any, S = any, R = any> {
110
110
* ```
111
111
*
112
112
*/
113
- export type ActionString < Source > = string ; // TODO: ActionString should support string and string[] for deep properties
113
+ export type ActionString < Source > = string | keyof Source ; // TODO: ActionString should support string and string[] for deep properties
114
114
115
115
/**
116
116
* An Array of String that allows to perform a function over source property
@@ -158,10 +158,9 @@ export type ActionAggregator<T extends unknown = unknown> = T extends object ? (
158
158
*```
159
159
*
160
160
*/
161
- export interface ActionSelector < Source = object , R = any > {
161
+ export interface ActionSelector < Source = object , Target = any > {
162
162
path ?: ActionString < Source > | ActionAggregator < Source > ;
163
- // | ((source: Source) => unknown);
164
- fn ?: ( fieldValue : any , object : Source , items : Source , objectToCompute : R ) => R ;
163
+ fn ?: ( fieldValue : any , object : Source , items : Source , objectToCompute : Target ) => Target ;
165
164
validation ?: BaseValidator < ReturnType < undefined extends ActionSelector [ 'fn' ] ? any : ActionSelector [ 'fn' ] > > ;
166
165
}
167
166
0 commit comments