What does the ampersand (&) mean in a TypeScript type definition?

可紊 提交于 2019-12-17 16:24:59

问题


On line 60359 of this type definition file, there is the following declaration:

type ActivatedEventHandler = (ev: Windows.ApplicationModel.Activation.IActivatedEventArgs & WinRTEvent<any>) => void;

What does the & sigil mean in this context?


回答1:


& in a type position means type intersection.

More

https://www.typescriptlang.org/docs/handbook/advanced-types.html#intersection-types



来源:https://stackoverflow.com/questions/38317625/what-does-the-ampersand-mean-in-a-typescript-type-definition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!