import { CrudSearchReponse } from '../../api/crud-api'; import { SearchCrudItemPayload } from '../../types/api'; export default interface CrudStoreModel { path: string; latestSearchResult?: CrudSearchReponse; loading: boolean; hasItemsError: boolean; itemsCache: CrudStoreItemsModel[]; overview: CrudStoreOverviewModel; schema?: CrudStoreSchemaModel; searchState: SearchCrudItemPayload; } export interface CrudStoreOverviewModel { fields?: string[]; additionalFields?: CrudStoreAdditionalFieldsModel; customFields?: CrudStoreCustomFieldsModel; } export interface CrudStoreAdditionalFieldsModel { [k: string]: string; } export interface CrudStoreCustomFieldsModel { [k: string]: string | boolean | number; } export interface CrudStoreItemsModel { [k: string]: any; } export interface CrudStoreSchemaModel { order: number; type: string; title: string; properties: CrudStoreSchemaPropertiesModel; isSingleton?: boolean; isTranslatable?: boolean; isPublishable?: boolean; preventCreate?: boolean; preventCopy?: boolean; preventDelete?: boolean; } export interface CrudStoreSchemaPropertiesModel { $type: TypeSchemaModel; [k: string]: BaseSchemaModel | TypeSchemaModel; } export interface CrudStoreItemsSchemaModel { $ref?: string; oneOf?: CrudStoreSchemaPropertiesModel[]; properties?: CrudStoreSchemaPropertiesModel; } export interface TypeSchemaModel { enum: string[]; isHidden: boolean; order?: number; isCopyable?: boolean; } export interface BaseSchemaModel extends CrudStoreItemsSchemaModel { title: string; type: string; format?: string; required: boolean; isHidden?: boolean; isCopyable?: boolean; isDisplayTitle?: boolean; isTranslatable?: boolean; order?: number; items?: CrudStoreItemsSchemaModel; minLength?: number; default?: boolean | string | number; } export interface GetSingletonItemPayload { defaultLanguage: string; id?: string; } export interface GetItemByIdPayload { id: string; ignoreCache?: boolean; }