"use strict";
exports.__esModule = true;
exports.testRun = exports.BuildDatabase = exports.MessageType = void 0;
var wrapper = require('bindings')('aslsp-native');
var MessageType;
(function (MessageType) {
    MessageType[MessageType["Error"] = 0] = "Error";
    MessageType[MessageType["Warning"] = 1] = "Warning";
    MessageType[MessageType["Information"] = 2] = "Information";
})(MessageType = exports.MessageType || (exports.MessageType = {}));
function BuildDatabase() {
    return new wrapper.Database();
}
exports.BuildDatabase = BuildDatabase;
function testRun() {
    var db = module.exports.BuildDatabase();
    db.loadScript("m.as", "int foo(){return 10}");
    db.build();
    var messages = db.messages();
    console.log("Build 1");
    for (var i = 0; i < messages.length; i++) {
        console.log(messages[i]);
    }
    db.loadScript("m.as", "int foo(){return 10;}");
    db.build();
    messages = db.messages();
    console.log("Build 2");
    for (var i = 0; i < messages.length; i++) {
        console.log(messages[i]);
    }
    db.reset();
    db.loadScript("m.as", "int foo(){return 10}");
    db.build();
    messages = db.messages();
    console.log("Build 3");
    for (var i = 0; i < messages.length; i++) {
        console.log(messages[i]);
    }
}
exports.testRun = testRun;
