@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.
- package/.out/core/mobx/form_model.d.ts +3 -1
- package/.out/core/mobx/form_model.js +11 -11
- package/.out/core/mobx/hooks.d.ts +2 -3
- package/.out/core/mobx/hooks.js +5 -3
- package/.out/core/mobx/specs/form_model.tests.js +9 -9
- package/.out/index.d.ts +0 -1
- package/.out/index.js +0 -1
- package/.out/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-check-types.log +1 -1
- package/core/mobx/form_model.ts +12 -13
- package/core/mobx/hooks.tsx +12 -14
- package/core/mobx/specs/form_model.tests.ts +9 -9
- package/dist/index.cjs +14 -13
- package/dist/index.d.cts +6 -22
- package/dist/index.d.ts +6 -22
- package/dist/index.js +14 -13
- package/index.ts +0 -1
- package/package.json +1 -1
- package/.out/core/mobx/types.d.ts +0 -19
- package/.out/core/mobx/types.js +0 -1
- package/core/mobx/types.ts +0 -57
package/core/mobx/types.ts
DELETED
|
@@ -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
|