From faaec1416d5d0e2f325912ded6b177a56554d423 Mon Sep 17 00:00:00 2001 From: Severin Date: Tue, 2 May 2017 01:04:51 +0200 Subject: [PATCH] Updating template function defintion (#15936) * Updating template function defintion As mentioned [here](https://github.com/seveves/ng2-vis/issues/32) there is a problem with the definition of the template functions. We really should allow any as a return value because you can return a string, Handlebars, mustache or even react templates. As you can see [here](http://visjs.org/docs/timeline/#Templates) the template function always has three parameters. I made them optional because you don't have to use them at all. * Using fat arrow syntax I think this is the right way to do it. * Fix lint error --- types/vis/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/vis/index.d.ts b/types/vis/index.d.ts index b265ce5693..5b7cc718b2 100644 --- a/types/vis/index.d.ts +++ b/types/vis/index.d.ts @@ -152,7 +152,7 @@ export interface TimelineOptions { groupEditable?: TimelineOptionsGroupEditableType; groupOrder?: TimelineOptionsGroupOrderType; groupOrderSwap?: TimelineOptionsGroupOrderSwapFunction; - groupTemplate?(): void; // TODO + groupTemplate?(item?: any, element?: any, data?: any): any; height?: HeightWidthType; hiddenDates?: any; // TODO horizontalScroll?: boolean; @@ -187,7 +187,7 @@ export interface TimelineOptions { stack?: boolean; snap?: TimelineOptionsSnapFunction; start?: DateType; - template?(): void; // TODO + template?(item?: any, element?: any, data?: any): any; throttleRedraw?: number; timeAxis?: TimelineTimeAxisOption; type?: string;