[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

23
types/docs.type.ts Normal file
View File

@@ -0,0 +1,23 @@
import type { TPostFrontmatter } from "./frontmatter.type";
export type TPostListItem = {
id: string;
frontMatter: TPostFrontmatter;
};
export type TPostsByTag = {
[tagName: string]: TPostListItem[];
};
export type TSearchResultItem = {
id: string;
title: string;
summary: string | null;
tags: string[] | null;
};
export type TTOCItem = {
level: number;
title: string;
anchorId: string;
};

View File

@@ -1,9 +1,7 @@
import type { NonEmptyArray } from "./utils.type";
export type TFrontmatter = {
export type TPostFrontmatter = {
title: string;
time: string;
tags: NonEmptyArray<string> | null;
tags: string[] | null;
subtitle: string | null;
summary: string | null;
coverURL: string | null;

View File

@@ -1,10 +0,0 @@
import type { TFrontmatter } from "./frontmatter.type";
export type TPostListItem = {
id: string;
frontMatter: TFrontmatter;
};
export type TPostsByTag = {
[tagName: string]: TPostListItem[];
};

View File

@@ -1,6 +0,0 @@
export type TSearchResultItem = {
id: string;
title: string;
summary: string | null;
tags: string[] | null;
};

View File

@@ -1,5 +0,0 @@
export type TTOCItem = {
level: number;
title: string;
anchorId: string;
};

View File

@@ -1 +0,0 @@
export type NonEmptyArray<T> = [T, ...T[]];