-
Notifications
You must be signed in to change notification settings - Fork 0
/
Issues.ts
31 lines (26 loc) · 838 Bytes
/
Issues.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
import { Instance, types } from "mobx-state-tree"
/**
* REST API endpoints for issues
* https://docs.github.com/en/rest/issues/issues
*/
export const LabelModel = types.model("ItemModel").props({
id: types.identifierNumber,
node_id: types.string,
name: types.string,
})
export const ItemModel = types.model("ItemModel").props({
node_id: types.identifier,
id: types.number,
title: types.string,
html_url: types.string,
body: types.string,
created_at: types.string,
labels: types.optional(types.array(LabelModel), []),
})
export const IssuesModel = types.model("IssuesModel").props({
total_count: types.number,
incomplete_results: types.boolean,
items: types.array(ItemModel),
})
export interface IItem extends Instance<typeof ItemModel> {}
export interface IIssues extends Instance<typeof IssuesModel> {}