/ src / models / Article.ts
Article.ts
 1  import { deserializeWith, rename, t } from "desero";
 2  
 3  /**
 4   * An article for a feed.
 5   * @hideconstructor
 6   */
 7  export class Article {
 8    category = t.string();
 9    content = t.string();
10    id = t.string();
11    @rename("image")
12    imageUrl = t.string();
13  
14    @deserializeWith((date) => new Date(date))
15    @rename("date")
16    publishedAt = t.instance<Date>();
17  
18    title = t.string();
19  }