Skip to content

Commit 8788317

Browse files
committed
Add resolveProps type
1 parent 5631b2c commit 8788317

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/react-form-renderer/src/files/field.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@ import { Validator } from "./validators";
22
import { ConditionDefinition } from './condition';
33
import { DataType } from "./data-types";
44
import { AnyObject } from "./common";
5+
import { FieldMetaState, FieldInputProps } from "react-final-form";
6+
import { FormOptions } from "./renderer-context";
57

68
export type FieldAction = [string, ...any[]];
79

810
export interface FieldActions {
911
[key: string]: FieldAction;
1012
}
1113

14+
export interface FieldApi<FieldValue, T extends HTMLElement = HTMLElement> {
15+
meta: FieldMetaState<FieldValue>;
16+
input: FieldInputProps<FieldValue, T>;
17+
}
18+
19+
export type ResolvePropsFunction = (props: AnyObject, fieldApi: FieldApi<any>, formOptions: FormOptions) => AnyObject;
20+
1221
interface Field extends AnyObject {
1322
name: string;
1423
component: string;
@@ -20,6 +29,7 @@ interface Field extends AnyObject {
2029
clearedValue?: any;
2130
clearOnUnmount?: boolean;
2231
actions?: FieldActions;
32+
resolveProps?: ResolvePropsFunction;
2333
}
2434

2535
export default Field;

0 commit comments

Comments
 (0)