@vite-hub/comments 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +79 -31
  2. package/dist/anchor.d.ts +7 -4
  3. package/dist/anchor.js +10 -5
  4. package/dist/client-diagnostics-CcFpkbAk.js +40 -0
  5. package/dist/client.d.ts +78 -3
  6. package/dist/client.js +198 -13
  7. package/dist/{console-BIz9t2cO.d.ts → console-h4KlhIik.d.ts} +97 -8
  8. package/dist/context-BqIsmYP1.js +61 -0
  9. package/dist/database/postgres.d.ts +738 -347
  10. package/dist/database/postgres.js +28 -7
  11. package/dist/{database-Cb2xjC1V.d.ts → database-CA1aHKN7.d.ts} +675 -276
  12. package/dist/database.d.ts +6 -98
  13. package/dist/database.js +2 -3
  14. package/dist/define-43mMR39K.js +89 -0
  15. package/dist/define-B3TF9zzn.d.ts +204 -0
  16. package/dist/errors-4gelGVmK.js +57 -0
  17. package/dist/errors-C6qptPoG.js +135 -0
  18. package/dist/errors-CyQyKAvy.d.ts +185 -0
  19. package/dist/fold-name-B7Zb3-MF.js +7 -0
  20. package/dist/{identity-3qtVC4rF.js → identity-CBOzgxSf.js} +7 -2
  21. package/dist/index-DNhy69Wt.d.ts +83 -0
  22. package/dist/index.d.ts +7 -7
  23. package/dist/index.js +196 -5
  24. package/dist/install-BcMPgPk_.js +1154 -0
  25. package/dist/install-W9ghhGoh.d.ts +36 -0
  26. package/dist/installed-B-PfERBU.js +30 -0
  27. package/dist/invariant-D8_xBqmZ.js +22 -0
  28. package/dist/migrate-B0k_0swk.d.ts +54 -0
  29. package/dist/migrate-BDQ8xqUs.js +289 -0
  30. package/dist/object-Da1zyPCR.js +11 -0
  31. package/dist/{operations-0B0QTVWX.d.ts → operations-D4A1Fcgf.d.ts} +37 -15
  32. package/dist/operations-DMMIfYPW.js +1159 -0
  33. package/dist/operations-GLeOqgMt.d.ts +257 -0
  34. package/dist/operations.d.ts +3 -7
  35. package/dist/operations.js +3 -2
  36. package/dist/overlay/client-DmsSMOzi.js +4 -0
  37. package/dist/overlay/dist-BoHMOFax.js +14 -0
  38. package/dist/overlay/dist-yIZmvSaU.js +1 -0
  39. package/dist/overlay/overlay.js +183 -177
  40. package/dist/page/loader.js +138 -18
  41. package/dist/{page-BuroSMXO.js → page-B41ozN63.js} +8 -6
  42. package/dist/{page-BtXADR6d.d.ts → page-DtbMOEMd.d.ts} +6 -5
  43. package/dist/page-tools-shared-NHUjKI8E.js +117 -0
  44. package/dist/path--zk6PEMz.js +18 -0
  45. package/dist/plugin-PS8PMYus.js +74 -0
  46. package/dist/realtime.d.ts +6 -12
  47. package/dist/realtime.js +23 -24
  48. package/dist/rpc-HBcWtg0T.d.ts +17 -0
  49. package/dist/rpc-RKPAusHp.js +153 -0
  50. package/dist/rpc.d.ts +2 -29
  51. package/dist/rpc.js +2 -75
  52. package/dist/runtime/auth.d.ts +5 -3
  53. package/dist/runtime/auth.js +8 -5
  54. package/dist/runtime/console.d.ts +1 -1
  55. package/dist/runtime/console.js +26 -21
  56. package/dist/runtime/index.d.ts +108 -60
  57. package/dist/runtime/index.js +684 -236
  58. package/dist/{server-BomGg3Gb.js → server-D8k-0GXe.js} +16 -7
  59. package/dist/server.d.ts +14 -88
  60. package/dist/server.js +7 -326
  61. package/dist/service-CFVm23k7.d.ts +158 -0
  62. package/dist/service-GHhhyQj4.js +609 -0
  63. package/dist/session-DVx-1Tym.d.ts +14 -0
  64. package/dist/session-EkudzUmm.js +503 -0
  65. package/dist/testing.d.ts +1 -1
  66. package/dist/testing.js +14 -2
  67. package/dist/tokens-DSbwkVSy.js +58 -0
  68. package/dist/types-BIS0hCEl.d.ts +124 -0
  69. package/dist/types-CZujrMFd.d.ts +322 -0
  70. package/dist/vite.d.ts +91 -87
  71. package/dist/vite.js +535 -796
  72. package/package.json +24 -27
  73. package/dist/database-BSnVrwHn.js +0 -60
  74. package/dist/database-C-ktS9Do.js +0 -95
  75. package/dist/define-BzW2Ychn.d.ts +0 -46
  76. package/dist/define-Cbhl6QVJ.js +0 -32
  77. package/dist/errors-BAQYcy3_.d.ts +0 -89
  78. package/dist/errors-DeD6wTCl.js +0 -77
  79. package/dist/h3-v1-request-DDGXJ9E7.js +0 -166
  80. package/dist/index-DklG2Etf.d.ts +0 -111
  81. package/dist/operations-NZG5dB8y.js +0 -732
  82. package/dist/page-tools-shared-D-amu6sx.js +0 -53
  83. package/dist/plugin-QElKQYkA.js +0 -725
  84. package/dist/request-DVc3M_AG.js +0 -14
  85. package/dist/src-CRTwnaEG.js +0 -1362
  86. package/dist/types-Cj8K7Vx7.d.ts +0 -176
  87. package/dist/types-Un2dcJWD.d.ts +0 -288
@@ -0,0 +1,124 @@
1
+ import { S as CommentThread, _ as CommentMetadata, m as CommentListCursor, r as CommentAnchor, s as CommentContext, w as CommentUser, x as CommentSubject, y as CommentStatus } from "./types-CZujrMFd.js";
2
+ import { g as CommentsUser, l as CommentsDefinition } from "./define-B3TF9zzn.js";
3
+ import { ViteHubContext } from "@vite-hub/runtime";
4
+ //#region src/types.d.ts
5
+ interface CommentsForgeTarget {
6
+ repository: string;
7
+ pullRequest: number;
8
+ }
9
+ /**
10
+ * Posts each thread to the pull request of the build that served its page: one comment per message, and one summary
11
+ * comment that lists every thread. Credentials come from Server Env: a GitHub App (`VITEHUB_GITHUB_APP_ID` with
12
+ * `VITEHUB_GITHUB_PRIVATE_KEY`), else `VITEHUB_GITHUB_TOKEN`.
13
+ */
14
+ interface CommentsForgeOptions {
15
+ /** Only GitHub for now. */
16
+ provider: "github";
17
+ /** `owner/name`. Default: the repository of the build that served the thread's page. */
18
+ repository?: string;
19
+ /**
20
+ * The pull request of a thread. Default: the one the build names, else the open pull request whose head is the
21
+ * build's branch. Return `undefined` to keep the thread off GitHub.
22
+ */
23
+ pullRequest?: (thread: CommentThread) => number | undefined | Promise<number | undefined>;
24
+ /**
25
+ * The GitHub token of the person who wrote a message, such as the user token of their GitHub sign-in, so the
26
+ * comment posts as them. Without one, the GitHub App posts it with their name.
27
+ */
28
+ token?: (author: CommentUser) => string | undefined | Promise<string | undefined>;
29
+ /** The heading of the summary comment. Default `"Preview comments"`. */
30
+ title?: string;
31
+ /** GitHub Enterprise API base. Default `https://api.github.com`. */
32
+ apiUrl?: string;
33
+ fetch?: typeof fetch;
34
+ }
35
+ /**
36
+ * The request event of a Comments call: the Request of the Comments API, or the server event of an operation call.
37
+ * Read the request, its cookies, and the platform bindings from `event["~standard"]`. `context` is the H3 event
38
+ * context, when the call came through an H3 event.
39
+ */
40
+ type CommentsRequestEvent = ViteHubContext<{
41
+ context?: Record<string, unknown>;
42
+ }>;
43
+ interface CommentsIdentifyContext {
44
+ event: CommentsRequestEvent;
45
+ }
46
+ interface CommentsPageContext {
47
+ /** The page URL: the origin of the request and the normalized path, without query and hash. */
48
+ url: URL;
49
+ event: CommentsRequestEvent;
50
+ }
51
+ /** The subject of a page, and the version of the subject that new threads start on. */
52
+ interface CommentsPageSubject extends CommentSubject {
53
+ revision?: number;
54
+ }
55
+ interface DefineCommentsOptions extends CommentsDefinition {
56
+ /** Resolves the user of a request. Without it, Comments reads the ViteHub Auth session. Return `null` for anonymous. */
57
+ identify?: (context: CommentsIdentifyContext) => CommentsUser | null | undefined | Promise<CommentsUser | null | undefined>;
58
+ /** Name of the Database that stores comments. Defaults to the `default` Database, or the only one. */
59
+ database?: string;
60
+ /** Posts threads to the pull request that the page previews. */
61
+ forge?: CommentsForgeOptions;
62
+ /**
63
+ * The subject that the overlay comments on for a page, such as `{ kind: "drop", id, revision }`. The server decides:
64
+ * the overlay reads the subject from `/session`, and a new thread from the overlay must be on it. `authorize` still
65
+ * runs on the subject. Return `null` or `undefined` for the default, `{ kind: "page", id: url.pathname }`.
66
+ */
67
+ page?: (context: CommentsPageContext) => CommentsPageSubject | null | undefined | Promise<CommentsPageSubject | null | undefined>;
68
+ }
69
+ interface ListCommentThreadsOptions {
70
+ subject?: CommentSubject;
71
+ /** Only threads about this kind of subject, across all its ids. */
72
+ subjectKind?: string;
73
+ /** An app path. The same as a `page` subject. */
74
+ page?: string;
75
+ /** Only the threads of this numbering scope, such as `site`. */
76
+ scope?: string;
77
+ status?: CommentStatus;
78
+ /** Only threads started on this version of the subject or an earlier one. */
79
+ revision?: {
80
+ lte: number;
81
+ };
82
+ /** Newest activity first. Default 200, at most 500. */
83
+ limit?: number;
84
+ /** Where the next page starts: the `updatedAt` and `id` of the last thread of the page before. */
85
+ before?: CommentListCursor;
86
+ }
87
+ interface CreateCommentThreadInput {
88
+ /** What the thread is about. Or set `page`. */
89
+ subject?: CommentSubject;
90
+ /** An app path, for a thread on a page. The same as `subject: { kind: "page", id: page }`. */
91
+ page?: string;
92
+ /** Default `{ kind: "page" }`. */
93
+ anchor?: CommentAnchor;
94
+ context?: CommentContext;
95
+ metadata?: CommentMetadata;
96
+ /** The version of the subject, such as a document version. */
97
+ revision?: number;
98
+ /** A retry key. A second create with the same key and author in the same scope returns the first thread. */
99
+ requestId?: string;
100
+ body: string;
101
+ author: CommentUser;
102
+ /** Ids of the people that `body` names with `@`. */
103
+ mentions?: string[];
104
+ attachments?: string[];
105
+ }
106
+ interface EditCommentInput {
107
+ body: string;
108
+ /** Replaces the mentions. Default: none. */
109
+ mentions?: string[];
110
+ }
111
+ interface ReplyInput {
112
+ body: string;
113
+ author: CommentUser;
114
+ mentions?: string[];
115
+ attachments?: string[];
116
+ }
117
+ interface ReplyOptions {
118
+ /** Reply to a resolved thread, and keep it resolved. Default `false`: the reply fails with `COMMENTS_RESOLVED`. */
119
+ allowResolved?: boolean;
120
+ }
121
+ /** Codes of the errors that Comments methods return in the `[error, data]` tuple. */
122
+ type CommentsErrorCode = "COMMENTS_NOT_INSTALLED" | "COMMENTS_NOT_FOUND" | "COMMENTS_INVALID_INPUT" | "COMMENTS_FORBIDDEN" | "COMMENTS_POLICY_MISSING" | "COMMENTS_RESOLVED" | "COMMENTS_CONTENT_MISSING" | "COMMENTS_FIELD_INVALID" | "COMMENTS_FIELD_NOT_EDITABLE" | "COMMENTS_FIELD_FORBIDDEN" | "COMMENTS_FIELD_CONFLICT" | "COMMENTS_FIELD_LOCKED";
123
+ //#endregion
124
+ export { CommentsPageContext as a, CreateCommentThreadInput as c, ListCommentThreadsOptions as d, ReplyInput as f, CommentsIdentifyContext as i, DefineCommentsOptions as l, CommentsForgeOptions as n, CommentsPageSubject as o, ReplyOptions as p, CommentsForgeTarget as r, CommentsRequestEvent as s, CommentsErrorCode as t, EditCommentInput as u };
@@ -0,0 +1,322 @@
1
+ //#region src/operations-core/types.d.ts
2
+ /** A person. The signed-in user and every author have this shape. */
3
+ interface CommentUser {
4
+ id: string;
5
+ /** Shown when there is one, else the `id`. */
6
+ name?: string;
7
+ image?: string;
8
+ /**
9
+ * True for a guest that named itself in the browser. Its id starts with `guest:`. Show the name, never trust it:
10
+ * a guest id never proves who wrote a message.
11
+ */
12
+ guest?: boolean;
13
+ }
14
+ /** The agent that wrote a comment on behalf of a user. Interfaces show it in place of the user, with the user's name beside. */
15
+ interface CommentActor {
16
+ id: string;
17
+ name?: string;
18
+ /** The agent's logo. */
19
+ image?: string;
20
+ }
21
+ type CommentStatus = "open" | "resolved";
22
+ /** What a thread is about. `page` takes an app path as `id`. Other kinds, such as `content`, name their own ids. */
23
+ interface CommentSubject {
24
+ kind: string;
25
+ id: string;
26
+ }
27
+ /**
28
+ * Every offset is in thousandths of the element box, so `500` is the middle.
29
+ * An anchor with a rectangle keeps it inside the box: `x + width <= 1000`.
30
+ */
31
+ interface PageAnchor {
32
+ kind: "page";
33
+ }
34
+ interface ElementAnchor {
35
+ kind: "element";
36
+ selector: string;
37
+ x: number;
38
+ y: number;
39
+ /** The `data-content-field` address of the element or its closest ancestor, such as `about#hero.title`. */
40
+ field?: string;
41
+ /** Tag and the first 40 characters of the element text, to check that `selector` still finds the same element. */
42
+ label?: string;
43
+ /** Fallback position when the element is gone: thousandths of the document width, and CSS pixels from the document top. */
44
+ page?: {
45
+ x: number;
46
+ y: number;
47
+ };
48
+ /** Viewport width when the pin was dropped. */
49
+ viewport?: {
50
+ width: number;
51
+ };
52
+ }
53
+ /** A W3C TextQuoteSelector inside the element that `selector` names. */
54
+ interface TextAnchor {
55
+ kind: "text";
56
+ selector: string;
57
+ exact: string;
58
+ prefix: string;
59
+ suffix: string;
60
+ }
61
+ interface AreaAnchor {
62
+ kind: "area";
63
+ selector: string;
64
+ x: number;
65
+ y: number;
66
+ width: number;
67
+ height: number;
68
+ }
69
+ /** A point on an image, or an area when `width` and `height` are set. */
70
+ interface ImageAnchor {
71
+ kind: "image";
72
+ selector: string;
73
+ x: number;
74
+ y: number;
75
+ width?: number;
76
+ height?: number;
77
+ }
78
+ type CommentAnchor = PageAnchor | ElementAnchor | TextAnchor | AreaAnchor | ImageAnchor;
79
+ /**
80
+ * Fields that app code keeps on a thread, such as where its own UI anchors it: at most 50 keys of at most 64
81
+ * characters, and strings of at most 4,000 characters.
82
+ */
83
+ type CommentMetadata = Record<string, string | number | boolean | null>;
84
+ /** A Vue component that renders the element of a thread. */
85
+ interface CommentComponent {
86
+ /** The component name, such as `PricingCard`. `<script setup>` components get the name of their file. */
87
+ name: string;
88
+ /**
89
+ * Source files that may define it, relative to the project root. Production builds keep only the name, so a
90
+ * name that two files share, such as `index`, gets both.
91
+ */
92
+ files?: string[];
93
+ }
94
+ /** The build that served a page: what the CI or host told the build, else Git. */
95
+ interface CommentBuild {
96
+ commit?: string;
97
+ branch?: string;
98
+ /** The GitHub repository, as `owner/name`. */
99
+ repository?: string;
100
+ /** The pull request that the build previews, when the host names it. */
101
+ pullRequest?: number;
102
+ }
103
+ /**
104
+ * What a person saw when they started a thread on a page, so a teammate or an Agent can find the code to change. The
105
+ * overlay reads the page, the element, the Vue components, and the browser; the server adds the build.
106
+ */
107
+ interface CommentContext {
108
+ /** The page origin and pathname, without credentials, query parameters, or a hash. */
109
+ url: string;
110
+ title?: string;
111
+ /** The Vue Router route pattern, such as `/blog/:id(.*)*`. */
112
+ route?: string;
113
+ element?: {
114
+ tag: string;
115
+ id?: string;
116
+ /** `data-testid`, `data-test`, or `data-cy` of the element or its closest ancestor. */
117
+ testId?: string;
118
+ /** The `role` attribute, or the role of the tag, such as `button` or `heading`. */
119
+ role?: string;
120
+ /** `aria-label`, `alt`, `title`, or the first 120 characters of the text. */
121
+ name?: string;
122
+ classes?: string[];
123
+ };
124
+ /** Outermost first. Empty on pages that Vue does not render. */
125
+ components?: CommentComponent[];
126
+ environment?: {
127
+ viewport: {
128
+ width: number;
129
+ height: number;
130
+ };
131
+ devicePixelRatio: number;
132
+ userAgent: string;
133
+ language?: string;
134
+ colorScheme?: "light" | "dark";
135
+ timeZone?: string;
136
+ };
137
+ /** The build that served the page, when the build could read it. */
138
+ build?: CommentBuild;
139
+ }
140
+ /**
141
+ * Where a thread sits on its pull request, when `defineComments({ forge })` posts it.
142
+ * - `posted`: on the pull request.
143
+ * - `pending`: being posted.
144
+ * - `failed`: the forge refused it; the next change, or `comments.sync()`, tries again.
145
+ */
146
+ interface CommentForgeLink {
147
+ repository: string;
148
+ pullRequest: number;
149
+ state: "posted" | "pending" | "failed";
150
+ /** The comment that holds the thread's first message. */
151
+ url?: string;
152
+ /** Why the forge refused it. */
153
+ error?: string;
154
+ /** `author` when it posted with the person's own GitHub token, `app` when the GitHub App posted it for them. */
155
+ postedAs?: "author" | "app";
156
+ }
157
+ /** One Markdown message. The first message of a thread is the comment. */
158
+ interface CommentMessage {
159
+ id: string;
160
+ threadId: string;
161
+ body: string;
162
+ author: CommentUser;
163
+ actor?: CommentActor;
164
+ /** Ids of the users mentioned in `body`. */
165
+ mentions: string[];
166
+ /** Keys of the files that `comments.upload` stored, or that app code stored itself. */
167
+ attachments: string[];
168
+ /** Milliseconds since the epoch. */
169
+ createdAt: number;
170
+ editedAt?: number;
171
+ }
172
+ interface CommentThread {
173
+ id: string;
174
+ /** The numbering scope. `n` is unique inside it. */
175
+ scope: string;
176
+ /** The number that pins and `?comment=<n>` show. */
177
+ n: number;
178
+ subject: CommentSubject;
179
+ anchor: CommentAnchor;
180
+ status: CommentStatus;
181
+ resolvedBy?: CommentUser;
182
+ resolvedAt?: number;
183
+ author: CommentUser;
184
+ actor?: CommentActor;
185
+ /** Oldest first. */
186
+ messages: CommentMessage[];
187
+ /** Fields that app code keeps on the thread. */
188
+ metadata?: CommentMetadata;
189
+ /** What the person saw on the page, for threads that the overlay started. */
190
+ context?: CommentContext;
191
+ /** The version of the subject that the thread was started on, such as a document version. */
192
+ revision?: number;
193
+ /** The pull request comment of the thread, when `defineComments({ forge })` posts threads. */
194
+ forge?: CommentForgeLink | null;
195
+ createdAt: number;
196
+ updatedAt: number;
197
+ }
198
+ interface CommentListQuery {
199
+ subject?: CommentSubject;
200
+ /** Only threads about this kind of subject, across all its ids. */
201
+ subjectKind?: string;
202
+ /** An app path. The same as a `page` subject. */
203
+ page?: string;
204
+ status?: CommentStatus;
205
+ /** Only threads that the signed-in user started. */
206
+ mine?: boolean;
207
+ /** Only threads that mention the signed-in user. */
208
+ mentions?: boolean;
209
+ /** Only threads started on this version of the subject or an earlier one. Threads without a `revision` are left out. */
210
+ revision?: {
211
+ lte: number;
212
+ };
213
+ /** Most threads in the answer. Default 200, at most 500. */
214
+ limit?: number;
215
+ /** Where the next page starts: the `updatedAt` and `id` of the last thread of the page before. Threads come newest first. */
216
+ before?: CommentListCursor;
217
+ }
218
+ /** The position of a thread in a list: the list is ordered by `updatedAt`, then `id`, newest first. */
219
+ interface CommentListCursor {
220
+ updatedAt: number;
221
+ id: string;
222
+ }
223
+ /** By id, or by number inside its scope, as `?comment=<n>` names it. */
224
+ type CommentGetInput = {
225
+ id: string;
226
+ } | {
227
+ scope: string;
228
+ n: number;
229
+ };
230
+ interface CommentCreateInput {
231
+ subject: CommentSubject;
232
+ anchor: CommentAnchor;
233
+ body: string;
234
+ mentions?: string[];
235
+ attachments?: string[];
236
+ metadata?: CommentMetadata;
237
+ /** The version of the subject, such as a document version. A whole number from 0. */
238
+ revision?: number;
239
+ /**
240
+ * A retry key, such as `crypto.randomUUID()`, kept for one draft. A second create with the same key in the same
241
+ * scope returns the first thread and creates nothing.
242
+ */
243
+ requestId?: string;
244
+ }
245
+ interface CommentReplyInput {
246
+ threadId: string;
247
+ body: string;
248
+ mentions?: string[];
249
+ attachments?: string[];
250
+ }
251
+ interface CommentEditInput {
252
+ threadId: string;
253
+ messageId: string;
254
+ body: string;
255
+ mentions?: string[];
256
+ }
257
+ /** Without `messageId` the whole thread goes. Deleting the first message also deletes the thread. */
258
+ interface CommentDeleteInput {
259
+ threadId: string;
260
+ messageId?: string;
261
+ }
262
+ interface CommentStatusInput {
263
+ threadId: string;
264
+ }
265
+ interface CommentUsersInput {
266
+ query: string;
267
+ limit?: number;
268
+ /** The thread that the mention goes in. Suggestions leave out the people that may not be mentioned there. */
269
+ threadId?: string;
270
+ /** The subject of a new thread, when there is no thread yet. */
271
+ subject?: CommentSubject;
272
+ }
273
+ interface CommentUploadInput {
274
+ /** The file name, such as `screenshot.png`. */
275
+ name: string;
276
+ /** The media type. See the limits for the types that Comments takes. */
277
+ type: string;
278
+ /** The file content, Base64-encoded. */
279
+ data: string;
280
+ /** The subject of the thread that the file goes in. */
281
+ subject?: CommentSubject;
282
+ }
283
+ /** A stored file. Put its `key` in `attachments` of `create` or `reply`. */
284
+ interface CommentAttachment {
285
+ key: string;
286
+ name: string;
287
+ type: string;
288
+ /** Bytes. */
289
+ size: number;
290
+ }
291
+ type CommentEvent = {
292
+ type: "thread";
293
+ thread: CommentThread;
294
+ } | {
295
+ type: "deleted";
296
+ threadId: string;
297
+ } | {
298
+ type: "reconnected";
299
+ };
300
+ /**
301
+ * The seam between the browser and the server. Each method has the name and the input of one `comments.*` operation.
302
+ * A mutation returns the thread as it is afterwards, and `delete` returns `null` when the thread is gone.
303
+ */
304
+ interface CommentsTransport {
305
+ /** Whether the server accepts attachment keys. Defaults to true for custom transports. */
306
+ supportsAttachments?: boolean;
307
+ list: (query: CommentListQuery) => Promise<CommentThread[]>;
308
+ get: (input: CommentGetInput) => Promise<CommentThread | null>;
309
+ create: (input: CommentCreateInput) => Promise<CommentThread>;
310
+ reply: (input: CommentReplyInput) => Promise<CommentThread>;
311
+ edit: (input: CommentEditInput) => Promise<CommentThread>;
312
+ delete: (input: CommentDeleteInput) => Promise<CommentThread | null>;
313
+ resolve: (input: CommentStatusInput) => Promise<CommentThread>;
314
+ reopen: (input: CommentStatusInput) => Promise<CommentThread>;
315
+ users: (input: CommentUsersInput) => Promise<CommentUser[]>;
316
+ /** Stores a file for `attachments`. Transports without it cannot attach files. */
317
+ upload?: (input: CommentUploadInput) => Promise<CommentAttachment>;
318
+ /** Live updates, such as Realtime. Without it the client refreshes when the window gets focus. */
319
+ subscribe?: (listener: (event: CommentEvent) => void) => () => void;
320
+ }
321
+ //#endregion
322
+ export { TextAnchor as A, CommentUploadInput as C, ElementAnchor as D, CommentsTransport as E, ImageAnchor as O, CommentThread as S, CommentUsersInput as T, CommentMetadata as _, CommentBuild as a, CommentStatusInput as b, CommentCreateInput as c, CommentEvent as d, CommentForgeLink as f, CommentMessage as g, CommentListQuery as h, CommentAttachment as i, PageAnchor as k, CommentDeleteInput as l, CommentListCursor as m, CommentActor as n, CommentComponent as o, CommentGetInput as p, CommentAnchor as r, CommentContext as s, AreaAnchor as t, CommentEditInput as u, CommentReplyInput as v, CommentUser as w, CommentSubject as x, CommentStatus as y };