@alloy-js/typescript 0.23.0-dev.7 → 0.23.0-dev.9

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.
Files changed (151) hide show
  1. package/dist/dev/src/components/FunctionBase.js +1 -9
  2. package/dist/dev/src/components/FunctionBase.js.map +1 -1
  3. package/dist/dev/src/name-conflict-resolver.js.map +1 -1
  4. package/dist/dev/test/function-declaration.test.js +65 -7
  5. package/dist/dev/test/function-declaration.test.js.map +1 -1
  6. package/dist/dev/test/name-conflict.test.js.map +1 -1
  7. package/dist/src/components/FunctionBase.js +1 -5
  8. package/dist/src/components/FunctionBase.js.map +1 -1
  9. package/dist/src/name-conflict-resolver.d.ts +2 -2
  10. package/dist/src/name-conflict-resolver.d.ts.map +1 -1
  11. package/dist/src/name-conflict-resolver.js.map +1 -1
  12. package/dist/test/function-declaration.test.js +42 -0
  13. package/dist/test/function-declaration.test.js.map +1 -1
  14. package/dist/test/name-conflict.test.js.map +1 -1
  15. package/dist/tsconfig.tsbuildinfo +1 -1
  16. package/docs/api/components/ArrowFunction.md +71 -0
  17. package/docs/api/components/BarrelFile.md +58 -0
  18. package/docs/api/components/BlockScope.md +97 -0
  19. package/docs/api/components/CallSignature.md +45 -0
  20. package/docs/api/components/CaseClause.md +102 -0
  21. package/docs/api/components/CatchClause.md +50 -0
  22. package/docs/api/components/ClassDeclaration.md +61 -0
  23. package/docs/api/components/ClassField.md +63 -0
  24. package/docs/api/components/ClassMember.md +56 -0
  25. package/docs/api/components/ClassMethod.md +75 -0
  26. package/docs/api/components/CommaList.md +31 -0
  27. package/docs/api/components/Declaration.md +87 -0
  28. package/docs/api/components/ElseClause.md +29 -0
  29. package/docs/api/components/ElseIfClause.md +30 -0
  30. package/docs/api/components/EnumDeclaration.md +29 -0
  31. package/docs/api/components/EnumMember.md +46 -0
  32. package/docs/api/components/ExportStatement.md +26 -0
  33. package/docs/api/components/FinallyClause.md +50 -0
  34. package/docs/api/components/FunctionCallExpression.md +29 -0
  35. package/docs/api/components/FunctionDeclaration.md +57 -0
  36. package/docs/api/components/FunctionExpression.md +71 -0
  37. package/docs/api/components/IfStatement.md +30 -0
  38. package/docs/api/components/ImportStatement.md +29 -0
  39. package/docs/api/components/ImportStatements.md +25 -0
  40. package/docs/api/components/InterfaceDeclaration.md +38 -0
  41. package/docs/api/components/InterfaceMember.md +99 -0
  42. package/docs/api/components/InterfaceMethod.md +74 -0
  43. package/docs/api/components/JSDoc.md +29 -0
  44. package/docs/api/components/JSDocComment.md +29 -0
  45. package/docs/api/components/JSDocExample.md +31 -0
  46. package/docs/api/components/MemberExpression.md +58 -0
  47. package/docs/api/components/NewExpression.md +26 -0
  48. package/docs/api/components/ObjectExpression.md +32 -0
  49. package/docs/api/components/ObjectProperty.md +44 -0
  50. package/docs/api/components/ObjectSpreadProperty.md +29 -0
  51. package/docs/api/components/PackageDirectory.md +102 -0
  52. package/docs/api/components/PackageJsonFile.md +82 -0
  53. package/docs/api/components/Reference.md +26 -0
  54. package/docs/api/components/SingleLineCommentBlock.md +29 -0
  55. package/docs/api/components/SourceFile.md +41 -0
  56. package/docs/api/components/SwitchStatement.md +30 -0
  57. package/docs/api/components/TSConfigJson.md +25 -0
  58. package/docs/api/components/TryStatement.md +50 -0
  59. package/docs/api/components/TypeRefContext.md +35 -0
  60. package/docs/api/components/ValueExpression.md +25 -0
  61. package/docs/api/components/VarDeclaration.md +44 -0
  62. package/docs/api/components/ensureTypeRefContext.md +28 -0
  63. package/docs/api/components/index.md +49 -0
  64. package/docs/api/contexts/Package-context.md +21 -0
  65. package/docs/api/contexts/PackageMetadata-context.md +18 -0
  66. package/docs/api/contexts/SourceFile-context.md +20 -0
  67. package/docs/api/contexts/index.md +5 -0
  68. package/docs/api/functions/createInstanceMemberSymbol.md +38 -0
  69. package/docs/api/functions/createLexicalScope.md +27 -0
  70. package/docs/api/functions/createMemberScope.md +28 -0
  71. package/docs/api/functions/createMemberSymbol.md +42 -0
  72. package/docs/api/functions/createPackage.md +18 -0
  73. package/docs/api/functions/createPrivateInstanceMemberSymbol.md +38 -0
  74. package/docs/api/functions/createPrivateStaticMemberSymbol.md +38 -0
  75. package/docs/api/functions/createStaticMemberSymbol.md +38 -0
  76. package/docs/api/functions/createTSNamePolicy.md +17 -0
  77. package/docs/api/functions/createTransientValueSymbol.md +17 -0
  78. package/docs/api/functions/createTypeAndValueSymbol.md +38 -0
  79. package/docs/api/functions/createTypeSymbol.md +38 -0
  80. package/docs/api/functions/createValueSymbol.md +38 -0
  81. package/docs/api/functions/decl.md +38 -0
  82. package/docs/api/functions/declMember.md +42 -0
  83. package/docs/api/functions/declType.md +38 -0
  84. package/docs/api/functions/getPackageScope.md +20 -0
  85. package/docs/api/functions/getSourceDirectoryData.md +18 -0
  86. package/docs/api/functions/index.md +27 -0
  87. package/docs/api/functions/ref.md +25 -0
  88. package/docs/api/functions/tsNameConflictResolver.md +19 -0
  89. package/docs/api/functions/useTSLexicalScope.md +17 -0
  90. package/docs/api/functions/useTSLexicalScopeIfPresent.md +17 -0
  91. package/docs/api/functions/useTSMemberScope.md +17 -0
  92. package/docs/api/functions/useTSNamePolicy.md +17 -0
  93. package/docs/api/functions/useTSScope.md +17 -0
  94. package/docs/api/index.md +7 -0
  95. package/docs/api/types/AddImportOptions.md +7 -0
  96. package/docs/api/types/BlockScopeProps.md +5 -0
  97. package/docs/api/types/CaseClauseProps.md +5 -0
  98. package/docs/api/types/CaseClausePropsBase.md +9 -0
  99. package/docs/api/types/CommonDeclarationProps.md +7 -0
  100. package/docs/api/types/CreatePackageProps.md +12 -0
  101. package/docs/api/types/CreateTsSymbolOptions.md +12 -0
  102. package/docs/api/types/DeclarationProps.md +5 -0
  103. package/docs/api/types/DeclarationPropsBase.md +8 -0
  104. package/docs/api/types/ExportConditions.md +7 -0
  105. package/docs/api/types/ExportPath.md +5 -0
  106. package/docs/api/types/ExternalPackage.md +7 -0
  107. package/docs/api/types/FunctionBodyProps.md +7 -0
  108. package/docs/api/types/FunctionParametersProps.md +10 -0
  109. package/docs/api/types/FunctionTypeParameterDescriptor.md +10 -0
  110. package/docs/api/types/FunctionTypeParametersProps.md +10 -0
  111. package/docs/api/types/FunctionTypeProps.md +13 -0
  112. package/docs/api/types/ImportRecords.md +5 -0
  113. package/docs/api/types/ImportedSymbol.md +8 -0
  114. package/docs/api/types/InterfaceExpressionProps.md +7 -0
  115. package/docs/api/types/InterfaceMemberProps.md +5 -0
  116. package/docs/api/types/InterfaceMemberPropsBase.md +11 -0
  117. package/docs/api/types/MemberExpressionPartProps.md +15 -0
  118. package/docs/api/types/ModuleExports.md +18 -0
  119. package/docs/api/types/ModuleSymbolsDescriptor.md +10 -0
  120. package/docs/api/types/NamedMap.md +18 -0
  121. package/docs/api/types/NamedModuleDescriptor.md +17 -0
  122. package/docs/api/types/PackageDescriptor.md +7 -0
  123. package/docs/api/types/PackageExports.md +7 -0
  124. package/docs/api/types/PackageRefkeys.md +10 -0
  125. package/docs/api/types/ParameterDescriptor.md +11 -0
  126. package/docs/api/types/ParameterDescriptorBase.md +16 -0
  127. package/docs/api/types/RefOptions.md +7 -0
  128. package/docs/api/types/SourceDirectoryData.md +7 -0
  129. package/docs/api/types/SourceFileHeaderProps.md +8 -0
  130. package/docs/api/types/TSLexicalScope.md +13 -0
  131. package/docs/api/types/TSMemberScope.md +14 -0
  132. package/docs/api/types/TSModuleScope.md +16 -0
  133. package/docs/api/types/TSOutputScope.md +5 -0
  134. package/docs/api/types/TSOutputSymbol.md +28 -0
  135. package/docs/api/types/TSPackageScope.md +21 -0
  136. package/docs/api/types/TSPackageScopeOptions.md +9 -0
  137. package/docs/api/types/TypeDeclarationProps.md +8 -0
  138. package/docs/api/types/TypeParameterDescriptor.md +13 -0
  139. package/docs/api/types/TypeScriptElements.md +5 -0
  140. package/docs/api/types/index.md +47 -0
  141. package/docs/api/variables/FunctionType.md +24 -0
  142. package/docs/api/variables/InterfaceExpression.md +5 -0
  143. package/docs/api/variables/TSSymbolFlags.md +5 -0
  144. package/docs/api/variables/TypeDeclaration.md +5 -0
  145. package/docs/api/variables/index.md +6 -0
  146. package/package.json +4 -4
  147. package/src/components/FunctionBase.tsx +1 -1
  148. package/src/name-conflict-resolver.ts +4 -6
  149. package/temp/api.json +2 -2
  150. package/test/function-declaration.test.tsx +36 -0
  151. package/test/name-conflict.test.tsx +4 -4
@@ -0,0 +1,16 @@
1
+ # ParameterDescriptorBase
2
+
3
+ Common properties for ParameterDescriptor and FunctionTypeParameterDescriptor.
4
+
5
+ ## Members
6
+
7
+ | | | |
8
+ | -------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9
+ | doc | optional [Children](../../../core/types/children/) | Documentation for the parameter. |
10
+ | metadata | optional Record\<string, unknown> | Arbitrary metadata for the parameter symbol. |
11
+ | name | string \| [Namekey](../../../core/types/namekey/) | The name of the parameter. |
12
+ | nullish | optional boolean | Whether the parameter is can be null or undefined. when optional is true, this will be set to true by default, but explicitly setting this to false will override that. |
13
+ | optional | optional boolean | Whether the parameter is optional. |
14
+ | refkey | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey for this parameter. |
15
+ | rest | optional boolean | Weather the parameter is rest parameter. |
16
+ | type | optional [Children](../../../core/types/children/) | The type of the parameter. |
@@ -0,0 +1,7 @@
1
+ # RefOptions
2
+
3
+ ## Members
4
+
5
+ | | | |
6
+ | ---- | ---------------- | - |
7
+ | type | optional boolean | |
@@ -0,0 +1,7 @@
1
+ # SourceDirectoryData
2
+
3
+ ## Members
4
+
5
+ | | | |
6
+ | ------- | --------------------------------------- | - |
7
+ | modules | Set<[TSModuleScope](../tsmodulescope/)> | |
@@ -0,0 +1,8 @@
1
+ # SourceFileHeaderProps
2
+
3
+ ## Members
4
+
5
+ | | | |
6
+ | ------------- | -------------------------------------------------- | - |
7
+ | header | optional [Children](../../../core/types/children/) | |
8
+ | headerComment | optional string | |
@@ -0,0 +1,13 @@
1
+ # TSLexicalScope
2
+
3
+ A lexical scope for TypeScript, which contains declaration spaces for types and values. This scope is used to hold symbols for things like variable or interface declarations.
4
+
5
+ ## Members
6
+
7
+ Extends [OutputScope](../../../core/types/outputscope/)
8
+
9
+ | | | |
10
+ | ----------------- | ------------------------------------------------------------------------ | - |
11
+ | declarationSpaces | string\[] | |
12
+ | types | import(“@alloy-js/core”).[OutputSpace](../../../core/types/outputspace/) | |
13
+ | values | import(“@alloy-js/core”).[OutputSpace](../../../core/types/outputspace/) | |
@@ -0,0 +1,14 @@
1
+ # TSMemberScope
2
+
3
+ A member scope for TypeScript. Member declarations create symbols in this scope, which will be added to the owner symbol’s members.
4
+
5
+ ## Members
6
+
7
+ Extends [TSLexicalScope](../tslexicalscope/)
8
+
9
+ | | | |
10
+ | ----------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
11
+ | constructor | (name: string, parentScope: TSOutputScope \| undefined, ownerSymbol: TSOutputSymbol, options: OutputScopeOptions) | Constructs a new instance of the [`TSMemberScope`](TSMemberScope.md) class |
12
+ | declarationSpaces | never\[] | |
13
+ | isMemberScope | boolean | |
14
+ | ownerSymbol | [TSOutputSymbol](../tsoutputsymbol/) | |
@@ -0,0 +1,16 @@
1
+ # TSModuleScope
2
+
3
+ A lexical scope for TypeScript which represents the top-level scope of a module. Manages the module’s imported and exported symbols.
4
+
5
+ ## Members
6
+
7
+ Extends [TSLexicalScope](../tslexicalscope/)
8
+
9
+ | | | |
10
+ | --------------- | -------------------------------------------------------------------------------------------------------- | - |
11
+ | addImport | (targetSymbol: TSOutputSymbol, targetModule: TSModuleScope, options: AddImportOptions) => TSOutputSymbol | |
12
+ | debugInfo | Record\<string, unknown> | |
13
+ | exportedSymbols | Map<[Refkey](../../../core/types/refkey/), [TSOutputSymbol](../tsoutputsymbol/)> | |
14
+ | getAllSymbols | () => Set\<TSOutputSymbol> | |
15
+ | importedModules | [ImportRecords](../importrecords/) | |
16
+ | importedSymbols | Map<[TSOutputSymbol](../tsoutputsymbol/), [TSOutputSymbol](../tsoutputsymbol/)> | |
@@ -0,0 +1,5 @@
1
+ # TSOutputScope
2
+
3
+ ```ts
4
+ type TSOutputScope = TSPackageScope | TSModuleScope | TSLexicalScope;
5
+ ```
@@ -0,0 +1,28 @@
1
+ # TSOutputSymbol
2
+
3
+ ## Members
4
+
5
+ Extends [OutputSymbol](../../../core/types/outputsymbol/)
6
+
7
+ | | | |
8
+ | ---------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
9
+ | constructor | (name: string \| Namekey, spaces: OutputSpace\[] \| OutputSpace \| undefined, options: CreateTsSymbolOptions) | Constructs a new instance of the [`TSOutputSymbol`](TSOutputSymbol.md) class |
10
+ | copy | () => TSOutputSymbol | |
11
+ | debugInfo | Record\<string, unknown> | |
12
+ | default | boolean | |
13
+ | export | boolean | |
14
+ | hasInstanceMembers | boolean | |
15
+ | instanceMembers | import(“@alloy-js/core”).[OutputMemberSpace](../../../core/types/outputmemberspace/) | |
16
+ | isInstanceMemberSymbol | boolean | |
17
+ | isPrivateMemberSymbol | boolean | |
18
+ | isPublicMemberSymbol | boolean | |
19
+ | isStaticMemberSymbol | boolean | |
20
+ | isTypeSymbol | boolean | |
21
+ | isValueSymbol | boolean | |
22
+ | memberSpaces | readonly \[“static”, “instance”, “private-static”, “private-instance”] | |
23
+ | ownerSymbol | [TSOutputSymbol](../tsoutputsymbol/) \| undefined | |
24
+ | privateInstanceMembers | import(“@alloy-js/core”).[OutputMemberSpace](../../../core/types/outputmemberspace/) | |
25
+ | privateStaticMembers | import(“@alloy-js/core”).[OutputMemberSpace](../../../core/types/outputmemberspace/) | |
26
+ | scope | [TSOutputScope](../tsoutputscope/) \| undefined | |
27
+ | staticMembers | import(“@alloy-js/core”).[OutputMemberSpace](../../../core/types/outputmemberspace/) | |
28
+ | tsFlags | [TSSymbolFlags](../../variables/tssymbolflags/) | |
@@ -0,0 +1,21 @@
1
+ # TSPackageScope
2
+
3
+ ## Members
4
+
5
+ Extends [OutputScope](../../../core/types/outputscope/)
6
+
7
+ | | | |
8
+ | ------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
9
+ | constructor | (name: string, version: string, path: string, options: TSPackageScopeOptions) | Constructs a new instance of the [`TSPackageScope`](TSPackageScope.md) class |
10
+ | addDependency | (pkg: TSPackageScope) => void | |
11
+ | addExport | (publicPath: string, module: TSModuleScope) => void | |
12
+ | addModule | (module: TSModuleScope) => void | |
13
+ | builtin | boolean | Whether this is a built-in package provided by the platform. |
14
+ | copyTo | () => TSPackageScope | |
15
+ | debugInfo | Record\<string, unknown> | |
16
+ | dependencies | Set<[TSPackageScope](../tspackagescope/)> | The scopes for the packages this package depends on. |
17
+ | exportedSymbols | Map\<string, [TSModuleScope](../tsmodulescope/)> | The symbols exported by this package. They are broken down by which paths they are exported from. It is possible a symbol may be present at multiple paths, in which case emitters can decide which symbol to use based on their own heuristics. |
18
+ | findExportedSymbol | (refkey: Refkey) => \[string, TSModuleScope] \| null | |
19
+ | modules | Set<[TSModuleScope](../tsmodulescope/)> | All of the modules contained within the package. These modules may or may not be exported. |
20
+ | path | string | The path of the root directory of the package. |
21
+ | version | string | The version of the this package. |
@@ -0,0 +1,9 @@
1
+ # TSPackageScopeOptions
2
+
3
+ ## Members
4
+
5
+ Extends [OutputScopeOptions](../../../core/types/outputscopeoptions/)
6
+
7
+ | | | |
8
+ | ------- | ---------------- | - |
9
+ | builtin | optional boolean | |
@@ -0,0 +1,8 @@
1
+ # TypeDeclarationProps
2
+
3
+ ## Members
4
+
5
+ Extends [CommonDeclarationProps](../commondeclarationprops/)
6
+
7
+ | |
8
+ | - |
@@ -0,0 +1,13 @@
1
+ # TypeParameterDescriptor
2
+
3
+ Information for a TypeScript generic type parameter.
4
+
5
+ ## Members
6
+
7
+ | | | |
8
+ | -------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
9
+ | default | optional [Children](../../../core/types/children/) | The default type of the type parameter. |
10
+ | extends | optional [Children](../../../core/types/children/) | The extends constraint for the type parameter. |
11
+ | metadata | optional Record\<string, unknown> | Arbitrary metadata for the type parameter symbol. |
12
+ | name | string \| [Namekey](../../../core/types/namekey/) | The name of the type parameter. |
13
+ | refkey | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | A refkey or array of refkeys for this type parameter. |
@@ -0,0 +1,5 @@
1
+ # TypeScriptElements
2
+
3
+ ```ts
4
+ type TypeScriptElements = "function" | "parameter" | "class" | "variable" | "enum" | "object-member-data" | "object-member-getter" | "class-member-data" | "class-member-getter" | "enum-member" | "interface" | "interface-member" | "type";
5
+ ```
@@ -0,0 +1,47 @@
1
+ # typescript — types
2
+
3
+ - [AddImportOptions](AddImportOptions.md)
4
+ - [BlockScopeProps](BlockScopeProps.md) — type BlockScopeProps = BlockScopePropsWithScopeValue | BlockScopePropsWithScopeInfo;
5
+ - [CaseClauseProps](CaseClauseProps.md) — type CaseClauseProps = CaseClausePropsWithExpression | CaseClausePropsWithValue | CaseClausePropsWithDefault;
6
+ - [CaseClausePropsBase](CaseClausePropsBase.md)
7
+ - [CommonDeclarationProps](CommonDeclarationProps.md) — The base props for declaration components.
8
+ - [CreatePackageProps](CreatePackageProps.md) — Props for creating a package with a specific name, version, and descriptor.
9
+ - [CreateTsSymbolOptions](CreateTsSymbolOptions.md) — Extends [OutputSymbolOptions](../../../core/types/outputsymboloptions/)
10
+ - [DeclarationProps](DeclarationProps.md) — type DeclarationProps = DeclarationPropsWithSymbol | DeclarationPropsWithInfo;
11
+ - [DeclarationPropsBase](DeclarationPropsBase.md)
12
+ - [ExportConditions](ExportConditions.md)
13
+ - [ExportPath](ExportPath.md) — type ExportPath = string | ExportConditions;
14
+ - [ExternalPackage](ExternalPackage.md)
15
+ - [FunctionBodyProps](FunctionBodyProps.md)
16
+ - [FunctionParametersProps](FunctionParametersProps.md) — Props for function parameters
17
+ - [FunctionTypeParameterDescriptor](FunctionTypeParameterDescriptor.md) — Information for a TypeScript type function parameter.
18
+ - [FunctionTypeParametersProps](FunctionTypeParametersProps.md) — Props for a function type(FunctionType or InterfaceMethod)
19
+ - [FunctionTypeProps](FunctionTypeProps.md) — Options for [FunctionType](../../variables/functiontype/) component.
20
+ - [ImportedSymbol](ImportedSymbol.md)
21
+ - [ImportRecords](ImportRecords.md) — type ImportRecords = Map<TSModuleScope, Set<ImportedSymbol>>;
22
+ - [InterfaceExpressionProps](InterfaceExpressionProps.md)
23
+ - [InterfaceMemberProps](InterfaceMemberProps.md) — type InterfaceMemberProps = InterfacePropertyMemberProps | InterfaceIndexerMemberProps;
24
+ - [InterfaceMemberPropsBase](InterfaceMemberPropsBase.md)
25
+ - [MemberExpressionPartProps](MemberExpressionPartProps.md)
26
+ - [ModuleExports](ModuleExports.md) — Infers the exported members of a module based on its descriptor.
27
+ - [ModuleSymbolsDescriptor](ModuleSymbolsDescriptor.md) — Describes the symbols exported by a module.
28
+ - [NamedMap](NamedMap.md) — type NamedMap<TDescriptor extends readonly NamedModuleDescriptor[]> = {
29
+ - [NamedModuleDescriptor](NamedModuleDescriptor.md) — Describes the structure of a module descriptor.
30
+ - [PackageDescriptor](PackageDescriptor.md)
31
+ - [PackageExports](PackageExports.md)
32
+ - [PackageRefkeys](PackageRefkeys.md) — type PackageRefkeys<PD extends Record<string, {
33
+ - [ParameterDescriptor](ParameterDescriptor.md) — Information for a TypeScript function parameter.
34
+ - [ParameterDescriptorBase](ParameterDescriptorBase.md) — Common properties for ParameterDescriptor and FunctionTypeParameterDescriptor.
35
+ - [RefOptions](RefOptions.md)
36
+ - [SourceDirectoryData](SourceDirectoryData.md)
37
+ - [SourceFileHeaderProps](SourceFileHeaderProps.md)
38
+ - [TSLexicalScope](TSLexicalScope.md) — A lexical scope for TypeScript, which contains declaration spaces for types and values.
39
+ - [TSMemberScope](TSMemberScope.md) — A member scope for TypeScript.
40
+ - [TSModuleScope](TSModuleScope.md) — A lexical scope for TypeScript which represents the top-level scope of a module.
41
+ - [TSOutputScope](TSOutputScope.md) — type TSOutputScope = TSPackageScope | TSModuleScope | TSLexicalScope;
42
+ - [TSOutputSymbol](TSOutputSymbol.md) — Extends [OutputSymbol](../../../core/types/outputsymbol/)
43
+ - [TSPackageScope](TSPackageScope.md) — Extends [OutputScope](../../../core/types/outputscope/)
44
+ - [TSPackageScopeOptions](TSPackageScopeOptions.md) — Extends [OutputScopeOptions](../../../core/types/outputscopeoptions/)
45
+ - [TypeDeclarationProps](TypeDeclarationProps.md) — Extends [CommonDeclarationProps](../commondeclarationprops/)
46
+ - [TypeParameterDescriptor](TypeParameterDescriptor.md) — Information for a TypeScript generic type parameter.
47
+ - [TypeScriptElements](TypeScriptElements.md) — type TypeScriptElements = "function" | "parameter" | "class" | "variable" | "enum" | "object-member-data" | "object-memb
@@ -0,0 +1,24 @@
1
+ # FunctionType
2
+
3
+ A TypeScript function declaration.
4
+
5
+ ```ts
6
+ FunctionType: import("@alloy-js/core").Component<FunctionTypeProps> & {
7
+ TypeParameters: import("@alloy-js/core").Component<import("./FunctionBase.jsx").TypeParametersProps> & Required<Pick<import("@alloy-js/core").Component<import("./FunctionBase.jsx").TypeParametersProps>, "tag">>;
8
+ Parameters: import("@alloy-js/core").Component<import("./FunctionBase.jsx").FunctionTypeParametersProps> & Required<Pick<import("@alloy-js/core").Component<import("./FunctionBase.jsx").FunctionTypeParametersProps>, "tag">>;
9
+ }
10
+ ```
11
+
12
+ ## Remarks
13
+
14
+ Providing parameters and type parameters can be accomplished in one of three ways:
15
+
16
+ 1. As an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
17
+ 2. As raw content via the `parametersChildren` or `typeParametersChildren` props.
18
+ 3. As a child of this component via the \[unresolved link] or \[unresolved link] components.
19
+
20
+ ## Example
21
+
22
+ ```ts
23
+ (foo: string, bar: number) => void
24
+ ```
@@ -0,0 +1,5 @@
1
+ # InterfaceExpression
2
+
3
+ ```ts
4
+ InterfaceExpression: import("@alloy-js/core").Component<InterfaceExpressionProps>
5
+ ```
@@ -0,0 +1,5 @@
1
+ # TSSymbolFlags
2
+
3
+ ```ts
4
+ enum TSSymbolFlags
5
+ ```
@@ -0,0 +1,5 @@
1
+ # TypeDeclaration
2
+
3
+ ```ts
4
+ TypeDeclaration: import("@alloy-js/core").Component<TypeDeclarationProps>
5
+ ```
@@ -0,0 +1,6 @@
1
+ # typescript — variables
2
+
3
+ - [FunctionType](FunctionType.md) — A TypeScript function declaration.
4
+ - [InterfaceExpression](InterfaceExpression.md) — InterfaceExpression: import("@alloy-js/core").Component<InterfaceExpressionProps>
5
+ - [TSSymbolFlags](TSSymbolFlags.md) — enum TSSymbolFlags
6
+ - [TypeDeclaration](TypeDeclaration.md) — TypeDeclaration: import("@alloy-js/core").Component<TypeDeclarationProps>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alloy-js/typescript",
3
- "version": "0.23.0-dev.7",
3
+ "version": "0.23.0-dev.9",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,13 +30,13 @@
30
30
  "author": "brian.terlson@microsoft.com",
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@alloy-js/core": "~0.22.0 || >= 0.23.0-dev.12",
33
+ "@alloy-js/core": "~0.22.0 || >= 0.23.0-dev.15",
34
34
  "change-case": "^5.4.4",
35
35
  "pathe": "^2.0.3"
36
36
  },
37
37
  "devDependencies": {
38
- "@alloy-js/cli": "~0.22.0 || >= 0.23.0-dev.4",
39
- "@alloy-js/rollup-plugin": "~0.1.0 || >= 0.1.1-dev.1",
38
+ "@alloy-js/cli": "~0.22.0 || >= 0.23.0-dev.5",
39
+ "@alloy-js/rollup-plugin": "~0.1.0 || >= 0.1.1-dev.2",
40
40
  "@microsoft/api-extractor": "~7.52.8",
41
41
  "@rollup/plugin-typescript": "^12.1.2",
42
42
  "concurrently": "^9.2.0",
@@ -151,7 +151,7 @@ function parameter(
151
151
  </Show>
152
152
  <Show when={!!(param as any).default}>
153
153
  {" = "}
154
- <param.TypeSlot>{(param as any).default!}</param.TypeSlot>
154
+ {(param as any).default!}
155
155
  </Show>
156
156
  </group>
157
157
  );
@@ -1,13 +1,11 @@
1
+ import { OutputSymbol } from "@alloy-js/core";
1
2
  import { TSOutputSymbol, TSSymbolFlags } from "./symbols/index.js";
2
3
 
3
- export function tsNameConflictResolver(
4
- name: string,
5
- symbols: TSOutputSymbol[],
6
- ) {
7
- const goodNamedSymbols = symbols.filter(
4
+ export function tsNameConflictResolver(name: string, symbols: OutputSymbol[]) {
5
+ const goodNamedSymbols = (symbols as TSOutputSymbol[]).filter(
8
6
  (s) => ~s.tsFlags & TSSymbolFlags.LocalImportSymbol,
9
7
  );
10
- const badNamedSymbols = symbols.filter(
8
+ const badNamedSymbols = (symbols as TSOutputSymbol[]).filter(
11
9
  (s) => s.tsFlags & TSSymbolFlags.LocalImportSymbol,
12
10
  );
13
11
  let nameCount = 1;
package/temp/api.json CHANGED
@@ -14968,8 +14968,8 @@
14968
14968
  },
14969
14969
  {
14970
14970
  "kind": "Reference",
14971
- "text": "TSOutputSymbol",
14972
- "canonicalReference": "@alloy-js/typescript!TSOutputSymbol:class"
14971
+ "text": "OutputSymbol",
14972
+ "canonicalReference": "@alloy-js/core!OutputSymbol:class"
14973
14973
  },
14974
14974
  {
14975
14975
  "kind": "Content",
@@ -388,6 +388,42 @@ describe("symbols", () => {
388
388
  }
389
389
  `);
390
390
  });
391
+
392
+ it("adds symbols for members of parameters when a type and default are provided", () => {
393
+ const ifaceRk = refkey();
394
+ const ifaceMemberRk = refkey();
395
+ const paramRk = refkey();
396
+
397
+ const param: ParameterDescriptor = {
398
+ name: "myParam",
399
+ refkey: paramRk,
400
+ type: ifaceRk,
401
+ default: "undefined",
402
+ };
403
+
404
+ const decl = (
405
+ <List doubleHardline>
406
+ <InterfaceDeclaration name="IFace" refkey={ifaceRk}>
407
+ <InterfaceMember name="myProp" refkey={ifaceMemberRk}>
408
+ string
409
+ </InterfaceMember>
410
+ </InterfaceDeclaration>
411
+ <FunctionDeclaration name="fn" parameters={[param]}>
412
+ {memberRefkey(paramRk, ifaceMemberRk)}
413
+ </FunctionDeclaration>
414
+ </List>
415
+ );
416
+
417
+ expect(toSourceText(decl)).toBe(d`
418
+ interface IFace {
419
+ myProp: string
420
+ }
421
+
422
+ function fn(myParam: IFace = undefined) {
423
+ myParam.myProp
424
+ }
425
+ `);
426
+ });
391
427
  });
392
428
 
393
429
  it("has parameters and return type in type ref context", () => {
@@ -1,4 +1,4 @@
1
- import { Output } from "@alloy-js/core";
1
+ import { Output, OutputSymbol } from "@alloy-js/core";
2
2
  import { camelCase } from "change-case";
3
3
  import { expect, it } from "vitest";
4
4
  import {
@@ -10,11 +10,11 @@ import {
10
10
  import { ParameterDescriptor } from "../src/parameter-descriptor.js";
11
11
 
12
12
  it("handles custom name conflict resolver based on metadata", () => {
13
- function resolver(name: string, symbols: TSOutputSymbol[]) {
14
- const goodNamedSymbols = symbols.filter(
13
+ function resolver(name: string, symbols: OutputSymbol[]) {
14
+ const goodNamedSymbols = (symbols as TSOutputSymbol[]).filter(
15
15
  (s) => ~s.tsFlags & TSSymbolFlags.LocalImportSymbol,
16
16
  );
17
- const badNamedSymbols = symbols.filter(
17
+ const badNamedSymbols = (symbols as TSOutputSymbol[]).filter(
18
18
  (s) => s.tsFlags & TSSymbolFlags.LocalImportSymbol,
19
19
  );
20
20
  let nameCount = 1;