@alloy-js/typescript 0.20.0-dev.0 → 0.20.0-dev.1
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/builtins/node.d.ts +1 -1
- package/dist/src/components/ArrowFunction.d.ts.map +1 -1
- package/dist/src/components/ArrowFunction.js +7 -13
- package/dist/src/components/BlockScope.d.ts.map +1 -1
- package/dist/src/components/BlockScope.js +3 -2
- package/dist/src/components/ClassDeclaration.d.ts.map +1 -1
- package/dist/src/components/ClassDeclaration.js +20 -30
- package/dist/src/components/Declaration.d.ts +2 -9
- package/dist/src/components/Declaration.d.ts.map +1 -1
- package/dist/src/components/Declaration.js +20 -43
- package/dist/src/components/EnumDeclaration.d.ts.map +1 -1
- package/dist/src/components/EnumDeclaration.js +5 -9
- package/dist/src/components/EnumMember.d.ts.map +1 -1
- package/dist/src/components/EnumMember.js +3 -4
- package/dist/src/components/ExportStatement.d.ts.map +1 -1
- package/dist/src/components/ExportStatement.js +2 -1
- package/dist/src/components/FunctionBase.d.ts.map +1 -1
- package/dist/src/components/FunctionBase.js +15 -12
- package/dist/src/components/FunctionDeclaration.d.ts.map +1 -1
- package/dist/src/components/FunctionDeclaration.js +3 -3
- package/dist/src/components/FunctionExpression.d.ts.map +1 -1
- package/dist/src/components/FunctionExpression.js +7 -13
- package/dist/src/components/FunctionType.d.ts.map +1 -1
- package/dist/src/components/FunctionType.js +3 -3
- package/dist/src/components/IfStatement.d.ts.map +1 -1
- package/dist/src/components/IfStatement.js +2 -1
- package/dist/src/components/ImportStatement.d.ts.map +1 -1
- package/dist/src/components/ImportStatement.js +3 -4
- package/dist/src/components/Interface.d.ts.map +1 -1
- package/dist/src/components/Interface.js +14 -13
- package/dist/src/components/InterfaceMethod.d.ts.map +1 -1
- package/dist/src/components/InterfaceMethod.js +4 -3
- package/dist/src/components/LexicalScope.d.ts +12 -0
- package/dist/src/components/LexicalScope.d.ts.map +1 -0
- package/dist/src/components/LexicalScope.js +24 -0
- package/dist/src/components/MemberDeclaration.d.ts +1 -10
- package/dist/src/components/MemberDeclaration.d.ts.map +1 -1
- package/dist/src/components/MemberDeclaration.js +3 -7
- package/dist/src/components/MemberExpression.d.ts.map +1 -1
- package/dist/src/components/MemberExpression.js +13 -5
- package/dist/src/components/MemberScope.d.ts +15 -0
- package/dist/src/components/MemberScope.d.ts.map +1 -0
- package/dist/src/components/MemberScope.js +17 -0
- package/dist/src/components/NewExpression.d.ts.map +1 -1
- package/dist/src/components/NewExpression.js +5 -5
- package/dist/src/components/ObjectExpression.d.ts.map +1 -1
- package/dist/src/components/ObjectExpression.js +10 -14
- package/dist/src/components/PropertyName.js +1 -2
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +3 -2
- package/dist/src/components/VarDeclaration.d.ts.map +1 -1
- package/dist/src/components/VarDeclaration.js +14 -26
- package/dist/src/context/index.d.ts +1 -1
- package/dist/src/context/index.d.ts.map +1 -1
- package/dist/src/context/index.js +1 -1
- package/dist/src/create-package.d.ts.map +1 -1
- package/dist/src/create-package.js +11 -33
- package/dist/src/symbols/index.d.ts +19 -0
- package/dist/src/symbols/index.d.ts.map +1 -1
- package/dist/src/symbols/index.js +72 -1
- package/dist/src/symbols/reference.d.ts +2 -2
- package/dist/src/symbols/reference.d.ts.map +1 -1
- package/dist/src/symbols/reference.js +68 -70
- package/dist/src/symbols/scopes.d.ts +5 -8
- package/dist/src/symbols/scopes.d.ts.map +1 -1
- package/dist/src/symbols/scopes.js +26 -0
- package/dist/src/symbols/ts-lexical-scope.d.ts +12 -0
- package/dist/src/symbols/ts-lexical-scope.d.ts.map +1 -0
- package/dist/src/symbols/ts-lexical-scope.js +16 -0
- package/dist/src/symbols/ts-member-scope.d.ts +12 -4
- package/dist/src/symbols/ts-member-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-member-scope.js +15 -6
- package/dist/src/symbols/ts-module-scope.d.ts +8 -3
- package/dist/src/symbols/ts-module-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-module-scope.js +29 -18
- package/dist/src/symbols/ts-output-symbol.d.ts +19 -18
- package/dist/src/symbols/ts-output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/ts-output-symbol.js +60 -37
- package/dist/src/symbols/ts-package-scope.d.ts +1 -1
- package/dist/src/symbols/ts-package-scope.d.ts.map +1 -1
- package/dist/src/symbols/ts-package-scope.js +4 -5
- package/dist/src/utils.d.ts +4 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +23 -1
- package/dist/test/class.test.js +4 -4
- package/dist/test/externals.test.js +2 -38
- package/dist/test/reference.test.js +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/ArrowFunction.tsx +7 -10
- package/src/components/BlockScope.tsx +3 -3
- package/src/components/ClassDeclaration.tsx +19 -44
- package/src/components/Declaration.tsx +22 -53
- package/src/components/EnumDeclaration.tsx +4 -11
- package/src/components/EnumMember.tsx +3 -3
- package/src/components/ExportStatement.tsx +2 -1
- package/src/components/FunctionBase.tsx +33 -28
- package/src/components/FunctionDeclaration.tsx +3 -3
- package/src/components/FunctionExpression.tsx +7 -10
- package/src/components/FunctionType.tsx +3 -3
- package/src/components/IfStatement.tsx +2 -1
- package/src/components/ImportStatement.tsx +4 -8
- package/src/components/Interface.tsx +15 -22
- package/src/components/InterfaceMethod.tsx +4 -4
- package/src/components/LexicalScope.tsx +27 -0
- package/src/components/MemberDeclaration.tsx +8 -20
- package/src/components/MemberExpression.tsx +25 -5
- package/src/components/MemberScope.tsx +29 -0
- package/src/components/NewExpression.tsx +4 -5
- package/src/components/ObjectExpression.tsx +11 -18
- package/src/components/PropertyName.tsx +2 -2
- package/src/components/SourceFile.tsx +3 -1
- package/src/components/VarDeclaration.tsx +14 -28
- package/src/context/index.ts +1 -1
- package/src/create-package.ts +10 -39
- package/src/symbols/index.ts +118 -0
- package/src/symbols/reference.tsx +163 -0
- package/src/symbols/scopes.ts +38 -13
- package/src/symbols/ts-lexical-scope.ts +18 -0
- package/src/symbols/ts-member-scope.ts +23 -6
- package/src/symbols/ts-module-scope.ts +31 -21
- package/src/symbols/ts-output-symbol.ts +111 -49
- package/src/symbols/ts-package-scope.ts +5 -5
- package/src/utils.ts +38 -1
- package/temp/api.json +1641 -713
- package/test/class.test.tsx +10 -4
- package/test/externals.test.tsx +1 -40
- package/test/reference.test.tsx +5 -5
- package/tsdoc-metadata.json +1 -1
- package/dist/src/context/private-scope.d.ts +0 -18
- package/dist/src/context/private-scope.d.ts.map +0 -1
- package/dist/src/context/private-scope.js +0 -8
- package/src/context/private-scope.ts +0 -23
- package/src/symbols/reference.ts +0 -197
|
@@ -123,6 +123,7 @@ export declare const fs: {
|
|
|
123
123
|
export declare const util: {
|
|
124
124
|
default: import("@alloy-js/core").Refkey;
|
|
125
125
|
} & {
|
|
126
|
+
types: import("@alloy-js/core").Refkey;
|
|
126
127
|
format: import("@alloy-js/core").Refkey;
|
|
127
128
|
callbackify: import("@alloy-js/core").Refkey;
|
|
128
129
|
debuglog: import("@alloy-js/core").Refkey;
|
|
@@ -147,6 +148,5 @@ export declare const util: {
|
|
|
147
148
|
transferableAbortController: import("@alloy-js/core").Refkey;
|
|
148
149
|
transferableAbortSignal: import("@alloy-js/core").Refkey;
|
|
149
150
|
aborted: import("@alloy-js/core").Refkey;
|
|
150
|
-
types: import("@alloy-js/core").Refkey;
|
|
151
151
|
} & {} & {} & SymbolCreator;
|
|
152
152
|
//# sourceMappingURL=node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrowFunction.d.ts","sourceRoot":"","sources":["../../../src/components/ArrowFunction.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ArrowFunction.d.ts","sourceRoot":"","sources":["../../../src/components/ArrowFunction.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAiB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AASxE,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,YA+BtD;yBA/Be,aAAa"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { childrenArray, findKeyedChild, findUnkeyedChildren
|
|
2
|
+
import { childrenArray, findKeyedChild, findUnkeyedChildren } from "@alloy-js/core";
|
|
3
3
|
import { getCallSignatureProps } from "../utils.js";
|
|
4
4
|
import { CallSignature } from "./CallSignature.js";
|
|
5
|
-
import { Declaration } from "./Declaration.js";
|
|
6
5
|
import { FunctionBody, FunctionParameters, getReturnType, TypeParameters } from "./FunctionBase.js";
|
|
6
|
+
import { LexicalScope } from "./LexicalScope.js";
|
|
7
7
|
/**
|
|
8
8
|
* A TypeScript arrow function expression.
|
|
9
9
|
*
|
|
@@ -48,19 +48,13 @@ export function ArrowFunction(props) {
|
|
|
48
48
|
parametersChildren,
|
|
49
49
|
typeParametersChildren
|
|
50
50
|
});
|
|
51
|
-
return [
|
|
52
|
-
nameKind: "function",
|
|
51
|
+
return [asyncKwd, _$createComponent(LexicalScope, {
|
|
53
52
|
get children() {
|
|
54
|
-
return [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return [_$createComponent(CallSignature, _$mergeProps(callSignatureProps, {
|
|
58
|
-
returnType: returnType
|
|
59
|
-
})), " => ", sBody];
|
|
60
|
-
}
|
|
61
|
-
})];
|
|
53
|
+
return [_$createComponent(CallSignature, _$mergeProps(callSignatureProps, {
|
|
54
|
+
returnType: returnType
|
|
55
|
+
})), " => ", sBody];
|
|
62
56
|
}
|
|
63
|
-
})
|
|
57
|
+
})];
|
|
64
58
|
}
|
|
65
59
|
ArrowFunction.TypeParameters = TypeParameters;
|
|
66
60
|
ArrowFunction.Parameters = FunctionParameters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockScope.d.ts","sourceRoot":"","sources":["../../../src/components/BlockScope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,
|
|
1
|
+
{"version":3,"file":"BlockScope.d.ts","sourceRoot":"","sources":["../../../src/components/BlockScope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AAGxB,MAAM,WAAW,6BACf,SAAQ,mBAAmB,EACzB,UAAU;CAAG;AACjB,MAAM,WAAW,4BACf,SAAQ,kBAAkB,EACxB,UAAU;CAAG;AAEjB,MAAM,MAAM,eAAe,GACvB,6BAA6B,GAC7B,4BAA4B,CAAC;AAEjC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qCAMhD"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { mergeProps as _$mergeProps, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { Block
|
|
2
|
+
import { Block } from "@alloy-js/core";
|
|
3
|
+
import { LexicalScope } from "./LexicalScope.js";
|
|
3
4
|
/**
|
|
4
5
|
* Create a TypeScript block which includes a scope for any nested declarations.
|
|
5
6
|
* Can either provide the scope directly via the `value` prop, or else provide
|
|
6
7
|
* information about the scope.
|
|
7
8
|
*/
|
|
8
9
|
export function BlockScope(props) {
|
|
9
|
-
return _$createComponent(
|
|
10
|
+
return _$createComponent(LexicalScope, _$mergeProps(props, {
|
|
10
11
|
get children() {
|
|
11
12
|
return _$createComponent(Block, _$mergeProps(props, {
|
|
12
13
|
get children() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/ClassDeclaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,
|
|
1
|
+
{"version":3,"file":"ClassDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/ClassDeclaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAIR,MAAM,EAGP,MAAM,gBAAgB,CAAC;AASxB,OAAO,EAAiB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAe,MAAM,mBAAmB,CAAC;AAQtE,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,YA2B5D;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YA6BlD;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YAiBhD;AAED,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB,EAAE,kBAAkB;IAC5E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YAwBlD"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { memo as _$memo, createComponent as _$createComponent, createIntrinsic as _$createIntrinsic, mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { Block, MemberDeclaration, Name,
|
|
3
|
-
import { usePrivateScope } from "../context/private-scope.js";
|
|
2
|
+
import { Block, MemberDeclaration, Name, Prose, Show, splitProps } from "@alloy-js/core";
|
|
4
3
|
import { useTSNamePolicy } from "../name-policy.js";
|
|
5
|
-
import {
|
|
4
|
+
import { createMemberSymbol, createTypeAndValueSymbol } from "../symbols/index.js";
|
|
5
|
+
import { TSSymbolFlags } from "../symbols/ts-output-symbol.js";
|
|
6
6
|
import { getCallSignatureProps } from "../utils.js";
|
|
7
7
|
import { CallSignature } from "./CallSignature.js";
|
|
8
8
|
import { Declaration } from "./Declaration.js";
|
|
9
9
|
import { JSDoc } from "./JSDoc.js";
|
|
10
10
|
import { JSDocParams } from "./JSDocParam.js";
|
|
11
|
+
import { LexicalScope } from "./LexicalScope.js";
|
|
12
|
+
import { MemberScope } from "./MemberScope.js";
|
|
11
13
|
import { PropertyName } from "./PropertyName.js";
|
|
12
14
|
import { TypeRefContext } from "./TypeRefContext.js";
|
|
13
15
|
/**
|
|
@@ -45,14 +47,14 @@ import { TypeRefContext } from "./TypeRefContext.js";
|
|
|
45
47
|
*/
|
|
46
48
|
export function ClassDeclaration(props) {
|
|
47
49
|
const namePolicy = useTSNamePolicy();
|
|
50
|
+
const name = namePolicy.getName(props.name, "class");
|
|
48
51
|
const extendsPart = props.extends && [" extends ", _$memo(() => props.extends)];
|
|
49
|
-
const sym =
|
|
52
|
+
const sym = createTypeAndValueSymbol(name, {
|
|
50
53
|
refkeys: props.refkey,
|
|
51
54
|
export: props.export,
|
|
52
55
|
default: props.default,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
metadata: props.metadata
|
|
56
|
+
metadata: props.metadata,
|
|
57
|
+
hasInstanceMembers: true
|
|
56
58
|
});
|
|
57
59
|
return [_$createComponent(Show, {
|
|
58
60
|
get when() {
|
|
@@ -74,39 +76,28 @@ export function ClassDeclaration(props) {
|
|
|
74
76
|
return props.default;
|
|
75
77
|
},
|
|
76
78
|
get children() {
|
|
77
|
-
return
|
|
79
|
+
return _$createComponent(MemberScope, {
|
|
80
|
+
ownerSymbol: sym,
|
|
78
81
|
get children() {
|
|
79
|
-
return
|
|
82
|
+
return ["class ", _$createComponent(Name, {}), extendsPart, " ", _$createComponent(Block, {
|
|
83
|
+
get children() {
|
|
84
|
+
return props.children;
|
|
85
|
+
}
|
|
86
|
+
})];
|
|
80
87
|
}
|
|
81
|
-
})
|
|
88
|
+
});
|
|
82
89
|
}
|
|
83
90
|
})];
|
|
84
91
|
}
|
|
85
92
|
export function ClassMember(props) {
|
|
86
93
|
const namer = useTSNamePolicy();
|
|
87
94
|
const name = namer.getName(props.name, "class-member-data");
|
|
88
|
-
let
|
|
89
|
-
if (props.static) {
|
|
90
|
-
flags |= OutputSymbolFlags.StaticMember;
|
|
91
|
-
} else {
|
|
92
|
-
flags |= OutputSymbolFlags.InstanceMember;
|
|
93
|
-
}
|
|
94
|
-
let scope;
|
|
95
|
-
if (props.jsPrivate) {
|
|
96
|
-
const memberScope = usePrivateScope();
|
|
97
|
-
scope = props.static ? memberScope.staticMembers : memberScope.instanceMembers;
|
|
98
|
-
} else {
|
|
99
|
-
const memberScope = useMemberScope();
|
|
100
|
-
scope = props.static ? memberScope.staticMembers : memberScope.instanceMembers;
|
|
101
|
-
}
|
|
102
|
-
let tsFlags = props.jsPrivate ? TSSymbolFlags.PrivateMember : TSSymbolFlags.None;
|
|
95
|
+
let tsFlags = TSSymbolFlags.None;
|
|
103
96
|
if (props.nullish) {
|
|
104
97
|
tsFlags |= TSSymbolFlags.Nullish;
|
|
105
98
|
}
|
|
106
|
-
const sym =
|
|
107
|
-
scope,
|
|
99
|
+
const sym = createMemberSymbol(name, props, {
|
|
108
100
|
refkeys: props.refkey,
|
|
109
|
-
flags,
|
|
110
101
|
tsFlags
|
|
111
102
|
});
|
|
112
103
|
return [_$createComponent(Show, {
|
|
@@ -167,11 +158,10 @@ export function ClassMethod(props) {
|
|
|
167
158
|
}
|
|
168
159
|
}), _$createComponent(ClassMember, _$mergeProps(rest, {
|
|
169
160
|
get children() {
|
|
170
|
-
return [_$memo(() => props.async && "async "), _$createComponent(PropertyName, {}), _$createComponent(
|
|
161
|
+
return [_$memo(() => props.async && "async "), _$createComponent(PropertyName, {}), _$createComponent(LexicalScope, {
|
|
171
162
|
get name() {
|
|
172
163
|
return props.name;
|
|
173
164
|
},
|
|
174
|
-
kind: "function",
|
|
175
165
|
get children() {
|
|
176
166
|
return [_$createComponent(CallSignature, callProps), " ", _$createComponent(Block, {
|
|
177
167
|
get children() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Children,
|
|
1
|
+
import { Children, Refkey } from "@alloy-js/core";
|
|
2
2
|
import { TypeScriptElements } from "../name-policy.js";
|
|
3
3
|
import { TSOutputSymbol } from "../symbols/index.js";
|
|
4
4
|
export interface BaseDeclarationProps {
|
|
@@ -19,10 +19,6 @@ export interface BaseDeclarationProps {
|
|
|
19
19
|
* Whether this is the default export of the module.
|
|
20
20
|
*/
|
|
21
21
|
default?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Flags for the symbol created by this component.
|
|
24
|
-
*/
|
|
25
|
-
flags?: OutputSymbolFlags;
|
|
26
22
|
children?: Children;
|
|
27
23
|
/**
|
|
28
24
|
* Whether this is a declaration of a type (e.g. interface, type alias) or a
|
|
@@ -61,10 +57,7 @@ export interface DeclarationProps extends Omit<BaseDeclarationProps, "name"> {
|
|
|
61
57
|
* @remarks
|
|
62
58
|
*
|
|
63
59
|
* This component will wrap its contents in a {@link @alloy-js/core#Declaration} component,
|
|
64
|
-
* so children can make use of declaration context.
|
|
65
|
-
* provided symbol flags have {@link @alloy-js/core#OutputSymbolFlags.MemberContainer}, this
|
|
66
|
-
* component will create a {@link @alloy-js/core#MemberScope}.
|
|
67
|
-
*
|
|
60
|
+
* so children can make use of declaration context.
|
|
68
61
|
*/
|
|
69
62
|
export declare function Declaration(props: DeclarationProps): Children;
|
|
70
63
|
//# sourceMappingURL=Declaration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Declaration.d.ts","sourceRoot":"","sources":["../../../src/components/Declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"Declaration.d.ts","sourceRoot":"","sources":["../../../src/components/Declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,MAAM,EACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAmB,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAGL,cAAc,EACf,MAAM,qBAAqB,CAAC;AAS7B,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;OAEG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAC1E;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAE9B;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YAgClD"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Declaration as CoreDeclaration
|
|
1
|
+
import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Declaration as CoreDeclaration } from "@alloy-js/core";
|
|
3
3
|
import { useTSNamePolicy } from "../name-policy.js";
|
|
4
|
-
import {
|
|
4
|
+
import { createTypeSymbol, createValueSymbol } from "../symbols/index.js";
|
|
5
5
|
|
|
6
6
|
// imports for documentation
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
8
|
|
|
9
|
-
import { PrivateScopeContext } from "../context/private-scope.js";
|
|
10
9
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
10
|
|
|
12
11
|
/**
|
|
@@ -18,10 +17,7 @@ import { PrivateScopeContext } from "../context/private-scope.js";
|
|
|
18
17
|
* @remarks
|
|
19
18
|
*
|
|
20
19
|
* This component will wrap its contents in a {@link @alloy-js/core#Declaration} component,
|
|
21
|
-
* so children can make use of declaration context.
|
|
22
|
-
* provided symbol flags have {@link @alloy-js/core#OutputSymbolFlags.MemberContainer}, this
|
|
23
|
-
* component will create a {@link @alloy-js/core#MemberScope}.
|
|
24
|
-
*
|
|
20
|
+
* so children can make use of declaration context.
|
|
25
21
|
*/
|
|
26
22
|
export function Declaration(props) {
|
|
27
23
|
let sym;
|
|
@@ -29,46 +25,27 @@ export function Declaration(props) {
|
|
|
29
25
|
sym = props.symbol;
|
|
30
26
|
} else {
|
|
31
27
|
const namePolicy = useTSNamePolicy();
|
|
32
|
-
|
|
33
|
-
if (props.kind
|
|
34
|
-
|
|
28
|
+
const name = namePolicy.getName(props.name, props.nameKind);
|
|
29
|
+
if (props.kind === "type") {
|
|
30
|
+
sym = createTypeSymbol(name, {
|
|
31
|
+
refkeys: props.refkey,
|
|
32
|
+
export: props.export,
|
|
33
|
+
default: props.default,
|
|
34
|
+
metadata: props.metadata
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
sym = createValueSymbol(name, {
|
|
38
|
+
refkeys: props.refkey,
|
|
39
|
+
export: props.export,
|
|
40
|
+
default: props.default,
|
|
41
|
+
metadata: props.metadata
|
|
42
|
+
});
|
|
35
43
|
}
|
|
36
|
-
sym = new TSOutputSymbol(namePolicy.getName(props.name, props.nameKind), {
|
|
37
|
-
refkeys: props.refkey,
|
|
38
|
-
export: props.export,
|
|
39
|
-
default: props.default,
|
|
40
|
-
flags: props.flags,
|
|
41
|
-
tsFlags,
|
|
42
|
-
metadata: props.metadata
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
function withMemberScope(children) {
|
|
46
|
-
return _$createComponent(MemberScope, {
|
|
47
|
-
owner: sym,
|
|
48
|
-
children: children
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function withPrivateMemberScope(children) {
|
|
52
|
-
const context = {
|
|
53
|
-
instanceMembers: sym.privateMemberScope,
|
|
54
|
-
staticMembers: sym.privateStaticMemberScope
|
|
55
|
-
};
|
|
56
|
-
return _$createComponent(PrivateScopeContext.Provider, {
|
|
57
|
-
value: context,
|
|
58
|
-
children: children
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
let children = () => props.children;
|
|
62
|
-
if (sym.flags & OutputSymbolFlags.MemberContainer) {
|
|
63
|
-
children = withMemberScope(children);
|
|
64
|
-
}
|
|
65
|
-
if (sym.tsFlags & TSSymbolFlags.PrivateMemberContainer) {
|
|
66
|
-
children = withPrivateMemberScope(children);
|
|
67
44
|
}
|
|
68
45
|
return _$createComponent(CoreDeclaration, {
|
|
69
46
|
symbol: sym,
|
|
70
47
|
get children() {
|
|
71
|
-
return [_$memo(() => props.export ? "export " : ""), _$memo(() => props.default ? "default " : ""), children];
|
|
48
|
+
return [_$memo(() => props.export ? "export " : ""), _$memo(() => props.default ? "default " : ""), _$memo(() => props.children)];
|
|
72
49
|
}
|
|
73
50
|
});
|
|
74
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnumDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/EnumDeclaration.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnumDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/EnumDeclaration.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAIxD,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CAC3C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qCAmC1D"}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { Block, computed, Declaration as CoreDeclaration, For,
|
|
2
|
+
import { Block, computed, Declaration as CoreDeclaration, For, Name, Show } from "@alloy-js/core";
|
|
3
3
|
import { useTSNamePolicy } from "../name-policy.js";
|
|
4
|
-
import {
|
|
4
|
+
import { createTypeAndValueSymbol } from "../symbols/index.js";
|
|
5
5
|
import { EnumMember } from "./EnumMember.js";
|
|
6
6
|
import { JSDoc } from "./JSDoc.js";
|
|
7
|
+
import { MemberScope } from "./MemberScope.js";
|
|
7
8
|
/**
|
|
8
9
|
* A TypeScript enum declaration.
|
|
9
10
|
*/
|
|
10
11
|
export function EnumDeclaration(props) {
|
|
11
12
|
const name = useTSNamePolicy().getName(props.name, "enum");
|
|
12
|
-
const
|
|
13
|
-
const scope = useTSScope();
|
|
14
|
-
const sym = new TSOutputSymbol(name, {
|
|
15
|
-
binder,
|
|
16
|
-
scope,
|
|
13
|
+
const sym = createTypeAndValueSymbol(name, {
|
|
17
14
|
refkeys: props.refkey,
|
|
18
15
|
default: props.default,
|
|
19
16
|
export: props.export,
|
|
20
|
-
flags: OutputSymbolFlags.StaticMemberContainer,
|
|
21
17
|
metadata: props.metadata
|
|
22
18
|
});
|
|
23
19
|
const valueEntries = computed(() => Object.entries(props.jsValue ?? {}));
|
|
@@ -36,7 +32,7 @@ export function EnumDeclaration(props) {
|
|
|
36
32
|
symbol: sym,
|
|
37
33
|
get children() {
|
|
38
34
|
return [_$memo(() => props.export ? "export " : ""), _$memo(() => props.default ? "default " : ""), "enum ", _$createComponent(Name, {}), " ", _$createComponent(MemberScope, {
|
|
39
|
-
|
|
35
|
+
ownerSymbol: sym,
|
|
40
36
|
get children() {
|
|
41
37
|
return _$createComponent(Block, {
|
|
42
38
|
get children() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnumMember.d.ts","sourceRoot":"","sources":["../../../src/components/EnumMember.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"EnumMember.d.ts","sourceRoot":"","sources":["../../../src/components/EnumMember.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAQ,MAAM,gBAAgB,CAAC;AAQxD,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;OAEG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YA0BhD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Show } from "@alloy-js/core";
|
|
3
3
|
import { useTSNamePolicy } from "../name-policy.js";
|
|
4
|
-
import {
|
|
4
|
+
import { createStaticMemberSymbol } from "../symbols/index.js";
|
|
5
5
|
import { JSDoc } from "./JSDoc.js";
|
|
6
6
|
import { PropertyName } from "./PropertyName.js";
|
|
7
7
|
import { ValueExpression } from "./ValueExpression.js";
|
|
@@ -13,9 +13,8 @@ export function EnumMember(props) {
|
|
|
13
13
|
const name = namer.getName(props.name, "enum-member");
|
|
14
14
|
let sym = undefined;
|
|
15
15
|
if (props.refkey) {
|
|
16
|
-
sym =
|
|
16
|
+
sym = createStaticMemberSymbol(name, {
|
|
17
17
|
refkeys: props.refkey,
|
|
18
|
-
flags: OutputSymbolFlags.StaticMember,
|
|
19
18
|
metadata: props.metadata
|
|
20
19
|
});
|
|
21
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportStatement.d.ts","sourceRoot":"","sources":["../../../src/components/ExportStatement.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAkB,MAAM,qBAAqB,CAAC;AAIpE,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ExportStatement.d.ts","sourceRoot":"","sources":["../../../src/components/ExportStatement.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAkB,MAAM,qBAAqB,CAAC;AAIpE,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,iDAkB1D"}
|
|
@@ -5,7 +5,8 @@ import { useSourceFile } from "./SourceFile.js";
|
|
|
5
5
|
export function ExportStatement(props) {
|
|
6
6
|
if (props.star) {
|
|
7
7
|
const module = useSourceFile();
|
|
8
|
-
|
|
8
|
+
const allSymbols = props.from.getAllSymbols();
|
|
9
|
+
for (const symbol of allSymbols) {
|
|
9
10
|
for (const refkey of symbol.refkeys) {
|
|
10
11
|
module.scope.exportedSymbols.set(refkey, symbol);
|
|
11
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionBase.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionBase.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FunctionBase.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionBase.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAYrE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CAC9B;AAED,oCAAoC;AACpC,MAAM,WAAW,uBAAuB;IACtC,iBAAiB;IACjB,QAAQ,CAAC,UAAU,CAAC,EAAE,mBAAmB,EAAE,GAAG,MAAM,EAAE,CAAC;IACvD,mBAAmB;IACnB,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CAC9B;AAED,iEAAiE;AACjE,MAAM,WAAW,2BAA2B;IAC1C,iBAAiB;IACjB,QAAQ,CAAC,UAAU,CAAC,EAAE,mBAAmB,EAAE,GAAG,MAAM,EAAE,CAAC;IACvD,mBAAmB;IACnB,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CAC9B;AAED,gCAAgC;AAChC,MAAM,WAAW,mBAAmB;IAClC,iBAAiB;IACjB,UAAU,CAAC,EAAE,uBAAuB,EAAE,GAAG,MAAM,EAAE,CAAC;IAClD,mBAAmB;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,sIAKxB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,kJAyB9B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,0JAyBlC,CAAC;AAwGF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,0IAoC1B,CAAC;AAsBF,wBAAgB,aAAa,CAC3B,UAAU,EAAE,QAAQ,GAAG,SAAS,EAChC,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAqB,YAKhD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
2
|
import { Block, code, createSymbolSlot, For, Indent, onCleanup, Show, taggedComponent } from "@alloy-js/core";
|
|
3
3
|
import { useTSNamePolicy } from "../name-policy.js";
|
|
4
|
-
import {
|
|
4
|
+
import { createValueSymbol, TSSymbolFlags } from "../symbols/index.js";
|
|
5
5
|
import { TypeRefContext } from "./TypeRefContext.js";
|
|
6
6
|
const functionParametersTag = Symbol();
|
|
7
7
|
const typeParametersTag = Symbol();
|
|
@@ -94,8 +94,6 @@ export const FunctionTypeParameters = taggedComponent(functionParametersTag, fun
|
|
|
94
94
|
});
|
|
95
95
|
});
|
|
96
96
|
function parameter(param) {
|
|
97
|
-
const SymbolSlot = createSymbolSlot();
|
|
98
|
-
SymbolSlot.instantiateInto(param.symbol);
|
|
99
97
|
return _$createIntrinsic("group", {
|
|
100
98
|
get children() {
|
|
101
99
|
return [_$createComponent(Show, {
|
|
@@ -115,7 +113,7 @@ function parameter(param) {
|
|
|
115
113
|
get children() {
|
|
116
114
|
return _$createIntrinsic("indent", {
|
|
117
115
|
get children() {
|
|
118
|
-
return [":", " ", _$createComponent(
|
|
116
|
+
return [":", " ", _$createComponent(param.TypeSlot, {
|
|
119
117
|
get children() {
|
|
120
118
|
return _$createComponent(TypeRefContext, {
|
|
121
119
|
get children() {
|
|
@@ -132,7 +130,7 @@ function parameter(param) {
|
|
|
132
130
|
return !!param.default;
|
|
133
131
|
},
|
|
134
132
|
get children() {
|
|
135
|
-
return [" = ", _$createComponent(
|
|
133
|
+
return [" = ", _$createComponent(param.TypeSlot, {
|
|
136
134
|
get children() {
|
|
137
135
|
return param.default;
|
|
138
136
|
}
|
|
@@ -149,26 +147,31 @@ function normalizeAndDeclareParameters(parameters, flags = TSSymbolFlags.Paramet
|
|
|
149
147
|
}
|
|
150
148
|
if (typeof parameters[0] === "string") {
|
|
151
149
|
return parameters.map(paramName => {
|
|
152
|
-
const name = namePolicy.getName(paramName,
|
|
153
|
-
const
|
|
154
|
-
|
|
150
|
+
const name = namePolicy.getName(paramName, "parameter");
|
|
151
|
+
const TypeSlot = createSymbolSlot();
|
|
152
|
+
const symbol = createValueSymbol(name, {
|
|
153
|
+
type: TypeSlot.firstSymbol
|
|
155
154
|
});
|
|
156
155
|
return {
|
|
157
156
|
refkeys: symbol.refkeys,
|
|
158
|
-
symbol
|
|
157
|
+
symbol,
|
|
158
|
+
TypeSlot
|
|
159
159
|
};
|
|
160
160
|
});
|
|
161
161
|
} else {
|
|
162
162
|
return parameters.map(param => {
|
|
163
163
|
const nullishFlag = param.nullish ?? param.optional ? TSSymbolFlags.Nullish : TSSymbolFlags.None;
|
|
164
|
-
const
|
|
164
|
+
const TypeSlot = createSymbolSlot();
|
|
165
|
+
const symbol = createValueSymbol(namePolicy.getName(param.name, "parameter"), {
|
|
165
166
|
refkeys: param.refkey,
|
|
166
167
|
tsFlags: flags | nullishFlag,
|
|
167
|
-
metadata: param.metadata
|
|
168
|
+
metadata: param.metadata,
|
|
169
|
+
type: TypeSlot.firstSymbol
|
|
168
170
|
});
|
|
169
171
|
return {
|
|
170
172
|
...param,
|
|
171
|
-
symbol
|
|
173
|
+
symbol,
|
|
174
|
+
TypeSlot
|
|
172
175
|
};
|
|
173
176
|
});
|
|
174
177
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionDeclaration.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FunctionDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionDeclaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAiB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAe,MAAM,kBAAkB,CAAC;AAWrE,MAAM,WAAW,wBACf,SAAQ,oBAAoB,EAC1B,kBAAkB;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,YAyClE;yBAzCe,mBAAmB"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, memo as _$memo, createIntrinsic as _$createIntrinsic, mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { childrenArray, findKeyedChild, findUnkeyedChildren, Name, Prose,
|
|
2
|
+
import { childrenArray, findKeyedChild, findUnkeyedChildren, Name, Prose, Show } from "@alloy-js/core";
|
|
3
3
|
import { getCallSignatureProps } from "../utils.js";
|
|
4
4
|
import { CallSignature } from "./CallSignature.js";
|
|
5
5
|
import { Declaration } from "./Declaration.js";
|
|
6
6
|
import { FunctionBody, FunctionParameters, getReturnType, TypeParameters } from "./FunctionBase.js";
|
|
7
7
|
import { JSDoc } from "./JSDoc.js";
|
|
8
8
|
import { JSDocParams } from "./JSDocParam.js";
|
|
9
|
+
import { LexicalScope } from "./LexicalScope.js";
|
|
9
10
|
/**
|
|
10
11
|
* A TypeScript function declaration.
|
|
11
12
|
*
|
|
@@ -61,11 +62,10 @@ export function FunctionDeclaration(props) {
|
|
|
61
62
|
}), _$createComponent(Declaration, _$mergeProps(props, {
|
|
62
63
|
nameKind: "function",
|
|
63
64
|
get children() {
|
|
64
|
-
return [asyncKwd, "function ", _$createComponent(Name, {}), _$createComponent(
|
|
65
|
+
return [asyncKwd, "function ", _$createComponent(Name, {}), _$createComponent(LexicalScope, {
|
|
65
66
|
get name() {
|
|
66
67
|
return props.name;
|
|
67
68
|
},
|
|
68
|
-
kind: "function",
|
|
69
69
|
get children() {
|
|
70
70
|
return [_$createComponent(CallSignature, _$mergeProps(callSignatureProps, {
|
|
71
71
|
returnType: returnType
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionExpression.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionExpression.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FunctionExpression.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionExpression.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAiB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AASxE,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,YA+BhE;yBA/Be,kBAAkB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { childrenArray, findKeyedChild, findUnkeyedChildren
|
|
2
|
+
import { childrenArray, findKeyedChild, findUnkeyedChildren } from "@alloy-js/core";
|
|
3
3
|
import { getCallSignatureProps } from "../utils.js";
|
|
4
4
|
import { CallSignature } from "./CallSignature.js";
|
|
5
|
-
import { Declaration } from "./Declaration.js";
|
|
6
5
|
import { FunctionBody, FunctionParameters, getReturnType, TypeParameters } from "./FunctionBase.js";
|
|
6
|
+
import { LexicalScope } from "./LexicalScope.js";
|
|
7
7
|
/**
|
|
8
8
|
* A TypeScript function expression.
|
|
9
9
|
*
|
|
@@ -47,19 +47,13 @@ export function FunctionExpression(props) {
|
|
|
47
47
|
parametersChildren,
|
|
48
48
|
typeParametersChildren
|
|
49
49
|
});
|
|
50
|
-
return [
|
|
51
|
-
nameKind: "function",
|
|
50
|
+
return [asyncKwd, "function ", _$createComponent(LexicalScope, {
|
|
52
51
|
get children() {
|
|
53
|
-
return [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return [_$createComponent(CallSignature, _$mergeProps(callSignatureProps, {
|
|
57
|
-
returnType: returnType
|
|
58
|
-
})), " ", sBody];
|
|
59
|
-
}
|
|
60
|
-
})];
|
|
52
|
+
return [_$createComponent(CallSignature, _$mergeProps(callSignatureProps, {
|
|
53
|
+
returnType: returnType
|
|
54
|
+
})), " ", sBody];
|
|
61
55
|
}
|
|
62
|
-
})
|
|
56
|
+
})];
|
|
63
57
|
}
|
|
64
58
|
FunctionExpression.TypeParameters = TypeParameters;
|
|
65
59
|
FunctionExpression.Parameters = FunctionParameters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionType.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionType.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FunctionType.d.ts","sourceRoot":"","sources":["../../../src/components/FunctionType.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAiB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAYxE;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,qCAAqC;IACrC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC;IACxB,kBAAkB;IAClB,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CAC9B;AAuCD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY;;;CAGvB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { memo as _$memo, createComponent as _$createComponent, createIntrinsic as _$createIntrinsic, mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { childrenArray, findKeyedChild, Prose,
|
|
2
|
+
import { childrenArray, findKeyedChild, Prose, Show } from "@alloy-js/core";
|
|
3
3
|
import { getCallSignatureProps } from "../utils.js";
|
|
4
4
|
import { CallSignature } from "./CallSignature.js";
|
|
5
5
|
import { FunctionParameters, FunctionTypeParameters, getReturnType, TypeParameters } from "./FunctionBase.js";
|
|
6
6
|
import { JSDoc } from "./JSDoc.js";
|
|
7
7
|
import { JSDocParams } from "./JSDocParam.js";
|
|
8
|
+
import { LexicalScope } from "./LexicalScope.js";
|
|
8
9
|
import { ensureTypeRefContext } from "./TypeRefContext.js";
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -41,8 +42,7 @@ const FunctionTypeComponent = ensureTypeRefContext(props => {
|
|
|
41
42
|
}
|
|
42
43
|
}), _$createIntrinsic("hbr", {})];
|
|
43
44
|
}
|
|
44
|
-
}), _$createComponent(
|
|
45
|
-
kind: "function",
|
|
45
|
+
}), _$createComponent(LexicalScope, {
|
|
46
46
|
get children() {
|
|
47
47
|
return [_$createComponent(CallSignature, _$mergeProps(callSignatureProps, {
|
|
48
48
|
returnType: null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IfStatement.d.ts","sourceRoot":"","sources":["../../../src/components/IfStatement.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"IfStatement.d.ts","sourceRoot":"","sources":["../../../src/components/IfStatement.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGtD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,QAAQ,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YAMlD;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,QAAQ,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,YAOpD;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YAOhD"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
2
|
import { Block } from "@alloy-js/core";
|
|
3
|
+
import { BlockScope } from "./BlockScope.js";
|
|
3
4
|
/**
|
|
4
5
|
* An if statement.
|
|
5
6
|
*/
|
|
6
7
|
export function IfStatement(props) {
|
|
7
|
-
return ["if (", _$memo(() => props.condition), ") ", _$createComponent(
|
|
8
|
+
return ["if (", _$memo(() => props.condition), ") ", _$createComponent(BlockScope, {
|
|
8
9
|
get children() {
|
|
9
10
|
return props.children;
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportStatement.d.ts","sourceRoot":"","sources":["../../../src/components/ImportStatement.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,cAAc,EACd,aAAa,
|
|
1
|
+
{"version":3,"file":"ImportStatement.d.ts","sourceRoot":"","sources":["../../../src/components/ImportStatement.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,cAAc,EACd,aAAa,EAEd,MAAM,qBAAqB,CAAC;AAI7B,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,6CA2C5D;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC9B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAqD1D"}
|