您好,我遇到了 TypeScript 问题。我有以下目录结构:
The file server/tsconfig.json contains the lines
"compilerOptions": {
"typeRoots": [
"../node_modules/@types",
"./typings"
],
...
"include": [
"./*.ts",
"./typings/**/*.ts"
],
Run Code Online (Sandbox Code Playgroud)
I import an un-typed JavaScript function in TypeScript in the file server/index.ts:
import { handler } from '../build/handler.js'
... (code using handler) ...
Run Code Online (Sandbox Code Playgroud)
The file server/typings/handler/index.d.ts contains
declare module …Run Code Online (Sandbox Code Playgroud)