Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions generators/angular/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import type {
Options as AngularOptions,
Source as AngularSource,
} from './types.js';
import type { Field as ClientField } from '../client/types.js';

const { ANGULAR } = clientFrameworkTypes;

Expand Down Expand Up @@ -152,7 +153,7 @@ export default class AngularGenerator extends BaseApplicationGenerator<
createNeedleCallback({
needle: 'i18n-language-loader',
contentToAdd: languagesDefinition.map(
lang => `'${lang.languageTag}': async (): Promise<any> => import('i18n/${lang.languageTag}.json'),`,
lang => `'${lang.languageTag}': async (): Promise<Record<string, unknown>> => import('i18n/${lang.languageTag}.json'),`,
),
}),
createNeedleCallback({
Expand Down Expand Up @@ -217,7 +218,7 @@ export default class AngularGenerator extends BaseApplicationGenerator<
...(entity.entityReadAuthority?.split(',') ?? []),
]),
});
entity.generateEntityClientEnumImports = (fields: any) => getClientEnumImportsFormat(fields, ANGULAR);
entity.generateEntityClientEnumImports = (fields: ClientField[]) => getClientEnumImportsFormat(fields, ANGULAR);
},
});
}
Expand Down
2 changes: 1 addition & 1 deletion generators/angular/support/translate-angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function replaceTranslationKeysWithText(
keyIndex = 1,
replacementIndex = 1,
escape,
}: { keyIndex?: number; replacementIndex?: number; escape?: (str: string, match: any) => string } = {},
}: { keyIndex?: number; replacementIndex?: number; escape?: (str: string, match: RegExpMatchArray) => string } = {},
) {
const regex = new RegExp(regexSource, 'g');
const allMatches = content.matchAll(regex);
Expand Down
2 changes: 1 addition & 1 deletion generators/angular/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface Entity<F extends Field = Field, R extends ClientRelationship =
* @param fields returns the import of enums that are referenced by the fields
* @returns {typeImports:Map} the fields that potentially contains some enum types
*/
generateEntityClientEnumImports?: (fields: any) => Map<any, any>;
generateEntityClientEnumImports?: (fields: Field[]) => Map<string, string>;
entityAngularAuthorities?: string;
entityAngularReadAuthorities?: string;
}
Expand Down
Loading