enumOptions and enum reader

This commit is contained in:
2026-06-04 03:37:44 +05:30
parent 2dbe9a5270
commit 7c33bd9c7c
8 changed files with 109 additions and 29 deletions

View File

@@ -10,6 +10,16 @@ export type FieldType =
| 'object'
| 'array';
export interface SelectOption {
key: string;
value: string;
}
export interface EnumOption {
key: string;
value: string | string[];
}
export interface ResourceField {
type: FieldType;
label: string;
@@ -19,8 +29,10 @@ export interface ResourceField {
schema?: Record<string, ResourceField>;
displayField?: string | string[];
formatter?: (value: any) => string;
relation?: string; // Name of the target resource
relation?: string;
filterType?: "autocomplete" | "multiselect" | "number-range" | "date-range";
enumOption?: EnumOption;
enumLabels?: Record<string, string>;
}
export type ResourceMode = "server" | "client";
@@ -38,6 +50,7 @@ export interface ResourceConfig {
mode?: ResourceMode;
fields?: string[];
};
enumOption?: EnumOption;
}
export interface AppConfig {