mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 08:01:20 -08:00
fix: add TypeScript support to Artplayer.vue and update i18n type declarations
This commit is contained in:
1 parent
474383853b
commit
6be0ea9542
3 files changed
+35
-21
No files matched your search
@@ -22,11 +22,25 @@
|
|||||||
"import": "./dist/artplayer.mjs",
|
"import": "./dist/artplayer.mjs",
|
||||||
"require": "./dist/artplayer.js"
|
"require": "./dist/artplayer.js"
|
||||||
},
|
},
|
||||||
|
"./legacy": {
|
||||||
|
"import": "./dist/artplayer.legacy.js",
|
||||||
|
"require": "./dist/artplayer.legacy.js"
|
||||||
|
},
|
||||||
"./i18n/*": {
|
"./i18n/*": {
|
||||||
"import": "./dist/i18n/*.mjs",
|
"import": "./dist/i18n/*.mjs",
|
||||||
"require": "./dist/i18n/*.js"
|
"require": "./dist/i18n/*.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"typesVersions": {
|
||||||
|
"*": {
|
||||||
|
"i18n/*": [
|
||||||
|
"types/i18n.d.ts"
|
||||||
|
],
|
||||||
|
"legacy": [
|
||||||
|
"types/artplayer.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"main": "./dist/artplayer.js",
|
"main": "./dist/artplayer.js",
|
||||||
"module": "./dist/artplayer.mjs",
|
"module": "./dist/artplayer.mjs",
|
||||||
"types": "./types/artplayer.d.ts",
|
"types": "./types/artplayer.d.ts",
|
||||||
@@ -35,4 +49,4 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"option-validator": "^2.0.6"
|
"option-validator": "^2.0.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-6
@@ -189,9 +189,4 @@ export default class Artplayer extends Player {
|
|||||||
plugin: (this: Artplayer, art: Artplayer) => unknown | Promise<unknown>,
|
plugin: (this: Artplayer, art: Artplayer) => unknown | Promise<unknown>,
|
||||||
) => Promise<Artplayer['plugins']> | Artplayer['plugins']
|
) => Promise<Artplayer['plugins']> | Artplayer['plugins']
|
||||||
} & Record<string, unknown>
|
} & Record<string, unknown>
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'artplayer/i18n/*' {
|
|
||||||
const lang: Partial<I18n>
|
|
||||||
export default lang
|
|
||||||
}
|
|
||||||
Vendored
+19
-14
@@ -1,18 +1,18 @@
|
|||||||
type I18nKeys
|
type I18nKeys
|
||||||
= | 'en'
|
= | 'en'
|
||||||
| 'zh-cn'
|
| 'zh-cn'
|
||||||
| 'zh-tw'
|
| 'zh-tw'
|
||||||
| 'pl'
|
| 'pl'
|
||||||
| 'cs'
|
| 'cs'
|
||||||
| 'es'
|
| 'es'
|
||||||
| 'fa'
|
| 'fa'
|
||||||
| 'fr'
|
| 'fr'
|
||||||
| 'id'
|
| 'id'
|
||||||
| 'ru'
|
| 'ru'
|
||||||
| 'tr'
|
| 'tr'
|
||||||
| 'ar'
|
| 'ar'
|
||||||
| 'vi'
|
| 'vi'
|
||||||
| (string & Record<never, never>)
|
| (string & Record<never, never>)
|
||||||
|
|
||||||
interface I18nValue {
|
interface I18nValue {
|
||||||
'Video Info': string
|
'Video Info': string
|
||||||
@@ -54,3 +54,8 @@ interface I18nValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type I18n = Partial<Record<I18nKeys, Partial<I18nValue>>>
|
export type I18n = Partial<Record<I18nKeys, Partial<I18nValue>>>
|
||||||
|
|
||||||
|
declare module "artplayer/i18n/*" {
|
||||||
|
const lang: Partial<I18nValue>
|
||||||
|
export default lang
|
||||||
|
}
|
||||||
Reference in new issue
Block a user