[fix] reorganize the typing files
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { SearchIndex } from "@/lib/search";
|
||||
import { isEmptyString } from "@/lib/utils";
|
||||
import type { TSearchResultItem } from "@/types/search-result";
|
||||
import type { TSearchResultItem } from "@/types/docs.type";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
type ResponseData = TSearchResultItem[];
|
||||
|
||||
@@ -13,9 +13,8 @@ import { Config } from "@/data/config";
|
||||
import { normalizeDate } from "@/lib/date";
|
||||
import { getPostFileContent, sortedPosts } from "@/lib/post-process";
|
||||
import { makeTOCTree } from "@/lib/toc";
|
||||
import type { TFrontmatter } from "@/types/frontmatter.type";
|
||||
import type { TPostListItem } from "@/types/post-list";
|
||||
import type { TTOCItem } from "@/types/toc.type";
|
||||
import type { TPostFrontmatter } from "@/types/frontmatter.type";
|
||||
import type { TPostListItem, TTOCItem } from "@/types/docs.type";
|
||||
import { nanoid } from "nanoid";
|
||||
import type { GetStaticPaths, GetStaticProps } from "next";
|
||||
import { MDXRemote, type MDXRemoteSerializeResult } from "next-mdx-remote";
|
||||
@@ -36,7 +35,7 @@ import { titleCase } from "title-case";
|
||||
type ReaderPageProps = {
|
||||
compiledSource: MDXRemoteSerializeResult;
|
||||
tocList: TTOCItem[];
|
||||
frontMatter: TFrontmatter;
|
||||
frontMatter: TPostFrontmatter;
|
||||
postId: string;
|
||||
nextPostListItem: TPostListItem | null;
|
||||
prevPostListItem: TPostListItem | null;
|
||||
@@ -205,7 +204,7 @@ export const getStaticProps: GetStaticProps<ReaderPageProps> = async (context) =
|
||||
|
||||
const postIndexInAllPosts = sortedPosts.allPostList.findIndex((item) => item.id === postId);
|
||||
|
||||
const frontMatter: TFrontmatter = sortedPosts.allPostList[postIndexInAllPosts].frontMatter;
|
||||
const frontMatter: TPostFrontmatter = sortedPosts.allPostList[postIndexInAllPosts].frontMatter;
|
||||
|
||||
const nextPostListItem =
|
||||
postIndexInAllPosts !== sortedPosts.allPostList.length - 1
|
||||
|
||||
@@ -10,7 +10,7 @@ import { LatestPostCountInHomePage } from "@/consts/consts";
|
||||
import { Config } from "@/data/config";
|
||||
import { sortedPosts } from "@/lib/post-process";
|
||||
import { generateRSSFeed } from "@/lib/rss";
|
||||
import type { TPostListItem } from "@/types/post-list";
|
||||
import type { TPostListItem } from "@/types/docs.type";
|
||||
import type { GetStaticProps } from "next";
|
||||
import Link from "next/link";
|
||||
import { LuPenTool } from "react-icons/lu";
|
||||
|
||||
@@ -11,7 +11,7 @@ import { PostCountPerPagination } from "@/consts/consts";
|
||||
import { Config } from "@/data/config";
|
||||
import { sortedPosts } from "@/lib/post-process";
|
||||
import { isEmptyArray, paginateArray } from "@/lib/utils";
|
||||
import type { TPostListItem } from "@/types/post-list";
|
||||
import type { TPostListItem } from "@/types/docs.type";
|
||||
import { nanoid } from "nanoid";
|
||||
import type { GetStaticPaths, GetStaticProps } from "next";
|
||||
import Link from "next/link";
|
||||
|
||||
@@ -8,7 +8,7 @@ import { NavBar } from "@/components/utils/NavBar";
|
||||
import { SEO } from "@/components/utils/SEO";
|
||||
import { Config } from "@/data/config";
|
||||
import { isEmptyString } from "@/lib/utils";
|
||||
import type { TSearchResultItem } from "@/types/search-result";
|
||||
import type { TSearchResultItem } from "@/types/docs.type";
|
||||
import axios from "axios";
|
||||
import { isArray } from "lodash";
|
||||
import { nanoid } from "nanoid";
|
||||
|
||||
@@ -10,7 +10,7 @@ import { PostCountPerPagination } from "@/consts/consts";
|
||||
import { Config } from "@/data/config";
|
||||
import { sortedPosts } from "@/lib/post-process";
|
||||
import { paginateArray } from "@/lib/utils";
|
||||
import type { TPostListItem } from "@/types/post-list";
|
||||
import type { TPostListItem } from "@/types/docs.type";
|
||||
import type { GetStaticPaths, GetStaticProps } from "next";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
Reference in New Issue
Block a user