@typespec/http-client-js 0.16.1-dev.0 → 0.16.1-dev.2

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 (205) hide show
  1. package/.turbo/turbo-build.log +2 -5
  2. package/dist/src/components/client-context/client-context-declaration.d.ts +1 -1
  3. package/dist/src/components/client-context/client-context-declaration.d.ts.map +1 -1
  4. package/dist/src/components/client-context/client-context-factory.d.ts +2 -2
  5. package/dist/src/components/client-context/client-context-factory.d.ts.map +1 -1
  6. package/dist/src/components/client-context/client-context-factory.js.map +1 -1
  7. package/dist/src/components/client-context/client-context-options.d.ts +2 -2
  8. package/dist/src/components/client-context/client-context-options.d.ts.map +1 -1
  9. package/dist/src/components/client-context/client-context-options.js.map +1 -1
  10. package/dist/src/components/client-context/client-context.d.ts +1 -1
  11. package/dist/src/components/client-context/client-context.d.ts.map +1 -1
  12. package/dist/src/components/client-context/parametrized-endpoint.d.ts +2 -2
  13. package/dist/src/components/client-context/parametrized-endpoint.d.ts.map +1 -1
  14. package/dist/src/components/client-context/parametrized-endpoint.js.map +1 -1
  15. package/dist/src/components/client-directory.d.ts +2 -2
  16. package/dist/src/components/client-directory.d.ts.map +1 -1
  17. package/dist/src/components/client-directory.js.map +1 -1
  18. package/dist/src/components/client-operation.d.ts +2 -2
  19. package/dist/src/components/client-operation.d.ts.map +1 -1
  20. package/dist/src/components/client-operation.js.map +1 -1
  21. package/dist/src/components/client.d.ts +2 -2
  22. package/dist/src/components/client.d.ts.map +1 -1
  23. package/dist/src/components/client.js.map +1 -1
  24. package/dist/src/components/encoding-provider.d.ts +1 -1
  25. package/dist/src/components/encoding-provider.d.ts.map +1 -1
  26. package/dist/src/components/http-request-options.d.ts +2 -2
  27. package/dist/src/components/http-request-options.d.ts.map +1 -1
  28. package/dist/src/components/http-request-options.js.map +1 -1
  29. package/dist/src/components/http-request-parameters-expression.d.ts +2 -2
  30. package/dist/src/components/http-request-parameters-expression.d.ts.map +1 -1
  31. package/dist/src/components/http-request-parameters-expression.js.map +1 -1
  32. package/dist/src/components/http-request.d.ts +2 -2
  33. package/dist/src/components/http-request.d.ts.map +1 -1
  34. package/dist/src/components/http-request.js.map +1 -1
  35. package/dist/src/components/http-response.d.ts +2 -2
  36. package/dist/src/components/http-response.d.ts.map +1 -1
  37. package/dist/src/components/http-response.js.map +1 -1
  38. package/dist/src/components/operation-handlers/index.d.ts +1 -1
  39. package/dist/src/components/operation-handlers/index.d.ts.map +1 -1
  40. package/dist/src/components/operation-handlers/index.js +0 -1
  41. package/dist/src/components/operation-handlers/index.js.map +1 -1
  42. package/dist/src/components/operation-handlers/operation-pipeline.d.ts +2 -2
  43. package/dist/src/components/operation-handlers/operation-pipeline.d.ts.map +1 -1
  44. package/dist/src/components/operation-handlers/paging/page-item.d.ts +1 -1
  45. package/dist/src/components/operation-handlers/paging/page-item.d.ts.map +1 -1
  46. package/dist/src/components/operation-handlers/paging/page-response.d.ts +2 -2
  47. package/dist/src/components/operation-handlers/paging/page-response.d.ts.map +1 -1
  48. package/dist/src/components/operation-handlers/paging/page-settings.d.ts +2 -2
  49. package/dist/src/components/operation-handlers/paging/page-settings.d.ts.map +1 -1
  50. package/dist/src/components/operation-handlers/paging/paginated-operation-handler.d.ts +1 -1
  51. package/dist/src/components/operation-handlers/paging/paginated-operation-handler.d.ts.map +1 -1
  52. package/dist/src/components/operation-handlers/paging/paginated-operation-handler.js.map +1 -1
  53. package/dist/src/components/operation-handlers/paging/request-send.d.ts +2 -2
  54. package/dist/src/components/operation-handlers/paging/request-send.d.ts.map +1 -1
  55. package/dist/src/components/operation-handlers/paging/request-send.js.map +1 -1
  56. package/dist/src/components/operation-handlers/paging/response-deserialize.d.ts +3 -3
  57. package/dist/src/components/operation-handlers/paging/response-deserialize.d.ts.map +1 -1
  58. package/dist/src/components/operation-handlers/paging/response-deserialize.js.map +1 -1
  59. package/dist/src/components/operation-handlers/paging/util.d.ts +2 -2
  60. package/dist/src/components/operation-handlers/paging/util.d.ts.map +1 -1
  61. package/dist/src/components/operation-handlers/types.d.ts +1 -1
  62. package/dist/src/components/operation-handlers/types.d.ts.map +1 -1
  63. package/dist/src/components/operation-options.d.ts +2 -2
  64. package/dist/src/components/operation-options.d.ts.map +1 -1
  65. package/dist/src/components/operation-parameters.d.ts +3 -3
  66. package/dist/src/components/operation-parameters.d.ts.map +1 -1
  67. package/dist/src/components/operation-parameters.js.map +1 -1
  68. package/dist/src/components/output.d.ts +2 -2
  69. package/dist/src/components/output.d.ts.map +1 -1
  70. package/dist/src/components/static-helpers/bytes-encoding.d.ts +2 -2
  71. package/dist/src/components/static-helpers/bytes-encoding.d.ts.map +1 -1
  72. package/dist/src/components/static-helpers/bytes-encoding.js.map +1 -1
  73. package/dist/src/components/testing/client-options.d.ts +1 -1
  74. package/dist/src/components/testing/client-options.d.ts.map +1 -1
  75. package/dist/src/components/testing/client-options.js.map +1 -1
  76. package/dist/src/components/transforms/data-transform.d.ts +2 -2
  77. package/dist/src/components/transforms/data-transform.d.ts.map +1 -1
  78. package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts +1 -1
  79. package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts.map +1 -1
  80. package/dist/src/components/transforms/json/json-model-additional-properties-transform.js.map +1 -1
  81. package/dist/src/components/transforms/json/json-model-property-transform.d.ts +2 -2
  82. package/dist/src/components/transforms/json/json-model-property-transform.d.ts.map +1 -1
  83. package/dist/src/components/transforms/json/json-model-property-transform.js.map +1 -1
  84. package/dist/src/components/transforms/json/json-transform-discriminator.d.ts +1 -1
  85. package/dist/src/components/transforms/json/json-transform-discriminator.d.ts.map +1 -1
  86. package/dist/src/components/transforms/json/json-transform.d.ts +2 -2
  87. package/dist/src/components/transforms/json/json-transform.d.ts.map +1 -1
  88. package/dist/src/components/transforms/json/json-transform.js.map +1 -1
  89. package/dist/src/components/transforms/json/union-transform.d.ts +1 -1
  90. package/dist/src/components/transforms/json/union-transform.d.ts.map +1 -1
  91. package/dist/src/components/transforms/json/union-transform.js.map +1 -1
  92. package/dist/src/components/transforms/multipart/array-part-transform.d.ts +2 -2
  93. package/dist/src/components/transforms/multipart/array-part-transform.d.ts.map +1 -1
  94. package/dist/src/components/transforms/multipart/file-part-transform.d.ts +2 -2
  95. package/dist/src/components/transforms/multipart/file-part-transform.d.ts.map +1 -1
  96. package/dist/src/components/transforms/multipart/file-part-transform.js.map +1 -1
  97. package/dist/src/components/transforms/multipart/multipart-transform.d.ts +1 -1
  98. package/dist/src/components/transforms/multipart/multipart-transform.d.ts.map +1 -1
  99. package/dist/src/components/transforms/multipart/part-transform.d.ts +1 -1
  100. package/dist/src/components/transforms/multipart/part-transform.d.ts.map +1 -1
  101. package/dist/src/components/transforms/multipart/simple-part-transform.d.ts +2 -2
  102. package/dist/src/components/transforms/multipart/simple-part-transform.d.ts.map +1 -1
  103. package/dist/src/components/transforms/multipart/simple-part-transform.js.map +1 -1
  104. package/dist/src/components/transforms/operation-transform-declaration.d.ts +3 -3
  105. package/dist/src/components/transforms/operation-transform-declaration.d.ts.map +1 -1
  106. package/dist/src/components/transforms/operation-transform-declaration.js.map +1 -1
  107. package/dist/src/components/transforms/operation-transform-expression.d.ts +1 -1
  108. package/dist/src/components/transforms/operation-transform-expression.d.ts.map +1 -1
  109. package/dist/src/components/transforms/operation-transform-expression.js.map +1 -1
  110. package/dist/src/components/transforms/scalar-transform.d.ts +2 -2
  111. package/dist/src/components/transforms/scalar-transform.d.ts.map +1 -1
  112. package/dist/src/components/transforms/scalar-transform.js.map +1 -1
  113. package/dist/src/components/utils/unpack-model-property.d.ts +1 -1
  114. package/dist/src/components/utils/unpack-model-property.d.ts.map +1 -1
  115. package/dist/src/components/utils/unpack-model-property.js.map +1 -1
  116. package/dist/src/components/utils/url-template.d.ts +1 -1
  117. package/dist/src/components/utils/url-template.d.ts.map +1 -1
  118. package/dist/src/context/encoding/encoding-context.d.ts +2 -2
  119. package/dist/src/context/encoding/encoding-context.d.ts.map +1 -1
  120. package/dist/src/context/encoding/encoding-context.js.map +1 -1
  121. package/dist/src/emitter.d.ts +3 -3
  122. package/dist/src/emitter.d.ts.map +1 -1
  123. package/dist/src/emitter.js.map +1 -1
  124. package/dist/src/lib.d.ts.map +1 -1
  125. package/dist/src/lib.js.map +1 -1
  126. package/dist/src/testing/index.d.ts +1 -1
  127. package/dist/src/testing/index.d.ts.map +1 -1
  128. package/dist/src/testing/index.js +1 -0
  129. package/dist/src/testing/index.js.map +1 -1
  130. package/dist/src/utils/client-discovery.d.ts +1 -1
  131. package/dist/src/utils/client-discovery.d.ts.map +1 -1
  132. package/dist/src/utils/operations.d.ts +2 -2
  133. package/dist/src/utils/operations.d.ts.map +1 -1
  134. package/dist/src/utils/operations.js.map +1 -1
  135. package/dist/src/utils/parameters.d.ts +5 -5
  136. package/dist/src/utils/parameters.d.ts.map +1 -1
  137. package/dist/src/utils/parameters.js.map +1 -1
  138. package/dist/tsconfig.tsbuildinfo +1 -1
  139. package/eng/scripts/{calculate-coverage.js → calculate-coverage.ts} +5 -8
  140. package/eng/scripts/{emit-e2e.js → emit-e2e.ts} +2 -6
  141. package/eng/scripts/{run-e2e-tests.js → run-e2e-tests.ts} +16 -12
  142. package/eng/scripts/{upload-spector-results.js → upload-spector-results.ts} +28 -9
  143. package/package.json +15 -15
  144. package/src/components/client-context/client-context-declaration.tsx +1 -1
  145. package/src/components/client-context/client-context-factory.tsx +5 -3
  146. package/src/components/client-context/client-context-options.tsx +3 -2
  147. package/src/components/client-context/client-context.tsx +1 -1
  148. package/src/components/client-context/parametrized-endpoint.tsx +3 -2
  149. package/src/components/client-directory.tsx +3 -2
  150. package/src/components/client-operation.tsx +3 -2
  151. package/src/components/client.tsx +3 -2
  152. package/src/components/encoding-provider.tsx +1 -1
  153. package/src/components/http-request-options.tsx +3 -2
  154. package/src/components/http-request-parameters-expression.tsx +3 -2
  155. package/src/components/http-request.tsx +3 -2
  156. package/src/components/http-response.tsx +3 -2
  157. package/src/components/operation-handlers/index.tsx +1 -1
  158. package/src/components/operation-handlers/operation-pipeline.tsx +2 -2
  159. package/src/components/operation-handlers/paging/page-item.tsx +1 -1
  160. package/src/components/operation-handlers/paging/page-response.tsx +2 -2
  161. package/src/components/operation-handlers/paging/page-settings.tsx +2 -2
  162. package/src/components/operation-handlers/paging/paginated-operation-handler.tsx +6 -4
  163. package/src/components/operation-handlers/paging/request-send.tsx +3 -2
  164. package/src/components/operation-handlers/paging/response-deserialize.tsx +5 -3
  165. package/src/components/operation-handlers/paging/util.ts +2 -2
  166. package/src/components/operation-handlers/types.tsx +1 -1
  167. package/src/components/operation-options.tsx +2 -2
  168. package/src/components/operation-parameters.tsx +4 -3
  169. package/src/components/output.tsx +2 -2
  170. package/src/components/static-helpers/bytes-encoding.tsx +3 -2
  171. package/src/components/testing/client-options.tsx +2 -1
  172. package/src/components/transforms/content-type-encoding-provider.tsx +1 -1
  173. package/src/components/transforms/data-transform.tsx +2 -2
  174. package/src/components/transforms/json/json-model-additional-properties-transform.tsx +2 -1
  175. package/src/components/transforms/json/json-model-property-transform.tsx +3 -2
  176. package/src/components/transforms/json/json-transform-discriminator.tsx +1 -1
  177. package/src/components/transforms/json/json-transform.tsx +3 -2
  178. package/src/components/transforms/json/union-transform.tsx +2 -1
  179. package/src/components/transforms/multipart/array-part-transform.tsx +2 -2
  180. package/src/components/transforms/multipart/file-part-transform.tsx +3 -2
  181. package/src/components/transforms/multipart/multipart-transform.tsx +1 -1
  182. package/src/components/transforms/multipart/part-transform.tsx +1 -1
  183. package/src/components/transforms/multipart/simple-part-transform.tsx +3 -2
  184. package/src/components/transforms/operation-transform-declaration.tsx +4 -3
  185. package/src/components/transforms/operation-transform-expression.tsx +3 -2
  186. package/src/components/transforms/scalar-transform.tsx +4 -2
  187. package/src/components/utils/unpack-model-property.ts +2 -1
  188. package/src/components/utils/url-template.tsx +1 -1
  189. package/src/context/encoding/encoding-context.tsx +3 -2
  190. package/src/emitter.tsx +4 -3
  191. package/src/lib.ts +2 -1
  192. package/src/testing/index.ts +3 -1
  193. package/src/utils/client-discovery.ts +1 -1
  194. package/src/utils/operations.ts +5 -3
  195. package/src/utils/parameters.tsx +6 -5
  196. package/test/e2e/http/payload/multipart/main.test.ts +1 -3
  197. package/test/e2e/http/payload/pageable/main.test.ts +2 -4
  198. package/test/e2e/http/type/model/inheritance/single-discriminator/main.test.ts +2 -4
  199. package/test/e2e/http/type/property/additional-properties/main.test.ts +1 -1
  200. package/test/e2e/http/type/property/additional-properties/spreads.test.ts +5 -3
  201. package/test/e2e/http/versioning/added/main.test.ts +1 -2
  202. package/test/e2e/http/versioning/removed/main.test.ts +1 -1
  203. package/test/test-host.ts +2 -1
  204. package/tsconfig.json +1 -0
  205. package/tsconfig.test.json +1 -0
@@ -1,5 +1,5 @@
1
- import { Children, Refkey } from "@alloy-js/core";
2
- import { EncodeData, ModelProperty, Scalar } from "@typespec/compiler";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import type { EncodeData, ModelProperty, Scalar } from "@typespec/compiler";
3
3
  import { useTsp } from "@typespec/emitter-framework";
4
4
  import { reportDiagnostic } from "../../lib.js";
5
5
  import { unpackProperty } from "../utils/unpack-model-property.js";
@@ -1,4 +1,5 @@
1
- import { Children, code, mapJoin } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { code, mapJoin } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import type { Model } from "@typespec/compiler";
4
5
  import { useTsp } from "@typespec/emitter-framework";
@@ -1,6 +1,7 @@
1
- import { Children, code, NamePolicyContext, Refkey } from "@alloy-js/core";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import { code, NamePolicyContext } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import { ModelProperty } from "@typespec/compiler";
4
+ import type { ModelProperty } from "@typespec/compiler";
4
5
  import { useTsp } from "@typespec/emitter-framework";
5
6
  import { unpackProperty } from "../../utils/unpack-model-property.js";
6
7
  import { ScalarDataTransform } from "../data-transform.jsx";
@@ -1,6 +1,6 @@
1
1
  import { code, mapJoin, refkey, useNamePolicy, type Children, type Refkey } from "@alloy-js/core";
2
2
  import * as ts from "@alloy-js/typescript";
3
- import { Discriminator, Model, Union } from "@typespec/compiler";
3
+ import type { Discriminator, Model, Union } from "@typespec/compiler";
4
4
  import { useTsp } from "@typespec/emitter-framework";
5
5
  import { JsonTransform } from "./json-transform.jsx";
6
6
 
@@ -1,5 +1,6 @@
1
- import { code, Refkey } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { code } from "@alloy-js/core";
3
+ import type { Children } from "@alloy-js/core/jsx-runtime";
3
4
  import type { Type } from "@typespec/compiler";
4
5
  import { useTsp } from "@typespec/emitter-framework";
5
6
  import { ScalarDataTransform } from "../data-transform.jsx";
@@ -1,4 +1,5 @@
1
- import { Children, code, refkey, Refkey } from "@alloy-js/core";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import { code, refkey } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import type { Union } from "@typespec/compiler";
4
5
  import { useTsp } from "@typespec/emitter-framework";
@@ -1,7 +1,7 @@
1
1
  import { code } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
2
+ import type { Children } from "@alloy-js/core/jsx-runtime";
3
3
  import * as ts from "@alloy-js/typescript";
4
- import { HttpOperationPart } from "@typespec/http";
4
+ import type { HttpOperationPart } from "@typespec/http";
5
5
  import { HttpPartTransform } from "./part-transform.jsx";
6
6
 
7
7
  export interface ArrayPartTransformProps {
@@ -1,6 +1,7 @@
1
- import { Children, code } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { code } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import { HttpOperationPart } from "@typespec/http";
4
+ import type { HttpOperationPart } from "@typespec/http";
4
5
  import { getCreateFilePartDescriptorReference } from "../../static-helpers/multipart-helpers.jsx";
5
6
 
6
7
  export interface FilePartTransformProps {
@@ -1,6 +1,6 @@
1
1
  import { For } from "@alloy-js/core";
2
2
  import { useTransformNamePolicy, useTsp } from "@typespec/emitter-framework";
3
- import { HttpOperationMultipartBody } from "@typespec/http";
3
+ import type { HttpOperationMultipartBody } from "@typespec/http";
4
4
  import { reportDiagnostic } from "../../../lib.js";
5
5
  import { HttpPartTransform } from "./part-transform.jsx";
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { type Children } from "@alloy-js/core";
2
- import { HttpOperationPart } from "@typespec/http";
2
+ import type { HttpOperationPart } from "@typespec/http";
3
3
  import { ArrayPartTransform } from "./array-part-transform.jsx";
4
4
  import { FilePartTransform } from "./file-part-transform.jsx";
5
5
  import { SimplePartTransform } from "./simple-part-transform.jsx";
@@ -1,6 +1,7 @@
1
- import { Children, code, List } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { code, List } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import { HttpOperationPart } from "@typespec/http";
4
+ import type { HttpOperationPart } from "@typespec/http";
4
5
  import { JsonTransform } from "../json/json-transform.jsx";
5
6
 
6
7
  export interface SimplePartTransformProps {
@@ -1,8 +1,9 @@
1
- import { Refkey, refkey } from "@alloy-js/core";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { refkey } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import * as ef from "@typespec/emitter-framework/typescript";
4
- import { HttpOperationBody } from "@typespec/http";
5
- import { ClientOperation } from "@typespec/http-client";
5
+ import type { HttpOperationBody } from "@typespec/http";
6
+ import type { ClientOperation } from "@typespec/http-client";
6
7
  import { JsonTransform } from "./json/json-transform.jsx";
7
8
 
8
9
  export interface TransformDeclarationProps {
@@ -1,7 +1,8 @@
1
1
  import * as ts from "@alloy-js/typescript";
2
2
  import type { Type } from "@typespec/compiler";
3
- import { HasName, TransformNamePolicyContext, useTsp } from "@typespec/emitter-framework";
4
- import { HttpOperation } from "@typespec/http";
3
+ import type { HasName } from "@typespec/emitter-framework";
4
+ import { TransformNamePolicyContext, useTsp } from "@typespec/emitter-framework";
5
+ import type { HttpOperation } from "@typespec/http";
5
6
  import { reportDiagnostic } from "../../lib.js";
6
7
  import { ContentTypeEncodingProvider } from "./content-type-encoding-provider.jsx";
7
8
  import { JsonTransform } from "./json/json-transform.jsx";
@@ -1,5 +1,7 @@
1
- import { Children, code, Refkey } from "@alloy-js/core";
2
- import { BytesKnownEncoding, EncodeData, NoTarget, Scalar } from "@typespec/compiler";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import { code } from "@alloy-js/core";
3
+ import type { BytesKnownEncoding, EncodeData, Scalar } from "@typespec/compiler";
4
+ import { NoTarget } from "@typespec/compiler";
3
5
  import { useTsp } from "@typespec/emitter-framework";
4
6
  import * as ef from "@typespec/emitter-framework/typescript";
5
7
  import { useDefaultEncoding } from "../../context/encoding/encoding-context.jsx";
@@ -1,4 +1,5 @@
1
- import { isNullType, ModelProperty, Type } from "@typespec/compiler";
1
+ import type { ModelProperty, Type } from "@typespec/compiler";
2
+ import { isNullType } from "@typespec/compiler";
2
3
  import { useTsp } from "@typespec/emitter-framework";
3
4
 
4
5
  /**
@@ -1,5 +1,5 @@
1
1
  import * as ts from "@alloy-js/typescript";
2
- import { ModelProperty } from "@typespec/compiler";
2
+ import type { ModelProperty } from "@typespec/compiler";
3
3
  import { useTransformNamePolicy } from "@typespec/emitter-framework";
4
4
  import { uriTemplateLib } from "../external-packages/uri-template.js";
5
5
 
@@ -1,8 +1,9 @@
1
- import { ComponentContext, createNamedContext, useContext } from "@alloy-js/core";
1
+ import type { ComponentContext } from "@alloy-js/core";
2
+ import { createNamedContext, useContext } from "@alloy-js/core";
2
3
  import { NoTarget } from "@typespec/compiler";
3
4
  import { useTsp } from "@typespec/emitter-framework";
4
5
  import { reportDiagnostic } from "../../lib.js";
5
- import { EncodingDefaults } from "./types.js";
6
+ import type { EncodingDefaults } from "./types.js";
6
7
 
7
8
  export const EncodingContext: ComponentContext<EncodingDefaults> =
8
9
  createNamedContext<EncodingDefaults>("Encoding");
package/src/emitter.tsx CHANGED
@@ -1,6 +1,7 @@
1
- import { Children, SourceDirectory } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { SourceDirectory } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import { EmitContext } from "@typespec/compiler";
4
+ import type { EmitContext } from "@typespec/compiler";
4
5
  import {
5
6
  Experimental_ComponentOverrides,
6
7
  Experimental_ComponentOverridesConfig,
@@ -17,7 +18,7 @@ import { Interfaces } from "./components/static-helpers/interfaces.jsx";
17
18
  import { MultipartHelpers } from "./components/static-helpers/multipart-helpers.jsx";
18
19
  import { PagingHelpers } from "./components/static-helpers/paging-helper.jsx";
19
20
  import { RestError } from "./components/static-helpers/rest-error.jsx";
20
- import { JsClientEmitterOptions } from "./lib.js";
21
+ import type { JsClientEmitterOptions } from "./lib.js";
21
22
 
22
23
  /**
23
24
  * Main function to handle the emission process.
package/src/lib.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { createTypeSpecLibrary, JSONSchemaType } from "@typespec/compiler";
1
+ import type { JSONSchemaType } from "@typespec/compiler";
2
+ import { createTypeSpecLibrary } from "@typespec/compiler";
2
3
 
3
4
  export interface JsClientEmitterOptions {
4
5
  "package-name"?: string;
@@ -1,8 +1,10 @@
1
1
  import { resolvePath } from "@typespec/compiler";
2
- import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing";
2
+ import type { TypeSpecTestLibrary } from "@typespec/compiler/testing";
3
+ import { createTestLibrary } from "@typespec/compiler/testing";
3
4
  import { fileURLToPath } from "url";
4
5
 
5
6
  /** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */
7
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
6
8
  export const HttpClientJavascriptEmitterTestLibrary: TypeSpecTestLibrary = createTestLibrary({
7
9
  name: "@typespec/http-client-js",
8
10
  packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../"),
@@ -1,4 +1,4 @@
1
- import * as cl from "@typespec/http-client";
1
+ import type * as cl from "@typespec/http-client";
2
2
 
3
3
  const flattenCache: WeakMap<cl.Client, cl.Client[]> = new WeakMap();
4
4
  /**
@@ -1,9 +1,11 @@
1
- import { Model, ModelProperty, Operation, Union } from "@typespec/compiler";
1
+ import type { Model, ModelProperty, Operation, Union } from "@typespec/compiler";
2
+ import type {
3
+ unsafe_Mutator as Mutator,
4
+ unsafe_MutatorRecord,
5
+ } from "@typespec/compiler/experimental";
2
6
  import {
3
7
  unsafe_mutateSubgraph as mutateSubgraph,
4
- unsafe_Mutator as Mutator,
5
8
  unsafe_MutatorFlow as MutatorFlow,
6
- unsafe_MutatorRecord,
7
9
  } from "@typespec/compiler/experimental";
8
10
  import { $, type Typekit } from "@typespec/compiler/typekit";
9
11
 
@@ -1,10 +1,11 @@
1
- import { code, mapJoin, Refkey, refkey } from "@alloy-js/core";
2
- import * as ts from "@alloy-js/typescript";
3
- import { ModelProperty, Value } from "@typespec/compiler";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { code, mapJoin, refkey } from "@alloy-js/core";
3
+ import type * as ts from "@alloy-js/typescript";
4
+ import type { ModelProperty, Value } from "@typespec/compiler";
4
5
  import { useTsp } from "@typespec/emitter-framework";
5
6
  import { buildParameterDescriptor } from "@typespec/emitter-framework/typescript";
6
- import { HttpAuth, HttpProperty, OAuth2FlowType } from "@typespec/http";
7
- import * as cl from "@typespec/http-client";
7
+ import type { HttpAuth, HttpProperty, OAuth2FlowType } from "@typespec/http";
8
+ import type * as cl from "@typespec/http-client";
8
9
  import { getClientContextOptionsRef } from "../components/client-context/client-context-options.jsx";
9
10
  import { httpRuntimeTemplateLib } from "../components/external-packages/ts-http-runtime.js";
10
11
 
@@ -88,9 +88,7 @@ describe.skip("Payload.MultiPart", () => {
88
88
  const address = { city: "X" };
89
89
  await client.jsonPart({
90
90
  address,
91
- profileImage: new Uint8Array([
92
- /* file content */
93
- ]),
91
+ profileImage: new Uint8Array([/* file content */]),
94
92
  });
95
93
  });
96
94
 
@@ -1,8 +1,6 @@
1
1
  import { describe, expect, it } from "vitest";
2
- import {
3
- Pet,
4
- ServerDrivenPaginationClient,
5
- } from "../../../generated/payload/pageable/src/index.js";
2
+ import type { Pet } from "../../../generated/payload/pageable/src/index.js";
3
+ import { ServerDrivenPaginationClient } from "../../../generated/payload/pageable/src/index.js";
6
4
 
7
5
  describe("Payload.Pageable", () => {
8
6
  describe("list", () => {
@@ -1,8 +1,6 @@
1
1
  import { describe, expect, it } from "vitest";
2
- import {
3
- Eagle,
4
- SingleDiscriminatorClient,
5
- } from "../../../../../generated/type/model/inheritance/single-discriminator/src/index.js";
2
+ import type { Eagle } from "../../../../../generated/type/model/inheritance/single-discriminator/src/index.js";
3
+ import { SingleDiscriminatorClient } from "../../../../../generated/type/model/inheritance/single-discriminator/src/index.js";
6
4
 
7
5
  describe("Type.Model.Inheritance.SingleDiscriminator", () => {
8
6
  const client = new SingleDiscriminatorClient({
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, it } from "vitest";
2
+ import type { ExtendsUnknownAdditionalPropertiesDiscriminatedDerived } from "../../../../generated/type/property/additional-properties/src/index.js";
2
3
  import {
3
- ExtendsUnknownAdditionalPropertiesDiscriminatedDerived,
4
4
  ExtendsUnknownClient,
5
5
  ExtendsUnknownDerivedClient,
6
6
  ExtendsUnknownDiscriminatedClient,
@@ -1,4 +1,9 @@
1
1
  import { describe, expect, it } from "vitest";
2
+ import type {
3
+ SpreadRecordForNonDiscriminatedUnion,
4
+ SpreadRecordForNonDiscriminatedUnion2,
5
+ SpreadRecordForNonDiscriminatedUnion3,
6
+ } from "../../../../generated/type/property/additional-properties/src/index.js";
2
7
  import {
3
8
  ExtendsDifferentSpreadFloatClient,
4
9
  ExtendsDifferentSpreadModelArrayClient,
@@ -20,9 +25,6 @@ import {
20
25
  SpreadFloatClient,
21
26
  SpreadModelArrayClient,
22
27
  SpreadModelClient,
23
- SpreadRecordForNonDiscriminatedUnion,
24
- SpreadRecordForNonDiscriminatedUnion2,
25
- SpreadRecordForNonDiscriminatedUnion3,
26
28
  SpreadRecordNonDiscriminatedUnion2Client,
27
29
  SpreadRecordNonDiscriminatedUnion3Client,
28
30
  SpreadRecordNonDiscriminatedUnionClient,
@@ -1,11 +1,10 @@
1
1
  import { describe, expect, it } from "vitest";
2
+ import type { ModelV1, ModelV2 } from "../../../generated/versioning/added/src/index.js";
2
3
  import {
3
4
  AddedClient,
4
5
  EnumV1,
5
6
  EnumV2,
6
7
  InterfaceV2Client,
7
- ModelV1,
8
- ModelV2,
9
8
  Versions,
10
9
  } from "../../../generated/versioning/added/src/index.js";
11
10
 
@@ -1,8 +1,8 @@
1
1
  import { describe, expect, it } from "vitest";
2
+ import type { ModelV3 } from "../../../generated/versioning/removed/src/index.js";
2
3
  import {
3
4
  EnumV2,
4
5
  EnumV3,
5
- ModelV3,
6
6
  RemovedClient,
7
7
  Versions,
8
8
  } from "../../../generated/versioning/removed/src/index.js";
package/test/test-host.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { Diagnostic, resolvePath } from "@typespec/compiler";
1
+ import type { Diagnostic } from "@typespec/compiler";
2
+ import { resolvePath } from "@typespec/compiler";
2
3
  import { createTester, expectDiagnosticEmpty } from "@typespec/compiler/testing";
3
4
 
4
5
  const ApiTester = createTester(resolvePath(import.meta.dirname, ".."), {
package/tsconfig.json CHANGED
@@ -6,6 +6,7 @@
6
6
  "target": "es2022",
7
7
  "skipLibCheck": true,
8
8
  "isolatedModules": true,
9
+ "verbatimModuleSyntax": true,
9
10
  "jsx": "preserve",
10
11
  "jsxImportSource": "@alloy-js/core",
11
12
  "emitDeclarationOnly": true,
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
3
  "compilerOptions": {
4
+ "verbatimModuleSyntax": false,
4
5
  "outDir": "dist-test"
5
6
  },
6
7
  "include": ["test/e2e/**/*"],