Skip to content

Commit c61fad0

Browse files
daniserSergey Danilchenko
andauthored
fix: mixin typings (#122)
Co-authored-by: Sergey Danilchenko <[email protected]>
1 parent f9e3152 commit c61fad0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"description": "allows to connect your `Laravel` Framework localization files with `Vue`.",
1717
"main": "dist/cjs/index.js",
1818
"module": "dist/index.js",
19+
"types": "dist/index.d.ts",
1920
"scripts": {
2021
"watch": "tsc --watch",
2122
"test": "jest",

src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ export const reset = (): void => {
9898
*/
9999
export const trans_choice = transChoice
100100

101+
/**
102+
* Type declarations for `$t` and `$tChoice` mixins.
103+
*/
104+
declare module '@vue/runtime-core' {
105+
interface ComponentCustomProperties {
106+
$t: typeof trans
107+
$tChoice: typeof transChoice
108+
}
109+
}
110+
101111
/**
102112
* The Vue Plugin. to be used on your Vue app like this: `app.use(i18nVue)`
103113
*/

0 commit comments

Comments
 (0)