Skip to content

Commit 617afdf

Browse files
committed
Fix typescript definitions
1 parent 44dc3ed commit 617afdf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

index.d.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,23 @@ type ComponentType = DefineComponent<{
3939
}
4040
}>
4141

42-
declare module 'vue' {
43-
interface ComponentCustomProperties {
42+
// @ts-ignore: works on Vue 2, fails in Vue 3
43+
declare module 'vue/types/vue' {
44+
export interface Vue {
4445
$t: (key: string, values?: Record<string, unknown>) => string
4546
$ta: (key: string, values?: Record<string, unknown>) => Record<string, string>
4647
}
48+
}
4749

48-
interface ComponentCustomProperties {
50+
// @ts-ignore: works on Vue 3, fails in Vue 2
51+
declare module '@vue/runtime-core' {
52+
export interface ComponentCustomProperties {
53+
$t: (key: string, values?: Record<string, unknown>) => string
54+
$ta: (key: string, values?: Record<string, unknown>) => Record<string, string>
4955
vT: FunctionDirective<HTMLElement, Record<string, FluentVariable>>
5056
}
5157

52-
interface GlobalComponents {
58+
export interface GlobalComponents {
5359
i18n: ComponentType
5460
}
5561
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy