Improve types
This commit is contained in:
parent
9cf50d1f72
commit
10351c52f8
|
@ -157,6 +157,21 @@ export interface FieldConstraints {
|
|||
}
|
||||
}
|
||||
|
||||
export interface OptionsFieldMetadata extends BaseFieldSchema {
|
||||
type: FieldType.OPTIONS
|
||||
constraints: FieldConstraints & {
|
||||
inclusion: string[]
|
||||
}
|
||||
}
|
||||
|
||||
export interface ArrayFieldMetadata extends BaseFieldSchema {
|
||||
type: FieldType.ARRAY
|
||||
constraints: FieldConstraints & {
|
||||
type: JsonFieldSubType.ARRAY
|
||||
inclusion: string[]
|
||||
}
|
||||
}
|
||||
|
||||
interface BaseFieldSchema extends UIFieldMetadata {
|
||||
type: FieldType
|
||||
name: string
|
||||
|
@ -182,6 +197,8 @@ interface OtherFieldMetadata extends BaseFieldSchema {
|
|||
| FieldType.BB_REFERENCE_SINGLE
|
||||
| FieldType.ATTACHMENTS
|
||||
| FieldType.STRING
|
||||
| FieldType.ARRAY
|
||||
| FieldType.OPTIONS
|
||||
>
|
||||
}
|
||||
|
||||
|
@ -198,6 +215,8 @@ export type FieldSchema =
|
|||
| JsonFieldMetadata
|
||||
| AttachmentFieldMetadata
|
||||
| BBReferenceSingleFieldMetadata
|
||||
| ArrayFieldMetadata
|
||||
| OptionsFieldMetadata
|
||||
|
||||
export interface TableSchema {
|
||||
[key: string]: FieldSchema
|
||||
|
|
Loading…
Reference in New Issue