@azure-tools/typespec-rust 0.1.0 → 0.3.0
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/src/codegen/cargotoml.d.ts +6 -0
- package/dist/src/codegen/cargotoml.d.ts.map +1 -1
- package/dist/src/codegen/cargotoml.js +6 -1
- package/dist/src/codegen/cargotoml.js.map +1 -1
- package/dist/src/codegen/clients.d.ts +19 -2
- package/dist/src/codegen/clients.d.ts.map +1 -1
- package/dist/src/codegen/clients.js +489 -250
- package/dist/src/codegen/clients.js.map +1 -1
- package/dist/src/codegen/codeGenerator.d.ts +29 -6
- package/dist/src/codegen/codeGenerator.d.ts.map +1 -1
- package/dist/src/codegen/codeGenerator.js +64 -25
- package/dist/src/codegen/codeGenerator.js.map +1 -1
- package/dist/src/codegen/context.d.ts +41 -0
- package/dist/src/codegen/context.d.ts.map +1 -1
- package/dist/src/codegen/context.js +94 -15
- package/dist/src/codegen/context.js.map +1 -1
- package/dist/src/codegen/enums.d.ts +9 -1
- package/dist/src/codegen/enums.d.ts.map +1 -1
- package/dist/src/codegen/enums.js +34 -20
- package/dist/src/codegen/enums.js.map +1 -1
- package/dist/src/codegen/helpers.d.ts +116 -2
- package/dist/src/codegen/helpers.d.ts.map +1 -1
- package/dist/src/codegen/helpers.js +148 -18
- package/dist/src/codegen/helpers.js.map +1 -1
- package/dist/src/codegen/lib.d.ts +7 -1
- package/dist/src/codegen/lib.d.ts.map +1 -1
- package/dist/src/codegen/lib.js +10 -5
- package/dist/src/codegen/lib.js.map +1 -1
- package/dist/src/codegen/mod.d.ts +6 -1
- package/dist/src/codegen/mod.d.ts.map +1 -1
- package/dist/src/codegen/mod.js +9 -10
- package/dist/src/codegen/mod.js.map +1 -1
- package/dist/src/codegen/models.d.ts +20 -1
- package/dist/src/codegen/models.d.ts.map +1 -1
- package/dist/src/codegen/models.js +250 -13
- package/dist/src/codegen/models.js.map +1 -1
- package/dist/src/codegen/use.d.ts +32 -0
- package/dist/src/codegen/use.d.ts.map +1 -1
- package/dist/src/codegen/use.js +42 -15
- package/dist/src/codegen/use.js.map +1 -1
- package/dist/src/codemodel/client.d.ts +150 -11
- package/dist/src/codemodel/client.d.ts.map +1 -1
- package/dist/src/codemodel/client.js +60 -17
- package/dist/src/codemodel/client.js.map +1 -1
- package/dist/src/codemodel/crate.d.ts +33 -0
- package/dist/src/codemodel/crate.d.ts.map +1 -1
- package/dist/src/codemodel/crate.js +17 -0
- package/dist/src/codemodel/crate.js.map +1 -1
- package/dist/src/codemodel/method.d.ts +17 -0
- package/dist/src/codemodel/method.d.ts.map +1 -1
- package/dist/src/codemodel/types.d.ts +152 -24
- package/dist/src/codemodel/types.d.ts.map +1 -1
- package/dist/src/codemodel/types.js +39 -25
- package/dist/src/codemodel/types.js.map +1 -1
- package/dist/src/emitter.d.ts +5 -0
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +36 -23
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/lib.d.ts +2 -0
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +6 -1
- package/dist/src/lib.js.map +1 -1
- package/dist/src/tcgcadapter/adapter.d.ts +73 -1
- package/dist/src/tcgcadapter/adapter.d.ts.map +1 -1
- package/dist/src/tcgcadapter/adapter.js +342 -81
- package/dist/src/tcgcadapter/adapter.js.map +1 -1
- package/dist/src/tcgcadapter/helpers.d.ts +18 -0
- package/dist/src/tcgcadapter/helpers.d.ts.map +1 -1
- package/dist/src/tcgcadapter/helpers.js +23 -2
- package/dist/src/tcgcadapter/helpers.js.map +1 -1
- package/dist/src/tcgcadapter/naming.d.ts +8 -0
- package/dist/src/tcgcadapter/naming.d.ts.map +1 -1
- package/dist/src/tcgcadapter/naming.js +8 -5
- package/dist/src/tcgcadapter/naming.js.map +1 -1
- package/package.json +21 -23
|
@@ -1,23 +1,40 @@
|
|
|
1
1
|
import * as types from './types.js';
|
|
2
|
+
/** Method is a Rust method */
|
|
2
3
|
export interface Method<T> {
|
|
4
|
+
/** the name of the method */
|
|
3
5
|
name: string;
|
|
6
|
+
/** any docs for the method */
|
|
4
7
|
docs: types.Docs;
|
|
8
|
+
/** indicates if the method should be public */
|
|
5
9
|
pub: boolean;
|
|
10
|
+
/** the name of the type on which the method is implemented */
|
|
6
11
|
impl: string;
|
|
12
|
+
/** self contains info about the self param */
|
|
7
13
|
self: Self;
|
|
14
|
+
/** the params passed to the method (excluding self). can be empty */
|
|
8
15
|
params: Array<Parameter>;
|
|
16
|
+
/** the method's return type */
|
|
9
17
|
returns?: T;
|
|
10
18
|
}
|
|
19
|
+
/** Parameter is a Rust function or method parameter */
|
|
11
20
|
export interface Parameter {
|
|
21
|
+
/** the name of the parameter */
|
|
12
22
|
name: string;
|
|
23
|
+
/** any docs for the parameter */
|
|
13
24
|
docs: types.Docs;
|
|
25
|
+
/** the parameter's type */
|
|
14
26
|
type: types.Type;
|
|
27
|
+
/** indicates if the parameter is mutable. defaults to false */
|
|
15
28
|
mut: boolean;
|
|
29
|
+
/** indicates if the parameter is a reference. defaults to false */
|
|
16
30
|
ref: boolean;
|
|
17
31
|
}
|
|
32
|
+
/** Self is a method's self parameter */
|
|
18
33
|
export interface Self {
|
|
19
34
|
name: 'self';
|
|
35
|
+
/** indicates if self is mutable */
|
|
20
36
|
mut: boolean;
|
|
37
|
+
/** indicates if self is a reference */
|
|
21
38
|
ref: boolean;
|
|
22
39
|
}
|
|
23
40
|
export declare class Method<T> implements Method<T> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../src/codemodel/method.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../src/codemodel/method.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,8BAA8B;AAC9B,MAAM,WAAW,MAAM,CA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ate } from './crate.js';
|
|
2
|
+
/** Docs contains the values used in doc comment generation. */
|
|
2
3
|
export interface Docs {
|
|
4
|
+
/** the high level summary */
|
|
3
5
|
summary?: string;
|
|
6
|
+
/** detailed description */
|
|
4
7
|
description?: string;
|
|
5
8
|
}
|
|
6
|
-
|
|
9
|
+
/** Type defines a type within the Rust type system */
|
|
10
|
+
export type Type = Arc | EncodedBytes | Enum | ExternalType | HashMap | ImplTrait | JsonValue | Literal | Model | OffsetDateTime | Option | Pager | RequestContent | Response | Result | Scalar | StringSlice | StringType | Struct | TokenCredential | Unit | Url | Vector;
|
|
11
|
+
/** Arc is a std::sync::Arc<T> */
|
|
7
12
|
export interface Arc extends StdType {
|
|
8
13
|
kind: 'arc';
|
|
14
|
+
/**
|
|
15
|
+
* the generic type param
|
|
16
|
+
* note that not all types are applicable
|
|
17
|
+
*/
|
|
9
18
|
type: Type;
|
|
10
19
|
}
|
|
20
|
+
/** BytesEncoding defines the possible types of base64-encoding. */
|
|
11
21
|
export type BytesEncoding = 'std' | 'url';
|
|
22
|
+
/** EncodedBytes is a Rust Vec<u8> that's base64-encoded. */
|
|
12
23
|
export interface EncodedBytes {
|
|
13
24
|
kind: 'encodedBytes';
|
|
25
|
+
/** indicates what kind of base64-encoding to use */
|
|
14
26
|
encoding: BytesEncoding;
|
|
15
27
|
}
|
|
28
|
+
/** Enum is a Rust enum type. */
|
|
16
29
|
export interface Enum {
|
|
17
30
|
kind: 'enum';
|
|
31
|
+
/** the name of the enum type */
|
|
18
32
|
name: string;
|
|
33
|
+
/** any docs for the type */
|
|
19
34
|
docs: Docs;
|
|
35
|
+
/** indicates if the enum and its values should be public */
|
|
20
36
|
pub: boolean;
|
|
37
|
+
/** one or more values for the enum */
|
|
21
38
|
values: Array<EnumValue>;
|
|
39
|
+
/** indicates if the enum is extensible or not */
|
|
22
40
|
extensible: boolean;
|
|
23
41
|
}
|
|
42
|
+
/** EnumValue is an enum value for a specific Enum */
|
|
24
43
|
export interface EnumValue {
|
|
44
|
+
/** the name of the enum value */
|
|
25
45
|
name: string;
|
|
46
|
+
/** any docs for the value */
|
|
26
47
|
docs: Docs;
|
|
48
|
+
/** the value used in SerDe operations */
|
|
27
49
|
value: number | string;
|
|
28
50
|
}
|
|
51
|
+
/** ExternalType is a type defined in a different crate */
|
|
29
52
|
export interface ExternalType extends External {
|
|
30
53
|
kind: 'external';
|
|
54
|
+
/** indicates if the type includes a lifetime annotation */
|
|
31
55
|
lifetime?: Lifetime;
|
|
32
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* HashMap is a Rust HashMap<K, V>
|
|
59
|
+
* K is always a String
|
|
60
|
+
*/
|
|
33
61
|
export interface HashMap extends StdType {
|
|
34
62
|
kind: 'hashmap';
|
|
63
|
+
/** the V generic type param */
|
|
35
64
|
type: Type;
|
|
36
65
|
}
|
|
66
|
+
/** ImplTrait is the Rust syntax for "a concrete type that implements this trait" */
|
|
37
67
|
export interface ImplTrait {
|
|
38
68
|
kind: 'implTrait';
|
|
69
|
+
/** the name of the trait */
|
|
39
70
|
name: string;
|
|
71
|
+
/** the type on which the trait is implemented */
|
|
40
72
|
type: Type;
|
|
41
73
|
}
|
|
74
|
+
/** JsonValue is a raw JSON value */
|
|
42
75
|
export interface JsonValue extends External {
|
|
43
76
|
kind: 'jsonValue';
|
|
44
77
|
}
|
|
78
|
+
/** Lifetime is a Rust lifetime name. */
|
|
45
79
|
export interface Lifetime {
|
|
46
80
|
name: string;
|
|
47
81
|
}
|
|
82
|
+
/** Literal is a literal value (e.g. a string "foo") */
|
|
48
83
|
export interface Literal {
|
|
49
84
|
kind: 'literal';
|
|
85
|
+
/** the literal's value */
|
|
50
86
|
value: boolean | null | number | string;
|
|
51
87
|
}
|
|
88
|
+
/** Model is a Rust struct that participates in serde */
|
|
52
89
|
export interface Model extends StructBase {
|
|
53
90
|
kind: 'model';
|
|
91
|
+
/** fields contains the fields within the struct */
|
|
54
92
|
fields: Array<ModelField>;
|
|
93
|
+
/**
|
|
94
|
+
* the name of the type over the wire if it's
|
|
95
|
+
* different from the type's name.
|
|
96
|
+
*/
|
|
97
|
+
xmlName?: string;
|
|
55
98
|
}
|
|
99
|
+
/** ModelField is a field definition within a model */
|
|
56
100
|
export interface ModelField extends StructFieldBase {
|
|
101
|
+
/** the name of the field over the wire */
|
|
57
102
|
serde: string;
|
|
103
|
+
/** contains XML-specific serde info */
|
|
104
|
+
xmlKind?: XMLKind;
|
|
58
105
|
}
|
|
106
|
+
/** DateTimeEncoding is the wire format of the date/time */
|
|
59
107
|
export type DateTimeEncoding = 'rfc3339' | 'rfc7231' | 'unixTimestamp';
|
|
108
|
+
/** OffsetDateTime is a Rust time::OffsetDateTime type */
|
|
60
109
|
export interface OffsetDateTime extends External {
|
|
61
110
|
kind: 'offsetDateTime';
|
|
111
|
+
/** the encoding format */
|
|
62
112
|
encoding: DateTimeEncoding;
|
|
63
113
|
}
|
|
114
|
+
/** Option is a Rust Option<T> */
|
|
64
115
|
export interface Option {
|
|
65
116
|
kind: 'option';
|
|
117
|
+
/**
|
|
118
|
+
* the generic type param
|
|
119
|
+
* note that not all types are applicable
|
|
120
|
+
*/
|
|
66
121
|
type: Type;
|
|
67
|
-
ref: boolean;
|
|
68
122
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
123
|
+
/** Pager is a Pager<T> from azure_core */
|
|
124
|
+
export interface Pager extends External {
|
|
125
|
+
kind: 'pager';
|
|
126
|
+
/** the model containing the page of items */
|
|
127
|
+
type: Model;
|
|
128
|
+
/** the wire format of the response body. */
|
|
129
|
+
format: BodyFormat;
|
|
73
130
|
}
|
|
131
|
+
/** RequestContent is a Rust RequestContent<T> from azure_core */
|
|
132
|
+
export interface RequestContent<T extends Type = Type> extends External {
|
|
133
|
+
kind: 'requestContent';
|
|
134
|
+
/**
|
|
135
|
+
* the generic type param
|
|
136
|
+
* note that not all types are applicable
|
|
137
|
+
*/
|
|
138
|
+
type: T;
|
|
139
|
+
/** the wire format of the request body */
|
|
140
|
+
format: BodyFormat;
|
|
141
|
+
}
|
|
142
|
+
/** Response is a Rust Response<T> from azure_core */
|
|
74
143
|
export interface Response extends External {
|
|
75
144
|
kind: 'response';
|
|
145
|
+
/**
|
|
146
|
+
* the generic type param
|
|
147
|
+
* note that not all types are applicable
|
|
148
|
+
*/
|
|
76
149
|
type: Type;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
150
|
+
/**
|
|
151
|
+
* the wire format of the response body.
|
|
152
|
+
* if the response doesn't return a body (i.e. Unit)
|
|
153
|
+
* the format will be undefined.
|
|
154
|
+
*/
|
|
155
|
+
format?: BodyFormat;
|
|
156
|
+
}
|
|
157
|
+
/** Result is a Rust Result<T> from azure_core */
|
|
158
|
+
export interface Result<T = Pager | Response | Unit> extends External {
|
|
80
159
|
kind: 'result';
|
|
81
|
-
type
|
|
160
|
+
/** the generic type param */
|
|
161
|
+
type: T;
|
|
82
162
|
}
|
|
163
|
+
/** ScalarType defines the supported Rust scalar type names */
|
|
83
164
|
export type ScalarType = 'bool' | 'f32' | 'f64' | 'i8' | 'i16' | 'i32' | 'i64';
|
|
165
|
+
/** Scalar is a Rust scalar type */
|
|
84
166
|
export interface Scalar {
|
|
85
167
|
kind: 'scalar';
|
|
168
|
+
/** the type of scalar */
|
|
86
169
|
type: ScalarType;
|
|
87
170
|
}
|
|
88
|
-
|
|
171
|
+
/** BodyFormat indicates the wire format for request and response bodies */
|
|
172
|
+
export type BodyFormat = 'binary' | 'json' | 'xml';
|
|
173
|
+
/** StringSlice is a Rust string slice */
|
|
89
174
|
export interface StringSlice {
|
|
90
175
|
kind: 'str';
|
|
91
176
|
}
|
|
177
|
+
/** StringType is a Rust string */
|
|
92
178
|
export interface StringType {
|
|
93
179
|
kind: 'String';
|
|
94
180
|
}
|
|
181
|
+
/** Struct is a Rust struct type definition */
|
|
95
182
|
export interface Struct extends StructBase {
|
|
96
183
|
kind: 'struct';
|
|
184
|
+
/** fields contains the fields within the struct */
|
|
97
185
|
fields: Array<StructField>;
|
|
98
186
|
}
|
|
187
|
+
/** StructField is a field definition within a struct */
|
|
99
188
|
export interface StructField extends StructFieldBase {
|
|
100
189
|
}
|
|
190
|
+
/** TokenCredential is an azure_core::TokenCredential parameter */
|
|
101
191
|
export interface TokenCredential extends External {
|
|
102
192
|
kind: 'tokenCredential';
|
|
193
|
+
/** the scopes to include for the credential */
|
|
103
194
|
scopes: Array<string>;
|
|
104
195
|
}
|
|
196
|
+
/** Unit is the unit type (i.e. "()") */
|
|
105
197
|
export interface Unit {
|
|
106
198
|
kind: 'unit';
|
|
107
199
|
}
|
|
200
|
+
/** Url is an azure_core::Url type */
|
|
108
201
|
export interface Url extends External {
|
|
109
202
|
kind: 'Url';
|
|
110
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Vector is a Rust Vec<T>
|
|
206
|
+
* since Vec<T> is in the prelude set, it doesn't need to extend StdType
|
|
207
|
+
*/
|
|
111
208
|
export interface Vector {
|
|
112
209
|
kind: 'vector';
|
|
210
|
+
/** the generic type param */
|
|
113
211
|
type: Type;
|
|
114
212
|
}
|
|
213
|
+
/** XMLKind contains info used for generating XML-specific serde */
|
|
214
|
+
export type XMLKind = 'attribute' | 'text' | 'unwrappedList';
|
|
215
|
+
/** External is a type defined in a different crate */
|
|
115
216
|
export interface External {
|
|
217
|
+
/** the crate that defines the type */
|
|
116
218
|
crate: string;
|
|
219
|
+
/** the name of the type */
|
|
117
220
|
name: string;
|
|
221
|
+
/** namespace within the crate where the type is defined (e.g. foo, foo::bar) */
|
|
118
222
|
namespace?: string;
|
|
119
223
|
}
|
|
120
224
|
export declare class External implements External {
|
|
121
225
|
constructor(crate: Crate, crateName: string, typeName: string, namespace?: string);
|
|
122
226
|
}
|
|
227
|
+
/** StdType is a type in the standard library that's not in the prelude set. */
|
|
123
228
|
export interface StdType {
|
|
229
|
+
/** the name of the type */
|
|
124
230
|
name: string;
|
|
231
|
+
/** the using statement to bring it into scope */
|
|
125
232
|
use: string;
|
|
126
233
|
}
|
|
127
234
|
export declare class StdType implements StdType {
|
|
128
235
|
constructor(name: string, use: string);
|
|
129
236
|
}
|
|
237
|
+
/** base type for models and structs */
|
|
130
238
|
interface StructBase {
|
|
131
239
|
kind: 'model' | 'struct';
|
|
240
|
+
/** the name of the struct */
|
|
132
241
|
name: string;
|
|
242
|
+
/** any docs for the type */
|
|
133
243
|
docs: Docs;
|
|
134
|
-
|
|
244
|
+
/** indicates if the struct is only for internal consumption */
|
|
245
|
+
internal: boolean;
|
|
246
|
+
/** fields contains the fields within the struct */
|
|
135
247
|
fields: Array<StructFieldBase>;
|
|
248
|
+
/** indicates if the type includes a lifetime annotation */
|
|
136
249
|
lifetime?: Lifetime;
|
|
137
250
|
}
|
|
251
|
+
/** base type for model and struct fields */
|
|
138
252
|
interface StructFieldBase {
|
|
253
|
+
/** the name of the field */
|
|
139
254
|
name: string;
|
|
255
|
+
/** any docs for the field */
|
|
140
256
|
docs: Docs;
|
|
257
|
+
/** indicates if the field should be public */
|
|
141
258
|
pub: boolean;
|
|
259
|
+
/** the field's underlying type */
|
|
142
260
|
type: Type;
|
|
261
|
+
/** the value to use when emitting a Default impl for the containing struct */
|
|
143
262
|
defaultValue?: string;
|
|
144
263
|
}
|
|
264
|
+
declare class StructBase implements StructBase {
|
|
265
|
+
constructor(kind: 'model' | 'struct', name: string, internal: boolean);
|
|
266
|
+
}
|
|
267
|
+
declare class StructFieldBase implements StructFieldBase {
|
|
268
|
+
constructor(name: string, pub: boolean, type: Type);
|
|
269
|
+
}
|
|
145
270
|
export declare class Arc extends StdType implements Arc {
|
|
146
271
|
constructor(type: Type);
|
|
147
272
|
}
|
|
@@ -172,26 +297,29 @@ export declare class Lifetime implements Lifetime {
|
|
|
172
297
|
export declare class Literal implements Literal {
|
|
173
298
|
constructor(value: boolean | null | number | string);
|
|
174
299
|
}
|
|
175
|
-
export declare class Model implements Model {
|
|
176
|
-
constructor(name: string,
|
|
300
|
+
export declare class Model extends StructBase implements Model {
|
|
301
|
+
constructor(name: string, internal: boolean);
|
|
177
302
|
}
|
|
178
|
-
export declare class ModelField implements ModelField {
|
|
303
|
+
export declare class ModelField extends StructFieldBase implements ModelField {
|
|
179
304
|
constructor(name: string, serde: string, pub: boolean, type: Type);
|
|
180
305
|
}
|
|
181
306
|
export declare class OffsetDateTime extends External implements OffsetDateTime {
|
|
182
307
|
constructor(crate: Crate, encoding: DateTimeEncoding);
|
|
183
308
|
}
|
|
184
309
|
export declare class Option implements Option {
|
|
185
|
-
constructor(type: Type
|
|
310
|
+
constructor(type: Type);
|
|
311
|
+
}
|
|
312
|
+
export declare class Pager extends External implements Pager {
|
|
313
|
+
constructor(crate: Crate, type: Model, format: BodyFormat);
|
|
186
314
|
}
|
|
187
|
-
export declare class RequestContent extends External implements RequestContent {
|
|
188
|
-
constructor(crate: Crate, type:
|
|
315
|
+
export declare class RequestContent<T> extends External implements RequestContent<T> {
|
|
316
|
+
constructor(crate: Crate, type: T, format: BodyFormat);
|
|
189
317
|
}
|
|
190
318
|
export declare class Response extends External implements Response {
|
|
191
|
-
constructor(crate: Crate, type: Type, format?:
|
|
319
|
+
constructor(crate: Crate, type: Type, format?: BodyFormat);
|
|
192
320
|
}
|
|
193
|
-
export declare class Result extends External implements Result {
|
|
194
|
-
constructor(crate: Crate, type:
|
|
321
|
+
export declare class Result<T> extends External implements Result<T> {
|
|
322
|
+
constructor(crate: Crate, type: T);
|
|
195
323
|
}
|
|
196
324
|
export declare class Scalar implements Scalar {
|
|
197
325
|
constructor(type: ScalarType);
|
|
@@ -202,10 +330,10 @@ export declare class StringSlice implements StringSlice {
|
|
|
202
330
|
export declare class StringType implements StringType {
|
|
203
331
|
constructor();
|
|
204
332
|
}
|
|
205
|
-
export declare class Struct implements Struct {
|
|
206
|
-
constructor(name: string,
|
|
333
|
+
export declare class Struct extends StructBase implements Struct {
|
|
334
|
+
constructor(name: string, internal: boolean);
|
|
207
335
|
}
|
|
208
|
-
export declare class StructField implements StructField {
|
|
336
|
+
export declare class StructField extends StructFieldBase implements StructField {
|
|
209
337
|
constructor(name: string, pub: boolean, type: Type);
|
|
210
338
|
}
|
|
211
339
|
export declare class TokenCredential extends External implements TokenCredential {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/codemodel/types.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAmB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/codemodel/types.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAmB,MAAM,YAAY,CAAC;AAEpD,+DAA+D;AAC/D,MAAM,WAAW,IAAI;IACnB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,sDAAsD;AACtD,MAAM,MAAM,IAAI,GAAG,GAAG,GAAG,YAAY,GAAG,IAAI,GAAG,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,eAAe,GAAG,IAAI,GAAG,GAAG,GAAG,MAAM,CAAC;AAE5Q,iCAAiC;AACjC,MAAM,WAAW,GAAI,SAAQ,OAAO;IAClC,IAAI,EAAE,KAAK,CAAC;IAEZ;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,mEAAmE;AACnE,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,KAAK,CAAC;AAE1C,4DAA4D;AAC5D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,cAAc,CAAC;IAErB,oDAAoD;IACpD,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,gCAAgC;AAChC,MAAM,WAAW,IAAI;IAC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gBAC1C,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO;CAI5C;AAED,qBAAa,WAAY,SAAQ,eAAgB,YAAW,WAAW;gBACzD,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI;CAGnD;AAED,qBAAa,eAAgB,SAAQ,QAAS,YAAW,eAAe;gBAC1D,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;CAQhD;AAED,qBAAa,IAAK,YAAW,IAAI;;CAIhC;AAED,qBAAa,GAAI,SAAQ,QAAS,YAAW,GAAG;gBAClC,KAAK,EAAE,KAAK;CAIzB;AAED,qBAAa,MAAO,YAAW,MAAM;gBACvB,IAAI,EAAE,IAAI;CAIvB"}
|
|
@@ -17,6 +17,22 @@ export class StdType {
|
|
|
17
17
|
this.use = use;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
class StructBase {
|
|
21
|
+
constructor(kind, name, internal) {
|
|
22
|
+
this.kind = kind;
|
|
23
|
+
this.name = name;
|
|
24
|
+
this.internal = internal;
|
|
25
|
+
this.docs = {};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class StructFieldBase {
|
|
29
|
+
constructor(name, pub, type) {
|
|
30
|
+
this.name = name;
|
|
31
|
+
this.pub = pub;
|
|
32
|
+
this.type = type;
|
|
33
|
+
this.docs = {};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
20
36
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
21
37
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
22
38
|
export class Arc extends StdType {
|
|
@@ -89,22 +105,16 @@ export class Literal {
|
|
|
89
105
|
this.value = value;
|
|
90
106
|
}
|
|
91
107
|
}
|
|
92
|
-
export class Model {
|
|
93
|
-
constructor(name,
|
|
94
|
-
|
|
95
|
-
this.name = name;
|
|
96
|
-
this.pub = pub;
|
|
108
|
+
export class Model extends StructBase {
|
|
109
|
+
constructor(name, internal) {
|
|
110
|
+
super('model', name, internal);
|
|
97
111
|
this.fields = new Array();
|
|
98
|
-
this.docs = {};
|
|
99
112
|
}
|
|
100
113
|
}
|
|
101
|
-
export class ModelField {
|
|
114
|
+
export class ModelField extends StructFieldBase {
|
|
102
115
|
constructor(name, serde, pub, type) {
|
|
103
|
-
|
|
116
|
+
super(name, pub, type);
|
|
104
117
|
this.serde = serde;
|
|
105
|
-
this.pub = pub;
|
|
106
|
-
this.type = type;
|
|
107
|
-
this.docs = {};
|
|
108
118
|
}
|
|
109
119
|
}
|
|
110
120
|
export class OffsetDateTime extends External {
|
|
@@ -115,7 +125,7 @@ export class OffsetDateTime extends External {
|
|
|
115
125
|
}
|
|
116
126
|
}
|
|
117
127
|
export class Option {
|
|
118
|
-
constructor(type
|
|
128
|
+
constructor(type) {
|
|
119
129
|
switch (type.kind) {
|
|
120
130
|
case 'String':
|
|
121
131
|
case 'encodedBytes':
|
|
@@ -124,23 +134,32 @@ export class Option {
|
|
|
124
134
|
case 'hashmap':
|
|
125
135
|
case 'model':
|
|
126
136
|
case 'offsetDateTime':
|
|
137
|
+
case 'requestContent':
|
|
127
138
|
case 'scalar':
|
|
128
139
|
case 'struct':
|
|
129
140
|
case 'Url':
|
|
130
141
|
case 'vector':
|
|
131
142
|
this.kind = 'option';
|
|
132
143
|
this.type = type;
|
|
133
|
-
this.ref = ref;
|
|
134
144
|
break;
|
|
135
145
|
default:
|
|
136
146
|
throw new Error(`unsupported Option generic type param kind ${type.kind}`);
|
|
137
147
|
}
|
|
138
148
|
}
|
|
139
149
|
}
|
|
150
|
+
export class Pager extends External {
|
|
151
|
+
constructor(crate, type, format) {
|
|
152
|
+
super(crate, 'azure_core', 'Pager');
|
|
153
|
+
this.kind = 'pager';
|
|
154
|
+
this.type = type;
|
|
155
|
+
this.format = format;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
140
158
|
export class RequestContent extends External {
|
|
141
159
|
constructor(crate, type, format) {
|
|
142
160
|
switch (type.kind) {
|
|
143
161
|
case 'String':
|
|
162
|
+
case 'encodedBytes':
|
|
144
163
|
case 'enum':
|
|
145
164
|
case 'hashmap':
|
|
146
165
|
case 'model':
|
|
@@ -160,6 +179,7 @@ export class Response extends External {
|
|
|
160
179
|
constructor(crate, type, format) {
|
|
161
180
|
switch (type.kind) {
|
|
162
181
|
case 'String':
|
|
182
|
+
case 'encodedBytes':
|
|
163
183
|
case 'enum':
|
|
164
184
|
case 'hashmap':
|
|
165
185
|
case 'jsonValue':
|
|
@@ -201,21 +221,15 @@ export class StringType {
|
|
|
201
221
|
this.kind = 'String';
|
|
202
222
|
}
|
|
203
223
|
}
|
|
204
|
-
export class Struct {
|
|
205
|
-
constructor(name,
|
|
206
|
-
|
|
207
|
-
this.name = name;
|
|
208
|
-
this.pub = pub;
|
|
224
|
+
export class Struct extends StructBase {
|
|
225
|
+
constructor(name, internal) {
|
|
226
|
+
super('struct', name, internal);
|
|
209
227
|
this.fields = new Array();
|
|
210
|
-
this.docs = {};
|
|
211
228
|
}
|
|
212
229
|
}
|
|
213
|
-
export class StructField {
|
|
230
|
+
export class StructField extends StructFieldBase {
|
|
214
231
|
constructor(name, pub, type) {
|
|
215
|
-
|
|
216
|
-
this.pub = pub;
|
|
217
|
-
this.type = type;
|
|
218
|
-
this.docs = {};
|
|
232
|
+
super(name, pub, type);
|
|
219
233
|
}
|
|
220
234
|
}
|
|
221
235
|
export class TokenCredential extends External {
|
|
@@ -223,7 +237,7 @@ export class TokenCredential extends External {
|
|
|
223
237
|
if (scopes.length === 0) {
|
|
224
238
|
throw new Error('scopes must contain at least one entry');
|
|
225
239
|
}
|
|
226
|
-
super(crate, 'azure_core', 'TokenCredential', '
|
|
240
|
+
super(crate, 'azure_core', 'TokenCredential', 'credentials');
|
|
227
241
|
this.kind = 'tokenCredential';
|
|
228
242
|
this.scopes = scopes;
|
|
229
243
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/codemodel/types.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAS,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/codemodel/types.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAS,eAAe,EAAE,MAAM,YAAY,CAAC;AAySpD,MAAM,OAAO,QAAQ;IACnB,YAAY,KAAY,EAAE,SAAiB,EAAE,QAAgB,EAAE,SAAkB;QAC/E,KAAK,CAAC,aAAa,CAAC,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF;AAWD,MAAM,OAAO,OAAO;IAClB,YAAY,IAAY,EAAE,GAAW;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;CACF;AA4CD,MAAM,UAAU;IACd,YAAY,IAAwB,EAAE,IAAY,EAAE,QAAiB;QACnE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACjB,CAAC;CACF;AAED,MAAM,eAAe;IACnB,YAAY,IAAY,EAAE,GAAY,EAAE,IAAU;QAChD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACjB,CAAC;CACF;AAED,mGAAmG;AACnG,mGAAmG;AAEnG,MAAM,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,GAAG,MAAM,CAAC;IACrB,CAAC;CACF;AAED,MAAM,OAAO,GAAI,SAAQ,QAAQ;IAC/B,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,CAAC;CACF;AAED,MAAM,OAAO,MAAM;IACjB,YAAY,IAAU;QACpB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
|
package/dist/src/emitter.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { RustEmitterOptions } from './lib.js';
|
|
2
2
|
import { EmitContext } from '@typespec/compiler';
|
|
3
3
|
import 'source-map-support/register.js';
|
|
4
|
+
/**
|
|
5
|
+
* entry point called by the tsp compiler
|
|
6
|
+
*
|
|
7
|
+
* @param context the emit context
|
|
8
|
+
*/
|
|
4
9
|
export declare function $onEmit(context: EmitContext<RustEmitterOptions>): Promise<void>;
|
|
5
10
|
//# sourceMappingURL=emitter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/emitter.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/emitter.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI9C,OAAO,EAAE,WAAW,EAAY,MAAM,oBAAoB,CAAC;AAC3D,OAAO,gCAAgC,CAAC;AAExC;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,kBAAkB,CAAC,iBAgCrE"}
|