UNPKG

@anoki/fse-common

Version:

Common types for FSE

49 lines (43 loc) 1.18 kB
import { WithMongooseProps } from './with-mongoose-props' import { Category } from './category' import { WithTranslations } from './with-translations' import { PageTypes, ReferenceEntityTypes } from '../constants' import { Section } from './section' import { EntityType } from './entity-type' import { Upload } from './upload-file' export type HomePage = { pageType: 'Home' } export type ServicesPage = { pageType: 'Services' targetPageIds: string[] aggregationPageIds: string[] updatedById: string entityTypeId: string entityType?: EntityType previewImageId: string previewImage?: Upload externalLink: string isSuggested: boolean visibleOnSidebar: boolean } export type StaticContentsPage = { pageType: 'StaticContent' } export type BasePage = WithMongooseProps<{ name: string description: string parentId: string pageType: PageTypes referenceEntityType: ReferenceEntityTypes pageUrl: string categoryId: string category?: Category sections: Section[] shortName?: string translations: WithTranslations<{ name: string description: string }> }> export type Page = BasePage & (HomePage | ServicesPage | StaticContentsPage)