PropertyDeclaration
Declares a Python property with optional getter, setter, and deleter methods.
import { PropertyDeclaration } from "@alloy-js/python";
<PropertyDeclaration abstract decorators={Children[]} doc={Children} name="string" refkey={Refkey} type={Children}> {children}</PropertyDeclaration>import { PropertyDeclaration } from "@alloy-js/python/stc";
PropertyDeclaration({ abstract: boolean, decorators: Children[], doc: Children, name: string, refkey: Refkey, type: Children,}).children(children)| abstract | optional boolean | |
| children | optional Children | |
| decorators | optional Children[] | Decorators rendered above the intrinsic @property line, in source order (decorators[0] is topmost / applied last). Use for decorators that wrap the resulting property, e.g. Pydantic’s @computed_field. |
| doc | optional Children | |
| name | string | |
| refkey | optional Refkey | |
| type | optional Children |