【发布时间】:2023-03-09 19:14:01
【问题描述】:
我有一个名为CarType 的枚举,它位于一个名为CarType.ts 的文件中。代码如下:
namespace MyProduct.Search {
export enum CarType {
Sedan = 0,
Wagon = 1,
Cabrio = 2,
/* etc */
}
}
在同一目录下的另一个名为SearchMain.ts 的文件中,我有以下代码:
/// <reference path="../../d.ts/jquery.d.ts" />
/// <reference path="../../d.ts/knockout.d.ts" />
/// <reference path="../../d.ts/fullcalendar.d.ts" />
namespace MyProduct.Search {
export module SearchMain {
export function Init() {
/* snip */
let type: CarType = CarType.Sedan;
}
/* snip */
}
}
在我尝试导入完整日历类型之前,上述工作正常。只要我在/// reference 行下方添加以下行
import { EventObjectInput } from 'fullcalendar/src/types/input-types';
CarType 变得不可用。 Intellisense 错误为Property 'CarType' does not exist on type 'typeof Search'。
如何将完整日历中的 EventObjectInput 与我的代码一起使用?
【问题讨论】:
标签: typescript