From 9587670e3301b663187645350073cbf934050f8b Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 30 Apr 2024 06:34:18 -0400 Subject: [PATCH] Remove pointless integer annotations. #190 (#260) --- copy_generated_types_from_lemmy.sh | 2 +- package.json | 2 +- src/types/ActivityId.ts | 2 +- src/types/BanFromCommunity.ts | 2 +- src/types/BanPerson.ts | 2 +- src/types/CommentAggregates.ts | 6 +++--- src/types/CommunityAggregates.ts | 16 ++++++++-------- src/types/GetComments.ts | 4 ++-- src/types/GetModlog.ts | 4 ++-- src/types/GetPersonDetails.ts | 4 ++-- src/types/GetPersonMentions.ts | 4 ++-- src/types/GetPosts.ts | 4 ++-- src/types/GetPrivateMessages.ts | 4 ++-- src/types/GetReplies.ts | 4 ++-- src/types/GetReportCountResponse.ts | 6 +++--- src/types/GetUnreadCountResponse.ts | 6 +++--- ...UnreadRegistrationApplicationCountResponse.ts | 2 +- src/types/ListCommentLikes.ts | 4 ++-- src/types/ListCommentReports.ts | 4 ++-- src/types/ListCommunities.ts | 4 ++-- src/types/ListMedia.ts | 4 ++-- src/types/ListPostLikes.ts | 4 ++-- src/types/ListPostReports.ts | 4 ++-- src/types/ListPrivateMessageReports.ts | 4 ++-- src/types/ListRegistrationApplications.ts | 4 ++-- src/types/ModlogListParams.ts | 4 ++-- src/types/PersonAggregates.ts | 4 ++-- src/types/PostAggregates.ts | 8 ++++---- src/types/PostReportView.ts | 2 +- src/types/PostView.ts | 2 +- src/types/Search.ts | 4 ++-- src/types/SiteAggregates.ts | 16 ++++++++-------- 32 files changed, 73 insertions(+), 73 deletions(-) diff --git a/copy_generated_types_from_lemmy.sh b/copy_generated_types_from_lemmy.sh index 8c5e05c..a2e1ee5 100755 --- a/copy_generated_types_from_lemmy.sh +++ b/copy_generated_types_from_lemmy.sh @@ -28,7 +28,7 @@ popd rm src/types/Sensitive.ts # Change all the bigints to numbers -find src/types -type f -name '*.ts' -exec sed -i 's/bigint/\/* integer *\/ number/g' {} + +find src/types -type f -name '*.ts' -exec sed -i 's/bigint/number/g' {} + node putTypesInIndex.js diff --git a/package.json b/package.json index 479b781..3547429 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "typedoc": "^0.25.8", "typescript": "^5.3.3" }, - "packageManager": "pnpm@9.0.1+sha256.46d50ee2afecb42b185ebbd662dc7bdd52ef5be56bf035bb615cab81a75345df", + "packageManager": "pnpm@9.0.6+sha256.0624e30eff866cdeb363b15061bdb7fd9425b17bc1bb42c22f5f4efdea21f6b3", "types": "./dist/index.d.ts", "lint-staged": { "*.{ts,tsx,js}": [ diff --git a/src/types/ActivityId.ts b/src/types/ActivityId.ts index 77411c7..c1fad6a 100644 --- a/src/types/ActivityId.ts +++ b/src/types/ActivityId.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ActivityId = /* integer */ number; +export type ActivityId = number; diff --git a/src/types/BanFromCommunity.ts b/src/types/BanFromCommunity.ts index 8f540b3..bcbf1ed 100644 --- a/src/types/BanFromCommunity.ts +++ b/src/types/BanFromCommunity.ts @@ -8,5 +8,5 @@ export interface BanFromCommunity { ban: boolean; remove_data?: boolean; reason?: string; - expires?: /* integer */ number; + expires?: number; } diff --git a/src/types/BanPerson.ts b/src/types/BanPerson.ts index d6d70c5..57195ed 100644 --- a/src/types/BanPerson.ts +++ b/src/types/BanPerson.ts @@ -6,5 +6,5 @@ export interface BanPerson { ban: boolean; remove_data?: boolean; reason?: string; - expires?: /* integer */ number; + expires?: number; } diff --git a/src/types/CommentAggregates.ts b/src/types/CommentAggregates.ts index be63154..0da21fe 100644 --- a/src/types/CommentAggregates.ts +++ b/src/types/CommentAggregates.ts @@ -3,9 +3,9 @@ import type { CommentId } from "./CommentId"; export interface CommentAggregates { comment_id: CommentId; - score: /* integer */ number; - upvotes: /* integer */ number; - downvotes: /* integer */ number; + score: number; + upvotes: number; + downvotes: number; published: string; child_count: number; } diff --git a/src/types/CommunityAggregates.ts b/src/types/CommunityAggregates.ts index b8fc455..f9da9f3 100644 --- a/src/types/CommunityAggregates.ts +++ b/src/types/CommunityAggregates.ts @@ -3,13 +3,13 @@ import type { CommunityId } from "./CommunityId"; export interface CommunityAggregates { community_id: CommunityId; - subscribers: /* integer */ number; - posts: /* integer */ number; - comments: /* integer */ number; + subscribers: number; + posts: number; + comments: number; published: string; - users_active_day: /* integer */ number; - users_active_week: /* integer */ number; - users_active_month: /* integer */ number; - users_active_half_year: /* integer */ number; - subscribers_local: /* integer */ number; + users_active_day: number; + users_active_week: number; + users_active_month: number; + users_active_half_year: number; + subscribers_local: number; } diff --git a/src/types/GetComments.ts b/src/types/GetComments.ts index e18275c..da7e51b 100644 --- a/src/types/GetComments.ts +++ b/src/types/GetComments.ts @@ -9,8 +9,8 @@ export interface GetComments { type_?: ListingType; sort?: CommentSortType; max_depth?: number; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; community_id?: CommunityId; community_name?: string; post_id?: PostId; diff --git a/src/types/GetModlog.ts b/src/types/GetModlog.ts index 449a303..11dd9e2 100644 --- a/src/types/GetModlog.ts +++ b/src/types/GetModlog.ts @@ -8,8 +8,8 @@ import type { PostId } from "./PostId"; export interface GetModlog { mod_person_id?: PersonId; community_id?: CommunityId; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; type_?: ModlogActionType; other_person_id?: PersonId; post_id?: PostId; diff --git a/src/types/GetPersonDetails.ts b/src/types/GetPersonDetails.ts index 38ffe82..ca5f1d2 100644 --- a/src/types/GetPersonDetails.ts +++ b/src/types/GetPersonDetails.ts @@ -7,8 +7,8 @@ export interface GetPersonDetails { person_id?: PersonId; username?: string; sort?: SortType; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; community_id?: CommunityId; saved_only?: boolean; } diff --git a/src/types/GetPersonMentions.ts b/src/types/GetPersonMentions.ts index f5edfed..be41920 100644 --- a/src/types/GetPersonMentions.ts +++ b/src/types/GetPersonMentions.ts @@ -3,7 +3,7 @@ import type { CommentSortType } from "./CommentSortType"; export interface GetPersonMentions { sort?: CommentSortType; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; unread_only?: boolean; } diff --git a/src/types/GetPosts.ts b/src/types/GetPosts.ts index 065837a..9da3149 100644 --- a/src/types/GetPosts.ts +++ b/src/types/GetPosts.ts @@ -7,8 +7,8 @@ import type { SortType } from "./SortType"; export interface GetPosts { type_?: ListingType; sort?: SortType; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; community_id?: CommunityId; community_name?: string; saved_only?: boolean; diff --git a/src/types/GetPrivateMessages.ts b/src/types/GetPrivateMessages.ts index 1312895..57a4074 100644 --- a/src/types/GetPrivateMessages.ts +++ b/src/types/GetPrivateMessages.ts @@ -3,7 +3,7 @@ import type { PersonId } from "./PersonId"; export interface GetPrivateMessages { unread_only?: boolean; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; creator_id?: PersonId; } diff --git a/src/types/GetReplies.ts b/src/types/GetReplies.ts index d1b3a20..bc8003b 100644 --- a/src/types/GetReplies.ts +++ b/src/types/GetReplies.ts @@ -3,7 +3,7 @@ import type { CommentSortType } from "./CommentSortType"; export interface GetReplies { sort?: CommentSortType; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; unread_only?: boolean; } diff --git a/src/types/GetReportCountResponse.ts b/src/types/GetReportCountResponse.ts index 0ffe166..f6e8e4d 100644 --- a/src/types/GetReportCountResponse.ts +++ b/src/types/GetReportCountResponse.ts @@ -3,7 +3,7 @@ import type { CommunityId } from "./CommunityId"; export interface GetReportCountResponse { community_id?: CommunityId; - comment_reports: /* integer */ number; - post_reports: /* integer */ number; - private_message_reports?: /* integer */ number; + comment_reports: number; + post_reports: number; + private_message_reports?: number; } diff --git a/src/types/GetUnreadCountResponse.ts b/src/types/GetUnreadCountResponse.ts index 781c553..a156270 100644 --- a/src/types/GetUnreadCountResponse.ts +++ b/src/types/GetUnreadCountResponse.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export interface GetUnreadCountResponse { - replies: /* integer */ number; - mentions: /* integer */ number; - private_messages: /* integer */ number; + replies: number; + mentions: number; + private_messages: number; } diff --git a/src/types/GetUnreadRegistrationApplicationCountResponse.ts b/src/types/GetUnreadRegistrationApplicationCountResponse.ts index 3ea780a..2257f54 100644 --- a/src/types/GetUnreadRegistrationApplicationCountResponse.ts +++ b/src/types/GetUnreadRegistrationApplicationCountResponse.ts @@ -1,5 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export interface GetUnreadRegistrationApplicationCountResponse { - registration_applications: /* integer */ number; + registration_applications: number; } diff --git a/src/types/ListCommentLikes.ts b/src/types/ListCommentLikes.ts index bd40667..555b0e3 100644 --- a/src/types/ListCommentLikes.ts +++ b/src/types/ListCommentLikes.ts @@ -3,6 +3,6 @@ import type { CommentId } from "./CommentId"; export interface ListCommentLikes { comment_id: CommentId; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; } diff --git a/src/types/ListCommentReports.ts b/src/types/ListCommentReports.ts index e291323..96ca96b 100644 --- a/src/types/ListCommentReports.ts +++ b/src/types/ListCommentReports.ts @@ -4,8 +4,8 @@ import type { CommunityId } from "./CommunityId"; export interface ListCommentReports { comment_id?: CommentId; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; unresolved_only?: boolean; community_id?: CommunityId; } diff --git a/src/types/ListCommunities.ts b/src/types/ListCommunities.ts index c346e54..063614b 100644 --- a/src/types/ListCommunities.ts +++ b/src/types/ListCommunities.ts @@ -6,6 +6,6 @@ export interface ListCommunities { type_?: ListingType; sort?: SortType; show_nsfw?: boolean; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; } diff --git a/src/types/ListMedia.ts b/src/types/ListMedia.ts index 618716f..1388ab0 100644 --- a/src/types/ListMedia.ts +++ b/src/types/ListMedia.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export interface ListMedia { - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; } diff --git a/src/types/ListPostLikes.ts b/src/types/ListPostLikes.ts index 0c593d7..68fb808 100644 --- a/src/types/ListPostLikes.ts +++ b/src/types/ListPostLikes.ts @@ -3,6 +3,6 @@ import type { PostId } from "./PostId"; export interface ListPostLikes { post_id: PostId; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; } diff --git a/src/types/ListPostReports.ts b/src/types/ListPostReports.ts index 951d974..a83ff95 100644 --- a/src/types/ListPostReports.ts +++ b/src/types/ListPostReports.ts @@ -3,8 +3,8 @@ import type { CommunityId } from "./CommunityId"; import type { PostId } from "./PostId"; export interface ListPostReports { - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; unresolved_only?: boolean; community_id?: CommunityId; post_id?: PostId; diff --git a/src/types/ListPrivateMessageReports.ts b/src/types/ListPrivateMessageReports.ts index c464ca2..2455b18 100644 --- a/src/types/ListPrivateMessageReports.ts +++ b/src/types/ListPrivateMessageReports.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export interface ListPrivateMessageReports { - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; unresolved_only?: boolean; } diff --git a/src/types/ListRegistrationApplications.ts b/src/types/ListRegistrationApplications.ts index 1e593f7..fbb4704 100644 --- a/src/types/ListRegistrationApplications.ts +++ b/src/types/ListRegistrationApplications.ts @@ -2,6 +2,6 @@ export interface ListRegistrationApplications { unread_only?: boolean; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; } diff --git a/src/types/ModlogListParams.ts b/src/types/ModlogListParams.ts index 85e8673..8f33b4e 100644 --- a/src/types/ModlogListParams.ts +++ b/src/types/ModlogListParams.ts @@ -10,7 +10,7 @@ export interface ModlogListParams { other_person_id?: PersonId; post_id?: PostId; comment_id?: CommentId; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; hide_modlog_names: boolean; } diff --git a/src/types/PersonAggregates.ts b/src/types/PersonAggregates.ts index 5888474..06367f7 100644 --- a/src/types/PersonAggregates.ts +++ b/src/types/PersonAggregates.ts @@ -3,6 +3,6 @@ import type { PersonId } from "./PersonId"; export interface PersonAggregates { person_id: PersonId; - post_count: /* integer */ number; - comment_count: /* integer */ number; + post_count: number; + comment_count: number; } diff --git a/src/types/PostAggregates.ts b/src/types/PostAggregates.ts index 610fcf8..8df3ef6 100644 --- a/src/types/PostAggregates.ts +++ b/src/types/PostAggregates.ts @@ -3,10 +3,10 @@ import type { PostId } from "./PostId"; export interface PostAggregates { post_id: PostId; - comments: /* integer */ number; - score: /* integer */ number; - upvotes: /* integer */ number; - downvotes: /* integer */ number; + comments: number; + score: number; + upvotes: number; + downvotes: number; published: string; newest_comment_time: string; } diff --git a/src/types/PostReportView.ts b/src/types/PostReportView.ts index 64845fe..92b224d 100644 --- a/src/types/PostReportView.ts +++ b/src/types/PostReportView.ts @@ -21,7 +21,7 @@ export interface PostReportView { hidden: boolean; creator_blocked: boolean; my_vote?: number; - unread_comments: /* integer */ number; + unread_comments: number; counts: PostAggregates; resolver?: Person; } diff --git a/src/types/PostView.ts b/src/types/PostView.ts index 6a531ef..a17cd51 100644 --- a/src/types/PostView.ts +++ b/src/types/PostView.ts @@ -20,5 +20,5 @@ export interface PostView { hidden: boolean; creator_blocked: boolean; my_vote?: number; - unread_comments: /* integer */ number; + unread_comments: number; } diff --git a/src/types/Search.ts b/src/types/Search.ts index d46b0df..da9817e 100644 --- a/src/types/Search.ts +++ b/src/types/Search.ts @@ -13,6 +13,6 @@ export interface Search { type_?: SearchType; sort?: SortType; listing_type?: ListingType; - page?: /* integer */ number; - limit?: /* integer */ number; + page?: number; + limit?: number; } diff --git a/src/types/SiteAggregates.ts b/src/types/SiteAggregates.ts index bdd7c6d..516b9d5 100644 --- a/src/types/SiteAggregates.ts +++ b/src/types/SiteAggregates.ts @@ -3,12 +3,12 @@ import type { SiteId } from "./SiteId"; export interface SiteAggregates { site_id: SiteId; - users: /* integer */ number; - posts: /* integer */ number; - comments: /* integer */ number; - communities: /* integer */ number; - users_active_day: /* integer */ number; - users_active_week: /* integer */ number; - users_active_month: /* integer */ number; - users_active_half_year: /* integer */ number; + users: number; + posts: number; + comments: number; + communities: number; + users_active_day: number; + users_active_week: number; + users_active_month: number; + users_active_half_year: number; }