import { Entity , Fields } from './entity' ; export class Serializable < TFields extends Fields > extends Entity < TFields > { constructor ( fields ) { super ( { ... fields , } ) ; } timestamp ( time ) { this . fields [ '@timestamp' ] = time ; return this ; } serialize ( ) { return [ this . fields ] ; } }