Hugo,
    If you are using the @externs in the class comments, use a native on 
function and it will ignore its requirement to actually have a body.  It can 
remain just a declaration.  The other thing that caused us problems in the 
beginning is we needed a change to the release compilation properties to 
optimize only the whitespace, because it was mangling our external namespaces 
if not.

public native static function getDocumentAsPDF():Object;

r/s
-Mark K

-----Original Message-----
From: Maria Jose Esteve <[email protected]> 
Sent: Sunday, October 24, 2021 07:32
To: [email protected]
Subject: [Non-DoD Source] RE: Externs that returns a value instead of void 
method

If you want I have several projects with externs that you could look at to see 
different wrappers.
Depending on how the JS library is set up you will have some problems or others 
😝 but in general they work very well.

- [1] royale-community-examples project: Here you have a wrapper for 
VirtualSelect, JSCalendar, JsFullCalendar and we are finishing one for 
InspireTree.
- [2] royale-echarts examples project: wrapper for the Apache Echarts incubator 
graphics library.

[1] https://github.com/mjesteve/royale-examples-community/tree/develop
[2] https://github.com/mjesteve/Royale-ECharts/tree/develop

I hope they will help you.
Hiedra.

-----Mensaje original-----
De: Yishay Weiss <[email protected]> 
Enviado el: domingo, 24 de octubre de 2021 9:15
Para: [email protected]
Asunto: Re: Externs that returns a value instead of void method

Are you compiling the PDF typdefs as a separate lib? If so, you need to make 
sure the application compiler treats it as a js-external-library. If you do 
that, as Josh pointed out, no js output from the lib will be included in your 
application so it shouldn't matter what actual values you return, as long as it 
compiles.

On 2021/10/23 22:35:33, Hugo Ferreira <[email protected]> wrote: 
> Hi,
> 
> How to use a method in externs (
> https://apache.github.io/royale-docs/features/externs) that returns a value.
> 
> I tried: public static function getDocumentAsPDF():Object { return null; }
> 
> But of course that returns null (even the JS version returns a value)
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to