progress to typing Blocks and Arrays

This commit is contained in:
James
2020-11-30 20:12:15 -05:00
parent 6bf60ff5d6
commit bb7c829c5e
19 changed files with 155 additions and 307 deletions

View File

@@ -25,11 +25,13 @@ type Admin = {
hidden?: boolean
}
type Labels = {
export type Labels = {
singular: string;
plural: string;
};
export type Validate = (value: unknown, options: unknown) => string | boolean;
interface FieldBase {
name?: string;
label?: string;
@@ -41,7 +43,7 @@ interface FieldBase {
hidden?: boolean;
saveToJWT?: boolean
localized?: boolean;
validate?: (value: any, field: Field) => any;
validate?: Validate;
hooks?: {
beforeValidate?: FieldHook[];
beforeChange?: FieldHook[];