22/* eslint-disable */
33{ {> licenseInfo} }
44
5- export const BASE_PATH = "{ {{basePath} }}".replace(/\/+$/, "");
5+ export const BASE_PATH: string = "{ {{basePath} }}".replace(/\/+$/, "");
66
77export interface ConfigurationParameters {
88 basePath?: string; // override base path
@@ -73,7 +73,7 @@ export class Configuration {
7373 }
7474}
7575
76- export const DefaultConfig = new Configuration();
76+ export const DefaultConfig: Configuration = new Configuration();
7777
7878/**
7979 * This is the base class for all generated API classes.
@@ -83,22 +83,22 @@ export class BaseAPI {
8383 private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i;
8484 private middleware: Middleware[];
8585
86- constructor(protected configuration = DefaultConfig) {
86+ constructor(protected configuration: Configuration = DefaultConfig) {
8787 this.middleware = configuration.middleware;
8888 }
8989
90- withMiddleware<T extends BaseAPI >(this: T, ...middlewares: Middleware[]) {
90+ withMiddleware<T extends BaseAPI >(this: T, ...middlewares: Middleware[]): T {
9191 const next = this.clone< T> ();
9292 next.middleware = next.middleware.concat(...middlewares);
9393 return next;
9494 }
9595
96- withPreMiddleware<T extends BaseAPI >(this: T, ...preMiddlewares: Array<Middleware [ ' pre' ] >) {
96+ withPreMiddleware<T extends BaseAPI >(this: T, ...preMiddlewares: Array<Middleware [ ' pre' ] >): T {
9797 const middlewares = preMiddlewares.map((pre) => ({ pre } ));
9898 return this.withMiddleware<T >(...middlewares);
9999 }
100100
101- withPostMiddleware<T extends BaseAPI >(this: T, ...postMiddlewares: Array<Middleware [ ' post' ] >) {
101+ withPostMiddleware<T extends BaseAPI >(this: T, ...postMiddlewares: Array<Middleware [ ' post' ] >): T {
102102 const middlewares = postMiddlewares.map((post) => ({ post } ));
103103 return this.withMiddleware<T >(...middlewares);
104104 }
@@ -369,7 +369,7 @@ function querystringSingleKey(key: string, value: string | number | null | undef
369369 return `${ encodeURIComponent(fullKey)} =${ encodeURIComponent(String(value))} `;
370370}
371371
372- export function exists(json: any, key: string) {
372+ export function exists(json: any, key: string): boolean {
373373 const value = json[key];
374374 return value !== null && value !== undefined;
375375}
@@ -453,7 +453,7 @@ export function parseDateTime(value: any): Date {
453453{ {/isDateLibraryTemporal} }
454454
455455{ {#modelSerializersEnabled} }
456- export function mapValues(data: any, fn: (item: any) => any) {
456+ export function mapValues(data: any, fn: (item: any) => any): { [key: string]: any } {
457457 const result: { [key: string]: any } = { } ;
458458 for (const key of Object.keys(data)) {
459459 result[key] = fn(data[key]);
0 commit comments