<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Sat, Dec 22, 2018 at 5:08 AM Michael Van Canneyt <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I agree totally, but I should point out that then we'll have 2 kinds of type<br>
helpers: normal ones (where you write the code) or external ones (where the<br>
code is in a mixin javascript library).<br>
<br>
That would require an extra keyword to be added. <br>
So for your example, this would be something like:<br>
<br>
TAutoTableHelper = type helper external for class TJSPDF<br>
procedure autoTable(aCols,aRows : Integer);<br>
end;<br>
<br>
This way the compiler knows that the type helper does not contain any code.<br>
<br>
Another possibility (maybe faster to implement) would be an 'external' <br>
interface, but that would require a typecast to be used, so a type helper will<br>
be easier to use. So currently I think we'll probably do that then.<br>
<br>
We'll keep it in mind for when we start with the type helpers.<br></blockquote><div><br></div><div>It sounds very good. I'll use the way extending a class. :-)</div><div><br></div><div>I solved it temporally using:</div><div><br></div><div><div><font size="1" face="monospace, monospace">TjsPDF = class external name 'jsPDF'</font></div><div><font size="1" face="monospace, monospace">public</font></div><div><font size="1" face="monospace, monospace"> ... </font><span style="font-family:monospace,monospace;font-size:x-small">jsPDF's methods / properties ...</span></div><div><span style="font-family:monospace,monospace;font-size:x-small"><br></span></div><div><font size="1" face="monospace, monospace"> { TODO: move this method to the TjsPDFAutoTable class as soon</font></div><div><font size="1" face="monospace, monospace"> as the class helpers feature is available in pas2js. :-) }</font></div><div><font size="1" face="monospace, monospace"> function autoTable(headers: TJSArray; data: TJSArray;</font></div><div><font size="1" face="monospace, monospace"> tableOptions: JSValue = nil): TjsPDF;</font></div><div><font size="1" face="monospace, monospace">end;</font></div></div><div><br></div><div>This method above allows me to generate complex auto paginated reports with a clean and great appearance. :-) I'll contribute those plugins to the pas2js RTL as soon as possible.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks for pointing it out !<br>
<br>
Michael.</blockquote><div><br></div><div>You're welcome dude, and thank you too! :-)</div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div></div></div></div>