py2ts.data.TSEnumType¶
- class py2ts.data.TSEnumType(name: str, elements: Dict[str, str | int], *, not_required: bool = False, comment: str | None = None)¶
Represents a TypeScript enum type.
Attributes
commentnot_requiredelementsnameMethods
__init__(name, elements, *[, not_required, ...])exclude(exclude)Exclude fields from the enum type.
Get all TypeScript types required for the current type.
- __init__(name: str, elements: Dict[str, str | int], *, not_required: bool = False, comment: str | None = None) None¶
- exclude(exclude: set[str]) TSEnumType¶
Exclude fields from the enum type.
- referenced_types() set[TypescriptType]¶
Get all TypeScript types required for the current type.
This method should gather all the necessary types and dependencies related to the current type, aiding in understanding and organizing generated code where multiple type inter-dependencies exist.