@typespec/emitter-framework 0.9.0-dev.3 → 0.9.0-dev.7
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/dist/src/core/components/output.d.ts +4 -4
- package/dist/src/core/components/output.d.ts.map +1 -1
- package/dist/src/core/components/output.js +3 -3
- package/dist/src/core/context/name-policy-context.d.ts +2 -2
- package/dist/src/core/context/name-policy-context.d.ts.map +1 -1
- package/dist/src/core/context/tsp-context.d.ts +2 -2
- package/dist/src/core/context/tsp-context.d.ts.map +1 -1
- package/dist/src/core/transport-name-policy.d.ts +1 -1
- package/dist/src/core/transport-name-policy.d.ts.map +1 -1
- package/dist/src/core/write-output.d.ts +2 -2
- package/dist/src/core/write-output.d.ts.map +1 -1
- package/dist/src/csharp/components/class/declaration.d.ts +13 -0
- package/dist/src/csharp/components/class/declaration.d.ts.map +1 -0
- package/dist/src/csharp/components/class/declaration.js +91 -0
- package/dist/src/csharp/components/class/declaration.test.d.ts +2 -0
- package/dist/src/csharp/components/class/declaration.test.d.ts.map +1 -0
- package/dist/src/csharp/components/class/declaration.test.js +392 -0
- package/dist/src/csharp/components/enum-declaration.d.ts +4 -4
- package/dist/src/csharp/components/enum-declaration.d.ts.map +1 -1
- package/dist/src/csharp/components/enum-declaration.js +14 -11
- package/dist/src/csharp/components/index.d.ts +2 -1
- package/dist/src/csharp/components/index.d.ts.map +1 -1
- package/dist/src/csharp/components/index.js +2 -1
- package/dist/src/csharp/components/property/property.d.ts +15 -0
- package/dist/src/csharp/components/property/property.d.ts.map +1 -0
- package/dist/src/csharp/components/property/property.js +85 -0
- package/dist/src/csharp/components/property/property.test.d.ts +2 -0
- package/dist/src/csharp/components/property/property.test.d.ts.map +1 -0
- package/dist/src/csharp/components/property/property.test.js +117 -0
- package/dist/src/csharp/components/type-expression.d.ts +3 -3
- package/dist/src/csharp/components/type-expression.d.ts.map +1 -1
- package/dist/src/csharp/components/type-expression.js +15 -1
- package/dist/src/csharp/components/type-expression.test.d.ts +2 -0
- package/dist/src/csharp/components/type-expression.test.d.ts.map +1 -0
- package/dist/src/csharp/components/type-expression.test.js +128 -0
- package/dist/src/csharp/components/utils/doc-comments.d.ts +14 -0
- package/dist/src/csharp/components/utils/doc-comments.d.ts.map +1 -0
- package/dist/src/csharp/components/utils/doc-comments.js +67 -0
- package/dist/src/testing/index.d.ts +1 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/scenario-test/harness.d.ts +2 -2
- package/dist/src/testing/scenario-test/harness.d.ts.map +1 -1
- package/dist/src/testing/scenario-test/test-host.d.ts +2 -2
- package/dist/src/testing/scenario-test/test-host.d.ts.map +1 -1
- package/dist/src/typescript/components/array-expression.d.ts +2 -3
- package/dist/src/typescript/components/array-expression.d.ts.map +1 -1
- package/dist/src/typescript/components/array-expression.js +2 -2
- package/dist/src/typescript/components/arrow-function.d.ts +2 -2
- package/dist/src/typescript/components/arrow-function.d.ts.map +1 -1
- package/dist/src/typescript/components/arrow-function.js +2 -1
- package/dist/src/typescript/components/class-method.d.ts +1 -1
- package/dist/src/typescript/components/class-method.d.ts.map +1 -1
- package/dist/src/typescript/components/enum-declaration.d.ts +6 -6
- package/dist/src/typescript/components/enum-declaration.d.ts.map +1 -1
- package/dist/src/typescript/components/enum-declaration.js +2 -2
- package/dist/src/typescript/components/function-declaration.d.ts +1 -1
- package/dist/src/typescript/components/function-declaration.d.ts.map +1 -1
- package/dist/src/typescript/components/function-expression.d.ts +2 -2
- package/dist/src/typescript/components/function-expression.d.ts.map +1 -1
- package/dist/src/typescript/components/function-expression.js +2 -1
- package/dist/src/typescript/components/function-type.d.ts +2 -2
- package/dist/src/typescript/components/function-type.d.ts.map +1 -1
- package/dist/src/typescript/components/function-type.js +2 -1
- package/dist/src/typescript/components/interface-declaration.d.ts +4 -4
- package/dist/src/typescript/components/interface-declaration.d.ts.map +1 -1
- package/dist/src/typescript/components/interface-declaration.js +3 -4
- package/dist/src/typescript/components/interface-member.d.ts +2 -2
- package/dist/src/typescript/components/interface-member.d.ts.map +1 -1
- package/dist/src/typescript/components/interface-method.d.ts +2 -2
- package/dist/src/typescript/components/interface-method.d.ts.map +1 -1
- package/dist/src/typescript/components/record-expression.d.ts +1 -1
- package/dist/src/typescript/components/record-expression.d.ts.map +1 -1
- package/dist/src/typescript/components/type-alias-declaration.d.ts +1 -1
- package/dist/src/typescript/components/type-alias-declaration.d.ts.map +1 -1
- package/dist/src/typescript/components/type-declaration.d.ts +1 -1
- package/dist/src/typescript/components/type-declaration.d.ts.map +1 -1
- package/dist/src/typescript/components/type-expression.d.ts +1 -1
- package/dist/src/typescript/components/type-expression.d.ts.map +1 -1
- package/dist/src/typescript/components/type-transform.d.ts +2 -2
- package/dist/src/typescript/components/type-transform.d.ts.map +1 -1
- package/dist/src/typescript/components/union-declaration.d.ts +2 -2
- package/dist/src/typescript/components/union-declaration.d.ts.map +1 -1
- package/dist/src/typescript/components/union-expression.d.ts +3 -4
- package/dist/src/typescript/components/union-expression.d.ts.map +1 -1
- package/dist/src/typescript/components/union-expression.js +3 -3
- package/dist/src/typescript/components/value-expression.d.ts +2 -2
- package/dist/src/typescript/components/value-expression.d.ts.map +1 -1
- package/dist/src/typescript/utils/operation.d.ts +2 -2
- package/dist/src/typescript/utils/operation.d.ts.map +1 -1
- package/dist/test/csharp/components/enum-declaration.test.js +57 -9
- package/dist/test/csharp/test-host.d.ts +1 -1
- package/dist/test/csharp/test-host.d.ts.map +1 -1
- package/dist/test/csharp/utils.d.ts +1 -1
- package/dist/test/csharp/utils.d.ts.map +1 -1
- package/dist/test/test-host.d.ts +2 -0
- package/dist/test/test-host.d.ts.map +1 -0
- package/dist/test/test-host.js +5 -0
- package/dist/test/typescript/components/member-expression.test.js +5 -5
- package/dist/test/typescript/test-host.d.ts +1 -1
- package/dist/test/typescript/test-host.d.ts.map +1 -1
- package/dist/test/utils.d.ts +2 -2
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/vitest.setup.d.ts +2 -0
- package/dist/test/vitest.setup.d.ts.map +1 -0
- package/dist/test/vitest.setup.js +1 -0
- package/package.json +10 -7
- package/src/core/components/output.tsx +9 -5
- package/src/core/context/name-policy-context.ts +2 -2
- package/src/core/context/tsp-context.ts +2 -2
- package/src/core/transport-name-policy.ts +1 -1
- package/src/core/write-output.ts +2 -2
- package/src/csharp/components/class/declaration.test.tsx +401 -0
- package/src/csharp/components/class/declaration.tsx +86 -0
- package/src/csharp/components/enum-declaration.tsx +26 -18
- package/src/csharp/components/index.ts +2 -1
- package/src/csharp/components/property/property.test.tsx +97 -0
- package/src/csharp/components/property/property.tsx +62 -0
- package/src/csharp/components/type-expression.test.tsx +133 -0
- package/src/csharp/components/type-expression.tsx +11 -4
- package/src/csharp/components/utils/doc-comments.tsx +58 -0
- package/src/testing/index.ts +1 -1
- package/src/testing/scenario-test/harness.ts +2 -2
- package/src/testing/scenario-test/test-host.ts +4 -4
- package/src/typescript/components/array-expression.tsx +3 -3
- package/src/typescript/components/arrow-function.tsx +2 -2
- package/src/typescript/components/class-method.tsx +1 -1
- package/src/typescript/components/enum-declaration.tsx +6 -6
- package/src/typescript/components/function-declaration.tsx +1 -1
- package/src/typescript/components/function-expression.tsx +2 -2
- package/src/typescript/components/function-type.tsx +2 -2
- package/src/typescript/components/interface-declaration.tsx +11 -12
- package/src/typescript/components/interface-member.tsx +2 -2
- package/src/typescript/components/interface-method.tsx +2 -2
- package/src/typescript/components/record-expression.tsx +1 -1
- package/src/typescript/components/type-alias-declaration.tsx +1 -1
- package/src/typescript/components/type-declaration.tsx +1 -1
- package/src/typescript/components/type-expression.tsx +2 -2
- package/src/typescript/components/type-transform.tsx +3 -3
- package/src/typescript/components/union-declaration.tsx +2 -2
- package/src/typescript/components/union-expression.tsx +12 -7
- package/src/typescript/components/value-expression.tsx +2 -2
- package/src/typescript/utils/operation.ts +2 -2
- package/test/csharp/components/enum-declaration.test.tsx +52 -11
- package/test/csharp/test-host.ts +2 -2
- package/test/csharp/utils.ts +1 -1
- package/test/test-host.ts +4 -0
- package/test/testing/snippet-extractor-csharp.test.ts +1 -1
- package/test/testing/snippet-extractor-java.test.ts +1 -1
- package/test/testing/snippet-extractor-python.test.ts +1 -1
- package/test/testing/snippet-extractor-typescript.test.ts +1 -1
- package/test/typescript/components/arrow-function.test.tsx +2 -2
- package/test/typescript/components/enum-declaration.test.tsx +1 -1
- package/test/typescript/components/function-declaration.test.tsx +1 -1
- package/test/typescript/components/function-expression.test.tsx +2 -2
- package/test/typescript/components/function-type.test.tsx +2 -2
- package/test/typescript/components/interface-declaration.test.tsx +1 -1
- package/test/typescript/components/interface-method.test.tsx +2 -2
- package/test/typescript/components/member-expression.test.tsx +10 -10
- package/test/typescript/components/type-alias-declaration.test.tsx +1 -1
- package/test/typescript/components/type-transform.test.tsx +2 -2
- package/test/typescript/components/union-declaration.test.tsx +2 -2
- package/test/typescript/components/value-expression.test.tsx +6 -6
- package/test/typescript/test-host.ts +1 -1
- package/test/utils.ts +2 -2
- package/test/vitest.setup.ts +1 -0
- package/tsconfig.json +3 -1
- package/vitest.config.ts +2 -1
- package/dist/src/csharp/components/class-declaration.d.ts +0 -9
- package/dist/src/csharp/components/class-declaration.d.ts.map +0 -1
- package/dist/src/csharp/components/class-declaration.js +0 -97
- package/dist/test/csharp/components/class-declaration.test.d.ts +0 -2
- package/dist/test/csharp/components/class-declaration.test.d.ts.map +0 -1
- package/dist/test/csharp/components/class-declaration.test.js +0 -421
- package/src/csharp/components/class-declaration.tsx +0 -87
- package/test/csharp/components/class-declaration.test.tsx +0 -344
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Children, type Refkey } from "@alloy-js/core";
|
|
2
2
|
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import { Enum, EnumMember as TspEnumMember, Union } from "@typespec/compiler";
|
|
3
|
+
import type { Enum, EnumMember as TspEnumMember, Union } from "@typespec/compiler";
|
|
4
4
|
export interface EnumDeclarationProps extends Omit<ts.TypeDeclarationProps, "name"> {
|
|
5
5
|
name?: string;
|
|
6
6
|
type: Union | Enum;
|
|
7
7
|
}
|
|
8
|
-
export declare function EnumDeclaration(props: EnumDeclarationProps):
|
|
8
|
+
export declare function EnumDeclaration(props: EnumDeclarationProps): Children;
|
|
9
9
|
export interface EnumMemberProps {
|
|
10
10
|
type: TspEnumMember;
|
|
11
|
-
doc?:
|
|
12
|
-
refkey?:
|
|
11
|
+
doc?: Children;
|
|
12
|
+
refkey?: Refkey;
|
|
13
13
|
}
|
|
14
|
-
export declare function EnumMember(props: EnumMemberProps):
|
|
14
|
+
export declare function EnumMember(props: EnumMemberProps): Children;
|
|
15
15
|
//# sourceMappingURL=enum-declaration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/enum-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"enum-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/enum-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAO,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,IAAI,aAAa,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAKnF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,YA4C1D;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YAShD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { For } from "@alloy-js/core";
|
|
3
3
|
import * as ts from "@alloy-js/typescript";
|
|
4
4
|
import { useTsp } from "../../core/context/tsp-context.js";
|
|
5
5
|
import { reportDiagnostic } from "../../lib.js";
|
|
@@ -38,7 +38,7 @@ export function EnumDeclaration(props) {
|
|
|
38
38
|
return props.export;
|
|
39
39
|
},
|
|
40
40
|
get children() {
|
|
41
|
-
return _$createComponent(
|
|
41
|
+
return _$createComponent(For, {
|
|
42
42
|
each: members,
|
|
43
43
|
joiner: ",\n",
|
|
44
44
|
children: ([key, value]) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from "@alloy-js/typescript";
|
|
2
|
-
import { Model, Operation } from "@typespec/compiler";
|
|
2
|
+
import type { Model, Operation } from "@typespec/compiler";
|
|
3
3
|
export interface FunctionDeclarationPropsWithType extends Omit<ts.FunctionDeclarationProps, "name"> {
|
|
4
4
|
type: Operation;
|
|
5
5
|
name?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/function-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"function-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/function-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM3D,MAAM,WAAW,gCACf,SAAQ,IAAI,CAAC,EAAE,CAAC,wBAAwB,EAAE,MAAM,CAAC;IACjD,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CACnD;AAED,MAAM,MAAM,wBAAwB,GAChC,gCAAgC,GAChC,EAAE,CAAC,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,qCAsClE;yBAtCe,mBAAmB;4BA+CyB,uBAAuB;;AAPnF,MAAM,WAAW,4BAA6B,SAAQ,IAAI,CAAC,EAAE,CAAC,wBAAwB,EAAE,MAAM,CAAC;IAC7F,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,uBAAuB,GAAG,4BAA4B,GAAG,EAAE,CAAC,uBAAuB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from "@alloy-js/typescript";
|
|
2
|
-
import { Operation } from "@typespec/compiler";
|
|
2
|
+
import type { Operation } from "@typespec/compiler";
|
|
3
3
|
export interface FunctionExpressionProps extends ts.FunctionExpressionProps {
|
|
4
4
|
type?: Operation;
|
|
5
5
|
/**
|
|
@@ -13,5 +13,5 @@ export interface FunctionExpressionProps extends ts.FunctionExpressionProps {
|
|
|
13
13
|
* function expression by converting from a TypeSpec Operation. Any other props
|
|
14
14
|
* provided will take precedence.
|
|
15
15
|
*/
|
|
16
|
-
export declare function FunctionExpression(props: Readonly<FunctionExpressionProps>): import("@alloy-js/core
|
|
16
|
+
export declare function FunctionExpression(props: Readonly<FunctionExpressionProps>): import("@alloy-js/core").Children;
|
|
17
17
|
//# sourceMappingURL=function-expression.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-expression.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/function-expression.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"function-expression.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/function-expression.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAIpD,MAAM,WAAW,uBAAwB,SAAQ,EAAE,CAAC,uBAAuB;IACzE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CACnD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,uBAAuB,CAAC,qCAoB1E"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mergeProps as _$mergeProps, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { splitProps } from "@alloy-js/core";
|
|
2
3
|
import * as ts from "@alloy-js/typescript";
|
|
3
4
|
import { buildParameterDescriptors, getReturnType } from "../utils/operation.js";
|
|
4
5
|
import { TypeExpression } from "./type-expression.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from "@alloy-js/typescript";
|
|
2
|
-
import { Operation } from "@typespec/compiler";
|
|
2
|
+
import type { Operation } from "@typespec/compiler";
|
|
3
3
|
export interface FunctionTypeProps extends ts.FunctionTypeProps {
|
|
4
4
|
type?: Operation;
|
|
5
5
|
/**
|
|
@@ -13,5 +13,5 @@ export interface FunctionTypeProps extends ts.FunctionTypeProps {
|
|
|
13
13
|
* by converting from a TypeSpec Operation. Any other props provided will take
|
|
14
14
|
* precedence.
|
|
15
15
|
*/
|
|
16
|
-
export declare function FunctionType(props: Readonly<FunctionTypeProps>): import("@alloy-js/core
|
|
16
|
+
export declare function FunctionType(props: Readonly<FunctionTypeProps>): import("@alloy-js/core").Children;
|
|
17
17
|
//# sourceMappingURL=function-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-type.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/function-type.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"function-type.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/function-type.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAIpD,MAAM,WAAW,iBAAkB,SAAQ,EAAE,CAAC,iBAAiB;IAC7D,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CACnD;AACD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,qCAkB9D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mergeProps as _$mergeProps, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { splitProps } from "@alloy-js/core";
|
|
2
3
|
import * as ts from "@alloy-js/typescript";
|
|
3
4
|
import { buildParameterDescriptors, getReturnType } from "../utils/operation.js";
|
|
4
5
|
import { TypeExpression } from "./type-expression.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Children } from "@alloy-js/core";
|
|
2
2
|
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import { Interface, Model } from "@typespec/compiler";
|
|
3
|
+
import { type Interface, type Model } from "@typespec/compiler";
|
|
4
4
|
export interface TypedInterfaceDeclarationProps extends Omit<ts.InterfaceDeclarationProps, "name"> {
|
|
5
5
|
type: Model | Interface;
|
|
6
6
|
name?: string;
|
|
7
7
|
}
|
|
8
8
|
export type InterfaceDeclarationProps = TypedInterfaceDeclarationProps | ts.InterfaceDeclarationProps;
|
|
9
|
-
export declare function InterfaceDeclaration(props: InterfaceDeclarationProps):
|
|
9
|
+
export declare function InterfaceDeclaration(props: InterfaceDeclarationProps): Children;
|
|
10
10
|
export interface InterfaceExpressionProps extends ts.InterfaceExpressionProps {
|
|
11
11
|
type: Model | Interface;
|
|
12
12
|
}
|
|
13
|
-
export declare function InterfaceExpression(props: InterfaceExpressionProps):
|
|
13
|
+
export declare function InterfaceExpression(props: InterfaceExpressionProps): Children;
|
|
14
14
|
//# sourceMappingURL=interface-declaration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/interface-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"interface-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/interface-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,QAAQ,EAAgB,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,KAAK,EAIX,MAAM,oBAAoB,CAAC;AAQ5B,MAAM,WAAW,8BAA+B,SAAQ,IAAI,CAAC,EAAE,CAAC,yBAAyB,EAAE,MAAM,CAAC;IAChG,IAAI,EAAE,KAAK,GAAG,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,yBAAyB,GACjC,8BAA8B,GAC9B,EAAE,CAAC,yBAAyB,CAAC;AAEjC,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,YAmCpE;AAQD,MAAM,WAAW,wBAAyB,SAAQ,EAAE,CAAC,wBAAwB;IAC3E,IAAI,EAAE,KAAK,GAAG,SAAS,CAAC;CACzB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,YAMlE"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, mergeProps as _$mergeProps, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { mapJoin } from "@alloy-js/core";
|
|
2
|
+
import { Block, For, mapJoin } from "@alloy-js/core";
|
|
4
3
|
import * as ts from "@alloy-js/typescript";
|
|
5
4
|
import { isNeverType } from "@typespec/compiler";
|
|
6
5
|
import { createRekeyableMap } from "@typespec/compiler/utils";
|
|
@@ -51,7 +50,7 @@ function isTypedInterfaceDeclarationProps(props) {
|
|
|
51
50
|
return "type" in props;
|
|
52
51
|
}
|
|
53
52
|
export function InterfaceExpression(props) {
|
|
54
|
-
return _$createComponent(
|
|
53
|
+
return _$createComponent(Block, {
|
|
55
54
|
get children() {
|
|
56
55
|
return _$createComponent(InterfaceBody, props);
|
|
57
56
|
}
|
|
@@ -130,7 +129,7 @@ function InterfaceBody(props) {
|
|
|
130
129
|
const enderProp = validTypeMembers.length > 0 ? {
|
|
131
130
|
ender: ";"
|
|
132
131
|
} : {};
|
|
133
|
-
return [_$createComponent(
|
|
132
|
+
return [_$createComponent(For, _$mergeProps({
|
|
134
133
|
each: validTypeMembers,
|
|
135
134
|
semicolon: true,
|
|
136
135
|
line: true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
2
|
-
import { ModelProperty, Operation } from "@typespec/compiler";
|
|
1
|
+
import { type Children } from "@alloy-js/core";
|
|
2
|
+
import { type ModelProperty, type Operation } from "@typespec/compiler";
|
|
3
3
|
export interface InterfaceMemberProps {
|
|
4
4
|
type: ModelProperty | Operation;
|
|
5
5
|
doc?: Children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface-member.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/interface-member.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"interface-member.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/interface-member.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAe,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAMrF,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,aAAa,GAAG,SAAS,CAAC;IAChC,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,YA8B1D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
1
|
+
import { type Children } from "@alloy-js/core";
|
|
2
2
|
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import { Operation } from "@typespec/compiler";
|
|
3
|
+
import type { Operation } from "@typespec/compiler";
|
|
4
4
|
export interface InterfaceMethodPropsWithType extends Omit<ts.InterfaceMethodProps, "name"> {
|
|
5
5
|
type: Operation;
|
|
6
6
|
name?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface-method.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/interface-method.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"interface-method.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/interface-method.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAc,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAKpD,MAAM,WAAW,4BAA6B,SAAQ,IAAI,CAAC,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACzF,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,cAAc,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CACnD;AAED,MAAM,MAAM,oBAAoB,GAAG,4BAA4B,GAAG,EAAE,CAAC,oBAAoB,CAAC;AAE1F;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC,YAgCpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-expression.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/record-expression.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"record-expression.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/record-expression.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG/C,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,IAAI,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,WAAW,EAAE,EAAE,qBAAqB,qCAItE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-alias-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/type-alias-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"type-alias-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/type-alias-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAM/C,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CAAC,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACvF,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,yBAAyB,GAAG,0BAA0B,GAAG,EAAE,CAAC,oBAAoB,CAAC;AAE7F;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,qCAwBpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/type-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"type-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/type-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAQ/C,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG;KAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAE1E,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qCA0B1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-expression.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/type-expression.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgC,IAAI,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"type-expression.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/type-expression.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgC,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,qCAAqC,CAAC;AAU7C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,IAAI,CAAC;IAEX;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qCA0DxD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Children, Refkey } from "@alloy-js/core";
|
|
2
|
-
import { Model, Type, Union } from "@typespec/compiler";
|
|
1
|
+
import { type Children, type Refkey } from "@alloy-js/core";
|
|
2
|
+
import type { Model, Type, Union } from "@typespec/compiler";
|
|
3
3
|
export interface TypeTransformProps {
|
|
4
4
|
name?: string;
|
|
5
5
|
type: Type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-transform.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/type-transform.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"type-transform.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/type-transform.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAsB,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEhF,OAAO,KAAK,EAEV,KAAK,EAIL,IAAI,EACJ,KAAK,EACN,MAAM,oBAAoB,CAAC;AAc5B,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,aAAa,GAAG,WAAW,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,EAAE,aAAa,GAAG,WAAW,CAAC;CACrC;AA+DD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,YAqEjE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,GAAG,WAAW,UAEvF;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,aAAa,GAAG,WAAW,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,YAwE5E;AAyDD,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,EAAE,aAAa,GAAG,WAAW,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAMD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,QAAQ,CAuEzE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core";
|
|
1
|
+
import { type Children } from "@alloy-js/core";
|
|
2
2
|
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import { Enum, Union } from "@typespec/compiler";
|
|
3
|
+
import type { Enum, Union } from "@typespec/compiler";
|
|
4
4
|
export interface TypedUnionDeclarationProps extends Omit<ts.TypeDeclarationProps, "name"> {
|
|
5
5
|
type: Union | Enum;
|
|
6
6
|
doc?: Children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/union-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"union-declaration.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/union-declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAMtD,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CAAC,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACvF,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC;IACnB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,GAAG,EAAE,CAAC,oBAAoB,CAAC;AAEzF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,YAuB5D"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { Enum, Union } from "@typespec/compiler";
|
|
1
|
+
import { type Children } from "@alloy-js/core";
|
|
2
|
+
import { type Enum, type Union } from "@typespec/compiler";
|
|
4
3
|
export interface UnionExpressionProps {
|
|
5
4
|
type: Union | Enum;
|
|
6
5
|
children?: Children;
|
|
7
6
|
}
|
|
8
|
-
export declare function UnionExpression({ type, children }: UnionExpressionProps):
|
|
7
|
+
export declare function UnionExpression({ type, children }: UnionExpressionProps): Children;
|
|
9
8
|
//# sourceMappingURL=union-expression.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union-expression.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/union-expression.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"union-expression.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/union-expression.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAa,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAEL,KAAK,IAAI,EAET,KAAK,KAAK,EAEX,MAAM,oBAAoB,CAAC;AAK5B,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,oBAAoB,YA+CvE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { For, List } from "@alloy-js/core";
|
|
3
3
|
import * as ts from "@alloy-js/typescript";
|
|
4
4
|
import { compilerAssert } from "@typespec/compiler";
|
|
5
5
|
import { useTsp } from "../../core/context/tsp-context.js";
|
|
@@ -13,7 +13,7 @@ export function UnionExpression({
|
|
|
13
13
|
$
|
|
14
14
|
} = useTsp();
|
|
15
15
|
const items = $.union.is(type) ? type.variants : type.members;
|
|
16
|
-
const variants = _$createComponent(
|
|
16
|
+
const variants = _$createComponent(For, {
|
|
17
17
|
joiner: " | ",
|
|
18
18
|
each: items,
|
|
19
19
|
children: (_, type) => {
|
|
@@ -106,7 +106,7 @@ function NoneEnvelope(props) {
|
|
|
106
106
|
type: model
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
return _$createComponent(
|
|
109
|
+
return _$createComponent(List, {
|
|
110
110
|
joiner: " & ",
|
|
111
111
|
get children() {
|
|
112
112
|
return [_$createComponent(ts.ObjectExpression, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-expression.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/value-expression.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"value-expression.d.ts","sourceRoot":"","sources":["../../../../src/typescript/components/value-expression.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhE;;GAEG;AACH,UAAU,oBAAoB;IAC5B;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC,GAAG,QAAQ,CAoC/E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Refkey } from "@alloy-js/core";
|
|
1
|
+
import { type Refkey } from "@alloy-js/core";
|
|
2
2
|
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import { Model, ModelProperty, Operation, Type } from "@typespec/compiler";
|
|
3
|
+
import type { Model, ModelProperty, Operation, Type } from "@typespec/compiler";
|
|
4
4
|
export declare function getReturnType(type: Operation, options?: {
|
|
5
5
|
skipErrorFiltering: boolean;
|
|
6
6
|
}): Type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/typescript/utils/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../src/typescript/utils/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAKhF,wBAAgB,aAAa,CAC3B,IAAI,EAAE,SAAS,EACf,OAAO,GAAE;IAAE,kBAAkB,EAAE,OAAO,CAAA;CAAkC,GACvE,IAAI,CASN;AAED,MAAM,WAAW,gCAAgC;IAC/C,MAAM,CAAC,EAAE,EAAE,CAAC,mBAAmB,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IACzD,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,KAAK,EACX,OAAO,GAAE,gCAAqC,GAC7C,EAAE,CAAC,mBAAmB,EAAE,GAAG,SAAS,CAqBtC;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,MAAM,GACnB,EAAE,CAAC,mBAAmB,CAaxB"}
|
|
@@ -45,7 +45,7 @@ it("renders a basic enum declaration", async () => {
|
|
|
45
45
|
assertFileContents(res, d`
|
|
46
46
|
namespace TestNamespace
|
|
47
47
|
{
|
|
48
|
-
|
|
48
|
+
enum TestEnum
|
|
49
49
|
{
|
|
50
50
|
Value1,
|
|
51
51
|
Value2,
|
|
@@ -83,7 +83,7 @@ it("renders an empty enum declaration", async () => {
|
|
|
83
83
|
assertFileContents(res, d`
|
|
84
84
|
namespace TestNamespace
|
|
85
85
|
{
|
|
86
|
-
|
|
86
|
+
enum TestEnum
|
|
87
87
|
{
|
|
88
88
|
|
|
89
89
|
}
|
|
@@ -123,7 +123,7 @@ it("can override enum name", async () => {
|
|
|
123
123
|
assertFileContents(res, d`
|
|
124
124
|
namespace TestNamespace
|
|
125
125
|
{
|
|
126
|
-
|
|
126
|
+
enum CustomEnumName
|
|
127
127
|
{
|
|
128
128
|
Value1,
|
|
129
129
|
Value2
|
|
@@ -153,7 +153,7 @@ it("renders an enum with access modifiers", async () => {
|
|
|
153
153
|
get children() {
|
|
154
154
|
return _$createComponent(EnumDeclaration, {
|
|
155
155
|
type: TestEnum,
|
|
156
|
-
|
|
156
|
+
internal: true
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
});
|
|
@@ -208,7 +208,7 @@ it("renders enum with C# naming conventions", async () => {
|
|
|
208
208
|
assertFileContents(res, d`
|
|
209
209
|
namespace TestNamespace
|
|
210
210
|
{
|
|
211
|
-
|
|
211
|
+
enum TestEnum
|
|
212
212
|
{
|
|
213
213
|
ValueOne,
|
|
214
214
|
ValueTwo,
|
|
@@ -248,7 +248,7 @@ it("renders enum with single value", async () => {
|
|
|
248
248
|
assertFileContents(res, d`
|
|
249
249
|
namespace TestNamespace
|
|
250
250
|
{
|
|
251
|
-
|
|
251
|
+
enum TestEnum
|
|
252
252
|
{
|
|
253
253
|
OnlyValue
|
|
254
254
|
}
|
|
@@ -289,7 +289,7 @@ it("renders enum with numeric-like member names", async () => {
|
|
|
289
289
|
assertFileContents(res, d`
|
|
290
290
|
namespace TestNamespace
|
|
291
291
|
{
|
|
292
|
-
|
|
292
|
+
enum TestEnum
|
|
293
293
|
{
|
|
294
294
|
Value0,
|
|
295
295
|
Value1,
|
|
@@ -339,12 +339,12 @@ it("renders multiple enums in the same namespace", async () => {
|
|
|
339
339
|
assertFileContents(res, d`
|
|
340
340
|
namespace TestNamespace
|
|
341
341
|
{
|
|
342
|
-
|
|
342
|
+
enum TestEnum1
|
|
343
343
|
{
|
|
344
344
|
Value1,
|
|
345
345
|
Value2
|
|
346
346
|
}
|
|
347
|
-
|
|
347
|
+
enum TestEnum2
|
|
348
348
|
{
|
|
349
349
|
OptionA,
|
|
350
350
|
OptionB,
|
|
@@ -352,4 +352,52 @@ it("renders multiple enums in the same namespace", async () => {
|
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
`);
|
|
355
|
+
});
|
|
356
|
+
it("renders an enum with doc comments", async () => {
|
|
357
|
+
const {
|
|
358
|
+
TestEnum
|
|
359
|
+
} = await runner.compile(`
|
|
360
|
+
@test enum TestEnum {
|
|
361
|
+
@doc("This is value one")
|
|
362
|
+
Value1;
|
|
363
|
+
/** This is value two */
|
|
364
|
+
Value2;
|
|
365
|
+
}
|
|
366
|
+
`);
|
|
367
|
+
const res = render(_$createComponent(Output, {
|
|
368
|
+
get program() {
|
|
369
|
+
return runner.program;
|
|
370
|
+
},
|
|
371
|
+
get children() {
|
|
372
|
+
return _$createComponent(Namespace, {
|
|
373
|
+
name: "TestNamespace",
|
|
374
|
+
get children() {
|
|
375
|
+
return _$createComponent(SourceFile, {
|
|
376
|
+
path: "test.cs",
|
|
377
|
+
get children() {
|
|
378
|
+
return _$createComponent(EnumDeclaration, {
|
|
379
|
+
type: TestEnum
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
}));
|
|
387
|
+
assertFileContents(res, d`
|
|
388
|
+
namespace TestNamespace
|
|
389
|
+
{
|
|
390
|
+
enum TestEnum
|
|
391
|
+
{
|
|
392
|
+
/// <summary>
|
|
393
|
+
/// This is value one
|
|
394
|
+
/// </summary>
|
|
395
|
+
Value1,
|
|
396
|
+
/// <summary>
|
|
397
|
+
/// This is value two
|
|
398
|
+
/// </summary>
|
|
399
|
+
Value2
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
`);
|
|
355
403
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-host.d.ts","sourceRoot":"","sources":["../../../test/csharp/test-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"test-host.d.ts","sourceRoot":"","sources":["../../../test/csharp/test-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AASlD,wBAAsB,yBAAyB,CAC7C,OAAO,GAAE;IAAE,SAAS,EAAE,MAAM,EAAE,CAAA;CAAsB,0DASrD;AAED,wBAAsB,gCAAgC,CAAC,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,iEAK7F;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,SAAS,EAAE,MAAM,EAAE,CAAA;CAAsB,GACnD,OAAO,CAAC,OAAO,CAAC,CAUlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../test/csharp/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../test/csharp/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,QAIxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-host.d.ts","sourceRoot":"","sources":["../../test/test-host.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,6CAA0E,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { List } from "@alloy-js/core";
|
|
3
3
|
import { d } from "@alloy-js/core/testing";
|
|
4
4
|
import { describe, expect, it } from "vitest";
|
|
5
5
|
import { TspContext } from "../../../src/core/index.js";
|
|
@@ -26,7 +26,7 @@ describe("Typescript Enum Member Expression", () => {
|
|
|
26
26
|
program
|
|
27
27
|
},
|
|
28
28
|
get children() {
|
|
29
|
-
return _$createComponent(
|
|
29
|
+
return _$createComponent(List, {
|
|
30
30
|
hardline: true,
|
|
31
31
|
get children() {
|
|
32
32
|
return [_$createComponent(EnumDeclaration, {
|
|
@@ -71,7 +71,7 @@ describe("Typescript Enum Member Expression", () => {
|
|
|
71
71
|
program
|
|
72
72
|
},
|
|
73
73
|
get children() {
|
|
74
|
-
return _$createComponent(
|
|
74
|
+
return _$createComponent(List, {
|
|
75
75
|
hardline: true,
|
|
76
76
|
get children() {
|
|
77
77
|
return [_$createComponent(EnumDeclaration, {
|
|
@@ -118,7 +118,7 @@ describe("Typescript Union Member Expression", () => {
|
|
|
118
118
|
program
|
|
119
119
|
},
|
|
120
120
|
get children() {
|
|
121
|
-
return _$createComponent(
|
|
121
|
+
return _$createComponent(List, {
|
|
122
122
|
hardline: true,
|
|
123
123
|
get children() {
|
|
124
124
|
return [_$createComponent(UnionDeclaration, {
|
|
@@ -159,7 +159,7 @@ describe("Typescript Union Member Expression", () => {
|
|
|
159
159
|
program
|
|
160
160
|
},
|
|
161
161
|
get children() {
|
|
162
|
-
return _$createComponent(
|
|
162
|
+
return _$createComponent(List, {
|
|
163
163
|
hardline: true,
|
|
164
164
|
get children() {
|
|
165
165
|
return [_$createComponent(UnionDeclaration, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-host.d.ts","sourceRoot":"","sources":["../../../test/typescript/test-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"test-host.d.ts","sourceRoot":"","sources":["../../../test/typescript/test-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAQlD,wBAAsB,yBAAyB,CAC7C,OAAO,GAAE;IAAE,SAAS,EAAE,MAAM,EAAE,CAAA;CAAsB,0DASrD;AAED,wBAAsB,gCAAgC,CAAC,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,iEAK7F;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,SAAS,EAAE,MAAM,EAAE,CAAA;CAAsB,GACnD,OAAO,CAAC,OAAO,CAAC,CAUlB;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEtD"}
|
package/dist/test/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Children, OutputDirectory } from "@alloy-js/core";
|
|
2
|
-
import { Program } from "@typespec/compiler";
|
|
1
|
+
import { type Children, type OutputDirectory } from "@alloy-js/core";
|
|
2
|
+
import type { Program } from "@typespec/compiler";
|
|
3
3
|
export declare function getEmitOutput(tspCode: string, cb: (program: Program) => Children): Promise<string | (OutputDirectory | import("@alloy-js/core").OutputFile)[]>;
|
|
4
4
|
export declare function assertFileContents(res: OutputDirectory, contents: string): void;
|
|
5
5
|
//# sourceMappingURL=utils.d.ts.map
|