[fix] reorganize the typing files
This commit is contained in:
23
types/docs.type.ts
Normal file
23
types/docs.type.ts
Normal 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;
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import type { TFrontmatter } from "./frontmatter.type";
|
||||
|
||||
export type TPostListItem = {
|
||||
id: string;
|
||||
frontMatter: TFrontmatter;
|
||||
};
|
||||
|
||||
export type TPostsByTag = {
|
||||
[tagName: string]: TPostListItem[];
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
export type TSearchResultItem = {
|
||||
id: string;
|
||||
title: string;
|
||||
summary: string | null;
|
||||
tags: string[] | null;
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
export type TTOCItem = {
|
||||
level: number;
|
||||
title: string;
|
||||
anchorId: string;
|
||||
};
|
||||
@@ -1 +0,0 @@
|
||||
export type NonEmptyArray<T> = [T, ...T[]];
|
||||
Reference in New Issue
Block a user