| 1 | import type { MessageSchema } from "@/lang/config" |
| 2 | import type { RecursiveKeyOf } from "@/types/common" |
| 3 | |
| 4 | // To ensure it is treated as a module, add at least one `export` statement |
| 5 | export {} |
| 6 | |
| 7 | declare module "@vue/runtime-core" { |
| 8 | interface ComponentCustomProperties { |
| 9 | $t: { |
| 10 | // Firma 1: Traduzione semplice |
| 11 | (key: RecursiveKeyOf<MessageSchema>): string |
| 12 | |
| 13 | // Firma 2: Traduzione con numero plurale |
| 14 | (key: RecursiveKeyOf<MessageSchema>, plural: number): string |
| 15 | |
| 16 | // Firma 3: Traduzione con numero plurale e opzioni aggiuntive |
| 17 | (key: RecursiveKeyOf<MessageSchema>, plural: number, options: TranslateOptions<Locales>): string |
| 18 | |
| 19 | // Firma 4: Traduzione con messaggio predefinito |
| 20 | (key: RecursiveKeyOf<MessageSchema>, defaultMsg: string): string |
| 21 | |
| 22 | // Firma 5: Traduzione con messaggio predefinito e opzioni aggiuntive |
| 23 | (key: RecursiveKeyOf<MessageSchema>, defaultMsg: string, options: TranslateOptions<Locales>): string |
| 24 | |
| 25 | // Firma 6: Traduzione con interpolazione di lista |
| 26 | (key: RecursiveKeyOf<MessageSchema>, list: unknown[]): string |
| 27 | |
| 28 | // Firma 7: Traduzione con interpolazione di lista e numero plurale |
| 29 | (key: RecursiveKeyOf<MessageSchema>, list: unknown[], plural: number): string |
| 30 | |
| 31 | // Firma 8: Traduzione con interpolazione di lista e messaggio predefinito |
| 32 | (key: RecursiveKeyOf<MessageSchema>, list: unknown[], defaultMsg: string): string |
| 33 | |
| 34 | // Firma 9: Traduzione con interpolazione di lista e opzioni aggiuntive |
| 35 | (key: RecursiveKeyOf<MessageSchema>, list: unknown[], options: TranslateOptions<Locales>): string |
| 36 | |
| 37 | // Firma 10: Traduzione con interpolazione nominale |
| 38 | (key: RecursiveKeyOf<MessageSchema>, named: NamedValue): string |
| 39 | |
| 40 | // Firma 11: Traduzione con interpolazione nominale e numero plurale |
| 41 | (key: RecursiveKeyOf<MessageSchema>, named: NamedValue, plural: number): string |
| 42 | |
| 43 | // Firma 12: Traduzione con interpolazione nominale e messaggio predefinito |
| 44 | (key: RecursiveKeyOf<MessageSchema>, named: NamedValue, defaultMsg: string): string |
| 45 | |
| 46 | // Firma 13: Traduzione con interpolazione nominale e opzioni aggiuntive |
| 47 | (key: RecursiveKeyOf<MessageSchema>, named: NamedValue, options: TranslateOptions<Locales>): string |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | declare module "vue-i18n" { |
| 53 | export interface DefineLocaleMessage extends MessageSchema {} |
| 54 | } |