-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtypes.ts
More file actions
107 lines (96 loc) · 2.49 KB
/
types.ts
File metadata and controls
107 lines (96 loc) · 2.49 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
96
97
98
99
100
101
102
103
104
105
106
107
import { TFile } from "obsidian";
import { TldrawColorName } from "./utils/tldrawColors";
export type DiscourseNode = {
id: string;
name: string;
format: string;
template?: string;
description?: string;
shortcut?: string;
color?: string;
tag?: string;
keyImage?: boolean;
folderPath?: string;
created: number;
modified: number;
importedFromRid?: string;
};
export type ImportStatus = "provisional" | "accepted";
export type DiscourseRelationType = {
id: string;
label: string;
complement: string;
color: TldrawColorName;
created: number;
modified: number;
importedFromRid?: string;
status?: ImportStatus;
};
export type DiscourseRelation = {
id: string;
sourceId: string;
destinationId: string;
relationshipTypeId: string;
created: number;
modified: number;
importedFromRid?: string;
status?: ImportStatus;
};
export type RelationInstance = {
id: string;
type: string;
source: string;
destination: string;
created: number;
author: string;
lastModified?: number;
publishedToGroupId?: string[];
importedFromRid?: string;
/** Tracks acceptance of imported relations. false = imported, not yet accepted. true or undefined = accepted/local. */
tentative?: boolean;
};
export type Settings = {
nodeTypes: DiscourseNode[];
discourseRelations: DiscourseRelation[];
relationTypes: DiscourseRelationType[];
showIdsInFrontmatter: boolean;
nodesFolderPath: string;
canvasFolderPath: string;
canvasAttachmentsFolderPath: string;
nodeTagHotkey: string;
spacePassword?: string;
accountLocalId?: string;
syncModeEnabled?: boolean;
/** Maps spaceUri (e.g. "obsidian:abc123") to human-readable name (e.g. "My Vault") */
spaceNames?: Record<string, string>;
};
export type BulkImportCandidate = {
file: TFile;
matchedNodeType: DiscourseNode;
alternativePattern: string;
extractedContent: string;
selected: boolean;
};
export type BulkImportPattern = {
nodeTypeId: string;
alternativePattern: string;
enabled: boolean;
};
export type ImportableNode = {
nodeInstanceId: string;
title: string;
spaceId: number;
spaceName: string;
groupId: string;
selected: boolean;
/** From source Content (latest last_modified across variants). Set when loaded from getPublishedNodesForGroups. */
createdAt?: number;
modifiedAt?: number;
filePath?: string;
};
export type GroupWithNodes = {
groupId: string;
groupName?: string;
nodes: ImportableNode[];
};
export const VIEW_TYPE_DISCOURSE_CONTEXT = "discourse-context-view";