mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 21:01:20 -08:00
add types.test.js
This commit is contained in:
1 parent
eb7bd68b43
commit
d27f07860f
48 files changed
+257
-109
No files matched your search
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: How to import types
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
Sometimes you lose `TypeScript` syntax prompt, then you can import types manually
|
||||
|
||||
|
||||
```js
|
||||
/**
|
||||
* @typedef { import("artplayer/types/artplayer") } Artplayer
|
||||
*/
|
||||
|
||||
/**
|
||||
* @type {Artplayer} - An Artplayer instance.
|
||||
*/
|
||||
const art1 = {};
|
||||
|
||||
/**
|
||||
* @param {Artplayer} art2 - An Artplayer instance.
|
||||
*/
|
||||
function getInstance(art2) {
|
||||
//
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: 如何导入类型
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
有时你会丢失 `TypeScript` 的语法提示,这时候你可以手动导入类型
|
||||
|
||||
|
||||
```js
|
||||
/**
|
||||
* @typedef { import("artplayer/types/artplayer") } Artplayer
|
||||
*/
|
||||
|
||||
/**
|
||||
* @type {Artplayer} - 一个 Artplayer 实例
|
||||
*/
|
||||
const art1 = {};
|
||||
|
||||
/**
|
||||
* @param {Artplayer} art2 - 一个 Artplayer 实例
|
||||
*/
|
||||
function getInstance(art2) {
|
||||
//
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user