@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.
- package/CHANGELOG.md +8 -0
- package/dist/dev/src/builtins/fmt/fmt.js +148 -0
- package/dist/dev/src/builtins/fmt/fmt.js.map +1 -0
- package/dist/dev/src/builtins/index.js +11 -0
- package/dist/dev/src/builtins/index.js.map +1 -0
- package/dist/dev/src/builtins/io/io.js +650 -0
- package/dist/dev/src/builtins/io/io.js.map +1 -0
- package/dist/dev/src/builtins/net/net.js +1212 -0
- package/dist/dev/src/builtins/net/net.js.map +1 -0
- package/dist/dev/src/builtins/time/time.js +464 -0
- package/dist/dev/src/builtins/time/time.js.map +1 -0
- package/dist/dev/src/components/ImportStatement.js +114 -0
- package/dist/dev/src/components/ImportStatement.js.map +1 -0
- package/dist/dev/src/components/ModuleDirectory.js +28 -0
- package/dist/dev/src/components/ModuleDirectory.js.map +1 -0
- package/dist/dev/src/components/Name.js +12 -0
- package/dist/dev/src/components/Name.js.map +1 -0
- package/dist/dev/src/components/Reference.js +15 -0
- package/dist/dev/src/components/Reference.js.map +1 -0
- package/dist/dev/src/components/SourceDirectory.js +38 -0
- package/dist/dev/src/components/SourceDirectory.js.map +1 -0
- package/dist/dev/src/components/SourceFile.js +119 -0
- package/dist/dev/src/components/SourceFile.js.map +1 -0
- package/dist/dev/src/components/doc/comment.js +46 -0
- package/dist/dev/src/components/doc/comment.js.map +1 -0
- package/dist/dev/src/components/doc/comment.test.js +371 -0
- package/dist/dev/src/components/doc/comment.test.js.map +1 -0
- package/dist/dev/src/components/function/function.js +250 -0
- package/dist/dev/src/components/function/function.js.map +1 -0
- package/dist/dev/src/components/function/function.test.js +630 -0
- package/dist/dev/src/components/function/function.test.js.map +1 -0
- package/dist/dev/src/components/index.js +16 -0
- package/dist/dev/src/components/index.js.map +1 -0
- package/dist/dev/src/components/interface/declaration.js +245 -0
- package/dist/dev/src/components/interface/declaration.js.map +1 -0
- package/dist/dev/src/components/interface/interface.test.js +853 -0
- package/dist/dev/src/components/interface/interface.test.js.map +1 -0
- package/dist/dev/src/components/package.test.js +137 -0
- package/dist/dev/src/components/package.test.js.map +1 -0
- package/dist/dev/src/components/parameters/parameters.js +102 -0
- package/dist/dev/src/components/parameters/parameters.js.map +1 -0
- package/dist/dev/src/components/parameters/typeparameters.js +93 -0
- package/dist/dev/src/components/parameters/typeparameters.js.map +1 -0
- package/dist/dev/src/components/pointer/pointer.js +8 -0
- package/dist/dev/src/components/pointer/pointer.js.map +1 -0
- package/dist/dev/src/components/stc/index.js +27 -0
- package/dist/dev/src/components/stc/index.js.map +1 -0
- package/dist/dev/src/components/struct/declaration.js +213 -0
- package/dist/dev/src/components/struct/declaration.js.map +1 -0
- package/dist/dev/src/components/struct/struct.test.js +1261 -0
- package/dist/dev/src/components/struct/struct.test.js.map +1 -0
- package/dist/dev/src/components/type/declaration.js +112 -0
- package/dist/dev/src/components/type/declaration.js.map +1 -0
- package/dist/dev/src/components/var/declaration.js +136 -0
- package/dist/dev/src/components/var/declaration.js.map +1 -0
- package/dist/dev/src/components/var/var-declaration.test.js +564 -0
- package/dist/dev/src/components/var/var-declaration.test.js.map +1 -0
- package/dist/dev/src/context/package.js +6 -0
- package/dist/dev/src/context/package.js.map +1 -0
- package/dist/dev/src/create-module.js +157 -0
- package/dist/dev/src/create-module.js.map +1 -0
- package/dist/dev/src/create-module.test.js +175 -0
- package/dist/dev/src/create-module.test.js.map +1 -0
- package/dist/dev/src/index.js +7 -0
- package/dist/dev/src/index.js.map +1 -0
- package/dist/dev/src/name-policy.js +27 -0
- package/dist/dev/src/name-policy.js.map +1 -0
- package/dist/dev/src/scopes/contexts.js +34 -0
- package/dist/dev/src/scopes/contexts.js.map +1 -0
- package/dist/dev/src/scopes/factories.js +17 -0
- package/dist/dev/src/scopes/factories.js.map +1 -0
- package/dist/dev/src/scopes/function.js +14 -0
- package/dist/dev/src/scopes/function.js.map +1 -0
- package/dist/dev/src/scopes/go.js +12 -0
- package/dist/dev/src/scopes/go.js.map +1 -0
- package/dist/dev/src/scopes/index.js +10 -0
- package/dist/dev/src/scopes/index.js.map +1 -0
- package/dist/dev/src/scopes/lexical.js +11 -0
- package/dist/dev/src/scopes/lexical.js.map +1 -0
- package/dist/dev/src/scopes/module.js +31 -0
- package/dist/dev/src/scopes/module.js.map +1 -0
- package/dist/dev/src/scopes/named-type.js +33 -0
- package/dist/dev/src/scopes/named-type.js.map +1 -0
- package/dist/dev/src/scopes/package.js +39 -0
- package/dist/dev/src/scopes/package.js.map +1 -0
- package/dist/dev/src/scopes/source-file.js +43 -0
- package/dist/dev/src/scopes/source-file.js.map +1 -0
- package/dist/dev/src/symbols/factories.js +165 -0
- package/dist/dev/src/symbols/factories.js.map +1 -0
- package/dist/dev/src/symbols/function.js +24 -0
- package/dist/dev/src/symbols/function.js.map +1 -0
- package/dist/dev/src/symbols/go.js +60 -0
- package/dist/dev/src/symbols/go.js.map +1 -0
- package/dist/dev/src/symbols/index.js +7 -0
- package/dist/dev/src/symbols/index.js.map +1 -0
- package/dist/dev/src/symbols/named-type.js +42 -0
- package/dist/dev/src/symbols/named-type.js.map +1 -0
- package/dist/dev/src/symbols/package.js +39 -0
- package/dist/dev/src/symbols/package.js.map +1 -0
- package/dist/dev/src/symbols/reference.js +76 -0
- package/dist/dev/src/symbols/reference.js.map +1 -0
- package/dist/dev/src/symbols/type-parameter.js +16 -0
- package/dist/dev/src/symbols/type-parameter.js.map +1 -0
- package/dist/dev/test/utils.js +92 -0
- package/dist/dev/test/utils.js.map +1 -0
- package/dist/dev/test/vitest.setup.js +2 -0
- package/dist/dev/test/vitest.setup.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/FunctionDeclaration.md +53 -0
- package/docs/api/components/FunctionParameter.md +40 -0
- package/docs/api/components/FunctionParameters.md +29 -0
- package/docs/api/components/FunctionReceiver.md +38 -0
- package/docs/api/components/ImportStatements.md +25 -0
- package/docs/api/components/InterfaceDeclaration.md +54 -0
- package/docs/api/components/InterfaceEmbed.md +29 -0
- package/docs/api/components/InterfaceFunction.md +41 -0
- package/docs/api/components/InterfaceTypeDeclaration.md +56 -0
- package/docs/api/components/LineComment.md +29 -0
- package/docs/api/components/ModuleDirectory.md +29 -0
- package/docs/api/components/Name.md +19 -0
- package/docs/api/components/Pointer.md +29 -0
- package/docs/api/components/Reference.md +25 -0
- package/docs/api/components/SingleImportStatement.md +35 -0
- package/docs/api/components/SourceDirectory.md +27 -0
- package/docs/api/components/SourceFile.md +44 -0
- package/docs/api/components/StructDeclaration.md +51 -0
- package/docs/api/components/StructEmbed.md +29 -0
- package/docs/api/components/StructMember.md +41 -0
- package/docs/api/components/StructTypeDeclaration.md +56 -0
- package/docs/api/components/TypeConstraint.md +28 -0
- package/docs/api/components/TypeDeclaration.md +47 -0
- package/docs/api/components/TypeDeclarationGroup.md +27 -0
- package/docs/api/components/TypeParameter.md +37 -0
- package/docs/api/components/TypeParameters.md +25 -0
- package/docs/api/components/VariableDeclaration.md +44 -0
- package/docs/api/components/VariableDeclarationGroup.md +28 -0
- package/docs/api/components/index.md +30 -0
- package/docs/api/contexts/TypeDeclarationGroup-context.md +17 -0
- package/docs/api/contexts/VariableDeclarationGroup-context.md +18 -0
- package/docs/api/contexts/index.md +4 -0
- package/docs/api/functions/createAnonymousTypeSymbol.md +25 -0
- package/docs/api/functions/createFunctionScope.md +26 -0
- package/docs/api/functions/createFunctionSymbol.md +35 -0
- package/docs/api/functions/createGoModuleScope.md +18 -0
- package/docs/api/functions/createGoNamePolicy.md +17 -0
- package/docs/api/functions/createGoPackageScope.md +18 -0
- package/docs/api/functions/createInterfaceMemberSymbol.md +25 -0
- package/docs/api/functions/createModule.md +20 -0
- package/docs/api/functions/createNamedTypeScope.md +27 -0
- package/docs/api/functions/createNestedStructSymbol.md +26 -0
- package/docs/api/functions/createPackageSymbol.md +19 -0
- package/docs/api/functions/createParameterSymbol.md +36 -0
- package/docs/api/functions/createPropertySymbol.md +34 -0
- package/docs/api/functions/createStructMemberSymbol.md +25 -0
- package/docs/api/functions/createTypeParameterSymbol.md +25 -0
- package/docs/api/functions/createTypeSymbol.md +26 -0
- package/docs/api/functions/createVariableSymbol.md +34 -0
- package/docs/api/functions/index.md +29 -0
- package/docs/api/functions/ref.md +18 -0
- package/docs/api/functions/useEnclosingPackageScope.md +17 -0
- package/docs/api/functions/useFuncScope.md +17 -0
- package/docs/api/functions/useGoNamePolicy.md +17 -0
- package/docs/api/functions/useGoScope.md +17 -0
- package/docs/api/functions/useLexicalScope.md +17 -0
- package/docs/api/functions/useModule.md +17 -0
- package/docs/api/functions/useNamedTypeScope.md +17 -0
- package/docs/api/functions/usePackage.md +17 -0
- package/docs/api/functions/useSourceFileScope.md +17 -0
- package/docs/api/index.md +7 -0
- package/docs/api/types/CreateTypeParameterSymbolOptions.md +9 -0
- package/docs/api/types/Descriptor.md +5 -0
- package/docs/api/types/EmbedDescriptor.md +9 -0
- package/docs/api/types/FieldDescriptor.md +9 -0
- package/docs/api/types/FunctionDescriptor.md +9 -0
- package/docs/api/types/FunctionSymbol.md +13 -0
- package/docs/api/types/GoElements.md +5 -0
- package/docs/api/types/GoFunctionScope.md +12 -0
- package/docs/api/types/GoLexicalScope.md +11 -0
- package/docs/api/types/GoModuleScope.md +10 -0
- package/docs/api/types/GoNamedTypeScope.md +16 -0
- package/docs/api/types/GoPackageScope.md +10 -0
- package/docs/api/types/GoScope.md +10 -0
- package/docs/api/types/GoSourceFileScope.md +13 -0
- package/docs/api/types/GoSymbol.md +17 -0
- package/docs/api/types/GoSymbolKinds.md +5 -0
- package/docs/api/types/GoSymbolOptions.md +10 -0
- package/docs/api/types/ImportRecords.md +5 -0
- package/docs/api/types/InterfaceDescriptor.md +9 -0
- package/docs/api/types/LibraryFrom.md +5 -0
- package/docs/api/types/MemberDescriptor.md +8 -0
- package/docs/api/types/MethodDescriptor.md +9 -0
- package/docs/api/types/NamedTypeDescriptor.md +8 -0
- package/docs/api/types/NamedTypeSymbol.md +17 -0
- package/docs/api/types/NamedTypeSymbolKind.md +5 -0
- package/docs/api/types/NamedTypeSymbolOptions.md +9 -0
- package/docs/api/types/NamedTypeTypeKind.md +5 -0
- package/docs/api/types/PackageDescriptor.md +12 -0
- package/docs/api/types/PackageSymbol.md +15 -0
- package/docs/api/types/PackageSymbolOptions.md +10 -0
- package/docs/api/types/ResolveDescriptor.md +7 -0
- package/docs/api/types/SourceFileHeaderProps.md +9 -0
- package/docs/api/types/StrictDescriptor.md +5 -0
- package/docs/api/types/StructDescriptor.md +9 -0
- package/docs/api/types/TypeDescriptor.md +9 -0
- package/docs/api/types/VariableDescriptor.md +9 -0
- package/docs/api/types/index.md +38 -0
- package/docs/api/variables/index.md +3 -0
- package/docs/api/variables/std.md +2463 -0
- package/package.json +10 -7
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# StructEmbed
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { StructEmbed } from "@alloy-js/go";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<StructEmbed doc={Children} refkey={Refkey}>
|
|
10
|
+
{children}
|
|
11
|
+
</StructEmbed>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { StructEmbed } from "@alloy-js/go/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
StructEmbed({ doc: Children, refkey: Refkey }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| -------- | -------------------------------------------------- | ----------- |
|
|
27
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
28
|
+
| doc | optional [Children](../../../core/types/children/) | Doc comment |
|
|
29
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | |
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# StructMember
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { StructMember } from "@alloy-js/go";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<StructMember
|
|
10
|
+
doc={Children}
|
|
11
|
+
name={string | Namekey}
|
|
12
|
+
refkey={Refkey}
|
|
13
|
+
tag={string | Record<string, string>}
|
|
14
|
+
type={Children}
|
|
15
|
+
/>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
* stc
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { StructMember } from "@alloy-js/go/stc";
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
StructMember({
|
|
25
|
+
doc: Children,
|
|
26
|
+
name: string | Namekey,
|
|
27
|
+
refkey: Refkey,
|
|
28
|
+
tag: string | Record<string, string>,
|
|
29
|
+
type: Children,
|
|
30
|
+
}).children(children)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| | | |
|
|
36
|
+
| ------ | -------------------------------------------------- | ----------- |
|
|
37
|
+
| doc | optional [Children](../../../core/types/children/) | Doc comment |
|
|
38
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | |
|
|
39
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | |
|
|
40
|
+
| tag | optional string \| Record\<string, string> | |
|
|
41
|
+
| type | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# StructTypeDeclaration
|
|
2
|
+
|
|
3
|
+
Wrapper for creating a named struct type declaration.
|
|
4
|
+
|
|
5
|
+
Properties for creating a named struct type declaration. This is a combination of `StructDeclarationProps` and `TypeDeclarationProps`.
|
|
6
|
+
|
|
7
|
+
* jsx
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { StructTypeDeclaration } from "@alloy-js/go";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<StructTypeDeclaration
|
|
14
|
+
alias
|
|
15
|
+
doc={Children}
|
|
16
|
+
name={string | Namekey}
|
|
17
|
+
refkey={Refkey}
|
|
18
|
+
refkey={Refkey}
|
|
19
|
+
singleLine
|
|
20
|
+
symbol={NamedTypeSymbol}
|
|
21
|
+
typeParameters={TypeParameterProps[]}
|
|
22
|
+
/>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
* stc
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { StructTypeDeclaration } from "@alloy-js/go/stc";
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
StructTypeDeclaration({
|
|
32
|
+
alias: boolean,
|
|
33
|
+
doc: Children,
|
|
34
|
+
name: string | Namekey,
|
|
35
|
+
refkey: Refkey,
|
|
36
|
+
refkey: Refkey,
|
|
37
|
+
singleLine: boolean,
|
|
38
|
+
symbol: NamedTypeSymbol,
|
|
39
|
+
typeParameters: TypeParameterProps[],
|
|
40
|
+
}).children(children)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Props
|
|
44
|
+
|
|
45
|
+
| | | |
|
|
46
|
+
| -------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
47
|
+
| alias | optional boolean | Whether the type is an alias |
|
|
48
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
49
|
+
| children | optional [Children](../../../core/types/children/) | Type expression |
|
|
50
|
+
| doc | optional [Children](../../../core/types/children/) | Documentation comment |
|
|
51
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | Type name |
|
|
52
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | |
|
|
53
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | Type refkey |
|
|
54
|
+
| singleLine | optional boolean | Whether to render the struct in a single line. This will only compile if `children` is a single line as well. This is not common in Go, so use with caution. |
|
|
55
|
+
| symbol | optional [NamedTypeSymbol](../../types/namedtypesymbol/) | Type symbol |
|
|
56
|
+
| typeParameters | optional [TypeParameterProps](../typeparameter/)\[] | Type parameters |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# TypeConstraint
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { TypeConstraint } from "@alloy-js/go";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<TypeConstraint constraints={Children[]}>
|
|
10
|
+
{children}
|
|
11
|
+
</TypeConstraint>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { TypeConstraint } from "@alloy-js/go/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
TypeConstraint({ constraints: Children[] }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| ----------- | ----------------------------------------------------- | - |
|
|
27
|
+
| children | optional [Children](../../../core/types/children/) | |
|
|
28
|
+
| constraints | optional [Children](../../../core/types/children/)\[] | |
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# TypeDeclaration
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { TypeDeclaration } from "@alloy-js/go";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<TypeDeclaration
|
|
10
|
+
alias
|
|
11
|
+
doc={Children}
|
|
12
|
+
name={string | Namekey}
|
|
13
|
+
refkey={Refkey}
|
|
14
|
+
symbol={NamedTypeSymbol}
|
|
15
|
+
typeParameters={TypeParameterProps[]}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</TypeDeclaration>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
* stc
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { TypeDeclaration } from "@alloy-js/go/stc";
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
TypeDeclaration({
|
|
28
|
+
alias: boolean,
|
|
29
|
+
doc: Children,
|
|
30
|
+
name: string | Namekey,
|
|
31
|
+
refkey: Refkey,
|
|
32
|
+
symbol: NamedTypeSymbol,
|
|
33
|
+
typeParameters: TypeParameterProps[],
|
|
34
|
+
}).children(children)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Props
|
|
38
|
+
|
|
39
|
+
| | | |
|
|
40
|
+
| -------------- | -------------------------------------------------------- | ---------------------------- |
|
|
41
|
+
| alias | optional boolean | Whether the type is an alias |
|
|
42
|
+
| children | optional [Children](../../../core/types/children/) | Type expression |
|
|
43
|
+
| doc | optional [Children](../../../core/types/children/) | Documentation comment |
|
|
44
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | Type name |
|
|
45
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | Type refkey |
|
|
46
|
+
| symbol | optional [NamedTypeSymbol](../../types/namedtypesymbol/) | Type symbol |
|
|
47
|
+
| typeParameters | optional [TypeParameterProps](../typeparameter/)\[] | Type parameters |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# TypeDeclarationGroup
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { TypeDeclarationGroup } from "@alloy-js/go";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<TypeDeclarationGroup >
|
|
10
|
+
{children}
|
|
11
|
+
</TypeDeclarationGroup>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { TypeDeclarationGroup } from "@alloy-js/go/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
TypeDeclarationGroup({ }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| -------- | ----------------------------------------- | - |
|
|
27
|
+
| children | [Children](../../../core/types/children/) | |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# TypeParameter
|
|
2
|
+
|
|
3
|
+
Information for a Go generic type parameter.
|
|
4
|
+
|
|
5
|
+
* jsx
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TypeParameter } from "@alloy-js/go";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<TypeParameter
|
|
12
|
+
constraint={Children}
|
|
13
|
+
name={string | Namekey}
|
|
14
|
+
refkey={Refkey}
|
|
15
|
+
/>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
* stc
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { TypeParameter } from "@alloy-js/go/stc";
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
TypeParameter({
|
|
25
|
+
constraint: Children,
|
|
26
|
+
name: string | Namekey,
|
|
27
|
+
refkey: Refkey,
|
|
28
|
+
}).children(children)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Props
|
|
32
|
+
|
|
33
|
+
| | | |
|
|
34
|
+
| ---------- | ------------------------------------------------- | --------------------------------- |
|
|
35
|
+
| constraint | [Children](../../../core/types/children/) | The parameter constraint |
|
|
36
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | The name of the type parameter. |
|
|
37
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | A refkey for this type parameter. |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# TypeParameters
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { TypeParameters } from "@alloy-js/go";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<TypeParameters parameters={TypeParameterProps[]} />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* stc
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { TypeParameters } from "@alloy-js/go/stc";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
TypeParameters({ parameters: TypeParameterProps[] }).children(children)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| | | |
|
|
24
|
+
| ---------- | --------------------------------------------------- | ---------- |
|
|
25
|
+
| parameters | optional [TypeParameterProps](../typeparameter/)\[] | Parameters |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# VariableDeclaration
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { VariableDeclaration } from "@alloy-js/go";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<VariableDeclaration
|
|
10
|
+
const
|
|
11
|
+
doc={Children}
|
|
12
|
+
name={string | Namekey}
|
|
13
|
+
refkey={Refkey}
|
|
14
|
+
type={Children}
|
|
15
|
+
>
|
|
16
|
+
{children}
|
|
17
|
+
</VariableDeclaration>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
* stc
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { VariableDeclaration } from "@alloy-js/go/stc";
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
VariableDeclaration({
|
|
27
|
+
const: boolean,
|
|
28
|
+
doc: Children,
|
|
29
|
+
name: string | Namekey,
|
|
30
|
+
refkey: Refkey,
|
|
31
|
+
type: Children,
|
|
32
|
+
}).children(children)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| | | |
|
|
38
|
+
| -------- | -------------------------------------------------- | ------------------------------------- |
|
|
39
|
+
| children | optional [Children](../../../core/types/children/) | Initializer expression |
|
|
40
|
+
| const | optional boolean | Whether this is a `const` declaration |
|
|
41
|
+
| doc | optional [Children](../../../core/types/children/) | Documentation comment |
|
|
42
|
+
| name | string \| [Namekey](../../../core/types/namekey/) | Variable name |
|
|
43
|
+
| refkey | optional [Refkey](../../../core/types/refkey/) | Variable refkey |
|
|
44
|
+
| type | optional [Children](../../../core/types/children/) | Type of the variable declaration |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# VariableDeclarationGroup
|
|
2
|
+
|
|
3
|
+
* jsx
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { VariableDeclarationGroup } from "@alloy-js/go";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<VariableDeclarationGroup const>
|
|
10
|
+
{children}
|
|
11
|
+
</VariableDeclarationGroup>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
* stc
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { VariableDeclarationGroup } from "@alloy-js/go/stc";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
VariableDeclarationGroup({ const: boolean }).children(children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| | | |
|
|
26
|
+
| -------- | ----------------------------------------- | - |
|
|
27
|
+
| children | [Children](../../../core/types/children/) | |
|
|
28
|
+
| const | optional boolean | |
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# go — components
|
|
2
|
+
|
|
3
|
+
- [FunctionDeclaration](FunctionDeclaration.md) — import { FunctionDeclaration } from "@alloy-js/go";
|
|
4
|
+
- [FunctionParameter](FunctionParameter.md) — Define a parameter to be used in functions.
|
|
5
|
+
- [FunctionParameters](FunctionParameters.md) — Render a collection of parameters
|
|
6
|
+
- [FunctionReceiver](FunctionReceiver.md) — import { FunctionReceiver } from "@alloy-js/go";
|
|
7
|
+
- [ImportStatements](ImportStatements.md) — import { ImportStatements } from "@alloy-js/go";
|
|
8
|
+
- [InterfaceDeclaration](InterfaceDeclaration.md) — Go interface declaration.
|
|
9
|
+
- [InterfaceEmbed](InterfaceEmbed.md) — import { InterfaceEmbed } from "@alloy-js/go";
|
|
10
|
+
- [InterfaceFunction](InterfaceFunction.md) — import { InterfaceFunction } from "@alloy-js/go";
|
|
11
|
+
- [InterfaceTypeDeclaration](InterfaceTypeDeclaration.md) — Wrapper for creating a named interface type declaration.
|
|
12
|
+
- [LineComment](LineComment.md) — A Go line comment block.
|
|
13
|
+
- [ModuleDirectory](ModuleDirectory.md) — import { ModuleDirectory } from "@alloy-js/go";
|
|
14
|
+
- [Name](Name.md) — import { Name } from "@alloy-js/go";
|
|
15
|
+
- [Pointer](Pointer.md) — A Go pointer type that wraps the given type.
|
|
16
|
+
- [Reference](Reference.md) — import { Reference } from "@alloy-js/go";
|
|
17
|
+
- [SingleImportStatement](SingleImportStatement.md) — import { SingleImportStatement } from "@alloy-js/go";
|
|
18
|
+
- [SourceDirectory](SourceDirectory.md) — import { SourceDirectory } from "@alloy-js/go";
|
|
19
|
+
- [SourceFile](SourceFile.md) — import { SourceFile } from "@alloy-js/go";
|
|
20
|
+
- [StructDeclaration](StructDeclaration.md) — Go struct declaration.
|
|
21
|
+
- [StructEmbed](StructEmbed.md) — import { StructEmbed } from "@alloy-js/go";
|
|
22
|
+
- [StructMember](StructMember.md) — import { StructMember } from "@alloy-js/go";
|
|
23
|
+
- [StructTypeDeclaration](StructTypeDeclaration.md) — Wrapper for creating a named struct type declaration.
|
|
24
|
+
- [TypeConstraint](TypeConstraint.md) — import { TypeConstraint } from "@alloy-js/go";
|
|
25
|
+
- [TypeDeclaration](TypeDeclaration.md) — import { TypeDeclaration } from "@alloy-js/go";
|
|
26
|
+
- [TypeDeclarationGroup](TypeDeclarationGroup.md) — import { TypeDeclarationGroup } from "@alloy-js/go";
|
|
27
|
+
- [TypeParameter](TypeParameter.md) — Information for a Go generic type parameter.
|
|
28
|
+
- [TypeParameters](TypeParameters.md) — import { TypeParameters } from "@alloy-js/go";
|
|
29
|
+
- [VariableDeclaration](VariableDeclaration.md) — import { VariableDeclaration } from "@alloy-js/go";
|
|
30
|
+
- [VariableDeclarationGroup](VariableDeclarationGroup.md) — import { VariableDeclarationGroup } from "@alloy-js/go";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# TypeDeclarationGroup context
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const TypeDeclarationGroupContext: ComponentContext<TypeDeclarationGroupContext>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Accessor
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
const myContext = useContext(TypeDeclarationGroupContext);
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Context interface
|
|
14
|
+
|
|
15
|
+
| | | |
|
|
16
|
+
| ------ | ------- | - |
|
|
17
|
+
| active | boolean | |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# VariableDeclarationGroup context
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const VariableDeclarationGroupContext: ComponentContext<VariableDeclarationGroupContext>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Accessor
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
const myContext = useContext(VariableDeclarationGroupContext);
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Context interface
|
|
14
|
+
|
|
15
|
+
| | | |
|
|
16
|
+
| ------ | ------- | - |
|
|
17
|
+
| active | boolean | |
|
|
18
|
+
| const | boolean | |
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# go — contexts
|
|
2
|
+
|
|
3
|
+
- [TypeDeclarationGroup context](TypeDeclarationGroup-context.md) — const TypeDeclarationGroupContext: ComponentContext<TypeDeclarationGroupContext>
|
|
4
|
+
- [VariableDeclarationGroup context](VariableDeclarationGroup-context.md) — const VariableDeclarationGroupContext: ComponentContext<VariableDeclarationGroupContext>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# createAnonymousTypeSymbol
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createAnonymousTypeSymbol } from "@alloy-js/go";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createAnonymousTypeSymbol(kind: NamedTypeTypeKind, options?: NamedTypeSymbolOptions): NamedTypeSymbol;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ------- | ------------------------------- | - |
|
|
14
|
+
| kind | NamedTypeTypeKind | |
|
|
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,26 @@
|
|
|
1
|
+
# createFunctionScope
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createFunctionScope } from "@alloy-js/go";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createFunctionScope(options?: OutputScopeOptions): GoFunctionScope;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ------- | --------------------------- | - |
|
|
14
|
+
| options | optional OutputScopeOptions | |
|
|
15
|
+
|
|
16
|
+
## Options
|
|
17
|
+
|
|
18
|
+
| | | |
|
|
19
|
+
| ----------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
20
|
+
| 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. |
|
|
21
|
+
| metadata | optional Record\<string, unknown> | Arbitrary metadata that is associated with this scope. |
|
|
22
|
+
| 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. |
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
[GoFunctionScope](../../types/gofunctionscope/)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# createFunctionSymbol
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createFunctionSymbol } from "@alloy-js/go";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createFunctionSymbol(originalName: string | Namekey, isMethod: boolean, options?: GoSymbolOptions): FunctionSymbol;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ------------ | ------------------------ | - |
|
|
14
|
+
| originalName | string \| Namekey | |
|
|
15
|
+
| isMethod | boolean | |
|
|
16
|
+
| options | optional GoSymbolOptions | |
|
|
17
|
+
|
|
18
|
+
## Options
|
|
19
|
+
|
|
20
|
+
| | | |
|
|
21
|
+
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
22
|
+
| aliasTarget | optional [OutputSymbol](../../../core/types/outputsymbol/) | The symbol this symbol is an alias for. |
|
|
23
|
+
| 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. |
|
|
24
|
+
| 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. |
|
|
25
|
+
| 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. |
|
|
26
|
+
| 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. |
|
|
27
|
+
| metadata | optional Record\<string, unknown> | Arbitrary metadata about this symbol. |
|
|
28
|
+
| namePolicy | optional [NamePolicyGetter](../../../core/types/namepolicygetter/) | When provided, this symbol will be named according to the provided name policy. |
|
|
29
|
+
| refkeys | optional [Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or refkeys associated with this symbol. |
|
|
30
|
+
| transient | optional boolean | Whether this symbol is transient. |
|
|
31
|
+
| 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. |
|
|
32
|
+
|
|
33
|
+
## Returns
|
|
34
|
+
|
|
35
|
+
[FunctionSymbol](../../types/functionsymbol/)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# createGoModuleScope
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createGoModuleScope } from "@alloy-js/go";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createGoModuleScope(name: string): GoModuleScope;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ---- | ------ | - |
|
|
14
|
+
| name | string | |
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
[GoModuleScope](../../types/gomodulescope/)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# createGoNamePolicy
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createGoNamePolicy } from "@alloy-js/go";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createGoNamePolicy(): NamePolicy<GoElements>;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| |
|
|
13
|
+
| - |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
[NamePolicy](../../../core/types/namepolicy/)<[GoElements](../../types/goelements/)>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# createGoPackageScope
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createGoPackageScope } from "@alloy-js/go";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createGoPackageScope(packageSymbol: PackageSymbol): GoPackageScope;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ------------- | ------------- | - |
|
|
14
|
+
| packageSymbol | PackageSymbol | |
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
[GoPackageScope](../../types/gopackagescope/)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# createInterfaceMemberSymbol
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createInterfaceMemberSymbol } from "@alloy-js/go";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createInterfaceMemberSymbol(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,20 @@
|
|
|
1
|
+
# createModule
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { createModule } from "@alloy-js/go";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function createModule<T extends PackageDescriptor<any>>(name: string, props: T, builtin?: boolean): LibraryFrom<T>;
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| | | |
|
|
13
|
+
| ------- | ---------------- | - |
|
|
14
|
+
| name | string | |
|
|
15
|
+
| props | T | |
|
|
16
|
+
| builtin | optional boolean | |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
[LibraryFrom](../../types/libraryfrom/)\<T>
|