Is there any way to override a var declaration in d.ts file?
initTaggingControls() {
RTE.CanvasEvents.registerListener(RTE.CanvasEvents.editableRegionChangedEvent, Function.createDelegate(null, this.onCustomTextChanged));
RTE.CanvasEvents.registerListener(RTE.CanvasEvents.editableRegionBlurEvent, Function.createDelegate(null, this.onCustomTextChanged));
RTE.CanvasEvents.registerListener(RTE.CanvasEvents.editableRegionFocusEvent, Function.createDelegate(null, this.onCustomTextChanged));
}
RTE is part of SharePoint. Line declare var RTE: any;
does the trick.
The problem lies in Function.createDelegate
because I cannot declare, or redeclare it.
Function
var is already declared in lib.d.ts.
Is there any way to override var declaration to add custom methods?
Function.createDelegate
is part of Microsoft ajax Library.
I am afraid no. e.g. the following is an error:
declare var String: any;
You can only add features to interfaces / modules. Variables definitions are closed.
I have a work item regarding the same : https://typescript.codeplex.com/workitem/917
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With