import { SchemaDefinition } from ".." ; /**
 * A JavaScript object containing the underlying data of an  Entity .
  export type EntityData = Record < string , number | boolean | string | string [ ] > ; /**
 * A constructor that creates an  Entity of type TEntity.
 *  template TEntity The  Entity type.
  export type EntityConstructor < TEntity > = new ( schemaDef , id , data ? ) => TEntity ; /**
 * An Entity is the class from which objects that Redis OM maps to are made. You need
 * to subclass Entity in your application:
 *
 * ```typescript
 * class Foo extends Entity {}
 * ```
 */ export default abstract class Entity { /** The generated entity ID. */ readonly entityId : string ; internal readonly entityData : EntityData ; private schemaDef : SchemaDefinition ; internal constructor ( schemaDef , id , data = { } ) { this . schemaDef = schemaDef ; this . entityId = id ; this . entityData = data ; } toJSON ( ) { let json = { entityId : this . entityId } ; for ( let key in this . schemaDef ) { json [ key ] = ( this as Record < string , any > ) [ key ] ; } return json ; } }