import {Model} from '../Model' import {Event} from '../../../event/Event' import {JSONState} from '../../../util' /** * Base class for events that concern an instance of a model. */ export abstract class ModelEvent> extends Event { /** * The instance of the model. */ public instance!: T constructor( instance?: T, ) { super() if ( instance ) { this.instance = instance } } // TODO implement serialization here dehydrate(): Promise { return Promise.resolve({}) } rehydrate(/* state: JSONState */): void | Promise { return undefined } }