(Currently requests.Requests will output requestsRequests.)
The above would add from uuid import UUID and import requests to the preamble. It might be nice to allow inline comments of this kind too: type x = Y; // @from z import Y. There should be no quotes or use of
Ability to skip helper types
This is mainly to keep the TypeScript references working so the type definitions are not just for ts2python. It can also be used for just ignoring a type if it is not needed in the Python output.
I am thinking it would be nice to specify a few behaviour changes with directives. I propose the
@
symbol inline with// @ts-expect-error
, etc.Imports required
(Currently
requests.Requests
will outputrequestsRequests
.)The above would add
from uuid import UUID
andimport requests
to the preamble. It might be nice to allow inline comments of this kind too:type x = Y; // @from z import Y
. There should be no quotes or use ofAbility to skip helper types
This is mainly to keep the TypeScript references working so the type definitions are not just for ts2python. It can also be used for just ignoring a type if it is not needed in the Python output.
The above
integer
type would not be output in the Python file.Force use of
TypeAlias
hintSome types are output fully as strings, which may not be recognised by an editor.
The above would output:
whereas currently no hint is output.