-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoamTypes.d.ts
54 lines (45 loc) · 1.05 KB
/
RoamTypes.d.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
45
46
47
48
49
50
51
52
53
54
declare global {
interface Window {
roamAlphaAPI?: {
q: (query: string, ...args: (string | number)[]) => [number][]
pull: (keys: string, dbid: number) => RoamNode | null
}
}
}
export interface RoamDBRef {
":db/id": number
}
export interface RoamBlock extends RoamDBRef {
":block/uid": string
":block/order": number
":block/string": string
":block/refs"?: RoamDBRef[]
":block/open": boolean
":block/children"?: RoamDBRef[]
":create/email": string
":create/time": number
":edit/email": string
":edit/time": number
}
type RoamAttrItem = [":block/uid", string]
type RoamAttr = {
":source": RoamAttrItem
":value": RoamAttrItem | string
}
export interface RoamNode extends RoamBlock {
":node/title": string
":attrs/lookup"?: RoamDBRef[]
":entity/attrs"?: [
RoamAttr,
RoamAttr,
RoamAttr,
][]
":page/permissions"?: { ":public": null | any }
}
export type RoamId =
| number
| string
| {
":block/uid"?: string
":db/id"?: number
}