@ui5/dts-generator
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -6,2 +6,8 @@ # Change Log | ||
# [2.2.0](https://github.com/SAP/ui5-typescript/compare/v2.1.0...v2.2.0) (2021-02-16) | ||
### Features | ||
- export replacement interfaces for module declaration ([#222](https://github.com/SAP/ui5-typescript/issues/222)) ([1a5dc02](https://github.com/SAP/ui5-typescript/commit/1a5dc02adfd0dc44f4c3fd53bcd371079cb20bfd)) | ||
# [2.1.0](https://github.com/SAP/ui5-typescript/compare/v2.0.6...v2.1.0) (2021-01-28) | ||
@@ -8,0 +14,0 @@ |
@@ -276,2 +276,5 @@ require("lodash.combinations"); | ||
parent: currNS, | ||
// indicator to remember that this interface | ||
// has been created from a namespace originally | ||
isNamespace: true, | ||
}; | ||
@@ -278,0 +281,0 @@ }); |
@@ -186,2 +186,23 @@ const _ = require("lodash"); | ||
text += "}"; | ||
/* | ||
* In order to export namespaces converted to interfaces as | ||
* modules we need to assign those mapped interfaces to const | ||
* | ||
* The following snippet shows how such an interface needs | ||
* to be defined to re-export it as module: | ||
* | ||
* interface BusyIndicator { | ||
* [...] | ||
* } | ||
* export const BusyIndicator: BusyIndicator; | ||
* | ||
* The following snippet shows how the re-export as module | ||
* can be done: | ||
* | ||
* declare module "sap/ui/core/BusyIndicator" { export default sap.ui.core.BusyIndicator; } | ||
* | ||
*/ | ||
if (ast.isNamespace) { | ||
text += NL + `export const ${ast.name}: ${ast.name};`; | ||
} | ||
return text; | ||
@@ -188,0 +209,0 @@ } |
{ | ||
"name": "@ui5/dts-generator", | ||
"description": "Generates TypeScript Definitions from UI5 api.json files", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"license": "Apache-2.0", | ||
@@ -32,3 +32,3 @@ "repository": { | ||
}, | ||
"gitHead": "0b2f9616ef3fd6344a726049e63cdd81be5b3e0c" | ||
"gitHead": "6072acd9337f9ad75d80b627331c8e13c6b4af75" | ||
} |
@@ -90,2 +90,3 @@ type UI5Visibility = "restricted" | "protected" | "public" | undefined; | ||
visibility: UI5Visibility; | ||
isNamespace?: boolean; | ||
} | ||
@@ -92,0 +93,0 @@ |
Sorry, the diff of this file is not supported yet
88478
2052