I've been trying to contribute to excellent DefinitelyTyped repository of TypeScript.
I encountered an unusual function declaration in WinJS though and wondered what the most succinct TypeScript definition would be for the function, so that the compiler won't complain and Visual Studio Intellisense works correctly.
The method I don't know how to translate to a TypeScript definition/stub is render.value (MSDN):
template.render.value(href, dataContext, container)
Most functions are easy to translate, but the function on the function, value, I don't know how to represent cleanly/correctly.
So far, I've got this for the Template class (MSDN), I just want it to be complete:
class Template {
public element: HTMLElement;
public extractChild: boolean;
public processTimeout: number;
public debugBreakOnRender: boolean;
public disableOptimizedProcessing: boolean;
public isDeclarativeControlContainer: boolean;
public bindingInitializer: any;
constructor(element: HTMLElement, options?: any);
public render(dataContext: any, container?: HTMLElement): WinJS.Promise<any>;
public renderItem(item: any, recycled?: HTMLElement);
// public render.value( ***TODO
}
renderreturns aPromise(I'm using it). I understand that functions can't be named that way. It's a function declared on a function in JavaScript. The WinJS library has the function. I didn't create it.