diff --git a/frontend/src/components/Markdown/types/rehype-components/index.d.ts b/frontend/src/@types/rehype-components/index.d.ts similarity index 100% rename from frontend/src/components/Markdown/types/rehype-components/index.d.ts rename to frontend/src/@types/rehype-components/index.d.ts diff --git a/frontend/src/@types/unist-util-find/index.d.ts b/frontend/src/@types/unist-util-find/index.d.ts new file mode 100644 index 0000000..255d73d --- /dev/null +++ b/frontend/src/@types/unist-util-find/index.d.ts @@ -0,0 +1,9 @@ +import { Node } from 'unist' +import { Text, Element, Comment } from 'hast' + +declare const find: ( + node: Element | Node, + condition: string | Object | Function, +) => Element | Text | Comment + +export = find diff --git a/frontend/src/boot.ts b/frontend/src/boot.ts index a854073..854a64c 100644 --- a/frontend/src/boot.ts +++ b/frontend/src/boot.ts @@ -1,6 +1,6 @@ import { store } from '@/store' import { ACCESS_TOKEN_NAME, BLOG_CONFIG, USER_INFO_NAME } from '@/utils/const' -import { Option } from 'utils/Request/Option' +import { Option } from './utils/Request/Option' // 初始化store const { dispatch } = store diff --git a/frontend/src/components/Markdown/types/README.md b/frontend/src/components/Markdown/types/README.md deleted file mode 100644 index 624f10a..0000000 --- a/frontend/src/components/Markdown/types/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# 警告 - -由于 某些模块 官方不支持 ts -请将各文件夹下的`index.d.ts`文件复制到`frontend/node_modules/模块名`文件夹下以支持 ts diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 5fbdb0c..83f0362 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -28,7 +28,8 @@ // "jsxImportSource": "hastscript", "baseUrl": "./src", "paths": { - "@/*": ["./*"] + "@/*": ["./*"], + "*": ["./@types/*"] } }, "include": ["src"]