UNPKG

@anoki/fse-common

Version:

Common types for FSE

26 lines (21 loc) 712 B
import { WithMongooseProps } from './with-mongoose-props' import { GetValues, PageTypes } from '../constants' export type ParentEntityTypes = 'Page' | 'Section' export type SavedEntityTypes = 'Page' | 'Section' | 'Element' export type StatusTypes = 'Pending' | 'Published' export type SavedChanges<TData> = WithMongooseProps<{ parentId: string parentEntityType: ParentEntityTypes entityId: string pageType: PageTypes entityType: SavedEntityTypes changedFields: TData status: StatusTypes entityBackup: TData }> export const SavedChangesStatusEnum = { PENDING: 'Pending', PUBLISHED: 'Published', ERROR: 'Error', } export type SavedChangesStatus = GetValues<typeof SavedChangesStatusEnum>