import { IPaginatedResult, TextDirection } from "../../shared-types"; import { LeanBlogDocument } from "../models/Blog"; export type BlogInPaginatedResponse = Omit & { upvotes: number; downvotes: number; }; export type BlogInResponse = Omit & { isUpvotedByUser: boolean; isDownvotedByUser: boolean; upvotes: number; downvotes: number; }; export type BlogsRouteTypes = { "/blogs/": { GET: { query: { "sort-direction"?: string; page?: string; "sort-field"?: string; limit?: string; keyword?: string; }; response: IPaginatedResult; }; POST: { body: Omit; response: string; }; }; "/blogs/:slug": { GET: { response: { blog: BlogInResponse & { nextLink: string; previousLink: string; }; relatedBlogs: BlogInPaginatedResponse[]; }; params: { slug: string; }; }; PUT: { body: { banner?: { key: string; type: string; name: string; _id: string; url: string; }; title?: string; description?: string; metaDescription?: string; content?: string; secondaryCategories?: { _id: string; slug: string; }[]; mainCategory?: { _id: string; slug: string; }; textDirection?: TextDirection; }; response: { slug: string; }; params: { slug: string; }; }; DELETE: { response: string; params: { slug: string; }; }; }; "/blogs/static-paths": { GET: { response: Array; }; }; "/blogs/grouped": { GET: { response: { recents: BlogInPaginatedResponse[]; }; }; }; "/blogs/by-category": { GET: { query: { page?: string; limit?: string; slug?: string; }; response: IPaginatedResult; }; }; "/blogs/upvote/:slug": { PUT: { response: string; params: { slug: string; }; }; }; "/blogs/downvote/:slug": { PUT: { response: string; params: { slug: string; }; }; }; "/blogs/clap/:slug": { PUT: { response: string; params: { slug: string; }; }; }; "/blogs/remove-vote/:slug": { PUT: { response: string; params: { slug: string; }; }; }; "/blogs/featured": { GET: { response: { items: Array; }; }; }; "/blogs/score/:slug": { GET: { response: { upvotes: number; downvotes: number; claps: number; isUpvotedByUser: boolean; isDownvotedByUser: boolean; }; params: { slug: string; }; }; }; };