@alloy-js/typescript 0.24.0-dev.1 → 0.24.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 (48) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/dev/src/components/BlockScope.js +2 -2
  3. package/dist/dev/src/components/BlockScope.js.map +1 -1
  4. package/dist/dev/src/components/FunctionBase.js +10 -10
  5. package/dist/dev/src/components/FunctionBase.js.map +1 -1
  6. package/dist/dev/src/components/FunctionDeclaration.js +10 -10
  7. package/dist/dev/src/components/FunctionDeclaration.js.map +1 -1
  8. package/dist/dev/src/components/MemberDeclaration.js +1 -1
  9. package/dist/dev/src/components/MemberDeclaration.js.map +1 -1
  10. package/dist/dev/src/components/index.js.map +1 -1
  11. package/dist/src/components/BlockScope.d.ts.map +1 -1
  12. package/dist/src/components/BlockScope.js.map +1 -1
  13. package/dist/src/components/FunctionBase.d.ts.map +1 -1
  14. package/dist/src/components/FunctionBase.js.map +1 -1
  15. package/dist/src/components/FunctionDeclaration.d.ts.map +1 -1
  16. package/dist/src/components/FunctionDeclaration.js.map +1 -1
  17. package/dist/src/components/MemberDeclaration.d.ts.map +1 -1
  18. package/dist/src/components/MemberDeclaration.js.map +1 -1
  19. package/dist/src/components/index.d.ts +1 -1
  20. package/dist/src/components/index.d.ts.map +1 -1
  21. package/dist/src/components/index.js.map +1 -1
  22. package/dist/src/parameter-descriptor.d.ts.map +1 -1
  23. package/dist/tsconfig.tsbuildinfo +1 -1
  24. package/docs/api/components/ArrowFunction.md +1 -3
  25. package/docs/api/components/FunctionDeclaration.md +1 -3
  26. package/docs/api/components/FunctionExpression.md +1 -3
  27. package/docs/api/components/InterfaceMethod.md +1 -3
  28. package/docs/api/components/MemberExpression.md +1 -6
  29. package/docs/api/components/ensureTypeRefContext.md +1 -1
  30. package/docs/api/components/index.md +0 -2
  31. package/docs/api/index.md +2 -2
  32. package/docs/api/types/NamedModuleDescriptor.md +1 -5
  33. package/docs/api/{components/Reference.md → types/ReferenceProps.md} +2 -20
  34. package/docs/api/types/TypeParametersProps.md +10 -0
  35. package/docs/api/types/TypeRefContextProps.md +7 -0
  36. package/docs/api/types/index.md +3 -0
  37. package/docs/api/variables/FunctionType.md +1 -3
  38. package/package.json +11 -10
  39. package/src/components/BlockScope.tsx +2 -4
  40. package/src/components/FunctionBase.tsx +12 -6
  41. package/src/components/FunctionDeclaration.tsx +1 -2
  42. package/src/components/MemberDeclaration.tsx +2 -4
  43. package/src/components/index.ts +1 -0
  44. package/src/parameter-descriptor.ts +1 -2
  45. package/temp/api.json +172 -62
  46. package/tsdoc-metadata.json +1 -1
  47. package/vitest.config.ts +1 -0
  48. package/docs/api/components/TypeRefContext.md +0 -35
@@ -63,9 +63,7 @@ Props for \[unresolved link] component
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.
67
- 2. As raw content via the `parametersChildren` or `typeParametersChildren` props.
68
- 3. As a child of this component via the \[unresolved link] or \[unresolved link] components.
66
+ 1. As an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s. 2. As raw content via the `parametersChildren` or `typeParametersChildren` props. 3. As a child of this component via the \[unresolved link] or \[unresolved link] components.
69
67
 
70
68
  ## Example
71
69
 
@@ -2,12 +2,7 @@
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
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
5
+ * **id**: The identifier for the member expression part \* **refkey**: a refkey for a symbol whose name becomes the identifier \* **symbol**: a symbol whose name becomes the identifier part \* **args**: create a method call with the given args \* **children**: arbitrary contents for the identifier part \* **await**: whether to await the value that results from this part of the member expression
11
6
 
12
7
  Each part can have a nullish prop, which indicates that the part may be null or undefined.
13
8
 
@@ -1,6 +1,6 @@
1
1
  # ensureTypeRefContext
2
2
 
3
- Ensure the current component is inside a type ref context. If not it will wrap in a [TypeRefContext](../typerefcontext/) component. If yes it will not add an extra node and return the original component.
3
+ Ensure the current component is inside a type ref context. If not it will wrap in a \[unresolved link] component. If yes it will not add an extra node and return the original component.
4
4
 
5
5
  * jsx
6
6
 
@@ -38,12 +38,10 @@
38
38
  - [ObjectSpreadProperty](ObjectSpreadProperty.md) — import { ObjectSpreadProperty } from "@alloy-js/typescript";
39
39
  - [PackageDirectory](PackageDirectory.md) — import { PackageDirectory } from "@alloy-js/typescript";
40
40
  - [PackageJsonFile](PackageJsonFile.md) — A file containing a package.json that defines a package.
41
- - [Reference](Reference.md) — import { Reference } from "@alloy-js/typescript";
42
41
  - [SingleLineCommentBlock](SingleLineCommentBlock.md) — A single line comment block.
43
42
  - [SourceFile](SourceFile.md) — import { SourceFile } from "@alloy-js/typescript";
44
43
  - [SwitchStatement](SwitchStatement.md) — A switch statement.
45
44
  - [TryStatement](TryStatement.md) — A try statement.
46
45
  - [TSConfigJson](TSConfigJson.md) — import { TSConfigJson } from "@alloy-js/typescript";
47
- - [TypeRefContext](TypeRefContext.md) — Set the current context of reference to be type reference.
48
46
  - [ValueExpression](ValueExpression.md) — import { ValueExpression } from "@alloy-js/typescript";
49
47
  - [VarDeclaration](VarDeclaration.md) — import { VarDeclaration } from "@alloy-js/typescript";
package/docs/api/index.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @alloy-js/typescript API Reference
2
2
 
3
- - [components](components/index.md) (47 items)
3
+ - [components](components/index.md) (45 items)
4
4
  - [contexts](contexts/index.md) (3 items)
5
5
  - [functions](functions/index.md) (25 items)
6
- - [types](types/index.md) (45 items)
6
+ - [types](types/index.md) (48 items)
7
7
  - [variables](variables/index.md) (4 items)
@@ -2,11 +2,7 @@
2
2
 
3
3
  Describes the structure of a module descriptor.
4
4
 
5
- A module descriptor can either be a string (representing the module name) or an object with the following properties:
6
-
7
- * `name`: The name of the module.
8
- * `staticMembers`: An optional array of named module descriptors representing static members of the module.
9
- * `instanceMembers`: An optional array of named module descriptors representing instance members of the module.
5
+ A module descriptor can either be a string (representing the module name) or an object with the following properties: - `name`: The name of the module. - `staticMembers`: An optional array of named module descriptors representing static members of the module. - `instanceMembers`: An optional array of named module descriptors representing instance members of the module.
10
6
 
11
7
  ```ts
12
8
  type NamedModuleDescriptor = string | {
@@ -1,24 +1,6 @@
1
- # Reference
1
+ # ReferenceProps
2
2
 
3
- * jsx
4
-
5
- ```tsx
6
- import { Reference } from "@alloy-js/typescript";
7
-
8
-
9
- <Reference refkey={Refkey} type />
10
- ```
11
-
12
- * stc
13
-
14
- ```ts
15
- import { Reference } from "@alloy-js/typescript/stc";
16
-
17
-
18
- Reference({ refkey: Refkey, type: boolean }).children(children)
19
- ```
20
-
21
- ## Props
3
+ ## Members
22
4
 
23
5
  | | | |
24
6
  | ------ | ------------------------------------- | --------------------------------------------------------------------------------------------------------- |
@@ -0,0 +1,10 @@
1
+ # TypeParametersProps
2
+
3
+ Props for type parameters
4
+
5
+ ## Members
6
+
7
+ | | | |
8
+ | ---------- | ------------------------------------------------------------------------------- | ------------ |
9
+ | children | optional [Children](../../../core/types/children/) | Jsx Children |
10
+ | parameters | optional [TypeParameterDescriptor](../typeparameterdescriptor/)\[] \| string\[] | Parameters |
@@ -0,0 +1,7 @@
1
+ # TypeRefContextProps
2
+
3
+ ## Members
4
+
5
+ | | | |
6
+ | -------- | ----------------------------------------- | -------- |
7
+ | children | [Children](../../../core/types/children/) | Children |
@@ -32,6 +32,7 @@
32
32
  - [PackageRefkeys](PackageRefkeys.md) — type PackageRefkeys<PD extends Record<string, {
33
33
  - [ParameterDescriptor](ParameterDescriptor.md) — Information for a TypeScript function parameter.
34
34
  - [ParameterDescriptorBase](ParameterDescriptorBase.md) — Common properties for ParameterDescriptor and FunctionTypeParameterDescriptor.
35
+ - [ReferenceProps](ReferenceProps.md)
35
36
  - [RefOptions](RefOptions.md)
36
37
  - [SourceDirectoryData](SourceDirectoryData.md)
37
38
  - [SourceFileHeaderProps](SourceFileHeaderProps.md)
@@ -44,4 +45,6 @@
44
45
  - [TSPackageScopeOptions](TSPackageScopeOptions.md) — Extends [OutputScopeOptions](../../../core/types/outputscopeoptions/)
45
46
  - [TypeDeclarationProps](TypeDeclarationProps.md) — Extends [CommonDeclarationProps](../commondeclarationprops/)
46
47
  - [TypeParameterDescriptor](TypeParameterDescriptor.md) — Information for a TypeScript generic type parameter.
48
+ - [TypeParametersProps](TypeParametersProps.md) — Props for type parameters
49
+ - [TypeRefContextProps](TypeRefContextProps.md)
47
50
  - [TypeScriptElements](TypeScriptElements.md) — type TypeScriptElements = "function" | "parameter" | "class" | "variable" | "enum" | "object-member-data" | "object-memb
@@ -13,9 +13,7 @@ FunctionType: import("@alloy-js/core").Component<FunctionTypeProps> & {
13
13
 
14
14
  Providing parameters and type parameters can be accomplished in one of three ways:
15
15
 
16
- 1. As an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s.
17
- 2. As raw content via the `parametersChildren` or `typeParametersChildren` props.
18
- 3. As a child of this component via the \[unresolved link] or \[unresolved link] components.
16
+ 1. As an array of [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s or [TypeParameterDescriptor](../../types/typeparameterdescriptor/)s. 2. As raw content via the `parametersChildren` or `typeParametersChildren` props. 3. As a child of this component via the \[unresolved link] or \[unresolved link] components.
19
17
 
20
18
  ## Example
21
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alloy-js/typescript",
3
- "version": "0.24.0-dev.1",
3
+ "version": "0.24.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,18 +30,19 @@
30
30
  "author": "brian.terlson@microsoft.com",
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@alloy-js/core": "~0.23.1 || >= 0.24.0-dev.7",
34
33
  "change-case": "^5.4.4",
35
- "pathe": "^2.0.3"
34
+ "pathe": "^2.0.3",
35
+ "@alloy-js/core": "~0.24.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@alloy-js/cli": "~0.23.0 || >= 0.24.0-dev.1",
39
- "@alloy-js/rollup-plugin": "~0.1.1 || >= 0.1.2-dev.2",
40
- "@microsoft/api-extractor": "~7.52.8",
41
- "@rollup/plugin-typescript": "^12.1.2",
42
- "concurrently": "^9.2.0",
43
- "typescript": "^5.8.3",
44
- "vitest": "3.2.4"
38
+ "@microsoft/api-extractor": "~7.58.8",
39
+ "@rollup/plugin-typescript": "^12.3.0",
40
+ "@types/node": "^25.9.2",
41
+ "concurrently": "^10.0.3",
42
+ "typescript": "^6.0.3",
43
+ "vitest": "4.1.8",
44
+ "@alloy-js/rollup-plugin": "~0.1.2",
45
+ "@alloy-js/cli": "~0.24.0"
45
46
  },
46
47
  "type": "module",
47
48
  "scripts": {
@@ -7,11 +7,9 @@ import {
7
7
  import { LexicalScope } from "./LexicalScope.jsx";
8
8
 
9
9
  export interface BlockScopePropsWithScopeValue
10
- extends ScopePropsWithValue,
11
- BlockProps {}
10
+ extends ScopePropsWithValue, BlockProps {}
12
11
  export interface BlockScopePropsWithScopeInfo
13
- extends ScopePropsWithInfo,
14
- BlockProps {}
12
+ extends ScopePropsWithInfo, BlockProps {}
15
13
 
16
14
  export type BlockScopeProps =
17
15
  | BlockScopePropsWithScopeValue
@@ -157,19 +157,25 @@ function parameter(
157
157
  );
158
158
  }
159
159
 
160
- interface DeclaredParameterDescriptor
161
- extends Omit<ParameterDescriptor, "name"> {
160
+ interface DeclaredParameterDescriptor extends Omit<
161
+ ParameterDescriptor,
162
+ "name"
163
+ > {
162
164
  symbol: TSOutputSymbol;
163
165
  TypeSlot: SymbolSlot;
164
166
  }
165
- interface DeclaredFunctionTypeParameterDescriptor
166
- extends Omit<FunctionTypeParameterDescriptor, "name"> {
167
+ interface DeclaredFunctionTypeParameterDescriptor extends Omit<
168
+ FunctionTypeParameterDescriptor,
169
+ "name"
170
+ > {
167
171
  symbol: TSOutputSymbol;
168
172
  TypeSlot: SymbolSlot;
169
173
  }
170
174
 
171
- interface DeclaredTypeParameterDescriptor
172
- extends Omit<TypeParameterDescriptor, "name"> {
175
+ interface DeclaredTypeParameterDescriptor extends Omit<
176
+ TypeParameterDescriptor,
177
+ "name"
178
+ > {
173
179
  symbol: TSOutputSymbol;
174
180
  }
175
181
 
@@ -21,8 +21,7 @@ import { JSDocParams } from "./JSDocParam.jsx";
21
21
  import { LexicalScope } from "./LexicalScope.jsx";
22
22
 
23
23
  export interface FunctionDeclarationProps
24
- extends CommonDeclarationProps,
25
- CallSignatureProps {
24
+ extends CommonDeclarationProps, CallSignatureProps {
26
25
  async?: boolean;
27
26
  children?: Children;
28
27
  }
@@ -10,8 +10,7 @@ import {
10
10
  TSSymbolFlags,
11
11
  } from "../symbols/index.js";
12
12
 
13
- export interface MemberDeclarationPropsWithInfo
14
- extends CoreMemberDeclarationPropsWithInfo {
13
+ export interface MemberDeclarationPropsWithInfo extends CoreMemberDeclarationPropsWithInfo {
15
14
  /**
16
15
  * The name policy kind to apply to the memberdeclaration.
17
16
  */
@@ -22,8 +21,7 @@ export interface MemberDeclarationPropsWithInfo
22
21
  nullish?: boolean;
23
22
  }
24
23
 
25
- export interface MemberDeclarationPropsWithSymbol
26
- extends CoreMemberDeclarationPropsWithSymbol {
24
+ export interface MemberDeclarationPropsWithSymbol extends CoreMemberDeclarationPropsWithSymbol {
27
25
  /**
28
26
  * The symbol for the member declaration.
29
27
  */
@@ -14,6 +14,7 @@ export {
14
14
  type FunctionBodyProps,
15
15
  type FunctionParametersProps,
16
16
  type FunctionTypeParametersProps,
17
+ type TypeParametersProps,
17
18
  } from "./FunctionBase.js";
18
19
  export * from "./FunctionCallExpression.js";
19
20
  export * from "./FunctionDeclaration.js";
@@ -65,8 +65,7 @@ export interface ParameterDescriptor extends ParameterDescriptorBase {
65
65
  /**
66
66
  * Information for a TypeScript type function parameter.
67
67
  */
68
- export interface FunctionTypeParameterDescriptor
69
- extends ParameterDescriptorBase {}
68
+ export interface FunctionTypeParameterDescriptor extends ParameterDescriptorBase {}
70
69
 
71
70
  /**
72
71
  * Information for a TypeScript generic type parameter.