Updating types from lemmy. (#209)

This commit is contained in:
Dessalines 2023-10-31 09:00:44 -04:00 committed by GitHub
parent c47102bfb1
commit 991af27e42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 9 additions and 15 deletions

View File

@ -1,5 +1,8 @@
#!/bin/bash
# Remove the old types
rm -rf src/types/*
# Remove the old bindings
pushd ../lemmy/crates
rm -rf **/bindings
@ -29,5 +32,5 @@ find src/types -type f -name '*.ts' -exec sed -i 's/bigint/\/* integer *\/ numbe
node putTypesInIndex.js
prettier -w src/types src/index.ts
prettier -w src

View File

@ -125,7 +125,7 @@ import {
UploadImage,
UploadImageResponse,
VERSION,
} from "./types/others";
} from "./other_types";
import { HideCommunity } from "./types/HideCommunity";
import { BlockInstance } from "./types/BlockInstance";
import { BlockInstanceResponse } from "./types/BlockInstanceResponse";

View File

@ -179,7 +179,6 @@ export { PersonMention } from "./types/PersonMention";
export { PersonMentionId } from "./types/PersonMentionId";
export { PersonMentionResponse } from "./types/PersonMentionResponse";
export { PersonMentionView } from "./types/PersonMentionView";
export { PersonSortType } from "./types/PersonSortType";
export { PersonView } from "./types/PersonView";
export { Post } from "./types/Post";
export { PostAggregates } from "./types/PostAggregates";
@ -243,4 +242,4 @@ export {
UploadImageResponse,
ImageFile,
DeleteImage,
} from "./types/others";
} from "./other_types";

View File

@ -13,6 +13,7 @@ export interface CommentView {
community: Community;
counts: CommentAggregates;
creator_banned_from_community: boolean;
creator_is_moderator: boolean;
subscribed: SubscribedType;
saved: boolean;
creator_blocked: boolean;

View File

@ -148,4 +148,5 @@ export type LemmyErrorType =
| { error: "community_has_no_followers" }
| { error: "ban_expiration_in_past" }
| { error: "invalid_unix_time" }
| { error: "invalid_bot_action" }
| { error: "unknown"; message: string };

View File

@ -5,7 +5,5 @@ export interface PersonAggregates {
id: number;
person_id: PersonId;
post_count: /* integer */ number;
post_score: /* integer */ number;
comment_count: /* integer */ number;
comment_score: /* integer */ number;
}

View File

@ -1,9 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type PersonSortType =
| "New"
| "Old"
| "MostComments"
| "CommentScore"
| "PostScore"
| "PostCount";

View File

@ -10,6 +10,7 @@ export interface PostView {
creator: Person;
community: Community;
creator_banned_from_community: boolean;
creator_is_moderator: boolean;
counts: PostAggregates;
subscribed: SubscribedType;
saved: boolean;