zspitz / ts-activex-gen

Library + UI for generating Typescript definitions / DefinitelyTyped packages from COM type libraries / LibreOffice Doxygen XML
MIT License
12 stars 4 forks source link

Handle conflicting base interface declarations #76

Closed zspitz closed 7 years ago

zspitz commented 7 years ago

Given the following conflicting definitions between XLayoutConstrains.getMinimumSize and XTextLayoutConstrains.getMinimumSize:

interface UnoControlEdit extends UnoControl, XTextComponent, XLayoutConstrains, XTextLayoutConstrains { }
interface XLayoutConstrains {
    getMinimumSize(): Size;
}
interface XTextLayoutConstrains {
    getMinimumSize(nCols: number, nLines: number): Size;
}

the compiler gives the following error:

severity: 'Error' message: 'Interface 'UnoControlEdit' cannot simultaneously extend types 'XLayoutConstrains' and 'XTextLayoutConstrains'. Named property 'getMinimumSize' of types 'XLayoutConstrains' and 'XTextLayoutConstrains' are not identical.'

The solution is to:

zspitz commented 7 years ago

This algorithm is implemented, but some members were not found / cloned. For the rest, there is code that clones these methods individually.