Closed Revest117 closed 2 years ago
File: example/control/ObjectPageLayout.ts
import SAPObjectPageLayout from "sap/uxap/ObjectPageLayout"; import SAPObjectPageLayoutRenderer from "sap/uxap/ObjectPageLayoutRenderer"; /** * @namespace example.control */ export default class ObjectPageLayout extends SAPObjectPageLayout { constructor(idOrSettings?: string | $ObjectPageLayoutSettings); constructor(id?: string, settings?: $ObjectPageLayoutSettings); constructor(id?: string, settings?: $ObjectPageLayoutSettings) { super(id, settings); } static readonly metadata = { "properties": { "example": { "type": "string" } } }; renderer = SAPObjectPageLayoutRenderer; }
The generated gen.d.ts File
import { $ObjectPageLayoutSettings } from "sap/uxap/ObjectPageLayout"; declare module "./ObjectPageLayout" { /** * Interface defining the settings object used in constructor calls */ interface $ObjectPageLayoutSettings extends $ObjectPageLayoutSettings { example?: string; } export default interface ObjectPageLayout { // property: example getExample(): string; setExample(example: string): this; } }
The ts error:
Type '$ObjectPageLayoutSettings' has no properties in common with type '$ObjectPageLayoutSettings'.ts(2559)
One solution could be to prefix the interfaces of the gen.d.ts file with a _ or other symbol to avoid naming problems:
import { $ObjectPageLayoutSettings } from "sap/uxap/ObjectPageLayout"; declare module "./ObjectPageLayout" { /** * Interface defining the settings object used in constructor calls */ interface $_ObjectPageLayoutSettings extends $ObjectPageLayoutSettings { example?: string; } export default interface ObjectPageLayout { // property: example getExample(): string; setExample(example: string): this; } }
import SAPObjectPageLayout from "sap/uxap/ObjectPageLayout"; import SAPObjectPageLayoutRenderer from "sap/uxap/ObjectPageLayoutRenderer"; /** * @namespace example.control */ export default class ObjectPageLayout extends SAPObjectPageLayout { constructor(idOrSettings?: string | $_ObjectPageLayoutSettings); constructor(id?: string, settings?: $_ObjectPageLayoutSettings); constructor(id?: string, settings?: $_ObjectPageLayoutSettings) { super(id, settings); } static readonly metadata = { "properties": { "example": { "type": "string" } } }; renderer = SAPObjectPageLayoutRenderer; }
Thanks for reporting! Will be fixed in the next release (with a "_1" suffix).
Regards Andreas
...which was just published: 0.5.0
File: example/control/ObjectPageLayout.ts
The generated gen.d.ts File
The ts error:
One solution could be to prefix the interfaces of the gen.d.ts file with a _ or other symbol to avoid naming problems: