define(["require", "exports", "inversify", "wed", "@wedxml/ajax-saver", "@wedxml/base-saver/tokens", "@wedxml/common/tokens", "@wedxml/default-runtime", "@wedxml/trivial-grammar-loader", "wed"], function (require, exports, inversify_1, wed_1, ajax_saver_1, tokens_1, tokens_2, default_runtime_1, trivial_grammar_loader_1, wed_2) {
    "use strict";
    function __export(m) {
        for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
    }
    Object.defineProperty(exports, "__esModule", { value: true });
    // It is important to reexport everything from wed because modes need to be able
    // to get what wed exports. Since this file becomes the entry point of the
    // bundle, we must reexport everything.
    __export(wed_2);
    // There are many ways this could be implemented. We export a makeEditor
    // function which takes parameters that are liable to change from case to case.
    function makeEditor(wedroot, options, saverOptions) {
        // You must create an InversifyJS container.
        const container = new inversify_1.Container();
        // The EDITOR_WIDGET is the DOM element that the editor will take over. This
        // binding is mandatory.
        container.bind(tokens_2.EDITOR_WIDGET).toConstantValue(wedroot);
        // EDITOR_OPTIONS are the options to pass to the editor that will be
        // created. This binding is mandatory.
        container.bind(tokens_2.EDITOR_OPTIONS).toConstantValue(options);
        // This editor will use an AjaxSaver object to save. The SAVER and
        // SAVER_OPTIONS bindings are mandatory.
        container.bind(tokens_2.SAVER).to(ajax_saver_1.AjaxSaver);
        container.bind(tokens_1.SAVER_OPTIONS).toConstantValue(saverOptions);
        // GRAMMAR_LOADER is the object we use to load Relax NG grammars. It is
        // mandatory.
        container.bind(tokens_2.GRAMMAR_LOADER).to(trivial_grammar_loader_1.TrivialGrammarLoader);
        // RUNTIME is mandatory. You'll typically use DefaultRuntime for this.
        container.bind(tokens_2.RUNTIME).to(default_runtime_1.DefaultRuntime);
        // You must call this function to bind the editor class to the container.
        wed_1.bindEditor(container);
        // And this is how you get a new editor that you can use.
        return container.get(tokens_2.EDITOR_INSTANCE);
    }
    exports.makeEditor = makeEditor;
});
//# sourceMappingURL=entry.js.map