[fix] reorganize the typing files

This commit is contained in:
PrinOrange
2024-09-26 16:48:47 +08:00
parent 7e7b86c1e5
commit f00a79fcf3
19 changed files with 49 additions and 50 deletions

View File

@@ -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[];

View File

@@ -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

View File

@@ -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";

View File

@@ -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";

View File

@@ -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";

View File

@@ -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";