mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 16:33:49 +00:00
feat: 类型声明
This commit is contained in:
@@ -25,7 +25,8 @@ const Markdown = ({ source, isChatting }: { source: string; isChatting: boolean
|
||||
pre: 'div',
|
||||
code({ node, inline, className, children, ...props }) {
|
||||
const match = /language-(\w+)/.exec(className || '');
|
||||
const code = String(children).replace(/\n$/, '');
|
||||
const code = String(children);
|
||||
|
||||
return !inline || match ? (
|
||||
<Box my={3} borderRadius={'md'} overflow={'hidden'} backgroundColor={'#222'}>
|
||||
<Flex
|
||||
@@ -53,7 +54,7 @@ const Markdown = ({ source, isChatting }: { source: string; isChatting: boolean
|
||||
</Box>
|
||||
) : (
|
||||
<code className={className} {...props}>
|
||||
{children}
|
||||
{code}
|
||||
</code>
|
||||
);
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import mongoose, { Mongoose } from 'mongoose';
|
||||
import mongoose from 'mongoose';
|
||||
|
||||
/**
|
||||
* 连接 MongoDB 数据库
|
||||
|
7
src/types/index.d.ts
vendored
7
src/types/index.d.ts
vendored
@@ -1,9 +1,6 @@
|
||||
import type { Mongoose } from 'mongoose';
|
||||
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface Global {
|
||||
mongodb: Mongoose | string;
|
||||
}
|
||||
}
|
||||
var mongodb: Mongoose | string | null;
|
||||
}
|
||||
export {};
|
||||
|
Reference in New Issue
Block a user