@alloy-js/go 0.3.0-dev.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/dev/src/builtins/fmt/fmt.js +148 -0
  3. package/dist/dev/src/builtins/fmt/fmt.js.map +1 -0
  4. package/dist/dev/src/builtins/index.js +11 -0
  5. package/dist/dev/src/builtins/index.js.map +1 -0
  6. package/dist/dev/src/builtins/io/io.js +650 -0
  7. package/dist/dev/src/builtins/io/io.js.map +1 -0
  8. package/dist/dev/src/builtins/net/net.js +1212 -0
  9. package/dist/dev/src/builtins/net/net.js.map +1 -0
  10. package/dist/dev/src/builtins/time/time.js +464 -0
  11. package/dist/dev/src/builtins/time/time.js.map +1 -0
  12. package/dist/dev/src/components/ImportStatement.js +114 -0
  13. package/dist/dev/src/components/ImportStatement.js.map +1 -0
  14. package/dist/dev/src/components/ModuleDirectory.js +28 -0
  15. package/dist/dev/src/components/ModuleDirectory.js.map +1 -0
  16. package/dist/dev/src/components/Name.js +12 -0
  17. package/dist/dev/src/components/Name.js.map +1 -0
  18. package/dist/dev/src/components/Reference.js +15 -0
  19. package/dist/dev/src/components/Reference.js.map +1 -0
  20. package/dist/dev/src/components/SourceDirectory.js +38 -0
  21. package/dist/dev/src/components/SourceDirectory.js.map +1 -0
  22. package/dist/dev/src/components/SourceFile.js +119 -0
  23. package/dist/dev/src/components/SourceFile.js.map +1 -0
  24. package/dist/dev/src/components/doc/comment.js +46 -0
  25. package/dist/dev/src/components/doc/comment.js.map +1 -0
  26. package/dist/dev/src/components/doc/comment.test.js +371 -0
  27. package/dist/dev/src/components/doc/comment.test.js.map +1 -0
  28. package/dist/dev/src/components/function/function.js +250 -0
  29. package/dist/dev/src/components/function/function.js.map +1 -0
  30. package/dist/dev/src/components/function/function.test.js +630 -0
  31. package/dist/dev/src/components/function/function.test.js.map +1 -0
  32. package/dist/dev/src/components/index.js +16 -0
  33. package/dist/dev/src/components/index.js.map +1 -0
  34. package/dist/dev/src/components/interface/declaration.js +245 -0
  35. package/dist/dev/src/components/interface/declaration.js.map +1 -0
  36. package/dist/dev/src/components/interface/interface.test.js +853 -0
  37. package/dist/dev/src/components/interface/interface.test.js.map +1 -0
  38. package/dist/dev/src/components/package.test.js +137 -0
  39. package/dist/dev/src/components/package.test.js.map +1 -0
  40. package/dist/dev/src/components/parameters/parameters.js +102 -0
  41. package/dist/dev/src/components/parameters/parameters.js.map +1 -0
  42. package/dist/dev/src/components/parameters/typeparameters.js +93 -0
  43. package/dist/dev/src/components/parameters/typeparameters.js.map +1 -0
  44. package/dist/dev/src/components/pointer/pointer.js +8 -0
  45. package/dist/dev/src/components/pointer/pointer.js.map +1 -0
  46. package/dist/dev/src/components/stc/index.js +27 -0
  47. package/dist/dev/src/components/stc/index.js.map +1 -0
  48. package/dist/dev/src/components/struct/declaration.js +213 -0
  49. package/dist/dev/src/components/struct/declaration.js.map +1 -0
  50. package/dist/dev/src/components/struct/struct.test.js +1261 -0
  51. package/dist/dev/src/components/struct/struct.test.js.map +1 -0
  52. package/dist/dev/src/components/type/declaration.js +112 -0
  53. package/dist/dev/src/components/type/declaration.js.map +1 -0
  54. package/dist/dev/src/components/var/declaration.js +136 -0
  55. package/dist/dev/src/components/var/declaration.js.map +1 -0
  56. package/dist/dev/src/components/var/var-declaration.test.js +564 -0
  57. package/dist/dev/src/components/var/var-declaration.test.js.map +1 -0
  58. package/dist/dev/src/context/package.js +6 -0
  59. package/dist/dev/src/context/package.js.map +1 -0
  60. package/dist/dev/src/create-module.js +157 -0
  61. package/dist/dev/src/create-module.js.map +1 -0
  62. package/dist/dev/src/create-module.test.js +175 -0
  63. package/dist/dev/src/create-module.test.js.map +1 -0
  64. package/dist/dev/src/index.js +7 -0
  65. package/dist/dev/src/index.js.map +1 -0
  66. package/dist/dev/src/name-policy.js +27 -0
  67. package/dist/dev/src/name-policy.js.map +1 -0
  68. package/dist/dev/src/scopes/contexts.js +34 -0
  69. package/dist/dev/src/scopes/contexts.js.map +1 -0
  70. package/dist/dev/src/scopes/factories.js +17 -0
  71. package/dist/dev/src/scopes/factories.js.map +1 -0
  72. package/dist/dev/src/scopes/function.js +14 -0
  73. package/dist/dev/src/scopes/function.js.map +1 -0
  74. package/dist/dev/src/scopes/go.js +12 -0
  75. package/dist/dev/src/scopes/go.js.map +1 -0
  76. package/dist/dev/src/scopes/index.js +10 -0
  77. package/dist/dev/src/scopes/index.js.map +1 -0
  78. package/dist/dev/src/scopes/lexical.js +11 -0
  79. package/dist/dev/src/scopes/lexical.js.map +1 -0
  80. package/dist/dev/src/scopes/module.js +31 -0
  81. package/dist/dev/src/scopes/module.js.map +1 -0
  82. package/dist/dev/src/scopes/named-type.js +33 -0
  83. package/dist/dev/src/scopes/named-type.js.map +1 -0
  84. package/dist/dev/src/scopes/package.js +39 -0
  85. package/dist/dev/src/scopes/package.js.map +1 -0
  86. package/dist/dev/src/scopes/source-file.js +43 -0
  87. package/dist/dev/src/scopes/source-file.js.map +1 -0
  88. package/dist/dev/src/symbols/factories.js +165 -0
  89. package/dist/dev/src/symbols/factories.js.map +1 -0
  90. package/dist/dev/src/symbols/function.js +24 -0
  91. package/dist/dev/src/symbols/function.js.map +1 -0
  92. package/dist/dev/src/symbols/go.js +60 -0
  93. package/dist/dev/src/symbols/go.js.map +1 -0
  94. package/dist/dev/src/symbols/index.js +7 -0
  95. package/dist/dev/src/symbols/index.js.map +1 -0
  96. package/dist/dev/src/symbols/named-type.js +42 -0
  97. package/dist/dev/src/symbols/named-type.js.map +1 -0
  98. package/dist/dev/src/symbols/package.js +39 -0
  99. package/dist/dev/src/symbols/package.js.map +1 -0
  100. package/dist/dev/src/symbols/reference.js +76 -0
  101. package/dist/dev/src/symbols/reference.js.map +1 -0
  102. package/dist/dev/src/symbols/type-parameter.js +16 -0
  103. package/dist/dev/src/symbols/type-parameter.js.map +1 -0
  104. package/dist/dev/test/utils.js +92 -0
  105. package/dist/dev/test/utils.js.map +1 -0
  106. package/dist/dev/test/vitest.setup.js +2 -0
  107. package/dist/dev/test/vitest.setup.js.map +1 -0
  108. package/dist/tsconfig.tsbuildinfo +1 -1
  109. package/docs/api/components/FunctionDeclaration.md +53 -0
  110. package/docs/api/components/FunctionParameter.md +40 -0
  111. package/docs/api/components/FunctionParameters.md +29 -0
  112. package/docs/api/components/FunctionReceiver.md +38 -0
  113. package/docs/api/components/ImportStatements.md +25 -0
  114. package/docs/api/components/InterfaceDeclaration.md +54 -0
  115. package/docs/api/components/InterfaceEmbed.md +29 -0
  116. package/docs/api/components/InterfaceFunction.md +41 -0
  117. package/docs/api/components/InterfaceTypeDeclaration.md +56 -0
  118. package/docs/api/components/LineComment.md +29 -0
  119. package/docs/api/components/ModuleDirectory.md +29 -0
  120. package/docs/api/components/Name.md +19 -0
  121. package/docs/api/components/Pointer.md +29 -0
  122. package/docs/api/components/Reference.md +25 -0
  123. package/docs/api/components/SingleImportStatement.md +35 -0
  124. package/docs/api/components/SourceDirectory.md +27 -0
  125. package/docs/api/components/SourceFile.md +44 -0
  126. package/docs/api/components/StructDeclaration.md +51 -0
  127. package/docs/api/components/StructEmbed.md +29 -0
  128. package/docs/api/components/StructMember.md +41 -0
  129. package/docs/api/components/StructTypeDeclaration.md +56 -0
  130. package/docs/api/components/TypeConstraint.md +28 -0
  131. package/docs/api/components/TypeDeclaration.md +47 -0
  132. package/docs/api/components/TypeDeclarationGroup.md +27 -0
  133. package/docs/api/components/TypeParameter.md +37 -0
  134. package/docs/api/components/TypeParameters.md +25 -0
  135. package/docs/api/components/VariableDeclaration.md +44 -0
  136. package/docs/api/components/VariableDeclarationGroup.md +28 -0
  137. package/docs/api/components/index.md +30 -0
  138. package/docs/api/contexts/TypeDeclarationGroup-context.md +17 -0
  139. package/docs/api/contexts/VariableDeclarationGroup-context.md +18 -0
  140. package/docs/api/contexts/index.md +4 -0
  141. package/docs/api/functions/createAnonymousTypeSymbol.md +25 -0
  142. package/docs/api/functions/createFunctionScope.md +26 -0
  143. package/docs/api/functions/createFunctionSymbol.md +35 -0
  144. package/docs/api/functions/createGoModuleScope.md +18 -0
  145. package/docs/api/functions/createGoNamePolicy.md +17 -0
  146. package/docs/api/functions/createGoPackageScope.md +18 -0
  147. package/docs/api/functions/createInterfaceMemberSymbol.md +25 -0
  148. package/docs/api/functions/createModule.md +20 -0
  149. package/docs/api/functions/createNamedTypeScope.md +27 -0
  150. package/docs/api/functions/createNestedStructSymbol.md +26 -0
  151. package/docs/api/functions/createPackageSymbol.md +19 -0
  152. package/docs/api/functions/createParameterSymbol.md +36 -0
  153. package/docs/api/functions/createPropertySymbol.md +34 -0
  154. package/docs/api/functions/createStructMemberSymbol.md +25 -0
  155. package/docs/api/functions/createTypeParameterSymbol.md +25 -0
  156. package/docs/api/functions/createTypeSymbol.md +26 -0
  157. package/docs/api/functions/createVariableSymbol.md +34 -0
  158. package/docs/api/functions/index.md +29 -0
  159. package/docs/api/functions/ref.md +18 -0
  160. package/docs/api/functions/useEnclosingPackageScope.md +17 -0
  161. package/docs/api/functions/useFuncScope.md +17 -0
  162. package/docs/api/functions/useGoNamePolicy.md +17 -0
  163. package/docs/api/functions/useGoScope.md +17 -0
  164. package/docs/api/functions/useLexicalScope.md +17 -0
  165. package/docs/api/functions/useModule.md +17 -0
  166. package/docs/api/functions/useNamedTypeScope.md +17 -0
  167. package/docs/api/functions/usePackage.md +17 -0
  168. package/docs/api/functions/useSourceFileScope.md +17 -0
  169. package/docs/api/index.md +7 -0
  170. package/docs/api/types/CreateTypeParameterSymbolOptions.md +9 -0
  171. package/docs/api/types/Descriptor.md +5 -0
  172. package/docs/api/types/EmbedDescriptor.md +9 -0
  173. package/docs/api/types/FieldDescriptor.md +9 -0
  174. package/docs/api/types/FunctionDescriptor.md +9 -0
  175. package/docs/api/types/FunctionSymbol.md +13 -0
  176. package/docs/api/types/GoElements.md +5 -0
  177. package/docs/api/types/GoFunctionScope.md +12 -0
  178. package/docs/api/types/GoLexicalScope.md +11 -0
  179. package/docs/api/types/GoModuleScope.md +10 -0
  180. package/docs/api/types/GoNamedTypeScope.md +16 -0
  181. package/docs/api/types/GoPackageScope.md +10 -0
  182. package/docs/api/types/GoScope.md +10 -0
  183. package/docs/api/types/GoSourceFileScope.md +13 -0
  184. package/docs/api/types/GoSymbol.md +17 -0
  185. package/docs/api/types/GoSymbolKinds.md +5 -0
  186. package/docs/api/types/GoSymbolOptions.md +10 -0
  187. package/docs/api/types/ImportRecords.md +5 -0
  188. package/docs/api/types/InterfaceDescriptor.md +9 -0
  189. package/docs/api/types/LibraryFrom.md +5 -0
  190. package/docs/api/types/MemberDescriptor.md +8 -0
  191. package/docs/api/types/MethodDescriptor.md +9 -0
  192. package/docs/api/types/NamedTypeDescriptor.md +8 -0
  193. package/docs/api/types/NamedTypeSymbol.md +17 -0
  194. package/docs/api/types/NamedTypeSymbolKind.md +5 -0
  195. package/docs/api/types/NamedTypeSymbolOptions.md +9 -0
  196. package/docs/api/types/NamedTypeTypeKind.md +5 -0
  197. package/docs/api/types/PackageDescriptor.md +12 -0
  198. package/docs/api/types/PackageSymbol.md +15 -0
  199. package/docs/api/types/PackageSymbolOptions.md +10 -0
  200. package/docs/api/types/ResolveDescriptor.md +7 -0
  201. package/docs/api/types/SourceFileHeaderProps.md +9 -0
  202. package/docs/api/types/StrictDescriptor.md +5 -0
  203. package/docs/api/types/StructDescriptor.md +9 -0
  204. package/docs/api/types/TypeDescriptor.md +9 -0
  205. package/docs/api/types/VariableDescriptor.md +9 -0
  206. package/docs/api/types/index.md +38 -0
  207. package/docs/api/variables/index.md +3 -0
  208. package/docs/api/variables/std.md +2463 -0
  209. package/package.json +10 -7
  210. package/vitest.config.ts +8 -0
@@ -0,0 +1,27 @@
1
+ # createNamedTypeScope
2
+
3
+ ```ts
4
+ import { createNamedTypeScope } from "@alloy-js/go";
5
+
6
+
7
+ function createNamedTypeScope(ownerSymbol: NamedTypeSymbol, options?: OutputScopeOptions): GoNamedTypeScope;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ----------- | --------------------------- | - |
14
+ | ownerSymbol | NamedTypeSymbol | |
15
+ | options | optional OutputScopeOptions | |
16
+
17
+ ## Options
18
+
19
+ | | | |
20
+ | ----------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | binder | optional [Binder](../../../core/types/binder/) | The binder instance this scope belongs to. If not provided, it will attempt to find the current binder from context. |
22
+ | metadata | optional Record\<string, unknown> | Arbitrary metadata that is associated with this scope. |
23
+ | ownerSymbol | optional [OutputSymbol](../../../core/types/outputsymbol/) | The owner symbol of this scope. When provided, this scope becomes a member scope, which exposes the symbols on its owner symbol instead of having its own declaration spaces. |
24
+
25
+ ## Returns
26
+
27
+ [GoNamedTypeScope](../../types/gonamedtypescope/)
@@ -0,0 +1,26 @@
1
+ # createNestedStructSymbol
2
+
3
+ ```ts
4
+ import { createNestedStructSymbol } from "@alloy-js/go";
5
+
6
+
7
+ function createNestedStructSymbol(originalName: string | Namekey, kind: NamedTypeTypeKind, options?: NamedTypeSymbolOptions): NamedTypeSymbol;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ------------ | ------------------------------- | - |
14
+ | originalName | string \| Namekey | |
15
+ | kind | NamedTypeTypeKind | |
16
+ | options | optional NamedTypeSymbolOptions | |
17
+
18
+ ## Options
19
+
20
+ | | | |
21
+ | -------------- | --------------------------------------------- | - |
22
+ | typeParameters | optional [GoSymbol](../../types/gosymbol/)\[] | |
23
+
24
+ ## Returns
25
+
26
+ [NamedTypeSymbol](../../types/namedtypesymbol/)
@@ -0,0 +1,19 @@
1
+ # createPackageSymbol
2
+
3
+ ```ts
4
+ import { createPackageSymbol } from "@alloy-js/go";
5
+
6
+
7
+ function createPackageSymbol(name: string, path?: string): PackageSymbol;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ---- | --------------- | - |
14
+ | name | string | |
15
+ | path | optional string | |
16
+
17
+ ## Returns
18
+
19
+ [PackageSymbol](../../types/packagesymbol/)
@@ -0,0 +1,36 @@
1
+ # createParameterSymbol
2
+
3
+ Create a symbol for a parameter in the current func scope.
4
+
5
+ ```ts
6
+ import { createParameterSymbol } from "@alloy-js/go";
7
+
8
+
9
+ function createParameterSymbol(originalName: string | Namekey, options?: GoSymbolOptions): GoSymbol;
10
+ ```
11
+
12
+ ## Parameters
13
+
14
+ | | | |
15
+ | ------------ | ------------------------ | - |
16
+ | originalName | string \| Namekey | |
17
+ | options | optional GoSymbolOptions | |
18
+
19
+ ## Options
20
+
21
+ | | | |
22
+ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23
+ | aliasTarget | optional [OutputSymbol](../../../core/types/outputsymbol/) | The symbol this symbol is an alias for. |
24
+ | binder | optional [Binder](../../../core/types/binder/) | The binder instance associated with this symbol. Symbol updates and changes will be reported to this binder. This binder will be able to find this symbol via its refkey and other means. Without a binder, this symbol will be unbound, which means it cannot be referenced by refkey. When constructing an external library symbol, pass `{ binder }` here to ensure the symbol is registered with the binder. See [TO\_SYMBOL](../../../core/variables/to_symbol/) for the full implementation protocol. |
25
+ | ignoreNameConflict | optional boolean | Whether the name of this symbol should bypass the active name conflict resolution. When true, the name of this symbol will be fixed, though it may conflict with other symbols which are also ignoring name conflict resolution. |
26
+ | ignoreNamePolicy | optional boolean | Whether the name of this symbol should bypass the active name policy. When true, the name of this symbol will be fixed, though it may conflict with other symbols which are also ignoring the name policy. |
27
+ | lazyMemberInitializer | optional () => void | Provide a function which lazy-initializes members the first time `resolveMemberByName()` is called on this symbol. Called at most once. Only `resolveMemberByName()` triggers this callback — iterating `OutputMemberSpace` directly does not. The callback fires regardless of whether the symbol belongs to any scope, so it is safe to use on scopeless external library symbols. |
28
+ | metadata | optional Record\<string, unknown> | Arbitrary metadata about this symbol. |
29
+ | namePolicy | optional [NamePolicyGetter](../../../core/types/namepolicygetter/) | When provided, this symbol will be named according to the provided name policy. |
30
+ | refkeys | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or refkeys associated with this symbol. |
31
+ | transient | optional boolean | Whether this symbol is transient. |
32
+ | type | optional [OutputSymbol](../../../core/types/outputsymbol/) \| Ref<[OutputSymbol](../../../core/types/outputsymbol/) \| undefined> | The symbol that provides type information for this symbol. When present, this symbol will not contain its own members, and instead members will be provided by the type. This can be provided a Ref, in which case the type will be the value of that ref. |
33
+
34
+ ## Returns
35
+
36
+ [GoSymbol](../../types/gosymbol/)
@@ -0,0 +1,34 @@
1
+ # createPropertySymbol
2
+
3
+ ```ts
4
+ import { createPropertySymbol } from "@alloy-js/go";
5
+
6
+
7
+ function createPropertySymbol(originalName: string | Namekey, options: GoSymbolOptions): GoSymbol;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ------------ | ----------------- | - |
14
+ | originalName | string \| Namekey | |
15
+ | options | GoSymbolOptions | |
16
+
17
+ ## Options
18
+
19
+ | | | |
20
+ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | aliasTarget | optional [OutputSymbol](../../../core/types/outputsymbol/) | The symbol this symbol is an alias for. |
22
+ | binder | optional [Binder](../../../core/types/binder/) | The binder instance associated with this symbol. Symbol updates and changes will be reported to this binder. This binder will be able to find this symbol via its refkey and other means. Without a binder, this symbol will be unbound, which means it cannot be referenced by refkey. When constructing an external library symbol, pass `{ binder }` here to ensure the symbol is registered with the binder. See [TO\_SYMBOL](../../../core/variables/to_symbol/) for the full implementation protocol. |
23
+ | ignoreNameConflict | optional boolean | Whether the name of this symbol should bypass the active name conflict resolution. When true, the name of this symbol will be fixed, though it may conflict with other symbols which are also ignoring name conflict resolution. |
24
+ | ignoreNamePolicy | optional boolean | Whether the name of this symbol should bypass the active name policy. When true, the name of this symbol will be fixed, though it may conflict with other symbols which are also ignoring the name policy. |
25
+ | lazyMemberInitializer | optional () => void | Provide a function which lazy-initializes members the first time `resolveMemberByName()` is called on this symbol. Called at most once. Only `resolveMemberByName()` triggers this callback — iterating `OutputMemberSpace` directly does not. The callback fires regardless of whether the symbol belongs to any scope, so it is safe to use on scopeless external library symbols. |
26
+ | metadata | optional Record\<string, unknown> | Arbitrary metadata about this symbol. |
27
+ | namePolicy | optional [NamePolicyGetter](../../../core/types/namepolicygetter/) | When provided, this symbol will be named according to the provided name policy. |
28
+ | refkeys | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or refkeys associated with this symbol. |
29
+ | transient | optional boolean | Whether this symbol is transient. |
30
+ | type | optional [OutputSymbol](../../../core/types/outputsymbol/) \| Ref<[OutputSymbol](../../../core/types/outputsymbol/) \| undefined> | The symbol that provides type information for this symbol. When present, this symbol will not contain its own members, and instead members will be provided by the type. This can be provided a Ref, in which case the type will be the value of that ref. |
31
+
32
+ ## Returns
33
+
34
+ [GoSymbol](../../types/gosymbol/)
@@ -0,0 +1,25 @@
1
+ # createStructMemberSymbol
2
+
3
+ ```ts
4
+ import { createStructMemberSymbol } from "@alloy-js/go";
5
+
6
+
7
+ function createStructMemberSymbol(originalName: string | Namekey, options?: NamedTypeSymbolOptions): NamedTypeSymbol;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ------------ | ------------------------------- | - |
14
+ | originalName | string \| Namekey | |
15
+ | options | optional NamedTypeSymbolOptions | |
16
+
17
+ ## Options
18
+
19
+ | | | |
20
+ | -------------- | --------------------------------------------- | - |
21
+ | typeParameters | optional [GoSymbol](../../types/gosymbol/)\[] | |
22
+
23
+ ## Returns
24
+
25
+ [NamedTypeSymbol](../../types/namedtypesymbol/)
@@ -0,0 +1,25 @@
1
+ # createTypeParameterSymbol
2
+
3
+ ```ts
4
+ import { createTypeParameterSymbol } from "@alloy-js/go";
5
+
6
+
7
+ function createTypeParameterSymbol(originalName: string | Namekey, options?: CreateTypeParameterSymbolOptions): GoSymbol;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ------------ | ----------------------------------------- | - |
14
+ | originalName | string \| Namekey | |
15
+ | options | optional CreateTypeParameterSymbolOptions | |
16
+
17
+ ## Options
18
+
19
+ | | | |
20
+ | ----- | ------------------------------------------------------------------------------------------------------------- | - |
21
+ | scope | optional [GoFunctionScope](../../types/gofunctionscope/) \| [GoNamedTypeScope](../../types/gonamedtypescope/) | |
22
+
23
+ ## Returns
24
+
25
+ [GoSymbol](../../types/gosymbol/)
@@ -0,0 +1,26 @@
1
+ # createTypeSymbol
2
+
3
+ ```ts
4
+ import { createTypeSymbol } from "@alloy-js/go";
5
+
6
+
7
+ function createTypeSymbol(originalName: string | Namekey, kind: NamedTypeTypeKind, options?: NamedTypeSymbolOptions): NamedTypeSymbol;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ------------ | ------------------------------- | - |
14
+ | originalName | string \| Namekey | |
15
+ | kind | NamedTypeTypeKind | |
16
+ | options | optional NamedTypeSymbolOptions | |
17
+
18
+ ## Options
19
+
20
+ | | | |
21
+ | -------------- | --------------------------------------------- | - |
22
+ | typeParameters | optional [GoSymbol](../../types/gosymbol/)\[] | |
23
+
24
+ ## Returns
25
+
26
+ [NamedTypeSymbol](../../types/namedtypesymbol/)
@@ -0,0 +1,34 @@
1
+ # createVariableSymbol
2
+
3
+ ```ts
4
+ import { createVariableSymbol } from "@alloy-js/go";
5
+
6
+
7
+ function createVariableSymbol(originalName: string | Namekey, options?: GoSymbolOptions): GoSymbol;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ------------ | ------------------------ | - |
14
+ | originalName | string \| Namekey | |
15
+ | options | optional GoSymbolOptions | |
16
+
17
+ ## Options
18
+
19
+ | | | |
20
+ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | aliasTarget | optional [OutputSymbol](../../../core/types/outputsymbol/) | The symbol this symbol is an alias for. |
22
+ | binder | optional [Binder](../../../core/types/binder/) | The binder instance associated with this symbol. Symbol updates and changes will be reported to this binder. This binder will be able to find this symbol via its refkey and other means. Without a binder, this symbol will be unbound, which means it cannot be referenced by refkey. When constructing an external library symbol, pass `{ binder }` here to ensure the symbol is registered with the binder. See [TO\_SYMBOL](../../../core/variables/to_symbol/) for the full implementation protocol. |
23
+ | ignoreNameConflict | optional boolean | Whether the name of this symbol should bypass the active name conflict resolution. When true, the name of this symbol will be fixed, though it may conflict with other symbols which are also ignoring name conflict resolution. |
24
+ | ignoreNamePolicy | optional boolean | Whether the name of this symbol should bypass the active name policy. When true, the name of this symbol will be fixed, though it may conflict with other symbols which are also ignoring the name policy. |
25
+ | lazyMemberInitializer | optional () => void | Provide a function which lazy-initializes members the first time `resolveMemberByName()` is called on this symbol. Called at most once. Only `resolveMemberByName()` triggers this callback — iterating `OutputMemberSpace` directly does not. The callback fires regardless of whether the symbol belongs to any scope, so it is safe to use on scopeless external library symbols. |
26
+ | metadata | optional Record\<string, unknown> | Arbitrary metadata about this symbol. |
27
+ | namePolicy | optional [NamePolicyGetter](../../../core/types/namepolicygetter/) | When provided, this symbol will be named according to the provided name policy. |
28
+ | refkeys | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or refkeys associated with this symbol. |
29
+ | transient | optional boolean | Whether this symbol is transient. |
30
+ | type | optional [OutputSymbol](../../../core/types/outputsymbol/) \| Ref<[OutputSymbol](../../../core/types/outputsymbol/) \| undefined> | The symbol that provides type information for this symbol. When present, this symbol will not contain its own members, and instead members will be provided by the type. This can be provided a Ref, in which case the type will be the value of that ref. |
31
+
32
+ ## Returns
33
+
34
+ [GoSymbol](../../types/gosymbol/)
@@ -0,0 +1,29 @@
1
+ # go — functions
2
+
3
+ - [createAnonymousTypeSymbol](createAnonymousTypeSymbol.md) — import { createAnonymousTypeSymbol } from "@alloy-js/go";
4
+ - [createFunctionScope](createFunctionScope.md) — import { createFunctionScope } from "@alloy-js/go";
5
+ - [createFunctionSymbol](createFunctionSymbol.md) — import { createFunctionSymbol } from "@alloy-js/go";
6
+ - [createGoModuleScope](createGoModuleScope.md) — import { createGoModuleScope } from "@alloy-js/go";
7
+ - [createGoNamePolicy](createGoNamePolicy.md) — import { createGoNamePolicy } from "@alloy-js/go";
8
+ - [createGoPackageScope](createGoPackageScope.md) — import { createGoPackageScope } from "@alloy-js/go";
9
+ - [createInterfaceMemberSymbol](createInterfaceMemberSymbol.md) — import { createInterfaceMemberSymbol } from "@alloy-js/go";
10
+ - [createModule](createModule.md) — import { createModule } from "@alloy-js/go";
11
+ - [createNamedTypeScope](createNamedTypeScope.md) — import { createNamedTypeScope } from "@alloy-js/go";
12
+ - [createNestedStructSymbol](createNestedStructSymbol.md) — import { createNestedStructSymbol } from "@alloy-js/go";
13
+ - [createPackageSymbol](createPackageSymbol.md) — import { createPackageSymbol } from "@alloy-js/go";
14
+ - [createParameterSymbol](createParameterSymbol.md) — Create a symbol for a parameter in the current func scope.
15
+ - [createPropertySymbol](createPropertySymbol.md) — import { createPropertySymbol } from "@alloy-js/go";
16
+ - [createStructMemberSymbol](createStructMemberSymbol.md) — import { createStructMemberSymbol } from "@alloy-js/go";
17
+ - [createTypeParameterSymbol](createTypeParameterSymbol.md) — import { createTypeParameterSymbol } from "@alloy-js/go";
18
+ - [createTypeSymbol](createTypeSymbol.md) — import { createTypeSymbol } from "@alloy-js/go";
19
+ - [createVariableSymbol](createVariableSymbol.md) — import { createVariableSymbol } from "@alloy-js/go";
20
+ - [ref](ref.md) — import { ref } from "@alloy-js/go";
21
+ - [useEnclosingPackageScope](useEnclosingPackageScope.md) — import { useEnclosingPackageScope } from "@alloy-js/go";
22
+ - [useFuncScope](useFuncScope.md) — import { useFuncScope } from "@alloy-js/go";
23
+ - [useGoNamePolicy](useGoNamePolicy.md) — import { useGoNamePolicy } from "@alloy-js/go";
24
+ - [useGoScope](useGoScope.md) — import { useGoScope } from "@alloy-js/go";
25
+ - [useLexicalScope](useLexicalScope.md) — import { useLexicalScope } from "@alloy-js/go";
26
+ - [useModule](useModule.md) — import { useModule } from "@alloy-js/go";
27
+ - [useNamedTypeScope](useNamedTypeScope.md) — import { useNamedTypeScope } from "@alloy-js/go";
28
+ - [usePackage](usePackage.md) — import { usePackage } from "@alloy-js/go";
29
+ - [useSourceFileScope](useSourceFileScope.md) — import { useSourceFileScope } from "@alloy-js/go";
@@ -0,0 +1,18 @@
1
+ # ref
2
+
3
+ ```ts
4
+ import { ref } from "@alloy-js/go";
5
+
6
+
7
+ function ref(refkey: Refkey): () => [string, OutputSymbol | undefined];
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | | | |
13
+ | ------ | ------ | - |
14
+ | refkey | Refkey | |
15
+
16
+ ## Returns
17
+
18
+ () => \[string, [OutputSymbol](../../../core/types/outputsymbol/) | undefined]
@@ -0,0 +1,17 @@
1
+ # useEnclosingPackageScope
2
+
3
+ ```ts
4
+ import { useEnclosingPackageScope } from "@alloy-js/go";
5
+
6
+
7
+ function useEnclosingPackageScope(): GoPackageScope | undefined;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | |
13
+ | - |
14
+
15
+ ## Returns
16
+
17
+ [GoPackageScope](../../types/gopackagescope/) | undefined
@@ -0,0 +1,17 @@
1
+ # useFuncScope
2
+
3
+ ```ts
4
+ import { useFuncScope } from "@alloy-js/go";
5
+
6
+
7
+ function useFuncScope(): GoFunctionScope;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | |
13
+ | - |
14
+
15
+ ## Returns
16
+
17
+ [GoFunctionScope](../../types/gofunctionscope/)
@@ -0,0 +1,17 @@
1
+ # useGoNamePolicy
2
+
3
+ ```ts
4
+ import { useGoNamePolicy } from "@alloy-js/go";
5
+
6
+
7
+ function useGoNamePolicy(): NamePolicy<GoElements>;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | |
13
+ | - |
14
+
15
+ ## Returns
16
+
17
+ [NamePolicy](../../../core/types/namepolicy/)<[GoElements](../../types/goelements/)>
@@ -0,0 +1,17 @@
1
+ # useGoScope
2
+
3
+ ```ts
4
+ import { useGoScope } from "@alloy-js/go";
5
+
6
+
7
+ function useGoScope(): GoScope;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | |
13
+ | - |
14
+
15
+ ## Returns
16
+
17
+ [GoScope](../../types/goscope/)
@@ -0,0 +1,17 @@
1
+ # useLexicalScope
2
+
3
+ ```ts
4
+ import { useLexicalScope } from "@alloy-js/go";
5
+
6
+
7
+ function useLexicalScope(): GoLexicalScope;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | |
13
+ | - |
14
+
15
+ ## Returns
16
+
17
+ [GoLexicalScope](../../types/golexicalscope/)
@@ -0,0 +1,17 @@
1
+ # useModule
2
+
3
+ ```ts
4
+ import { useModule } from "@alloy-js/go";
5
+
6
+
7
+ function useModule(): GoModuleScope;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | |
13
+ | - |
14
+
15
+ ## Returns
16
+
17
+ [GoModuleScope](../../types/gomodulescope/)
@@ -0,0 +1,17 @@
1
+ # useNamedTypeScope
2
+
3
+ ```ts
4
+ import { useNamedTypeScope } from "@alloy-js/go";
5
+
6
+
7
+ function useNamedTypeScope(): GoNamedTypeScope;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | |
13
+ | - |
14
+
15
+ ## Returns
16
+
17
+ [GoNamedTypeScope](../../types/gonamedtypescope/)
@@ -0,0 +1,17 @@
1
+ # usePackage
2
+
3
+ ```ts
4
+ import { usePackage } from "@alloy-js/go";
5
+
6
+
7
+ function usePackage(): GoPackageScope;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | |
13
+ | - |
14
+
15
+ ## Returns
16
+
17
+ [GoPackageScope](../../types/gopackagescope/)
@@ -0,0 +1,17 @@
1
+ # useSourceFileScope
2
+
3
+ ```ts
4
+ import { useSourceFileScope } from "@alloy-js/go";
5
+
6
+
7
+ function useSourceFileScope(): GoSourceFileScope | undefined;
8
+ ```
9
+
10
+ ## Parameters
11
+
12
+ | |
13
+ | - |
14
+
15
+ ## Returns
16
+
17
+ [GoSourceFileScope](../../types/gosourcefilescope/) | undefined
@@ -0,0 +1,7 @@
1
+ # @alloy-js/go API Reference
2
+
3
+ - [components](components/index.md) (28 items)
4
+ - [contexts](contexts/index.md) (2 items)
5
+ - [functions](functions/index.md) (27 items)
6
+ - [types](types/index.md) (36 items)
7
+ - [variables](variables/index.md) (1 items)
@@ -0,0 +1,9 @@
1
+ # CreateTypeParameterSymbolOptions
2
+
3
+ ## Members
4
+
5
+ Extends [GoSymbolOptions](../gosymboloptions/)
6
+
7
+ | | | |
8
+ | ----- | ------------------------------------------------------------------------------------------- | - |
9
+ | scope | optional [GoFunctionScope](../gofunctionscope/) \| [GoNamedTypeScope](../gonamedtypescope/) | |
@@ -0,0 +1,5 @@
1
+ # Descriptor
2
+
3
+ ```ts
4
+ type Descriptor = PackageDescriptor<any> | FieldDescriptor | FunctionDescriptor | MethodDescriptor | VariableDescriptor | StructDescriptor<any> | InterfaceDescriptor<any> | TypeDescriptor<any> | EmbedDescriptor;
5
+ ```
@@ -0,0 +1,9 @@
1
+ # EmbedDescriptor
2
+
3
+ ## Members
4
+
5
+ Extends [MemberDescriptor](../memberdescriptor/)
6
+
7
+ | | | |
8
+ | ---- | ------- | - |
9
+ | kind | ”embed” | |
@@ -0,0 +1,9 @@
1
+ # FieldDescriptor
2
+
3
+ ## Members
4
+
5
+ Extends [MemberDescriptor](../memberdescriptor/)
6
+
7
+ | | | |
8
+ | ---- | ------- | - |
9
+ | kind | ”field” | |
@@ -0,0 +1,9 @@
1
+ # FunctionDescriptor
2
+
3
+ ## Members
4
+
5
+ Extends [MemberDescriptor](../memberdescriptor/)
6
+
7
+ | | | |
8
+ | ---- | ---------- | - |
9
+ | kind | ”function” | |
@@ -0,0 +1,13 @@
1
+ # FunctionSymbol
2
+
3
+ A symbol for a function in Go, including receivers.
4
+
5
+ ## Members
6
+
7
+ Extends [GoSymbol](../gosymbol/)
8
+
9
+ | | | |
10
+ | -------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------- |
11
+ | constructor | (name: string \| Namekey, spaces: OutputSpace \| undefined, options: GoSymbolOptions) | Constructs a new instance of the [`FunctionSymbol`](FunctionSymbol.md) class |
12
+ | receiverSymbol | [NamedTypeSymbol](../namedtypesymbol/) \| undefined | |
13
+ | symbolKind | | |
@@ -0,0 +1,5 @@
1
+ # GoElements
2
+
3
+ ```ts
4
+ type GoElements = "parameter" | "type-parameter" | "function" | "type" | "variable" | "struct-member" | "interface-member";
5
+ ```
@@ -0,0 +1,12 @@
1
+ # GoFunctionScope
2
+
3
+ ## Members
4
+
5
+ Extends [GoLexicalScope](../golexicalscope/)
6
+
7
+ | | | |
8
+ | ----------------- | ----------------------------------------------- | - |
9
+ | declarationSpaces | string\[] | |
10
+ | localVariables | [OutputSpace](../../../core/types/outputspace/) | |
11
+ | parameters | [OutputSpace](../../../core/types/outputspace/) | |
12
+ | typeParameters | [OutputSpace](../../../core/types/outputspace/) | |
@@ -0,0 +1,11 @@
1
+ # GoLexicalScope
2
+
3
+ ## Members
4
+
5
+ Extends [GoScope](../goscope/)
6
+
7
+ | | | |
8
+ | ----------------- | ----------------------------------------------- | - |
9
+ | declarationSpaces | string\[] | |
10
+ | types | [OutputSpace](../../../core/types/outputspace/) | |
11
+ | values | [OutputSpace](../../../core/types/outputspace/) | |
@@ -0,0 +1,10 @@
1
+ # GoModuleScope
2
+
3
+ ## Members
4
+
5
+ Extends [GoScope](../goscope/)
6
+
7
+ | | | |
8
+ | ----------- | -------------------------------- | ------------------------------------------------------ |
9
+ | constructor | (name: string, builtin: boolean) | Constructs a new instance of the [`GoModuleScope`](GoModuleScope.md) class |
10
+ | builtin | boolean | |