refactor: Continue refactoring after migrating to rsbuild
This commit is contained in:
120 files changed
+751
-483
No files matched your search
@@ -9,11 +9,23 @@ export interface Article {
|
||||
updatedDate?: Date;
|
||||
tags?: string[];
|
||||
image?: string;
|
||||
Component: React.ComponentType<{ components?: Record<string, React.ComponentType<any>> }>;
|
||||
Component: React.ComponentType<{ components?: Record<string, React.ComponentType<unknown>> }>;
|
||||
}
|
||||
|
||||
function register(module: any, slug: string): Article {
|
||||
const { frontmatter, default: Component } = module;
|
||||
interface MdxModule {
|
||||
frontmatter: {
|
||||
title: string;
|
||||
description?: string;
|
||||
createdDate: string;
|
||||
updatedDate?: string;
|
||||
tags?: string[];
|
||||
image?: string;
|
||||
};
|
||||
default: React.ComponentType<{ components?: Record<string, React.ComponentType<unknown>> }>;
|
||||
}
|
||||
|
||||
function register(module: unknown, slug: string): Article {
|
||||
const { frontmatter, default: Component } = module as MdxModule;
|
||||
return {
|
||||
slug,
|
||||
title: frontmatter.title,
|
||||
|
||||
Reference in new issue
Block a user