import { Entity , EntityStatus , EntityValues , ResolvedEntitySchema } from "./entities" ; import { FireCMSContext } from "./firecms_context" ; category export interface EntityCallbacks < M extends { [ Key ] : any ; } = any > { param entitySaveProps onSaveSuccess ? ( entitySaveProps ) : Promise < void > | void ; param entitySaveProps onSaveFailure ? ( entitySaveProps ) : Promise < void > | void ; param entitySaveProps onPreSave ? ( entitySaveProps ) : Promise < Partial < EntityValues < M > > > | Partial < EntityValues < M > > ; param entityDeleteProps onPreDelete ? ( entityDeleteProps ) : void ; param entityDeleteProps onDelete ? ( entityDeleteProps ) : void ; } category export interface EntityOnSaveProps < M extends { [ Key ] : any ; } > { /**
     * Resolved schema of the entity
     */ schema : ResolvedEntitySchema < M > ; /**
     * Full path where this entity is being saved
     */ path : string ; /**
     * Id of the entity or undefined if new
     */ entityId ? : string ; /**
     * Values being saved
     */ values : Partial < EntityValues < M > > ; /**
     * Values being saved
     */ previousValues ? : Partial < EntityValues < M > > ; /**
     * New or existing entity
     */ status : EntityStatus ; /**
     * Context of the app status
     */ context : FireCMSContext ; } category export interface EntityOnDeleteProps < M extends { [ Key ] : any ; } > { /**
     * Schema of the entity being deleted
     */ schema : ResolvedEntitySchema < M > ; /**
     * Path of the parent collection
     */ path : string ; /**
     * Deleted entity id
     */ entityId : string ; /**
     * Deleted entity
     */ entity : Entity < M > ; /**
     * Context of the app status
     */ context : FireCMSContext ; }