You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fixmicrosoft#3171
Currently the `--nostdlib` option is just useless, here splitting the
intrinsic types from the rest of the std lib.
Intrinsic types will always be loaded regardless of what `nostdlib`
says.
Being able to disable that can be useful in the compiler test to not be
polluted by some extra elements.
Copy file name to clipboardexpand all lines: packages/compiler/lib/intrinsics.tsp
+3-75
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,6 @@
1
+
import"../dist/src/lib/intrinsic-decorators.js";
2
+
3
+
// This file contains all the intrinsic types of typespec. Everything here will always be loaded
1
4
namespaceTypeSpec;
2
5
3
6
/**
@@ -122,20 +125,6 @@ scalar duration;
122
125
*/
123
126
scalarboolean;
124
127
125
-
/**
126
-
* Represent a 32-bit unix timestamp datetime with 1s of granularity.
127
-
* It measures time by the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970.
128
-
*/
129
-
@encode("unixTimestamp", int32)
130
-
scalarunixTimestamp32extendsutcDateTime;
131
-
132
-
/**
133
-
* Represent a model
134
-
*/
135
-
// Deprecated June 2023 sprint
136
-
#deprecated"object is deprecated. Please use {} for an empty model, `Record<unknown>` for a record with unknown property types, `unknown[]` for an array."
137
-
modelobject {}
138
-
139
128
/**
140
129
* @dev Array model type, equivalent to `Element[]`
141
130
* @templateElement The type of the array elements
@@ -149,64 +138,3 @@ model Array<Element> {}
149
138
*/
150
139
@indexer(string, Element)
151
140
modelRecord<Element> {}
152
-
153
-
/**
154
-
* Represent a URL string as described by https://url.spec.whatwg.org/
155
-
*/
156
-
scalarurlextendsstring;
157
-
158
-
/**
159
-
* Represents a collection of optional properties.
160
-
*
161
-
* @templateSource An object whose spread properties are all optional.
162
-
*/
163
-
@doc("The template for adding optional properties.")
164
-
@withOptionalProperties
165
-
modelOptionalProperties<Source> {
166
-
...Source;
167
-
}
168
-
169
-
/**
170
-
* Represents a collection of updateable properties.
171
-
*
172
-
* @templateSource An object whose spread properties are all updateable.
173
-
*/
174
-
@doc("The template for adding updateable properties.")
175
-
@withUpdateableProperties
176
-
modelUpdateableProperties<Source> {
177
-
...Source;
178
-
}
179
-
180
-
/**
181
-
* Represents a collection of omitted properties.
182
-
*
183
-
* @templateSource An object whose properties are spread.
184
-
* @templateKeys The property keys to omit.
185
-
*/
186
-
@doc("The template for omitting properties.")
187
-
@withoutOmittedProperties(Keys)
188
-
modelOmitProperties<Source, Keysextendsstring> {
189
-
...Source;
190
-
}
191
-
192
-
/**
193
-
* Represents a collection of properties with default values omitted.
194
-
*
195
-
* @templateSource An object whose spread property defaults are all omitted.
196
-
*/
197
-
@withoutDefaultValues
198
-
modelOmitDefaults<Source> {
199
-
...Source;
200
-
}
201
-
202
-
/**
203
-
* Applies a visibility setting to a collection of properties.
204
-
*
205
-
* @templateSource An object whose properties are spread.
206
-
* @templateVisibility The visibility to apply to all properties.
207
-
*/
208
-
@doc("The template for setting the default visibility of key properties.")
* Represent a 32-bit unix timestamp datetime with 1s of granularity.
5
+
* It measures time by the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970.
6
+
*/
7
+
@encode("unixTimestamp", int32)
8
+
scalarunixTimestamp32extendsutcDateTime;
9
+
10
+
/**
11
+
* Represent a model
12
+
*/
13
+
// Deprecated June 2023 sprint
14
+
#deprecated"object is deprecated. Please use {} for an empty model, `Record<unknown>` for a record with unknown property types, `unknown[]` for an array."
15
+
modelobject {}
16
+
17
+
/**
18
+
* Represent a URL string as described by https://url.spec.whatwg.org/
19
+
*/
20
+
scalarurlextendsstring;
21
+
22
+
/**
23
+
* Represents a collection of optional properties.
24
+
*
25
+
* @templateSource An object whose spread properties are all optional.
26
+
*/
27
+
@doc("The template for adding optional properties.")
28
+
@withOptionalProperties
29
+
modelOptionalProperties<Source> {
30
+
...Source;
31
+
}
32
+
33
+
/**
34
+
* Represents a collection of updateable properties.
35
+
*
36
+
* @templateSource An object whose spread properties are all updateable.
37
+
*/
38
+
@doc("The template for adding updateable properties.")
39
+
@withUpdateableProperties
40
+
modelUpdateableProperties<Source> {
41
+
...Source;
42
+
}
43
+
44
+
/**
45
+
* Represents a collection of omitted properties.
46
+
*
47
+
* @templateSource An object whose properties are spread.
48
+
* @templateKeys The property keys to omit.
49
+
*/
50
+
@doc("The template for omitting properties.")
51
+
@withoutOmittedProperties(Keys)
52
+
modelOmitProperties<Source, Keysextendsstring> {
53
+
...Source;
54
+
}
55
+
56
+
/**
57
+
* Represents a collection of properties with default values omitted.
58
+
*
59
+
* @templateSource An object whose spread property defaults are all omitted.
60
+
*/
61
+
@withoutDefaultValues
62
+
modelOmitDefaults<Source> {
63
+
...Source;
64
+
}
65
+
66
+
/**
67
+
* Applies a visibility setting to a collection of properties.
68
+
*
69
+
* @templateSource An object whose properties are spread.
70
+
* @templateVisibility The visibility to apply to all properties.
71
+
*/
72
+
@doc("The template for setting the default visibility of key properties.")
0 commit comments