@sealcode/sealgen 0.15.14 → 0.15.15
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,8 +1,8 @@
|
|
|
1
1
|
import { FilePointer } from "@sealcode/file-manager";
|
|
2
2
|
import type { FlatTemplatable } from "tempstream";
|
|
3
3
|
import type { FormField } from "./fields/field.js";
|
|
4
|
-
export type FormDataPrimitive = string | string[] | number | undefined;
|
|
5
|
-
export type FormDataValue = FormDataPrimitive | Record<string, FormDataPrimitive
|
|
4
|
+
export type FormDataPrimitive = string | string[] | number | undefined | FilePointer;
|
|
5
|
+
export type FormDataValue = FormDataPrimitive | Record<string, FormDataPrimitive>;
|
|
6
6
|
export type FieldValueType<F extends FormField> = F extends FormField<infer R> ? R : never;
|
|
7
7
|
export type FormFieldsToValues<F extends Record<string, FormField<boolean, keyof F>>> = {
|
|
8
8
|
[Property in keyof F]: FieldValueType<F[Property]>;
|
package/package.json
CHANGED
package/src/forms/form-types.ts
CHANGED
|
@@ -2,11 +2,16 @@ import { FilePointer } from "@sealcode/file-manager";
|
|
|
2
2
|
import type { FlatTemplatable } from "tempstream";
|
|
3
3
|
import type { FormField } from "./fields/field.js";
|
|
4
4
|
|
|
5
|
-
export type FormDataPrimitive =
|
|
5
|
+
export type FormDataPrimitive =
|
|
6
|
+
| string
|
|
7
|
+
| string[]
|
|
8
|
+
| number
|
|
9
|
+
| undefined
|
|
10
|
+
| FilePointer;
|
|
11
|
+
|
|
6
12
|
export type FormDataValue =
|
|
7
13
|
| FormDataPrimitive
|
|
8
|
-
| Record<string, FormDataPrimitive
|
|
9
|
-
| FilePointer;
|
|
14
|
+
| Record<string, FormDataPrimitive>;
|
|
10
15
|
|
|
11
16
|
export type FieldValueType<F extends FormField> = F extends FormField<infer R>
|
|
12
17
|
? R
|