[Pas2js] dts2pas cannot handle plain interfaces
Michael Van Canneyt
michael at freepascal.org
Mon Nov 7 11:06:08 CET 2022
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 {
> <stuff>
> }
>
> Then, from line 1283 onwards:
>
> interface OnsOptions {
> parentScope?: Object;
> }
>
> interface AlertOptions {
> <stuff>
> }
>
> 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 <michael at freepascal.org>
> 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.
More information about the Pas2js
mailing list