@strictly/react-form 0.0.22 → 0.0.24

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,57 +0,0 @@
1
- // TODO rename/split-out this file
2
- import { type ToOfFieldAdapter } from './field_adapter'
3
- import {
4
- type FlattenedConvertedFieldsOf,
5
- type FormModel,
6
- } from './form_model'
7
-
8
- /**
9
- * Used to extract the supported value paths from a model
10
- */
11
- export type ValuePathsOfModel<
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- Model extends FormModel<any, any, any, any, any>,
14
- > = Model extends FormModel<
15
- infer _1,
16
- infer _2,
17
- infer _3,
18
- infer _4,
19
- infer ValuePathsToAdapters
20
- > ? keyof ValuePathsToAdapters
21
- : never
22
-
23
- /**
24
- * Used to extract the render type (so the value that is passed to the view) of a given value path
25
- * from a model
26
- */
27
- export type ToValueOfModelValuePath<
28
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
- Model extends FormModel<any, any, any, any, any>,
30
- K extends ValuePathsOfModel<Model>,
31
- > = Model extends FormModel<
32
- infer _1,
33
- infer _2,
34
- infer _3,
35
- infer _4,
36
- infer ValuePathsToAdapters
37
- > ? ToOfFieldAdapter<ValuePathsToAdapters[K]>
38
- : never
39
-
40
- /**
41
- * Extracts the form fields from a form model. The recommended way is to
42
- * define the form fields explicitly and use that type to enforce the types
43
- * of your converters, but generating the FormFields from your model
44
- * is less typing, albeit at the cost of potentially getting type errors
45
- * reported a long way away from the source
46
- */
47
- export type FormFieldsOfModel<
48
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
- Model extends FormModel<any, any, any, any, any>,
50
- > = Model extends FormModel<
51
- infer _1,
52
- infer _2,
53
- infer _3,
54
- infer _4,
55
- infer ValuePathsToAdapters
56
- > ? FlattenedConvertedFieldsOf<ValuePathsToAdapters>
57
- : never