@typespec/compiler 0.65.0-dev.2 → 0.65.0-dev.22

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 (192) hide show
  1. package/dist/manifest.js +2 -2
  2. package/dist/src/core/binder.d.ts +1 -1
  3. package/dist/src/core/binder.d.ts.map +1 -1
  4. package/dist/src/core/binder.js +1 -0
  5. package/dist/src/core/binder.js.map +1 -1
  6. package/dist/src/core/checker.d.ts.map +1 -1
  7. package/dist/src/core/checker.js +7 -4
  8. package/dist/src/core/checker.js.map +1 -1
  9. package/dist/src/core/compiler-code-fixes/convert-to-value.codefix.d.ts +10 -0
  10. package/dist/src/core/compiler-code-fixes/convert-to-value.codefix.d.ts.map +1 -0
  11. package/dist/src/core/compiler-code-fixes/convert-to-value.codefix.js +68 -0
  12. package/dist/src/core/compiler-code-fixes/convert-to-value.codefix.js.map +1 -0
  13. package/dist/src/core/decorator-utils.d.ts.map +1 -1
  14. package/dist/src/core/decorator-utils.js +3 -1
  15. package/dist/src/core/decorator-utils.js.map +1 -1
  16. package/dist/src/core/deprecation.d.ts.map +1 -1
  17. package/dist/src/core/deprecation.js +1 -3
  18. package/dist/src/core/deprecation.js.map +1 -1
  19. package/dist/src/core/helpers/projected-names-utils.d.ts.map +1 -1
  20. package/dist/src/core/helpers/projected-names-utils.js.map +1 -1
  21. package/dist/src/core/intrinsic-type-state.d.ts.map +1 -1
  22. package/dist/src/core/intrinsic-type-state.js +1 -3
  23. package/dist/src/core/intrinsic-type-state.js.map +1 -1
  24. package/dist/src/core/messages.d.ts +2 -20
  25. package/dist/src/core/messages.d.ts.map +1 -1
  26. package/dist/src/core/messages.js +0 -6
  27. package/dist/src/core/messages.js.map +1 -1
  28. package/dist/src/core/name-resolver.d.ts.map +1 -1
  29. package/dist/src/core/name-resolver.js +1 -0
  30. package/dist/src/core/name-resolver.js.map +1 -1
  31. package/dist/src/core/parser.d.ts.map +1 -1
  32. package/dist/src/core/parser.js +1 -0
  33. package/dist/src/core/parser.js.map +1 -1
  34. package/dist/src/core/program.d.ts +2 -0
  35. package/dist/src/core/program.d.ts.map +1 -1
  36. package/dist/src/core/program.js +2 -0
  37. package/dist/src/core/program.js.map +1 -1
  38. package/dist/src/core/projected-program.d.ts.map +1 -1
  39. package/dist/src/core/projected-program.js.map +1 -1
  40. package/dist/src/core/projection-members.d.ts.map +1 -1
  41. package/dist/src/core/projection-members.js +1 -0
  42. package/dist/src/core/projection-members.js.map +1 -1
  43. package/dist/src/core/projector.d.ts.map +1 -1
  44. package/dist/src/core/projector.js +1 -5
  45. package/dist/src/core/projector.js.map +1 -1
  46. package/dist/src/core/semantic-walker.d.ts +4 -0
  47. package/dist/src/core/semantic-walker.d.ts.map +1 -1
  48. package/dist/src/core/semantic-walker.js +5 -0
  49. package/dist/src/core/semantic-walker.js.map +1 -1
  50. package/dist/src/core/state-accessors.d.ts.map +1 -1
  51. package/dist/src/core/state-accessors.js.map +1 -1
  52. package/dist/src/core/type-relation-checker.d.ts.map +1 -1
  53. package/dist/src/core/type-relation-checker.js +1 -0
  54. package/dist/src/core/type-relation-checker.js.map +1 -1
  55. package/dist/src/core/types.d.ts +7 -0
  56. package/dist/src/core/types.d.ts.map +1 -1
  57. package/dist/src/core/types.js.map +1 -1
  58. package/dist/src/core/visibility/core.d.ts.map +1 -1
  59. package/dist/src/core/visibility/core.js +7 -6
  60. package/dist/src/core/visibility/core.js.map +1 -1
  61. package/dist/src/emitter-framework/types.d.ts.map +1 -1
  62. package/dist/src/experimental/freeze-graph.d.ts +3 -0
  63. package/dist/src/experimental/freeze-graph.d.ts.map +1 -0
  64. package/dist/src/experimental/freeze-graph.js +28 -0
  65. package/dist/src/experimental/freeze-graph.js.map +1 -0
  66. package/dist/src/experimental/index.d.ts +6 -2
  67. package/dist/src/experimental/index.d.ts.map +1 -1
  68. package/dist/src/experimental/index.js +6 -2
  69. package/dist/src/experimental/index.js.map +1 -1
  70. package/dist/src/experimental/mutators.d.ts +5 -3
  71. package/dist/src/experimental/mutators.d.ts.map +1 -1
  72. package/dist/src/experimental/mutators.js +283 -52
  73. package/dist/src/experimental/mutators.js.map +1 -1
  74. package/dist/src/experimental/realm.d.ts.map +1 -1
  75. package/dist/src/experimental/realm.js +5 -0
  76. package/dist/src/experimental/realm.js.map +1 -1
  77. package/dist/src/experimental/typekit/kits/literal.d.ts +61 -52
  78. package/dist/src/experimental/typekit/kits/literal.d.ts.map +1 -1
  79. package/dist/src/experimental/typekit/kits/literal.js.map +1 -1
  80. package/dist/src/experimental/typekit/kits/model-property.d.ts +11 -3
  81. package/dist/src/experimental/typekit/kits/model-property.d.ts.map +1 -1
  82. package/dist/src/experimental/typekit/kits/model-property.js.map +1 -1
  83. package/dist/src/experimental/typekit/kits/model.d.ts +41 -15
  84. package/dist/src/experimental/typekit/kits/model.d.ts.map +1 -1
  85. package/dist/src/experimental/typekit/kits/model.js +4 -0
  86. package/dist/src/experimental/typekit/kits/model.js.map +1 -1
  87. package/dist/src/experimental/typekit/kits/scalar.d.ts +349 -344
  88. package/dist/src/experimental/typekit/kits/scalar.d.ts.map +1 -1
  89. package/dist/src/experimental/typekit/kits/scalar.js.map +1 -1
  90. package/dist/src/experimental/typekit/kits/type.d.ts +5 -4
  91. package/dist/src/experimental/typekit/kits/type.d.ts.map +1 -1
  92. package/dist/src/experimental/typekit/kits/type.js +19 -38
  93. package/dist/src/experimental/typekit/kits/type.js.map +1 -1
  94. package/dist/src/experimental/typekit/kits/union-variant.d.ts +28 -15
  95. package/dist/src/experimental/typekit/kits/union-variant.d.ts.map +1 -1
  96. package/dist/src/experimental/typekit/kits/union-variant.js.map +1 -1
  97. package/dist/src/experimental/typekit/kits/union.d.ts +39 -30
  98. package/dist/src/experimental/typekit/kits/union.d.ts.map +1 -1
  99. package/dist/src/experimental/typekit/kits/union.js.map +1 -1
  100. package/dist/src/formatter/print/printer.d.ts.map +1 -1
  101. package/dist/src/formatter/print/printer.js.map +1 -1
  102. package/dist/src/init/init.d.ts +3 -2
  103. package/dist/src/init/init.d.ts.map +1 -1
  104. package/dist/src/init/init.js +8 -3
  105. package/dist/src/init/init.js.map +1 -1
  106. package/dist/src/init/scaffold.d.ts +2 -1
  107. package/dist/src/init/scaffold.d.ts.map +1 -1
  108. package/dist/src/init/scaffold.js +1 -1
  109. package/dist/src/init/scaffold.js.map +1 -1
  110. package/dist/src/lib/decorators.d.ts +0 -2
  111. package/dist/src/lib/decorators.d.ts.map +1 -1
  112. package/dist/src/lib/decorators.js +15 -26
  113. package/dist/src/lib/decorators.js.map +1 -1
  114. package/dist/src/lib/encoded-names.js +3 -3
  115. package/dist/src/lib/encoded-names.js.map +1 -1
  116. package/dist/src/lib/examples.js +5 -1
  117. package/dist/src/lib/examples.js.map +1 -1
  118. package/dist/src/lib/key.d.ts.map +1 -1
  119. package/dist/src/lib/key.js +3 -2
  120. package/dist/src/lib/key.js.map +1 -1
  121. package/dist/src/lib/paging.js +3 -3
  122. package/dist/src/lib/paging.js.map +1 -1
  123. package/dist/src/lib/service.d.ts.map +1 -1
  124. package/dist/src/lib/service.js +3 -2
  125. package/dist/src/lib/service.js.map +1 -1
  126. package/dist/src/lib/utils.d.ts +6 -3
  127. package/dist/src/lib/utils.d.ts.map +1 -1
  128. package/dist/src/lib/utils.js +7 -10
  129. package/dist/src/lib/utils.js.map +1 -1
  130. package/dist/src/lib/visibility.d.ts.map +1 -1
  131. package/dist/src/lib/visibility.js +3 -2
  132. package/dist/src/lib/visibility.js.map +1 -1
  133. package/dist/src/module-resolver/esm/resolve-package-exports.js +2 -2
  134. package/dist/src/module-resolver/esm/resolve-package-exports.js.map +1 -1
  135. package/dist/src/module-resolver/esm/resolve-package-imports.d.ts +5 -0
  136. package/dist/src/module-resolver/esm/resolve-package-imports.d.ts.map +1 -0
  137. package/dist/src/module-resolver/esm/resolve-package-imports.js +26 -0
  138. package/dist/src/module-resolver/esm/resolve-package-imports.js.map +1 -0
  139. package/dist/src/module-resolver/esm/utils.d.ts +4 -1
  140. package/dist/src/module-resolver/esm/utils.d.ts.map +1 -1
  141. package/dist/src/module-resolver/esm/utils.js +5 -0
  142. package/dist/src/module-resolver/esm/utils.js.map +1 -1
  143. package/dist/src/module-resolver/module-resolver.d.ts +2 -0
  144. package/dist/src/module-resolver/module-resolver.d.ts.map +1 -1
  145. package/dist/src/module-resolver/module-resolver.js +55 -3
  146. package/dist/src/module-resolver/module-resolver.js.map +1 -1
  147. package/dist/src/server/lib-provider.d.ts +23 -0
  148. package/dist/src/server/lib-provider.d.ts.map +1 -0
  149. package/dist/src/server/{emitter-provider.js → lib-provider.js} +25 -23
  150. package/dist/src/server/lib-provider.js.map +1 -0
  151. package/dist/src/server/serverlib.d.ts.map +1 -1
  152. package/dist/src/server/serverlib.js +5 -2
  153. package/dist/src/server/serverlib.js.map +1 -1
  154. package/dist/src/server/tspconfig/completion.d.ts +5 -3
  155. package/dist/src/server/tspconfig/completion.d.ts.map +1 -1
  156. package/dist/src/server/tspconfig/completion.js +234 -16
  157. package/dist/src/server/tspconfig/completion.js.map +1 -1
  158. package/dist/src/server/yaml-resolver.d.ts +20 -2
  159. package/dist/src/server/yaml-resolver.d.ts.map +1 -1
  160. package/dist/src/server/yaml-resolver.js +39 -6
  161. package/dist/src/server/yaml-resolver.js.map +1 -1
  162. package/dist/src/types/package-json.d.ts +19 -2
  163. package/dist/src/types/package-json.d.ts.map +1 -1
  164. package/dist/src/utils/index.d.ts +1 -0
  165. package/dist/src/utils/index.d.ts.map +1 -1
  166. package/dist/src/utils/index.js +1 -0
  167. package/dist/src/utils/index.js.map +1 -1
  168. package/dist/src/{experimental → utils}/state-accessor.d.ts +2 -4
  169. package/dist/src/utils/state-accessor.d.ts.map +1 -0
  170. package/dist/src/{experimental → utils}/state-accessor.js +2 -4
  171. package/dist/src/utils/state-accessor.js.map +1 -0
  172. package/lib/std/projected-names.tsp +5 -5
  173. package/package.json +15 -11
  174. package/templates/__snapshots__/rest/.gitignore +9 -0
  175. package/templates/__snapshots__/rest/main.tsp +46 -0
  176. package/templates/__snapshots__/rest/package.json +20 -0
  177. package/templates/__snapshots__/rest/tspconfig.yaml +16 -0
  178. package/templates/rest/main.tsp +46 -0
  179. package/templates/scaffolding.json +51 -5
  180. package/dist/src/core/compiler-code-fixes/model-to-object-literal.codefix.d.ts +0 -6
  181. package/dist/src/core/compiler-code-fixes/model-to-object-literal.codefix.d.ts.map +0 -1
  182. package/dist/src/core/compiler-code-fixes/model-to-object-literal.codefix.js +0 -15
  183. package/dist/src/core/compiler-code-fixes/model-to-object-literal.codefix.js.map +0 -1
  184. package/dist/src/core/compiler-code-fixes/tuple-to-array-value.codefix.d.ts +0 -6
  185. package/dist/src/core/compiler-code-fixes/tuple-to-array-value.codefix.d.ts.map +0 -1
  186. package/dist/src/core/compiler-code-fixes/tuple-to-array-value.codefix.js +0 -15
  187. package/dist/src/core/compiler-code-fixes/tuple-to-array-value.codefix.js.map +0 -1
  188. package/dist/src/experimental/state-accessor.d.ts.map +0 -1
  189. package/dist/src/experimental/state-accessor.js.map +0 -1
  190. package/dist/src/server/emitter-provider.d.ts +0 -22
  191. package/dist/src/server/emitter-provider.d.ts.map +0 -1
  192. package/dist/src/server/emitter-provider.js.map +0 -1
@@ -1,354 +1,359 @@
1
1
  import type { Scalar, Type } from "../../../core/types.js";
2
2
  import { type EncodeData } from "../../../lib/decorators.js";
3
- /** @experimental */
4
- interface ScalarKit {
3
+ /**
4
+ * Operations for scalar types like strings, numerics, booleans, dates, etc.
5
+ * @experimental
6
+ */
7
+ export interface ScalarKit {
8
+ /**
9
+ * Check if `type` is any scalar type.
10
+ *
11
+ * @param type The type to check.
12
+ */
13
+ is(type: Type): type is Scalar;
14
+ /**
15
+ * Check if `type` is exactly the standard boolean type.
16
+ *
17
+ * @param type The type to check.
18
+ */
19
+ isBoolean(type: Type): type is Scalar;
20
+ /**
21
+ * Check if `type` is exactly the standard bytes type.
22
+ *
23
+ * @param type The type to check.
24
+ */
25
+ isBytes(type: Type): type is Scalar;
26
+ /**
27
+ * Check if `type` is exactly the standard decimal type.
28
+ *
29
+ * @param type The type to check.
30
+ */
31
+ isDecimal(type: Type): type is Scalar;
32
+ /**
33
+ * Check if `type` is exactly the standard decimal128 type.
34
+ *
35
+ * @param type The type to check.
36
+ */
37
+ isDecimal128(type: Type): type is Scalar;
38
+ /**
39
+ * Check if `type` is exactly the standard duration type.
40
+ *
41
+ * @param type The type to check.
42
+ */
43
+ isDuration(type: Type): type is Scalar;
44
+ /**
45
+ * Check if `type` is exactly the standard float type.
46
+ *
47
+ * @param type The type to check.
48
+ */
49
+ isFloat(type: Type): type is Scalar;
50
+ /**
51
+ * Check if `type` is exactly the standard float32 type.
52
+ *
53
+ * @param type The type to check.
54
+ */
55
+ isFloat32(type: Type): type is Scalar;
56
+ /**
57
+ * Check if `type` is exactly the standard float64 type.
58
+ *
59
+ * @param type The type to check.
60
+ */
61
+ isFloat64(type: Type): type is Scalar;
62
+ /**
63
+ * Check if `type` is exactly the standard int8 type.
64
+ *
65
+ * @param type The type to check.
66
+ */
67
+ isInt8(type: Type): type is Scalar;
68
+ /**
69
+ * Check if `type` is exactly the standard int16 type.
70
+ *
71
+ * @param type The type to check.
72
+ */
73
+ isInt16(type: Type): type is Scalar;
74
+ /**
75
+ * Check if `type` is exactly the standard int32 type.
76
+ *
77
+ * @param type The type to check.
78
+ */
79
+ isInt32(type: Type): type is Scalar;
80
+ /**
81
+ * Check if `type` is exactly the standard int64 type.
82
+ *
83
+ * @param type The type to check.
84
+ */
85
+ isInt64(type: Type): type is Scalar;
86
+ /**
87
+ * Check if `type` is exactly the standard integer type.
88
+ *
89
+ * @param type The type to check.
90
+ */
91
+ isInteger(type: Type): type is Scalar;
92
+ /**
93
+ * Check if `type` is exactly the standard offsetDateTime type.
94
+ *
95
+ * @param type The type to check.
96
+ */
97
+ isOffsetDateTime(type: Type): type is Scalar;
98
+ /**
99
+ * Check if `type` is exactly the standard plainDate type.
100
+ *
101
+ * @param type The type to check.
102
+ */
103
+ isPlainDate(type: Type): type is Scalar;
104
+ /**
105
+ * Check if `type` is exactly the standard plainTime type.
106
+ *
107
+ * @param type The type to check.
108
+ */
109
+ isPlainTime(type: Type): type is Scalar;
110
+ /**
111
+ * Check if `type` is exactly the standard safeint type.
112
+ *
113
+ * @param type The type to check.
114
+ */
115
+ isSafeint(type: Type): type is Scalar;
116
+ /**
117
+ * Check if `type` is exactly the standard uint8 type.
118
+ *
119
+ * @param type The type to check.
120
+ */
121
+ isUint8(type: Type): type is Scalar;
122
+ /**
123
+ * Check if `type` is exactly the standard uint16 type.
124
+ *
125
+ * @param type The type to check.
126
+ */
127
+ isUint16(type: Type): type is Scalar;
128
+ /**
129
+ * Check if `type` is exactly the standard uint32 type.
130
+ *
131
+ * @param type The type to check.
132
+ */
133
+ isUint32(type: Type): type is Scalar;
134
+ /**
135
+ * Check if `type` is exactly the standard uint64 type.
136
+ *
137
+ * @param type The type to check.
138
+ */
139
+ isUint64(type: Type): type is Scalar;
140
+ /**
141
+ * Check if `type` is exactly the standard url type.
142
+ *
143
+ * @param type The type to check.
144
+ */
145
+ isUrl(type: Type): type is Scalar;
146
+ /**
147
+ * Check if `type` is exactly the standard utcDateTime type.
148
+ *
149
+ * @param type The type to check.
150
+ */
151
+ isUtcDateTime(type: Type): type is Scalar;
152
+ /**
153
+ *
154
+ * @param type The type to check.
155
+ */
156
+ isNumeric(type: Type): type is Scalar;
157
+ /**
158
+ * Check if `type` is exactly the standard string type.
159
+ *
160
+ * @param type The type to check.
161
+ */
162
+ isString(type: Type): type is Scalar;
163
+ /**
164
+ * Check if `type` extends the standard boolean type.
165
+ *
166
+ * @param type The type to check.
167
+ */
168
+ extendsBoolean(type: Type): type is Scalar;
169
+ /**
170
+ * Check if `type` extends the standard string type.
171
+ *
172
+ * @param type The type to check.
173
+ */
174
+ extendsString(type: Type): type is Scalar;
175
+ /**
176
+ * Check if `type` extends the standard numeric type.
177
+ *
178
+ * @param type The type to check.
179
+ */
180
+ extendsNumeric(type: Type): type is Scalar;
181
+ /**
182
+ * Check if `type` extends the standard bytes type.
183
+ *
184
+ * @param type The type to check.
185
+ */
186
+ extendsBytes(type: Type): type is Scalar;
187
+ /**
188
+ * Check if `type` extends the standard decimal type.
189
+ *
190
+ * @param type The type to check.
191
+ */
192
+ extendsDecimal(type: Type): type is Scalar;
193
+ /**
194
+ * Check if `type` extends the standard decimal128 type.
195
+ *
196
+ * @param type The type to check.
197
+ */
198
+ extendsDecimal128(type: Type): type is Scalar;
199
+ /**
200
+ * Check if `type` extends the standard duration type.
201
+ *
202
+ * @param type The type to check.
203
+ */
204
+ extendsDuration(type: Type): type is Scalar;
205
+ /**
206
+ * Check if `type` extends the standard float type.
207
+ *
208
+ * @param type The type to check.
209
+ */
210
+ extendsFloat(type: Type): type is Scalar;
211
+ /**
212
+ * Check if `type` extends the standard float32 type.
213
+ *
214
+ * @param type The type to check.
215
+ */
216
+ extendsFloat32(type: Type): type is Scalar;
217
+ /**
218
+ * Check if `type` extends the standard float64 type.
219
+ *
220
+ * @param type The type to check.
221
+ */
222
+ extendsFloat64(type: Type): type is Scalar;
223
+ /**
224
+ * Check if `type` extends the standard int8 type.
225
+ *
226
+ * @param type The type to check.
227
+ */
228
+ extendsInt8(type: Type): type is Scalar;
229
+ /**
230
+ * Check if `type` extends the standard int16 type.
231
+ *
232
+ * @param type The type to check.
233
+ */
234
+ extendsInt16(type: Type): type is Scalar;
235
+ /**
236
+ * Check if `type` extends the standard int32 type.
237
+ *
238
+ * @param type The type to check.
239
+ */
240
+ extendsInt32(type: Type): type is Scalar;
241
+ /**
242
+ * Check if `type` extends the standard int64 type.
243
+ *
244
+ * @param type The type to check.
245
+ */
246
+ extendsInt64(type: Type): type is Scalar;
247
+ /**
248
+ * Check if `type` extends the standard integer type.
249
+ *
250
+ * @param type The type to check.
251
+ */
252
+ extendsInteger(type: Type): type is Scalar;
253
+ /**
254
+ * Check if `type` extends the standard offsetDateTime type.
255
+ *
256
+ * @param type The type to check.
257
+ */
258
+ extendsOffsetDateTime(type: Type): type is Scalar;
259
+ /**
260
+ * Check if `type` extends the standard plainDate type.
261
+ *
262
+ * @param type The type to check.
263
+ */
264
+ extendsPlainDate(type: Type): type is Scalar;
265
+ /**
266
+ * Check if `type` extends the standard plainTime type.
267
+ *
268
+ * @param type The type to check.
269
+ */
270
+ extendsPlainTime(type: Type): type is Scalar;
271
+ /**
272
+ * Check if `type` extends the standard safeint type.
273
+ *
274
+ * @param type The type to check.
275
+ */
276
+ extendsSafeint(type: Type): type is Scalar;
277
+ /**
278
+ * Check if `type` extends the standard uint8 type.
279
+ *
280
+ * @param type The type to check.
281
+ */
282
+ extendsUint8(type: Type): type is Scalar;
283
+ /**
284
+ * Check if `type` extends the standard uint16 type.
285
+ *
286
+ * @param type The type to check.
287
+ */
288
+ extendsUint16(type: Type): type is Scalar;
289
+ /**
290
+ * Check if `type` extends the standard uint32 type.
291
+ *
292
+ * @param type The type to check.
293
+ */
294
+ extendsUint32(type: Type): type is Scalar;
295
+ /**
296
+ * Check if `type` extends the standard uint64 type.
297
+ *
298
+ * @param type The type to check.
299
+ */
300
+ extendsUint64(type: Type): type is Scalar;
301
+ /**
302
+ * Check if `type` extends the standard url type.
303
+ *
304
+ * @param type The type to check.
305
+ */
306
+ extendsUrl(type: Type): type is Scalar;
307
+ /**
308
+ * Check if `type` extends the standard utcDateTime type.
309
+ *
310
+ * @param type The type to check.
311
+ */
312
+ extendsUtcDateTime(type: Type): type is Scalar;
313
+ /**
314
+ * Get the standard built-in base type of a scalar. For all built-in scalar
315
+ * types (numeric, string, int32, etc.) this will just return the scalar
316
+ * type. For user-defined scalars, this will return the first base scalar
317
+ * that is built-in. For user-defined scalars without a standard base type,
318
+ * this will return null.
319
+ *
320
+ * @param type The scalar to check.
321
+ */
322
+ getStdBase(type: Scalar): Scalar | null;
323
+ /**
324
+ * Get the encoding information for a scalar type. Returns undefined if no
325
+ * encoding data is specified.
326
+ *
327
+ * Note: This will return the encoding data for the scalar type itself, not
328
+ * the model property that uses the scalar type. If this scalar might be
329
+ * referenced from a model property, use {@link modelProperty.getEncoding}
330
+ * instead.
331
+ *
332
+ * @param scalar The scalar to get the encoding data for.
333
+ */
334
+ getEncoding(scalar: Scalar): EncodeData | undefined;
335
+ /**
336
+ * Get the well-known format for a string scalar. Returns undefined if no
337
+ * format is specified.
338
+ *
339
+ * Note: This will return the format data for the scalar type itself, not
340
+ * the model property that uses the scalar type. If this scalar might be
341
+ * referenced from a model property, use {@link ModelPropertyKit.getEncoding}
342
+ * instead.
343
+ *
344
+ * @param scalar The scalar to get the format for.
345
+ */
346
+ getFormat(scalar: Scalar): string | undefined;
347
+ }
348
+ interface TypekitExtension {
5
349
  /**
6
350
  * Operations for scalar types like strings, numerics, booleans, dates, etc.
351
+ * @experimental
7
352
  */
8
- scalar: {
9
- /**
10
- * Check if `type` is any scalar type.
11
- *
12
- * @param type The type to check.
13
- */
14
- is(type: Type): type is Scalar;
15
- /**
16
- * Check if `type` is exactly the standard boolean type.
17
- *
18
- * @param type The type to check.
19
- */
20
- isBoolean(type: Type): type is Scalar;
21
- /**
22
- * Check if `type` is exactly the standard bytes type.
23
- *
24
- * @param type The type to check.
25
- */
26
- isBytes(type: Type): type is Scalar;
27
- /**
28
- * Check if `type` is exactly the standard decimal type.
29
- *
30
- * @param type The type to check.
31
- */
32
- isDecimal(type: Type): type is Scalar;
33
- /**
34
- * Check if `type` is exactly the standard decimal128 type.
35
- *
36
- * @param type The type to check.
37
- */
38
- isDecimal128(type: Type): type is Scalar;
39
- /**
40
- * Check if `type` is exactly the standard duration type.
41
- *
42
- * @param type The type to check.
43
- */
44
- isDuration(type: Type): type is Scalar;
45
- /**
46
- * Check if `type` is exactly the standard float type.
47
- *
48
- * @param type The type to check.
49
- */
50
- isFloat(type: Type): type is Scalar;
51
- /**
52
- * Check if `type` is exactly the standard float32 type.
53
- *
54
- * @param type The type to check.
55
- */
56
- isFloat32(type: Type): type is Scalar;
57
- /**
58
- * Check if `type` is exactly the standard float64 type.
59
- *
60
- * @param type The type to check.
61
- */
62
- isFloat64(type: Type): type is Scalar;
63
- /**
64
- * Check if `type` is exactly the standard int8 type.
65
- *
66
- * @param type The type to check.
67
- */
68
- isInt8(type: Type): type is Scalar;
69
- /**
70
- * Check if `type` is exactly the standard int16 type.
71
- *
72
- * @param type The type to check.
73
- */
74
- isInt16(type: Type): type is Scalar;
75
- /**
76
- * Check if `type` is exactly the standard int32 type.
77
- *
78
- * @param type The type to check.
79
- */
80
- isInt32(type: Type): type is Scalar;
81
- /**
82
- * Check if `type` is exactly the standard int64 type.
83
- *
84
- * @param type The type to check.
85
- */
86
- isInt64(type: Type): type is Scalar;
87
- /**
88
- * Check if `type` is exactly the standard integer type.
89
- *
90
- * @param type The type to check.
91
- */
92
- isInteger(type: Type): type is Scalar;
93
- /**
94
- * Check if `type` is exactly the standard offsetDateTime type.
95
- *
96
- * @param type The type to check.
97
- */
98
- isOffsetDateTime(type: Type): type is Scalar;
99
- /**
100
- * Check if `type` is exactly the standard plainDate type.
101
- *
102
- * @param type The type to check.
103
- */
104
- isPlainDate(type: Type): type is Scalar;
105
- /**
106
- * Check if `type` is exactly the standard plainTime type.
107
- *
108
- * @param type The type to check.
109
- */
110
- isPlainTime(type: Type): type is Scalar;
111
- /**
112
- * Check if `type` is exactly the standard safeint type.
113
- *
114
- * @param type The type to check.
115
- */
116
- isSafeint(type: Type): type is Scalar;
117
- /**
118
- * Check if `type` is exactly the standard uint8 type.
119
- *
120
- * @param type The type to check.
121
- */
122
- isUint8(type: Type): type is Scalar;
123
- /**
124
- * Check if `type` is exactly the standard uint16 type.
125
- *
126
- * @param type The type to check.
127
- */
128
- isUint16(type: Type): type is Scalar;
129
- /**
130
- * Check if `type` is exactly the standard uint32 type.
131
- *
132
- * @param type The type to check.
133
- */
134
- isUint32(type: Type): type is Scalar;
135
- /**
136
- * Check if `type` is exactly the standard uint64 type.
137
- *
138
- * @param type The type to check.
139
- */
140
- isUint64(type: Type): type is Scalar;
141
- /**
142
- * Check if `type` is exactly the standard url type.
143
- *
144
- * @param type The type to check.
145
- */
146
- isUrl(type: Type): type is Scalar;
147
- /**
148
- * Check if `type` is exactly the standard utcDateTime type.
149
- *
150
- * @param type The type to check.
151
- */
152
- isUtcDateTime(type: Type): type is Scalar;
153
- /**
154
- *
155
- * @param type The type to check.
156
- */
157
- isNumeric(type: Type): type is Scalar;
158
- /**
159
- * Check if `type` is exactly the standard string type.
160
- *
161
- * @param type The type to check.
162
- */
163
- isString(type: Type): type is Scalar;
164
- /**
165
- * Check if `type` extends the standard boolean type.
166
- *
167
- * @param type The type to check.
168
- */
169
- extendsBoolean(type: Type): type is Scalar;
170
- /**
171
- * Check if `type` extends the standard string type.
172
- *
173
- * @param type The type to check.
174
- */
175
- extendsString(type: Type): type is Scalar;
176
- /**
177
- * Check if `type` extends the standard numeric type.
178
- *
179
- * @param type The type to check.
180
- */
181
- extendsNumeric(type: Type): type is Scalar;
182
- /**
183
- * Check if `type` extends the standard bytes type.
184
- *
185
- * @param type The type to check.
186
- */
187
- extendsBytes(type: Type): type is Scalar;
188
- /**
189
- * Check if `type` extends the standard decimal type.
190
- *
191
- * @param type The type to check.
192
- */
193
- extendsDecimal(type: Type): type is Scalar;
194
- /**
195
- * Check if `type` extends the standard decimal128 type.
196
- *
197
- * @param type The type to check.
198
- */
199
- extendsDecimal128(type: Type): type is Scalar;
200
- /**
201
- * Check if `type` extends the standard duration type.
202
- *
203
- * @param type The type to check.
204
- */
205
- extendsDuration(type: Type): type is Scalar;
206
- /**
207
- * Check if `type` extends the standard float type.
208
- *
209
- * @param type The type to check.
210
- */
211
- extendsFloat(type: Type): type is Scalar;
212
- /**
213
- * Check if `type` extends the standard float32 type.
214
- *
215
- * @param type The type to check.
216
- */
217
- extendsFloat32(type: Type): type is Scalar;
218
- /**
219
- * Check if `type` extends the standard float64 type.
220
- *
221
- * @param type The type to check.
222
- */
223
- extendsFloat64(type: Type): type is Scalar;
224
- /**
225
- * Check if `type` extends the standard int8 type.
226
- *
227
- * @param type The type to check.
228
- */
229
- extendsInt8(type: Type): type is Scalar;
230
- /**
231
- * Check if `type` extends the standard int16 type.
232
- *
233
- * @param type The type to check.
234
- */
235
- extendsInt16(type: Type): type is Scalar;
236
- /**
237
- * Check if `type` extends the standard int32 type.
238
- *
239
- * @param type The type to check.
240
- */
241
- extendsInt32(type: Type): type is Scalar;
242
- /**
243
- * Check if `type` extends the standard int64 type.
244
- *
245
- * @param type The type to check.
246
- */
247
- extendsInt64(type: Type): type is Scalar;
248
- /**
249
- * Check if `type` extends the standard integer type.
250
- *
251
- * @param type The type to check.
252
- */
253
- extendsInteger(type: Type): type is Scalar;
254
- /**
255
- * Check if `type` extends the standard offsetDateTime type.
256
- *
257
- * @param type The type to check.
258
- */
259
- extendsOffsetDateTime(type: Type): type is Scalar;
260
- /**
261
- * Check if `type` extends the standard plainDate type.
262
- *
263
- * @param type The type to check.
264
- */
265
- extendsPlainDate(type: Type): type is Scalar;
266
- /**
267
- * Check if `type` extends the standard plainTime type.
268
- *
269
- * @param type The type to check.
270
- */
271
- extendsPlainTime(type: Type): type is Scalar;
272
- /**
273
- * Check if `type` extends the standard safeint type.
274
- *
275
- * @param type The type to check.
276
- */
277
- extendsSafeint(type: Type): type is Scalar;
278
- /**
279
- * Check if `type` extends the standard uint8 type.
280
- *
281
- * @param type The type to check.
282
- */
283
- extendsUint8(type: Type): type is Scalar;
284
- /**
285
- * Check if `type` extends the standard uint16 type.
286
- *
287
- * @param type The type to check.
288
- */
289
- extendsUint16(type: Type): type is Scalar;
290
- /**
291
- * Check if `type` extends the standard uint32 type.
292
- *
293
- * @param type The type to check.
294
- */
295
- extendsUint32(type: Type): type is Scalar;
296
- /**
297
- * Check if `type` extends the standard uint64 type.
298
- *
299
- * @param type The type to check.
300
- */
301
- extendsUint64(type: Type): type is Scalar;
302
- /**
303
- * Check if `type` extends the standard url type.
304
- *
305
- * @param type The type to check.
306
- */
307
- extendsUrl(type: Type): type is Scalar;
308
- /**
309
- * Check if `type` extends the standard utcDateTime type.
310
- *
311
- * @param type The type to check.
312
- */
313
- extendsUtcDateTime(type: Type): type is Scalar;
314
- /**
315
- * Get the standard built-in base type of a scalar. For all built-in scalar
316
- * types (numeric, string, int32, etc.) this will just return the scalar
317
- * type. For user-defined scalars, this will return the first base scalar
318
- * that is built-in. For user-defined scalars without a standard base type,
319
- * this will return null.
320
- *
321
- * @param type The scalar to check.
322
- */
323
- getStdBase(type: Scalar): Scalar | null;
324
- /**
325
- * Get the encoding information for a scalar type. Returns undefined if no
326
- * encoding data is specified.
327
- *
328
- * Note: This will return the encoding data for the scalar type itself, not
329
- * the model property that uses the scalar type. If this scalar might be
330
- * referenced from a model property, use {@link modelProperty.getEncoding}
331
- * instead.
332
- *
333
- * @param scalar The scalar to get the encoding data for.
334
- */
335
- getEncoding(scalar: Scalar): EncodeData | undefined;
336
- /**
337
- * Get the well-known format for a string scalar. Returns undefined if no
338
- * format is specified.
339
- *
340
- * Note: This will return the format data for the scalar type itself, not
341
- * the model property that uses the scalar type. If this scalar might be
342
- * referenced from a model property, use {@link ModelPropertyKit.getEncoding}
343
- * instead.
344
- *
345
- * @param scalar The scalar to get the format for.
346
- */
347
- getFormat(scalar: Scalar): string | undefined;
348
- };
353
+ scalar: ScalarKit;
349
354
  }
350
355
  declare module "../define-kit.js" {
351
- interface Typekit extends ScalarKit {
356
+ interface Typekit extends TypekitExtension {
352
357
  }
353
358
  }
354
359
  export {};