@deepkit/framework
Version:
40 lines • 1.4 kB
JavaScript
/*
* Deepkit Framework
* Copyright (C) 2021 Deepkit UG, Marc J. Schmidt
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the MIT License.
*
* You should have received a copy of the MIT License along with this program.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.importedFiles = void 0;
exports.watch = watch;
const events_1 = require("events");
class ImportedFiles extends events_1.EventEmitter {
constructor() {
super(...arguments);
this.files = [];
}
on(event, listener) {
return super.on(event, listener);
}
add(path) {
this.files.push(path);
this.emit('file');
}
}
ImportedFiles.__type = [() => events_1.EventEmitter, 'files', function () { return []; }, "file", 'event', 'args', '', 'listener', 'on', 'path', 'add', 'ImportedFiles', 'P7!&F3">#P.$2%P"@2&$/\'2(!0)P&2*"0+5w,'];
exports.importedFiles = new ImportedFiles();
/**
* Watch files in importedFiles and trigger the callback when change detected
*/
function watch(callback) {
//todo: Watch for changes and callback when detected.
// make sure that files added after this watch function has been called are handled as well
exports.importedFiles.on('file', () => {
});
}
watch.__type = ['', 'callback', 'watch', 'PP$/!2""/#'];
//# sourceMappingURL=watch.js.map
;