Skip to content

Commit f18327d

Browse files
committed
fix: use AbstractIntlMessages type for loadMessages
1 parent bff370f commit f18327d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/templates/src/lib/load-messages.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
import { AbstractIntlMessages } from "next-intl";
2+
13
/**
24
* Loads translation messages from a locale file with automatic fallback to English.
35
* @param importPath - A function that returns the dynamic import for the given locale
46
* @param locale - The locale to load
57
* @returns The loaded messages object
68
*/
79
export async function loadMessages(
8-
importPath: (locale: string) => Promise<{ default: Record<string, unknown> }>,
10+
importPath: (locale: string) => Promise<{ default: AbstractIntlMessages }>,
911
locale: string,
10-
) {
12+
): Promise<AbstractIntlMessages> {
1113
try {
1214
return (await importPath(locale)).default;
1315
} catch {

0 commit comments

Comments
 (0)