(READ ONLY) Margin is an open annotation layer for the internet. Powered by the AT Protocol.
margin.at
extension
web
atproto
comments
1export interface UserProfile {
2 did: string;
3 handle: string;
4 displayName?: string;
5 description?: string;
6 avatar?: string;
7 banner?: string;
8 website?: string;
9 links?: string[];
10 followersCount?: number;
11 followsCount?: number;
12 postsCount?: number;
13 labels?: ContentLabel[];
14}
15
16export interface Selector {
17 type?: string;
18 exact: string;
19 prefix?: string;
20 suffix?: string;
21 start?: number;
22 end?: number;
23}
24
25export interface Target {
26 source: string;
27 title?: string;
28 selector?: Selector;
29}
30
31export interface AnnotationBody {
32 type: "TextualBody";
33 value: string;
34 format: "text/plain";
35}
36
37export interface Param {
38 id: string;
39 value: string;
40}
41
42export interface AnnotationItem {
43 uri: string;
44 id?: string;
45 cid: string;
46 author: UserProfile;
47 creator?: UserProfile;
48 target?: Target;
49 source?: string;
50 body?: AnnotationBody;
51 motivation: "highlighting" | "commenting" | "bookmarking" | string;
52 type?: string;
53 createdAt: string;
54 text?: string;
55 title?: string;
56 description?: string;
57 color?: string;
58 tags?: string[];
59 editedAt?: string;
60 likeCount?: number;
61 replyCount?: number;
62 repostCount?: number;
63 children?: AnnotationItem[];
64 inReplyTo?: string;
65 viewer?: {
66 like?: string;
67 };
68 collection?: {
69 uri: string;
70 name: string;
71 icon?: string;
72 };
73 context?: {
74 uri: string;
75 name: string;
76 icon?: string;
77 }[];
78 addedBy?: UserProfile;
79 collectionItemUri?: string;
80 reply?: {
81 parent?: {
82 uri: string;
83 cid: string;
84 };
85 root?: {
86 uri: string;
87 cid: string;
88 };
89 };
90 parentUri?: string;
91 labels?: ContentLabel[];
92}
93
94export type ActorSearchItem = UserProfile;
95
96export interface FeedResponse {
97 items: AnnotationItem[];
98 hasMore: boolean;
99 fetchedCount: number;
100}
101
102export interface NotificationItem {
103 id: number;
104 recipient: UserProfile;
105 actor: UserProfile;
106 type:
107 | "reply"
108 | "quote"
109 | "highlight"
110 | "bookmark"
111 | "annotation"
112 | "like"
113 | "follow";
114 subjectUri: string;
115 subject?: AnnotationItem | unknown;
116 createdAt: string;
117 readAt?: string;
118}
119
120export interface Collection {
121 id: string;
122 uri: string;
123 name: string;
124 description?: string;
125 icon?: string;
126 creator: UserProfile;
127 createdAt: string;
128 itemCount: number;
129 items?: AnnotationItem[];
130}
131
132export interface CollectionItem {
133 id: string;
134 collectionId: string;
135 subjectUri: string;
136 createdAt: string;
137 annotation?: AnnotationItem;
138}
139
140export interface ModerationRelationship {
141 blocking: boolean;
142 muting: boolean;
143 blockedBy: boolean;
144}
145
146export interface BlockedUser {
147 did: string;
148 author: UserProfile;
149 createdAt: string;
150}
151
152export interface MutedUser {
153 did: string;
154 author: UserProfile;
155 createdAt: string;
156}
157
158export interface ModerationReport {
159 id: number;
160 reporter: UserProfile;
161 subject: UserProfile;
162 subjectUri?: string;
163 reasonType: string;
164 reasonText?: string;
165 status: string;
166 createdAt: string;
167 resolvedAt?: string;
168 resolvedBy?: string;
169}
170
171export type ReportReasonType =
172 | "spam"
173 | "violation"
174 | "misleading"
175 | "sexual"
176 | "rude"
177 | "other";
178
179export interface ContentLabel {
180 val: string;
181 src: string;
182 scope?: "account" | "content";
183}
184
185export type ContentLabelValue =
186 | "sexual"
187 | "nudity"
188 | "violence"
189 | "gore"
190 | "spam"
191 | "misleading";
192
193export type LabelVisibility = "hide" | "warn" | "ignore";
194
195export interface LabelerSubscription {
196 did: string;
197}
198
199export interface LabelPreference {
200 labelerDid: string;
201 label: string;
202 visibility: LabelVisibility;
203}
204
205export interface LabelDefinition {
206 identifier: string;
207 severity: string;
208 blurs: string;
209 description: string;
210}
211
212export interface LabelerInfo {
213 did: string;
214 name: string;
215 labels: LabelDefinition[];
216}
217
218export interface HydratedLabel {
219 id: number;
220 src: string;
221 uri: string;
222 val: string;
223 createdBy: {
224 did: string;
225 handle: string;
226 displayName?: string;
227 avatar?: string;
228 };
229 createdAt: string;
230 subject?: {
231 did: string;
232 handle: string;
233 displayName?: string;
234 avatar?: string;
235 };
236}
237export interface EditHistoryItem {
238 id: number;
239 uri: string;
240 recordType: string;
241 previousContent: string;
242 previousCid?: string;
243 editedAt: string;
244}