forked from boardroom-inc/protocol-Info
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
42 lines (36 loc) · 1.17 KB
/
types.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
37
38
39
40
41
42
import * as t from "io-ts";
export const ProtocolIo = t.type({
cname: t.string,
description: t.string,
path: t.string,
previousPaths: t.union([t.array(t.string), t.undefined]),
folder: t.string,
isEnabled: t.boolean,
discourseForum: t.union([
t.partial({
url: t.string,
categoryId: t.string,
}),
t.undefined,
]),
safeAddress: t.union([t.string, t.undefined]),
treasuryAddresses: t.union([t.array(t.string), t.undefined]),
disableTreasuryNav: t.union([t.boolean, t.undefined]),
});
export const ProtocolEvents = t.type({
title: t.union([t.string, t.undefined]),
date: t.union([t.string, t.number, t.undefined]),
url: t.union([t.string, t.undefined]),
type: t.union([t.string, t.undefined]),
protocolCname: t.string,
});
export const ProtocolForScreeenerIo = t.type({
name: t.string,
cname: t.string,
treasuryAddresses: t.array(t.string),
});
export type ProtocolForScreeener = t.TypeOf<typeof ProtocolForScreeenerIo>;
export type Protocol = t.TypeOf<typeof ProtocolIo>;
export type CalendarEvent = t.TypeOf<typeof ProtocolEvents>;
export type CalendarEvents = Record<string, CalendarEvent[]>;
export const dateKeyFormat = "YYYY-MM-DD";