Javascript 我不能在另一个模块中使用我的.d.ts文件,模块有问题
我在将.d.ts文件链接到另一个.d.ts文件时遇到问题。它返回以下错误: 模块“./consts”没有导出的成员“设备”。你是说 “设备” 我试图找出TS文档中缺少的内容,但没有找到答案。我用导出的const设备得到了同一个名为const.ts的文件 我的代码如下所示: 常数d.tsJavascript 我不能在另一个模块中使用我的.d.ts文件,模块有问题,javascript,typescript,next.js,Javascript,Typescript,Next.js,我在将.d.ts文件链接到另一个.d.ts文件时遇到问题。它返回以下错误: 模块“./consts”没有导出的成员“设备”。你是说 “设备” 我试图找出TS文档中缺少的内容,但没有找到答案。我用导出的const设备得到了同一个名为const.ts的文件 我的代码如下所示: 常数d.ts declare module "@utils/Queries/consts" export type Devices = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
declare module "@utils/Queries/consts"
export type Devices = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
declare const QUERIES: {
XS: 'xs',
SM: 'sm',
MD: 'md',
LG: 'lg',
XL: 'xl'
}
import { Interpolation } from 'styled-components'
import { Devices } from './consts'
declare module '@utils/Queries/query'
type QueryFunction = (style: Interpolation<any>) => Interpolation<any>
declare const MediaQuery: { [key in Devices]: QueryFunction };
declare const getBreakpointWidth: (name: string) => string;
export { MediaQuery, MediaQuery as default, getBreakpointWidth };
现在我想调用index.d.ts中的设备类型,我得到了上面写的错误
索引d.ts
declare module "@utils/Queries/consts"
export type Devices = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
declare const QUERIES: {
XS: 'xs',
SM: 'sm',
MD: 'md',
LG: 'lg',
XL: 'xl'
}
import { Interpolation } from 'styled-components'
import { Devices } from './consts'
declare module '@utils/Queries/query'
type QueryFunction = (style: Interpolation<any>) => Interpolation<any>
declare const MediaQuery: { [key in Devices]: QueryFunction };
declare const getBreakpointWidth: (name: string) => string;
export { MediaQuery, MediaQuery as default, getBreakpointWidth };