-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
JSerPost.ts
36 lines (35 loc) · 926 Bytes
/
JSerPost.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// LICENSE : MIT
"use strict";
export class JSerPost {
// start with 1
postNumber: number;
/** @type {string} */
title: string;
/** @type {string} */
url: string;
/** @type {string} */
content: string;
/** @type {string} */
category: string;
/** @type {Date} */
date: Date;
/** @type {string[]} */
tags: string[];
constructor(number: number, post: any) {
/** @type {number} */
// start with 1
this.postNumber = number;
/** @type {string} */
this.title = post["title"];
/** @type {string} */
this.url = post["url"];
/** @type {string} */
this.content = post["content"];
/** @type {string} */
this.category = post["category"];
/** @type {Date} */
this.date = new Date(post["date"]);
/** @type {string[]} */
this.tags = post["tags"] || [];
}
}