@typespec/compiler 0.52.0-dev.1 → 0.52.0-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.
- package/dist/manifest.js +2 -2
- package/lib/decorators.tsp +3 -3
- package/lib/lib.tsp +30 -25
- package/package.json +1 -1
package/dist/manifest.js
CHANGED
package/lib/decorators.tsp
CHANGED
|
@@ -69,7 +69,7 @@ extern dec errorsDoc(target: Operation, doc: valueof string);
|
|
|
69
69
|
*
|
|
70
70
|
* ```typespec
|
|
71
71
|
* #deprecated "Use ActionV2"
|
|
72
|
-
* op Action<
|
|
72
|
+
* op Action<Result>(): Result;
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
75
|
#deprecated "@deprecated decorator is deprecated. Use the `#deprecated` directive instead."
|
|
@@ -288,8 +288,8 @@ extern dec tag(target: Namespace | Interface | Operation, tag: valueof string);
|
|
|
288
288
|
* @example
|
|
289
289
|
* ```typespec
|
|
290
290
|
* @friendlyName("{name}List", T)
|
|
291
|
-
* model List<
|
|
292
|
-
* value:
|
|
291
|
+
* model List<Item> {
|
|
292
|
+
* value: Item[];
|
|
293
293
|
* nextLink: string;
|
|
294
294
|
* }
|
|
295
295
|
* ```
|
package/lib/lib.tsp
CHANGED
|
@@ -138,18 +138,18 @@ scalar unixTimestamp32 extends utcDateTime;
|
|
|
138
138
|
model object {}
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
|
-
* @dev Array model type, equivalent to `
|
|
142
|
-
* @template
|
|
141
|
+
* @dev Array model type, equivalent to `Element[]`
|
|
142
|
+
* @template Element The type of the array elements
|
|
143
143
|
*/
|
|
144
|
-
@indexer(integer,
|
|
145
|
-
model Array<
|
|
144
|
+
@indexer(integer, Element)
|
|
145
|
+
model Array<Element> {}
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
|
-
* @dev Model with string properties where all the properties have type `
|
|
149
|
-
* @template
|
|
148
|
+
* @dev Model with string properties where all the properties have type `Property`
|
|
149
|
+
* @template Element The type of the properties
|
|
150
150
|
*/
|
|
151
|
-
@indexer(string,
|
|
152
|
-
model Record<
|
|
151
|
+
@indexer(string, Element)
|
|
152
|
+
model Record<Element> {}
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
155
|
* Represent a URL string as described by https://url.spec.whatwg.org/
|
|
@@ -158,51 +158,56 @@ scalar url extends string;
|
|
|
158
158
|
|
|
159
159
|
/**
|
|
160
160
|
* Represents a collection of optional properties.
|
|
161
|
-
*
|
|
161
|
+
*
|
|
162
|
+
* @template Source An object whose spread properties are all optional.
|
|
162
163
|
*/
|
|
163
164
|
@doc("The template for adding optional properties.")
|
|
164
165
|
@withOptionalProperties
|
|
165
|
-
model OptionalProperties<
|
|
166
|
-
...
|
|
166
|
+
model OptionalProperties<Source> {
|
|
167
|
+
...Source;
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
/**
|
|
170
171
|
* Represents a collection of updateable properties.
|
|
171
|
-
*
|
|
172
|
+
*
|
|
173
|
+
* @template Source An object whose spread properties are all updateable.
|
|
172
174
|
*/
|
|
173
175
|
@doc("The template for adding updateable properties.")
|
|
174
176
|
@withUpdateableProperties
|
|
175
|
-
model UpdateableProperties<
|
|
176
|
-
...
|
|
177
|
+
model UpdateableProperties<Source> {
|
|
178
|
+
...Source;
|
|
177
179
|
}
|
|
178
180
|
|
|
179
181
|
/**
|
|
180
182
|
* Represents a collection of omitted properties.
|
|
181
|
-
*
|
|
182
|
-
* @template
|
|
183
|
+
*
|
|
184
|
+
* @template Source An object whose properties are spread.
|
|
185
|
+
* @template Keys The property keys to omit.
|
|
183
186
|
*/
|
|
184
187
|
@doc("The template for omitting properties.")
|
|
185
|
-
@withoutOmittedProperties(
|
|
186
|
-
model OmitProperties<
|
|
187
|
-
...
|
|
188
|
+
@withoutOmittedProperties(Keys)
|
|
189
|
+
model OmitProperties<Source, Keys extends string> {
|
|
190
|
+
...Source;
|
|
188
191
|
}
|
|
189
192
|
|
|
190
193
|
/**
|
|
191
194
|
* Represents a collection of properties with default values omitted.
|
|
192
|
-
*
|
|
195
|
+
*
|
|
196
|
+
* @template Source An object whose spread property defaults are all omitted.
|
|
193
197
|
*/
|
|
194
198
|
@withoutDefaultValues
|
|
195
|
-
model OmitDefaults<
|
|
196
|
-
...
|
|
199
|
+
model OmitDefaults<Source> {
|
|
200
|
+
...Source;
|
|
197
201
|
}
|
|
198
202
|
|
|
199
203
|
/**
|
|
200
204
|
* Applies a visibility setting to a collection of properties.
|
|
201
|
-
*
|
|
205
|
+
*
|
|
206
|
+
* @template Source An object whose properties are spread.
|
|
202
207
|
* @template Visibility The visibility to apply to all properties.
|
|
203
208
|
*/
|
|
204
209
|
@doc("The template for setting the default visibility of key properties.")
|
|
205
210
|
@withDefaultKeyVisibility(Visibility)
|
|
206
|
-
model DefaultKeyVisibility<
|
|
207
|
-
...
|
|
211
|
+
model DefaultKeyVisibility<Source, Visibility extends valueof string> {
|
|
212
|
+
...Source;
|
|
208
213
|
}
|