Open briefy opened 7 years ago
/* interface definition */
interface MyFunction {
(id: string): any;
}
interface MyFunctionWithStatics extends MyFunction { resolve(id: string): string; cache: any; extensions: any; main: string; }
/ implementation ONE / function myFunc(id:string){} namespace myFunc{ export function resolve(id:string):string{ return id}; export let cache:any; export let extensions: any; export let main:string } let impl : MyFunctionWithStatics= myFunc
/ implementation SECOND /
function myFunc(id:string){}
let impl: MyFunctionWithStatics =
TSLint apply those rule gradually to make your code in ts better.
[x] make sure what is the difference between the two below