-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.ts
44 lines (36 loc) · 992 Bytes
/
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
43
44
type Opaque<K, T> = T & { __TYPE__: K }
export namespace Id {
export type Legislation = Opaque<'Legislation', string>
export type Resolution = Opaque<'Resolution', string>
export type Bill = Opaque<'Bill', string>
export type Amendment = Opaque<'Amendment', string>
export type Vote = Opaque<'Vote', string>
}
export type Chamber = 'House' | 'Senate'
export type ResolutionType = 'Concurrent Resolution' | 'Joint Resolution' | 'Simple Resolution'
interface Common {
id: string;
chamber: Chamber;
type: string;
number: number;
congress?: number;
}
export interface Legislation extends Common {
type: ResolutionType | 'Bill';
binding: boolean;
}
export interface Resolution extends Legislation {
type: ResolutionType;
binding: false;
}
export interface Bill extends Legislation {
type: 'Bill';
binding: true;
}
export interface Amendment extends Common {
type: 'Amendment';
}
export interface Vote extends Common {
type: 'Vote';
session: number;
}