Skip to content

Commit b3409c9

Browse files
committed
fix: Fixed typing for form return values
1 parent 05f8b2a commit b3409c9

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@codifycli/ink-form",
33
"type": "module",
4-
"version": "0.0.2",
4+
"version": "0.0.3",
55
"description": "Complex user-friendly form component for Codify",
66
"main": "lib/index.js",
77
"exports": "./lib/index.js",

src/types.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface FormProps {
3232
*
3333
* @param value the final value of the form.
3434
* */
35-
onSubmit?: (value: Array<Record<string, any>>) => void;
35+
onSubmit?: (output: FormReturnValue) => void;
3636

3737
/**
3838
* You can use custom field implementations, by specifying their ``type`` attribute to a custom
@@ -204,3 +204,8 @@ export type SpecificFormFieldRendererProps<T extends FormField> = FormFieldRende
204204
onSave: (newValue?: ValueOfField<T>) => void;
205205
onCancel: () => void;
206206
};
207+
208+
export type FormReturnValue = Array<{
209+
section: FormSection;
210+
value: Record<string, unknown>;
211+
}>

0 commit comments

Comments
 (0)