📜  typescript 扩展导入的命名空间 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:14.055000             🧑  作者: Mango

代码示例1
// We can import a namespace in a non-declaration .ts, and export it again as a extended type:

// custom-fc.ts : enhances declaration of FC namespace
import * as origFC from "fullcalendar";

declare namespace Complimentary {
    class TimeGrid {
        prepareHits(): void;
    }
    let views: any;
}

// apply additional types to origFc and export again
export const FC: (typeof Complimentary & typeof origFC) = origFC as any;