7.15.8 • Published 5 years ago

mendix-client v7.15.8

Weekly downloads
294
License
Apache-2.0
Repository
github
Last release
5 years ago

Mendix Client API Type definition

This type definition is based on the Mendix client API documentation

https://apidocs.mendix.com/7/client/

Installation

npm install --save-dev mendix-client

  • Add to your tsconfig.json
{
    "compilerOptions": {
        "types": [ "mendix-client" ]
    }
}

Usage

Typescript sample works as a Mendix Dojo widget

import * as dojoDeclare from "dojo/_base/declare";
import * as WidgetBase from "mxui/widget/_WidgetBase";

export class MyWidget extends WidgetBase {
    // Properties from Mendix modeler
    private message: string; 
    // Don`t assign default values, as the constructor will never be executed
    // alternative set them in the postCreate
    // private info: "Hello World"; 
    
    postCreate() {
        console.log("We have a widget ", this.message);
    }

    update(object: mendix.lib.MxObject, callback?: Function) {
        console.log("We have a context", object);

        if (callback) {
            callback();
        }
    }
}

dojoDeclare("com.mendix.widget.mywidget.MyWidget", [ WidgetBase ], (function(Source: any) {
    const result: any = {};
    for (const i in Source.prototype) {
        if (i !== "constructor" && Source.prototype.hasOwnProperty(i)) {
            result[i] = Source.prototype[i];
        }
    }
    return result;
}(MyWidget)));

More info about the Dojo declare hack for TypesScript: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/dojo/README.md

Dependency

7.15.8

5 years ago

7.15.7

5 years ago

7.15.6

5 years ago

7.15.5

5 years ago

7.15.4

5 years ago

7.15.3

6 years ago

7.15.2

6 years ago

7.15.1

6 years ago

7.15.0

6 years ago

7.14.0

6 years ago

7.13.5

6 years ago

7.13.4

6 years ago

7.13.3

6 years ago

7.13.2

6 years ago

7.13.1

6 years ago

7.6.5

6 years ago

7.6.4

6 years ago

7.6.3

7 years ago

7.6.2

7 years ago

7.6.1

7 years ago

7.6.0

7 years ago

7.4.1

7 years ago