@alloy-js/typescript 0.27.0-dev.0 → 0.27.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/api/components/ArrowFunction.md +16 -14
- package/docs/api/components/BarrelFile.md +3 -3
- package/docs/api/components/BlockScope.md +10 -4
- package/docs/api/components/CallSignature.md +11 -11
- package/docs/api/components/CaseClause.md +9 -3
- package/docs/api/components/CatchClause.md +6 -6
- package/docs/api/components/ClassDeclaration.md +34 -5
- package/docs/api/components/ClassField.md +16 -17
- package/docs/api/components/ClassMember.md +14 -14
- package/docs/api/components/ClassMethod.md +24 -25
- package/docs/api/components/Declaration.md +19 -15
- package/docs/api/components/EnumDeclaration.md +32 -4
- package/docs/api/components/EnumMember.md +10 -10
- package/docs/api/components/FunctionDeclaration.md +39 -14
- package/docs/api/components/FunctionExpression.md +16 -14
- package/docs/api/components/InterfaceDeclaration.md +33 -7
- package/docs/api/components/InterfaceMember.md +18 -14
- package/docs/api/components/InterfaceMethod.md +22 -20
- package/docs/api/components/MemberExpression.md +6 -1
- package/docs/api/components/ObjectExpression.md +3 -3
- package/docs/api/components/ObjectProperty.md +10 -10
- package/docs/api/components/PackageDirectory.md +26 -48
- package/docs/api/components/PackageJsonFile.md +3 -9
- package/docs/api/{types/ReferenceProps.md → components/Reference.md} +20 -2
- package/docs/api/components/SourceFile.md +3 -3
- package/docs/api/components/TypeRefContext.md +35 -0
- package/docs/api/components/VarDeclaration.md +35 -9
- package/docs/api/components/ensureTypeRefContext.md +3 -3
- package/docs/api/components/index.md +3 -1
- package/docs/api/contexts/Package-context.md +1 -1
- package/docs/api/contexts/PackageMetadata-context.md +1 -1
- package/docs/api/contexts/SourceFile-context.md +1 -1
- package/docs/api/contexts/index.md +3 -3
- package/docs/api/functions/createInstanceMemberSymbol.md +21 -21
- package/docs/api/functions/createMemberSymbol.md +22 -25
- package/docs/api/functions/createPackage.md +2 -2
- package/docs/api/functions/createPrivateInstanceMemberSymbol.md +21 -21
- package/docs/api/functions/createPrivateStaticMemberSymbol.md +21 -21
- package/docs/api/functions/createStaticMemberSymbol.md +21 -21
- package/docs/api/functions/createTypeAndValueSymbol.md +21 -21
- package/docs/api/functions/createTypeSymbol.md +21 -21
- package/docs/api/functions/createValueSymbol.md +21 -21
- package/docs/api/functions/decl.md +18 -18
- package/docs/api/functions/declMember.md +23 -26
- package/docs/api/functions/declType.md +18 -18
- package/docs/api/index.md +2 -2
- package/docs/api/types/ExportConditions.md +3 -3
- package/docs/api/types/FunctionParametersProps.md +4 -4
- package/docs/api/types/FunctionTypeParametersProps.md +4 -4
- package/docs/api/types/MemberExpressionPartProps.md +11 -11
- package/docs/api/types/ModuleExports.md +1 -8
- package/docs/api/types/NamedMap.md +1 -14
- package/docs/api/types/NamedModuleDescriptor.md +6 -6
- package/docs/api/types/PackageDescriptor.md +3 -3
- package/docs/api/types/PackageExports.md +3 -3
- package/docs/api/types/PackageRefkeys.md +1 -6
- package/docs/api/types/ParameterDescriptorBase.md +10 -10
- package/docs/api/types/TSLexicalScope.md +6 -5
- package/docs/api/types/TSMemberScope.md +7 -6
- package/docs/api/types/TSModuleScope.md +10 -9
- package/docs/api/types/TSOutputSymbol.md +55 -22
- package/docs/api/types/TSPackageScope.md +26 -15
- package/docs/api/types/TypeDeclarationProps.md +2 -0
- package/docs/api/types/TypeParameterDescriptor.md +7 -7
- package/docs/api/types/TypeParametersProps.md +4 -4
- package/docs/api/types/index.md +5 -7
- package/docs/api/variables/FunctionType.md +4 -5
- package/docs/api/variables/InterfaceExpression.md +1 -1
- package/docs/api/variables/TSSymbolFlags.md +7 -1
- package/docs/api/variables/TypeDeclaration.md +1 -1
- package/docs/api/variables/index.md +3 -3
- package/package.json +3 -5
- package/api-extractor.json +0 -16
- package/docs/api/types/TypeRefContextProps.md +0 -7
- package/temp/api.json +0 -16745
- package/tsdoc-metadata.json +0 -11
|
@@ -2,13 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
A TypeScript enum declaration.
|
|
4
4
|
|
|
5
|
+
The base props for declaration components.
|
|
6
|
+
|
|
5
7
|
* jsx
|
|
6
8
|
|
|
7
9
|
```tsx
|
|
8
10
|
import { EnumDeclaration } from "@alloy-js/typescript";
|
|
9
11
|
|
|
10
12
|
|
|
11
|
-
<EnumDeclaration
|
|
13
|
+
<EnumDeclaration
|
|
14
|
+
default
|
|
15
|
+
doc={Children}
|
|
16
|
+
export
|
|
17
|
+
jsValue={Record<string, string | number>}
|
|
18
|
+
kind={"type" | "value"}
|
|
19
|
+
metadata={Record<string, unknown>}
|
|
20
|
+
name={string | Namekey<NamekeyOptions>}
|
|
21
|
+
refkey={Refkey | Refkey[]}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</EnumDeclaration>
|
|
12
25
|
```
|
|
13
26
|
|
|
14
27
|
* stc
|
|
@@ -18,12 +31,27 @@ A TypeScript enum declaration.
|
|
|
18
31
|
|
|
19
32
|
|
|
20
33
|
EnumDeclaration({
|
|
34
|
+
default: boolean,
|
|
35
|
+
doc: Children,
|
|
36
|
+
export: boolean,
|
|
21
37
|
jsValue: Record<string, string | number>,
|
|
38
|
+
kind: "type" | "value",
|
|
39
|
+
metadata: Record<string, unknown>,
|
|
40
|
+
name: string | Namekey<NamekeyOptions>,
|
|
41
|
+
refkey: Refkey | Refkey[],
|
|
22
42
|
}).children(children)
|
|
23
43
|
```
|
|
24
44
|
|
|
25
45
|
## Props
|
|
26
46
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
47
|
+
| | | |
|
|
48
|
+
| -------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| children | optional[Children](../../../core/types/children/) | |
|
|
50
|
+
| default | optional boolean | Whether this is the default export of the module. |
|
|
51
|
+
| doc | optional[Children](../../../core/types/children/) | Documentation for this declaration |
|
|
52
|
+
| export | optional boolean | Whether to export this declaration from the module. |
|
|
53
|
+
| jsValue | optional Record\<string, string \| number> | A JS object representing the enum member names and values. |
|
|
54
|
+
| kind | optional “type” \| “value” | Whether this is a declaration of a type (e.g. interface, type alias) or a value (e.g. var, const, let). |
|
|
55
|
+
| metadata | optional Record\<string, unknown> | Arbitrary metadata about this declaration. |
|
|
56
|
+
| name | string \| [Namekey](../../../core/types/namekey/)<[NamekeyOptions](../../../core/types/namekeyoptions/)> | The base name of this declaration. May change depending on naming policy and any conflicts. |
|
|
57
|
+
| refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or array of refkeys for this declaration. |
|
|
@@ -12,7 +12,7 @@ A TypeScript enum member.
|
|
|
12
12
|
doc={Children}
|
|
13
13
|
jsValue={string | number}
|
|
14
14
|
metadata={Record<string, unknown>}
|
|
15
|
-
name={string | Namekey}
|
|
15
|
+
name={string | Namekey<NamekeyOptions>}
|
|
16
16
|
refkey={Refkey}
|
|
17
17
|
value={Children}
|
|
18
18
|
/>
|
|
@@ -28,7 +28,7 @@ A TypeScript enum member.
|
|
|
28
28
|
doc: Children,
|
|
29
29
|
jsValue: string | number,
|
|
30
30
|
metadata: Record<string, unknown>,
|
|
31
|
-
name: string | Namekey
|
|
31
|
+
name: string | Namekey<NamekeyOptions>,
|
|
32
32
|
refkey: Refkey,
|
|
33
33
|
value: Children,
|
|
34
34
|
}).children(children)
|
|
@@ -36,11 +36,11 @@ A TypeScript enum member.
|
|
|
36
36
|
|
|
37
37
|
## Props
|
|
38
38
|
|
|
39
|
-
| |
|
|
40
|
-
| -------- |
|
|
41
|
-
| doc | optional[Children](../../../core/types/children/)
|
|
42
|
-
| jsValue | optional string \| number
|
|
43
|
-
| metadata | optional Record\<string, unknown>
|
|
44
|
-
| name | string \| [Namekey](../../../core/types/namekey/) | The name of the member. If a naming policy is provided in context, the policy name “enum-member” is used. |
|
|
45
|
-
| refkey | optional[Refkey](../../../core/types/refkey/)
|
|
46
|
-
| value | optional[Children](../../../core/types/children/)
|
|
39
|
+
| | | |
|
|
40
|
+
| -------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
|
+
| doc | optional[Children](../../../core/types/children/) | Documentation for the enum member. |
|
|
42
|
+
| jsValue | optional string \| number | The JS value of the enum member. |
|
|
43
|
+
| metadata | optional Record\<string, unknown> | Arbitrary symbol metadata for the enum member. |
|
|
44
|
+
| name | string \| [Namekey](../../../core/types/namekey/)<[NamekeyOptions](../../../core/types/namekeyoptions/)> | The name of the member. If a naming policy is provided in context, the policy name “enum-member” is used. |
|
|
45
|
+
| refkey | optional[Refkey](../../../core/types/refkey/) | Refkey for the enum member symbol. If the refkey is not provided, a symbol is not created and the member cannot be referenced by refkey. |
|
|
46
|
+
| value | optional[Children](../../../core/types/children/) | The value of the enum member. |
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A TypeScript function declaration.
|
|
4
4
|
|
|
5
|
+
The base props for declaration components.
|
|
6
|
+
|
|
5
7
|
* jsx
|
|
6
8
|
|
|
7
9
|
```tsx
|
|
@@ -10,10 +12,17 @@ A TypeScript function declaration.
|
|
|
10
12
|
|
|
11
13
|
<FunctionDeclaration
|
|
12
14
|
async
|
|
13
|
-
|
|
15
|
+
default
|
|
16
|
+
doc={Children}
|
|
17
|
+
export
|
|
18
|
+
kind={"type" | "value"}
|
|
19
|
+
metadata={Record<string, unknown>}
|
|
20
|
+
name={string | Namekey<NamekeyOptions>}
|
|
21
|
+
parameters={string[] | ParameterDescriptor[]}
|
|
14
22
|
parametersChildren={Children}
|
|
23
|
+
refkey={Refkey | Refkey[]}
|
|
15
24
|
returnType={Children}
|
|
16
|
-
typeParameters={
|
|
25
|
+
typeParameters={string[] | TypeParameterDescriptor[]}
|
|
17
26
|
typeParametersChildren={Children}
|
|
18
27
|
>
|
|
19
28
|
{children}
|
|
@@ -28,28 +37,44 @@ A TypeScript function declaration.
|
|
|
28
37
|
|
|
29
38
|
FunctionDeclaration({
|
|
30
39
|
async: boolean,
|
|
31
|
-
|
|
40
|
+
default: boolean,
|
|
41
|
+
doc: Children,
|
|
42
|
+
export: boolean,
|
|
43
|
+
kind: "type" | "value",
|
|
44
|
+
metadata: Record<string, unknown>,
|
|
45
|
+
name: string | Namekey<NamekeyOptions>,
|
|
46
|
+
parameters: string[] | ParameterDescriptor[],
|
|
32
47
|
parametersChildren: Children,
|
|
48
|
+
refkey: Refkey | Refkey[],
|
|
33
49
|
returnType: Children,
|
|
34
|
-
typeParameters:
|
|
50
|
+
typeParameters: string[] | TypeParameterDescriptor[],
|
|
35
51
|
typeParametersChildren: Children,
|
|
36
52
|
}).children(children)
|
|
37
53
|
```
|
|
38
54
|
|
|
39
55
|
## Props
|
|
40
56
|
|
|
41
|
-
| |
|
|
42
|
-
| ---------------------- |
|
|
43
|
-
| async | optional boolean
|
|
44
|
-
| children | optional[Children](../../../core/types/children/)
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
57
|
+
| | | |
|
|
58
|
+
| ---------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| async | optional boolean | |
|
|
60
|
+
| children | optional[Children](../../../core/types/children/) | |
|
|
61
|
+
| default | optional boolean | Whether this is the default export of the module. |
|
|
62
|
+
| doc | optional[Children](../../../core/types/children/) | Documentation for this declaration |
|
|
63
|
+
| export | optional boolean | Whether to export this declaration from the module. |
|
|
64
|
+
| kind | optional “type” \| “value” | Whether this is a declaration of a type (e.g. interface, type alias) or a value (e.g. var, const, let). |
|
|
65
|
+
| metadata | optional Record\<string, unknown> | Arbitrary metadata about this declaration. |
|
|
66
|
+
| name | string \| [Namekey](../../../core/types/namekey/)<[NamekeyOptions](../../../core/types/namekeyoptions/)> | The base name of this declaration. May change depending on naming policy and any conflicts. |
|
|
67
|
+
| parameters | optional string\[] \| [ParameterDescriptor](../../types/parameterdescriptor/)\[] | The parameters to the function. Can be an array of strings for parameters which don’t have a type or a default value. Otherwise, it’s an array of [ParameterDescriptor](../../types/parameterdescriptor/)s. |
|
|
68
|
+
| parametersChildren | optional[Children](../../../core/types/children/) | Raw content to be used as the parameter list. |
|
|
69
|
+
| refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or array of refkeys for this declaration. |
|
|
70
|
+
| returnType | optional[Children](../../../core/types/children/) | The return type of the function. |
|
|
71
|
+
| typeParameters | optional string\[] \| [TypeParameterDescriptor](../../types/typeparameterdescriptor/)\[] | The type parameters for the function. Can be an array of strings for type parameters which don’t have any constraints or a default type, otherwise it’s an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s. |
|
|
72
|
+
| typeParametersChildren | optional[Children](../../../core/types/children/) | Raw content to be used as the type parameter list. |
|
|
50
73
|
|
|
51
74
|
## Remarks
|
|
52
75
|
|
|
53
76
|
Providing parameters and type parameters can be accomplished in one of three ways:
|
|
54
77
|
|
|
55
|
-
1. As an array of [ParameterDescriptor](../../types/parameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
|
|
78
|
+
1. As an array of [ParameterDescriptor](../../types/parameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
|
|
79
|
+
2. As raw content via the `parametersChildren` or `typeParametersChildren` props.
|
|
80
|
+
3. As a child of this component via the (FunctionDeclaration:namespace).Parameters or (FunctionDeclaration:namespace).TypeParameters components.
|
|
@@ -10,10 +10,10 @@ A TypeScript function expression.
|
|
|
10
10
|
|
|
11
11
|
<FunctionExpression
|
|
12
12
|
async
|
|
13
|
-
parameters={
|
|
13
|
+
parameters={string[] | ParameterDescriptor[]}
|
|
14
14
|
parametersChildren={Children}
|
|
15
15
|
returnType={Children}
|
|
16
|
-
typeParameters={
|
|
16
|
+
typeParameters={string[] | TypeParameterDescriptor[]}
|
|
17
17
|
typeParametersChildren={Children}
|
|
18
18
|
>
|
|
19
19
|
{children}
|
|
@@ -28,31 +28,33 @@ A TypeScript function expression.
|
|
|
28
28
|
|
|
29
29
|
FunctionExpression({
|
|
30
30
|
async: boolean,
|
|
31
|
-
parameters:
|
|
31
|
+
parameters: string[] | ParameterDescriptor[],
|
|
32
32
|
parametersChildren: Children,
|
|
33
33
|
returnType: Children,
|
|
34
|
-
typeParameters:
|
|
34
|
+
typeParameters: string[] | TypeParameterDescriptor[],
|
|
35
35
|
typeParametersChildren: Children,
|
|
36
36
|
}).children(children)
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
## Props
|
|
40
40
|
|
|
41
|
-
| |
|
|
42
|
-
| ---------------------- |
|
|
43
|
-
| async | optional boolean
|
|
44
|
-
| children | optional[Children](../../../core/types/children/)
|
|
45
|
-
| parameters | optional[ParameterDescriptor](../../types/parameterdescriptor/)\[]
|
|
46
|
-
| parametersChildren | optional[Children](../../../core/types/children/)
|
|
47
|
-
| returnType | optional[Children](../../../core/types/children/)
|
|
48
|
-
| typeParameters | optional[TypeParameterDescriptor](../../types/typeparameterdescriptor/)\[]
|
|
49
|
-
| typeParametersChildren | optional[Children](../../../core/types/children/)
|
|
41
|
+
| | | |
|
|
42
|
+
| ---------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| async | optional boolean | |
|
|
44
|
+
| children | optional[Children](../../../core/types/children/) | |
|
|
45
|
+
| parameters | optional string\[] \| [ParameterDescriptor](../../types/parameterdescriptor/)\[] | The parameters to the function. Can be an array of strings for parameters which don’t have a type or a default value. Otherwise, it’s an array of [ParameterDescriptor](../../types/parameterdescriptor/)s. |
|
|
46
|
+
| parametersChildren | optional[Children](../../../core/types/children/) | Raw content to be used as the parameter list. |
|
|
47
|
+
| returnType | optional[Children](../../../core/types/children/) | The return type of the function. |
|
|
48
|
+
| typeParameters | optional string\[] \| [TypeParameterDescriptor](../../types/typeparameterdescriptor/)\[] | The type parameters for the function. Can be an array of strings for type parameters which don’t have any constraints or a default type, otherwise it’s an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s. |
|
|
49
|
+
| typeParametersChildren | optional[Children](../../../core/types/children/) | Raw content to be used as the type parameter list. |
|
|
50
50
|
|
|
51
51
|
## Remarks
|
|
52
52
|
|
|
53
53
|
Providing parameters and type parameters can be accomplished in one of three ways:
|
|
54
54
|
|
|
55
|
-
1. As an array of [ParameterDescriptor](../../types/parameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
|
|
55
|
+
1. As an array of [ParameterDescriptor](../../types/parameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
|
|
56
|
+
2. As raw content via the `parametersChildren` or `typeParametersChildren` props.
|
|
57
|
+
3. As a child of this component via the (FunctionExpression:namespace).Parameters or (FunctionExpression:namespace).TypeParameters components.
|
|
56
58
|
|
|
57
59
|
## Example
|
|
58
60
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Create a TypeScript interface declaration.
|
|
4
4
|
|
|
5
|
+
The base props for declaration components.
|
|
6
|
+
|
|
5
7
|
* jsx
|
|
6
8
|
|
|
7
9
|
```tsx
|
|
@@ -9,9 +11,18 @@ Create a TypeScript interface declaration.
|
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
<InterfaceDeclaration
|
|
14
|
+
default
|
|
15
|
+
doc={Children}
|
|
16
|
+
export
|
|
12
17
|
extends={Children}
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
kind={"type" | "value"}
|
|
19
|
+
metadata={Record<string, unknown>}
|
|
20
|
+
name={string | Namekey<NamekeyOptions>}
|
|
21
|
+
refkey={Refkey | Refkey[]}
|
|
22
|
+
typeParameters={string[] | TypeParameterDescriptor[]}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</InterfaceDeclaration>
|
|
15
26
|
```
|
|
16
27
|
|
|
17
28
|
* stc
|
|
@@ -21,17 +32,32 @@ Create a TypeScript interface declaration.
|
|
|
21
32
|
|
|
22
33
|
|
|
23
34
|
InterfaceDeclaration({
|
|
35
|
+
default: boolean,
|
|
36
|
+
doc: Children,
|
|
37
|
+
export: boolean,
|
|
24
38
|
extends: Children,
|
|
25
|
-
|
|
39
|
+
kind: "type" | "value",
|
|
40
|
+
metadata: Record<string, unknown>,
|
|
41
|
+
name: string | Namekey<NamekeyOptions>,
|
|
42
|
+
refkey: Refkey | Refkey[],
|
|
43
|
+
typeParameters: string[] | TypeParameterDescriptor[],
|
|
26
44
|
}).children(children)
|
|
27
45
|
```
|
|
28
46
|
|
|
29
47
|
## Props
|
|
30
48
|
|
|
31
|
-
| |
|
|
32
|
-
| -------------- |
|
|
33
|
-
|
|
|
34
|
-
|
|
|
49
|
+
| | | |
|
|
50
|
+
| -------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| children | optional[Children](../../../core/types/children/) | |
|
|
52
|
+
| default | optional boolean | Whether this is the default export of the module. |
|
|
53
|
+
| doc | optional[Children](../../../core/types/children/) | Documentation for this declaration |
|
|
54
|
+
| export | optional boolean | Whether to export this declaration from the module. |
|
|
55
|
+
| extends | optional[Children](../../../core/types/children/) | |
|
|
56
|
+
| kind | optional “type” \| “value” | Whether this is a declaration of a type (e.g. interface, type alias) or a value (e.g. var, const, let). |
|
|
57
|
+
| metadata | optional Record\<string, unknown> | Arbitrary metadata about this declaration. |
|
|
58
|
+
| name | string \| [Namekey](../../../core/types/namekey/)<[NamekeyOptions](../../../core/types/namekeyoptions/)> | The base name of this declaration. May change depending on naming policy and any conflicts. |
|
|
59
|
+
| refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or array of refkeys for this declaration. |
|
|
60
|
+
| typeParameters | optional string\[] \| [TypeParameterDescriptor](../../types/typeparameterdescriptor/)\[] | The generic type parameters of the interface. |
|
|
35
61
|
|
|
36
62
|
## Remarks
|
|
37
63
|
|
|
@@ -16,13 +16,15 @@ The type of the member can be provided either as the `type` prop or as the child
|
|
|
16
16
|
|
|
17
17
|
<InterfaceMember
|
|
18
18
|
doc={Children}
|
|
19
|
-
name={string | Namekey}
|
|
19
|
+
name={string | Namekey<NamekeyOptions>}
|
|
20
20
|
nullish
|
|
21
21
|
optional
|
|
22
22
|
readonly
|
|
23
23
|
refkey={Refkey | Refkey[]}
|
|
24
24
|
type={Children}
|
|
25
|
-
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
</InterfaceMember>
|
|
26
28
|
```
|
|
27
29
|
|
|
28
30
|
* stc
|
|
@@ -33,7 +35,7 @@ The type of the member can be provided either as the `type` prop or as the child
|
|
|
33
35
|
|
|
34
36
|
InterfaceMember({
|
|
35
37
|
doc: Children,
|
|
36
|
-
name: string | Namekey
|
|
38
|
+
name: string | Namekey<NamekeyOptions>,
|
|
37
39
|
nullish: boolean,
|
|
38
40
|
optional: boolean,
|
|
39
41
|
readonly: boolean,
|
|
@@ -44,16 +46,16 @@ The type of the member can be provided either as the `type` prop or as the child
|
|
|
44
46
|
|
|
45
47
|
### Props
|
|
46
48
|
|
|
47
|
-
| |
|
|
48
|
-
| -------- |
|
|
49
|
-
| children | optional[Children](../../../core/types/children/)
|
|
50
|
-
| doc | optional[Children](../../../core/types/children/)
|
|
51
|
-
| name | string \| [Namekey](../../../core/types/namekey/)
|
|
52
|
-
| nullish | optional boolean
|
|
53
|
-
| optional | optional boolean
|
|
54
|
-
| readonly | optional boolean
|
|
55
|
-
| refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[]
|
|
56
|
-
| type | optional[Children](../../../core/types/children/)
|
|
49
|
+
| | | |
|
|
50
|
+
| -------- | -------------------------------------------------------------------------------------------------------- | - |
|
|
51
|
+
| children | optional[Children](../../../core/types/children/) | |
|
|
52
|
+
| doc | optional[Children](../../../core/types/children/) | |
|
|
53
|
+
| name | string \| [Namekey](../../../core/types/namekey/)<[NamekeyOptions](../../../core/types/namekeyoptions/)> | |
|
|
54
|
+
| nullish | optional boolean | |
|
|
55
|
+
| optional | optional boolean | |
|
|
56
|
+
| readonly | optional boolean | |
|
|
57
|
+
| refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | |
|
|
58
|
+
| type | optional[Children](../../../core/types/children/) | |
|
|
57
59
|
|
|
58
60
|
## Overload 2
|
|
59
61
|
|
|
@@ -69,7 +71,9 @@ The type of the member can be provided either as the `type` prop or as the child
|
|
|
69
71
|
readonly
|
|
70
72
|
refkey={Refkey | Refkey[]}
|
|
71
73
|
type={Children}
|
|
72
|
-
|
|
74
|
+
>
|
|
75
|
+
{children}
|
|
76
|
+
</InterfaceMember>
|
|
73
77
|
```
|
|
74
78
|
|
|
75
79
|
* stc
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
An interface method declaration.
|
|
4
4
|
|
|
5
|
-
Props for
|
|
5
|
+
Props for [InterfaceMethod](../interfacemethod/) component
|
|
6
6
|
|
|
7
7
|
* jsx
|
|
8
8
|
|
|
@@ -13,12 +13,12 @@ Props for \[unresolved link] component
|
|
|
13
13
|
<InterfaceMethod
|
|
14
14
|
async
|
|
15
15
|
doc={Children}
|
|
16
|
-
name={string | Namekey}
|
|
17
|
-
parameters={
|
|
16
|
+
name={string | Namekey<NamekeyOptions>}
|
|
17
|
+
parameters={string[] | ParameterDescriptor[]}
|
|
18
18
|
parametersChildren={Children}
|
|
19
19
|
refkey={Refkey | Refkey[]}
|
|
20
20
|
returnType={Children}
|
|
21
|
-
typeParameters={
|
|
21
|
+
typeParameters={string[] | TypeParameterDescriptor[]}
|
|
22
22
|
typeParametersChildren={Children}
|
|
23
23
|
>
|
|
24
24
|
{children}
|
|
@@ -34,36 +34,38 @@ Props for \[unresolved link] component
|
|
|
34
34
|
InterfaceMethod({
|
|
35
35
|
async: boolean,
|
|
36
36
|
doc: Children,
|
|
37
|
-
name: string | Namekey
|
|
38
|
-
parameters:
|
|
37
|
+
name: string | Namekey<NamekeyOptions>,
|
|
38
|
+
parameters: string[] | ParameterDescriptor[],
|
|
39
39
|
parametersChildren: Children,
|
|
40
40
|
refkey: Refkey | Refkey[],
|
|
41
41
|
returnType: Children,
|
|
42
|
-
typeParameters:
|
|
42
|
+
typeParameters: string[] | TypeParameterDescriptor[],
|
|
43
43
|
typeParametersChildren: Children,
|
|
44
44
|
}).children(children)
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
## Props
|
|
48
48
|
|
|
49
|
-
| |
|
|
50
|
-
| ---------------------- |
|
|
51
|
-
| async | optional boolean
|
|
52
|
-
| children | optional[Children](../../../core/types/children/)
|
|
53
|
-
| doc | optional[Children](../../../core/types/children/)
|
|
54
|
-
| name | string \| [Namekey](../../../core/types/namekey/)
|
|
55
|
-
| parameters | optional[ParameterDescriptor](../../types/parameterdescriptor/)\[]
|
|
56
|
-
| parametersChildren | optional[Children](../../../core/types/children/)
|
|
57
|
-
| refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[]
|
|
58
|
-
| returnType | optional[Children](../../../core/types/children/)
|
|
59
|
-
| typeParameters | optional[TypeParameterDescriptor](../../types/typeparameterdescriptor/)\[]
|
|
60
|
-
| typeParametersChildren | optional[Children](../../../core/types/children/)
|
|
49
|
+
| | | |
|
|
50
|
+
| ---------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| async | optional boolean | If the method is async. It will change the returnType from `T` to `Promise<T>` |
|
|
52
|
+
| children | optional[Children](../../../core/types/children/) | Jsx content |
|
|
53
|
+
| doc | optional[Children](../../../core/types/children/) | Documentation for this method. |
|
|
54
|
+
| name | string \| [Namekey](../../../core/types/namekey/)<[NamekeyOptions](../../../core/types/namekeyoptions/)> | Interface member name |
|
|
55
|
+
| parameters | optional string\[] \| [ParameterDescriptor](../../types/parameterdescriptor/)\[] | The parameters to the function. Can be an array of strings for parameters which don’t have a type or a default value. Otherwise, it’s an array of [ParameterDescriptor](../../types/parameterdescriptor/)s. |
|
|
56
|
+
| parametersChildren | optional[Children](../../../core/types/children/) | Raw content to be used as the parameter list. |
|
|
57
|
+
| refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | Ref key for the member declaration |
|
|
58
|
+
| returnType | optional[Children](../../../core/types/children/) | The return type of the function. |
|
|
59
|
+
| typeParameters | optional string\[] \| [TypeParameterDescriptor](../../types/typeparameterdescriptor/)\[] | The type parameters for the function. Can be an array of strings for type parameters which don’t have any constraints or a default type, otherwise it’s an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s. |
|
|
60
|
+
| typeParametersChildren | optional[Children](../../../core/types/children/) | Raw content to be used as the type parameter list. |
|
|
61
61
|
|
|
62
62
|
## Remarks
|
|
63
63
|
|
|
64
64
|
Providing parameters and type parameters can be accomplished in one of three ways:
|
|
65
65
|
|
|
66
|
-
1. As an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
|
|
66
|
+
1. As an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
|
|
67
|
+
2. As raw content via the `parametersChildren` or `typeParametersChildren` props.
|
|
68
|
+
3. As a child of this component via the (InterfaceMethod:namespace).Parameters or (InterfaceMethod:namespace).TypeParameters components.
|
|
67
69
|
|
|
68
70
|
## Example
|
|
69
71
|
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Create a member expression from parts. Each part can provide one of the following:
|
|
4
4
|
|
|
5
|
-
* **id**: The identifier for the member expression part
|
|
5
|
+
* **id**: The identifier for the member expression part
|
|
6
|
+
* **refkey**: a refkey for a symbol whose name becomes the identifier
|
|
7
|
+
* **symbol**: a symbol whose name becomes the identifier part
|
|
8
|
+
* **args**: create a method call with the given args
|
|
9
|
+
* **children**: arbitrary contents for the identifier part
|
|
10
|
+
* **await**: whether to await the value that results from this part of the member expression
|
|
6
11
|
|
|
7
12
|
Each part can have a nullish prop, which indicates that the part may be null or undefined.
|
|
8
13
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
<ObjectExpression
|
|
10
|
-
jsValue={
|
|
10
|
+
jsValue={Record<string, unknown> | Map<string, unknown> | [string, unknown][]}
|
|
11
11
|
>
|
|
12
12
|
{children}
|
|
13
13
|
</ObjectExpression>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
ObjectExpression({
|
|
23
|
-
jsValue:
|
|
23
|
+
jsValue: Record<string, unknown> | Map<string, unknown> | [string, unknown][],
|
|
24
24
|
}).children(children)
|
|
25
25
|
```
|
|
26
26
|
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
| | | |
|
|
30
30
|
| -------- | ----------------------------------------------------------------------------------- | - |
|
|
31
31
|
| children | optional[Children](../../../core/types/children/) | |
|
|
32
|
-
| jsValue | optional
|
|
32
|
+
| jsValue | optional Record\<string, unknown> \| Map\<string, unknown> \| \[string, unknown]\[] | |
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<ObjectProperty
|
|
10
10
|
jsValue={unknown}
|
|
11
|
-
name={string | Namekey}
|
|
11
|
+
name={string | Namekey<NamekeyOptions>}
|
|
12
12
|
nameExpression={Children}
|
|
13
13
|
refkey={Refkey | Refkey[]}
|
|
14
14
|
value={Children}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
ObjectProperty({
|
|
27
27
|
jsValue: unknown,
|
|
28
|
-
name: string | Namekey
|
|
28
|
+
name: string | Namekey<NamekeyOptions>,
|
|
29
29
|
nameExpression: Children,
|
|
30
30
|
refkey: Refkey | Refkey[],
|
|
31
31
|
value: Children,
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
|
|
35
35
|
## Props
|
|
36
36
|
|
|
37
|
-
| |
|
|
38
|
-
| -------------- |
|
|
39
|
-
| children | optional[Children](../../../core/types/children/)
|
|
40
|
-
| jsValue | optional unknown
|
|
41
|
-
| name | optional string \| [Namekey](../../../core/types/namekey/)
|
|
42
|
-
| nameExpression | optional[Children](../../../core/types/children/)
|
|
43
|
-
| refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[]
|
|
44
|
-
| value | optional[Children](../../../core/types/children/)
|
|
37
|
+
| | | |
|
|
38
|
+
| -------------- | ----------------------------------------------------------------------------------------------------------------- | - |
|
|
39
|
+
| children | optional[Children](../../../core/types/children/) | |
|
|
40
|
+
| jsValue | optional unknown | |
|
|
41
|
+
| name | optional string \| [Namekey](../../../core/types/namekey/)<[NamekeyOptions](../../../core/types/namekeyoptions/)> | |
|
|
42
|
+
| nameExpression | optional[Children](../../../core/types/children/) | |
|
|
43
|
+
| refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | |
|
|
44
|
+
| value | optional[Children](../../../core/types/children/) | |
|