- declare module '#utils' {
- // 在这里定义模块的类型
- // 例如,如果模块导出一个函数,可以这样定义:
- export function someUtilityFunction(arg: string): number;
- // 如果模块导出多个内容,可以使用命名导出
- export interface UtilityOptions {
- optionA: string;
- optionB: number;
- }
- // 如果模块有默认导出
- const defaultExport: UtilityOptions;
- export default defaultExport;
- }
|