import { Image } from './image' import { WithMongooseProps } from './with-mongoose-props' import { WithTenantProps } from './with-tenant-props' import { ElementTypes, ReferenceEntityTypes, RenderTypes } from '../constants' import { Category } from './category' export type Element = TData & WithMongooseProps< WithTenantProps<{ elementData: object renderType: RenderTypes referenceEntityType: ReferenceEntityTypes reference: any // TODO: improve with correct types elementType: ElementTypes orderPosition: number referenceId?: string sectionId: string name: string link: string }> > export type BasicElement = Element export type AnnouncementsElement = Element<{ category?: Category publishedDate?: string }> export type LastNewsElement = Element<{ category: Category image: Image description?: string }> export type NewsElement = Element<{ category: Category image?: Image description: string publishedAt?: string dateRange?: string }> export type PlacesElement = Element<{ category?: Category address?: string mapLink?: string distance?: boolean }> export type ServicesElement = Element<{ description?: string category?: Category // service entity type badge?: string // active service }> export type ElementDictionary = | BasicElement | AnnouncementsElement | LastNewsElement | NewsElement | PlacesElement | ServicesElement