import { NohmModel } from './model' ; import { IChangeEventPayload , IDefaultEventPayload , IPropertyDiff , IRelationChangeEventPayload , IDictionary , } from './model.header' ; export function defaultComposer < TProps > ( this ) { return { target : { id : this . id , modelName : this . modelName , properties : this . allProperties ( ) , } , } ; } export { defaultComposer as create } ; function changeComposer < TProps > ( this , diff ) { const result = defaultComposer . apply ( this ) ; result . target . diff = diff ; return result ; } export { changeComposer as update , changeComposer as save } ; export function remove ( this , id ) { const result = defaultComposer . apply ( this ) ; result . target . id = id ; return result ; } function relationComposer < TProps , TParentProps > ( this , parent , relationName ) { const childPayload = defaultComposer . call ( this ) ; const parentPayload = defaultComposer . call ( parent ) ; return { child : childPayload . target , parent : parentPayload . target , relation : relationName , } ; } export { relationComposer as link , relationComposer as unlink } ;