2

I am working on an Durandal spa and would like to write new code in typescript.

Is there a way to mix amd modules with typescript classes? This an example of an amd module. I removed some code from the module to make it more readable.

define(['durandal/app', 'durandal/system', 'config', 'amplify'],
function (app, system, config, amplify) {

    var exports = {};

    var init = function () {
        ...
    };

    var onRequestError = function(response, status) {
        ...
    };

    exports.getTablePresentation = function (lemmaId, languageKey) {
        ...
    };

    exports.getSuggestions = function (searchdirection, term, level) {
        ...
    };

    init();

    return exports;
});

I am using VS Code as my editor. In tsconfig.json I have set allowJs = true and this is the import syntax I am trying to use.

import * as config from '../config.js';
export class AppSecurity {}
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.