@@ -184,7 +184,7 @@ interface GenerateApiParamsBase {
184
184
requestOptions ?: null | Partial < RequestInit > ;
185
185
186
186
/** ts compiler configuration object (for --to-js option) */
187
- compilerTsConfig ?: Record < string , any > ;
187
+ compilerTsConfig ?: Record < string , unknown > ;
188
188
189
189
/**
190
190
* custom ts->* translator
@@ -257,28 +257,28 @@ type CodeGenConstruct = {
257
257
CodeGenKeyword : {
258
258
UtilRequiredKeys : string ;
259
259
} ;
260
- ArrayType : ( content : any ) => string ;
261
- StringValue : ( content : any ) => string ;
262
- BooleanValue : ( content : any ) => string ;
263
- NumberValue : ( content : any ) => string ;
264
- NullValue : ( content : any ) => string ;
265
- UnionType : ( content : any ) => string ;
266
- ExpressionGroup : ( content : any ) => string ;
267
- IntersectionType : ( content : any ) => string ;
268
- RecordType : ( content : any ) => string ;
269
- TypeField : ( content : any ) => string ;
270
- InterfaceDynamicField : ( content : any ) => string ;
271
- EnumField : ( content : any ) => string ;
272
- EnumFieldsWrapper : ( content : any ) => string ;
273
- ObjectWrapper : ( content : any ) => string ;
274
- MultilineComment : ( content : any ) => string ;
275
- TypeWithGeneric : ( content : any ) => string ;
260
+ ArrayType : ( content : unknown ) => string ;
261
+ StringValue : ( content : unknown ) => string ;
262
+ BooleanValue : ( content : unknown ) => string ;
263
+ NumberValue : ( content : unknown ) => string ;
264
+ NullValue : ( content : unknown ) => string ;
265
+ UnionType : ( content : unknown ) => string ;
266
+ ExpressionGroup : ( content : unknown ) => string ;
267
+ IntersectionType : ( content : unknown ) => string ;
268
+ RecordType : ( content : unknown ) => string ;
269
+ TypeField : ( content : unknown ) => string ;
270
+ InterfaceDynamicField : ( content : unknown ) => string ;
271
+ EnumField : ( content : unknown ) => string ;
272
+ EnumFieldsWrapper : ( content : unknown ) => string ;
273
+ ObjectWrapper : ( content : unknown ) => string ;
274
+ MultilineComment : ( content : unknown ) => string ;
275
+ TypeWithGeneric : ( content : unknown ) => string ;
276
276
} ;
277
277
278
278
type PrimitiveTypeStructValue =
279
279
| string
280
280
| ( (
281
- schema : Record < string , any > ,
281
+ schema : Record < string , unknown > ,
282
282
parser : import ( "../src/schema-parser/schema-parser" ) . SchemaParser ,
283
283
) => string ) ;
284
284
@@ -341,60 +341,65 @@ type BuildRoutePath = {
341
341
342
342
export interface Hooks {
343
343
/** calls before parse\process route path */
344
- onPreBuildRoutePath : ( routePath : string ) => string | void ;
344
+ onPreBuildRoutePath : ( routePath : string ) => string | undefined ;
345
345
/** calls after parse\process route path */
346
- onBuildRoutePath : ( data : BuildRoutePath ) => BuildRoutePath | void ;
346
+ onBuildRoutePath : ( data : BuildRoutePath ) => BuildRoutePath | undefined ;
347
347
/** calls before insert path param name into string path interpolation */
348
348
onInsertPathParam : (
349
349
paramName : string ,
350
350
index : number ,
351
351
arr : BuildRouteParam [ ] ,
352
352
resultRoute : string ,
353
- ) => string | void ;
353
+ ) => string | undefined ;
354
354
/** calls after parse schema component */
355
- onCreateComponent : ( component : SchemaComponent ) => SchemaComponent | void ;
355
+ onCreateComponent : (
356
+ component : SchemaComponent ,
357
+ ) => SchemaComponent | undefined ;
356
358
/** calls before parse any kind of schema */
357
359
onPreParseSchema : (
358
- originalSchema : any ,
360
+ originalSchema : unknown ,
359
361
typeName : string ,
360
362
schemaType : string ,
361
- ) => any ;
363
+ ) => undefined ;
362
364
/** calls after parse any kind of schema */
363
- onParseSchema : ( originalSchema : any , parsedSchema : any ) => any | void ;
365
+ onParseSchema : (
366
+ originalSchema : unknown ,
367
+ parsedSchema : unknown ,
368
+ ) => unknown | undefined ;
364
369
/** calls after parse route (return type: customized route (ParsedRoute), nothing change (void), false (ignore this route)) */
365
- onCreateRoute : ( routeData : ParsedRoute ) => ParsedRoute | void | false ;
370
+ onCreateRoute : ( routeData : ParsedRoute ) => ParsedRoute | false | undefined ;
366
371
/** Start point of work this tool (after fetching schema) */
367
372
onInit ?: < C extends GenerateApiConfiguration [ "config" ] > (
368
373
configuration : C ,
369
374
codeGenProcess : import ( "../src/code-gen-process" ) . CodeGenProcess ,
370
- ) => C | void ;
375
+ ) => C | undefined ;
371
376
/** customize configuration object before sending it to ETA templates */
372
377
onPrepareConfig ?: < C extends GenerateApiConfiguration > (
373
378
currentConfiguration : C ,
374
- ) => C | void ;
379
+ ) => C | undefined ;
375
380
/** customize route name as you need */
376
381
onCreateRouteName ?: (
377
382
routeNameInfo : RouteNameInfo ,
378
383
rawRouteInfo : RawRouteInfo ,
379
- ) => RouteNameInfo | void ;
384
+ ) => RouteNameInfo | undefined ;
380
385
/** customize request params (path params, query params) */
381
386
onCreateRequestParams ?: (
382
387
rawType : SchemaComponent [ "rawTypeData" ] ,
383
- ) => SchemaComponent [ "rawTypeData" ] | void ;
388
+ ) => SchemaComponent [ "rawTypeData" ] | undefined ;
384
389
/** customize name of model type */
385
390
onFormatTypeName ?: (
386
391
typeName : string ,
387
392
rawTypeName ?: string ,
388
393
schemaType ?: "type-name" | "enum-key" ,
389
- ) => string | void ;
394
+ ) => string | undefined ;
390
395
/** customize name of route (operationId), you can do it with using onCreateRouteName too */
391
396
onFormatRouteName ?: (
392
397
routeInfo : RawRouteInfo ,
393
398
templateRouteName : string ,
394
- ) => string | void ;
399
+ ) => string | undefined ;
395
400
}
396
401
397
- export type RouteNameRouteInfo = { } ;
402
+ export type RouteNameRouteInfo = Record < unknown , unknown > ;
398
403
399
404
export type RouteNameInfo = {
400
405
usage : string ;
@@ -407,7 +412,7 @@ export type SchemaTypePrimitiveContent = {
407
412
schemaType : string ;
408
413
type : string ;
409
414
typeIdentifier : string ;
410
- name ?: any ;
415
+ name ?: unknown ;
411
416
description : string ;
412
417
content : string ;
413
418
} ;
@@ -593,7 +598,7 @@ export interface GenerateApiConfiguration {
593
598
input : string ;
594
599
output : string ;
595
600
url : string ;
596
- spec : any ;
601
+ spec : unknown ;
597
602
fileName : string ;
598
603
templatePaths : {
599
604
/** `templates/base` */
@@ -650,7 +655,7 @@ export interface GenerateApiConfiguration {
650
655
hooks : Hooks ;
651
656
enumNamesAsValues : boolean ;
652
657
version : string ;
653
- compilerTsConfig : Record < string , any > ;
658
+ compilerTsConfig : Record < string , unknown > ;
654
659
enumKeyResolverName : string ;
655
660
typeNameResolverName : string ;
656
661
specificArgNameResolverName : string ;
0 commit comments