Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 @@
Options as AngularOptions,
Source as AngularSource,
} from './types.js';
import type { Field as ClientField } from '../client/types.js';

Check failure on line 49 in generators/angular/generator.ts

View workflow job for this annotation

GitHub Actions / check-npm-test

`../client/types.js` type import should occur before import of `./entity-files-angular.js`

const { ANGULAR } = clientFrameworkTypes;

Expand Down Expand Up @@ -152,7 +153,7 @@
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 @@
...(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