【发布时间】:2019-10-16 17:50:11
【问题描述】:
我有一个这样的界面:
x.ts:
namespace Basex {
export interface AddressDto {
AddressDetail?: string;
AddressName?: string;
AddressType?: number;
City?: string;
CityCode?: number;
CountryCode?: number;
DexjustizCode?: string;
District?: string;
HouseNumber?: number;
HouseNumberDetail?: string;
Id?: number;
IsMainAddress?: boolean;
LastAddressInterval?: string;
Street?: string;
Text?: string;
Town?: string;
ValidationLevel?: number;
ValidityEndDate?: Date;
ValidityStartDate?: Date;
}
}
// I use this object on my screen in this way;
const {Basex} = require('../../src/model/dto/x');
我可以像这样访问AddressDto Basex.AddressDto
但我无法从另一个依赖项目访问此命名空间。我已经尝试使用上述方法在依赖项目的index.ts中导出。但它不可能。很快如何从另一个依赖项访问这个命名空间的接口?
【问题讨论】:
标签: reactjs typescript interface namespaces typescript-typings