@@ -170,8 +170,8 @@ import {type FieldDefinitionBase, type IntrinsicTypeName} from './definition'
170
170
* @beta
171
171
*/
172
172
export function defineType <
173
- TType extends string | IntrinsicTypeName , // IntrinsicTypeName here improves autocompletion in _some_ IDEs (not VS Code atm)
174
- TName extends string ,
173
+ const TType extends string | IntrinsicTypeName , // IntrinsicTypeName here improves autocompletion in _some_ IDEs (not VS Code atm)
174
+ const TName extends string ,
175
175
TSelect extends Record < string , string > | undefined ,
176
176
TPrepareValue extends Record < keyof TSelect , any > | undefined ,
177
177
TAlias extends IntrinsicTypeName | undefined ,
@@ -211,8 +211,8 @@ export function defineType<
211
211
* @beta
212
212
*/
213
213
export function defineField <
214
- TType extends string | IntrinsicTypeName , // IntrinsicTypeName here improves autocompletion in _some_ IDEs (not VS Code atm)
215
- TName extends string ,
214
+ const TType extends string | IntrinsicTypeName , // IntrinsicTypeName here improves autocompletion in _some_ IDEs (not VS Code atm)
215
+ const TName extends string ,
216
216
TSelect extends Record < string , string > | undefined ,
217
217
TPrepareValue extends Record < keyof TSelect , any > | undefined ,
218
218
TAlias extends IntrinsicTypeName | undefined ,
@@ -229,7 +229,8 @@ export function defineField<
229
229
// eslint-disable-next-line @typescript-eslint/no-unused-vars
230
230
defineOptions ?: DefineSchemaOptions < TStrict , TAlias > ,
231
231
) : typeof schemaField & WidenValidation & WidenInitialValue {
232
- return schemaField
232
+ // TODO: re-evaluate the need for this cast
233
+ return schemaField as typeof schemaField & WidenValidation & WidenInitialValue
233
234
}
234
235
235
236
/**
@@ -253,8 +254,8 @@ export function defineField<
253
254
* @beta
254
255
*/
255
256
export function defineArrayMember <
256
- TType extends string | IntrinsicTypeName , // IntrinsicTypeName here improves autocompletion in _some_ IDEs (not VS Code atm)
257
- TName extends string ,
257
+ const TType extends string | IntrinsicTypeName , // IntrinsicTypeName here improves autocompletion in _some_ IDEs (not VS Code atm)
258
+ const TName extends string ,
258
259
TSelect extends Record < string , string > | undefined ,
259
260
TPrepareValue extends Record < keyof TSelect , any > | undefined ,
260
261
TAlias extends IntrinsicTypeName | undefined ,
@@ -276,7 +277,8 @@ export function defineArrayMember<
276
277
// eslint-disable-next-line @typescript-eslint/no-unused-vars
277
278
defineOptions ?: DefineSchemaOptions < TStrict , TAlias > ,
278
279
) : typeof arrayOfSchema & WidenValidation & WidenInitialValue {
279
- return arrayOfSchema
280
+ // TODO: re-evaluate the need for this cast
281
+ return arrayOfSchema as typeof arrayOfSchema & WidenValidation & WidenInitialValue
280
282
}
281
283
282
284
/**
0 commit comments