@sandvichxyz/pecans 1.1.2 → 1.1.4

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 (121) hide show
  1. package/dist/generated/client.d.ts +38 -0
  2. package/dist/generated/client.d.ts.map +1 -0
  3. package/dist/generated/client.js +121 -0
  4. package/dist/generated/client.js.map +1 -0
  5. package/dist/generated/decoders.d.ts +14 -0
  6. package/dist/generated/decoders.d.ts.map +1 -0
  7. package/dist/generated/decoders.js +120 -0
  8. package/dist/generated/decoders.js.map +1 -0
  9. package/dist/generated/encoders.d.ts +4 -0
  10. package/dist/generated/encoders.d.ts.map +1 -0
  11. package/dist/generated/encoders.js +25 -0
  12. package/dist/generated/encoders.js.map +1 -0
  13. package/dist/generated/enums.d.ts +12 -0
  14. package/dist/generated/enums.d.ts.map +1 -0
  15. package/dist/generated/enums.js +18 -0
  16. package/dist/generated/enums.js.map +1 -0
  17. package/dist/generated/index.d.ts +22 -0
  18. package/dist/generated/index.d.ts.map +1 -0
  19. package/dist/generated/index.js +39 -0
  20. package/dist/generated/index.js.map +1 -0
  21. package/dist/generated/modules/account.d.ts +7 -0
  22. package/dist/generated/modules/account.d.ts.map +1 -0
  23. package/dist/generated/modules/account.js +30 -0
  24. package/dist/generated/modules/account.js.map +1 -0
  25. package/dist/generated/modules/answer.d.ts +38 -0
  26. package/dist/generated/modules/answer.d.ts.map +1 -0
  27. package/dist/generated/modules/answer.js +89 -0
  28. package/dist/generated/modules/answer.js.map +1 -0
  29. package/dist/generated/modules/ask.d.ts +95 -0
  30. package/dist/generated/modules/ask.d.ts.map +1 -0
  31. package/dist/generated/modules/ask.js +226 -0
  32. package/dist/generated/modules/ask.js.map +1 -0
  33. package/dist/generated/modules/auth.d.ts +28 -0
  34. package/dist/generated/modules/auth.d.ts.map +1 -0
  35. package/dist/generated/modules/auth.js +53 -0
  36. package/dist/generated/modules/auth.js.map +1 -0
  37. package/dist/generated/modules/dashboard.d.ts +11 -0
  38. package/dist/generated/modules/dashboard.d.ts.map +1 -0
  39. package/dist/generated/modules/dashboard.js +20 -0
  40. package/dist/generated/modules/dashboard.js.map +1 -0
  41. package/dist/generated/modules/drawing.d.ts +33 -0
  42. package/dist/generated/modules/drawing.d.ts.map +1 -0
  43. package/dist/generated/modules/drawing.js +69 -0
  44. package/dist/generated/modules/drawing.js.map +1 -0
  45. package/dist/generated/modules/feed.d.ts +22 -0
  46. package/dist/generated/modules/feed.d.ts.map +1 -0
  47. package/dist/generated/modules/feed.js +43 -0
  48. package/dist/generated/modules/feed.js.map +1 -0
  49. package/dist/generated/modules/forum.d.ts +96 -0
  50. package/dist/generated/modules/forum.d.ts.map +1 -0
  51. package/dist/generated/modules/forum.js +193 -0
  52. package/dist/generated/modules/forum.js.map +1 -0
  53. package/dist/generated/modules/images.d.ts +27 -0
  54. package/dist/generated/modules/images.d.ts.map +1 -0
  55. package/dist/generated/modules/images.js +53 -0
  56. package/dist/generated/modules/images.js.map +1 -0
  57. package/dist/generated/modules/messages.d.ts +59 -0
  58. package/dist/generated/modules/messages.d.ts.map +1 -0
  59. package/dist/generated/modules/messages.js +119 -0
  60. package/dist/generated/modules/messages.js.map +1 -0
  61. package/dist/generated/modules/navbar.d.ts +11 -0
  62. package/dist/generated/modules/navbar.d.ts.map +1 -0
  63. package/dist/generated/modules/navbar.js +20 -0
  64. package/dist/generated/modules/navbar.js.map +1 -0
  65. package/dist/generated/modules/notify.d.ts +27 -0
  66. package/dist/generated/modules/notify.d.ts.map +1 -0
  67. package/dist/generated/modules/notify.js +51 -0
  68. package/dist/generated/modules/notify.js.map +1 -0
  69. package/dist/generated/modules/profile.d.ts +42 -0
  70. package/dist/generated/modules/profile.d.ts.map +1 -0
  71. package/dist/generated/modules/profile.js +87 -0
  72. package/dist/generated/modules/profile.js.map +1 -0
  73. package/dist/generated/modules/qa.d.ts +12 -0
  74. package/dist/generated/modules/qa.d.ts.map +1 -0
  75. package/dist/generated/modules/qa.js +23 -0
  76. package/dist/generated/modules/qa.js.map +1 -0
  77. package/dist/generated/modules/settings.d.ts +23 -0
  78. package/dist/generated/modules/settings.d.ts.map +1 -0
  79. package/dist/generated/modules/settings.js +44 -0
  80. package/dist/generated/modules/settings.js.map +1 -0
  81. package/dist/generated/modules/stories.d.ts +16 -0
  82. package/dist/generated/modules/stories.d.ts.map +1 -0
  83. package/dist/generated/modules/stories.js +35 -0
  84. package/dist/generated/modules/stories.js.map +1 -0
  85. package/dist/generated/types.d.ts +956 -0
  86. package/dist/generated/types.d.ts.map +1 -0
  87. package/dist/generated/types.js +4 -0
  88. package/dist/generated/types.js.map +1 -0
  89. package/dist/index.d.ts +3 -0
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +19 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/runtime/call.d.ts +19 -0
  94. package/dist/runtime/call.d.ts.map +1 -0
  95. package/dist/runtime/call.js +26 -0
  96. package/dist/runtime/call.js.map +1 -0
  97. package/dist/runtime/client.d.ts +27 -0
  98. package/dist/runtime/client.d.ts.map +1 -0
  99. package/dist/runtime/client.js +90 -0
  100. package/dist/runtime/client.js.map +1 -0
  101. package/dist/runtime/index.d.ts +6 -0
  102. package/dist/runtime/index.d.ts.map +1 -0
  103. package/dist/runtime/index.js +22 -0
  104. package/dist/runtime/index.js.map +1 -0
  105. package/dist/runtime/join.d.ts +2 -0
  106. package/dist/runtime/join.d.ts.map +1 -0
  107. package/dist/runtime/join.js +14 -0
  108. package/dist/runtime/join.js.map +1 -0
  109. package/dist/runtime/module.d.ts +7 -0
  110. package/dist/runtime/module.d.ts.map +1 -0
  111. package/dist/runtime/module.js +27 -0
  112. package/dist/runtime/module.js.map +1 -0
  113. package/dist/runtime/transform.d.ts +19 -0
  114. package/dist/runtime/transform.d.ts.map +1 -0
  115. package/dist/runtime/transform.js +40 -0
  116. package/dist/runtime/transform.js.map +1 -0
  117. package/dist/runtime/types.d.ts +19 -0
  118. package/dist/runtime/types.d.ts.map +1 -0
  119. package/dist/runtime/types.js +3 -0
  120. package/dist/runtime/types.js.map +1 -0
  121. package/package.json +1 -1
@@ -0,0 +1,956 @@
1
+ export type ThreadListResponse = TCResponse & {
2
+ name: string;
3
+ totalThreads: number;
4
+ category: string;
5
+ canCreate: boolean;
6
+ threads: ForumThread[];
7
+ };
8
+ export type ViewPostsResponse = TCResponse & {
9
+ posts: ForumPost[];
10
+ numPostsBefore: number;
11
+ numPostsAfter: number;
12
+ jumpTo: number;
13
+ thread: ViewThread;
14
+ };
15
+ export type ForumSearchResponse = TCResponse & {
16
+ results: ForumSearchResult[];
17
+ };
18
+ export type GetQuoteTextResponse = TCResponse & {
19
+ /**
20
+ * The raw text of the post being quoted.
21
+ */
22
+ originalText: string;
23
+ /**
24
+ * Username of the post's author.
25
+ */
26
+ user: string;
27
+ };
28
+ export type NewThreadResponse = TCResponse & {
29
+ /**
30
+ * Id of the newly created thread.
31
+ */
32
+ threadId: number;
33
+ };
34
+ /**
35
+ * A newly-created forum thread.
36
+ */
37
+ export type ForumThreadFeedItem = FeedItemBase & {
38
+ type: "forum.thread";
39
+ data: {
40
+ /**
41
+ * First line(s) of the thread's opening post.
42
+ */
43
+ preview: string;
44
+ };
45
+ };
46
+ /**
47
+ * A newly-asked Q&A question.
48
+ */
49
+ export type QaNewQuestionFeedItem = FeedItemBase & {
50
+ type: "qa.newquestion";
51
+ data: {
52
+ /**
53
+ * First line(s) of the question body.
54
+ */
55
+ preview: string;
56
+ };
57
+ };
58
+ /**
59
+ * An account being registered.
60
+ */
61
+ export type AccountRegisterFeedItem = FeedItemBase & {
62
+ type: "account.register";
63
+ data: unknown[];
64
+ };
65
+ export type FeedResponse = TCResponse & {
66
+ /**
67
+ * Server-side cursor for pagination.
68
+ */
69
+ feedId: string;
70
+ /**
71
+ * The first page of feed items, newest first.
72
+ */
73
+ items: FeedItem[];
74
+ };
75
+ export type FeedItem = ForumThreadFeedItem | QaNewQuestionFeedItem | AccountRegisterFeedItem;
76
+ export type FeedScrollResponse = TCResponse & {
77
+ /**
78
+ * The next page of items; absent once the feed is exhausted.
79
+ */
80
+ items?: FeedItem[];
81
+ /**
82
+ * True when there are no more items to load.
83
+ */
84
+ end?: boolean;
85
+ };
86
+ export type FolderViewResponse = TCResponse & {
87
+ hasMore: boolean;
88
+ hasPrevious: boolean;
89
+ messages: MessagePreview[];
90
+ };
91
+ export type MessageViewResponse = TCResponse & {
92
+ messages: Message[];
93
+ header: MessageThreadHeader;
94
+ /**
95
+ * Whether older pages exist beyond this one. Page 1 holds the most recent
96
+ * messages; higher page numbers are progressively older.
97
+ */
98
+ hasMore: boolean;
99
+ };
100
+ export type FolderListResponse = TCResponse & {
101
+ folders: Folder[];
102
+ };
103
+ export type SaveDrawingResponse = TCResponse & {
104
+ /**
105
+ * Id of the newly-created image, e.g. `img45790`.
106
+ */
107
+ newImageId: string;
108
+ };
109
+ export type ViewDrawingDataResponse = TCResponse & {
110
+ /**
111
+ * The raw pixel data: a flat hex string, 32×32, RGB, 6 hex chars per pixel, row-major.
112
+ */
113
+ data: string;
114
+ };
115
+ export type ImageBatchGetResponse = TCResponse & {
116
+ /**
117
+ * The requested images, in no guaranteed order.
118
+ */
119
+ items: ImageData[];
120
+ };
121
+ export type ImageGalleryListResponse = TCResponse & {
122
+ /**
123
+ * Ids of the images on this page.
124
+ */
125
+ images: ImageRef[];
126
+ /**
127
+ * Whether further pages exist beyond this one.
128
+ */
129
+ hasMore: boolean;
130
+ };
131
+ export type ImageInfoResponse = TCResponse & {
132
+ imageId: string;
133
+ /**
134
+ * Username of the image's owner.
135
+ */
136
+ owner: string;
137
+ /**
138
+ * Whether the active account owns this image.
139
+ */
140
+ isYours: boolean;
141
+ };
142
+ export type NotifySyncResponse = TCResponse & {
143
+ count: number;
144
+ };
145
+ export type WhosOnlineResponse = TCResponse & {
146
+ users: TruncatedUser[];
147
+ };
148
+ export type LoginResponse = TCResponse & {
149
+ success: boolean;
150
+ authToken: string;
151
+ yourId: string;
152
+ };
153
+ export type ExistingCookieResponse = TCResponse & {
154
+ success: boolean;
155
+ yourId: string;
156
+ };
157
+ export type LogoutResponse = TCResponse & {
158
+ success: boolean;
159
+ ripToken: string;
160
+ user: string;
161
+ };
162
+ export type AnswerReplyResponse = TCResponse & {
163
+ id: number;
164
+ time: number;
165
+ text: string;
166
+ };
167
+ /**
168
+ * A question on Two Cans & String.
169
+ */
170
+ export type Question = TCResponse & {
171
+ id: number;
172
+ /**
173
+ * Unix time the question was asked.
174
+ */
175
+ time: number;
176
+ /**
177
+ * The question body text (UCP markup).
178
+ */
179
+ text: string;
180
+ };
181
+ /**
182
+ * A question viewed on the Answer page.
183
+ */
184
+ export type AnswerQuestion = Question & {
185
+ /**
186
+ * Username of the asker, present only when the question is public.
187
+ */
188
+ author?: string;
189
+ poll?: Poll1;
190
+ };
191
+ export type SavedQuestionsResponse = TCResponse & {
192
+ questions: SavedQuestion[];
193
+ };
194
+ export type ListDataResponse = TCResponse & {
195
+ /**
196
+ * Question headers, without their body text.
197
+ */
198
+ questions: QuestionMetadata[];
199
+ };
200
+ export type QuestionTextResponse = TCResponse & {
201
+ /**
202
+ * Question bodies, keyed by id.
203
+ */
204
+ questions: QuestionText[];
205
+ };
206
+ /**
207
+ * A single question as seen on its public view page.
208
+ */
209
+ export type ViewQuestionResponse = Question & {
210
+ /**
211
+ * Whether the question was asked publicly (non-anonymously).
212
+ */
213
+ isPublic: boolean;
214
+ /**
215
+ * Number of responses the question has received.
216
+ */
217
+ responseCount: number;
218
+ /**
219
+ * Username of the asker, present only when the question is public.
220
+ */
221
+ user?: string;
222
+ /**
223
+ * Whether the current user is the asker.
224
+ */
225
+ isYours: boolean;
226
+ };
227
+ /**
228
+ * A page of answers to a question you asked.
229
+ */
230
+ export type AnswersResponse = TCResponse & {
231
+ answers: QuestionAnswer[];
232
+ /**
233
+ * Whether more answers exist beyond this page.
234
+ */
235
+ hasMore: boolean;
236
+ /**
237
+ * Cursor id for fetching the next page.
238
+ */
239
+ nextId: number;
240
+ };
241
+ /**
242
+ * The result of pinning or unpinning a question.
243
+ */
244
+ export type PinToggleResponse = TCResponse & {
245
+ /**
246
+ * The question's new pinned state.
247
+ */
248
+ status: boolean;
249
+ };
250
+ /**
251
+ * The result of bumping a question.
252
+ */
253
+ export type BumpQuestionResponse = TCResponse & {
254
+ /**
255
+ * The question's new expiry (inactive) time.
256
+ */
257
+ expireTime: number;
258
+ };
259
+ /**
260
+ * One answer/response, fetched by its answer id.
261
+ */
262
+ export type GetResponseResponse = TCResponse & {
263
+ /**
264
+ * Id of the question this answers.
265
+ */
266
+ questionId: number;
267
+ /**
268
+ * The answer body text (UCP markup).
269
+ */
270
+ text: string;
271
+ /**
272
+ * Id of the conversation spawned from this answer, if any.
273
+ */
274
+ convoHeaderId?: number;
275
+ };
276
+ export type ProfileGetResponse = TCResponse & {
277
+ /**
278
+ * The looked-up user's id. `ok` is false with error `NOT_FOUND` if no such user.
279
+ */
280
+ id: string;
281
+ };
282
+ export type ProfileDetailsResponse = TCResponse & {
283
+ /**
284
+ * Echoes back the requested field name.
285
+ */
286
+ type: string;
287
+ /**
288
+ * The field's value; a string for text fields, a number for counts like `followers`.
289
+ */
290
+ value: {
291
+ [k: string]: unknown;
292
+ };
293
+ };
294
+ /**
295
+ * An entry in your followers list; adds block state.
296
+ */
297
+ export type FollowerEntry = FollowEntry & {
298
+ /**
299
+ * True if you have blocked this follower.
300
+ */
301
+ blocked: boolean;
302
+ };
303
+ export type ListFollowersResponse = TCResponse & {
304
+ followers: FollowerEntry[];
305
+ };
306
+ export type ListFollowsResponse = TCResponse & {
307
+ follows: FollowEntry[];
308
+ };
309
+ export type QaGetPinnedResponse = TCResponse & {
310
+ /**
311
+ * The questions the user has pinned to their profile.
312
+ */
313
+ pinned: PinnedQuestion[];
314
+ };
315
+ export type NavbarGetResponse = TCResponse & {
316
+ /**
317
+ * The navigation items, in display order.
318
+ */
319
+ nav: NavItem[];
320
+ };
321
+ export type DashboardResponse = TCResponse & {
322
+ /**
323
+ * The most recently asked questions across the site.
324
+ */
325
+ recentQuestions: DashboardQuestion[];
326
+ /**
327
+ * The most recent forum posts across the site.
328
+ */
329
+ recentForumPosts: DashboardForumPost[];
330
+ pointlessNums: DashboardPointlessNums1;
331
+ };
332
+ export type SettingsGetResponse = TCResponse & {
333
+ /**
334
+ * The account's email address.
335
+ */
336
+ email: string;
337
+ /**
338
+ * Whether to send notifications for new private messages.
339
+ */
340
+ msgNotify: boolean;
341
+ /**
342
+ * Whether to hide the sender identity on anonymous messages.
343
+ */
344
+ msgHideAnon: boolean;
345
+ };
346
+ export type StoriesViewListResponse = TCResponse & {
347
+ stories: Story[];
348
+ };
349
+ export type FerrytellCreateResponse = TCResponse & {
350
+ /**
351
+ * Id of the newly created story.
352
+ */
353
+ storyId: number;
354
+ };
355
+ export interface TCFollowInfo {
356
+ in: number;
357
+ out: number;
358
+ }
359
+ export interface TCProfile {
360
+ id: string;
361
+ name: string;
362
+ online: number;
363
+ avatar: string;
364
+ subs: TCFollowInfo;
365
+ }
366
+ export interface TCResponse {
367
+ ok: boolean;
368
+ error?: string;
369
+ profiles?: TCProfile[];
370
+ }
371
+ export interface TCUser {
372
+ id?: string;
373
+ anon?: boolean;
374
+ }
375
+ /**
376
+ * An RGB color, normalized from whatever encoded form the Twocans API uses.
377
+ */
378
+ export interface Rgb {
379
+ r: number;
380
+ g: number;
381
+ b: number;
382
+ }
383
+ export interface ForumCategory {
384
+ id: string;
385
+ name: string;
386
+ description: string;
387
+ threads: number;
388
+ posts: number;
389
+ newThreads: number;
390
+ }
391
+ export interface ForumCategoriesResponse {
392
+ categories: ForumCategory[];
393
+ }
394
+ export interface ThreadListPost {
395
+ id: number;
396
+ author: string;
397
+ text: string;
398
+ time: number;
399
+ category: string;
400
+ thread: number;
401
+ }
402
+ export interface ForumThread {
403
+ id: number;
404
+ views: number;
405
+ replies: number;
406
+ title: string;
407
+ category: string;
408
+ new: boolean;
409
+ firstPost: ThreadListPost;
410
+ lastPost: ThreadListPost;
411
+ }
412
+ export interface ForumPost {
413
+ id: number;
414
+ user: string;
415
+ text: string;
416
+ ucpText: string;
417
+ ucpEnabled: boolean;
418
+ time: number;
419
+ new: boolean;
420
+ }
421
+ export interface ViewThread {
422
+ id: number;
423
+ lastPostId: number;
424
+ title: string;
425
+ locked: boolean;
426
+ }
427
+ export interface ForumSearchResult {
428
+ post: ThreadListPost;
429
+ threadTitle: string;
430
+ }
431
+ export interface FeedItemBase {
432
+ id: number;
433
+ /**
434
+ * Unix time the activity happened.
435
+ */
436
+ time: number;
437
+ /**
438
+ * Username of the account the item belongs to.
439
+ */
440
+ owner: string;
441
+ /**
442
+ * Relative path to the item on the site, e.g. `/forum/blogs/11894`.
443
+ */
444
+ url: string;
445
+ /**
446
+ * Display title for the item (may be empty for questions).
447
+ */
448
+ title: string;
449
+ }
450
+ export interface MessagePreview {
451
+ id: string;
452
+ subject: string;
453
+ preview: string;
454
+ time: number;
455
+ users: TCUser[];
456
+ new?: boolean;
457
+ }
458
+ export interface Message {
459
+ id: number;
460
+ member: number;
461
+ time: number;
462
+ type: string;
463
+ html: string;
464
+ new?: boolean;
465
+ }
466
+ export interface MessageFolder {
467
+ id: string;
468
+ name: string;
469
+ }
470
+ export interface MessageThreadMember {
471
+ mid: number;
472
+ anon?: boolean;
473
+ readTo: number;
474
+ id?: string;
475
+ you?: boolean;
476
+ }
477
+ export interface MessageThreadHeader {
478
+ title: string;
479
+ members: MessageThreadMember[];
480
+ folder: MessageFolder;
481
+ }
482
+ export interface Folder {
483
+ id: string;
484
+ name: string;
485
+ }
486
+ export interface ImageData {
487
+ /**
488
+ * Image id, e.g. `img45788`.
489
+ */
490
+ id: string;
491
+ /**
492
+ * Base64-encoded PNG, prefixed with the literal string `B64`.
493
+ */
494
+ data: string;
495
+ }
496
+ export interface ImageRef {
497
+ /**
498
+ * Image id, e.g. `img45788`.
499
+ */
500
+ id: string;
501
+ }
502
+ export interface TruncatedUser {
503
+ id: string;
504
+ }
505
+ export interface PollOption {
506
+ text: string;
507
+ color: string;
508
+ votes?: number;
509
+ yours?: boolean;
510
+ }
511
+ export interface Poll {
512
+ options: PollOption[];
513
+ answered: boolean;
514
+ }
515
+ /**
516
+ * The attached poll, if this is a poll-type question.
517
+ */
518
+ export interface Poll1 {
519
+ options: PollOption[];
520
+ answered: boolean;
521
+ }
522
+ /**
523
+ * A question the user has saved for later, as shown on the
524
+ * Saved Questions page.
525
+ */
526
+ export interface SavedQuestion {
527
+ /**
528
+ * The question id.
529
+ */
530
+ id: number;
531
+ /**
532
+ * Short preview of the question body.
533
+ */
534
+ preview: string;
535
+ }
536
+ export interface PollOptionRaw {
537
+ /**
538
+ * Number of votes this option has received.
539
+ */
540
+ n: number;
541
+ /**
542
+ * Option index or choice id.
543
+ */
544
+ c: number;
545
+ }
546
+ export interface PollMetadataRaw {
547
+ id: number;
548
+ options: PollOptionRaw[];
549
+ }
550
+ /**
551
+ * The header for one question: everything except the question body itself.
552
+ * Returned by `listData`; the body is fetched separately via `qtext`.
553
+ */
554
+ export interface QuestionMetadata {
555
+ id: number;
556
+ /**
557
+ * Whether the question is still activate.
558
+ */
559
+ isActive: boolean;
560
+ /**
561
+ * Total number of replies.
562
+ */
563
+ replyCount: number;
564
+ /**
565
+ * Total number of new replies (not yet marked as read).
566
+ */
567
+ newReplyCount: number;
568
+ /**
569
+ * Unix time at which the question closes.
570
+ */
571
+ expireTime: number;
572
+ /**
573
+ * Unix time at which the question was asked.
574
+ */
575
+ creationTime: number;
576
+ /**
577
+ * Whether the question was asked publicly (non-anonymously).
578
+ */
579
+ isPublic: boolean;
580
+ /**
581
+ * Whether this is a free-text question or a poll.
582
+ */
583
+ questionType: "text" | "poll";
584
+ }
585
+ export interface QuestionText {
586
+ id: number;
587
+ /**
588
+ * The question's body text.
589
+ */
590
+ text: string;
591
+ }
592
+ /**
593
+ * One answer to a question you asked, as returned by `getAnswers`.
594
+ */
595
+ export interface QuestionAnswer {
596
+ id: number;
597
+ /**
598
+ * The answer body text (UCP markup).
599
+ */
600
+ body: string;
601
+ /**
602
+ * Unix time the answer was posted.
603
+ */
604
+ time: number;
605
+ /**
606
+ * Id of the question this answers.
607
+ */
608
+ questionId: number;
609
+ /**
610
+ * Id of the conversation spawned from this answer, or 0 if none.
611
+ */
612
+ convoId: number;
613
+ /**
614
+ * Whether the answer is unread.
615
+ */
616
+ unread: boolean;
617
+ }
618
+ /**
619
+ * A fully populated question with metadata and body text.
620
+ */
621
+ export interface QuestionData {
622
+ /**
623
+ * The question's body text.
624
+ */
625
+ body: string;
626
+ header: QuestionMetadata1;
627
+ }
628
+ /**
629
+ * The header for one question: everything except the question body itself.
630
+ * Returned by `listData`; the body is fetched separately via `qtext`.
631
+ */
632
+ export interface QuestionMetadata1 {
633
+ id: number;
634
+ /**
635
+ * Whether the question is still activate.
636
+ */
637
+ isActive: boolean;
638
+ /**
639
+ * Total number of replies.
640
+ */
641
+ replyCount: number;
642
+ /**
643
+ * Total number of new replies (not yet marked as read).
644
+ */
645
+ newReplyCount: number;
646
+ /**
647
+ * Unix time at which the question closes.
648
+ */
649
+ expireTime: number;
650
+ /**
651
+ * Unix time at which the question was asked.
652
+ */
653
+ creationTime: number;
654
+ /**
655
+ * Whether the question was asked publicly (non-anonymously).
656
+ */
657
+ isPublic: boolean;
658
+ /**
659
+ * Whether this is a free-text question or a poll.
660
+ */
661
+ questionType: "text" | "poll";
662
+ }
663
+ /**
664
+ * One choice in a new poll question.
665
+ */
666
+ export interface NewPollChoice {
667
+ /**
668
+ * Display label for the choice.
669
+ */
670
+ label: string;
671
+ /**
672
+ * 6-digit hex color (no leading `#`), e.g. "ff0000", or the name of a color.
673
+ */
674
+ color: string;
675
+ }
676
+ /**
677
+ * The poll attached to a new poll-type question.
678
+ */
679
+ export interface NewPoll {
680
+ choices: NewPollChoice[];
681
+ }
682
+ /**
683
+ * The body of a new question, serialized as JSON into the legacy askapi's
684
+ * `rawEmbeddedJsonLolInternalTechDebt` field.
685
+ */
686
+ export interface PostQuestionBody {
687
+ /**
688
+ * The question text.
689
+ */
690
+ text: string;
691
+ /**
692
+ * Whether the question was asked publicly (non-anonymously).
693
+ */
694
+ isPublic: boolean;
695
+ /**
696
+ * Whether the question carries a poll.
697
+ */
698
+ hasPoll: boolean;
699
+ poll?: NewPoll1;
700
+ }
701
+ /**
702
+ * The poll attached to a new poll-type question.
703
+ */
704
+ export interface NewPoll1 {
705
+ choices: NewPollChoice[];
706
+ }
707
+ /**
708
+ * One entry in a follower/following list.
709
+ */
710
+ export interface FollowEntry {
711
+ /**
712
+ * The other user's id.
713
+ */
714
+ id: string;
715
+ /**
716
+ * True if the follow relationship is reciprocated.
717
+ */
718
+ mutual: boolean;
719
+ }
720
+ export interface PinnedQuestion {
721
+ id: number;
722
+ /**
723
+ * First line(s) of the question body.
724
+ */
725
+ preview: string;
726
+ /**
727
+ * Unix time the question was asked.
728
+ */
729
+ time: number;
730
+ }
731
+ export interface NavItem {
732
+ /**
733
+ * Stable id for the destination, e.g. `feed`, `forum`.
734
+ */
735
+ id: string;
736
+ /**
737
+ * Path the item links to, e.g. `/forum`.
738
+ */
739
+ url: string;
740
+ /**
741
+ * Human-readable label, e.g. `Home Feed`.
742
+ */
743
+ label: string;
744
+ /**
745
+ * Image id for the item's icon.
746
+ */
747
+ icon: string;
748
+ /**
749
+ * Notification feature key to badge this item against, if any.
750
+ */
751
+ notify?: string;
752
+ }
753
+ export interface DashboardQuestion {
754
+ id: number;
755
+ /**
756
+ * Unix time the question was asked.
757
+ */
758
+ time: number;
759
+ /**
760
+ * First line(s) of the question body.
761
+ */
762
+ preview: string;
763
+ }
764
+ /**
765
+ * The forum category a recent post belongs to.
766
+ */
767
+ export interface DashboardForumCategory {
768
+ /**
769
+ * Category slug, e.g. `games`.
770
+ */
771
+ key: string;
772
+ /**
773
+ * Human-readable category name.
774
+ */
775
+ name: string;
776
+ /**
777
+ * Relative path to the category, e.g. `/forum/games`.
778
+ */
779
+ url: string;
780
+ }
781
+ /**
782
+ * The thread a recent post belongs to.
783
+ */
784
+ export interface DashboardForumThread {
785
+ /**
786
+ * Thread title.
787
+ */
788
+ name: string;
789
+ /**
790
+ * Relative path to the thread, e.g. `/forum/games/5753`.
791
+ */
792
+ url: string;
793
+ }
794
+ /**
795
+ * A recent forum post shown on the dashboard.
796
+ */
797
+ export interface DashboardForumPost {
798
+ id: number;
799
+ /**
800
+ * First line(s) of the post body.
801
+ */
802
+ preview: string;
803
+ /**
804
+ * Relative path that jumps to the post, e.g. `/forum/games/gotopost/1347214/#post1347214`.
805
+ */
806
+ url: string;
807
+ /**
808
+ * Username of the post's author.
809
+ */
810
+ user: string;
811
+ thread: DashboardForumThread1;
812
+ category: DashboardForumCategory1;
813
+ }
814
+ /**
815
+ * The thread a recent post belongs to.
816
+ */
817
+ export interface DashboardForumThread1 {
818
+ /**
819
+ * Thread title.
820
+ */
821
+ name: string;
822
+ /**
823
+ * Relative path to the thread, e.g. `/forum/games/5753`.
824
+ */
825
+ url: string;
826
+ }
827
+ /**
828
+ * The forum category a recent post belongs to.
829
+ */
830
+ export interface DashboardForumCategory1 {
831
+ /**
832
+ * Category slug, e.g. `games`.
833
+ */
834
+ key: string;
835
+ /**
836
+ * Human-readable category name.
837
+ */
838
+ name: string;
839
+ /**
840
+ * Relative path to the category, e.g. `/forum/games`.
841
+ */
842
+ url: string;
843
+ }
844
+ /**
845
+ * Site-wide vanity counters shown on the dashboard.
846
+ */
847
+ export interface DashboardPointlessNums {
848
+ /**
849
+ * Total number of registered users.
850
+ */
851
+ usersRegistered: number;
852
+ /**
853
+ * Total number of questions and answers ever posted.
854
+ */
855
+ questionsAndAnswers: number;
856
+ }
857
+ /**
858
+ * Site-wide vanity counters shown on the dashboard.
859
+ */
860
+ export interface DashboardPointlessNums1 {
861
+ /**
862
+ * Total number of registered users.
863
+ */
864
+ usersRegistered: number;
865
+ /**
866
+ * Total number of questions and answers ever posted.
867
+ */
868
+ questionsAndAnswers: number;
869
+ }
870
+ /**
871
+ * One line of text on a story. The color is normalized to an `Rgb` struct in
872
+ * both directions, though the wire form is asymmetric: a packed 0xRRGGBB
873
+ * integer when creating a story, an `[r, g, b]` tuple when reading one back.
874
+ */
875
+ export interface StoryLine {
876
+ /**
877
+ * The line's text content.
878
+ */
879
+ value: string;
880
+ color: Rgb1;
881
+ }
882
+ /**
883
+ * An RGB color, normalized from whatever encoded form the Twocans API uses.
884
+ */
885
+ export interface Rgb1 {
886
+ r: number;
887
+ g: number;
888
+ b: number;
889
+ }
890
+ /**
891
+ * The three lines of text composing a story.
892
+ */
893
+ export interface StoryText {
894
+ top: StoryLine;
895
+ middle: StoryLine;
896
+ bottom: StoryLine;
897
+ }
898
+ /**
899
+ * The background of a story, as sent when creating one.
900
+ */
901
+ export interface StoryBackgroundInput {
902
+ /**
903
+ * Background kind, e.g. "image".
904
+ */
905
+ type: string;
906
+ /**
907
+ * Image id, present when `type` is "image".
908
+ */
909
+ image?: string;
910
+ }
911
+ /**
912
+ * The background of a story, as returned by the view list.
913
+ */
914
+ export interface StoryBackground {
915
+ /**
916
+ * True when the background is an image rather than a solid color.
917
+ */
918
+ isImage: boolean;
919
+ /**
920
+ * Image id, present when `isImage` is true.
921
+ */
922
+ imageId?: string;
923
+ }
924
+ /**
925
+ * A story shown in the stories tray.
926
+ */
927
+ export interface Story {
928
+ /**
929
+ * Id of the user whose story this is.
930
+ */
931
+ userId: string;
932
+ background: StoryBackground1;
933
+ text: StoryText1;
934
+ }
935
+ /**
936
+ * The background of a story, as returned by the view list.
937
+ */
938
+ export interface StoryBackground1 {
939
+ /**
940
+ * True when the background is an image rather than a solid color.
941
+ */
942
+ isImage: boolean;
943
+ /**
944
+ * Image id, present when `isImage` is true.
945
+ */
946
+ imageId?: string;
947
+ }
948
+ /**
949
+ * The three lines of text composing a story.
950
+ */
951
+ export interface StoryText1 {
952
+ top: StoryLine;
953
+ middle: StoryLine;
954
+ bottom: StoryLine;
955
+ }
956
+ //# sourceMappingURL=types.d.ts.map