Last active
December 20, 2021 19:19
-
-
Save nkmry/9300823 to your computer and use it in GitHub Desktop.
TypeScript でコールバック関数の型定義をしたい場合は、call signature を付けた interface として定義すれば良い。関数もオブジェクトの一種だから。
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
interface callbackType{(argv :number) :void}; | |
function func(callback:callbackType){ | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment