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 {
|
interface BaseFieldSchema extends UIFieldMetadata {
|
||||||
type: FieldType
|
type: FieldType
|
||||||
name: string
|
name: string
|
||||||
|
@ -182,6 +197,8 @@ interface OtherFieldMetadata extends BaseFieldSchema {
|
||||||
| FieldType.BB_REFERENCE_SINGLE
|
| FieldType.BB_REFERENCE_SINGLE
|
||||||
| FieldType.ATTACHMENTS
|
| FieldType.ATTACHMENTS
|
||||||
| FieldType.STRING
|
| FieldType.STRING
|
||||||
|
| FieldType.ARRAY
|
||||||
|
| FieldType.OPTIONS
|
||||||
>
|
>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,6 +215,8 @@ export type FieldSchema =
|
||||||
| JsonFieldMetadata
|
| JsonFieldMetadata
|
||||||
| AttachmentFieldMetadata
|
| AttachmentFieldMetadata
|
||||||
| BBReferenceSingleFieldMetadata
|
| BBReferenceSingleFieldMetadata
|
||||||
|
| ArrayFieldMetadata
|
||||||
|
| OptionsFieldMetadata
|
||||||
|
|
||||||
export interface TableSchema {
|
export interface TableSchema {
|
||||||
[key: string]: FieldSchema
|
[key: string]: FieldSchema
|
||||||
|
|
Loading…
Reference in New Issue