TypeScript中的部分类

6

files.ts

export class ServiceUrls {
 static baseUrl: string = 'http://localhost:52949/V1/';
    static baseImageUrl: string = 'http://localhost:52949/';
}

filess1.ts

extends interface  ServiceUrls{
 static baseUrl: string = 'http://localhost:52949/V1/';
    static baseImageUrl: string = 'http://localhost:52949/';
}

如何在TypeScript中实现局部类。 我应该如何引用同一类以使其像局部类一样工作。如果我在files1.ts中给出相同的类名,它会报错声明或语句预期。

https://github.com/Microsoft/TypeScript/issues/563 - user581157
2
可能是如何将TypeScript类拆分为多个文件?的重复问题。 - 8eecf0d2
1个回答

2

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接