AnsweredAssumed Answered

Base constructor must all have the Same return type

Question asked by gis_devteam on Nov 23, 2018

Hi,

 

I am facing  some issues with custom widgets while migrating  ARCGISAPI 4.4 to 4.9.

Currently we are using ARCGIS 4.9 and  dojo 1.11.

 

We have created custom widgets by extending ‘dijit/_WidgetBase’ module as shown in below:

 

/// <reference path="../../../typings/_references.ts" />

 

/// <amd-dependency path="esri/core/tsSupport/declareExtendsHelper" name="__extends" />

/// <amd-dependency path="esri/core/tsSupport/decorateHelper" name="__decorate" />

 

import { subclass, declared } from "esri/core/accessorSupport/decorators";

 

import Evented = require("dojo/Evented");

import _WidgetBase = require("dijit/_WidgetBase");

 

/**

* A view model created to be used with the SmallActionButton widget.

*      The sole purpose is to trigger an 'emit', which is not possible from *.TSX files it seems.

*      The @vmEvent("smallActionButtonClicked") convenience decorator on the widget then pass the emit on to any 'on' handlers that was created.

*/

@subclass("compass.widgets.SmallActionButtonViewModel")

 

class SmallActionButtonViewModel extends declared(_WidgetBase) {

   

    public static actionEventName: string = "smallActionButtonClicked";

 

    /**

     * Initializes this instance.

     */

    constructor() {

        super();

    }

 

    protected action(): void {

        this.emit(SmallActionButtonViewModel.actionEventName, {});

    }

}

 

export = SmallActionButtonViewModel;

 

This code is perfectly running with arcgis 4.4 and dojo 1.9.after changes to 4.9 and dojo 1.11 we are getting error with declared method like “Base constructor must all have the Same return type”. For more details, please refer the attached document.

 

Please assist to resolve this issue.

Outcomes