In your example, both are declared using a colon ...
Let him break it in half!
No type declaration ...
interface JQuery { addTemplateSetup }
Type declaration ...
: (func: Function, priority: bool) =>void;
If you use the word is instead of : this is like saying
Property named 'addTemplateSetUp': a function that takes two parameters of specific types and does not return a value
Here is an example with two interfaces that are actually identical, but one uses => and the other does not. Both of them are handled the same way with TypeScript, so it really doesn't match the preferences of the developers.
interface JQuery { addTemplateSetup: (func: Function, priority: bool) =>void; } interface Identical { addTemplateSetup(func: Function, priority: bool): void; } class ImplementsEither implements JQuery { addTemplateSetup (func: Function, priority: bool) : void { } }
You can use the style declaration => if you like to read almost in English.
You can use the second style if you want your interfaces to be more like implementations.
source share