@alloy-js/python 0.5.0-dev.2 → 0.6.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/dev/src/components/CallSignature.js +2 -2
- package/dist/dev/src/components/CallSignature.js.map +1 -1
- package/dist/dev/src/components/ConstructorDeclaration.js +1 -1
- package/dist/dev/src/components/ConstructorDeclaration.js.map +1 -1
- package/dist/dev/src/components/DataclassDeclaration.js +5 -5
- package/dist/dev/src/components/DataclassDeclaration.js.map +1 -1
- package/dist/dev/src/components/FunctionBase.js +9 -9
- package/dist/dev/src/components/FunctionBase.js.map +1 -1
- package/dist/dev/src/components/PropertyDeclaration.js +8 -8
- package/dist/dev/src/components/PropertyDeclaration.js.map +1 -1
- package/dist/dev/src/components/PyDoc.js +64 -64
- package/dist/dev/src/components/PyDoc.js.map +1 -1
- package/dist/dev/src/components/PydanticClassDeclaration.js +5 -5
- package/dist/dev/src/components/PydanticClassDeclaration.js.map +1 -1
- package/dist/dev/src/symbols/python-output-symbol.js.map +1 -1
- package/dist/src/components/CallSignature.d.ts.map +1 -1
- package/dist/src/components/CallSignature.js.map +1 -1
- package/dist/src/components/ConstructorDeclaration.d.ts.map +1 -1
- package/dist/src/components/ConstructorDeclaration.js.map +1 -1
- package/dist/src/components/DataclassDeclaration.d.ts.map +1 -1
- package/dist/src/components/DataclassDeclaration.js.map +1 -1
- package/dist/src/components/FunctionBase.d.ts.map +1 -1
- package/dist/src/components/FunctionBase.js.map +1 -1
- package/dist/src/components/PropertyDeclaration.d.ts.map +1 -1
- package/dist/src/components/PropertyDeclaration.js.map +1 -1
- package/dist/src/components/PyDoc.d.ts.map +1 -1
- package/dist/src/components/PyDoc.js.map +1 -1
- package/dist/src/components/PydanticClassDeclaration.d.ts.map +1 -1
- package/dist/src/components/PydanticClassDeclaration.js.map +1 -1
- package/dist/src/symbols/python-output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/python-output-symbol.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/FunctionalEnumDeclaration.md +3 -6
- package/docs/api/components/MemberExpression.md +1 -5
- package/docs/api/components/index.md +0 -2
- package/docs/api/functions/isTypeRefContext.md +1 -1
- package/docs/api/index.md +2 -2
- package/docs/api/types/ReferenceProps.md +7 -0
- package/docs/api/types/TypeRefContextProps.md +7 -0
- package/docs/api/types/index.md +2 -0
- package/package.json +10 -9
- package/src/components/CallSignature.tsx +4 -2
- package/src/components/ConstructorDeclaration.tsx +4 -2
- package/src/components/DataclassDeclaration.tsx +1 -2
- package/src/components/FunctionBase.tsx +1 -2
- package/src/components/PropertyDeclaration.tsx +8 -4
- package/src/components/PyDoc.tsx +12 -6
- package/src/components/PydanticClassDeclaration.tsx +1 -2
- package/src/symbols/python-output-symbol.ts +1 -2
- package/temp/api.json +91 -59
- package/tsdoc-metadata.json +1 -1
- package/vitest.config.ts +1 -0
- package/docs/api/components/Reference.md +0 -31
- package/docs/api/components/TypeRefContext.md +0 -41
package/temp/api.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"metadata": {
|
|
3
3
|
"toolPackage": "@microsoft/api-extractor",
|
|
4
|
-
"toolVersion": "7.
|
|
4
|
+
"toolVersion": "7.58.8",
|
|
5
5
|
"schemaVersion": 1011,
|
|
6
6
|
"oldestForwardsCompatibleVersion": 1001,
|
|
7
7
|
"tsdocConfig": {
|
|
@@ -114,6 +114,22 @@
|
|
|
114
114
|
"tagName": "@virtual",
|
|
115
115
|
"syntaxKind": "modifier"
|
|
116
116
|
},
|
|
117
|
+
{
|
|
118
|
+
"tagName": "@jsx",
|
|
119
|
+
"syntaxKind": "block"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"tagName": "@jsxRuntime",
|
|
123
|
+
"syntaxKind": "block"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"tagName": "@jsxFrag",
|
|
127
|
+
"syntaxKind": "block"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"tagName": "@jsxImportSource",
|
|
131
|
+
"syntaxKind": "block"
|
|
132
|
+
},
|
|
117
133
|
{
|
|
118
134
|
"tagName": "@betaDocumentation",
|
|
119
135
|
"syntaxKind": "modifier"
|
|
@@ -227,7 +243,7 @@
|
|
|
227
243
|
{
|
|
228
244
|
"kind": "PropertySignature",
|
|
229
245
|
"canonicalReference": "@alloy-js/python!AddImportOptions#type:member",
|
|
230
|
-
"docComment": "/**\n * If true, this import is only used in type annotation contexts
|
|
246
|
+
"docComment": "/**\n * If true, this import is only used in type annotation contexts. Such imports will be guarded with `if TYPE_CHECKING:`.\n */\n",
|
|
231
247
|
"excerptTokens": [
|
|
232
248
|
{
|
|
233
249
|
"kind": "Content",
|
|
@@ -257,7 +273,7 @@
|
|
|
257
273
|
{
|
|
258
274
|
"kind": "Function",
|
|
259
275
|
"canonicalReference": "@alloy-js/python!Atom:function(1)",
|
|
260
|
-
"docComment": "/**\n * A component that renders a JavaScript value as a Python atom (atomic value)
|
|
276
|
+
"docComment": "/**\n * A component that renders a JavaScript value as a Python atom (atomic value). It handles various types of atomic values including numbers, booleans, strings, functions, arrays, and objects, converting them to Python-like syntax.\n *\n * @example\n * ```tsx\n * <Atom jsValue={42} /> // renders \"42\"\n * <Atom jsValue={true} /> // renders \"True\"\n * <Atom jsValue=\"Hello\" /> // renders '\"Hello\"'\n * <Atom jsValue={[1, 2, 3]} /> // renders \"[1, 2, 3]\"\n * <Atom jsValue={{ key: \"value\" }} />\n * ```\n *\n */\n",
|
|
261
277
|
"excerptTokens": [
|
|
262
278
|
{
|
|
263
279
|
"kind": "Content",
|
|
@@ -375,7 +391,7 @@
|
|
|
375
391
|
{
|
|
376
392
|
"kind": "Function",
|
|
377
393
|
"canonicalReference": "@alloy-js/python!AttributeDoc:function(1)",
|
|
378
|
-
"docComment": "/**\n * A component that creates documentation for a single attribute
|
|
394
|
+
"docComment": "/**\n * A component that creates documentation for a single attribute. This can be used for both inline and block attribute documentation.\n */\n",
|
|
379
395
|
"excerptTokens": [
|
|
380
396
|
{
|
|
381
397
|
"kind": "Content",
|
|
@@ -622,7 +638,7 @@
|
|
|
622
638
|
{
|
|
623
639
|
"kind": "PropertySignature",
|
|
624
640
|
"canonicalReference": "@alloy-js/python!BaseDeclarationProps#name:member",
|
|
625
|
-
"docComment": "/**\n * The base name of this declaration. May change depending on naming policy
|
|
641
|
+
"docComment": "/**\n * The base name of this declaration. May change depending on naming policy and any conflicts.\n */\n",
|
|
626
642
|
"excerptTokens": [
|
|
627
643
|
{
|
|
628
644
|
"kind": "Content",
|
|
@@ -698,7 +714,7 @@
|
|
|
698
714
|
{
|
|
699
715
|
"kind": "Function",
|
|
700
716
|
"canonicalReference": "@alloy-js/python!CallSignature:function(1)",
|
|
701
|
-
"docComment": "/**\n * A Python call signature, e.g. the part after the `def` keyword and the name in a
|
|
717
|
+
"docComment": "/**\n * A Python call signature, e.g. the part after the `def` keyword and the name in a function expression.\n *\n * @remarks\n *\n * Any parameters or type parameters declared in this signature will be placed in the current scope. This component does not make a scope to hold its parameters.\n *\n * @example\n * ```tsx\n * <CallSignature\n * parameters={[{ name: \"a\", type: \"int\" }, { name: \"b\", type: \"str\" }]}\n * returnType=\"int\"\n * />\n * ```\n *\n * renders to\n * ```py\n * (a: int, b: str) -> int\n * ```\n *\n */\n",
|
|
702
718
|
"excerptTokens": [
|
|
703
719
|
{
|
|
704
720
|
"kind": "Content",
|
|
@@ -745,7 +761,7 @@
|
|
|
745
761
|
{
|
|
746
762
|
"kind": "Function",
|
|
747
763
|
"canonicalReference": "@alloy-js/python!CallSignatureParameters:function(1)",
|
|
748
|
-
"docComment": "/**\n * A call signature parameters declaration, which can be used to define the
|
|
764
|
+
"docComment": "/**\n * A call signature parameters declaration, which can be used to define the parameters of a function or other callables.\n *\n * @example\n * ```tsx\n * <py.CallSignatureParameters parameters={[ \"a\", \"b\" ]} />\n * ```\n *\n * This will generate:\n * ```python\n * a, b\n * ```\n *\n */\n",
|
|
749
765
|
"excerptTokens": [
|
|
750
766
|
{
|
|
751
767
|
"kind": "Content",
|
|
@@ -978,7 +994,7 @@
|
|
|
978
994
|
{
|
|
979
995
|
"kind": "PropertySignature",
|
|
980
996
|
"canonicalReference": "@alloy-js/python!CallSignatureProps#parameters:member",
|
|
981
|
-
"docComment": "/**\n * The parameters to the call signature. Can be an array of strings (for simple
|
|
997
|
+
"docComment": "/**\n * The parameters to the call signature. Can be an array of strings (for simple parameter names), {@link ParameterDescriptor}s, or special markers (\"*\" for keyword-only, \"/\" for positional-only).\n */\n",
|
|
982
998
|
"excerptTokens": [
|
|
983
999
|
{
|
|
984
1000
|
"kind": "Content",
|
|
@@ -1051,7 +1067,7 @@
|
|
|
1051
1067
|
{
|
|
1052
1068
|
"kind": "PropertySignature",
|
|
1053
1069
|
"canonicalReference": "@alloy-js/python!CallSignatureProps#typeParameters:member",
|
|
1054
|
-
"docComment": "/**\n * The type parameters of the call signature, e.g. for a generic function
|
|
1070
|
+
"docComment": "/**\n * The type parameters of the call signature, e.g. for a generic function. This is only supported in Python 3.12+.\n */\n",
|
|
1055
1071
|
"excerptTokens": [
|
|
1056
1072
|
{
|
|
1057
1073
|
"kind": "Content",
|
|
@@ -1081,7 +1097,7 @@
|
|
|
1081
1097
|
{
|
|
1082
1098
|
"kind": "Function",
|
|
1083
1099
|
"canonicalReference": "@alloy-js/python!ClassDeclaration:function(1)",
|
|
1084
|
-
"docComment": "/**\n * Create a Python class declaration.\n *\n * @remarks\n *\n
|
|
1100
|
+
"docComment": "/**\n * Create a Python class declaration.\n *\n * @remarks\n *\n * Any child declarations (methods, fields, nested classes) will be placed in the class scope. This component creates a class scope to hold its members.\n *\n * @example\n * ```tsx\n * <ClassDeclaration name=\"MyClass\" bases={[\"BaseClass\"]}>\n * <VariableDeclaration name=\"a\" type=\"int\" />\n * <VariableDeclaration name=\"b\" type=\"str\" />\n * <py.FunctionDeclaration name=\"my_method\" parameters={[{ name: \"a\", type: \"int\" }, { name: \"b\", type: \"str\" }]} returnType=\"int\">\n * return a + b\n * </py.FunctionDeclaration>\n * </ClassDeclaration>\n * ```\n *\n * renders to\n * ```py\n * class MyClass(BaseClass):\n * a: int = None\n * b: str = None\n * def my_method(self, a: int, b: str) -> int:\n * return a + b\n * ```\n *\n */\n",
|
|
1085
1101
|
"excerptTokens": [
|
|
1086
1102
|
{
|
|
1087
1103
|
"kind": "Content",
|
|
@@ -1184,7 +1200,7 @@
|
|
|
1184
1200
|
{
|
|
1185
1201
|
"kind": "PropertySignature",
|
|
1186
1202
|
"canonicalReference": "@alloy-js/python!ClassDeclarationProps#decorators:member",
|
|
1187
|
-
"docComment": "/**\n * Decorators rendered above the `class` keyword, in source order
|
|
1203
|
+
"docComment": "/**\n * Decorators rendered above the `class` keyword, in source order — `decorators[0]` is topmost. By Python's bottom-up application order, the topmost entry is the outermost decorator (applied last).\n *\n * Each entry should produce a complete decorator line (typically starting with `@`). Falsy entries are skipped, so conditional decorators can be provided inline when needed.\n *\n * Wrappers like `DataclassDeclaration` build their intrinsic decorator (e.g. `@dataclass(...)`) and append it to this list at the position that keeps `@dataclass` closest to the class — i.e. user `decorators` end up **above** the intrinsic one, matching how Pydantic's `@field_validator` sits above `@classmethod` on methods.\n *\n * Do **not** pass a wrapper's intrinsic decorator here. For example, when using `DataclassDeclaration`, do not include `@dataclass(...)` in `decorators` — the component renders it for you, and stacking it twice would produce invalid Python.\n */\n",
|
|
1188
1204
|
"excerptTokens": [
|
|
1189
1205
|
{
|
|
1190
1206
|
"kind": "Content",
|
|
@@ -1552,7 +1568,7 @@
|
|
|
1552
1568
|
{
|
|
1553
1569
|
"kind": "Function",
|
|
1554
1570
|
"canonicalReference": "@alloy-js/python!ClassEnumDeclaration:function(1)",
|
|
1555
|
-
"docComment": "/**\n * Create a Python enum using the class-based syntax.\n *\n * This generates enums using the `class Name(Enum):` syntax with member definitions
|
|
1571
|
+
"docComment": "/**\n * Create a Python enum using the class-based syntax.\n *\n * This generates enums using the `class Name(Enum):` syntax with member definitions inside the class body. Supports various member value styles including auto-generated values, explicit values, and custom base types.\n *\n * @example\n * ```tsx\n * <ClassEnumDeclaration\n * name=\"Direction\"\n * members={[\n * { name: \"NORTH\" },\n * { name: \"SOUTH\" },\n * { name: \"EAST\" },\n * { name: \"WEST\" }\n * ]}\n * />\n * ```\n *\n * renders to:\n * ```python\n * class Direction(Enum):\n * NORTH = \"NORTH\"\n * SOUTH = \"SOUTH\"\n * EAST = \"EAST\"\n * WEST = \"WEST\"\n * ```\n *\n * @example\n *\n * With explicit values:\n * ```tsx\n * <ClassEnumDeclaration\n * name=\"Status\"\n * members={[\n * { name: \"PENDING\", value: 1 },\n * { name: \"ACTIVE\", value: 2 },\n * { name: \"INACTIVE\", value: 3 }\n * ]}\n * />\n * ```\n *\n * renders to:\n * ```python\n * class Status(Enum):\n * PENDING = 1\n * ACTIVE = 2\n * INACTIVE = 3\n * ```\n *\n * @example\n *\n * With auto() values:\n * ```tsx\n * <ClassEnumDeclaration\n * name=\"Color\"\n * style=\"auto\"\n * members={[\n * { name: \"RED\" },\n * { name: \"GREEN\" },\n * { name: \"BLUE\" }\n * ]}\n * />\n * ```\n *\n * renders to:\n * ```python\n * class Color(Enum):\n * RED = auto()\n * GREEN = auto()\n * BLUE = auto()\n * ```\n *\n */\n",
|
|
1556
1572
|
"excerptTokens": [
|
|
1557
1573
|
{
|
|
1558
1574
|
"kind": "Content",
|
|
@@ -1650,7 +1666,7 @@
|
|
|
1650
1666
|
{
|
|
1651
1667
|
"kind": "PropertySignature",
|
|
1652
1668
|
"canonicalReference": "@alloy-js/python!ClassEnumProps#decorators:member",
|
|
1653
|
-
"docComment": "/**\n * Decorators rendered above `class <Name>(<BaseType>):`. See
|
|
1669
|
+
"docComment": "/**\n * Decorators rendered above `class <Name>(<BaseType>):`. See {@link ClassDeclarationProps.decorators} for the source-order and falsy skip semantics.\n *\n * Not available on functional-enum syntax (`Name = Enum(...)`), which is a variable assignment rather than a class definition.\n */\n",
|
|
1654
1670
|
"excerptTokens": [
|
|
1655
1671
|
{
|
|
1656
1672
|
"kind": "Content",
|
|
@@ -1690,7 +1706,7 @@
|
|
|
1690
1706
|
{
|
|
1691
1707
|
"kind": "Function",
|
|
1692
1708
|
"canonicalReference": "@alloy-js/python!ClassInstantiation:function(1)",
|
|
1693
|
-
"docComment": "/**\n * Used to create new instances of classes in Python.\n *\n * @remarks\n *\n
|
|
1709
|
+
"docComment": "/**\n * Used to create new instances of classes in Python.\n *\n * @remarks\n *\n * It is similar to FunctionCallExpression but specifically for class instantiation. Args should be a list arguments that can be either simple js values or py.Atoms, which will render as positional arguments, or py.VariableDeclarations, which will render as named arguments in the call statement. This component will not check for the correctness of the python grammar and will just work with any children you provide. It is up to you to ensure that the arguments you provide are valid in the context of a class instantiation.\n *\n * @example\n * ```tsx\n * <ClassInstantiation target=\"MyClass\" args={[\"arg1\", \"arg2\"]} />\n * ```\n *\n * This will generate:\n * ```python\n * MyClass(arg1, arg2)\n * ```\n *\n */\n",
|
|
1694
1710
|
"excerptTokens": [
|
|
1695
1711
|
{
|
|
1696
1712
|
"kind": "Content",
|
|
@@ -1823,7 +1839,7 @@
|
|
|
1823
1839
|
{
|
|
1824
1840
|
"kind": "Interface",
|
|
1825
1841
|
"canonicalReference": "@alloy-js/python!ClassMethodDeclarationProps:interface",
|
|
1826
|
-
"docComment": "/**\n * A Python class method declaration component.\n *\n * @remarks\n *\n
|
|
1842
|
+
"docComment": "/**\n * A Python class method declaration component.\n *\n * @remarks\n *\n * Use **`decorators`** for decorators that must appear above `@classmethod` (for example Pydantic `@field_validator`).\n *\n * @example\n * ```tsx\n * <py.ClassMethodDeclaration name=\"create\" parameters={[{ name: \"value\", type: \"str\" }]}>\n * return cls(value)\n * </py.ClassMethodDeclaration>\n * ```\n *\n * Generates:\n * ```python\n * @classmethod\n * def create(cls, value: str) -> None:\n * return cls(value)\n * ```\n *\n */\n",
|
|
1827
1843
|
"excerptTokens": [
|
|
1828
1844
|
{
|
|
1829
1845
|
"kind": "Content",
|
|
@@ -1882,7 +1898,7 @@
|
|
|
1882
1898
|
{
|
|
1883
1899
|
"kind": "Interface",
|
|
1884
1900
|
"canonicalReference": "@alloy-js/python!CommonFunctionProps:interface",
|
|
1885
|
-
"docComment": "/**\n * Shared base interface for function-like components.\n *\n * @remarks\n *\n
|
|
1901
|
+
"docComment": "/**\n * Shared base interface for function-like components.\n *\n * @remarks\n *\n * This interface is consumed by public components like `FunctionDeclaration`, `MethodDeclaration`, and property method helpers. It combines declaration metadata with call signature shape.\n */\n",
|
|
1886
1902
|
"excerptTokens": [
|
|
1887
1903
|
{
|
|
1888
1904
|
"kind": "Content",
|
|
@@ -1942,7 +1958,7 @@
|
|
|
1942
1958
|
{
|
|
1943
1959
|
"kind": "PropertySignature",
|
|
1944
1960
|
"canonicalReference": "@alloy-js/python!CommonFunctionProps#decorators:member",
|
|
1945
|
-
"docComment": "/**\n * Decorators rendered above `def`, in source order — `decorators[0]` is
|
|
1961
|
+
"docComment": "/**\n * Decorators rendered above `def`, in source order — `decorators[0]` is topmost. By Python's bottom-up application order, the topmost entry is the **outermost** decorator (applied last) and wraps the result of every decorator below it.\n *\n * Each entry should produce a complete decorator line (typically starting with `@`). Falsy entries (other than `0`) are skipped, so conditional decorators can be provided inline when needed.\n *\n * When used through wrappers that emit an intrinsic decorator (`ClassMethodDeclaration` → `@classmethod`, `StaticMethodDeclaration` → `@staticmethod`, `PropertyDeclaration` → `@property`), these decorators are rendered **above** the intrinsic line — the correct position for Pydantic's `@field_validator` / `@model_validator` and other wrappers that must see the underlying function, not a descriptor.\n *\n * When used on plain `MethodDeclaration` / `FunctionDeclaration`, these decorators are rendered above `@abstractmethod` (if `abstract` is set) and above `def`.\n *\n * Do **not** pass intrinsic decorators here — i.e. `@classmethod`, `@staticmethod`, `@property`, or `@abstractmethod`. Those are emitted by the matching component (`ClassMethodDeclaration`, `StaticMethodDeclaration`, `PropertyDeclaration`, or the `abstract` flag) and would otherwise be stacked twice in the output, producing invalid Python.\n */\n",
|
|
1946
1962
|
"excerptTokens": [
|
|
1947
1963
|
{
|
|
1948
1964
|
"kind": "Content",
|
|
@@ -2650,7 +2666,7 @@
|
|
|
2650
2666
|
{
|
|
2651
2667
|
"kind": "Variable",
|
|
2652
2668
|
"canonicalReference": "@alloy-js/python!dataclassDecoratorKeys:var",
|
|
2653
|
-
"docComment": "/**\n * Allowed keyword arguments for the Python `@dataclass(...)` decorator
|
|
2669
|
+
"docComment": "/**\n * Allowed keyword arguments for the Python `@dataclass(...)` decorator. Single source of truth: runtime keys and compile-time type are derived here.\n */\n",
|
|
2654
2670
|
"excerptTokens": [
|
|
2655
2671
|
{
|
|
2656
2672
|
"kind": "Content",
|
|
@@ -2787,7 +2803,7 @@
|
|
|
2787
2803
|
{
|
|
2788
2804
|
"kind": "Function",
|
|
2789
2805
|
"canonicalReference": "@alloy-js/python!Declaration:function(1)",
|
|
2790
|
-
"docComment": "/**\n * A Python declaration, which can be a class, function, variable, etc.\n *\n * @remarks\n *\n
|
|
2806
|
+
"docComment": "/**\n * A Python declaration, which can be a class, function, variable, etc.\n *\n * @remarks\n *\n * This component is used to create a declaration with a symbol that can be referenced in the code.\n */\n",
|
|
2791
2807
|
"excerptTokens": [
|
|
2792
2808
|
{
|
|
2793
2809
|
"kind": "Content",
|
|
@@ -3280,7 +3296,7 @@
|
|
|
3280
3296
|
{
|
|
3281
3297
|
"kind": "PropertySignature",
|
|
3282
3298
|
"canonicalReference": "@alloy-js/python!EnumMemberProps#refkey:member",
|
|
3283
|
-
"docComment": "/**\n * Refkey for the enum member symbol. If the refkey is not provided, a symbol
|
|
3299
|
+
"docComment": "/**\n * Refkey for the enum member symbol. If the refkey is not provided, a symbol will be created and the member cannot be referenced by refkey.\n */\n",
|
|
3284
3300
|
"excerptTokens": [
|
|
3285
3301
|
{
|
|
3286
3302
|
"kind": "Content",
|
|
@@ -3400,7 +3416,7 @@
|
|
|
3400
3416
|
{
|
|
3401
3417
|
"kind": "PropertySignature",
|
|
3402
3418
|
"canonicalReference": "@alloy-js/python!EnumPropsBase#baseType:member",
|
|
3403
|
-
"docComment": "/**\n * The base type of the enum. One of: 'Enum', 'IntEnum', 'StrEnum', 'Flag', 'IntFlag'
|
|
3419
|
+
"docComment": "/**\n * The base type of the enum. One of: 'Enum', 'IntEnum', 'StrEnum', 'Flag', 'IntFlag'. Defaults to 'Enum'.\n */\n",
|
|
3404
3420
|
"excerptTokens": [
|
|
3405
3421
|
{
|
|
3406
3422
|
"kind": "Content",
|
|
@@ -3832,7 +3848,7 @@
|
|
|
3832
3848
|
{
|
|
3833
3849
|
"kind": "Function",
|
|
3834
3850
|
"canonicalReference": "@alloy-js/python!FunctionalEnumDeclaration:function(1)",
|
|
3835
|
-
"docComment": "/**\n * Create a Python enum using the functional syntax.\n *\n * This generates enums using the `Enum('Name', [...])` or `Enum('Name', {...})` syntax
|
|
3851
|
+
"docComment": "/**\n * Create a Python enum using the functional syntax.\n *\n * This generates enums using the `Enum('Name', [...])` or `Enum('Name', {...})` syntax. The format depends on whether enum members have explicit values: - Members without values: `Enum('Direction', ['NORTH', 'SOUTH', 'EAST', 'WEST'])` - Members with values: `Enum('Direction', {'NORTH': 1, 'SOUTH': 2, 'EAST': 3, 'WEST': 4})`\n *\n * @example\n * ```tsx\n * <FunctionalEnumDeclaration\n * name=\"Direction\"\n * members={[\n * { name: \"NORTH\" },\n * { name: \"SOUTH\" },\n * { name: \"EAST\" },\n * { name: \"WEST\" }\n * ]}\n * />\n * ```\n *\n * renders to:\n * ```python\n * Direction = Enum('Direction', ['NORTH', 'SOUTH', 'EAST', 'WEST'])\n * ```\n *\n * @example\n * ```tsx\n * <FunctionalEnumDeclaration\n * name=\"Status\"\n * members={[\n * { name: \"PENDING\", value: 1 },\n * { name: \"ACTIVE\", value: 2 },\n * { name: \"INACTIVE\", value: 3 }\n * ]}\n * />\n * ```\n *\n * renders to:\n * ```python\n * Status = Enum('Status', {'PENDING': 1, 'ACTIVE': 2, 'INACTIVE': 3})\n * ```\n *\n */\n",
|
|
3836
3852
|
"excerptTokens": [
|
|
3837
3853
|
{
|
|
3838
3854
|
"kind": "Content",
|
|
@@ -4035,7 +4051,7 @@
|
|
|
4035
4051
|
{
|
|
4036
4052
|
"kind": "Function",
|
|
4037
4053
|
"canonicalReference": "@alloy-js/python!FunctionDeclaration:function(1)",
|
|
4038
|
-
"docComment": "/**\n * A Python function declaration.\n *\n * @remarks\n *\n
|
|
4054
|
+
"docComment": "/**\n * A Python function declaration.\n *\n * @remarks\n *\n * This component creates a Python function declaration with optional type annotations, parameters, and return types. It supports async functions and automatically handles symbol creation and emission.\n *\n * @example\n * ```tsx\n * <FunctionDeclaration\n * name=\"my_function\"\n * returnType=\"int\"\n * parameters={[{ name: \"a\", type: { children: \"int\" } }, { name: \"b\", type: { children: \"str\" } }]}\n * >\n * return a + b\n * </FunctionDeclaration>\n * ```\n *\n * This will generate:\n * ```python\n * def my_function(a: int, b: str) -> int:\n * return a + b\n * ```\n *\n */\n",
|
|
4039
4055
|
"excerptTokens": [
|
|
4040
4056
|
{
|
|
4041
4057
|
"kind": "Content",
|
|
@@ -4494,7 +4510,7 @@
|
|
|
4494
4510
|
{
|
|
4495
4511
|
"kind": "Function",
|
|
4496
4512
|
"canonicalReference": "@alloy-js/python!FutureStatement:function(1)",
|
|
4497
|
-
"docComment": "/**\n * A future statement that imports features from __future__.\n *\n * Future statements are directives to the compiler that a particular module
|
|
4513
|
+
"docComment": "/**\n * A future statement that imports features from __future__.\n *\n * Future statements are directives to the compiler that a particular module should be compiled using syntax or semantics from a future Python release. They must appear near the top of the module, after the module docstring (if any).\n *\n * Use this in the `futureImports` prop of SourceFile to ensure proper placement.\n *\n * @example\n * ```tsx\n * <SourceFile path=\"models.py\" futureImports={[<FutureStatement feature=\"annotations\" />]}>\n * <ClassDeclaration name=\"User\">\n * <PropertyDeclaration name=\"manager\" type=\"User\" />\n * </ClassDeclaration>\n * </SourceFile>\n * ```\n *\n * renders to\n * ```py\n * from __future__ import annotations\n *\n *\n * class User:\n * manager: User\n * ```\n *\n */\n",
|
|
4498
4514
|
"excerptTokens": [
|
|
4499
4515
|
{
|
|
4500
4516
|
"kind": "Content",
|
|
@@ -4936,7 +4952,7 @@
|
|
|
4936
4952
|
{
|
|
4937
4953
|
"kind": "Function",
|
|
4938
4954
|
"canonicalReference": "@alloy-js/python!getCallSignatureProps:function(1)",
|
|
4939
|
-
"docComment": "/**\n * Extract only the call signature props from a props object which extends
|
|
4955
|
+
"docComment": "/**\n * Extract only the call signature props from a props object which extends `CallSignatureProps`. You can provide default values for the props.\n */\n",
|
|
4940
4956
|
"excerptTokens": [
|
|
4941
4957
|
{
|
|
4942
4958
|
"kind": "Content",
|
|
@@ -5425,7 +5441,7 @@
|
|
|
5425
5441
|
{
|
|
5426
5442
|
"kind": "Function",
|
|
5427
5443
|
"canonicalReference": "@alloy-js/python!InlineDoc:function(1)",
|
|
5428
|
-
"docComment": "/**\n * An inline documentation component for attribute docstrings
|
|
5444
|
+
"docComment": "/**\n * An inline documentation component for attribute docstrings. Unlike PyDoc, this doesn't add a trailing line break after the closing quotes, which is appropriate for documenting consecutive attributes like enum members.\n */\n",
|
|
5429
5445
|
"excerptTokens": [
|
|
5430
5446
|
{
|
|
5431
5447
|
"kind": "Content",
|
|
@@ -5573,7 +5589,7 @@
|
|
|
5573
5589
|
{
|
|
5574
5590
|
"kind": "Function",
|
|
5575
5591
|
"canonicalReference": "@alloy-js/python!isTypeRefContext:function(1)",
|
|
5576
|
-
"docComment": "/**\n * @returns
|
|
5592
|
+
"docComment": "/**\n * @returns 'true' if in a type context, 'false' if in a value context.\n */\n",
|
|
5577
5593
|
"excerptTokens": [
|
|
5578
5594
|
{
|
|
5579
5595
|
"kind": "Content",
|
|
@@ -5750,7 +5766,7 @@
|
|
|
5750
5766
|
{
|
|
5751
5767
|
"kind": "Function",
|
|
5752
5768
|
"canonicalReference": "@alloy-js/python!MemberExpression:function(1)",
|
|
5753
|
-
"docComment": "/**\n * Create a member expression from parts. Each part can provide one of
|
|
5769
|
+
"docComment": "/**\n * Create a member expression from parts. Each part can provide one of the following:\n *\n * * **id**: The identifier for the member expression part * **refkey**: a refkey for a symbol whose name becomes the identifier * **symbol**: a symbol whose name becomes the identifier part * **args**: create a method call with the given args * **children**: arbitrary contents for the identifier part.\n *\n * @example\n * ```tsx\n * <MemberExpression>\n * <MemberExpression.Part id=\"base\" />\n * <MemberExpression.Part refkey={rk} />\n * <MemberExpression.Part symbol={sym} />\n * <MemberExpression.Part args={[\"hello\", \"world\"]} />\n * <MemberExpression.Part>SomeValue</MemberExpression.Part>\n * </MemberExpression>\n * ```\n *\n * Assuming `rk` is a refkey to a symbol name \"prop1\", and `sym` is a symbol with a name of \"prop2\", this will render:\n * ```ts\n * base.prop1.prop2(\"hello\", \"world\").SomeValue\n * ```\n *\n */\n",
|
|
5754
5770
|
"excerptTokens": [
|
|
5755
5771
|
{
|
|
5756
5772
|
"kind": "Content",
|
|
@@ -5902,7 +5918,7 @@
|
|
|
5902
5918
|
{
|
|
5903
5919
|
"kind": "PropertySignature",
|
|
5904
5920
|
"canonicalReference": "@alloy-js/python!MemberExpressionPartProps#id:member",
|
|
5905
|
-
"docComment": "/**\n * The identifier for attribute access (obj.attr)
|
|
5921
|
+
"docComment": "/**\n * The identifier for attribute access (obj.attr). Use this for Python attribute references.\n */\n",
|
|
5906
5922
|
"excerptTokens": [
|
|
5907
5923
|
{
|
|
5908
5924
|
"kind": "Content",
|
|
@@ -5929,7 +5945,7 @@
|
|
|
5929
5945
|
{
|
|
5930
5946
|
"kind": "PropertySignature",
|
|
5931
5947
|
"canonicalReference": "@alloy-js/python!MemberExpressionPartProps#key:member",
|
|
5932
|
-
"docComment": "/**\n * Single key for subscription access (obj[key] or obj[0])
|
|
5948
|
+
"docComment": "/**\n * Single key for subscription access (obj[key] or obj[0]). Use this for single subscription access.\n */\n",
|
|
5933
5949
|
"excerptTokens": [
|
|
5934
5950
|
{
|
|
5935
5951
|
"kind": "Content",
|
|
@@ -5957,7 +5973,7 @@
|
|
|
5957
5973
|
{
|
|
5958
5974
|
"kind": "PropertySignature",
|
|
5959
5975
|
"canonicalReference": "@alloy-js/python!MemberExpressionPartProps#keys:member",
|
|
5960
|
-
"docComment": "/**\n * Multiple keys for tuple subscription access (obj[a, b] -\\> obj[(a, b)])
|
|
5976
|
+
"docComment": "/**\n * Multiple keys for tuple subscription access (obj[a, b] -\\> obj[(a, b)]). Use this when you need tuple key access.\n */\n",
|
|
5961
5977
|
"excerptTokens": [
|
|
5962
5978
|
{
|
|
5963
5979
|
"kind": "Content",
|
|
@@ -6017,7 +6033,7 @@
|
|
|
6017
6033
|
{
|
|
6018
6034
|
"kind": "PropertySignature",
|
|
6019
6035
|
"canonicalReference": "@alloy-js/python!MemberExpressionPartProps#slice:member",
|
|
6020
|
-
"docComment": "/**\n * Slice notation for subscription access (obj[start:stop:step])
|
|
6036
|
+
"docComment": "/**\n * Slice notation for subscription access (obj[start:stop:step]). Use this for Python slice syntax.\n */\n",
|
|
6021
6037
|
"excerptTokens": [
|
|
6022
6038
|
{
|
|
6023
6039
|
"kind": "Content",
|
|
@@ -6269,7 +6285,7 @@
|
|
|
6269
6285
|
{
|
|
6270
6286
|
"kind": "Function",
|
|
6271
6287
|
"canonicalReference": "@alloy-js/python!MethodDeclaration:function(1)",
|
|
6272
|
-
"docComment": "/**\n * A Python instance method declaration component.\n *\n * @remarks\n *\n
|
|
6288
|
+
"docComment": "/**\n * A Python instance method declaration component.\n *\n * @remarks\n *\n * Automatically injects the `self` parameter for instance methods and enforces that the declaration appears within a class body.\n *\n * @example\n * ```tsx\n * <py.MethodDeclaration name=\"do_work\" parameters={[{ name: \"value\", type: \"int\" }]}>\n * return value * 2\n * </py.MethodDeclaration>\n * ```\n *\n * Generates:\n * ```python\n * def do_work(self, value: int) -> None:\n * return value * 2\n * ```\n *\n */\n",
|
|
6273
6289
|
"excerptTokens": [
|
|
6274
6290
|
{
|
|
6275
6291
|
"kind": "Content",
|
|
@@ -6379,7 +6395,7 @@
|
|
|
6379
6395
|
{
|
|
6380
6396
|
"kind": "Function",
|
|
6381
6397
|
"canonicalReference": "@alloy-js/python!MethodDoc:function(1)",
|
|
6382
|
-
"docComment": "/**\n * A component that creates a MethodDoc block for class methods
|
|
6398
|
+
"docComment": "/**\n * A component that creates a MethodDoc block for class methods. Automatically adds a note about not including 'self' parameter if no custom note is provided.\n */\n",
|
|
6383
6399
|
"excerptTokens": [
|
|
6384
6400
|
{
|
|
6385
6401
|
"kind": "Content",
|
|
@@ -7684,7 +7700,7 @@
|
|
|
7684
7700
|
{
|
|
7685
7701
|
"kind": "Interface",
|
|
7686
7702
|
"canonicalReference": "@alloy-js/python!PropertyDeclarationProps:interface",
|
|
7687
|
-
"docComment": "/**\n * Declares a Python property with optional getter, setter, and deleter methods.\n *\n * @remarks\n *\n
|
|
7703
|
+
"docComment": "/**\n * Declares a Python property with optional getter, setter, and deleter methods.\n *\n * @remarks\n *\n * The property must be declared within a class. The getter method is automatically generated using the `@property` decorator. Use the nested `Setter` and `Deleter` components to add mutators.\n *\n * Use **`decorators`** for decorators that must appear **above** the intrinsic `@property` (for example Pydantic `@computed_field`, `@typing.final`, `@typing.override`). The first array entry is rendered topmost, matching Python source order.\n *\n * @example\n * ```tsx\n * <py.PropertyDeclaration name=\"name\" type={{ children: \"str\" }}>\n * return self._name\n * </py.PropertyDeclaration>\n * ```\n *\n * Generates:\n * ```python\n * @property\n * def name(self) -> str:\n * return self._name\n * ```\n *\n * @example\n *\n * Setter and deleter\n * ```tsx\n * <py.PropertyDeclaration name=\"value\" type={{ children: \"int\" }}>\n * return self._value\n * <py.PropertyDeclaration.Setter type={{ children: \"int\" }}>\n * self._value = value\n * </py.PropertyDeclaration.Setter>\n * <py.PropertyDeclaration.Deleter>\n * del self._value\n * </py.PropertyDeclaration.Deleter>\n * </py.PropertyDeclaration>\n * ```\n *\n * Generates:\n * ```python\n * @property\n * def value(self) -> int:\n * return self._value\n *\n * @value.setter\n * def value(self, value: int) -> None:\n * self._value = value\n *\n * @value.deleter\n * def value(self) -> None:\n * del self._value\n * ```\n *\n * @example\n *\n * Pydantic computed field\n * ```tsx\n * <py.PropertyDeclaration\n * name=\"area\"\n * type=\"float\"\n * decorators={[code`@${pydanticModule[\".\"].computed_field}`]}\n * >\n * return self.width ** 2\n * </py.PropertyDeclaration>\n * ```\n *\n * Generates:\n * ```python\n * @computed_field\n * @property\n * def area(self) -> float:\n * return self.width ** 2\n * ```\n *\n */\n",
|
|
7688
7704
|
"excerptTokens": [
|
|
7689
7705
|
{
|
|
7690
7706
|
"kind": "Content",
|
|
@@ -7754,7 +7770,7 @@
|
|
|
7754
7770
|
{
|
|
7755
7771
|
"kind": "PropertySignature",
|
|
7756
7772
|
"canonicalReference": "@alloy-js/python!PropertyDeclarationProps#decorators:member",
|
|
7757
|
-
"docComment": "/**\n * Decorators rendered above the intrinsic `@property` line, in source order
|
|
7773
|
+
"docComment": "/**\n * 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`.\n */\n",
|
|
7758
7774
|
"excerptTokens": [
|
|
7759
7775
|
{
|
|
7760
7776
|
"kind": "Content",
|
|
@@ -8263,7 +8279,7 @@
|
|
|
8263
8279
|
{
|
|
8264
8280
|
"kind": "Function",
|
|
8265
8281
|
"canonicalReference": "@alloy-js/python!PydanticClassDeclaration:function(1)",
|
|
8266
|
-
"docComment": "/**\n * Renders a Python class that subclasses Pydantic's `BaseModel
|
|
8282
|
+
"docComment": "/**\n * Renders a Python class that subclasses Pydantic's `BaseModel`: `class Name(BaseModel): ...`.\n *\n * When `bases` is omitted, the class extends `pydanticModule[\".\"].BaseModel`. Pass `bases` to inherit from another generated class (or to combine bases explicitly).\n *\n * Optional `modelConfig={{...}}` and top-level config props (for example `frozen`, `strict`, `extra`) emit `model_config = ConfigDict(...)` for common Pydantic v2 model settings (see {@link PydanticModelConfigDictProps}). When both are used, top-level props override `modelConfig` keys.\n *\n * Fields are ordinary class body declarations; use `pydanticModule[\".\"].Field` in initializers when you need `Field(...)`.\n *\n * @example\n * ```tsx\n * import { pydanticModule } from \"@alloy-js/python\";\n * import * as py from \"@alloy-js/python\";\n *\n * <py.PydanticClassDeclaration name=\"User\" frozen>\n * <py.VariableDeclaration instanceVariable omitNone name=\"id\" type=\"int\" />\n * <py.VariableDeclaration\n * instanceVariable\n * name=\"name\"\n * type=\"str\"\n * initializer={\"Field(default=\\\"anonymous\\\")\"}\n * />\n * </py.PydanticClassDeclaration>\n * ```\n *\n * ```py\n * from pydantic import BaseModel\n * from pydantic import ConfigDict\n * from pydantic import Field\n *\n * class User(BaseModel):\n * model_config = ConfigDict(frozen=True)\n * id: int\n * name: str = Field(default=\"anonymous\")\n * ```\n *\n */\n",
|
|
8267
8283
|
"excerptTokens": [
|
|
8268
8284
|
{
|
|
8269
8285
|
"kind": "Content",
|
|
@@ -8343,7 +8359,7 @@
|
|
|
8343
8359
|
{
|
|
8344
8360
|
"kind": "PropertySignature",
|
|
8345
8361
|
"canonicalReference": "@alloy-js/python!PydanticClassDeclarationProps#modelConfig:member",
|
|
8346
|
-
"docComment": "/**\n * Canonical structured config object for `ConfigDict(...)`. Values here are
|
|
8362
|
+
"docComment": "/**\n * Canonical structured config object for `ConfigDict(...)`. Values here are merged with top-level config props.\n *\n * Top-level config props take precedence over `modelConfig` when the same key is provided in both places.\n */\n",
|
|
8347
8363
|
"excerptTokens": [
|
|
8348
8364
|
{
|
|
8349
8365
|
"kind": "Content",
|
|
@@ -8371,7 +8387,7 @@
|
|
|
8371
8387
|
{
|
|
8372
8388
|
"kind": "PropertySignature",
|
|
8373
8389
|
"canonicalReference": "@alloy-js/python!PydanticClassDeclarationProps#modelConfigExpression:member",
|
|
8374
|
-
"docComment": "/**\n * Emits `model_config = <expression>` verbatim (use for arbitrary `ConfigDict
|
|
8390
|
+
"docComment": "/**\n * Emits `model_config = <expression>` verbatim (use for arbitrary `ConfigDict` kwargs or dynamic config). Takes precedence over both `modelConfig` and top-level config props.\n *\n * @example\n *\n * A typical value emits `ConfigDict(frozen=True, extra=\"forbid\")`.\n */\n",
|
|
8375
8391
|
"excerptTokens": [
|
|
8376
8392
|
{
|
|
8377
8393
|
"kind": "Content",
|
|
@@ -8411,7 +8427,7 @@
|
|
|
8411
8427
|
{
|
|
8412
8428
|
"kind": "Interface",
|
|
8413
8429
|
"canonicalReference": "@alloy-js/python!PydanticModelConfigDictProps:interface",
|
|
8414
|
-
"docComment": "/**\n * Keyword-style options for Pydantic v2 `ConfigDict`, using camelCase prop names
|
|
8430
|
+
"docComment": "/**\n * Keyword-style options for Pydantic v2 `ConfigDict`, using camelCase prop names that map to snake_case Python arguments (for example `validateAssignment` → `validate_assignment`).\n */\n",
|
|
8415
8431
|
"excerptTokens": [
|
|
8416
8432
|
{
|
|
8417
8433
|
"kind": "Content",
|
|
@@ -9156,7 +9172,7 @@
|
|
|
9156
9172
|
{
|
|
9157
9173
|
"kind": "Function",
|
|
9158
9174
|
"canonicalReference": "@alloy-js/python!PyDoc:function(1)",
|
|
9159
|
-
"docComment": "/**\n * A PyDoc comment. The children of this component are joined with two hard
|
|
9175
|
+
"docComment": "/**\n * A PyDoc comment. The children of this component are joined with two hard linebreaks. This is useful for creating PyDoc comments with multiple paragraphs.\n */\n",
|
|
9160
9176
|
"excerptTokens": [
|
|
9161
9177
|
{
|
|
9162
9178
|
"kind": "Content",
|
|
@@ -9787,7 +9803,7 @@
|
|
|
9787
9803
|
{
|
|
9788
9804
|
"kind": "Method",
|
|
9789
9805
|
"canonicalReference": "@alloy-js/python!PythonModuleScope#addTypeImport:member(1)",
|
|
9790
|
-
"docComment": "/**\n * Add TYPE_CHECKING import from the typing module
|
|
9806
|
+
"docComment": "/**\n * Add TYPE_CHECKING import from the typing module. Returns the local symbol for use in the if block opener.\n */\n",
|
|
9791
9807
|
"excerptTokens": [
|
|
9792
9808
|
{
|
|
9793
9809
|
"kind": "Content",
|
|
@@ -10261,7 +10277,7 @@
|
|
|
10261
10277
|
{
|
|
10262
10278
|
"kind": "Property",
|
|
10263
10279
|
"canonicalReference": "@alloy-js/python!PythonOutputSymbol#isTypeOnly:member",
|
|
10264
|
-
"docComment": "/**\n * Returns true if this symbol is only used in type annotation contexts
|
|
10280
|
+
"docComment": "/**\n * Returns true if this symbol is only used in type annotation contexts. Such symbols can be imported inside a TYPE_CHECKING block.\n */\n",
|
|
10265
10281
|
"excerptTokens": [
|
|
10266
10282
|
{
|
|
10267
10283
|
"kind": "Content",
|
|
@@ -10701,11 +10717,11 @@
|
|
|
10701
10717
|
{
|
|
10702
10718
|
"kind": "Function",
|
|
10703
10719
|
"canonicalReference": "@alloy-js/python!Reference:function(1)",
|
|
10704
|
-
"docComment": "/**\n * A Python reference to a symbol, such as a variable, function, or class.\n *\n * @remarks\n *\n
|
|
10720
|
+
"docComment": "/**\n * A Python reference to a symbol, such as a variable, function, or class.\n *\n * @remarks\n *\n * This component is used to render references to symbols in Python code. It takes a `refkey` prop which is the key of the symbol to reference.\n */\n",
|
|
10705
10721
|
"excerptTokens": [
|
|
10706
10722
|
{
|
|
10707
10723
|
"kind": "Content",
|
|
10708
|
-
"text": "export declare function Reference(
|
|
10724
|
+
"text": "export declare function Reference(input: "
|
|
10709
10725
|
},
|
|
10710
10726
|
{
|
|
10711
10727
|
"kind": "Reference",
|
|
@@ -10740,6 +10756,14 @@
|
|
|
10740
10756
|
"parameters": [
|
|
10741
10757
|
{
|
|
10742
10758
|
"parameterName": "{ refkey }",
|
|
10759
|
+
"parameterTypeTokenRange": {
|
|
10760
|
+
"startIndex": 0,
|
|
10761
|
+
"endIndex": 0
|
|
10762
|
+
},
|
|
10763
|
+
"isOptional": false
|
|
10764
|
+
},
|
|
10765
|
+
{
|
|
10766
|
+
"parameterName": "input",
|
|
10743
10767
|
"parameterTypeTokenRange": {
|
|
10744
10768
|
"startIndex": 1,
|
|
10745
10769
|
"endIndex": 2
|
|
@@ -10813,7 +10837,7 @@
|
|
|
10813
10837
|
{
|
|
10814
10838
|
"kind": "PropertySignature",
|
|
10815
10839
|
"canonicalReference": "@alloy-js/python!RefOptions#type:member",
|
|
10816
|
-
"docComment": "/**\n * If true, this reference is only used in a type annotation context
|
|
10840
|
+
"docComment": "/**\n * If true, this reference is only used in a type annotation context. The import will be guarded with `if TYPE_CHECKING:`.\n */\n",
|
|
10817
10841
|
"excerptTokens": [
|
|
10818
10842
|
{
|
|
10819
10843
|
"kind": "Content",
|
|
@@ -11066,7 +11090,7 @@
|
|
|
11066
11090
|
{
|
|
11067
11091
|
"kind": "Function",
|
|
11068
11092
|
"canonicalReference": "@alloy-js/python!SourceFile:function(1)",
|
|
11069
|
-
"docComment": "/**\n * A Python source file component that represents a Python file in the source directory
|
|
11093
|
+
"docComment": "/**\n * A Python source file component that represents a Python file in the source directory. It provides a scope for the file, which is a `PythonModuleScope` that contains all the symbols defined in the file, such as functions, classes, and variables.\n *\n * @example\n * ```tsx\n * <SourceFile path=\"test.py\">\n * <FunctionDeclaration name=\"test\" />\n * </SourceFile>\n * ```\n *\n * renders to\n * ```py\n * def test():\n * pass\n * ```\n *\n * @example\n *\n * With module documentation:\n * ```tsx\n * <SourceFile\n * path=\"utils.py\"\n * doc={<ModuleDoc description={[<Prose>Utility functions for data processing.</Prose>]} />}\n * >\n * <FunctionDeclaration name=\"process_data\" />\n * </SourceFile>\n * ```\n *\n * renders to\n * ```py\n * \"\"\"\n * Utility functions for data processing.\n * \"\"\"\n *\n * def process_data():\n * pass\n * ```\n *\n */\n",
|
|
11070
11094
|
"excerptTokens": [
|
|
11071
11095
|
{
|
|
11072
11096
|
"kind": "Content",
|
|
@@ -11225,7 +11249,7 @@
|
|
|
11225
11249
|
{
|
|
11226
11250
|
"kind": "PropertySignature",
|
|
11227
11251
|
"canonicalReference": "@alloy-js/python!SourceFileProps#header:member",
|
|
11228
|
-
"docComment": "/**\n * Content to render at the very top of the file, before everything else
|
|
11252
|
+
"docComment": "/**\n * Content to render at the very top of the file, before everything else. Use this for shebang lines, encoding declarations, or license headers.\n */\n",
|
|
11229
11253
|
"excerptTokens": [
|
|
11230
11254
|
{
|
|
11231
11255
|
"kind": "Content",
|
|
@@ -11253,7 +11277,7 @@
|
|
|
11253
11277
|
{
|
|
11254
11278
|
"kind": "PropertySignature",
|
|
11255
11279
|
"canonicalReference": "@alloy-js/python!SourceFileProps#headerComment:member",
|
|
11256
|
-
"docComment": "/**\n * Comment to add at the top of the file, rendered as a Python comment block
|
|
11280
|
+
"docComment": "/**\n * Comment to add at the top of the file, rendered as a Python comment block. This is a convenience prop for adding copyright notices or other comments.\n */\n",
|
|
11257
11281
|
"excerptTokens": [
|
|
11258
11282
|
{
|
|
11259
11283
|
"kind": "Content",
|
|
@@ -11315,7 +11339,7 @@
|
|
|
11315
11339
|
{
|
|
11316
11340
|
"kind": "Function",
|
|
11317
11341
|
"canonicalReference": "@alloy-js/python!StatementList:function(1)",
|
|
11318
|
-
"docComment": "/**\n * A Python statement list, which is a list of statements that can be rendered
|
|
11342
|
+
"docComment": "/**\n * A Python statement list, which is a list of statements that can be rendered in a Python source file.\n *\n * @example\n * ```tsx\n * <StatementList>\n * <FunctionDeclaration name=\"test\" />\n * <VariableDeclaration name=\"x\" value={42} />\n * </StatementList>\n * ```\n *\n * renders to\n * ```py\n * def test():\n * pass\n *\n * x = 42\n * ```\n *\n */\n",
|
|
11319
11343
|
"excerptTokens": [
|
|
11320
11344
|
{
|
|
11321
11345
|
"kind": "Content",
|
|
@@ -11459,7 +11483,7 @@
|
|
|
11459
11483
|
{
|
|
11460
11484
|
"kind": "Interface",
|
|
11461
11485
|
"canonicalReference": "@alloy-js/python!StaticMethodDeclarationProps:interface",
|
|
11462
|
-
"docComment": "/**\n * A Python static method declaration component.\n *\n * @remarks\n *\n
|
|
11486
|
+
"docComment": "/**\n * A Python static method declaration component.\n *\n * @remarks\n *\n * Use **`decorators`** for decorators that must appear above `@staticmethod`.\n *\n * @example\n * ```tsx\n * <py.StaticMethodDeclaration name=\"identity\" parameters={[{ name: \"value\", type: \"int\" }]}>\n * return value\n * </py.StaticMethodDeclaration>\n * ```\n *\n * Generates:\n * ```python\n * @staticmethod\n * def identity(value: int) -> None:\n * return value\n * ```\n *\n */\n",
|
|
11463
11487
|
"excerptTokens": [
|
|
11464
11488
|
{
|
|
11465
11489
|
"kind": "Content",
|
|
@@ -11533,7 +11557,7 @@
|
|
|
11533
11557
|
{
|
|
11534
11558
|
"kind": "PropertySignature",
|
|
11535
11559
|
"canonicalReference": "@alloy-js/python!SubscriptionProps#key:member",
|
|
11536
|
-
"docComment": "/**\n * Single key for subscription access (obj[key] or obj[0])
|
|
11560
|
+
"docComment": "/**\n * Single key for subscription access (obj[key] or obj[0]). Use this for single subscription access.\n */\n",
|
|
11537
11561
|
"excerptTokens": [
|
|
11538
11562
|
{
|
|
11539
11563
|
"kind": "Content",
|
|
@@ -11561,7 +11585,7 @@
|
|
|
11561
11585
|
{
|
|
11562
11586
|
"kind": "PropertySignature",
|
|
11563
11587
|
"canonicalReference": "@alloy-js/python!SubscriptionProps#keys:member",
|
|
11564
|
-
"docComment": "/**\n * Multiple keys for tuple subscription access (obj[a, b] -\\> obj[(a, b)])
|
|
11588
|
+
"docComment": "/**\n * Multiple keys for tuple subscription access (obj[a, b] -\\> obj[(a, b)]). Use this when you need tuple key access.\n */\n",
|
|
11565
11589
|
"excerptTokens": [
|
|
11566
11590
|
{
|
|
11567
11591
|
"kind": "Content",
|
|
@@ -11593,7 +11617,7 @@
|
|
|
11593
11617
|
{
|
|
11594
11618
|
"kind": "PropertySignature",
|
|
11595
11619
|
"canonicalReference": "@alloy-js/python!SubscriptionProps#slice:member",
|
|
11596
|
-
"docComment": "/**\n * Slice notation for subscription access (obj[start:stop:step])
|
|
11620
|
+
"docComment": "/**\n * Slice notation for subscription access (obj[start:stop:step]). Use this for Python slice syntax.\n */\n",
|
|
11597
11621
|
"excerptTokens": [
|
|
11598
11622
|
{
|
|
11599
11623
|
"kind": "Content",
|
|
@@ -11747,11 +11771,11 @@
|
|
|
11747
11771
|
{
|
|
11748
11772
|
"kind": "Function",
|
|
11749
11773
|
"canonicalReference": "@alloy-js/python!TypeRefContext:function(1)",
|
|
11750
|
-
"docComment": "/**\n * Set the current context of reference to be type reference.\n *\n * @remarks\n *\n
|
|
11774
|
+
"docComment": "/**\n * Set the current context of reference to be type reference.\n *\n * @remarks\n *\n * References used inside the children of this component will be treated as type-only references. When a symbol is only referenced in type contexts, it will be imported inside a `if TYPE_CHECKING:` block.\n *\n * @example\n * ```tsx\n * <TypeRefContext>\n * {someTypeRefkey}\n * </TypeRefContext>\n * ```\n *\n */\n",
|
|
11751
11775
|
"excerptTokens": [
|
|
11752
11776
|
{
|
|
11753
11777
|
"kind": "Content",
|
|
11754
|
-
"text": "TypeRefContext: (
|
|
11778
|
+
"text": "TypeRefContext: (input: "
|
|
11755
11779
|
},
|
|
11756
11780
|
{
|
|
11757
11781
|
"kind": "Reference",
|
|
@@ -11778,6 +11802,14 @@
|
|
|
11778
11802
|
"parameters": [
|
|
11779
11803
|
{
|
|
11780
11804
|
"parameterName": "{ children }",
|
|
11805
|
+
"parameterTypeTokenRange": {
|
|
11806
|
+
"startIndex": 0,
|
|
11807
|
+
"endIndex": 0
|
|
11808
|
+
},
|
|
11809
|
+
"isOptional": false
|
|
11810
|
+
},
|
|
11811
|
+
{
|
|
11812
|
+
"parameterName": "input",
|
|
11781
11813
|
"parameterTypeTokenRange": {
|
|
11782
11814
|
"startIndex": 1,
|
|
11783
11815
|
"endIndex": 2
|
|
@@ -11836,7 +11868,7 @@
|
|
|
11836
11868
|
{
|
|
11837
11869
|
"kind": "Function",
|
|
11838
11870
|
"canonicalReference": "@alloy-js/python!TypeReference:function(1)",
|
|
11839
|
-
"docComment": "/**\n * A type reference like Foo[T, P] or int.\n *\n * @remarks\n *\n
|
|
11871
|
+
"docComment": "/**\n * A type reference like Foo[T, P] or int.\n *\n * @remarks\n *\n * This component automatically wraps its content in a type reference context, so any symbols referenced via refkey will be imported as type-only (inside a `if TYPE_CHECKING:` block) unless also used as values elsewhere.\n */\n",
|
|
11840
11872
|
"excerptTokens": [
|
|
11841
11873
|
{
|
|
11842
11874
|
"kind": "Content",
|
|
@@ -12328,7 +12360,7 @@
|
|
|
12328
12360
|
{
|
|
12329
12361
|
"kind": "PropertySignature",
|
|
12330
12362
|
"canonicalReference": "@alloy-js/python!VariableDeclarationProps#callStatementVar:member",
|
|
12331
|
-
"docComment": "/**\n * Indicates if this is a call statement variable. Optional
|
|
12363
|
+
"docComment": "/**\n * Indicates if this is a call statement variable. Optional. This is used to handle cases where the variable is part of a call statement.\n */\n",
|
|
12332
12364
|
"excerptTokens": [
|
|
12333
12365
|
{
|
|
12334
12366
|
"kind": "Content",
|
|
@@ -12383,7 +12415,7 @@
|
|
|
12383
12415
|
{
|
|
12384
12416
|
"kind": "PropertySignature",
|
|
12385
12417
|
"canonicalReference": "@alloy-js/python!VariableDeclarationProps#instanceVariable:member",
|
|
12386
|
-
"docComment": "/**\n * Indicates if this variable is an instance variable. Optional
|
|
12418
|
+
"docComment": "/**\n * Indicates if this variable is an instance variable. Optional. This is used to handle cases where the variable is part of a class instance.\n */\n",
|
|
12387
12419
|
"excerptTokens": [
|
|
12388
12420
|
{
|
|
12389
12421
|
"kind": "Content",
|