From 032c2841d448657be37d88def22bb1d2b5615186 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 17 Apr 2023 14:02:47 +0800 Subject: [PATCH] chore: fix module delcare ts problem --- app/api/utils/common.ts | 1 - app/global.d.ts | 2 ++ tsconfig.json | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 app/global.d.ts diff --git a/app/api/utils/common.ts b/app/api/utils/common.ts index 2330499..e276dfa 100644 --- a/app/api/utils/common.ts +++ b/app/api/utils/common.ts @@ -4,7 +4,6 @@ import { ChatClient } from 'langgenius-client' import uuid from 'uuid' const userPrefix = `user_${APP_ID}:`; -// const uuid = require('uuid') export const getInfo = (request: NextRequest) => { const sessionId = request.cookies.get('session_id')?.value || uuid.v4(); diff --git a/app/global.d.ts b/app/global.d.ts new file mode 100644 index 0000000..337e84b --- /dev/null +++ b/app/global.d.ts @@ -0,0 +1,2 @@ +declare module 'langgenius-client'; +declare module 'uuid'; diff --git a/tsconfig.json b/tsconfig.json index c3e0bca..668a47e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -31,6 +31,7 @@ }, "include": [ "next-env.d.ts", + "global.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", @@ -39,4 +40,4 @@ "exclude": [ "node_modules" ] -} +} \ No newline at end of file