Skip to content

Instantly share code, notes, and snippets.

@nkmry
Last active December 20, 2021 19:19
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkmry/9300823 to your computer and use it in GitHub Desktop.
Save nkmry/9300823 to your computer and use it in GitHub Desktop.
TypeScript でコールバック関数の型定義をしたい場合は、call signature を付けた interface として定義すれば良い。関数もオブジェクトの一種だから。
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