add types.test.js

This commit is contained in:
Harvey committed 2021-12-15 15:48:18 +08:00
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) {
//
}
```