TypeScript-我可以实现一个模块吗?

时间:2020-07-21 10:05:35

标签: typescript module interface declaration implements

假设我有一个名为ModuleA的模块,

export interface Ia {
    methodA(a: number): string;
    varA: number;
}

export class B {

    constructor(content?: string | any) {

    }

    public get content(): string {
        return "";
    }

}

export enum C {
    Ca,
    Cb,
}

export namespace D {
    export const MAX_INTEGER_VALUE: number = 2147483647;
    export const E = new B();
}

export function equals(objA: any, objB: any): boolean {
    return true;
}

是否有一种方法可以使用此ModuleA“作为接口”,以便另一个模块(模块B)可以来实现并提供其实现? (即,实现任何现有类成员(在此示例中为B类及其方法)和函数(在此示例中为fun)的实现。

0 个答案:

没有答案
相关问题