@@ -176,27 +176,27 @@ export class SchemaBuilder {
176176 /** @deprecated Use `.prop`. */
177177 public Field < K extends string , V extends Schema > (
178178 key : K ,
179- type : V ,
180- options : Omit < NoT < ObjectFieldSchema < K , V > > , 'key' | 'type ' | 'optional' > = { } ,
179+ value : V ,
180+ options : Omit < NoT < ObjectFieldSchema < K , V > > , 'key' | 'value ' | 'optional' > = { } ,
181181 ) : ObjectFieldSchema < K , V > {
182182 return {
183183 kind : 'field' ,
184184 key,
185- type ,
185+ value ,
186186 ...options ,
187187 } ;
188188 }
189189
190190 /** @deprecated Use `.propOpt`. */
191191 public FieldOpt < K extends string , V extends Schema > (
192192 key : K ,
193- type : V ,
194- options : Omit < NoT < ObjectFieldSchema < K , V > > , 'key' | 'type ' | 'optional' > = { } ,
193+ value : V ,
194+ options : Omit < NoT < ObjectFieldSchema < K , V > > , 'key' | 'value ' | 'optional' > = { } ,
195195 ) : ObjectOptionalFieldSchema < K , V > {
196196 return {
197197 kind : 'field' ,
198198 key,
199- type ,
199+ value ,
200200 ...options ,
201201 optional : true ,
202202 } ;
@@ -205,34 +205,38 @@ export class SchemaBuilder {
205205 /** Declares an object property. */
206206 public prop < K extends string , V extends Schema > (
207207 key : K ,
208- type : V ,
209- options : Omit < NoT < ObjectFieldSchema < K , V > > , 'key' | 'type ' | 'optional' > = { } ,
208+ value : V ,
209+ options : Omit < NoT < ObjectFieldSchema < K , V > > , 'key' | 'value ' | 'optional' > = { } ,
210210 ) : ObjectFieldSchema < K , V > {
211211 return {
212212 kind : 'field' ,
213213 key,
214- type ,
214+ value ,
215215 ...options ,
216216 } ;
217217 }
218218
219219 /** Declares an optional object property. */
220220 public propOpt < K extends string , V extends Schema > (
221221 key : K ,
222- type : V ,
223- options : Omit < NoT < ObjectFieldSchema < K , V > > , 'key' | 'type ' | 'optional' > = { } ,
222+ value : V ,
223+ options : Omit < NoT < ObjectFieldSchema < K , V > > , 'key' | 'value ' | 'optional' > = { } ,
224224 ) : ObjectOptionalFieldSchema < K , V > {
225225 return {
226226 kind : 'field' ,
227227 key,
228- type ,
228+ value ,
229229 ...options ,
230230 optional : true ,
231231 } ;
232232 }
233233
234- public Map < T extends Schema > ( type : T , options ?: Omit < NoT < MapSchema < T > > , 'type' > ) : MapSchema < T > {
235- return { kind : 'map' , type, ...options } ;
234+ public Map < V extends Schema , K extends Schema = StringSchema > (
235+ value : V ,
236+ key ?: K ,
237+ options ?: Omit < NoT < MapSchema < V , K > > , 'value' | 'key' >
238+ ) : MapSchema < V , K > {
239+ return { kind : 'map' , value, ...( key && { key} ) , ...options } ;
236240 }
237241
238242 public Any ( options : NoT < AnySchema > = { } ) : AnySchema {
0 commit comments