Last active
June 14, 2019 06:14
-
-
Save kurone-kito/ccb4b50181908ae6da2c4b2e8c77c9d1 to your computer and use it in GitHub Desktop.
🐥 Example of type solution using d.ts in JavaScript.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {import("./Piyo").default} */ | |
let x; | |
let y = new x(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface PiyoInstance { | |
/** | |
* Thru an argument. | |
* @param x argument. | |
* @template T argument type. | |
*/ | |
instanceMethod<T>(x: T): T; | |
} | |
/** 🐥 */ | |
export default interface Piyo { | |
/** Create the instance. */ | |
new (): PiyoInstance; | |
/** | |
* Thru an argument. | |
* @param x argument. | |
* @template T argument type. | |
*/ | |
staticMethod<T>(x: T): T; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment