@alloy-js/python 0.3.0-dev.4 → 0.3.0-dev.6
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/dist/src/components/CallSignature.d.ts +6 -4
- package/dist/src/components/CallSignature.d.ts.map +1 -1
- package/dist/src/components/CallSignature.js +23 -26
- package/dist/src/components/CallSignature.js.map +1 -1
- package/dist/src/components/FutureStatement.d.ts +35 -0
- package/dist/src/components/FutureStatement.d.ts.map +1 -0
- package/dist/src/components/FutureStatement.js +31 -0
- package/dist/src/components/FutureStatement.js.map +1 -0
- package/dist/src/components/SourceFile.d.ts +8 -2
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +124 -8
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +1 -0
- package/dist/src/components/index.js.map +1 -1
- package/dist/test/callsignatures.test.js +127 -0
- package/dist/test/callsignatures.test.js.map +1 -1
- package/dist/test/classdeclarations.test.js +2 -0
- package/dist/test/classdeclarations.test.js.map +1 -1
- package/dist/test/dataclassdeclarations.test.js +13 -0
- package/dist/test/dataclassdeclarations.test.js.map +1 -1
- package/dist/test/enums.test.js +7 -0
- package/dist/test/enums.test.js.map +1 -1
- package/dist/test/externals.test.js +2 -0
- package/dist/test/externals.test.js.map +1 -1
- package/dist/test/functiondeclaration.test.js +2 -0
- package/dist/test/functiondeclaration.test.js.map +1 -1
- package/dist/test/methoddeclaration.test.js +1 -0
- package/dist/test/methoddeclaration.test.js.map +1 -1
- package/dist/test/namepolicies.test.js +1 -0
- package/dist/test/namepolicies.test.js.map +1 -1
- package/dist/test/propertydeclaration.test.js +1 -0
- package/dist/test/propertydeclaration.test.js.map +1 -1
- package/dist/test/pydocs.test.js +1 -1
- package/dist/test/pydocs.test.js.map +1 -1
- package/dist/test/sourcefiles.test.js +921 -39
- package/dist/test/sourcefiles.test.js.map +1 -1
- package/dist/test/utils.d.ts +2 -2
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +9 -9
- package/dist/test/utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/CallSignature.tsx +41 -36
- package/src/components/FutureStatement.tsx +38 -0
- package/src/components/SourceFile.tsx +128 -8
- package/src/components/index.ts +1 -0
- package/temp/api.json +169 -5
- package/test/callsignatures.test.tsx +110 -0
- package/test/classdeclarations.test.tsx +2 -0
- package/test/dataclassdeclarations.test.tsx +13 -0
- package/test/enums.test.tsx +7 -0
- package/test/externals.test.tsx +2 -0
- package/test/functiondeclaration.test.tsx +2 -0
- package/test/methoddeclaration.test.tsx +1 -0
- package/test/namepolicies.test.tsx +1 -0
- package/test/propertydeclaration.test.tsx +1 -0
- package/test/pydocs.test.tsx +1 -1
- package/test/sourcefiles.test.tsx +754 -48
- package/test/utils.tsx +10 -5
|
@@ -14,8 +14,16 @@ import { createPythonSymbol } from "../symbol-creation.js";
|
|
|
14
14
|
import { PythonOutputSymbol } from "../symbols/index.js";
|
|
15
15
|
import { Atom } from "./Atom.jsx";
|
|
16
16
|
|
|
17
|
+
export type ParameterMarker = "*" | "/";
|
|
18
|
+
|
|
19
|
+
function isParameterMarker(
|
|
20
|
+
param: string | ParameterDescriptor | undefined,
|
|
21
|
+
): param is ParameterMarker {
|
|
22
|
+
return typeof param === "string" && (param === "*" || param === "/");
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
export interface CallSignatureParametersProps {
|
|
18
|
-
readonly parameters?: (ParameterDescriptor | string)[];
|
|
26
|
+
readonly parameters?: (ParameterDescriptor | ParameterMarker | string)[];
|
|
19
27
|
readonly args?: boolean;
|
|
20
28
|
readonly kwargs?: boolean;
|
|
21
29
|
}
|
|
@@ -34,13 +42,11 @@ export interface CallSignatureParametersProps {
|
|
|
34
42
|
* ```
|
|
35
43
|
*/
|
|
36
44
|
export function CallSignatureParameters(props: CallSignatureParametersProps) {
|
|
37
|
-
const parameters = normalizeAndDeclareParameters(props.parameters ?? []);
|
|
38
|
-
|
|
39
45
|
const parameterList = computed(() => {
|
|
40
|
-
const params = []
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
const params = (props.parameters ?? []).map((p) => {
|
|
47
|
+
return isParameterMarker(p) ? p : (
|
|
48
|
+
parameter(normalizeAndDeclareParameter(p))
|
|
49
|
+
);
|
|
44
50
|
});
|
|
45
51
|
|
|
46
52
|
// Add *args if specified
|
|
@@ -88,40 +94,39 @@ interface DeclaredParameterDescriptor
|
|
|
88
94
|
TypeSlot?: SymbolSlot;
|
|
89
95
|
}
|
|
90
96
|
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
): DeclaredParameterDescriptor
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
});
|
|
97
|
+
function normalizeAndDeclareParameter(
|
|
98
|
+
param: ParameterDescriptor | string,
|
|
99
|
+
): DeclaredParameterDescriptor {
|
|
100
|
+
if (isParameterDescriptor(param)) {
|
|
101
|
+
const TypeSlot = createSymbolSlot();
|
|
102
|
+
|
|
103
|
+
const symbol = createPythonSymbol(
|
|
104
|
+
param.name,
|
|
105
|
+
{
|
|
106
|
+
refkeys: param.refkey,
|
|
107
|
+
type: TypeSlot.firstSymbol,
|
|
108
|
+
},
|
|
109
|
+
"parameter",
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
...param,
|
|
114
|
+
symbol,
|
|
115
|
+
TypeSlot,
|
|
116
|
+
};
|
|
117
|
+
} else {
|
|
118
|
+
const symbol = createPythonSymbol(param, {}, "parameter");
|
|
119
|
+
return { symbol };
|
|
120
|
+
}
|
|
117
121
|
}
|
|
118
122
|
|
|
119
123
|
export interface CallSignatureProps {
|
|
120
124
|
/**
|
|
121
|
-
* The parameters to the call signature. Can be an array of strings (for
|
|
122
|
-
*
|
|
125
|
+
* The parameters to the call signature. Can be an array of strings (for simple
|
|
126
|
+
* parameter names), {@link ParameterDescriptor}s, or special markers ("*" for
|
|
127
|
+
* keyword-only, "/" for positional-only).
|
|
123
128
|
*/
|
|
124
|
-
parameters?: (ParameterDescriptor | string)[];
|
|
129
|
+
parameters?: (ParameterDescriptor | ParameterMarker | string)[];
|
|
125
130
|
|
|
126
131
|
/**
|
|
127
132
|
* The type parameters of the call signature, e.g. for a generic function.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Children } from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
export interface FutureStatementProps {
|
|
4
|
+
/**
|
|
5
|
+
* The name of the feature to import from __future__.
|
|
6
|
+
*/
|
|
7
|
+
feature: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A future statement that imports features from __future__.
|
|
12
|
+
*
|
|
13
|
+
* Future statements are directives to the compiler that a particular module
|
|
14
|
+
* should be compiled using syntax or semantics from a future Python release.
|
|
15
|
+
* They must appear near the top of the module, after the module docstring (if any).
|
|
16
|
+
*
|
|
17
|
+
* Use this in the `futureImports` prop of SourceFile to ensure proper placement.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <SourceFile path="models.py" futureImports={<FutureStatement feature="annotations" />}>
|
|
22
|
+
* <ClassDeclaration name="User">
|
|
23
|
+
* <PropertyDeclaration name="manager" type="User" />
|
|
24
|
+
* </ClassDeclaration>
|
|
25
|
+
* </SourceFile>
|
|
26
|
+
* ```
|
|
27
|
+
* renders to
|
|
28
|
+
* ```py
|
|
29
|
+
* from __future__ import annotations
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* class User:
|
|
33
|
+
* manager: User
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export function FutureStatement(props: FutureStatementProps): Children {
|
|
37
|
+
return <>from __future__ import {props.feature}</>;
|
|
38
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
childrenArray,
|
|
2
3
|
ComponentContext,
|
|
3
4
|
SourceFile as CoreSourceFile,
|
|
4
5
|
createNamedContext,
|
|
6
|
+
isComponentCreator,
|
|
5
7
|
List,
|
|
6
8
|
Scope,
|
|
7
9
|
Show,
|
|
@@ -12,8 +14,51 @@ import {
|
|
|
12
14
|
import { join } from "pathe";
|
|
13
15
|
import { PythonModuleScope } from "../symbols/index.js";
|
|
14
16
|
import { ImportStatements } from "./ImportStatement.js";
|
|
17
|
+
import { SimpleCommentBlock } from "./PyDoc.js";
|
|
15
18
|
import { Reference } from "./Reference.js";
|
|
16
19
|
|
|
20
|
+
// Non top-level definitions
|
|
21
|
+
const NON_DEFINITION_NAMES = new Set([
|
|
22
|
+
"VariableDeclaration",
|
|
23
|
+
"MemberExpression",
|
|
24
|
+
"FunctionCallExpression",
|
|
25
|
+
"ClassInstantiation",
|
|
26
|
+
"Reference",
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
// Wrapper components that we should look inside to find the actual first child
|
|
30
|
+
const WRAPPER_COMPONENT_NAMES = new Set(["StatementList"]);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Checks if the first child is a top-level definition (function or class).
|
|
34
|
+
* PEP 8 requires 2 blank lines before top-level function and class definitions,
|
|
35
|
+
* but not before other statements like variable assignments.
|
|
36
|
+
*
|
|
37
|
+
* Returns true only if there are children and the first child is a definition.
|
|
38
|
+
*/
|
|
39
|
+
function firstChildIsDefinition(children: Children | undefined): boolean {
|
|
40
|
+
if (!children) return false;
|
|
41
|
+
const arr = childrenArray(() => children);
|
|
42
|
+
if (arr.length === 0) return false;
|
|
43
|
+
const first = arr[0];
|
|
44
|
+
|
|
45
|
+
// Non-component children (strings, numbers, refkeys, etc.) are not definitions
|
|
46
|
+
if (!isComponentCreator(first)) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const name = first.component.name;
|
|
51
|
+
if (NON_DEFINITION_NAMES.has(name)) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
// Look inside wrapper components
|
|
55
|
+
if (WRAPPER_COMPONENT_NAMES.has(name) && first.props?.children) {
|
|
56
|
+
return firstChildIsDefinition(first.props.children as Children);
|
|
57
|
+
}
|
|
58
|
+
// If we get here, it's likely a definition (FunctionDeclaration, ClassDeclaration, etc.)
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
17
62
|
export interface PythonSourceFileContext {
|
|
18
63
|
scope: PythonModuleScope;
|
|
19
64
|
/** The module name for this file, e.g. 'test' for test.py */
|
|
@@ -37,17 +82,23 @@ export interface SourceFileProps {
|
|
|
37
82
|
*/
|
|
38
83
|
children?: Children;
|
|
39
84
|
/**
|
|
40
|
-
*
|
|
85
|
+
* Content to render at the very top of the file, before everything else.
|
|
86
|
+
* Use this for shebang lines, encoding declarations, or license headers.
|
|
41
87
|
*/
|
|
42
88
|
header?: Children;
|
|
43
89
|
/**
|
|
44
|
-
* Comment to add
|
|
90
|
+
* Comment to add at the top of the file, rendered as a Python comment block.
|
|
91
|
+
* This is a convenience prop for adding copyright notices or other comments.
|
|
45
92
|
*/
|
|
46
93
|
headerComment?: string;
|
|
47
94
|
/**
|
|
48
95
|
* Documentation for this module, which will be rendered as a module-level docstring.
|
|
49
96
|
*/
|
|
50
97
|
doc?: Children;
|
|
98
|
+
/**
|
|
99
|
+
* __future__ imports to render after the docstring but before regular imports.
|
|
100
|
+
*/
|
|
101
|
+
futureImports?: Children;
|
|
51
102
|
}
|
|
52
103
|
|
|
53
104
|
/**
|
|
@@ -100,21 +151,90 @@ export function SourceFile(props: SourceFileProps) {
|
|
|
100
151
|
module: path,
|
|
101
152
|
};
|
|
102
153
|
|
|
154
|
+
// Check if there are any children
|
|
155
|
+
const hasChildren =
|
|
156
|
+
props.children !== undefined &&
|
|
157
|
+
childrenArray(() => props.children).length > 0;
|
|
158
|
+
|
|
159
|
+
// PEP 8 requires 2 blank lines before top-level function/class definitions
|
|
160
|
+
const needsExtraSpacing = firstChildIsDefinition(props.children);
|
|
161
|
+
|
|
162
|
+
// Check if there's any preamble content (header, doc, imports, etc.)
|
|
163
|
+
const hasPreamble =
|
|
164
|
+
props.header !== undefined ||
|
|
165
|
+
props.headerComment !== undefined ||
|
|
166
|
+
props.doc !== undefined ||
|
|
167
|
+
props.futureImports !== undefined;
|
|
168
|
+
|
|
103
169
|
return (
|
|
104
|
-
<CoreSourceFile
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
170
|
+
<CoreSourceFile
|
|
171
|
+
path={props.path}
|
|
172
|
+
filetype="py"
|
|
173
|
+
reference={Reference}
|
|
174
|
+
header={props.header}
|
|
175
|
+
>
|
|
176
|
+
{/* Extra blank line after header when followed by doc/futureImports/children (not headerComment) */}
|
|
177
|
+
<Show
|
|
178
|
+
when={
|
|
179
|
+
props.header !== undefined &&
|
|
180
|
+
props.headerComment === undefined &&
|
|
181
|
+
(props.doc !== undefined ||
|
|
182
|
+
props.futureImports !== undefined ||
|
|
183
|
+
hasChildren)
|
|
184
|
+
}
|
|
185
|
+
>
|
|
108
186
|
<hbr />
|
|
109
187
|
</Show>
|
|
188
|
+
<Show when={props.headerComment !== undefined}>
|
|
189
|
+
<SimpleCommentBlock>{props.headerComment}</SimpleCommentBlock>
|
|
190
|
+
{/* When followed by doc: just newline (no blank line) */}
|
|
191
|
+
<Show when={props.doc !== undefined}>
|
|
192
|
+
<hbr />
|
|
193
|
+
</Show>
|
|
194
|
+
{/* When followed by futureImports or children directly (no doc): blank line */}
|
|
195
|
+
<Show
|
|
196
|
+
when={
|
|
197
|
+
props.doc === undefined &&
|
|
198
|
+
(props.futureImports !== undefined || hasChildren)
|
|
199
|
+
}
|
|
200
|
+
>
|
|
201
|
+
<hbr />
|
|
202
|
+
<hbr />
|
|
203
|
+
</Show>
|
|
204
|
+
</Show>
|
|
110
205
|
<Show when={props.doc !== undefined}>
|
|
111
206
|
{props.doc}
|
|
112
|
-
<
|
|
207
|
+
<Show when={props.futureImports !== undefined || hasChildren}>
|
|
208
|
+
<hbr />
|
|
209
|
+
</Show>
|
|
210
|
+
</Show>
|
|
211
|
+
<Show when={props.futureImports !== undefined}>
|
|
212
|
+
{props.futureImports}
|
|
213
|
+
<Show when={hasChildren}>
|
|
214
|
+
<hbr />
|
|
215
|
+
<hbr />
|
|
216
|
+
</Show>
|
|
217
|
+
</Show>
|
|
218
|
+
<Show when={scope.importedModules.size > 0}>
|
|
219
|
+
<ImportStatements records={scope.importedModules} />
|
|
220
|
+
<Show when={hasChildren}>
|
|
221
|
+
<hbr />
|
|
222
|
+
<hbr />
|
|
223
|
+
</Show>
|
|
224
|
+
</Show>
|
|
225
|
+
{/* Extra blank line before top-level definitions */}
|
|
226
|
+
<Show
|
|
227
|
+
when={
|
|
228
|
+
needsExtraSpacing && (hasPreamble || scope.importedModules.size > 0)
|
|
229
|
+
}
|
|
230
|
+
>
|
|
113
231
|
<hbr />
|
|
114
232
|
</Show>
|
|
115
233
|
<PythonSourceFileContext.Provider value={sfContext}>
|
|
116
234
|
<Scope value={scope}>
|
|
117
|
-
<
|
|
235
|
+
<Show when={hasChildren}>
|
|
236
|
+
<List doubleHardline>{props.children}</List>
|
|
237
|
+
</Show>
|
|
118
238
|
</Scope>
|
|
119
239
|
</PythonSourceFileContext.Provider>
|
|
120
240
|
</CoreSourceFile>
|
package/src/components/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from "./EnumMember.js";
|
|
|
12
12
|
export type { CommonFunctionProps } from "./FunctionBase.js";
|
|
13
13
|
export * from "./FunctionCallExpression.js";
|
|
14
14
|
export * from "./FunctionDeclaration.js";
|
|
15
|
+
export * from "./FutureStatement.js";
|
|
15
16
|
export * from "./ImportStatement.js";
|
|
16
17
|
export * from "./LexicalScope.js";
|
|
17
18
|
export * from "./MemberExpression.js";
|
package/temp/api.json
CHANGED
|
@@ -831,6 +831,15 @@
|
|
|
831
831
|
"text": "ParameterDescriptor",
|
|
832
832
|
"canonicalReference": "@alloy-js/python!ParameterDescriptor:interface"
|
|
833
833
|
},
|
|
834
|
+
{
|
|
835
|
+
"kind": "Content",
|
|
836
|
+
"text": " | "
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"kind": "Reference",
|
|
840
|
+
"text": "ParameterMarker",
|
|
841
|
+
"canonicalReference": "@alloy-js/python!ParameterMarker:type"
|
|
842
|
+
},
|
|
834
843
|
{
|
|
835
844
|
"kind": "Content",
|
|
836
845
|
"text": " | string)[]"
|
|
@@ -846,7 +855,7 @@
|
|
|
846
855
|
"name": "parameters",
|
|
847
856
|
"propertyTypeTokenRange": {
|
|
848
857
|
"startIndex": 1,
|
|
849
|
-
"endIndex":
|
|
858
|
+
"endIndex": 6
|
|
850
859
|
}
|
|
851
860
|
}
|
|
852
861
|
],
|
|
@@ -924,7 +933,7 @@
|
|
|
924
933
|
{
|
|
925
934
|
"kind": "PropertySignature",
|
|
926
935
|
"canonicalReference": "@alloy-js/python!CallSignatureProps#parameters:member",
|
|
927
|
-
"docComment": "/**\n * The parameters to the call signature. Can be an array of strings (for
|
|
936
|
+
"docComment": "/**\n * The parameters to the call signature. Can be an array of strings (for simple\n * parameter names), {@link ParameterDescriptor}s, or special markers (\"*\" for\n * keyword-only, \"/\" for positional-only).\n */\n",
|
|
928
937
|
"excerptTokens": [
|
|
929
938
|
{
|
|
930
939
|
"kind": "Content",
|
|
@@ -939,6 +948,15 @@
|
|
|
939
948
|
"text": "ParameterDescriptor",
|
|
940
949
|
"canonicalReference": "@alloy-js/python!ParameterDescriptor:interface"
|
|
941
950
|
},
|
|
951
|
+
{
|
|
952
|
+
"kind": "Content",
|
|
953
|
+
"text": " | "
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
"kind": "Reference",
|
|
957
|
+
"text": "ParameterMarker",
|
|
958
|
+
"canonicalReference": "@alloy-js/python!ParameterMarker:type"
|
|
959
|
+
},
|
|
942
960
|
{
|
|
943
961
|
"kind": "Content",
|
|
944
962
|
"text": " | string)[]"
|
|
@@ -954,7 +972,7 @@
|
|
|
954
972
|
"name": "parameters",
|
|
955
973
|
"propertyTypeTokenRange": {
|
|
956
974
|
"startIndex": 1,
|
|
957
|
-
"endIndex":
|
|
975
|
+
"endIndex": 6
|
|
958
976
|
}
|
|
959
977
|
},
|
|
960
978
|
{
|
|
@@ -4332,6 +4350,98 @@
|
|
|
4332
4350
|
],
|
|
4333
4351
|
"extendsTokenRanges": []
|
|
4334
4352
|
},
|
|
4353
|
+
{
|
|
4354
|
+
"kind": "Function",
|
|
4355
|
+
"canonicalReference": "@alloy-js/python!FutureStatement:function(1)",
|
|
4356
|
+
"docComment": "/**\n * A future statement that imports features from __future__.\n *\n * Future statements are directives to the compiler that a particular module\n * should be compiled using syntax or semantics from a future Python release.\n * 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",
|
|
4357
|
+
"excerptTokens": [
|
|
4358
|
+
{
|
|
4359
|
+
"kind": "Content",
|
|
4360
|
+
"text": "export declare function FutureStatement(props: "
|
|
4361
|
+
},
|
|
4362
|
+
{
|
|
4363
|
+
"kind": "Reference",
|
|
4364
|
+
"text": "FutureStatementProps",
|
|
4365
|
+
"canonicalReference": "@alloy-js/python!FutureStatementProps:interface"
|
|
4366
|
+
},
|
|
4367
|
+
{
|
|
4368
|
+
"kind": "Content",
|
|
4369
|
+
"text": "): "
|
|
4370
|
+
},
|
|
4371
|
+
{
|
|
4372
|
+
"kind": "Reference",
|
|
4373
|
+
"text": "Children",
|
|
4374
|
+
"canonicalReference": "@alloy-js/core!Children:type"
|
|
4375
|
+
},
|
|
4376
|
+
{
|
|
4377
|
+
"kind": "Content",
|
|
4378
|
+
"text": ";"
|
|
4379
|
+
}
|
|
4380
|
+
],
|
|
4381
|
+
"fileUrlPath": "src/components/FutureStatement.tsx",
|
|
4382
|
+
"returnTypeTokenRange": {
|
|
4383
|
+
"startIndex": 3,
|
|
4384
|
+
"endIndex": 4
|
|
4385
|
+
},
|
|
4386
|
+
"releaseTag": "Public",
|
|
4387
|
+
"overloadIndex": 1,
|
|
4388
|
+
"parameters": [
|
|
4389
|
+
{
|
|
4390
|
+
"parameterName": "props",
|
|
4391
|
+
"parameterTypeTokenRange": {
|
|
4392
|
+
"startIndex": 1,
|
|
4393
|
+
"endIndex": 2
|
|
4394
|
+
},
|
|
4395
|
+
"isOptional": false
|
|
4396
|
+
}
|
|
4397
|
+
],
|
|
4398
|
+
"name": "FutureStatement"
|
|
4399
|
+
},
|
|
4400
|
+
{
|
|
4401
|
+
"kind": "Interface",
|
|
4402
|
+
"canonicalReference": "@alloy-js/python!FutureStatementProps:interface",
|
|
4403
|
+
"docComment": "",
|
|
4404
|
+
"excerptTokens": [
|
|
4405
|
+
{
|
|
4406
|
+
"kind": "Content",
|
|
4407
|
+
"text": "export interface FutureStatementProps "
|
|
4408
|
+
}
|
|
4409
|
+
],
|
|
4410
|
+
"fileUrlPath": "src/components/FutureStatement.tsx",
|
|
4411
|
+
"releaseTag": "Public",
|
|
4412
|
+
"name": "FutureStatementProps",
|
|
4413
|
+
"preserveMemberOrder": false,
|
|
4414
|
+
"members": [
|
|
4415
|
+
{
|
|
4416
|
+
"kind": "PropertySignature",
|
|
4417
|
+
"canonicalReference": "@alloy-js/python!FutureStatementProps#feature:member",
|
|
4418
|
+
"docComment": "/**\n * The name of the feature to import from __future__.\n */\n",
|
|
4419
|
+
"excerptTokens": [
|
|
4420
|
+
{
|
|
4421
|
+
"kind": "Content",
|
|
4422
|
+
"text": "feature: "
|
|
4423
|
+
},
|
|
4424
|
+
{
|
|
4425
|
+
"kind": "Content",
|
|
4426
|
+
"text": "string"
|
|
4427
|
+
},
|
|
4428
|
+
{
|
|
4429
|
+
"kind": "Content",
|
|
4430
|
+
"text": ";"
|
|
4431
|
+
}
|
|
4432
|
+
],
|
|
4433
|
+
"isReadonly": false,
|
|
4434
|
+
"isOptional": false,
|
|
4435
|
+
"releaseTag": "Public",
|
|
4436
|
+
"name": "feature",
|
|
4437
|
+
"propertyTypeTokenRange": {
|
|
4438
|
+
"startIndex": 1,
|
|
4439
|
+
"endIndex": 2
|
|
4440
|
+
}
|
|
4441
|
+
}
|
|
4442
|
+
],
|
|
4443
|
+
"extendsTokenRanges": []
|
|
4444
|
+
},
|
|
4335
4445
|
{
|
|
4336
4446
|
"kind": "Function",
|
|
4337
4447
|
"canonicalReference": "@alloy-js/python!GeneratorDoc:function(1)",
|
|
@@ -7384,6 +7494,32 @@
|
|
|
7384
7494
|
],
|
|
7385
7495
|
"extendsTokenRanges": []
|
|
7386
7496
|
},
|
|
7497
|
+
{
|
|
7498
|
+
"kind": "TypeAlias",
|
|
7499
|
+
"canonicalReference": "@alloy-js/python!ParameterMarker:type",
|
|
7500
|
+
"docComment": "",
|
|
7501
|
+
"excerptTokens": [
|
|
7502
|
+
{
|
|
7503
|
+
"kind": "Content",
|
|
7504
|
+
"text": "export type ParameterMarker = "
|
|
7505
|
+
},
|
|
7506
|
+
{
|
|
7507
|
+
"kind": "Content",
|
|
7508
|
+
"text": "\"*\" | \"/\""
|
|
7509
|
+
},
|
|
7510
|
+
{
|
|
7511
|
+
"kind": "Content",
|
|
7512
|
+
"text": ";"
|
|
7513
|
+
}
|
|
7514
|
+
],
|
|
7515
|
+
"fileUrlPath": "src/components/CallSignature.tsx",
|
|
7516
|
+
"releaseTag": "Public",
|
|
7517
|
+
"name": "ParameterMarker",
|
|
7518
|
+
"typeTokenRange": {
|
|
7519
|
+
"startIndex": 1,
|
|
7520
|
+
"endIndex": 2
|
|
7521
|
+
}
|
|
7522
|
+
},
|
|
7387
7523
|
{
|
|
7388
7524
|
"kind": "Function",
|
|
7389
7525
|
"canonicalReference": "@alloy-js/python!PropertyDeclaration:function(1)",
|
|
@@ -9942,10 +10078,38 @@
|
|
|
9942
10078
|
"endIndex": 2
|
|
9943
10079
|
}
|
|
9944
10080
|
},
|
|
10081
|
+
{
|
|
10082
|
+
"kind": "PropertySignature",
|
|
10083
|
+
"canonicalReference": "@alloy-js/python!SourceFileProps#futureImports:member",
|
|
10084
|
+
"docComment": "/**\n * __future__ imports to render after the docstring but before regular imports.\n */\n",
|
|
10085
|
+
"excerptTokens": [
|
|
10086
|
+
{
|
|
10087
|
+
"kind": "Content",
|
|
10088
|
+
"text": "futureImports?: "
|
|
10089
|
+
},
|
|
10090
|
+
{
|
|
10091
|
+
"kind": "Reference",
|
|
10092
|
+
"text": "Children",
|
|
10093
|
+
"canonicalReference": "@alloy-js/core!Children:type"
|
|
10094
|
+
},
|
|
10095
|
+
{
|
|
10096
|
+
"kind": "Content",
|
|
10097
|
+
"text": ";"
|
|
10098
|
+
}
|
|
10099
|
+
],
|
|
10100
|
+
"isReadonly": false,
|
|
10101
|
+
"isOptional": true,
|
|
10102
|
+
"releaseTag": "Public",
|
|
10103
|
+
"name": "futureImports",
|
|
10104
|
+
"propertyTypeTokenRange": {
|
|
10105
|
+
"startIndex": 1,
|
|
10106
|
+
"endIndex": 2
|
|
10107
|
+
}
|
|
10108
|
+
},
|
|
9945
10109
|
{
|
|
9946
10110
|
"kind": "PropertySignature",
|
|
9947
10111
|
"canonicalReference": "@alloy-js/python!SourceFileProps#header:member",
|
|
9948
|
-
"docComment": "/**\n *
|
|
10112
|
+
"docComment": "/**\n * Content to render at the very top of the file, before everything else.\n * Use this for shebang lines, encoding declarations, or license headers.\n */\n",
|
|
9949
10113
|
"excerptTokens": [
|
|
9950
10114
|
{
|
|
9951
10115
|
"kind": "Content",
|
|
@@ -9973,7 +10137,7 @@
|
|
|
9973
10137
|
{
|
|
9974
10138
|
"kind": "PropertySignature",
|
|
9975
10139
|
"canonicalReference": "@alloy-js/python!SourceFileProps#headerComment:member",
|
|
9976
|
-
"docComment": "/**\n * Comment to add
|
|
10140
|
+
"docComment": "/**\n * Comment to add at the top of the file, rendered as a Python comment block.\n * This is a convenience prop for adding copyright notices or other comments.\n */\n",
|
|
9977
10141
|
"excerptTokens": [
|
|
9978
10142
|
{
|
|
9979
10143
|
"kind": "Content",
|