forked from cerebral/overmind
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnamespaces.ts
More file actions
95 lines (86 loc) · 1.33 KB
/
namespaces.ts
File metadata and controls
95 lines (86 loc) · 1.33 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
export default (ts) =>
ts
? [
{
fileName: 'overmind/admin/state.ts',
code: `
export type User = {
username: string
bio: string
}
export type Users = {
[username: string]: User
}
export type State = {
isLoadingUsers: boolean
users: Users
}
export const state: State = {
isLoadingUsers: false,
users: {}
}
`,
},
{
fileName: 'overmind/issues/state.ts',
code: `
export type Issue = {
id: string
username: string
title: string
description: string
}
export type Issues = {
[id: string]: Issue
}
export enum SortKey = {
Date = 'date',
Title = 'title'
}
export enum SortDirection = {
Asc = 'asc',
Desc = 'desc'
}
export type Sorting {
key: SortKey
type: SortDirection
}
export type State = {
isLoading: boolean
issues: Issues
}
export const state: State = {
isLoading: false,
issues: {},
sorting: {
key: SortKey.Date,
direction: SortDirection.Asc
}
}
`,
},
]
: [
{
fileName: 'overmind/admin/state.js',
code: `
export default {
isLoadingUsers: false,
users: {}
}
`,
},
{
fileName: 'overmind/issues/state.js',
code: `
export default {
isLoading: false,
issues: {},
sorting: {
key: 'date',
type: 'asc'
}
}
`,
},
]