@meith/drafts 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.ts +13 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -7,8 +7,21 @@ export interface Draft {
|
|
|
7
7
|
readonly updatedAt?: Date
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
export interface DraftSummary {
|
|
11
|
+
readonly forumId: number
|
|
12
|
+
readonly forumTitle: string
|
|
13
|
+
readonly forumSlug: string
|
|
14
|
+
readonly threadId: number | null
|
|
15
|
+
readonly threadTitle: string | null
|
|
16
|
+
readonly threadSlug: string | null
|
|
17
|
+
readonly title: string
|
|
18
|
+
readonly message: string
|
|
19
|
+
readonly updatedAt: Date
|
|
20
|
+
}
|
|
21
|
+
|
|
10
22
|
export interface DraftRepository {
|
|
11
23
|
find(userId: number, forumId: number, threadId: number | null): Promise<Draft | null>
|
|
12
24
|
save(userId: number, draft: Draft): Promise<void>
|
|
13
25
|
remove(userId: number, forumId: number, threadId: number | null): Promise<void>
|
|
26
|
+
listByUser(userId: number): Promise<readonly DraftSummary[]>
|
|
14
27
|
}
|