-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Copy pathArray.ts
64 lines (51 loc) · 2.27 KB
/
Array.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import type { MarkOptional } from 'ts-essentials'
import type { ArrayField, ArrayFieldClient } from '../../fields/config/types.js'
import type { ArrayFieldValidation } from '../../fields/validations.js'
import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
import type {
ClientFieldBase,
FieldClientComponent,
FieldPaths,
FieldServerComponent,
ServerFieldBase,
} from '../forms/Field.js'
import type {
FieldDescriptionClientComponent,
FieldDescriptionServerComponent,
FieldDiffClientComponent,
FieldDiffServerComponent,
FieldLabelClientComponent,
FieldLabelServerComponent,
} from '../types.js'
type ArrayFieldClientWithoutType = MarkOptional<ArrayFieldClient, 'type'>
type ArrayFieldBaseClientProps = {
readonly validate?: ArrayFieldValidation
} & FieldPaths
type ArrayFieldBaseServerProps = Pick<FieldPaths, 'path'>
export type ArrayFieldClientProps = ArrayFieldBaseClientProps &
ClientFieldBase<ArrayFieldClientWithoutType>
export type ArrayFieldServerProps = ArrayFieldBaseServerProps &
ServerFieldBase<ArrayField, ArrayFieldClientWithoutType>
export type ArrayFieldServerComponent = FieldServerComponent<
ArrayField,
ArrayFieldClientWithoutType,
ArrayFieldBaseServerProps
>
export type ArrayFieldClientComponent<T extends Record<string, unknown> = {}> =
FieldClientComponent<ArrayFieldClientWithoutType, ArrayFieldBaseClientProps>
export type ArrayFieldLabelServerComponent<T extends Record<string, unknown> = {}> =
FieldLabelServerComponent<ArrayField, ArrayFieldClientWithoutType>
export type ArrayFieldLabelClientComponent = FieldLabelClientComponent<ArrayFieldClientWithoutType>
export type ArrayFieldDescriptionServerComponent = FieldDescriptionServerComponent<
ArrayField,
ArrayFieldClientWithoutType
>
export type ArrayFieldDescriptionClientComponent =
FieldDescriptionClientComponent<ArrayFieldClientWithoutType>
export type ArrayFieldErrorServerComponent = FieldErrorServerComponent<
ArrayField,
ArrayFieldClientWithoutType
>
export type ArrayFieldErrorClientComponent = FieldErrorClientComponent<ArrayFieldClientWithoutType>
export type ArrayFieldDiffServerComponent = FieldDiffServerComponent<ArrayField, ArrayFieldClient>
export type ArrayFieldDiffClientComponent = FieldDiffClientComponent<ArrayFieldClient>