The python-to-typescript command is complete in devel

15 views
Skip to first unread message

Edward K. Ream

unread,
Oct 14, 2021, 8:27:11 AM10/14/21
to leo-editor
See PR #2268 for code details. This command contains some of the most elegant code I have ever written. I am proud of it.  I (and python!) have come a long way since 2001!

To use, select any @<file> node and execute python-to-typescript.
The command creates (safe!) results in the last top-level node of the outline.

The command attempts no type analysis. It uses "void" as the type of all functions and methods.  However, the script will annotate function/method arguments:

@data python-to-typescript-types in leoSettings.leo contains a list of key/value pairs. Keys are argument names (as used in Leo); values are typescript type names.

This concludes the planned work on the command. I'll be using the command to help transliterate some of Leo's core files to typescript for leoInteg 2.0.

Please report any problems. Feel free to ask any questions.

Edward
Reply all
Reply to author
Forward
0 new messages