@typespec/compiler 0.56.0-dev.12 → 0.56.0-dev.13

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.
@@ -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
  namespace TypeSpec;
2
5
 
3
6
  /**
@@ -122,20 +125,6 @@ scalar duration;
122
125
  */
123
126
  scalar boolean;
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
- scalar unixTimestamp32 extends utcDateTime;
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
- model object {}
138
-
139
128
  /**
140
129
  * @dev Array model type, equivalent to `Element[]`
141
130
  * @template Element The type of the array elements
@@ -149,64 +138,3 @@ model Array<Element> {}
149
138
  */
150
139
  @indexer(string, Element)
151
140
  model Record<Element> {}
152
-
153
- /**
154
- * Represent a URL string as described by https://url.spec.whatwg.org/
155
- */
156
- scalar url extends string;
157
-
158
- /**
159
- * Represents a collection of optional properties.
160
- *
161
- * @template Source An object whose spread properties are all optional.
162
- */
163
- @doc("The template for adding optional properties.")
164
- @withOptionalProperties
165
- model OptionalProperties<Source> {
166
- ...Source;
167
- }
168
-
169
- /**
170
- * Represents a collection of updateable properties.
171
- *
172
- * @template Source An object whose spread properties are all updateable.
173
- */
174
- @doc("The template for adding updateable properties.")
175
- @withUpdateableProperties
176
- model UpdateableProperties<Source> {
177
- ...Source;
178
- }
179
-
180
- /**
181
- * Represents a collection of omitted properties.
182
- *
183
- * @template Source An object whose properties are spread.
184
- * @template Keys The property keys to omit.
185
- */
186
- @doc("The template for omitting properties.")
187
- @withoutOmittedProperties(Keys)
188
- model OmitProperties<Source, Keys extends string> {
189
- ...Source;
190
- }
191
-
192
- /**
193
- * Represents a collection of properties with default values omitted.
194
- *
195
- * @template Source An object whose spread property defaults are all omitted.
196
- */
197
- @withoutDefaultValues
198
- model OmitDefaults<Source> {
199
- ...Source;
200
- }
201
-
202
- /**
203
- * Applies a visibility setting to a collection of properties.
204
- *
205
- * @template Source An object whose properties are spread.
206
- * @template Visibility The visibility to apply to all properties.
207
- */
208
- @doc("The template for setting the default visibility of key properties.")
209
- @withDefaultKeyVisibility(Visibility)
210
- model DefaultKeyVisibility<Source, Visibility extends valueof string> {
211
- ...Source;
212
- }
@@ -1,4 +1,4 @@
1
- import "../dist/src/lib/decorators.js";
1
+ import "../../dist/src/lib/decorators.js";
2
2
 
3
3
  using TypeSpec.Reflection;
4
4
 
@@ -0,0 +1,5 @@
1
+ // TypeSpec standard library. Everything in here can be omitted by using `--nostdlib` cli flag or `nostdlib` in the config.
2
+ import "./types.tsp";
3
+ import "./decorators.tsp";
4
+ import "./reflection.tsp";
5
+ import "./projected-names.tsp";
@@ -0,0 +1,76 @@
1
+ namespace TypeSpec;
2
+
3
+ /**
4
+ * 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
+ scalar unixTimestamp32 extends utcDateTime;
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
+ model object {}
16
+
17
+ /**
18
+ * Represent a URL string as described by https://url.spec.whatwg.org/
19
+ */
20
+ scalar url extends string;
21
+
22
+ /**
23
+ * Represents a collection of optional properties.
24
+ *
25
+ * @template Source An object whose spread properties are all optional.
26
+ */
27
+ @doc("The template for adding optional properties.")
28
+ @withOptionalProperties
29
+ model OptionalProperties<Source> {
30
+ ...Source;
31
+ }
32
+
33
+ /**
34
+ * Represents a collection of updateable properties.
35
+ *
36
+ * @template Source An object whose spread properties are all updateable.
37
+ */
38
+ @doc("The template for adding updateable properties.")
39
+ @withUpdateableProperties
40
+ model UpdateableProperties<Source> {
41
+ ...Source;
42
+ }
43
+
44
+ /**
45
+ * Represents a collection of omitted properties.
46
+ *
47
+ * @template Source An object whose properties are spread.
48
+ * @template Keys The property keys to omit.
49
+ */
50
+ @doc("The template for omitting properties.")
51
+ @withoutOmittedProperties(Keys)
52
+ model OmitProperties<Source, Keys extends string> {
53
+ ...Source;
54
+ }
55
+
56
+ /**
57
+ * Represents a collection of properties with default values omitted.
58
+ *
59
+ * @template Source An object whose spread property defaults are all omitted.
60
+ */
61
+ @withoutDefaultValues
62
+ model OmitDefaults<Source> {
63
+ ...Source;
64
+ }
65
+
66
+ /**
67
+ * Applies a visibility setting to a collection of properties.
68
+ *
69
+ * @template Source An object whose properties are spread.
70
+ * @template Visibility The visibility to apply to all properties.
71
+ */
72
+ @doc("The template for setting the default visibility of key properties.")
73
+ @withDefaultKeyVisibility(Visibility)
74
+ model DefaultKeyVisibility<Source, Visibility extends valueof string> {
75
+ ...Source;
76
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/compiler",
3
- "version": "0.56.0-dev.12",
3
+ "version": "0.56.0-dev.13",
4
4
  "description": "TypeSpec Compiler Preview",
5
5
  "author": "Microsoft Corporation",
6
6
  "license": "MIT",
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "type": "module",
21
21
  "main": "dist/src/index.js",
22
- "tspMain": "lib/main.tsp",
22
+ "tspMain": "lib/std/main.tsp",
23
23
  "exports": {
24
24
  ".": {
25
25
  "types": "./dist/src/index.d.ts",
@@ -54,7 +54,7 @@
54
54
  "tsp-server": "cmd/tsp-server.js"
55
55
  },
56
56
  "files": [
57
- "lib/*.tsp",
57
+ "lib/**/*.tsp",
58
58
  "dist/**",
59
59
  "templates/**",
60
60
  "entrypoints",
package/lib/main.tsp DELETED
@@ -1,4 +0,0 @@
1
- import "./lib.tsp";
2
- import "./decorators.tsp";
3
- import "./reflection.tsp";
4
- import "./projected-names.tsp";
File without changes