@@ -311,7 +311,11 @@ export function createI18n<
311
311
> (
312
312
options : Options ,
313
313
LegacyVueI18n ?: any // eslint-disable-line @typescript-eslint/no-explicit-any
314
- ) : I18n < Messages , DateTimeFormats , NumberFormats , OptionLocale , Legacy >
314
+ ) : typeof options [ 'legacy' ] extends true
315
+ ? I18n < Messages , DateTimeFormats , NumberFormats , OptionLocale , true >
316
+ : typeof options [ 'legacy' ] extends false
317
+ ? I18n < Messages , DateTimeFormats , NumberFormats , OptionLocale , false >
318
+ : I18n < Messages , DateTimeFormats , NumberFormats , OptionLocale , Legacy >
315
319
316
320
/**
317
321
* Vue I18n factory
@@ -410,7 +414,11 @@ export function createI18n<
410
414
> (
411
415
options : Options ,
412
416
LegacyVueI18n ?: any // eslint-disable-line @typescript-eslint/no-explicit-any
413
- ) : I18n < Messages , DateTimeFormats , NumberFormats , OptionLocale , Legacy >
417
+ ) : typeof options [ 'legacy' ] extends true
418
+ ? I18n < Messages , DateTimeFormats , NumberFormats , OptionLocale , true >
419
+ : typeof options [ 'legacy' ] extends false
420
+ ? I18n < Messages , DateTimeFormats , NumberFormats , OptionLocale , false >
421
+ : I18n < Messages , DateTimeFormats , NumberFormats , OptionLocale , Legacy >
414
422
415
423
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
416
424
export function createI18n ( options : any = { } , VueI18nLegacy ?: any ) : any {
0 commit comments