From ngps at objectmemetic.com Mon Nov 7 10:00:41 2022 From: ngps at objectmemetic.com (Ng Pheng Siong) Date: Mon, 7 Nov 2022 17:00:41 +0800 Subject: [Pas2js] dts2pas cannot handle plain interfaces Message-ID: <20221107090041.GC78383@localhost.localdomain> Hi Michael and all, I've used dts2pas to create a Pascal unit for OnsenUI. It seems dts2pas currently does not support 'plain' interfaces. Line 1237 of onsenui.d.ts declares following: interface OnsListElement extends HTMLElement { } Then, from line 1283 onwards: interface OnsOptions { parentScope?: Object; } interface AlertOptions { } In the output generated by dts2pas, class TOnsListItemElement exists, corresponding to the line 1237 declaration mentioned above, but the 'plain' interfaces OnsOptions and so on aren't generated. The Pascal source fails to compile: Pas2JS Compiler version 2.3.1 [2022/10/05] for Linux x86_64 Copyright (c) 2022 Free Pascal team. units/onsenui.pas(14,14) Error: Forward type not resolved "TOnsOptions" Fatal: Compilation aborted OnsenUI is v2.12.6, installed by npm. pas2js is this version: commit 426000efcd3ddeb3b3dc0649cb30f9e3aa82b9c3 (HEAD -> main, origin/main, origin/HEAD) Author: Micha?l Van Canneyt Date: Tue Oct 4 09:41:27 2022 +0200 * Reinstate check for non-empty text content Is this expected to work? Should I raise an issue in Gitlab? Pheng From michael at freepascal.org Mon Nov 7 11:06:08 2022 From: michael at freepascal.org (Michael Van Canneyt) Date: Mon, 7 Nov 2022 11:06:08 +0100 (CET) Subject: [Pas2js] dts2pas cannot handle plain interfaces In-Reply-To: <20221107090041.GC78383@localhost.localdomain> References: <20221107090041.GC78383@localhost.localdomain> Message-ID: On Mon, 7 Nov 2022, Ng Pheng Siong via Pas2js wrote: > Hi Michael and all, > > I've used dts2pas to create a Pascal unit for OnsenUI. It seems dts2pas > currently does not support 'plain' interfaces. Line 1237 of onsenui.d.ts declares > following: > > interface OnsListElement extends HTMLElement { > > } > > Then, from line 1283 onwards: > > interface OnsOptions { > parentScope?: Object; > } > > interface AlertOptions { > > } > > In the output generated by dts2pas, class TOnsListItemElement exists, corresponding to > the line 1237 declaration mentioned above, but the 'plain' interfaces OnsOptions and so on > aren't generated. The Pascal source fails to compile: > > Pas2JS Compiler version 2.3.1 [2022/10/05] for Linux x86_64 > Copyright (c) 2022 Free Pascal team. > units/onsenui.pas(14,14) Error: Forward type not resolved "TOnsOptions" > Fatal: Compilation aborted > > OnsenUI is v2.12.6, installed by npm. pas2js is this version: > > commit 426000efcd3ddeb3b3dc0649cb30f9e3aa82b9c3 (HEAD -> main, origin/main, origin/HEAD) > Author: Micha?l Van Canneyt > Date: Tue Oct 4 09:41:27 2022 +0200 > > * Reinstate check for non-empty text content > > Is this expected to work? Should I raise an issue in Gitlab? This is supposed to work, so yes, please file an issue. In your issue, please include a link to the OnsenUI dts (or the dts itself), so I don't need to search for it :-) Michael.