From 1776215ada3d6127c1c8e5610aa5ba4d944e4e08 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 30 Jan 2020 08:40:11 +0000 Subject: [PATCH] use interface to get autocompletion and types for client-side API --- api/js/etemplate/et2_core_widget.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/js/etemplate/et2_core_widget.ts b/api/js/etemplate/et2_core_widget.ts index 5569ac391a..d3f9075bd5 100644 --- a/api/js/etemplate/et2_core_widget.ts +++ b/api/js/etemplate/et2_core_widget.ts @@ -854,14 +854,14 @@ Comment this out (for now) return true; } - private _egw: object; + private _egw: IegwAppLocal; /** * The egw function returns the instance of the client side api belonging * to this widget tree. The api instance can be set in the "container" * widget using the setApiInstance function. */ - egw() + egw() : IegwAppLocal { // The _egw property is not set if (typeof this._egw === 'undefined') { @@ -889,9 +889,9 @@ Comment this out (for now) * Sets the client side api instance. It can be retrieved by the widget tree * by using the "egw()" function. * - * @param {egw} _egw egw object to set + * @param {IegwAppLocal} _egw egw object to set */ - setApiInstance(_egw) + setApiInstance(_egw : IegwAppLocal) { this._egw = _egw; }